{"size": 3416, "ext": "js", "max_stars_repo_path": "arcgisapi/Clatsop County Parcel Viewer/widgets/AddData/search/LayerListPane.js", "max_stars_repo_name": "brian32768/map46", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "arcgisapi/Clatsop County Parcel Viewer/widgets/AddData/search/LayerListPane.js", "max_issues_repo_name": "brian32768/map46", "max_issues_repo_issues_event_min_datetime": "2020-04-30T00:06:00.000Z", "max_issues_repo_issues_event_max_datetime": "2020-04-30T00:06:00.000Z", "max_forks_repo_path": "arcgisapi/Clatsop County Parcel Viewer/widgets/AddData/search/LayerListPane.js", "max_forks_repo_name": "brian32768/map46", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 379.5555555556, "max_line_length": 741, "alphanum_fraction": 0.7327283372}
// 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:{"url:widgets/AddData/search/templates/LayerListPane.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"add-data-layerlist--mask"\x3e\x3c/div\x3e\r\n  \x3cdiv class\x3d"add-data-layerlist--container" data-dojo-attach-point\x3d"_container"\x3e\r\n    \x3ch2 data-dojo-attach-point\x3d"_title"\x3e\x3c/h2\x3e\r\n    \x3cdiv data-dojo-attach-point\x3d"_layerlist"\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"add-data-layerlist--footer jimu-widget-add-data-footer" data-dojo-attach-point\x3d"_footer"\x3e\r\n    \x3ca href\x3d"#" class\x3d"back-button" data-dojo-attach-point\x3d"_backButton"\x3e\r\n      ${i18n.layerList.back}\x3ci class\x3d"esri-icon-collapse"\x3e\x3c/i\x3e\r\n    \x3c/a\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n'}});
define("dojo/_base/declare dojo/_base/array dojo/on dojo/dom-class dojo/dom-construct dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./templates/LayerListPane.html dojo/i18n!../nls/strings ./util".split(" "),function(l,k,m,g,d,n,p,q,r,h,t){return l([n,p,q],{i18n:h,templateString:r,wabWidget:null,baseClass:"add-data-widget-layers",postCreate:function(){this.inherited(arguments)},startup:function(){this._started||(this._buildList(),this._initListeners(),this.inherited(arguments))},
_addLayer:function(a,c){var b=this,f=this._getLayerTitle(c),e=d.create("div",{"class":"add-data-layerlist--listitem"},a);d.create("A",{"class":"remove-button",href:"#",innerHTML:"\x3cspan class\x3d'esri-icon-trash'\x3e\x3c/span\x3e",title:h.layerList.removeLayer,onclick:function(a){a.preventDefault();try{b.wabWidget&&b.wabWidget.map&&(b.wabWidget.map.removeLayer(c),d.destroy(e))}catch(u){console.warn("Error removing layer."),console.warn(u)}}},e);var v=d.create("label",{"class":"layer-name"},e);t.setNodeText(v,
f)},_buildList:function(){var a=this,c=!1,b=[],f=this.wabWidget.map,e=d.create("div",{"class":"add-data-layerlist--list"});k.forEach(f.layerIds,function(a){b.push(a)});k.forEach(f.graphicsLayerIds,function(a){b.push(a)});b.reverse();k.forEach(b,function(b){(b=f.getLayer(b))&&b.xtnAddData&&(c=!0,a._addLayer(e,b))});return c?e:d.create("div",{"class":"no-data-message",innerHTML:h.layerList.noLayersAdded})},_getLayerTitle:function(a){var c="...";if("string"===typeof a.label&&0<a.label.length)c=a.label;
else if("string"===typeof a.title&&0<a.title.length)c=a.title;else if("string"===typeof a.name&&0<a.name.length)c=a.name;else if(a.url){var b=a.url.indexOf("/FeatureServer");-1===b&&(b=a.url.indexOf("/MapServer"));-1===b&&(b=a.url.indexOf("/ImageServer"));-1===b&&(b=a.url.indexOf("/service"));-1<b&&(a=a.url.substring(0,b),c=a=a.substring(a.lastIndexOf("/")+1,a.length))}return c},_initListeners:function(){var a=this;this.own(m(this._backButton,"click",function(c){c.preventDefault();a.hide()}))},show:function(){var a=
this._buildList();this._title.innerHTML=h.layerList.caption;this._layerlist.innerHTML="";a&&a.tagName&&this._layerlist.appendChild(a);this.wabWidget&&this.wabWidget.domNode&&g.add(this.wabWidget.domNode,"layerlist-show");g.add(this.domNode,"show")},hide:function(){this.wabWidget&&this.wabWidget.domNode&&g.remove(this.wabWidget.domNode,"layerlist-show");g.remove(this.domNode,"show")}})});