// 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
require({cache:{"jimu/dijit/LayerChooserFromMapLite":function(){define("dojo/on dojo/_base/declare dojo/promise/all dojo/_base/lang dojo/_base/html dojo/_base/array jimu/dijit/CheckBox jimu/dijit/LayerChooserFromMap jimu/LayerStructure".split(" "),function(r,G,I,y,h,k,l,n,t){var v=G([n],{templateString:'\x3cdiv style\x3d"width:100%;"\x3e\x3cdiv data-dojo-attach-point\x3d"errorTipSection" class\x3d"error-tip-section"\x3e\x3cspan class\x3d"jimu-icon jimu-icon-error"\x3e\x3c/span\x3e\x3cspan class\x3d"jimu-state-error-text" data-dojo-attach-point\x3d"errTip"\x3e${nls.noLayersTip}\x3c/span\x3e\x3c/div\x3e\x3cdiv data-dojo-attach-point\x3d"treeSection" class\x3d"tree-section"\x3e\x3cul data-dojo-attach-point\x3d"treeUl" class\x3d"tree-ul tree-root-ul"\x3e\x3c/ul\x3e\x3c/div\x3e\x3c/div\x3e',
map:null,layerStateController:null,layerState:null,customFilter:null,onlySelectLeafLayer:!1,displayLayerTypeIcon:!0,showTables:!0,viewMode:!1,onlyShowWebMapLayers:!1,layerStructure:null,_layerDatas:null,_eventHandles:null,postMixInProperties:function(){this.nls=window.jimuNls.basicLayerChooserFromMap},postCreate:function(){h.addClass(this.domNode,"jimu-basic-layer-chooser-from-map");h.addClass(this.domNode,"jimu-basic-layer-chooser-from-map-lite");this._layerDatas={};this._eventHandles=[];this.layerStructure=
this.map?t.createInstance(this.map):t.getInstance();this.layerInfosObj=this.layerStructure._layerInfos;this.layerState=this._clearLayerState(this.layerState)||{};this.layerStateController||(this.layerStateController=new v.LayerStateController);var d=this.customFilter?y.hitch(this,this.customFilter):y.hitch(this,this.filter);this.filter=n.andCombineFilters([this.basicFilter,d]);this._createTree()},_createTree:function(){if(this.onlyShowWebMapLayers){var d=this.layerStructure.getWebmapLayerNodes();
var b=this.layerStructure.getWebmapTableNodes()}else d=this.layerStructure.getLayerNodes(),b=this.layerStructure.getTableNodes();0<this._createLayerNodes(d.concat(this.showTables?b:[]),this.treeUl)&&(h.setStyle(this.errorTipSection,"display","none"),this.layerStateController.restoreState(this.layerState,this.layerStructure))},_createLayerNodes:function(d,b){var e=k.map(d,function(B){return this.filter(B._layerInfo)},this),g=0;I(e).then(y.hitch(this,function(B){k.forEach(B,function(A,D){A&&(this._createLayerNode(d[D],
b),g++)},this)}));return g},_createLayerNode:function(d,b){var e=h.create("li",{"class":"tree-node-li",id:"layerchooserlite-tree-node-li-"+d.id},b),g=h.create("div",{"class":"tree-node-div"},e);b=h.create("span",{"class":"tree-node-column-span collapse-span"},g);var B=h.create("span",{"class":"tree-node-column-span check-box-span"},g);B=h.create("div",{"class":"tree-node-column-div check-box-div"},B);var A=h.create("span",{"class":"tree-node-column-span icon-span "+(this.displayLayerTypeIcon?"display":
"")},g);var D=(D=this.layerState[d.id])?D.selected:this.layerStateController.getState(d);D=new l({checked:D},B);var p=h.create("span",{"class":"tree-node-column-span title-span",innerHTML:d.title},g),w=h.create("ul",{"class":"tree-ul tree-subnode-ul",style:"display:none; "},e);e={layerNode:d,layerNodeLi:e,layerNodeDiv:g,collapseSpan:b,iconSpan:A,checkBox:D,subLayerNodeUl:w,hasBeenOpened:!1};this._layerDatas[d.id]=e;d.isLeaf()||(h.addClass(b,"is-leaf"),h.addClass(p,"is-leaf"),d=r(b,"click",y.hitch(this,
this._onCollapse,e)),this._eventHandles.push(d),d=r(p,"click",y.hitch(this,this._onCollapse,e)),this._eventHandles.push(d),this.onlySelectLeafLayer&&(D.setStatus(!1),h.setStyle(B,"display","none")));!0===this.viewMode&&D.setStatus(!1);d=r(D.domNode,"click",y.hitch(this,this._onCheckBoxChange,e));this._eventHandles.push(d);this._setIconImage(e,!1);return e},_setIconImage:function(d,b){if(this.displayLayerTypeIcon){var e=d.layerNode,g=e.getLayerType(),B=e.getLayerObject();I({layerType:g,layerObject:B}).then(y.hitch(this,
function(A){if(A.layerType&&A.layerObject){var D={type:A.layerType,layerInfo:e._layerInfo};A=window.location.protocol+"//"+window.location.host+require.toUrl("jimu");(D=this._getIconInfo(D,b).imageName)&&h.setStyle(d.iconSpan,"background-image","url("+A+"/css/images/"+D+")")}}))}},_getCheckBoxValue:function(d){return d.getStatus()?d.getValue():!1},_clearLayerState:function(d){var b={};d&&this.layerStructure.traversal(y.hitch(this,function(e){d[e.id]&&(b[e.id]={selected:d[e.id].selected})}));return b},
_selectOrDeselectLayer:function(d,b){if(d=this._layerDatas[d])d.checkBox.setValue(b),this._onCheckBoxChange(d)},selectLayer:function(d){this._selectOrDeselectLayer(d,!0)},deselectLayer:function(d){this._selectOrDeselectLayer(d,!1)},getState:function(){var d=y.clone(this.layerState),b;for(b in this._layerDatas)this._layerDatas.hasOwnProperty(b)&&"function"!==typeof this._layerDatas[b]&&(this._getCheckBoxValue(this._layerDatas[b].checkBox)?d[b]={selected:!0}:d[b]={selected:!1});return d},restoreState:function(d){this.layerState=
this._clearLayerState(d);for(var b in this._layerDatas)if(this._layerDatas.hasOwnProperty(b)&&"function"!==typeof this._layerDatas[b]){var e=(d=this._layerDatas[b])&&d.checkBox,g=this.layerState[b];g?e.setValue(g.selected):e.setValue(this.layerStateController.getState(d.layerNode))}this.layerStateController.restoreState(this.layerState,this.layerStructure)},setViewMode:function(d){for(var b in this._layerDatas)if(this._layerDatas.hasOwnProperty(b)&&"function"!==typeof this._layerDatas[b]){var e=this._layerDatas[b];
e=e&&e.checkBox;!0===d?(this.viewMode=!0,e.setStatus(!1)):(this.viewMode=!1,e.setStatus(!0))}},getSelectedLayerNodes:function(){var d=[],b=this.getState(),e;for(e in b)if(b.hasOwnProperty(e)&&"function"!==typeof b[e]&&b[e].selected){var g=this.layerStructure.getNodeById(e);g&&d.push(g)}return d},getLoadedLayerNodes:function(){var d=[],b;for(b in this._layerDatas)if(this._layerDatas.hasOwnProperty(b)&&"function"!==typeof this._layerDatas[b]){var e=this.layerStructure.getNodeById(b);e&&d.push(e)}return d},
getLayerAssociateDomNodesById:function(d){var b=null;(d=this._layerDatas[d])&&(b={collapseIcon:d.collapseSpan,checkBox:d.checkBox.domNode,layerTypeIcon:d.iconSpan});return b},getSelectedItems:function(){var d=[];return d=k.map(this.getSelectedLayerNodes(),function(b){return{name:b.title,url:b.getUrl(),layerInfo:b._layerInfo}},this)},getAllItems:function(){return[]},_clear:function(){this._layerDatas={};k.forEach(this._eventHandles,function(d){d.remove()},this);this._eventHandles=[];h.empty(this.treeUl)},
destroy:function(){this._clear();this.map&&this.layerStructure.destroy();this.shelter&&(this.shelter.destroy(),this.shelter=null);this.inherited(arguments)},_onCollapse:function(d){var b="none"===h.getStyle(d.subLayerNodeUl,"display")?!0:!1;b?(h.setStyle(d.subLayerNodeUl,"display","block"),h.addClass(d.collapseSpan,"opened")):(h.setStyle(d.subLayerNodeUl,"display","none"),h.removeClass(d.collapseSpan,"opened"));this._setIconImage(d,b);d.hasBeenOpened||(this._createLayerNodes(d.layerNode.getSubNodes(),
d.subLayerNodeUl),d.hasBeenOpened=!0)},_onCheckBoxChange:function(d,b){this.layerStateController.setState(d.layerNode,this._getCheckBoxValue(d.checkBox));this.emit("selection-change",d.layerNode,this._getCheckBoxValue(d.checkBox));this._onTreeClick(d,b)},_onLayerInfosChanged:function(){this._createTree();this.emit("update")},_onLayerInfosIsShowInMapChanged:function(){this._createTree();this.emit("update")},_onTreeClick:function(d,b){d={name:d.layerNode.title||"",parent:null,layerInfo:d.layerNode._layerInfo,
type:null,layerClass:null,id:null,isLeaf:d.layerNode.isLeaf(),hasChildren:d.layerNode.isLeaf()?!1:!0};this.emit("tree-click",d,null,b)}});v.LayerStateController=G(null,{getState:function(d){return!0},setState:function(d,b){return this},restoreState:function(d,b){return this}});v.LayerVisibilityStateController=G(v.LayerStateController,{getState:function(d){return d.isToggledOn()},setState:function(d,b){d.toggle();return this},restoreState:function(d,b){var e={layerOptions:{}},g;for(g in d)d.hasOwnProperty(g)&&
"function"!==typeof d[g]&&(e.layerOptions[g]={visible:d[g].selected});b.restoreState(e);return this}});v.layerVisibilityStateController=new v.LayerVisibilityStateController;v.LayerLegendStateController=G(v.LayerStateController,{getState:function(d){return d.isShowLegend()}});v.layerLegendStateController=new v.LayerLegendStateController;return v})},"jimu/dijit/LayerChooserFromMap":function(){define("dojo/on dojo/Evented dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/store/Memory dojo/Deferred dojo/store/Observable dijit/tree/ObjectStoreModel dojo/promise/all dojo/_base/lang dojo/_base/html dojo/_base/array jimu/utils jimu/dijit/_Tree jimu/LayerInfos/LayerInfos jimu/dijit/LoadingIndicator".split(" "),
function(r,G,I,y,h,k,l,n,t,v,d,b,e,g,B,A,D,p){var w=I([y,h,k,G],{templateString:'\x3cdiv style\x3d"width:100%;"\x3e\x3cdiv data-dojo-attach-point\x3d"errorTipSection" class\x3d"error-tip-section"\x3e\x3cspan class\x3d"jimu-icon jimu-icon-error"\x3e\x3c/span\x3e\x3cspan class\x3d"jimu-state-error-text" data-dojo-attach-point\x3d"errTip"\x3e${nls.noLayersTip}\x3c/span\x3e\x3c/div\x3e\x3c/div\x3e',_store:null,_id:0,_treeClass:"layer-chooser-tree",createMapResponse:null,multiple:!1,onlyShowVisible:!1,
updateWhenLayerInfosIsShowInMapChanged:!1,onlyShowWebMapLayers:!1,displayTooltipForTreeNode:!1,onlyFilterCurrentLayerWhenAddItem:!1,postMixInProperties:function(){this.nls=window.jimuNls.basicLayerChooserFromMap},postCreate:function(){this.inherited(arguments);e.addClass(this.domNode,"jimu-basic-layer-chooser-from-map");this.multiple=!!this.multiple;this.shelter=new p({hidden:!0});this.shelter.placeAt(this.domNode);this.shelter.startup();this._createTree();this.basicFilter=b.hitch(this,this.basicFilter);
this.filter=w.andCombineFilters([this.basicFilter,this.filter]);this.createMapResponse&&this.setCreateMapResponse(this.createMapResponse)},basicFilter:function(f){var m=new n;this.onlyShowVisible?m.resolve(f.isShowInMap()):m.resolve(!0);return m},filter:function(f){f=new n;f.resolve(!0);return f},getSelectedItems:function(){var f=this.tree.getSelectedItems();return g.map(f,b.hitch(this,function(m){return this.getHandledItem(m)}))},getAllItems:function(){var f=this.tree.getAllItems(),m=[];g.forEach(f,
b.hitch(this,function(x){"root"!==x.id&&(x=this.getHandledItem(x),m.push(x))}));return m},getHandledItem:function(f){return{name:f.name,layerInfo:f.layerInfo}},_isLeafItem:function(f){return f.isLeaf},setCreateMapResponse:function(f){this.createMapResponse=f;D.getInstance(this.createMapResponse.map,this.createMapResponse.itemInfo).then(b.hitch(this,function(m){this.layerInfosObj=m;this.own(r(this.layerInfosObj,"layerInfosChanged",b.hitch(this,this._onLayerInfosChanged)));this.updateWhenLayerInfosIsShowInMapChanged&&
this.own(r(this.layerInfosObj,"layerInfosIsShowInMapChanged",b.hitch(this,this._onLayerInfosIsShowInMapChanged)));this._buildTree(this.layerInfosObj)}))},_onLayerInfosChanged:function(f,m){this._buildTree(this.layerInfosObj);this.emit("update")},_onLayerInfosIsShowInMapChanged:function(f){this._buildTree(this.layerInfosObj);this.emit("update")},_buildTree:function(f){this._clear();e.setStyle(this.errorTipSection,"display","block");var m=[];this.onlyShowWebMapLayers?(m=f.getLayerInfoArrayOfWebmap(),
m=m.concat(f.getTableInfoArrayOfWebmap())):(m=f.getLayerInfoArray(),m=m.concat(f.getTableInfoArray()));0!==m.length&&(e.setStyle(this.errorTipSection,"display","none"),g.forEach(m,b.hitch(this,function(x){this._addDirectLayerInfo(x)})))},_addDirectLayerInfo:function(f){f&&f.getLayerObject().then(b.hitch(this,function(){this._addItem("root",f)}),b.hitch(this,function(m){console.error(m)}))},_clear:function(){var f=this._store.query({parent:"root"});g.forEach(f,b.hitch(this,function(m){m&&"root"!==
m.id&&this._store.remove(m.id)}))},_addItem:function(f,m){var x=null,z=m.getLayerType(),H=this.filter(m);d({layerType:z,valid:H}).then(b.hitch(this,function(E){if(E.valid){var L=b.hitch(this,function(P,T){this._id++;x={name:m.title||"",parent:f,layerInfo:m,type:E.layerType,layerClass:m.layerObject.declaredClass,id:this._id.toString(),isLeaf:P,hasChildren:T};this._store.add(x)}),F=m.getSubLayers(),J=0===F.length,Q=!0;this.onlyFilterCurrentLayerWhenAddItem?(J&&(Q=!1),L(J,Q)):J?L(J,!1):(F=g.map(F,b.hitch(this,
function(P){return this.filter(P)})),d(F).then(b.hitch(this,function(P){(P=g.some(P,function(T){return T}))&&L(J,P)})))}}))},_getRootItem:function(){return{id:"root",name:"Map Root",type:"root",isLeaf:!1,hasChildren:!0}},_createTree:function(){var f=this._getRootItem();f=new l({data:[f],getChildren:function(m){return this.query({parent:m.id})}});this._store=new t(f);f=new v({store:this._store,query:{id:"root"},mayHaveChildren:b.hitch(this,this._mayHaveChildren)});this.tree=new A({multiple:this.multiple,
model:f,showRoot:!1,isLeafItem:b.hitch(this,this._isLeafItem),style:{width:"100%"},onOpen:b.hitch(this,function(m,x){"root"!==m.id&&this._onTreeOpen(m,x)}),onClick:b.hitch(this,function(m,x,z){this._onTreeClick(m,x,z);this.emit("tree-click",m,x,z)}),getIconStyle:b.hitch(this,function(m,x){var z=null;if(!m||"root"===m.id)return null;var H={width:"20px",height:"20px",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundImage:""},E=window.location.protocol+"//"+window.location.host+
require.toUrl("jimu");if(m=this._getIconInfo(m,x).imageName)H.backgroundImage="url("+E+"/css/images/"+m+")",z=H;return z}),getIconClass:b.hitch(this,function(m,x){return this._getIconInfo(m,x).className}),getTooltip:b.hitch(this,function(m){return this.displayTooltipForTreeNode?m.layerInfo.title:""})});e.addClass(this.tree.domNode,this._treeClass);this.tree.placeAt(this.shelter.domNode,"before")},_mayHaveChildren:function(f){return f.hasChildren},_getIconInfo:function(f,m){var x="",z="";"ArcGISDynamicMapServiceLayer"===
f.type||"ArcGISTiledMapServiceLayer"===f.type?m?(x="mapserver_open.png",z="mapservice-layer-icon open"):(x="mapserver_close.png",z="mapservice-layer-icon close"):"GroupLayer"===f.type?m?(x="group_layer2.png",z="group-layer-icon open"):(x="group_layer1.png",z="group-layer-icon close"):"FeatureLayer"===f.type?(f=B.getTypeByGeometryType(f.layerInfo.layerObject.geometryType),"point"===f?(x="point_layer1.png",z="point-layer-icon"):"polyline"===f?(x="line_layer1.png",z="line-layer-icon"):"polygon"===f&&
(x="polygon_layer1.png",z="polygon-layer-icon")):"Table"===f.type?(x="table.png",z="table-icon"):"ArcGISImageServiceLayer"===f.type||"ArcGISImageServiceVectorLayer"===f.type?(x="image_layer.png",z="iamge-layer-icon"):m?(x="mapserver_open.png",z="mapservice-layer-icon open"):(x="mapserver_close.png",z="mapservice-layer-icon close");return{imageName:x,className:z}},_onTreeOpen:function(f,m){if("root"!==f.id){var x=[];m=[];x=f.layerInfo.getSubLayers();f.checked||(this.shelter.show(),m=g.map(x,b.hitch(this,
function(z){return z.getLayerObject()})),d(m).then(b.hitch(this,function(){this.domNode&&(g.forEach(x,b.hitch(this,function(z){this._addItem(f.id,z)})),f.checked=!0,this.shelter.hide())}),b.hitch(this,function(z){console.error(z);this.shelter.hide()})))}},_onTreeClick:function(f,m,x){},destroy:function(){this.shelter&&(this.shelter.destroy(),this.shelter=null);this.tree&&this.tree.destroy();this.inherited(arguments)}});w.createFilterByLayerType=function(f){b.isArrayLike(f)||(f=[]);return function(m){var x=
new n;if(0===f.length)x.resolve(!0);else{var z=[];m.traversal(function(H){z.push(H.getLayerType())});d(z).then(function(H){for(var E=0;E<H.length;E++)for(var L=0;L<f.length;L++)if(H[E]===f[L]){x.resolve(!0);return}x.resolve(!1)},function(H){console.error(H);x.reject(H)})}return x}};w.createFeaturelayerFilter=function(f,m,x,z){var H=["point","polyline","polygon"];f&&0<f.length?(f=g.filter(f,function(E){return 0<=H.indexOf(E)}),0===f.length&&(f=H)):f=H;return function(E){var L=E.getLayerType();E=E.getLayerObject();
return d({layerType:L,layerObject:E}).then(function(F){var J=F.layerType;F=F.layerObject;if("ArcGISDynamicMapServiceLayer"===J||"ArcGISTiledMapServiceLayer"===J||"GroupLayer"===J||"FeatureCollection"===J)return!0;if("FeatureLayer"===J){J=B.getTypeByGeometryType(F.geometryType);J=0<=g.indexOf(f,J);var Q=w._shouldPassStatisticsCheck(z,F);return F.url?(F=B.isFeaturelayerUrlSupportQuery(F.url,F.capabilities),J&&F&&Q):m&&J}return"Table"===J?(J=B.isFeaturelayerUrlSupportQuery(F.url,F.capabilities),F=w._shouldPassStatisticsCheck(z,
F),x&&J&&F):!1})}};w.createImageServiceLayerFilter=function(f,m){return function(x){var z=x.getLayerType();x=x.getLayerObject();return d({layerType:z,layerObject:x}).then(function(H){var E=H.layerType,L=H.layerObject;return"ArcGISImageServiceLayer"===E||"ArcGISImageServiceVectorLayer"===E?f?B.isImageServiceSupportQuery(H.layerObject.capabilities)?m?w._shouldPassStatisticsCheck(m,L):!0:!1:!0:!1})}};w._shouldPassStatisticsCheck=function(f,m){return f?(f=!1,f=m.advancedQueryCapabilities?!!m.advancedQueryCapabilities.supportsStatistics:
!!m.supportsStatistics):!0};w.createQueryableLayerFilter=function(f){var m=w.createFeaturelayerFilter(["point","polyline","polygon"],!1,!0,f);f=w.createImageServiceLayerFilter(!0,f);return w.orCombineFilters([m,f])};w.andCombineFilters=function(f){return w._combineFilters(f,!0)};w.orCombineFilters=function(f){return w._combineFilters(f,!1)};w._combineFilters=function(f,m){return function(x){var z=new n,H=g.map(f,function(E){return E(x)});d(H).then(function(E){var L=!1;L=m?g.every(E,function(F){return F}):
g.some(E,function(F){return F});z.resolve(L)},function(E){console.error(E);z.reject(E)});return z}};return w})},"dijit/tree/ObjectStoreModel":function(){define("dojo/_base/array dojo/aspect dojo/_base/declare dojo/Deferred dojo/_base/lang dojo/when ../Destroyable".split(" "),function(r,G,I,y,h,k,l){return I("dijit.tree.ObjectStoreModel",l,{store:null,labelAttr:"name",labelType:"text",root:null,query:null,constructor:function(n){h.mixin(this,n);this.childrenCache={}},getRoot:function(n,t){if(this.root)n(this.root);
else{var v=this.store.query(this.query);v.then&&this.own(v);k(v,h.hitch(this,function(d){if(1!=d.length)throw Error("dijit.tree.ObjectStoreModel: root query returned "+d.length+" items, but must return exactly one");this.root=d[0];n(this.root);v.observe&&v.observe(h.hitch(this,function(b){this.onChange(b)}),!0)}),t)}},mayHaveChildren:function(){return!0},getChildren:function(n,t,v){var d=this.store.getIdentity(n);if(this.childrenCache[d])k(this.childrenCache[d],t,v);else{var b=this.childrenCache[d]=
this.store.getChildren(n);b.then&&this.own(b);b.observe&&this.own(b.observe(h.hitch(this,function(e,g,B){this.onChange(e);g!=B&&k(b,h.hitch(this,"onChildrenChange",n))}),!0));k(b,t,v)}},isItem:function(){return!0},getIdentity:function(n){return this.store.getIdentity(n)},getLabel:function(n){return n[this.labelAttr]},newItem:function(n,t,v,d){return this.store.put(n,{parent:t,before:d})},pasteItem:function(n,t,v,d,b,e){var g=new y;if(t===v&&!d&&!e)return g.resolve(!0),g;t&&!d?this.getChildren(t,h.hitch(this,
function(B){B=[].concat(B);var A=r.indexOf(B,n);B.splice(A,1);this.onChildrenChange(t,B);g.resolve(this.store.put(n,{overwrite:!0,parent:v,oldParent:t,before:e,isCopy:!1}))})):g.resolve(this.store.put(n,{overwrite:!0,parent:v,oldParent:t,before:e,isCopy:!0}));return g},onChange:function(){},onChildrenChange:function(){},onDelete:function(){}})})},"jimu/dijit/_Tree":function(){define("dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dojo/text!./templates/_TreeNode.html dojo/_base/lang dojo/_base/html dojo/_base/array dojo/_base/event dojo/query dojo/aspect dojo/on dojo/keys dojo/Evented dijit/registry dijit/Tree jimu/utils".split(" "),
function(r,G,I,y,h,k,l,n,t,v,d,b,e,g,B,A){var D=r([B._TreeNode,e],{templateString:y,declaredClass:"jimu._TreeNode",isLeaf:!1,groupId:"",postCreate:function(){this.inherited(arguments);k.addClass(this.domNode,"jimu-tree-node");this.isLeaf=!!this.isLeaf;this.groupId?(this.checkNode=k.toDom('\x3cinput type\x3d"radio" /\x3e'),this.checkNode.name=this.groupId):this.checkNode=k.toDom('\x3cinput type\x3d"checkbox" /\x3e');k.addClass(this.checkNode,"jimu-tree-check-node");k.place(this.checkNode,this.contentNode,
"first");this.own(d(this.checkNode,"click",h.hitch(this,this._onClick)));this.own(d(this.rowNode,"keydown",h.hitch(this,function(p,w){w.target=p;w.keyCode!==b.ENTER&&w.keyCode!==b.SPACE||this._onClick(w)},this.checkNode)));this.isLeaf?this.groupId?k.setStyle(this.checkNode,"display","none"):k.setStyle(this.checkNode,"display","inline"):k.setStyle(this.checkNode,"display","none");this.isLeaf?k.addClass(this.domNode,"jimu-tree-leaf-node"):k.addClass(this.domNode,"jimu-tree-not-leaf-node")},select:function(){this.isLeaf&&
(this.checkNode.checked=!0,k.addClass(this.domNode,"jimu-tree-selected-leaf-node"))},unselect:function(){this.isLeaf&&(this.checkNode.checked=!1,k.removeClass(this.domNode,"jimu-tree-selected-leaf-node"))},toggleSelect:function(){this.isLeaf&&(this.checkNode.checked?this.unselect():this.select())},_onClick:function(p){(p.target||p.srcElement)===this.checkNode?this.tree._onCheckNodeClick(this,this.checkNode.checked,p):this.tree._onClick(this,p)},_onChange:function(){this.isLeaf&&setTimeout(h.hitch(this,
function(){this.checkNode.checked?this.emit("tn-select",this):this.emit("tn-unselect",this)}),100)},destroy:function(){delete this.tree;this.inherited(arguments)}});return r([B,e],{declaredClass:"jimu._Tree",openOnClick:!0,multiple:!0,uniqueId:"",showRoot:!1,postMixInProperties:function(){this.inherited(arguments);this.uniqueId="tree_"+A.getRandomString()},postCreate:function(){this.inherited(arguments);k.addClass(this.domNode,"jimu-tree");this.own(v.before(this,"onClick",h.hitch(this,this._jimuBeforeClick)));
this.rootLoadingIndicator&&k.setStyle(this.rootLoadingIndicator,"display","none");this.dndController.singular=!0;k.setAttr(this.domNode,"tabindex",0)},removeItem:function(p){this.model.store.remove(p)},getAllItems:function(){var p=this.getAllTreeNodeWidgets();return l.map(p,h.hitch(this,function(w){var f=w.item;f.selected=w.checkNode.checked;return f}))},getSelectedItems:function(){var p=this.getAllTreeNodeWidgets();p=l.filter(p,h.hitch(this,function(w){return w.checkNode.checked}));return l.map(p,
h.hitch(this,function(w){return w.item}))},getFilteredItems:function(p){var w=this.getAllTreeNodeWidgets();w=l.map(w,h.hitch(this,function(f){var m=f.item;m.selected=f.checkNode.checked;return m}));return l.filter(w,h.hitch(this,function(f){return p(f)}))},getTreeNodeByItemId:function(p){for(var w=this._getAllTreeNodeDoms(),f=0;f<w.length;f++){var m=g.byNode(w[f]);if(m.item.id.toString()===p.toString())return m}return null},selectItem:function(p){(p=this.getTreeNodeByItemId(p))&&p.isLeaf&&this.selectNodeWidget(p)},
unselectItem:function(p){(p=this.getTreeNodeByItemId(p))&&p.isLeaf&&p.unselect()},getAllLeafTreeNodeWidgets:function(){var p=this.getAllTreeNodeWidgets();return l.filter(p,h.hitch(this,function(w){return w.isLeaf}))},getAllTreeNodeWidgets:function(){var p=this._getAllTreeNodeDoms();return l.map(p,h.hitch(this,function(w){return g.byNode(w)}))},isLeafItem:function(p){return p&&p.isLeaf},_getAllTreeNodeDoms:function(){return t(".dijitTreeNode",this.domNode)},_createTreeNode:function(p){p.isLeaf=this.isLeafItem(p.item);
this.multiple||(p.groupId=this.uniqueId);return new D(p)},_onTreeNodeSelect:function(p){this.emit("item-select",{item:p.item,treeNode:p})},_onTreeNodeUnselect:function(p){this.emit("item-unselect",{item:p.item,treeNode:p})},selectNodeWidget:function(p){this.multiple||this.unselectAllLeafNodeWidgets();p.select()},_jimuBeforeClick:function(p,w,f){w.isLeaf&&(k.hasClass(f.target||f.srcElement,"jimu-tree-check-node")||(this.multiple?w.toggleSelect():this.selectNodeWidget(w)));return arguments},_onCheckNodeClick:function(p,
w,f){!this.multiple&&w&&this.unselectAllLeafNodeWidgets();n.stop(f);this.focusNode(p);setTimeout(h.hitch(this,function(){w?this.selectNodeWidget(p):p.unselect();this.onClick(p.item,p,f)}),0)},unselectAllLeafNodeWidgets:function(){var p=this.getAllLeafTreeNodeWidgets();l.forEach(p,h.hitch(this,function(w){w.unselect()}))}})})},"dijit/Tree":function(){define("dojo/_base/array dojo/aspect dojo/cookie dojo/_base/declare dojo/Deferred dojo/promise/all dojo/dom dojo/dom-class dojo/dom-geometry dojo/dom-style dojo/errors/create dojo/fx dojo/has dojo/_base/kernel dojo/keys dojo/_base/lang dojo/on dojo/topic dojo/touch dojo/when ./a11yclick ./focus ./registry ./_base/manager ./_Widget ./_TemplatedMixin ./_Container ./_Contained ./_CssStateMixin ./_KeyNavMixin dojo/text!./templates/TreeNode.html dojo/text!./templates/Tree.html ./tree/TreeStoreModel ./tree/ForestStoreModel ./tree/_dndSelector dojo/query!css2".split(" "),
function(r,G,I,y,h,k,l,n,t,v,d,b,e,g,B,A,D,p,w,f,m,x,z,H,E,L,F,J,Q,P,T,Z,da,aa,ba){function N(a){return A.delegate(a.promise||a,{addCallback:function(c){this.then(c)},addErrback:function(c){this.otherwise(c)}})}var Y=y("dijit._TreeNode",[E,L,F,J,Q],{item:null,isTreeNode:!0,label:"",_setLabelAttr:function(a){this.labelNode["html"==this.labelType?"innerHTML":"innerText"in this.labelNode?"innerText":"textContent"]=a;this._set("label",a);e("dojo-bidi")&&this.applyTextDir(this.labelNode)},labelType:"text",
isExpandable:null,isExpanded:!1,state:"NotLoaded",templateString:T,baseClass:"dijitTreeNode",cssStateNodes:{rowNode:"dijitTreeRow"},_setTooltipAttr:{node:"rowNode",type:"attribute",attribute:"title"},buildRendering:function(){this.inherited(arguments);this._setExpando();this._updateItemClasses(this.item);this.isExpandable&&this.labelNode.setAttribute("aria-expanded",this.isExpanded);this.setSelected(!1)},_setIndentAttr:function(a){var c=Math.max(a,0)*this.tree._nodePixelIndent+"px";v.set(this.domNode,
"backgroundPosition",c+" 0px");v.set(this.rowNode,this.isLeftToRight()?"paddingLeft":"paddingRight",c);r.forEach(this.getChildren(),function(q){q.set("indent",a+1)});this._set("indent",a)},markProcessing:function(){this.state="Loading";this._setExpando(!0)},unmarkProcessing:function(){this._setExpando(!1)},_updateItemClasses:function(a){var c=this.tree,q=c.model;c._v10Compat&&a===q.root&&(a=null);this._applyClassAndStyle(a,"icon","Icon");this._applyClassAndStyle(a,"label","Label");this._applyClassAndStyle(a,
"row","Row");this.tree._startPaint(!0)},_applyClassAndStyle:function(a,c,q){var u="_"+c+"Class";c+="Node";var C=this[u];this[u]=this.tree["get"+q+"Class"](a,this.isExpanded);n.replace(this[c],this[u]||"",C||"");v.set(this[c],this.tree["get"+q+"Style"](a,this.isExpanded)||{})},_updateLayout:function(){var a=this.getParent();a=!a||!a.rowNode||"none"==a.rowNode.style.display;n.toggle(this.domNode,"dijitTreeIsRoot",a);n.toggle(this.domNode,"dijitTreeIsLast",!a&&!this.getNextSibling())},_setExpando:function(a){var c=
["dijitTreeExpandoLoading","dijitTreeExpandoOpened","dijitTreeExpandoClosed","dijitTreeExpandoLeaf"];a=a?0:this.isExpandable?this.isExpanded?1:2:3;n.replace(this.expandoNode,c[a],c);this.expandoNodeText.innerHTML=["*","-","+","*"][a]},expand:function(){if(this._expandDeferred)return N(this._expandDeferred);this._collapseDeferred&&(this._collapseDeferred.cancel(),delete this._collapseDeferred);this.isExpanded=!0;this.labelNode.setAttribute("aria-expanded","true");(this.tree.showRoot||this!==this.tree.rootNode)&&
this.containerNode.setAttribute("role","group");n.add(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);this==this.tree.rootNode&&this.tree.showRoot&&this.tree.domNode.setAttribute("aria-expanded","true");var a=b.wipeIn({node:this.containerNode,duration:H.defaultDuration}),c=this._expandDeferred=new h(function(){a.stop()});G.after(a,"onEnd",function(){c.resolve(!0)},!0);a.play();return N(c)},collapse:function(){if(this._collapseDeferred)return N(this._collapseDeferred);
this._expandDeferred&&(this._expandDeferred.cancel(),delete this._expandDeferred);this.isExpanded=!1;this.labelNode.setAttribute("aria-expanded","false");this==this.tree.rootNode&&this.tree.showRoot&&this.tree.domNode.setAttribute("aria-expanded","false");n.remove(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);var a=b.wipeOut({node:this.containerNode,duration:H.defaultDuration}),c=this._collapseDeferred=new h(function(){a.stop()});G.after(a,"onEnd",
function(){c.resolve(!0)},!0);a.play();return N(c)},indent:0,setChildItems:function(a){var c=this.tree,q=c.model,u=[],C=c.focusedChild,U=this.getChildren();r.forEach(U,function(K){F.prototype.removeChild.call(this,K)},this);this.defer(function(){r.forEach(U,function(K){if(!K._destroyed&&!K.getParent()){c.dndController.removeTreeNode(K);(function ca(M){var V=q.getIdentity(M.item),X=c._itemNodesMap[V];1==X.length?delete c._itemNodesMap[V]:(V=r.indexOf(X,M),-1!=V&&X.splice(V,1));r.forEach(M.getChildren(),
ca)})(K);if(c.persist){var R=r.map(K.getTreePath(),function(M){return c.model.getIdentity(M)}).join("/"),O;for(O in c._openedNodes)O.substr(0,R.length)==R&&delete c._openedNodes[O];c._saveExpandedNodes()}c.lastFocusedChild&&!l.isDescendant(c.lastFocusedChild.domNode,c.domNode)&&delete c.lastFocusedChild;C&&!l.isDescendant(C.domNode,c.domNode)&&c.focus();K.destroyRecursive()}})});this.state="Loaded";a&&0<a.length?(this.isExpandable=!0,r.forEach(a,function(K){var R=q.getIdentity(K),O=c._itemNodesMap[R];
if(O)for(var W=0;W<O.length;W++)if(O[W]&&!O[W].getParent()){var M=O[W];M.set("indent",this.indent+1);break}M||(M=this.tree._createTreeNode({item:K,tree:c,isExpandable:q.mayHaveChildren(K),label:c.getLabel(K),labelType:c.model&&c.model.labelType||"text",tooltip:c.getTooltip(K),ownerDocument:c.ownerDocument,dir:c.dir,lang:c.lang,textDir:c.textDir,indent:this.indent+1}),O?O.push(M):c._itemNodesMap[R]=[M]);this.addChild(M);(this.tree.autoExpand||this.tree._state(M))&&u.push(c._expandNode(M))},this),r.forEach(this.getChildren(),
function(K){K._updateLayout()})):this.isExpandable=!1;this._setExpando&&this._setExpando(!1);this._updateItemClasses(this.item);a=k(u);this.tree._startPaint(a);return N(a)},getTreePath:function(){for(var a=this,c=[];a&&a!==this.tree.rootNode;)c.unshift(a.item),a=a.getParent();c.unshift(this.tree.rootNode.item);return c},getIdentity:function(){return this.tree.model.getIdentity(this.item)},removeChild:function(a){this.inherited(arguments);var c=this.getChildren();0==c.length&&(this.isExpandable=!1,
this.collapse());r.forEach(c,function(q){q._updateLayout()})},makeExpandable:function(){this.isExpandable=!0;this._setExpando(!1)},setSelected:function(a){this.labelNode.setAttribute("aria-selected",a?"true":"false");n.toggle(this.rowNode,"dijitTreeRowSelected",a)},focus:function(){x.focus(this.focusNode)}});e("dojo-bidi")&&Y.extend({_setTextDirAttr:function(a){!a||this.textDir==a&&this._created||(this._set("textDir",a),this.applyTextDir(this.labelNode),r.forEach(this.getChildren(),function(c){c.set("textDir",
a)},this))}});var S=y("dijit.Tree",[E,P,L,Q],{baseClass:"dijitTree",store:null,model:null,query:null,label:"",showRoot:!0,childrenAttr:["children"],paths:[],path:[],selectedItems:null,selectedItem:null,openOnClick:!1,openOnDblClick:!1,templateString:Z,persist:!1,autoExpand:!1,dndController:ba,dndParams:"onDndDrop itemCreator onDndCancel checkAcceptance checkItemAcceptance dragThreshold betweenThreshold".split(" "),onDndDrop:null,itemCreator:null,onDndCancel:null,checkAcceptance:null,checkItemAcceptance:null,
dragThreshold:5,betweenThreshold:0,_nodePixelIndent:19,_publish:function(a,c){p.publish(this.id,A.mixin({tree:this,event:a},c||{}))},postMixInProperties:function(){this.tree=this;this.autoExpand&&(this.persist=!1);this._itemNodesMap={};!this.cookieName&&this.id&&(this.cookieName=this.id+"SaveStateCookie");this.expandChildrenDeferred=new h;this.pendingCommandsPromise=this.expandChildrenDeferred.promise;this.inherited(arguments)},postCreate:function(){this._initState();var a=this;this.own(D(this.containerNode,
D.selector(".dijitTreeNode",w.enter),function(u){a._onNodeMouseEnter(z.byNode(this),u)}),D(this.containerNode,D.selector(".dijitTreeNode",w.leave),function(u){a._onNodeMouseLeave(z.byNode(this),u)}),D(this.containerNode,D.selector(".dijitTreeRow",m.press),function(u){a._onNodePress(z.getEnclosingWidget(this),u)}),D(this.containerNode,D.selector(".dijitTreeRow",m),function(u){a._onClick(z.getEnclosingWidget(this),u)}),D(this.containerNode,D.selector(".dijitTreeRow","dblclick"),function(u){a._onDblClick(z.getEnclosingWidget(this),
u)}));this.model||this._store2model();this.own(G.after(this.model,"onChange",A.hitch(this,"_onItemChange"),!0),G.after(this.model,"onChildrenChange",A.hitch(this,"_onItemChildrenChange"),!0),G.after(this.model,"onDelete",A.hitch(this,"_onItemDelete"),!0));this.inherited(arguments);if(this.dndController){A.isString(this.dndController)&&(this.dndController=A.getObject(this.dndController));for(var c={},q=0;q<this.dndParams.length;q++)this[this.dndParams[q]]&&(c[this.dndParams[q]]=this[this.dndParams[q]]);
this.dndController=new this.dndController(this,c)}this._load();this.onLoadDeferred=N(this.pendingCommandsPromise);this.onLoadDeferred.then(A.hitch(this,"onLoad"))},_store2model:function(){this._v10Compat=!0;g.deprecated("Tree: from version 2.0, should specify a model object rather than a store/query");var a={id:this.id+"_ForestStoreModel",store:this.store,query:this.query,childrenAttrs:this.childrenAttr};this.params.mayHaveChildren&&(a.mayHaveChildren=A.hitch(this,"mayHaveChildren"));this.params.getItemChildren&&
(a.getChildren=A.hitch(this,function(c,q,u){this.getItemChildren(this._v10Compat&&c===this.model.root?null:c,q,u)}));this.model=new aa(a);this.showRoot=!!this.label},onLoad:function(){},_load:function(){this.model.getRoot(A.hitch(this,function(a){var c=this.rootNode=this.tree._createTreeNode({item:a,tree:this,isExpandable:!0,label:this.label||this.getLabel(a),labelType:this.model.labelType||"text",textDir:this.textDir,indent:this.showRoot?0:-1});this.showRoot?(this.domNode.setAttribute("aria-multiselectable",
!this.dndController.singular),this.rootLoadingIndicator.style.display="none"):(c.rowNode.style.display="none",this.domNode.setAttribute("role","presentation"),this.domNode.removeAttribute("aria-expanded"),this.domNode.removeAttribute("aria-multiselectable"),this["aria-label"]?(c.containerNode.setAttribute("aria-label",this["aria-label"]),this.domNode.removeAttribute("aria-label")):this["aria-labelledby"]&&(c.containerNode.setAttribute("aria-labelledby",this["aria-labelledby"]),this.domNode.removeAttribute("aria-labelledby")),
c.labelNode.setAttribute("role","presentation"),c.labelNode.removeAttribute("aria-selected"),c.containerNode.setAttribute("role","tree"),c.containerNode.setAttribute("aria-expanded","true"),c.containerNode.setAttribute("aria-multiselectable",!this.dndController.singular));this.containerNode.appendChild(c.domNode);a=this.model.getIdentity(a);this._itemNodesMap[a]?this._itemNodesMap[a].push(c):this._itemNodesMap[a]=[c];c._updateLayout();this._expandNode(c).then(A.hitch(this,function(){this._destroyed||
(this.rootLoadingIndicator.style.display="none",this.expandChildrenDeferred.resolve(!0))}))}),A.hitch(this,function(a){console.error(this,": error loading root: ",a)}))},getNodesByItem:function(a){if(!a)return[];a=A.isString(a)?a:this.model.getIdentity(a);return[].concat(this._itemNodesMap[a])},_setSelectedItemAttr:function(a){this.set("selectedItems",[a])},_setSelectedItemsAttr:function(a){var c=this;return this.pendingCommandsPromise=this.pendingCommandsPromise.always(A.hitch(this,function(){var q=
r.map(a,function(C){return!C||A.isString(C)?C:c.model.getIdentity(C)}),u=[];r.forEach(q,function(C){u=u.concat(c._itemNodesMap[C]||[])});this.set("selectedNodes",u)}))},_setPathAttr:function(a){return a.length?N(this.set("paths",[a]).then(function(c){return c[0]})):N(this.set("paths",[]).then(function(c){return c[0]}))},_setPathsAttr:function(a){function c(u,C){var U=u.shift(),K=r.filter(C,function(R){return R.getIdentity()==U})[0];if(K)return u.length?q._expandNode(K).then(function(){return c(u,
K.getChildren())}):K;throw new S.PathError("Could not expand path at "+U);}var q=this;return N(this.pendingCommandsPromise=this.pendingCommandsPromise.always(function(){return k(r.map(a,function(u){u=r.map(u,function(C){return C&&A.isObject(C)?q.model.getIdentity(C):C});if(u.length)return c(u,[q.rootNode]);throw new S.PathError("Empty path");}))}).then(function(u){q.set("selectedNodes",u);return q.paths}))},_setSelectedNodeAttr:function(a){this.set("selectedNodes",[a])},_setSelectedNodesAttr:function(a){this.dndController.setSelection(a)},
expandAll:function(){function a(q){return c._expandNode(q).then(function(){var u=r.filter(q.getChildren()||[],function(C){return C.isExpandable});return k(r.map(u,a))})}var c=this;return N(a(this.rootNode))},collapseAll:function(){function a(q){var u=r.filter(q.getChildren()||[],function(C){return C.isExpandable});u=k(r.map(u,a));return!q.isExpanded||q==c.rootNode&&!c.showRoot?u:u.then(function(){return c._collapseNode(q)})}var c=this;return N(a(this.rootNode))},mayHaveChildren:function(){},getItemChildren:function(){},
getLabel:function(a){return this.model.getLabel(a)},getIconClass:function(a,c){return!a||this.model.mayHaveChildren(a)?c?"dijitFolderOpened":"dijitFolderClosed":"dijitLeaf"},getLabelClass:function(){},getRowClass:function(){},getIconStyle:function(){},getLabelStyle:function(){},getRowStyle:function(){},getTooltip:function(){return""},_onDownArrow:function(a,c){(a=this._getNext(c))&&a.isTreeNode&&this.focusNode(a)},_onUpArrow:function(a,c){if(a=c.getPreviousSibling())for(c=a;c.isExpandable&&c.isExpanded&&
c.hasChildren();)c=c.getChildren(),c=c[c.length-1];else if(a=c.getParent(),this.showRoot||a!==this.rootNode)c=a;c&&c.isTreeNode&&this.focusNode(c)},_onRightArrow:function(a,c){c.isExpandable&&!c.isExpanded?this._expandNode(c):c.hasChildren()&&(c=c.getChildren()[0])&&c.isTreeNode&&this.focusNode(c)},_onLeftArrow:function(a,c){c.isExpandable&&c.isExpanded?this._collapseNode(c):(a=c.getParent())&&a.isTreeNode&&(this.showRoot||a!==this.rootNode)&&this.focusNode(a)},focusLastChild:function(){var a=this._getLast();
a&&a.isTreeNode&&this.focusNode(a)},_getFirst:function(){return this.showRoot?this.rootNode:this.rootNode.getChildren()[0]},_getLast:function(){for(var a=this.rootNode;a.isExpanded;){var c=a.getChildren();if(!c.length)break;a=c[c.length-1]}return a},_getNext:function(a){if(a.isExpandable&&a.isExpanded&&a.hasChildren())return a.getChildren()[0];for(;a&&a.isTreeNode;){var c=a.getNextSibling();if(c)return c;a=a.getParent()}return null},childSelector:".dijitTreeRow",isExpandoNode:function(a,c){return l.isDescendant(a,
c.expandoNode)||l.isDescendant(a,c.expandoNodeText)},_onNodePress:function(a,c){this.focusNode(a)},__click:function(a,c,q,u){var C=this.isExpandoNode(c.target,a);a.isExpandable&&(q||C)?this._onExpandoClick({node:a}):(this._publish("execute",{item:a.item,node:a,evt:c}),this[u](a.item,a,c),this.focusNode(a));c.stopPropagation();c.preventDefault()},_onClick:function(a,c){this.__click(a,c,this.openOnClick,"onClick")},_onDblClick:function(a,c){this.__click(a,c,this.openOnDblClick,"onDblClick")},_onExpandoClick:function(a){a=
a.node;this.focusNode(a);a.isExpanded?this._collapseNode(a):this._expandNode(a)},onClick:function(){},onDblClick:function(){},onOpen:function(){},onClose:function(){},_getNextNode:function(a){g.deprecated(this.declaredClass+"::_getNextNode(node) is deprecated. Use _getNext(node) instead.","","2.0");return this._getNext(a)},_getRootOrFirstNode:function(){g.deprecated(this.declaredClass+"::_getRootOrFirstNode() is deprecated. Use _getFirst() instead.","","2.0");return this._getFirst()},_collapseNode:function(a){a._expandNodeDeferred&&
delete a._expandNodeDeferred;if("Loading"!=a.state&&a.isExpanded){var c=a.collapse();this.onClose(a.item,a);this._state(a,!1);this._startPaint(c);return c}},_expandNode:function(a){if(a._expandNodeDeferred)return a._expandNodeDeferred;var c=this.model,q=a.item,u=this;a._loadDeferred||(a.markProcessing(),a._loadDeferred=new h,c.getChildren(q,function(C){a.unmarkProcessing();a.setChildItems(C).then(function(){a._loadDeferred.resolve(C)})},function(C){console.error(u,": error loading "+a.label+" children: ",
C);a._loadDeferred.reject(C)}));c=a._loadDeferred.then(A.hitch(this,function(){var C=a.expand();this.onOpen(a.item,a);this._state(a,!0);return C}));this._startPaint(c);return c},focusNode:function(a){for(var c=[],q=this.domNode;q&&q.tagName&&"IFRAME"!==q.tagName.toUpperCase();q=q.parentNode)c.push({domNode:q.contentWindow||q,scrollLeft:q.scrollLeft||0,scrollTop:q.scrollTop||0});this.focusChild(a);this.defer(function(){for(var u=0,C=c.length;u<C;u++)c[u].domNode.scrollLeft=c[u].scrollLeft,c[u].domNode.scrollTop=
c[u].scrollTop},0)},_onNodeMouseEnter:function(){},_onNodeMouseLeave:function(){},_onItemChange:function(a){var c=this.model.getIdentity(a);if(c=this._itemNodesMap[c]){var q=this.getLabel(a),u=this.getTooltip(a);r.forEach(c,function(C){C.set({item:a,label:q,tooltip:u});C._updateItemClasses(a)})}},_onItemChildrenChange:function(a,c){a=this.model.getIdentity(a);(a=this._itemNodesMap[a])&&r.forEach(a,function(q){q.setChildItems(c)})},_onItemDelete:function(a){a=this.model.getIdentity(a);var c=this._itemNodesMap[a];
c&&(r.forEach(c,function(q){this.dndController.removeTreeNode(q);var u=q.getParent();u&&u.removeChild(q);this.lastFocusedChild&&!l.isDescendant(this.lastFocusedChild.domNode,this.domNode)&&delete this.lastFocusedChild;this.focusedChild&&!l.isDescendant(this.focusedChild.domNode,this.domNode)&&this.focus();q.destroyRecursive()},this),delete this._itemNodesMap[a])},_initState:function(){this._openedNodes={};if(this.persist&&this.cookieName){var a=I(this.cookieName);a&&r.forEach(a.split(","),function(c){this._openedNodes[c]=
!0},this)}},_state:function(a,c){if(!this.persist)return!1;var q=r.map(a.getTreePath(),function(u){return this.model.getIdentity(u)},this).join("/");if(1===arguments.length)return this._openedNodes[q];c?this._openedNodes[q]=!0:delete this._openedNodes[q];this._saveExpandedNodes()},_saveExpandedNodes:function(){if(this.persist&&this.cookieName){var a=[],c;for(c in this._openedNodes)a.push(c);I(this.cookieName,a.join(","),{expires:365})}},destroy:function(){this._curSearch&&(this._curSearch.timer.remove(),
delete this._curSearch);this.rootNode&&this.rootNode.destroyRecursive();this.dndController&&!A.isString(this.dndController)&&this.dndController.destroy();this.rootNode=null;this.inherited(arguments)},destroyRecursive:function(){this.destroy()},resize:function(a){a&&t.setMarginBox(this.domNode,a);this._nodePixelIndent=t.position(this.tree.indentDetector).w||this._nodePixelIndent;this.expandChildrenDeferred.then(A.hitch(this,function(){this.rootNode.set("indent",this.showRoot?0:-1);this._adjustWidths()}))},
_outstandingPaintOperations:0,_startPaint:function(a){this._outstandingPaintOperations++;this._adjustWidthsTimer&&(this._adjustWidthsTimer.remove(),delete this._adjustWidthsTimer);var c=A.hitch(this,function(){this._outstandingPaintOperations--;0>=this._outstandingPaintOperations&&!this._adjustWidthsTimer&&this._started&&(this._adjustWidthsTimer=this.defer("_adjustWidths"))});f(a,c,c)},_adjustWidths:function(){this._adjustWidthsTimer&&(this._adjustWidthsTimer.remove(),delete this._adjustWidthsTimer);
this.containerNode.style.width="auto";this.containerNode.style.width=this.domNode.scrollWidth>this.domNode.offsetWidth?"auto":"100%"},_createTreeNode:function(a){return new Y(a)},focus:function(){this.lastFocusedChild?this.focusNode(this.lastFocusedChild):this.focusFirstChild()}});e("dojo-bidi")&&S.extend({_setTextDirAttr:function(a){a&&this.textDir!=a&&(this._set("textDir",a),this.rootNode.set("textDir",a))}});S.PathError=d("TreePathError");S._TreeNode=Y;return S})},"dijit/tree/TreeStoreModel":function(){define(["dojo/_base/array",
"dojo/aspect","dojo/_base/declare","dojo/_base/lang"],function(r,G,I,y){return I("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:!1,constructor:function(h){y.mixin(this,h);this.connects=[];h=this.store;if(!h.getFeatures()["dojo.data.api.Identity"])throw Error("dijit.tree.TreeStoreModel: store must support dojo.data.Identity");h.getFeatures()["dojo.data.api.Notification"]&&(this.connects=this.connects.concat([G.after(h,
"onNew",y.hitch(this,"onNewItem"),!0),G.after(h,"onDelete",y.hitch(this,"onDeleteItem"),!0),G.after(h,"onSet",y.hitch(this,"onSetItem"),!0)]))},destroy:function(){for(var h;h=this.connects.pop();)h.remove()},getRoot:function(h,k){this.root?h(this.root):this.store.fetch({query:this.query,onComplete:y.hitch(this,function(l){if(1!=l.length)throw Error("dijit.tree.TreeStoreModel: root query returned "+l.length+" items, but must return exactly one");this.root=l[0];h(this.root)}),onError:k})},mayHaveChildren:function(h){return r.some(this.childrenAttrs,
function(k){return this.store.hasAttribute(h,k)},this)},getChildren:function(h,k,l){var n=this.store;if(n.isItemLoaded(h)){for(var t=[],v=0;v<this.childrenAttrs.length;v++){var d=n.getValues(h,this.childrenAttrs[v]);t=t.concat(d)}var b=0;this.deferItemLoadingUntilExpand||r.forEach(t,function(g){n.isItemLoaded(g)||b++});0==b?k(t):r.forEach(t,function(g,B){n.isItemLoaded(g)||n.loadItem({item:g,onItem:function(A){t[B]=A;0==--b&&k(t)},onError:l})})}else{var e=y.hitch(this,arguments.callee);n.loadItem({item:h,
onItem:function(g){e(g,k,l)},onError:l})}},isItem:function(h){return this.store.isItem(h)},fetchItemByIdentity:function(h){this.store.fetchItemByIdentity(h)},getIdentity:function(h){return this.store.getIdentity(h)},getLabel:function(h){return this.labelAttr?this.store.getValue(h,this.labelAttr):this.store.getLabel(h)},newItem:function(h,k,l){var n={parent:k,attribute:this.childrenAttrs[0]},t;this.newItemIdAttr&&h[this.newItemIdAttr]?this.fetchItemByIdentity({identity:h[this.newItemIdAttr],scope:this,
onItem:function(v){v?this.pasteItem(v,null,k,!0,l):(t=this.store.newItem(h,n))&&void 0!=l&&this.pasteItem(t,k,k,!1,l)}}):(t=this.store.newItem(h,n))&&void 0!=l&&this.pasteItem(t,k,k,!1,l)},pasteItem:function(h,k,l,n,t){var v=this.store,d=this.childrenAttrs[0];k&&r.forEach(this.childrenAttrs,function(e){if(v.containsValue(k,e,h)){if(!n){var g=r.filter(v.getValues(k,e),function(B){return B!=h});v.setValues(k,e,g)}d=e}});if(l)if("number"==typeof t){var b=v.getValues(l,d).slice();b.splice(t,0,h);v.setValues(l,
d,b)}else v.setValues(l,d,v.getValues(l,d).concat(h))},onChange:function(){},onChildrenChange:function(){},onDelete:function(){},onNewItem:function(h,k){k&&this.getChildren(k.item,y.hitch(this,function(l){this.onChildrenChange(k.item,l)}))},onDeleteItem:function(h){this.onDelete(h)},onSetItem:function(h,k){if(-1!=r.indexOf(this.childrenAttrs,k))this.getChildren(h,y.hitch(this,function(l){this.onChildrenChange(h,l)}));else this.onChange(h)}})})},"dijit/tree/ForestStoreModel":function(){define(["dojo/_base/array",
"dojo/_base/declare","dojo/_base/kernel","dojo/_base/lang","./TreeStoreModel"],function(r,G,I,y,h){return G("dijit.tree.ForestStoreModel",h,{rootId:"$root$",rootLabel:"ROOT",query:null,constructor:function(k){this.root={store:this,root:!0,id:k.rootId,label:k.rootLabel,children:k.rootChildren}},mayHaveChildren:function(k){return k===this.root||this.inherited(arguments)},getChildren:function(k,l,n){k===this.root?this.root.children?l(this.root.children):this.store.fetch({query:this.query,onComplete:y.hitch(this,
function(t){this.root.children=t;l(t)}),onError:n}):this.inherited(arguments)},isItem:function(k){return k===this.root?!0:this.inherited(arguments)},fetchItemByIdentity:function(k){if(k.identity==this.root.id){var l=k.scope||I.global;k.onItem&&k.onItem.call(l,this.root)}else this.inherited(arguments)},getIdentity:function(k){return k===this.root?this.root.id:this.inherited(arguments)},getLabel:function(k){return k===this.root?this.root.label:this.inherited(arguments)},newItem:function(k,l,n){return l===
this.root?(this.onNewRootItem(k),this.store.newItem(k)):this.inherited(arguments)},onNewRootItem:function(){},pasteItem:function(k,l,n,t,v){if(l===this.root&&!t)this.onLeaveRoot(k);this.inherited(arguments,[k,l===this.root?null:l,n===this.root?null:n,t,v]);if(n===this.root)this.onAddToRoot(k)},onAddToRoot:function(k){console.log(this,": item ",k," added to root")},onLeaveRoot:function(k){console.log(this,": item ",k," removed from root")},_requeryTop:function(){var k=this.root.children||[];this.store.fetch({query:this.query,
onComplete:y.hitch(this,function(l){this.root.children=l;if(k.length!=l.length||r.some(k,function(n,t){return l[t]!=n}))this.onChildrenChange(this.root,l)})})},onNewItem:function(k,l){this._requeryTop();this.inherited(arguments)},onDeleteItem:function(k){-1!=r.indexOf(this.root.children,k)&&this._requeryTop();this.inherited(arguments)},onSetItem:function(k,l,n,t){this._requeryTop();this.inherited(arguments)}})})},"dijit/tree/_dndSelector":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/kernel dojo/_base/lang dojo/dnd/common dojo/dom dojo/mouse dojo/on dojo/touch ../a11yclick ./_dndContainer".split(" "),
function(r,G,I,y,h,k,l,n,t,v,d){return G("dijit.tree._dndSelector",d,{constructor:function(){this.selection={};this.anchor=null;this.events.push(n(this.tree.domNode,t.press,y.hitch(this,"onMouseDown")),n(this.tree.domNode,t.release,y.hitch(this,"onMouseUp")),n(this.tree.domNode,t.move,y.hitch(this,"onMouseMove")),n(this.tree.domNode,v.press,y.hitch(this,"onClickPress")),n(this.tree.domNode,v.release,y.hitch(this,"onClickRelease")))},singular:!1,getSelectedTreeNodes:function(){var b=[],e=this.selection,
g;for(g in e)b.push(e[g]);return b},selectNone:function(){this.setSelection([]);return this},destroy:function(){this.inherited(arguments);this.selection=this.anchor=null},addTreeNode:function(b,e){this.setSelection(this.getSelectedTreeNodes().concat([b]));e&&(this.anchor=b);return b},removeTreeNode:function(b){var e=r.filter(this.getSelectedTreeNodes(),function(g){return!k.isDescendant(g.domNode,b.domNode)});this.setSelection(e);return b},isTreeNodeSelected:function(b){return b.id&&!!this.selection[b.id]},
setSelection:function(b){var e=this.getSelectedTreeNodes();r.forEach(this._setDifference(e,b),y.hitch(this,function(g){g.setSelected(!1);this.anchor==g&&delete this.anchor;delete this.selection[g.id]}));r.forEach(this._setDifference(b,e),y.hitch(this,function(g){g.setSelected(!0);this.selection[g.id]=g}));this._updateSelectionProperties()},_setDifference:function(b,e){r.forEach(e,function(g){g.__exclude__=!0});b=r.filter(b,function(g){return!g.__exclude__});r.forEach(e,function(g){delete g.__exclude__});
return b},_updateSelectionProperties:function(){var b=this.getSelectedTreeNodes(),e=[],g=[];r.forEach(b,function(B){var A=B.getTreePath();g.push(B);e.push(A)},this);b=r.map(g,function(B){return B.item});this.tree._set("paths",e);this.tree._set("path",e[0]||[]);this.tree._set("selectedNodes",g);this.tree._set("selectedNode",g[0]||null);this.tree._set("selectedItems",b);this.tree._set("selectedItem",b[0]||null)},onClickPress:function(b){if(!(this.current&&this.current.isExpandable&&this.tree.isExpandoNode(b.target,
this.current))){"mousedown"==b.type&&l.isLeft(b)&&b.preventDefault();var e="keydown"==b.type?this.tree.focusedChild:this.current;if(e){var g=h.getCopyKeyState(b),B=e.id;this.singular||b.shiftKey||!this.selection[B]?(this._doDeselect=!1,this.userSelect(e,g,b.shiftKey)):this._doDeselect=!0}}},onClickRelease:function(b){this._doDeselect&&(this._doDeselect=!1,this.userSelect("keyup"==b.type?this.tree.focusedChild:this.current,h.getCopyKeyState(b),b.shiftKey))},onMouseMove:function(){this._doDeselect=
!1},onMouseDown:function(){},onMouseUp:function(){},_compareNodes:function(b,e){if(b===e)return 0;if("sourceIndex"in document.documentElement)return b.sourceIndex-e.sourceIndex;if("compareDocumentPosition"in document.documentElement)return b.compareDocumentPosition(e)&2?1:-1;if(document.createRange){var g=doc.createRange();g.setStartBefore(b);b=doc.createRange();b.setStartBefore(e);return g.compareBoundaryPoints(g.END_TO_END,b)}throw Error("dijit.tree._compareNodes don't know how to compare two different nodes in this browser");
},userSelect:function(b,e,g){if(this.singular)this.anchor==b&&e?this.selectNone():(this.setSelection([b]),this.anchor=b);else if(g&&this.anchor){e=this._compareNodes(this.anchor.rowNode,b.rowNode);g=this.anchor;0>e?e=g:(e=b,b=g);for(g=[];e!=b;)g.push(e),e=this.tree._getNext(e);g.push(b);this.setSelection(g)}else this.selection[b.id]&&e?this.removeTreeNode(b):e?this.addTreeNode(b,!0):(this.setSelection([b]),this.anchor=b)},getItem:function(b){return{data:this.selection[b],type:["treeNode"]}},forInSelectedItems:function(b,
e){e=e||I.global;for(var g in this.selection)b.call(e,this.getItem(g),g,this)}})})},"dijit/tree/_dndContainer":function(){define("dojo/aspect dojo/_base/declare dojo/dom-class dojo/_base/lang dojo/on dojo/touch".split(" "),function(r,G,I,y,h,k){return G("dijit.tree._dndContainer",null,{constructor:function(l,n){this.tree=l;this.node=l.domNode;y.mixin(this,n);this.containerState="";I.add(this.node,"dojoDndContainer");this.events=[h(this.node,k.enter,y.hitch(this,"onOverEvent")),h(this.node,k.leave,
y.hitch(this,"onOutEvent")),r.after(this.tree,"_onNodeMouseEnter",y.hitch(this,"onMouseOver"),!0),r.after(this.tree,"_onNodeMouseLeave",y.hitch(this,"onMouseOut"),!0),h(this.node,"dragstart, selectstart",function(t){t.preventDefault()})]},destroy:function(){for(var l;l=this.events.pop();)l.remove();this.node=this.parent=null},onMouseOver:function(l){this.current=l},onMouseOut:function(){this.current=null},_changeState:function(l,n){var t="dojoDnd"+l;l=l.toLowerCase()+"State";I.replace(this.node,t+
n,t+this[l]);this[l]=n},_addItemClass:function(l,n){I.add(l,"dojoDndItem"+n)},_removeItemClass:function(l,n){I.remove(l,"dojoDndItem"+n)},onOverEvent:function(){this._changeState("Container","Over")},onOutEvent:function(){this._changeState("Container","")}})})},"widgets/Legend/setting/_build-generate_module":function(){define(["dojo/text!./Setting.html","dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"url:jimu/dijit/templates/_TreeNode.html":'\x3cdiv class\x3d"dijitTreeNode" role\x3d"presentation"\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"rowNode" class\x3d"dijitTreeRow" role\x3d"presentation"\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"expandoNode" class\x3d"dijitInline dijitTreeExpando" role\x3d"presentation"\x3e\x3c/span\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"expandoNodeText" class\x3d"dijitExpandoText" role\x3d"presentation"\x3e\x3c/span\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"contentNode" class\x3d"dijitTreeContent" role\x3d"presentation"\x3e\r\n\t\t\t\x3cspan role\x3d"presentation" class\x3d"dijitInline dijitIcon dijitTreeIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"labelNode,focusNode" class\x3d"dijitTreeLabel" role\x3d"treeitem" tabindex\x3d"-1" aria-selected\x3d"false"\x3e\x3c/span\x3e\r\n\t\t\x3c/span\x3e\r\n\t\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitTreeNodeContainer" role\x3d"presentation" style\x3d"display: none;"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:dijit/templates/TreeNode.html":'\x3cdiv class\x3d"dijitTreeNode" role\x3d"presentation"\r\n\t\x3e\x3cdiv data-dojo-attach-point\x3d"rowNode" class\x3d"dijitTreeRow" role\x3d"presentation"\r\n\t\t\x3e\x3cspan data-dojo-attach-point\x3d"expandoNode" class\x3d"dijitInline dijitTreeExpando" role\x3d"presentation"\x3e\x3c/span\r\n\t\t\x3e\x3cspan data-dojo-attach-point\x3d"expandoNodeText" class\x3d"dijitExpandoText" role\x3d"presentation"\x3e\x3c/span\r\n\t\t\x3e\x3cspan data-dojo-attach-point\x3d"contentNode"\r\n\t\t\tclass\x3d"dijitTreeContent" role\x3d"presentation"\x3e\r\n\t\t\t\x3cspan role\x3d"presentation" class\x3d"dijitInline dijitIcon dijitTreeIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\r\n\t\t\t\x3e\x3cspan data-dojo-attach-point\x3d"labelNode,focusNode" class\x3d"dijitTreeLabel" role\x3d"treeitem"\r\n\t\t\t\t   tabindex\x3d"-1" aria-selected\x3d"false" id\x3d"${id}_label"\x3e\x3c/span\x3e\r\n\t\t\x3c/span\r\n\t\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitTreeNodeContainer" role\x3d"presentation"\r\n\t\t style\x3d"display: none;" aria-labelledby\x3d"${id}_label"\x3e\x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:dijit/templates/Tree.html":'\x3cdiv role\x3d"tree"\x3e\r\n\t\x3cdiv class\x3d"dijitInline dijitTreeIndent" style\x3d"position: absolute; top: -9999px" data-dojo-attach-point\x3d"indentDetector"\x3e\x3c/div\x3e\r\n\t\x3cdiv class\x3d"dijitTreeExpando dijitTreeExpandoLoading" data-dojo-attach-point\x3d"rootLoadingIndicator"\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitTreeContainer" role\x3d"presentation"\x3e\r\n\t\x3c/div\x3e\r\n\x3c/div\x3e\r\n',"url:widgets/Legend/setting/Setting.html":'\x3cdiv style\x3d"width:100%;height:100%;"\x3e\r\n  \x3cdiv class\x3d"settings-section" data-dojo-attach-point\x3d"searchesSection"\x3e\r\n    \x3ctable class\x3d"setting-table input-table" cellspacing\x3d"0"\x3e\r\n      \x3ctbody\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first"\x3e${nls.arrangement}\x3c/td\x3e\r\n          \x3ctd class\x3d"second"\x3e\r\n            \x3cselect style\x3d"margin-left: 0px;" data-dojo-attach-point\x3d"selectArrangement" data-dojo-type\x3d"dijit/form/Select"\x3e\r\n              \x3coption value\x3d"0"\x3e${nls.left}\x3c/option\x3e\r\n              \x3coption value\x3d"1"\x3e${nls.right}\x3c/option\x3e\r\n            \x3c/select\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n      \x3c/tbody\x3e\r\n    \x3c/table\x3e\r\n    \x3ctable class\x3d"setting-table checkbox-table" cellspacing\x3d"0"\x3e\r\n      \x3ctbody\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first"\x3e\r\n            \x3cdiv style\x3d"margin-right: 0px;" data-dojo-attach-point\x3d"autoUpdate" \r\n              data-dojo-type\x3d"jimu/dijit/CheckBox"/\x3e\x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"second"\x3e${nls.autoUpdate}\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first"\x3e\r\n            \x3cdiv style\x3d"margin-right: 0px;" data-dojo-attach-point\x3d"respectCurrentMapScale" \r\n            data-dojo-type\x3d"jimu/dijit/CheckBox"/\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"second"\x3e${nls.respectCurrentMapScale}\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first"\x3e\r\n            \x3cdiv style\x3d"margin-right: 0px;" data-dojo-attach-point\x3d"showLegendForBasemap" \r\n            data-dojo-type\x3d"jimu/dijit/CheckBox"/\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"second"\x3e${nls.showBasemapLegends}\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n      \x3c/tbody\x3e\r\n    \x3c/table\x3e\r\n    \r\n\r\n\r\n    \x3cdiv class\x3d"layer-chooser-section" data-dojo-attach-point\x3d"layerChooserSection"\x3e\r\n      \x3c!--div class\x3d"overlap"\x3e\x3c/div\x3e\r\n      \x3cdiv class\x3d"toggle-button-div" data-dojo-attach-point\x3d"toggleButtonDiv"\x3eusing webmap\'s config?????\x3c/div\x3e\r\n      \x3cdiv class\x3d"refresh-button-div responisve-overlap" data-dojo-attach-point\x3d"refreshButtonDiv" data-dojo-attach-event\x3d"click:_onRefreshButtonClick"\x3erefresh from webmap??????\x3c/div\x3e\r\n      \x3cspan class\x3d"layer-chooser-title responisve-overlap"\x3e${nls.layerSelectorTitle}\x3c/span--\x3e\r\n\r\n      \x3cdiv class\x3d"layer-chooser-title-div" data-dojo-attach-point\x3d"layerSelectorTitleDiv"\x3e\r\n        \x3cdiv class\x3d"title"\x3e${nls.showLegendsForLayers}\x3c/div\x3e\r\n        \x3cdiv class\x3d"honorWebMap"\x3e\r\n          \x3cdiv data-dojo-attach-point\x3d"syncWithWebmapToggle" label\x3d\'${nls.honorTheWebMapSetting}\' data-dojo-type\x3d"jimu/dijit/CheckBox"/\x3e\x3c/div\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"layer-chooser-div" data-dojo-attach-point\x3d"layerChooserDiv"\x3e\r\n        \x3cdiv class\x3d"refresh-button-div" data-dojo-attach-point\x3d"refreshButtonDiv" data-dojo-attach-event\x3d"click:_onRefreshButtonClick" title\x3d\'${nls.resetTip}\'\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/Legend/setting/css/style.css":".jimu-widget-legend-setting{margin:0; padding:0; font-size:15px;}.jimu-widget-legend-setting .dijitArrowButtonContainer{width: 17px;}.jimu-widget-legend-setting .dijitSelect{height: 30px; width: 100%;}.jimu-widget-legend-setting .setting-table \x3e thead \x3e tr \x3e th,.jimu-widget-legend-setting .setting-table \x3e tbody \x3e tr \x3e td{height:40px;}.jimu-widget-legend-setting .input-table \x3e tbody \x3e tr \x3e .first{width:auto;}.jimu-widget-legend-setting .input-table \x3e tbody \x3e tr \x3e .second{width:200px; padding: 0 10px 0 10px;}.jimu-widget-legend-setting .input-table \x3e tbody \x3e tr \x3e .third{width:35px;}.jimu-widget-legend-setting .checkbox-table \x3e tbody \x3e tr \x3e .first{padding-top: 5px;}.jimu-widget-legend-setting .checkbox-table \x3e tbody \x3e tr \x3e .second{padding: 0 10px 0 10px;}.jimu-widget-legend-setting .layer-chooser-section{position: relative; margin-top: 20px;}.jimu-widget-legend-setting .layer-chooser-section .layer-chooser-title-div {overflow: hidden;}.jimu-widget-legend-setting .layer-chooser-section .layer-chooser-title-div .title{float: left;}}.jimu-rtl .jimu-widget-legend-setting .input-table \x3e tbody \x3e tr \x3e .first{}.jimu-widget-legend-setting .input-table \x3e tbody \x3e tr \x3e .second{width:200px;}.jimu-widget-legend-setting .input-table \x3e tbody \x3e tr \x3e .third{width:35px;}.jimu-widget-legend-setting .checkbox-table \x3e tbody \x3e tr \x3e .first{padding-top: 5px;}.jimu-widget-legend-setting .checkbox-table \x3e tbody \x3e tr \x3e .second{padding: 0 10px 0 10px;}.jimu-widget-legend-setting .layer-chooser-section{position: relative; margin-top: 20px;}.jimu-widget-legend-setting .layer-chooser-section .layer-chooser-title-div {overflow: hidden;}.jimu-widget-legend-setting .layer-chooser-section .layer-chooser-title-div .title{float: left;}.jimu-rtl .jimu-widget-legend-setting .layer-chooser-section .layer-chooser-title-div .title{float: right;}.jimu-widget-legend-setting .layer-chooser-section .layer-chooser-title-div .honorWebMap{float: right;}.jimu-rtl .jimu-widget-legend-setting .layer-chooser-section .layer-chooser-title-div .honorWebMap{float: left;}.jimu-widget-legend-setting .layer-chooser-section .layer-chooser-title-div .honorWebMap .checkbox{float: right !important;}.jimu-rtl .jimu-widget-legend-setting .layer-chooser-section .layer-chooser-title-div .honorWebMap .checkbox{float: left !important;}.jimu-widget-legend-setting .layer-chooser-div{border: 1px solid #d9dde0; min-height: 130px; max-height: 410px; overflow-y: auto; position: relative;}.jimu-widget-legend-setting .layer-chooser-section .refresh-button-div{position: absolute; top: 0; right: 0; background-image: url(./images/reset.svg); background-repeat: no-repeat; background-position: center center; height: 30px; width: 30px; z-index: 1; cursor: pointer;}.jimu-rtl .jimu-widget-legend-setting .layer-chooser-section .refresh-button-div{left: 0; right: auto;}.jimu-widget-legend-setting .layer-chooser-section .tree-root-ul{border: 0px solid #d9dde0;}",
"*now":function(r){r(['dojo/i18n!*preload*widgets/Legend/setting/nls/Setting*["ar","bs","ca","cs","da","de","en","el","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nb","nl","pl","pt-br","pt-pt","ro","ru","sk","sl","sr","sv","th","tr","zh-cn","uk","vi","zh-hk","zh-tw","ROOT"]'])},"*noref":1}});
define("dojo/_base/declare dojo/_base/array dojo/_base/html dojo/_base/lang dojo/Deferred dojo/on jimu/BaseWidgetSetting jimu/dijit/LayerChooserFromMapLite jimu/LayerInfos/LayerInfos dijit/_WidgetsInTemplateMixin dijit/form/NumberTextBox dijit/form/CheckBox".split(" "),function(r,G,I,y,h,k,l,n,t,v){return r([l,v],{baseClass:"jimu-widget-legend-setting",startup:function(){this.inherited(arguments);this.config.legend||(this.config.legend={});this.setConfig(this.config)},setConfig:function(d){this.config=
d;void 0!==d.legend.arrangement&&this.selectArrangement.set("value",d.legend.arrangement);this.autoUpdate.setValue(d.legend.autoUpdate);this.respectCurrentMapScale.setValue(d.legend.respectCurrentMapScale);this.showLegendForBasemap.setValue(d.showLegendForBasemap);this._setLayerChooser(this.config.layerState);this.syncWithWebmapToggle.setValue(d.syncWithWebmap);d.syncWithWebmap&&(this._setLayerChooser(null),this.layerChooser.setViewMode(!0));this.own(k(this.syncWithWebmapToggle,"change",y.hitch(this,
this._onSyncWithWebmapToggleChange)))},getConfig:function(){this.config.legend.arrangement=parseInt(this.selectArrangement.get("value"),10);this.config.legend.autoUpdate=this.autoUpdate.checked;this.config.legend.respectCurrentMapScale=this.respectCurrentMapScale.checked;this.config.showLegendForBasemap=this.showLegendForBasemap.checked;this.config.syncWithWebmap=this.syncWithWebmapToggle.checked;this.config.syncWithWebmap||(this.config.layerState=this.layerChooser.getState());return this.config},
_setLayerChooser:function(d){this.layerChooser?this.layerChooser.restoreState(d):(this.layerChooser=new n({customFilter:function(b){var e=new h,g=null;b.isTable?e.resolve(!1):b.isRootLayer()?e.resolve(!0):(g=b.getRootLayerInfo())&&g.layerObject&&("esri.layers.ArcGISDynamicMapServiceLayer"===g.layerObject.declaredClass||"esri.layers.ArcGISTiledMapServiceLayer"===g.layerObject.declaredClass||"esri.layers.FeatureCollection"===g.layerObject.declaredClass)?e.resolve(!0):e.resolve(!1);return e},layerState:d,
layerStateController:n.layerLegendStateController,onlyShowWebMapLayers:!0,onlySelectLeafLayer:!0}),this.layerChooser.placeAt(this.layerChooserDiv));this._updateLayerChooserUI()},_updateLayerChooserUI:function(){var d=t.getInstanceSync();G.forEach(d.getLayerInfoArray(),function(b){b&&b.layerObject&&"esri.layers.ArcGISDynamicMapServiceLayer"!==b.layerObject.declaredClass&&"esri.layers.ArcGISTiledMapServiceLayer"!==b.layerObject.declaredClass&&"esri.layers.FeatureCollection"!==b.layerObject.declaredClass&&
(b=this.layerChooser.getLayerAssociateDomNodesById(b.id))&&b.collapseIcon&&I.setStyle(b.collapseIcon,"background-image","none")},this)},_onSyncWithWebmapToggleChange:function(d){d?(this._setLayerChooser(null),this.layerChooser.setViewMode(!0)):(this.layerChooser.setViewMode(!1),this._setLayerChooser(this.config.layerState))},_onRefreshButtonClick:function(){this.syncWithWebmapToggle.checked||this._setLayerChooser()}})});