// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
define(["dojo/_base/declare","dojo/_base/html","dojo/query","dojo/_base/array","jimu/utils"],function(u,a,v,m,w){return u("jimu-bind-label-props-mixin",null,{isRenderIdForAttrs:!1,buildRendering:function(){this.inherited(arguments);if(this.isRenderIdForAttrs){var c=v("[data-a11y-label-id],[data-a11y-label-by], [data-label-for], [data-label-id]",this.domNode);(a.getAttr(this.domNode,"data-a11y-label-id")||a.getAttr(this.domNode,"data-a11y-label-by")||a.getAttr(this.domNode,"data-label-for")||a.getAttr(this.domNode,
"data-label-id"))&&c.unshift(this.domNode);var n={},k=[],d={},g=0,p="jimuUniqName_"+w.getUUID();m.forEach(c,function(b){var q=a.getAttr(b,"data-a11y-label-id"),x=a.getAttr(b,"data-a11y-label-by"),h=a.getAttr(b,"data-label-for"),l=a.getAttr(b,"data-label-id");q?(a.removeAttr(b,"data-a11y-label-id"),e=p+"_"+g,a.setAttr(b,"id",e),n[q]=e,g++):x?k.push(b):h?(d.hasOwnProperty(h)||(d[h]={}),d[h].forDom=b):(d.hasOwnProperty(l)||(d[l]={}),d[l].idDom=b)});for(var f in k){c=k[f];var y=a.getAttr(c,"data-a11y-label-by").split(" "),
r=[];m.forEach(y,function(b){r.push(n[b])});a.removeAttr(c,"data-a11y-label-by");a.setAttr(c,"aria-labelledby",r.join(" "))}for(var t in d){var e=p+"_"+g;f=d[t].forDom;c=d[t].idDom;f&&(a.removeAttr(f,"data-label-for"),a.setAttr(f,"for",e));c&&(a.removeAttr(c,"data-label-id"),a.setAttr(c,"id",e));g++}}}})});