// 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:{"widgets/AddData/search/SearchContext":function(){define(["dojo/_base/declare","dojo/_base/lang"],function(H,x){return H(null,{allowArcGISOnline:!0,arcgisOnlinePortal:null,orgId:null,portal:null,username:null,constructor:function(E){x.mixin(this,E)}})})},"widgets/AddData/search/util":function(){define(["dojo/_base/array","dojo/aspect","dojo/io-query","esri/InfoTemplate","esri/layers/WFSLayer"],function(H,x,E,B,A){return{checkMixedContent:function(z){"string"===typeof window.location.href&&
0===window.location.href.indexOf("https://")&&"string"===typeof z&&0===z.indexOf("http://")&&(z="https:"+z.substring("5"));return z},endsWith:function(z,n){return-1!==z.indexOf(n,z.length-n.length)},escapeForLucene:function(z){return z.replace(/(\+|\-|\&|\!|\(|\)|\{|\}|\[|\]|\^|\"|\~|\*|\?|\:|\\)/g,"\\$1")},findLayersAdded:function(z,n){var v=[],D=[],w=[],J={itemIds:D,layers:w};if(!z)return J;var F="string"===typeof n&&0<n.length;H.forEach(z.layerIds,function(L){v.push(L)});H.forEach(z.graphicsLayerIds,
function(L){v.push(L)});H.forEach(v,function(L){(L=z.getLayer(L))&&"string"===typeof L.xtnItemId&&0<L.xtnItemId.length&&(!F||L.xtnItemId===n)&&(w.push(L),-1===D.indexOf(L.xtnItemId)&&D.push(L.xtnItemId))});return J},loadWFSByUrl:function(z,n,v,D,w,J){var F,L,O,S=this.makeOGCRequestInfo(D);D=S.url;var G=new A;var M=G.on("error",function(m){M&&M.remove();z.reject(m.error)});G.fromJson(S,function(m){try{if(M&&M.remove(),m&&m.push&&0<m.length){var f=m[0],g={url:D,version:G._version,name:f.name};O=f.name||
f.title;if("string"===typeof g.version&&0<g.version.length&&"string"===typeof g.name&&0<g.name.length){var u=new A({id:w,infoTemplate:new B});"string"===typeof O&&0<O.length&&(u.name=O);F=u.on("error",function(q){F&&F.remove();z.reject(q.error)});L=x.after(u,"_describeFeatureTypeResponse",function(){L&&L.remove();u.fields&&0<u.fields.length&&v._setFeatureLayerInfoTemplate(u)});u.fromJson(g,function(){F&&F.remove();u.xtnAddData=!0;n&&J&&n.addLayer(u);z.resolve(u)})}else z.reject(Error("Error loading WFSLayer, missing version and/or layer"))}else z.reject(Error("Error loading WFSLayer, no layers"))}catch(q){console.warn("Error loading WFSLayer",
D),console.error(q),z.reject(q)}})},makeOGCRequestInfo:function(z){var n={url:z},v=z.indexOf("?");if(-1!==v){n.url=z.substring(0,v);var D;z=z.substring(v+1,z.length);if("string"===typeof z&&0<z.length){var w=E.queryToObject(z),J={};if(w){for(D in w)w.hasOwnProperty(D)&&(z=w[D],v=D.toLowerCase(),"request"!==v&&"service"!==v&&("version"===v?"string"===typeof z&&0<z.length&&(n.version=z):"name"===v?"string"===typeof z&&0<z.length&&(n.name=z):J[D]=z));z=E.objectToQuery(J);"string"===typeof z&&0<z.length&&
(n.url=n.url+"?"+z)}}}return n},setNodeText:function(z,n){z.innerHTML="";n&&z.appendChild(document.createTextNode(n))},setNodeTitle:function(z,n){z.title="";n&&z.setAttribute("title",n)},setNodeHTML:function(z,n){z.innerHTML="";n&&(z.innerHTML=n)}}})},"esri/layers/WFSLayer":function(){define("dojo/_base/declare dojo/_base/kernel dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has dojo/on ../request ../kernel ../graphic ../renderers/jsonUtils ../symbols/jsonUtils ../Color ../symbols/SimpleMarkerSymbol ../symbols/SimpleLineSymbol ../symbols/SimpleFillSymbol ../SpatialReference ../geometry/webMercatorUtils ../geometry/Extent ../geometry/Point ../geometry/Multipoint ../geometry/Polyline ../geometry/Polygon ./LabelClass ./GraphicsLayer".split(" "),
function(H,x,E,B,A,z,n,v,D,w,J,F,L,O,S,G,M,m,f,g,u,q,r,t,h){H=H([h],{declaredClass:"esri.layers.WFSLayer",constructor:function(a){this.geometryType=this.describeFeatureTypeUrl=this.getFeatureUrl=this.layerNamespace="";this.fields=[];this.spatialReferences=[];this.fullExtent=null;this.visible=!0;this.renderer=null;this.id="WFSLayer";this._url="";this._version="1.1.0";this._layerName="";this._nsLayerNames={};this._layerDefinedGeometryType="esriGeometryComplex";this._wkid=3857;this._mode="snapshot";
this._maxFeatures=100;this._inverseResponse=this._inverseFilter=!1;this._nsGeometryFieldName=this._getFeatureRequest=this._nsFields="";this._graphicArray=[];this._gmlNS="http://www.opengis.net/gml";this._layerEventHandlers=[];this.customParameters=this._describeFeatureTypeCallback=this._getCapabilitiesCallback=null;this.showLabels=!0;this.labelingInfo=null;a&&(a.id&&(this.id=a.id),this.showLabels=null!==a.showLabels?a.showLabels:!0);this.onError=E.hitch(this,this.onError);this._errorSupport=E.hitch(this,
this._errorSupport);this._parseGml=E.hitch(this,this._parseGml);this._getCapabilities=E.hitch(this,this._getCapabilities);this._getCapabilitiesResponse=E.hitch(this,this._getCapabilitiesResponse);this._describeFeatureTypeResponse=E.hitch(this,this._describeFeatureTypeResponse);this._pointSymbol=new O(O.STYLE_CIRCLE,6,new S(S.STYLE_SOLID,new L([0,255,0]),1),new L([255,0,0]));this._lineSymbol=new S(S.STYLE_SOLID,new L([0,255,0]),3);this._polygonSymbol=new G(G.STYLE_SOLID,new S(S.STYLE_SOLID,new L([255,
0,0]),2),new L([255,255,0,.25]));this.loaded=!1;this._isProjectedOk=!0},initialize:function(a,b){a.id&&(this.id=a.id);a.url&&(this._url=a.url);a.version&&(this._version=a.version);this.customParameters=a.customParameters;this._getCapabilities(b)},selectLayer:function(a,b){this._layerName=a.layerName;this._wkid=a.wkid;this._mode=a.mode;this._maxFeatures=a.maxFeatures;this._inverseResponse=a.swapXY;this._inverseFilter=a.swapXYFilter;this.geometryType=a.geometryType;this._describeFeatureType(b);this.loaded=
!0},toJson:function(){var a={};a.id=this.id;a.url=this._url;a.version=this._version;a.mode="snapshot"===this._mode?0:1;a.name=this._layerName;a.geometryType=this.geometryType;a.wkid=this._wkid;a.maxFeatures=this._maxFeatures;a.swapXY=this._inverseResponse;a.swapXYFilter=this._inverseFilter;a.pointSymbol=this._pointSymbol.toJson();a.lineSymbol=this._lineSymbol.toJson();a.polygonSymbol=this._polygonSymbol.toJson();a.showLabels=this.showLabels;this.labelingInfo&&(a.labelingInfo=B.map(this.labelingInfo,
function(b){return b.toJson()}));this.customParameters&&(a.customParameters=this.customParameters);return a},fromJson:function(a,b){a.id&&(this.id=a.id);a.url&&(this._url=a.url);a.version&&(this._version=a.version);a.mode&&(this._mode=0===a.mode?"snapshot":"onDemand");a.name&&(this._layerName=a.name);a.geometryType&&(this.geometryType=a.geometryType);a.wkid&&(this._wkid=a.wkid);a.maxFeatures&&(this._maxFeatures=a.maxFeatures);a.swapXY&&(this._inverseResponse=a.swapXY);a.swapXYFilter&&(this._inverseFilter=
a.swapXYFilter);a.pointSymbol&&(this._pointSymbol=F.fromJson(a.pointSymbol));a.lineSymbol&&(this._lineSymbol=F.fromJson(a.lineSymbol));a.polygonSymbol&&(this._polygonSymbol=F.fromJson(a.polygonSymbol));this.showLabels=null!=a.showLabels?a.showLabels:!0;a.labelingInfo&&(this.labelingInfo=B.map(a.labelingInfo,function(d){return new t(d)}));this.customParameters=a.customParameters;this._getCapabilities(b);this.loaded=!0},setPointSymbol:function(a){this._pointSymbol=a},setLineSymbol:function(a){this._lineSymbol=
a},setPolygonSymbol:function(a){this._polygonSymbol=a},_setMap:function(a){this._map=a;var b=this.inherited(arguments);this._map&&(this._layerEventHandlers.push(this._map.on("extent-change",E.hitch(this,"refresh"))),this._layerEventHandlers.push(this.on("visibility-change",E.hitch(this,"_visibilityChange"))));this._getFeature();this.refresh();return b},_unsetMap:function(){for(var a=0;a<this._layerEventHandlers.length;a++)A.disconnect(this._layerEventHandlers[a]);this.refresh();this.inherited(arguments)},
refresh:function(){this.clear();this.redraw();"ondemand"===this._mode.toLowerCase()&&this._fireUpdateStart()},redraw:function(){if(this.visible)for(var a=0;a<this._graphicArray.length;a++){var b=this._graphicArray[a],d=b.geometry,c=null;"point"===d.type?c=this.renderer?this.renderer.getSymbol(b):this._pointSymbol:"multipoint"===d.type?c=this.renderer?this.renderer.getSymbol(b):this._pointSymbol:"polyline"===d.type?c=this.renderer?this.renderer.getSymbol(b):this._lineSymbol:"polygon"===d.type&&(c=
this.renderer?this.renderer.getSymbol(b):this._polygonSymbol);b.setSymbol(c);this.add(b)}},_visibilityChange:function(a){this.visible=a.visible;this.redraw()},onUpdateStart:function(){this._getFeature()},onUpdateEnd:function(){this.clear();this.redraw()},setLabelingInfo:function(a){a?(this.labelingInfo=a,this._fixLabelExpr()):delete this.labelingInfo;this.onLabelingInfoChange()},onLabelingInfoChange:function(){},_fixLabelExpr:function(){var a=/\[([^\[\]]+)\]/ig,b,d=this,c=function(e,l){e=d._getField(l,
!0);return"["+(e&&e.name||l)+"]"};B.forEach(this.labelingInfo,function(e){if(b=e.labelExpression)e.labelExpression=b.replace(a,c)})},_getField:function(a,b){var d=this.fields;if(!d||0===d.length)return null;var c;b&&(a=a.toLowerCase());B.some(d,function(e){var l=!1;(l=b?e&&e.name.toLowerCase()===a?!0:!1:e&&e.name===a?!0:!1)&&(c=e);return l});return c},setCustomParameters:function(a){this.customParameters=a;this._getFeature();this.refresh()},_getCapabilities:function(a){this._getCapabilitiesCallback=
a;a=E.trim(this._url);if(""===a)this.onError("WFSLayer: url is invalid");else if("1.0.0"!==this._version&&"1.1.0"!==this._version&&"2.0.0"!==this._version)this.onError("WFSLayer: version is invalid");else if(""!==a){var b=a.indexOf("?");b=this._checkForUrlInUrl(a,b);b="?"===a.charAt(a.length-1)?"":-1===b?"?":"\x26";a=a+b+"service\x3dWFS\x26request\x3dGetCapabilities\x26version\x3d"+this._version;a=this._appendCustomParameters(a);v({url:a,handleAs:"text",headers:{"Content-Type":null}},{usePost:!1}).then(this._getCapabilitiesResponse,
this._errorSupport)}},_errorSupport:function(a){this.onError(a)},_getCapabilitiesResponse:function(a){var b,d,c,e=new DOMParser;try{var l=e.parseFromString(a,"text/xml"),p=this._readExceptionReport(l,a);if(p)this.onError("WFSLayer: getCapabilities - returns exception: "+p);else{var y=l.documentElement.attributes.getNamedItem("version");if(y){this._version=y.value;var K="2.0.0"===this._version?"http://www.opengis.net/wfs/2.0":"http://www.opengis.net/wfs";if("2.0.0"===this._version){var P=l.getElementsByTagNameNS("http://www.opengis.net/ows/1.1",
"Operation");for(b=0;b<P.length;b++){if((c=P[b].attributes.getNamedItem("name"))&&"DescribeFeatureType"===c.value){var W=P[b].getElementsByTagNameNS("http://www.opengis.net/ows/1.1","Get");this.describeFeatureTypeUrl=W[0].attributes.getNamedItem("xlink:href").value}if(c&&"GetFeature"===c.value){var U=P[b].getElementsByTagNameNS("http://www.opengis.net/ows/1.1","Post");this.getFeatureUrl=U[0].attributes.getNamedItem("xlink:href").value}}}else if("1.1.0"===this._version)for(P=l.getElementsByTagNameNS("http://www.opengis.net/ows",
"Operation"),b=0;b<P.length;b++)(c=P[b].attributes.getNamedItem("name"))&&"DescribeFeatureType"===c.value&&(W=P[b].getElementsByTagNameNS("http://www.opengis.net/ows","Get"),this.describeFeatureTypeUrl=W[0].attributes.getNamedItem("xlink:href").value),c&&"GetFeature"===c.value&&(U=P[b].getElementsByTagNameNS("http://www.opengis.net/ows","Post"))&&U.length&&(this.getFeatureUrl=U[0].attributes.getNamedItem("xlink:href").value);else if("1.0.0"===this._version){var k=l.getElementsByTagNameNS(K,"DescribeFeatureType");
if(!k||!k.length){this.onError("WFSLayer: getCapabilities - no describeFeatureType info");return}W=k[0].getElementsByTagNameNS(K,"Get");this.describeFeatureTypeUrl=W[0].attributes.getNamedItem("onlineResource").value;var I=l.getElementsByTagNameNS(K,"GetFeature");if(!I||!I.length){this.onError("WFSLayer: getCapabilities - no GetFeature info");return}(U=I[0].getElementsByTagNameNS(K,"Post"))&&U.length&&(this.getFeatureUrl=U[0].attributes.getNamedItem("onlineResource").value)}this._nsLayerNames={};
a=[];var C=l.getElementsByTagNameNS(K,"FeatureTypeList");for(b=0;b<C.length;b++){var T=C[b].getElementsByTagNameNS(K,"FeatureType");for(d=0;d<T.length;d++){var N=T[d],V=N.getElementsByTagNameNS(K,"Name")[0],Q=V.textContent,X=Q.indexOf(":"),R=Q.substring(0,X),Y=Q.substring(X+1),aa=V.lookupNamespaceURI(R);null===aa&&(aa=V.lookupNamespaceURI(null));this._nsLayerNames[Y]={prefix:R,namespace:aa};var ca=N.getElementsByTagNameNS(K,"Title"),da=0<ca.length?ca[0].textContent:"";""===da&&(da=Y);this.spatialReferences=
this._readFactoryCodes(this._version,N);var Z=this._readDefaultBBOX(this._version,N);a.push({name:Y,title:da,spatialReferences:this.spatialReferences,extent:Z})}}this._describeFeatureType();var ba=this._getCapabilitiesCallback;ba&&ba(a)}else this.onError("WFSLayer: getCapabilities - document not recognized.")}}catch(ea){this.onError("WFSLayer: getCapabilities - parsing error")}},_readFactoryCodes:function(a,b){var d,c=[];if("2.0.0"===a||"1.1.0"===a){a=b.getElementsByTagNameNS("*","DefaultSRS");this._addCodeList(c,
a[0]);a=b.getElementsByTagNameNS("*","DefaultCRS");this._addCodeList(c,a[0]);a=b.getElementsByTagNameNS("*","OtherSRS");for(d=0;d<a.length;d++)this._addCodeList(c,a[d]);a=b.getElementsByTagNameNS("*","OtherCRS");for(d=0;d<a.length;d++)this._addCodeList(c,a[d])}else"1.0.0"===a&&(a=b.getElementsByTagNameNS("*","SRS"),this._addCodeList(c,a[0]));for(b=!1;0<c.length;){4326===c[0]&&(b=!0);break}b||c.push(4326);return c},_addCodeList:function(a,b){b&&(b=b.textContent.match(/\d+/g),0<b.length&&(b=parseInt(b[b.length-
1],10),84===b&&(b=4326),a.push(b)))},_readDefaultBBOX:function(a,b){if("2.0.0"===a||"1.1.0"===a){var d=b.getElementsByTagNameNS("*","WGS84BoundingBox");if(!d[0]||!d[0].attributes)return[];var c=d[0].getElementsByTagNameNS("*","LowerCorner");var e=d[0].getElementsByTagNameNS("*","UpperCorner");if(0>=c.length||0>=e.length)return[];var l=c[0].textContent;d=l.indexOf(" ");c=l.substring(0,d);l=l.substring(d+1);d=e[0].textContent;a=d.indexOf(" ");e=d.substring(0,a);d=d.substring(a+1)}else if("1.0.0"===
a){d=b.getElementsByTagNameNS("*","LatLongBoundingBox");if(!d[0]||!d[0].attributes)return[];c=d[0].attributes.getNamedItem("minx").value;l=d[0].attributes.getNamedItem("miny").value;e=d[0].attributes.getNamedItem("maxx").value;d=d[0].attributes.getNamedItem("maxy").value}c=parseFloat(c,10);l=parseFloat(l,10);e=parseFloat(e,10);d=parseFloat(d,10);return[c,l,e,d]},_describeFeatureType:function(a){if(""!==this._layerName)if(""===this.describeFeatureTypeUrl)this.onError("WFSLayer: invalid describeFeatureType url");
else if(""===this._wkid)this.onError("WFSLayer: invalid wkid");else if("snapshot"!==this._mode&&"onDemand"!==this._mode)this.onError("WFSLayer: invalid mode");else if(""===this._maxFeatures||0>this._maxFeatures||1E6<this._maxFeatures)this.onError("WFSLayer: invalid maxFeatures");else if(this._describeFeatureTypeCallback=a,a=E.trim(this.describeFeatureTypeUrl),""!==a){var b=a.indexOf("?");b=this._checkForUrlInUrl(a,b);var d="?"===a.charAt(a.length-1)?"":-1===b?"?":"\x26",c=this._nsLayerNames[this._layerName];
if(void 0===c)this.onError("WFSLayer: invalid layerName");else b=c.prefix,c=c.namespace,a=a+d+"service\x3dWFS\x26request\x3dDescribeFeatureType\x26version\x3d"+this._version,a+="\x26typeName\x3d",""!==b&&(a+=b+":"),a+=encodeURIComponent(this._layerName),""!==b&&(a+="\x26namespace\x3dxmlns("+b+"\x3d"+encodeURIComponent(c)+")"),a=this._appendCustomParameters(a),v({url:a,handleAs:"text",headers:{"Content-Type":null}},{usePost:!1}).then(this._describeFeatureTypeResponse,this._errorSupport)}},_describeFeatureTypeResponse:function(a){var b=
(new DOMParser).parseFromString(a,"text/xml");if(a=this._readExceptionReport(b,a))this.onError("WFSLayer: DescribeFeatureType - returns exception: "+a);else{this.fields=[];a=b.getElementsByTagNameNS("http://www.w3.org/2001/XMLSchema","schema");for(b=0;b<a.length;b++){var d=this._readAllFields(a[b]);null!==d&&(this._layerDefinedGeometryType=d[0],this.fields=d[1])}this.geometryType&&""!==this.geometryType||(this.geometryType=this._layerDefinedGeometryType);for(b=0;b<this.fields.length;b++)a=this.fields[b],
"esriFieldTypeGeometry"===a.type&&(this._nsGeometryFieldName=a.name);this.layerNamespace=this._nsLayerNames[this._layerName].namespace;if(0===this.fields.length)this.onError("WFSLayer: DescribeFeatureType - can't get fields");else this._getFeature(),(b=this._describeFeatureTypeCallback)&&b(this.fields)}},_readAllFields:function(a){for(var b=a.childNodes,d=0;d<b.length;d++){var c=b[d];if("element"===c.localName){var e=c.attributes;if(e.name.value===this._layerName)return(b=e.type)?(c=b.value,b=c.indexOf(":"),
c=c.substring(b+1),this._readFieldsFromGlobalComplextType(a,c)):this._readFieldsFromLocalComplextType(c)}}return null},_readFieldsFromGlobalComplextType:function(a,b){a=a.childNodes;for(var d=0;d<a.length;d++){var c=a[d];if("complexType"===c.localName&&c.attributes.name.value===b)return this._readFieldsFromLocalComplextType(c)}return null},_readFieldsFromLocalComplextType:function(a){for(var b=[],d="esriGeometryComplex",c=a.getElementsByTagNameNS("http://www.w3.org/2001/XMLSchema","element"),e=0;e<
c.length;e++){var l=c[e],p="",y=l.attributes.getNamedItem("name");y&&(p=y.value);if(""!==p){var K=a="",P=l.attributes.getNamedItem("type");y="unknown";if(null!==P){K=P.value;var W=K.indexOf(":");a=K.substring(0,W);K=K.substring(W+1);y=P.lookupNamespaceURI(a);null===y&&(y=P.lookupNamespaceURI(null))}if(""===K){l=l.childNodes;for(var U=0;U<l.length;U++)if(a=l[U],"simpleType"===a.localName){a=a.childNodes;for(U=0;U<a.length;U++)if(node2=a[U],"restriction"===node2.localName){P=node2.attributes.getNamedItem("base");
K=P.value;W=K.indexOf(":");a=K.substring(0,W);K=K.substring(W+1);break}if(""!==K)break}}l="Unknown";switch(K){case "integer":case "nonPositiveInteger":case "negativeInteger":case "long":case "int":case "short":case "byte":case "nonNegativeInteger":case "unsignedLong":case "unsignedInt":case "unsignedShort":case "unsignedByte":case "positiveInteger":l="esriFieldTypeInteger";b.push({name:p,alias:p,type:l,wfsNamespace:y});break;case "float":case "double":case "decimal":l="esriFieldTypeDouble";b.push({name:p,
alias:p,type:l,wfsNamespace:y});break;case "boolean":case "string":case "gYearMonth":case "gYear":case "gMonthDay":case "gDay":case "gMonth":case "anyURI":case "QName":case "NOTATION":case "normalizedString":case "token":case "language":case "IDREFS":case "ENTITIES":case "NMTOKEN":case "NMTOKENS":case "Name":case "NCName":case "ID":case "IDREF":case "ENTITY":l="esriFieldTypeString";b.push({name:p,alias:p,type:l,wfsNamespace:y});break;case "duration":case "dateTime":case "time":case "date":l="esriFieldTypeDate";
b.push({name:p,alias:p,type:l,wfsNamespace:y});break;case "PointPropertyType":case "MultiPointPropertyType":l="esriFieldTypeGeometry";d="esriGeometryPoint";b.push({name:p,alias:p,type:l,wfsNamespace:y});break;case "MultiCurvePropertyType":case "MultiLineStringPropertyType":l="esriFieldTypeGeometry";d="esriGeometryPolyline";b.push({name:p,alias:p,type:l,wfsNamespace:y});break;case "MultiSurfacePropertyType":case "MultiPolygonPropertyType":l="esriFieldTypeGeometry";d="esriGeometryPolygon";b.push({name:p,
alias:p,type:l,wfsNamespace:y});break;case "GeometryPropertyType":case "MultiGeometryPropertyType":l="esriFieldTypeGeometry",d="esriGeometryComplex",b.push({name:p,alias:p,type:l,wfsNamespace:y})}}}return[d,b]},_getFeature:function(){var a="\x3c?xml version\x3d'1.0' encoding\x3d'utf-8'?\x3e\n\x3cGetFeature \n xmlns:xsi\x3d'http://www.w3.org/2001/XMLSchema-instance'\n xmlns:gml\x3d'http://www.opengis.net/gml'\n xmlns:ogc\x3d'http://www.opengis.net/ogc'\n xmlns:wfs\x3d'http://www.opengis.net/wfs'\n";
a="2.0.0"===this._version?a+" xmlns\x3d'http://www.opengis.net/wfs/2.0'\n":a+" xmlns\x3d'http://www.opengis.net/wfs'\n";var b=this._nsLayerNames[this._layerName];if(void 0===b)this.onError("WFSLayer: invalid layerName");else{var d=b.prefix;b=b.namespace;if("ondemand"===this._mode.toLowerCase()&&""===this._nsGeometryFieldName)this.onError("WFSLayer: GetFeature - can't use 'onDemand' mode as geometryFieldName is unknown.");else if(a+=" xmlns:"+d+"\x3d'"+b+"'\n",a="2.0.0"===this._version?a+(" version\x3d'"+
this._version+"' service\x3d'WFS' count\x3d'"+this._maxFeatures+"'\x3e\n"):a+(" version\x3d'"+this._version+"' service\x3d'WFS' maxFeatures\x3d'"+this._maxFeatures+"'\x3e\n"),a="2.0.0"===this._version?a+(" \x3cQuery typeNames\x3d'"+d+":"+this._layerName+"' srsName\x3d'EPSG:"+this._wkid+"'\x3e\n"):a+(" \x3cwfs:Query typeName\x3d'"+d+":"+this._layerName+"' srsName\x3d'EPSG:"+this._wkid+"'\x3e\n"),"ondemand"===this._mode.toLowerCase()&&(a=a+"  \x3cogc:Filter xmlns:ogc\x3d'http://www.opengis.net/ogc'\x3e\n   \x3cogc:BBOX\x3e\n    \x3cogc:PropertyName\x3e"+
(d+":"+this._nsGeometryFieldName+"\x3c/ogc:PropertyName\x3e\n"),a+="    \x3cgml:Box srsName\x3d'EPSG:"+this._wkid+"'\x3e\n",a=this._inverseFilter?a+"      \x3cgml:coordinates\x3e{ymin},{xmin} {ymax},{xmax}\x3c/gml:coordinates\x3e\n":a+"      \x3cgml:coordinates\x3e{xmin},{ymin} {xmax},{ymax}\x3c/gml:coordinates\x3e\n",a+="    \x3c/gml:Box\x3e\n   \x3c/ogc:BBOX\x3e\n  \x3c/ogc:Filter\x3e\n"),a="2.0.0"===this._version?a+" \x3c/Query\x3e\n":a+" \x3c/wfs:Query\x3e\n",this._getFeatureRequest=a+"\x3c/GetFeature\x3e\n",
""===this.getFeatureUrl)this.onError("WFSLayer: getFeature - server doesn't support POST method.");else if(""!==this._getFeatureRequest&&this._map&&null!==this._map.spatialReference.wkid){a=this._getFeatureRequest;if("ondemand"===this._mode.toLowerCase()){a=this._map.extent.xmin;d=this._map.extent.ymin;b=this._map.extent.xmax;var c=this._map.extent.ymax,e={},l=this._map.spatialReference,p=new M(this._wkid);this._projectFromSRToSR(l,p,a,d,e)&&(a=e.x,d=e.y);this._projectFromSRToSR(l,p,b,c,e)&&(b=e.x,
c=e.y);a=this._getFeatureRequest.replace(/{xmin}/,a).replace(/{ymin}/,d).replace(/{xmax}/,b).replace(/{ymax}/,c)}d=this._appendCustomParameters(this.getFeatureUrl);v({url:d,handleAs:"text",headers:{"Content-Type":"text/xml"},postData:a},{usePost:!0}).then(this._parseGml,this._errorSupport)}}},_parseGml:function(a){if(this._map&&this._map.spatialReference&&this._map.spatialReference.wkid){var b=(new DOMParser).parseFromString(a,"text/xml");if(a=this._readExceptionReport(b,a))this.onError("WFSLayer: GetFeature - returns exception: "+
a);else this._gmlNS="2.0.0"===this._version?"http://www.opengis.net/gml/3.2":"http://www.opengis.net/gml",""===this._wkid&&(this._wkid=this._map.spatialReference.wkid),this._graphicArray=this._readFeatureMembers(b,this._wkid,2,this._nsLayerNames[this._layerName].namespace,this._layerName),this.fullExtent=this._createFullExtent(this._graphicArray),this.onLabelingInfoChange(),"ondemand"===this._mode.toLowerCase()?this._fireUpdateEnd():this.refresh()}},_limit4326:function(a){for(var b=0;b<a.length;b++){var d=
a[b].geometry;4326===d.spatialReference.wkid&&(d.x=this._limit4326X(d.x),d.y=this._limit4326Y(d.y))}},_limit4326X:function(a){180<=a&&(a=179.99);-180>=a&&(a=-179.99);return a},_limit4326Y:function(a){90<=a&&(a=89.99);-90>=a&&(a=-89.99);return a},_createFullExtent:function(a){for(var b=null,d=0;d<a.length;d++){var c=a[d].geometry,e=null;(e="point"===c.geometryType?new f(c.x,c.y,c.x,c.y,c.spatialReference):c.getExtent())&&(b=null===b?e:b.union(e))}return b},_readExceptionReport:function(a,b){return 0<
a.getElementsByTagNameNS("*","ExceptionReport").length||0<a.getElementsByTagNameNS("*","ServiceExceptionReport").length?b:""},_readFeatureMembers:function(a,b,d,c,e){var l=this._readWkidFromNode(a);-1!=l&&(b=l);l=this._readSrsDimension(a);0!==l&&(d=l);var p=[];var y=a.getElementsByTagNameNS("*","featureMembers");for(l=0;l<y.length;l++){var K=y[l];var P=K.getElementsByTagNameNS(c,e);0===P.length&&(P=K.getElementsByTagNameNS(null,e));0===P.length&&(P=K.getElementsByTagNameNS("*",e));for(K=0;K<P.length;K++)this._readLayer(p,
P[K],b,d)}y=a.getElementsByTagNameNS("*","featureMember");for(l=0;l<y.length;l++)for(K=y[l],P=K.getElementsByTagNameNS(c,e),0===P.length&&(P=K.getElementsByTagNameNS(null,e)),0===P.length&&(P=K.getElementsByTagNameNS("*",e)),K=0;K<P.length;K++)this._readLayer(p,P[K],b,d);y=a.getElementsByTagNameNS("*","member");for(l=0;l<y.length;l++)for(K=y[l],P=K.getElementsByTagNameNS(c,e),0===P.length&&(P=K.getElementsByTagNameNS(null,e)),0===P.length&&(P=K.getElementsByTagNameNS("*",e)),K=0;K<P.length;K++)this._readLayer(p,
P[K],b,d);return p},_readLayer:function(a,b,d,c){var e=this._readSrsDimension(b);0!==e&&(c=e);var l=b.childNodes,p="",y=null;for(b=0;b<l.length;b++){var K=l[b];if(1==K.nodeType&&(e=K.localName,"boundedBy"!==e)){K=this._readGeometry(K,d,c);if(!this._isProjectedOk){this._isProjectedOk=!0;console.error("WFSLayer: could not project geometry.");break}if(null!==K&&(y=K,p=e,"point"!==y.geometryType||"esriGeometryPolygon"!==this.geometryType&&"esriGeometryPolyline"!==this.geometryType))break}}if(y){d={};
for(b=0;b<l.length;b++)if(K=l[b],e=K.localName,c=K.textContent,e!==p)for(K=0;K<this.fields.length;K++){var P=this.fields[K];P.name==e&&(d[e]="esriFieldTypeDouble"===P.type?parseFloat(c,10):"esriFieldTypeInteger"===P.type?parseInt(c,10):c.trim())}this._convertWFSGeometryToGraphicObjects(a,y,d)}},_convertWFSGeometryToGraphicObjects:function(a,b,d){if("point"===b.geometryType&&("esriGeometryPoint"===this.geometryType||"esriGeometryComplex"===this.geometryType)){var c=new w;b=new g(b);c.setGeometry(b);
c.setAttributes(d);a.push(c)}else if("multipoint"===b.geometryType&&("esriGeometryPoint"===this.geometryType||"esriGeometryComplex"===this.geometryType))c=new w,b=new u(b),c.setGeometry(b),c.setAttributes(d),a.push(c);else if("polyline"===b.geometryType&&("esriGeometryPolyline"===this.geometryType||"esriGeometryComplex"===this.geometryType))c=new w,b=new q(b),c.setGeometry(b),c.setAttributes(d),a.push(c);else if("polygon"===b.geometryType&&("esriGeometryPolygon"===this.geometryType||"esriGeometryComplex"===
this.geometryType))c=new w,b=new r(b),c.setGeometry(b),c.setAttributes(d),a.push(c);else if("multigeometry"===b.geometryType)for(c=0;c<b.length;c++)this._convertWFSGeometryToGraphicObjects(a,b[c],d)},_readGeometry:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);var e=a.getElementsByTagNameNS(this._gmlNS,"MultiSurface");if(1<=e.length)for(c=0;c<e.length;)return this._readMultiSurface(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"MultiCurve");
if(1<=e.length){var l=[];for(c=0;c<e.length;c++){var p=this._readMultiCurve(e[c],b,d);for(a=0;a<p.length;a++)l.push(p[a])}return{geometryType:"polyline",paths:l,spatialReference:{wkid:this._map.spatialReference.wkid}}}e=a.getElementsByTagNameNS(this._gmlNS,"MultiGeometry");for(c=0;c<e.length;)return this._readMultiGeometry(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"Geometry");for(c=0;c<e.length;)return this._readGeometry(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"GeometryCollection");
for(c=0;c<e.length;)return this._readGeometryCollection(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"Surface");for(c=0;c<e.length;)return this._readSurface(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"Curve");for(c=0;c<e.length;)return this._readCurve(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"MultiPolygon");for(c=0;c<e.length;)return this._readMultiPolygon(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"Polygon");for(c=0;c<e.length;)return this._readPolygon(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,
"MultiLineString");for(c=0;c<e.length;)return this._readMultiLineString(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"LineString");for(c=0;c<e.length;){b=this._readLineString(e[c],b,d);d={geometryType:"polyline",paths:[],spatialReference:{wkid:this._map.spatialReference.wkid}};c=[];for(a=0;a<b.length;a++)c.push(b[a]);d.paths.push(c);return d}e=a.getElementsByTagNameNS(this._gmlNS,"LinearRing");for(c=0;c<e.length;)return this._readLinearRing(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"Box");
if(1<=e.length)for(c=0;c<e.length;)return this._readBox(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"Envelope");for(c=0;c<e.length;)return this._readEnvelope(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"MultiPoint");if(1<=e.length)for(c=0;c<e.length;)return this._readMultiPoint(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"Point");for(c=0;c<e.length;)return this._readPoint(e[c],b,d);return null},_readGeometryCollection:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);
0!==c&&(d=c);c=[];c.geometryType="multigeometry";c.spatialReference={wkid:this._map.spatialReference.wkid};var e=a.getElementsByTagNameNS(this._gmlNS,"geometryMember");for(a=0;a<e.length;a++){var l=this._readGeometryMember(e[a],b,d);c.push(l)}return c},_readMultiGeometry:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);c=[];c.geometryType="multigeometry";c.spatialReference={wkid:this._map.spatialReference.wkid};var e=a.getElementsByTagNameNS(this._gmlNS,
"geometryMember");for(a=0;a<e.length;a++){var l=this._readGeometryMember(e[a],b,d);c.push(l)}return c},_readSurface:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);var e=[];e.geometryType="multigeometry";e.spatialReference={wkid:this._map.spatialReference.wkid};var l=a.getElementsByTagNameNS(this._gmlNS,"Point");for(c=0;c<l.length;c++)e.push(this._readPoint(l[c],b,d));l=a.getElementsByTagNameNS(this._gmlNS,"patches");for(c=0;c<l.length;c++){a=
this._readPatches(l[c],b,d);for(var p=0;p<a.length;p++)e.push(a[p])}return e},_readMultiSurface:function(a,b,d){var c;var e=this._readWkidFromNode(a);-1!=e&&(b=e);e=this._readSrsDimension(a);0!==e&&(d=e);var l=[];l.geometryType="multigeometry";l.spatialReference={wkid:this._map.spatialReference.wkid};var p=a.getElementsByTagNameNS(this._gmlNS,"surfaceMember");for(e=0;e<p.length;e++){var y=this._readSurfaceMember(p[e],b,d);for(c=0;c<y.length;c++)l.push(y[c])}p=a.getElementsByTagNameNS(this._gmlNS,
"surfaceMembers");for(e=0;e<p.length;e++)for(a=this._readSurfaceMembers(p[e],b,d),c=0;c<a.length;c++)l.push(a[c]);return l},_readCurve:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);c={geometryType:"polyline",paths:[],spatialReference:{wkid:this._map.spatialReference.wkid}};var e=a.getElementsByTagNameNS(this._gmlNS,"segments");for(a=0;a<e.length;a++)for(var l=this._readSegments(e[a],b,d),p=0;p<l.length;p++)c.paths.push(l[p]);return c},_readSegments:function(a,
b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);c=[];c.geometryType="multigeometry";c.spatialReference={wkid:this._map.spatialReference.wkid};var e=a.getElementsByTagNameNS(this._gmlNS,"LineStringSegment");for(a=0;a<e.length;a++){var l=this._readLineStringSegment(e[a],b,d);c.push(l)}return c},_readLineStringSegment:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);for(a=a.getElementsByTagNameNS(this._gmlNS,
"posList");0<a.length;)return this._readPosList(a[0],b,d)},_readMultiCurve:function(a,b,d){var c;var e=this._readWkidFromNode(a);-1!=e&&(b=e);e=this._readSrsDimension(a);0!==e&&(d=e);var l=[];l.spatialReference={wkid:this._map.spatialReference.wkid};var p=a.getElementsByTagNameNS(this._gmlNS,"curveMember");for(e=0;e<p.length;e++){var y=this._readCurveMember(p[e],b,d);for(c=0;c<y.length;c++)l.push(y[c])}p=a.getElementsByTagNameNS(this._gmlNS,"curveMembers");for(e=0;e<p.length;e++)for(y=this._readCurveMembers(p[e],
b,d),c=0;c<y.length;c++)l.push(y[c]);return l},_readGeometryMember:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);var e=a.getElementsByTagNameNS(this._gmlNS,"Point");for(c=0;c<e.length;)return this._readPoint(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"LineString");for(c=0;c<e.length;){b=this._readLineString(e[c],b,d);d={geometryType:"polyline",paths:[],spatialReference:{wkid:this._map.spatialReference.wkid}};c=[];for(a=0;a<b.length;a++)c.push(b[a]);
d.paths.push(c);return d}e=a.getElementsByTagNameNS(this._gmlNS,"Polygon");for(c=0;c<e.length;)return this._readPolygon(e[c],b,d);return null},_readSurfaceMember:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);c=[];c.geometryType="multigeometry";c.spatialReference={wkid:this._map.spatialReference.wkid};var e=a.getElementsByTagNameNS(this._gmlNS,"Polygon");for(a=0;a<e.length;a++){var l=this._readPolygon(e[a],b,d);c.push(l)}return c},_readSurfaceMembers:function(a,
b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);c=[];c.geometryType="multigeometry";c.spatialReference={wkid:this._map.spatialReference.wkid};var e=a.getElementsByTagNameNS(this._gmlNS,"Polygon");for(a=0;a<e.length;a++){var l=this._readPolygon(e[a],b,d);c.push(l)}return c},_readCurveMember:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);c=[];c.geometryType="multigeometry";c.spatialReference={wkid:this._map.spatialReference.wkid};
var e=a.getElementsByTagNameNS(this._gmlNS,"LineString");for(a=0;a<e.length;a++){var l=this._readLineString(e[a],b,d);c.push(l)}return c},_readCurveMembers:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);c=[];c.geometryType="multigeometry";c.spatialReference={wkid:this._map.spatialReference.wkid};var e=a.getElementsByTagNameNS(this._gmlNS,"LineString");for(a=0;a<e.length;a++){var l=this._readLineString(e[a],b,d);c.push(l)}return c},_readBox:function(a,
b,d){var c,e,l,p,y=this._readWkidFromNode(a);-1!=y&&(b=y);y=this._readSrsDimension(a);0!==y&&(d=y);y={geometryType:"polygon",rings:[],spatialReference:{wkid:this._map.spatialReference.wkid}};var K=a.getElementsByTagNameNS(this._gmlNS,"coordinates");for(c=0;c<K.length;c++)if(e=this._readCoordinates(K[c],b,d)){if(1<=e.length){var P=l=e[0][0];var W=p=e[0][1]}1<=e.length&&(l=e[1][0],p=e[1][1]);y.rings.push([[P,W],[P,p],[l,p],[l,W],[P,W]]);return y}K=a.getElementsByTagNameNS(this._gmlNS,"coord");return 2<=
K.length?((a=this._readCoord(K[0],b,d))&&1<=a.length&&(P=l=a[0][0],W=p=a[0][1]),(b=this._readCoord(K[1],b,d))&&1<=b.length&&(l=b[0][0],p=b[0][1]),y.rings.push([[P,W],[P,p],[l,p],[l,W],[P,W]]),y):null},_readEnvelope:function(a,b,d){var c,e;var l=this._readWkidFromNode(a);-1!=l&&(b=l);l=this._readSrsDimension(a);0!==l&&(d=l);var p=a.getElementsByTagNameNS(this._gmlNS,"lowerCorner");for(l=0;l<p.length;l++){var y=this._readCoordinates(p[l],b,d);y&&(c=y[0])}p=a.getElementsByTagNameNS(this._gmlNS,"upperCorner");
for(l=0;l<p.length;l++)(a=this._readCoordinates(p[l],b,d))&&(e=a[0]);return c&&e?{geometryType:"polygon",rings:[[[c[0],c[1]],[c[0],e[1]],[e[0],e[1]],[e[0],c[1]],[c[0],c[1]]]],spatialReference:{wkid:this._map.spatialReference.wkid}}:null},_readPolygon:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);var e={geometryType:"polygon",rings:[],spatialReference:{wkid:this._map.spatialReference.wkid}};var l=a.getElementsByTagNameNS(this._gmlNS,"outerBoundaryIs");
for(c=0;c<l.length;c++){var p=this._readOuterBoundaryIs(l[c],b,d);e.rings.push(p)}l=a.getElementsByTagNameNS(this._gmlNS,"innerBoundaryIs");for(c=0;c<l.length;c++)p=this._readInnerBoundaryIs(l[c],b,d),e.rings.push(p);l=a.getElementsByTagNameNS(this._gmlNS,"exterior");for(c=0;c<l.length;c++)p=this._readExterior(l[c],b,d),e.rings.push(p);l=a.getElementsByTagNameNS(this._gmlNS,"interior");for(c=0;c<l.length;c++)p=this._readInterior(l[c],b,d),e.rings.push(p);return e},_readPolygonMember:function(a,b,
d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);for(a=a.getElementsByTagNameNS(this._gmlNS,"Polygon");0<a.length;)return this._readPolygon(a[0],b,d);return null},_readMultiPolygon:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);c=[];c.geometryType="multigeometry";c.spatialReference={wkid:this._map.spatialReference.wkid};var e=a.getElementsByTagNameNS(this._gmlNS,"polygonMember");for(a=0;a<e.length;a++){var l=
this._readPolygonMember(e[a],b,d);c.push(l)}return c},_readOuterBoundaryIs:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);for(a=a.getElementsByTagNameNS(this._gmlNS,"LinearRing");0<a.length;)return this._readLinearRing(a[0],b,d);return null},_readInnerBoundaryIs:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);for(a=a.getElementsByTagNameNS(this._gmlNS,"LinearRing");0<a.length;)return this._readLinearRing(a[0],
b,d);return null},_readExterior:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);for(a=a.getElementsByTagNameNS(this._gmlNS,"LinearRing");0<a.length;)return this._readLinearRing(a[0],b,d);return null},_readInterior:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);for(a=a.getElementsByTagNameNS(this._gmlNS,"LinearRing");0<a.length;)return this._readLinearRing(a[0],b,d);return null},_readPatches:function(a,
b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);c=[];c.spatialReference={wkid:this._map.spatialReference.wkid};var e=a.getElementsByTagNameNS(this._gmlNS,"PolygonPatch");for(a=0;a<e.length;a++)c.push(this._readPolygon(e[a],b,d));return c},_readLineString:function(a,b,d){var c,e;var l=this._readWkidFromNode(a);-1!=l&&(b=l);l=this._readSrsDimension(a);0!==l&&(d=l);var p=[];p.spatialReference={wkid:this._map.spatialReference.wkid};var y=a.getElementsByTagNameNS(this._gmlNS,
"coordinates");for(l=0;l<y.length;l++)if(e=this._readCoordinates(y[l],b,d))for(c=0;c<e.length;c++){var K=e[c];p.push(K)}y=a.getElementsByTagNameNS(this._gmlNS,"coord");for(l=0;l<y.length;l++)if(e=this._readCoord(y[l],b,d))for(c=0;c<e.length;c++)K=e[c],p.push(K);y=a.getElementsByTagNameNS(this._gmlNS,"posList");for(l=0;l<y.length;l++)if(e=this._readPosList(y[l],b,d))for(c=0;c<e.length;c++)K=e[c],p.push(K);return p},_readLineStringMember:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);
c=this._readSrsDimension(a);0!==c&&(d=c);for(a=a.getElementsByTagNameNS(this._gmlNS,"LineString");0<a.length;)return this._readLineString(a[0],b,d);return null},_readMultiLineString:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);c={geometryType:"polyline",paths:[],spatialReference:{wkid:this._map.spatialReference.wkid}};var e=a.getElementsByTagNameNS(this._gmlNS,"lineStringMember");for(a=0;a<e.length;a++){var l=this._readLineStringMember(e[a],
b,d);l&&c.paths.push(l)}return 1<=c.paths.length?c:null},_readPoint:function(a,b,d){var c;var e=this._readWkidFromNode(a);-1!=e&&(b=e);e=this._readSrsDimension(a);0!==e&&(d=e);var l=a.getElementsByTagNameNS(this._gmlNS,"coordinates");for(e=0;e<l.length;e++)if(c=this._readCoordinates(l[e],b,d))return{geometryType:"point",x:c[0][0],y:c[0][1],spatialReference:{wkid:this._map.spatialReference.wkid}};l=a.getElementsByTagNameNS(this._gmlNS,"pos");for(e=0;e<l.length;e++)if((c=this._readPos(l[e],b,d))&&0<
c.length)return{geometryType:"point",x:c[0][0],y:c[0][1],spatialReference:{wkid:this._map.spatialReference.wkid}};l=a.getElementsByTagNameNS(this._gmlNS,"coord");for(e=0;e<l.length;e++)if(a=this._readCoord(l[e],b,d))return{geometryType:"point",x:a[0][0],y:a[0][1],spatialReference:{wkid:this._map.spatialReference.wkid}};return null},_readPointMember:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);for(a=a.getElementsByTagNameNS(this._gmlNS,"Point");0<
a.length;)return this._readPoint(a[0],b,d);return null},_readMultiPoint:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);c={geometryType:"multipoint",points:[],spatialReference:{wkid:this._map.spatialReference.wkid}};var e=a.getElementsByTagNameNS(this._gmlNS,"pointMember");for(a=0;a<e.length;a++){var l=this._readPointMember(e[a],b,d);l&&c.points.push([l.x,l.y])}return 1<=c.points.length?c:null},_readLinearRing:function(a,b,d){var c=this._readWkidFromNode(a);
-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);var e=a.getElementsByTagNameNS(this._gmlNS,"coordinates");for(c=0;c<e.length;)return this._readCoordinates(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"posList");for(c=0;c<e.length;)return this._readCoordinates(e[c],b,d);e=a.getElementsByTagNameNS(this._gmlNS,"pos");for(c=0;c<e.length;)return this._readPos(e[c],b,d)},_readCoordinatesBody:function(a,b,d){var c=new M(a);b=b.trim();var e=[];e.spatialReference={wkid:this._map.spatialReference.wkid};
a=this._isReverse(a,this.version);if(b)if(2===d){if((b=b.match(/[0123456789.\-\+eE]+/g))&&2<=b.length)for(d=0;d<b.length;d+=2){var l=parseFloat(b[d]);var p=parseFloat(b[d+1]);if(a){var y=p;p=l;l=y}y={};this._projectFromSRToSR(c,this._map.spatialReference,l,p,y)&&(l=y.x,p=y.y);e.push([l,p])}}else if(3===d&&(b=b.match(/[0123456789.\-\+eE]+/g))&&3<=b.length)for(d=0;d<b.length;d+=3)l=parseFloat(b[d]),p=parseFloat(b[d+1]),a&&(y=p,p=l,l=y),y={},this._projectFromSRToSR(c,this._map.spatialReference,l,p,y)&&
(l=y.x,p=y.y),e.push([l,p]);return e},_readCoord:function(a,b,d){var c,e=this._readWkidFromNode(a);-1!=e&&(b=e);e=new M(b);var l=this._readSrsDimension(a);0!==l&&(d=l);var p=this._isReverse(b,this.version),y=[];y.spatialReference={wkid:this._map.spatialReference.wkid};l=0;var K=a.getElementsByTagNameNS(this._gmlNS,"X");for(c=0;c<K.length;){l=this._readFloat(K[c],b,d);break}var P=0;K=a.getElementsByTagNameNS(this._gmlNS,"Y");for(c=0;c<K.length;){P=this._readFloat(K[c],b,d);break}p&&(a=P,P=l,l=a);a=
{};this._projectFromSRToSR(e,this._map.spatialReference,l,P,a)&&(l=a.x,P=a.y);y.push(p?[P,l]:[l,P]);return y},_readCoordinates:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);return this._readCoordinatesBody(b,a.textContent,d)},_readPos:function(a,b,d){var c=this._readWkidFromNode(a);-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);return this._readCoordinatesBody(b,a.textContent,d)},_readPosList:function(a,b,d){var c=this._readWkidFromNode(a);
-1!=c&&(b=c);c=this._readSrsDimension(a);0!==c&&(d=c);return this._readCoordinatesBody(b,a.textContent,d)},_projectFromSRToSR:function(a,b,d,c,e){if(m.canProject(a,b))return a=new g(d,c,a),b=m.project(a,b),e.x=b.x,e.y=b.y,!0;e.x=d;e.y=c;return this._isProjectedOk=!1},_readFloat:function(a){return(a=a.textContent)?parseFloat(a):0},_readSrsDimension:function(a){return a.attributes&&(a=a.attributes.getNamedItem("srsDimension"))?parseInt(a.value,10):0},_readWkidFromNode:function(a){return a.attributes&&
(a=a.attributes.getNamedItem("srsName"))&&(a=a.value.match(/\d+/g))&&0<a.length?(a=parseInt(a[a.length-1],10),84===a&&(a=4326),parseInt(a,10)):-1},_isReverse:function(a,b){return this._inverseResponse},_appendCustomParameters:function(a){if(this.customParameters)for(var b in this.customParameters)a+=(-1===a.indexOf("?")?"?":"\x26")+b+"\x3d"+encodeURIComponent(this.customParameters[b]);return a},_checkForUrlInUrl:function(a,b){var d=a.toLowerCase().lastIndexOf("http");-1<b&&d>b&&(-1<a.indexOf("?",
d)||-1!==a.indexOf("\x26",d)||(b=-1));return b}});z("extend-esri")&&E.setObject("layers.WFSLayer",H,D);return H})},"widgets/AddData/search/SearchPane":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/on dojo/dom-class dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./templates/SearchPane.html dojo/i18n!../nls/strings ./SearchBox ./BBoxOption ./ScopeOptions ./TypeOptions ./SortOptions ./ResultsPane ./Paging ./ResultCount".split(" "),function(H,
x,E,B,A,z,n,v,D,w){return H([z,n,v],{i18n:w,templateString:D,qDefaultFilter:null,qRequiredFilter:null,searchOnStart:!0,searchContext:null,wabWidget:null,_dfd:null,postCreate:function(){this.inherited(arguments);E.forEach(this.getComponents(),function(J){J.searchPane=this},this)},startup:function(){this._started||(this.inherited(arguments),this.bindEvents(),this.searchOnStart&&this.search())},_onFilterPlaceholderChanged:function(){A.contains(this.filterPlaceholder,"opened")?(A.remove(this.filterPlaceholder,
"opened"),A.remove(this.filterWrapper,"show")):(this.filterWrapper.style.top=this.headerNode.clientHeight+"px",A.add(this.filterPlaceholder,"opened"),A.add(this.filterWrapper,"show"))},_onSearchBoxPlaceholderChanged:function(){},bindEvents:function(){this.own(B(this.filterPlaceholder,"click",x.hitch(this,this._onFilterPlaceholderChanged)))},buildQueryParams:function(J){var F=null;"string"===typeof this.qRequiredFilter&&0<this.qRequiredFilter.length&&(F=this.qRequiredFilter);var L={q:F,canSortByRelevance:!1};
E.forEach(this.getComponents(),function(O){O.appendQueryParams(L,J)});delete L.canSortByRelevance;null===L.q&&"string"===typeof this.qDefaultFilter&&0<this.qDefaultFilter.length&&(L.q=this.qDefaultFilter);return L},getComponents:function(){return[this.searchBox,this.bboxOption,this.scopeOptions,this.typeOptions,this.sortOptions,this.resultsPane,this.paging,this.resultCount]},resize:function(){this.contentNode.style.top=this.headerNode.clientHeight+1+"px"},search:function(){var J=this,F={},L=this.buildQueryParams(F);
if(null!==L&&null!==L.q){L&&null===L.sortField&&(L.sortOrder="desc");var O=this.searchContext.portal;F.scopeIsArcGISOnline&&this.searchContext.arcgisOnlinePortal&&(O=this.searchContext.arcgisOnlinePortal);null!==this._dfd&&this._dfd.cancel("Search aborted.",!1);var S=null;this._dfd=S=O.queryItems(L).then(function(G){S.isCanceled()||(G.queryParams||(G.queryParams={start:G.start,num:G.num},G.nextQueryParams||"undefined"===typeof G.nextStart||-1===G.nextStart||(G.nextQueryParams={start:G.nextStart})),
E.forEach(J.getComponents(),function(M){M.processResults(G)}))}).otherwise(function(G){console.warn("searchError",G)})}},_showLayers:function(){this.wabWidget&&this.wabWidget.showLayers()}})})},"widgets/AddData/search/SearchBox":function(){define("dojo/_base/declare dojo/_base/lang dojo/on dojo/keys ./SearchComponent dojo/text!./templates/SearchBox.html dojo/i18n!../nls/strings".split(" "),function(H,x,E,B,A,z,n){return H([A],{i18n:n,templateString:z,postCreate:function(){this.inherited(arguments);
this._checkClearButton();this.own(E(this.searchTextBox,"keyup",x.hitch(this,function(v){this._checkClearButton();v.keyCode===B.ENTER&&this.search()})))},_checkClearButton:function(){},clearButtonClicked:function(){this.searchTextBox.value="";this._checkClearButton();this.search()},searchButtonClicked:function(){this.search()},appendQueryParams:function(v){var D=this.searchTextBox.value;null!==D&&(D=x.trim(D));null!==D&&0<D.length&&(v.canSortByRelevance=!0,D="("+D+")",v.q=null!==v.q&&0<v.q.length?
v.q+(" AND "+D):D)}})})},"widgets/AddData/search/SearchComponent":function(){define(["dojo/_base/declare","dijit/_WidgetBase","dijit/_TemplatedMixin","dijit/_WidgetsInTemplateMixin"],function(H,x,E,B){return H([x,E,B],{isSearchComponent:!0,searchPane:null,template:"\x3cdiv\x3e\x3c/div\x3e",postCreate:function(){this.inherited(arguments)},appendQueryParams:function(A,z){},processResults:function(A){},getConfig:function(){return this.searchPane&&this.searchPane.wabWidget&&this.searchPane.wabWidget.config?
this.searchPane.wabWidget.config:{}},getMap:function(){return this.searchPane&&this.searchPane.wabWidget?this.searchPane.wabWidget.map:null},search:function(){this.searchPane&&this.searchPane.search()}})})},"widgets/AddData/search/BBoxOption":function(){define(["dojo/_base/declare","./SearchComponent","dojo/text!./templates/BBoxOption.html","dojo/i18n!../nls/strings","dijit/form/CheckBox"],function(H,x,E,B){return H([x],{i18n:B,templateString:E,postCreate:function(){this.inherited(arguments);this.bboxToggle.set("checked",
!0)},bboxClicked:function(){this.search()},_getBBox:function(){var A;if(A=this.getMap())if(A=A.geographicExtent)return A.xmin+","+A.ymin+","+A.xmax+","+A.ymax;return null},appendQueryParams:function(A){if(this.bboxToggle.get("checked")){var z=this._getBBox();null!==z&&(A.canSortByRelevance=!0,A.bbox=z)}}})})},"widgets/AddData/search/ScopeOptions":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/dom-class ./SearchComponent dojo/text!./templates/ScopeOptions.html dojo/i18n!../nls/strings ./util".split(" "),
function(H,x,E,B,A,z,n,v){return H([A],{i18n:n,templateString:z,curatedFilter:null,postCreate:function(){this.inherited(arguments)},startup:function(){this._started||(this.inherited(arguments),this.initOptions())},hideDropdown:function(){B.remove(this.scopePlaceholder,"opened");B.remove(this.btnGroup,"show")},initOptions:function(){var D=this.searchPane.searchContext,w="string"===typeof D.username&&0<D.username.length,J=this.getConfig().scopeOptions;this.curatedFilter=J.Curated.filter;var F=null;
D=function(L,O){var S=J[L];S&&S.allow?("string"===typeof S.label&&0<x.trim(S.label).length?v.setNodeText(O,x.trim(S.label)):w||"MyOrganization"!==L||v.setNodeText(O,n.search.scopeOptions.anonymousContent),J.defaultScope===L&&(F=O)):O.style.display="none"};D("MyContent",this.MyContentToggle);D("MyOrganization",this.MyOrganizationToggle);D("Curated",this.CuratedToggle);D("ArcGISOnline",this.ArcGISOnlineToggle);F||(J.MyOrganization.allow?F=this.MyOrganizationToggle:J.ArcGISOnline.allow?F=this.ArcGISOnlineToggle:
J.Curated.allow?F=this.CuratedToggle:J.MyContent.allow&&(F=this.MyContentToggle));F&&(B.add(F,"active"),this.scopePlaceholderText.innerHTML=F.innerHTML)},optionClicked:function(D){this.toggleClassName(D);this.hideDropdown();this.search()},scopePlaceholderClicked:function(D){D.preventDefault();B.contains(this.scopePlaceholder,"opened")?this.hideDropdown():this.showDropdown()},showDropdown:function(){B.add(this.scopePlaceholder,"opened");B.add(this.btnGroup,"show")},toggleClassName:function(D){E.forEach(this.btnGroup.children,
function(w){B.remove(w,"active")});B.add(D.target,"active");this.scopePlaceholderText.innerHTML=D.target.innerHTML},appendQueryParams:function(D,w){var J=null;E.some(this.btnGroup.children,function(M){if(B.contains(M,"active"))return J=M.getAttribute("data-option-name"),!0});"undefined"===typeof J&&(J=null);var F=null,L=this.curatedFilter,O=this.searchPane.searchContext,S=O.username,G=O.orgId;"MyContent"===J?"string"===typeof S&&0<S.length&&(F="(owner:"+v.escapeForLucene(S)+")"):"MyOrganization"===
J?"string"===typeof G&&0<G.length&&(F="(orgid:"+v.escapeForLucene(G)+")"):"Curated"===J?"string"===typeof L&&0<L.length&&(F=L):"ArcGISOnline"===J&&O.allowArcGISOnline&&(w.scopeIsArcGISOnline=!0);null!==F&&0<F.length&&(F="("+F+")",D.q=null!==D.q&&0<D.q.length?D.q+(" AND "+F):F)}})})},"widgets/AddData/search/TypeOptions":function(){define("dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/on ./SearchComponent dojo/text!./templates/TypeOptions.html dojo/i18n!../nls/strings esri/layers/VectorTileLayer dijit/TooltipDialog dijit/form/DropDownButton jimu/dijit/CheckBox".split(" "),
function(H,x,E,B,A,z,n,v){return H([A],{i18n:n,templateString:z,postCreate:function(){this.inherited(arguments);v&&v.supported()||(console.warn("AddData: Vector Tile is not supported."),this.vectorTileNode.style.display="none");this.own(B(this.tooltipDialog,"open",E.hitch(this,function(){this.tooltipDialog.domNode.className+=" "+this.searchPane.wabWidget.appConfig.theme.name})));this.own(B(this.mapServiceToggle,"change",E.hitch(this,function(){this.search()})));this.own(B(this.featureServiceToggle,
"change",E.hitch(this,function(){this.search()})));this.own(B(this.imageServiceToggle,"change",E.hitch(this,function(){this.search()})));this.own(B(this.vectorTileServiceToggle,"change",E.hitch(this,function(){this.search()})));this.own(B(this.kmlToggle,"change",E.hitch(this,function(){this.search()})));this.own(B(this.wmsToggle,"change",E.hitch(this,function(){this.search()})));this.own(B(this.wfsToggle,"change",E.hitch(this,function(){this.search()})));this.own(B(this.wmtsToggle,"change",E.hitch(this,
function(){this.search()})))},getOptionWidgets:function(){return[this.mapServiceToggle,this.featureServiceToggle,this.imageServiceToggle,this.vectorTileServiceToggle,this.kmlToggle,this.wmsToggle,this.wfsToggle,this.wmtsToggle]},optionClicked:function(){},appendQueryParams:function(D){var w=function(O,S){0<O.length&&(O+=" OR ");return O+S},J="",F="",L=!1;x.forEach(this.getOptionWidgets(),function(O){var S=O.domNode.getAttribute("data-option-q");F=w(F,S);O.getValue()&&(J=w(J,S),L=!0)});L||(J=F);null!==
J&&0<J.length&&(J="("+J+")",D.q=null!==D.q&&0<D.q.length?D.q+(" AND "+J):J)}})})},"esri/layers/VectorTileLayer":function(){(function(){var H=function(){try{var E=window.WebGLRenderingContext}catch(D){E=!1}try{for(var B=document.createElement("canvas"),A=["webgl","experimental-webgl","webkit-3d","moz-webgl"],z=null,n=0;n<A.length;++n){try{z=B.getContext(A[n])}catch(D){}if(z)break}var v=z}catch(D){v=!1}return E&&v?!0:!1}(),x=["dojo/_base/lang","dojo/has","dojo/Deferred","../sniff","./layer"];H&&x.push("./VectorTileLayerImpl");
define(x,function(E,B,A,z,n,v){n=v?v:n.createSubclass({declaredClass:"esri.layers.VectorTileLayer",constructor:function(){var D=new A;D.reject(Error("esri.layers.VectorTileLayer is not supported"));D.promise.otherwise(E.hitch(this,function(w){this._errorHandler(w)}))}});n.ACCESS_TOKEN=null;n.supported=function(){return H};B("extend-esri")&&E.setObject("layers.VectorTileLayer",n,z);return n})})()},"widgets/AddData/search/SortOptions":function(){define("dojo/_base/declare dojo/on dojo/dom-class ./SearchComponent dojo/text!./templates/SortOptions.html dojo/i18n!../nls/strings dijit/form/Select".split(" "),
function(H,x,E,B,A,z){return H([B],{i18n:z,templateString:A,sortField:null,sortOrder:null,postCreate:function(){this.inherited(arguments);this.updateSortOrderButton();var n=this;this.own(this.sortSelect.on("change",function(){var v=n.sortField=n.sortSelect.get("value");if(""===v)n.sortOrder=null;else if("title"===v||"owner"===v)n.sortOrder="asc";else if("avgrating"===v||"numviews"===v||"modified"===v)n.sortOrder="desc";n.updateSortOrderButton();n.search()}));this.own(x(this.sortSelect.dropDown,"open",
function(){var v=this.domNode.parentElement;v&&E.add(v,"add-data-widget-popup")}))},sortOrderClicked:function(){"asc"===this.sortOrder?(this.sortOrder="desc",this.updateSortOrderButton(),this.search()):"desc"===this.sortOrder&&(this.sortOrder="asc",this.updateSortOrderButton(),this.search())},updateSortOrderButton:function(){var n=this.sortOrderBtn;n.style.visibility=null!==this.sortField&&0<this.sortField.length?"visible":"hidden";"desc"===this.sortOrder?E.add(n,"descending"):E.remove(n,"descending")},
appendQueryParams:function(n){n.sortField=null;n.sortOrder=null;var v=this.sortField,D=this.sortOrder;null!==v&&0<v.length?(n.sortField=v,null!==D&&0<D.length&&(n.sortOrder=D)):n.canSortByRelevance||(n.sortField="numviews",n.sortOrder="desc")}})})},"widgets/AddData/search/ResultsPane":function(){define("dojo/_base/declare dojo/_base/array ./SearchComponent dojo/text!./templates/ResultsPane.html dojo/i18n!../nls/strings ./ItemCard ./util".split(" "),function(H,x,E,B,A,z,n){return H([E],{i18n:A,templateString:B,
postCreate:function(){this.inherited(arguments)},addItem:function(v){v.placeAt(this.itemsNode)},destroyItems:function(){this.noMatchNode.style.display="none";this.noMatchNode.innerHTML="";this.destroyDescendants(!1)},showNoMatch:function(){n.setNodeText(this.noMatchNode,A.search.resultsPane.noMatch);this.noMatchNode.style.display="block"},processResults:function(v){this.destroyItems();var D=v.results;if(D&&0<D.length){var w=n.findLayersAdded(this.getMap(),null).itemIds;x.forEach(v.results,function(J){this.addItem(new z({item:J,
canRemove:-1!==w.indexOf(J.id),resultsPane:this}))},this)}else this.showNoMatch()}})})},"widgets/AddData/search/ItemCard":function(){define("dojo/_base/declare dojo/_base/array dojo/date/locale dojo/dom-class dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./templates/ItemCard.html dojo/i18n!../nls/strings ./util ./LayerLoader".split(" "),function(H,x,E,B,A,z,n,v,D,w,J){return H([A,z,n],{i18n:D,templateString:v,canRemove:!1,item:null,resultsPane:null,_dfd:null,postCreate:function(){this.inherited(arguments)},
startup:function(){this._started||(this.inherited(arguments),this.render())},addClicked:function(){var F=this,L=this.addButton;if(!B.contains(L,"disabled"))if(B.add(L,"disabled"),this.canRemove){var O=this.resultsPane.getMap();w.setNodeText(F.messageNode,D.search.item.messages.removing);var S=w.findLayersAdded(O,this.item.id).layers;x.forEach(S,function(G){O.removeLayer(G)});this.canRemove=!1;w.setNodeText(F.messageNode,"");w.setNodeText(this.addButton,D.search.item.actions.add);B.remove(L,"disabled")}else w.setNodeText(F.messageNode,
D.search.item.messages.adding),(new J).addItem(this.item,this.resultsPane.getMap()).then(function(G){G?(F.canRemove=!0,w.setNodeText(F.messageNode,""),w.setNodeText(F.addButton,D.search.item.actions.remove)):w.setNodeText(F.messageNode,D.search.item.messages.addFailed);B.remove(L,"disabled")}).otherwise(function(G){console.warn("Add layer failed.");console.warn(G);w.setNodeText(F.messageNode,D.search.item.messages.addFailed);B.remove(L,"disabled");G&&"string"===typeof G.message&&0<G.message.length&&
console.log("")})},detailsClicked:function(){var F=this.item;F=w.checkMixedContent(F.portalUrl)+"/home/item.html?id\x3d"+encodeURIComponent(F.id);window.open(F)},formatDate:function(F){"number"===typeof F&&(F=new Date(F));return E.format(F,{selector:"date",datePattern:D.search.item.dateFormat})},render:function(){w.setNodeText(this.titleNode,this.item.title);w.setNodeTitle(this.titleNode,this.item.title);this._renderThumbnail();this._renderTypeOwnerDate();this.canRemove&&w.setNodeText(this.addButton,
D.search.item.actions.remove)},_renderThumbnail:function(){var F=this.thumbnailNode,L=this.item.thumbnailUrl;F.innerHTML="";L=w.checkMixedContent(L);var O=document.createElement("IMG");O.src=L||"widgets/AddData/images/placeholder_120x80.png";F.appendChild(O)},_renderTypeOwnerDate:function(){var F=this.item;var L=D.search.item.types[F.type];if("undefined"===typeof L||null===L)L=F.type;L=D.search.item.typeByOwnerPattern.replace("{type}",L);L=L.replace("{owner}",F.owner);w.setNodeText(this.typeByOwnerNode,
L)}})})},"widgets/AddData/search/LayerLoader":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/promise/all dojo/Deferred dojo/json dojo/i18n!../nls/strings ./util esri/lang esri/request esri/arcgis/utils esri/layers/ArcGISDynamicMapServiceLayer esri/layers/ArcGISImageServiceLayer esri/layers/ArcGISTiledMapServiceLayer esri/layers/DynamicLayerInfo esri/layers/FeatureLayer esri/layers/ImageParameters esri/layers/ImageServiceParameters esri/layers/KMLLayer esri/layers/LayerDrawingOptions esri/layers/MosaicRule esri/layers/RasterFunction esri/layers/TileInfo esri/layers/VectorTileLayer esri/layers/WFSLayer esri/layers/WMSLayer esri/layers/WMSLayerInfo esri/layers/WMTSLayer esri/layers/WMTSLayerInfo esri/layers/WebTiledLayer esri/dijit/PopupTemplate esri/InfoTemplate esri/renderers/jsonUtils esri/geometry/Extent esri/SpatialReference jimu/utils".split(" "),
function(H,x,E,B,A,z,n,v,D,w,J,F,L,O,S,G,M,m,f,g,u,q,r,t,h,a,b,d,c,e,l,p,y,K,P,W,U){return H(null,{item:null,itemUrl:null,map:null,serviceUrl:null,constructor:function(k){x.mixin(this,k)},addItem:function(k,I){var C=new z;this.map=I;this.item=k;this.itemUrl=this._checkMixedContent(k.itemUrl);this.serviceUrl=this._checkMixedContent(k.url);if("Feature Service"===k.type)return this._addFeatureService();if("Image Service"===k.type)return this._addImageService();if("KML"===k.type)return this._addKML();
if("Map Service"===k.type)return this._addMapService();if("Vector Tile Service"===k.type)return this._addVectorTileService();if("WFS"===k.type)return this._addWFS();if("WMS"===k.type)return this._addWMS();if("WMTS"===k.type)return this._addWMTS();console.warn("Unsupported item type: ",k.type);C.resolve(null);return C},_addFeatureService:function(){var k=this,I=new z,C=this.serviceUrl,T=this.item,N={},V=null,Q=[],X=[];k._readItemJsonData().then(function(R){(N=R||{},N.layers)&&0<N.layers.length&&E.forEach(N.layers,
function(Y){"undefined"!==typeof Y.id&&null!==Y.id&&(null===V&&(V=[]),V.push(Y.id))});return k._readRestInfo(C)}).then(function(R){if(!R||"string"!==typeof R.type||"Feature Layer"!==R.type&&"Table"!==R.type){var Y=[];R&&R.layers&&0<R.layers.length&&E.forEach(R.layers,function(aa){Y.push(aa)});R&&R.tables&&0<R.tables.length&&E.forEach(R.tables,function(aa){Y.push(aa)});0<Y.length?E.forEach(Y,function(aa){var ca=!0;null!==V&&0<V.length&&(ca=E.some(V,function(da){return da===aa.id}));ca&&(ca=new M(C+
"/"+aa.id,{id:k._generateLayerId(),outFields:["*"]}),Q.push(k._waitForLayer(ca)))}):console.warn("No layers or tables...")}else R=new M(C,{id:k._generateLayerId(),outFields:["*"]}),Q.push(k._waitForLayer(R));return A(Q)}).then(function(R){E.forEach(R,function(Y){X.push(Y)});X.reverse();return X}).then(function(){E.forEach(X,function(R){var Y=k._processFeatureLayer(R,T,N);R.arcgisProps={title:Y.title};R._titleForLegend=Y.title;w.isDefined(R.title)||(R.title=Y.title);k._addLayer(R)})}).then(function(){I.resolve(X)}).otherwise(function(R){I.reject(R)});
return I},_addImageService:function(){var k=this,I=new z;k._readItemJsonData().then(function(C){return k._newImageServiceLayer(C||{})}).then(function(C){k._addLayer(C);I.resolve(C)}).otherwise(function(C){I.reject(C)});return I},_addKML:function(){var k=this,I=new z;k._newKMLLayer().then(function(C){C&&(C.title=k.item.title);k._addLayer(C);I.resolve(C)}).otherwise(function(C){I.reject(C)});return I},_addMapService:function(){var k=this,I=new z;k._readItemJsonData().then(function(C){return k._newMapServiceLayer(C||
{})}).then(function(C){k._addLayer(C);I.resolve(C)}).otherwise(function(C){I.reject(C)});return I},_addVectorTileService:function(){var k=this,I=new z;k._newVectorTileLayer().then(function(C){k._addLayer(C);I.resolve(C)}).otherwise(function(C){I.reject(C)});return I},_addWFS:function(){var k=this,I=new z;k._readItemJsonData().then(function(C){return k._newWFSLayer(C||{})}).then(function(C){C&&(C.title=k.item.title);k._addLayer(C);I.resolve(C)}).otherwise(function(C){console.log("Error adding WFS",
C);I.reject(C)});return I},_addWMS:function(){var k=this,I=new z;k._readItemJsonData().then(function(C){return k._newWMSLayer(C||{})}).then(function(C){C&&(C.title=k.item.title);k._addLayer(C);I.resolve(C)}).otherwise(function(C){I.reject(C)});return I},_addWMTS:function(){var k=this,I=new z;k._readItemJsonData().then(function(C){return k._newWMTSLayer(C||{})}).then(function(C){C&&(C.title=k.item.title);k._addLayer(C);I.resolve(C)}).otherwise(function(C){I.reject(C)});return I},_addLayer:function(k){var I=
this.item;k&&(k.xtnItemId=I.id,k.xtnAddData=!0,!k.arcgisProps&&I&&(k.arcgisProps={title:I.title},k._titleForLegend=I.title),w.isDefined(k.title)||(k.title=I.title),k._wabProperties={itemLayerInfo:{itemId:I.id,itemUrl:this.itemUrl,portalUrl:I.portalUrl}},this.map.addLayer(k))},_checkMixedContent:function(k){return D.checkMixedContent(k)},_checkUrl:function(k){return F._checkUrl(k)},_checkVectorTileUrl:function(k,I){var C=new z;if(function(N,V){return-1!==N.indexOf(V,N.length-V.length)}(k,".json"))return I.styleUrl=
k,C.resolve(k),C;var T={url:null,content:{},handleAs:"json",callbackParamName:"callback"};this.itemUrl?(T.url=this.itemUrl+"/resources/styles/root.json",J(T,{}).then(function(){I.styleUrl=T.url;C.resolve(T.url)}).otherwise(function(){T.url=k+"/resources/styles/root.json";J(T,{}).then(function(){I.styleUrl=T.url;C.resolve(T.url)}).otherwise(function(){I.url=k;C.resolve(k)})})):(T.url=k+"/resources/styles/root.json",J(T,{}).then(function(){I.styleUrl=T.url;C.resolve(T.url)}).otherwise(function(){I.url=
k;C.resolve(k)}));return C},_generateLayerId:function(){return this._generateLayerIds(1)[0]},_generateLayerIds:function(k){var I,C=[];for(I=0;I<k;I++)C.push(this._generateRandomId());return C},_generateRandomId:function(){var k=null;k="function"===typeof Date.now?Date.now():(new Date).getTime();var I=(""+Math.random()).replace("0.","r");return(k+""+I).replace(/-/g,"")},_makeFeatureLayerTitle:function(k,I,C){try{if(I&&C&&I===C)return I;if(I&&C){var T=C.indexOf(I);if(0===T){var N=C.substring(T+I.length+
1);if(13<=N.length){var V=/^\d+$/;if(V.test(N))return I}}}}catch(Q){}return k.replace("{serviceName}",I).replace("{layerName}",C)},_newImageServiceLayer:function(k){var I=new z,C=this._generateLayerId(),T=this.serviceUrl,N={mapLayerId:C,bandIds:null,format:null,compressionQuality:null,opacity:1,visibility:!0};w.isDefined(k.visibility)&&!1===k.visibility&&(N.visibility=!1);w.isDefined(k.opacity)&&(N.opacity=k.opacity);w.isDefined(k.minScale)&&!w.isDefined(N.minScale)&&(N.minScale=k.minScale);w.isDefined(k.maxScale)&&
!w.isDefined(N.maxScale)&&(N.maxScale=k.maxScale);w.isDefined(k.refreshInterval)&&!w.isDefined(N.refreshInterval)&&(N.refreshInterval=k.refreshInterval);!k.popupInfo||N.popupInfo||N.disablePopup||(N.popupInfo=k.popupInfo);k.renderingRule&&!N.renderingRule&&(N.renderingRule=k.renderingRule,k.renderingRule.functionName&&(N.renderingRule.rasterFunction=k.renderingRule.functionName));k.bandIds&&!N.bandIds&&(N.bandIds=k.bandIds);k.mosaicRule&&!N.mosaicRule&&(N.mosaicRule=k.mosaicRule);k.format&&!N.format&&
(N.format=k.format);w.isDefined(k.compressionQuality)&&!w.isDefined(N.compressionQuality)&&(N.compressionQuality=k.compressionQuality);!k.layerDefinition||!k.layerDefinition.definitionExpression||w.isDefined(N.layerDefinition)&&w.isDefined(N.layerDefinition.definitionExpression)||(N.layerDefinition=N.layerDefinition||{},N.layerDefinition.definitionExpression=k.layerDefinition.definitionExpression);k=new f;null!==N.bandIds&&(k.bandIds=N.bandIds);null!==N.format&&(k.format=N.format,null!==N.compressionQuality&&
(k.compressionQuality=N.compressionQuality));N.renderingRule&&N.renderingRule.rasterFunction&&(C=new r(N.renderingRule),k.renderingRule=C);N.mosaicRule&&(C=new q(N.mosaicRule),k.mosaicRule=C);w.isDefined(N.noData)&&(k.noData=N.noData);w.isDefined(N.noDataInterpretation)&&(k.noDataInterpretation=N.noDataInterpretation);w.isDefined(N.interpolation)&&(k.interpolation=N.interpolation);k={imageServiceParameters:k,opacity:N.opacity,visible:N.visibility};w.isDefined(N.mapLayerId)&&(k.id=N.mapLayerId);w.isDefined(N.minScale)&&
(k.minScale=N.minScale);w.isDefined(N.maxScale)&&(k.maxScale=N.maxScale);w.isDefined(N.refreshInterval)&&(k.refreshInterval=N.refreshInterval);w.isDefined(N.resourceInfo)&&(k.resourceInfo=N.resourceInfo);T=new O(this._checkUrl(T),k);this._waitForLayer(T).then(function(V){N.layerDefinition&&N.layerDefinition.definitionExpression&&V.setDefinitionExpression(N.layerDefinition.definitionExpression,!0);!N.disablePopup&&N.popupInfo&&V.setInfoTemplate(new p(N.popupInfo));I.resolve(V)},function(V){I.reject(V)});
return I},_newInfoTemplate:function(k,I){if(k)try{return new p({description:k.description,title:k.title,showAttachments:k.showAttachments,fieldInfos:k.fieldInfos,mediaInfos:k.mediaInfos})}catch(C){console.error(C)}k=new y;w.isDefined(I)&&k.setTitle(I);return k},_newKMLLayer:function(){var k={id:this._generateLayerId()};k=new g(this.serviceUrl,k);return this._waitForLayer(k)},_newMapServiceLayer:function(k){var I=this,C=new z,T=this.serviceUrl,N=this._generateLayerId();J({url:T,content:{f:"json"},
handleAs:"json",callbackParamName:"callback"},{}).then(function(V){var Q=null;Q={id:N};if(V.tileInfo)Q=new S(T,Q);else if(V&&V.supportedImageFormatTypes&&-1!==V.supportedImageFormatTypes.indexOf("PNG32")&&(Q.imageParameters=new m,Q.imageParameters.format="png32"),Q=new L(T,Q),k&&k.layers&&0<k.layers.length){var X=[],R,Y=[],aa,ca=[],da;E.forEach(k.layers,function(Z){Z.layerDefinition&&Z.layerDefinition.definitionExpression&&(X[Z.id]=Z.layerDefinition.definitionExpression);if(Z.layerDefinition&&Z.layerDefinition.source){R=
null;da=Z.layerDefinition.source;if("mapLayer"===da.type){var ba=E.filter(V.layers,function(ea){return ea.id===da.mapLayerId});ba.length&&(R=x.mixin(ba[0],Z))}else R=x.mixin({},Z);R&&(R.source=da,delete R.popupInfo,R=new G(R),k.visibleLayers&&(ba="string"===typeof k.visibleLayers?k.visibleLayers.split(","):k.visibleLayers,-1<E.indexOf(ba,Z.id)?R.defaultVisibility=!0:R.defaultVisibility=!1),Y.push(R))}Z.layerDefinition&&Z.layerDefinition.source&&Z.layerDefinition.drawingInfo&&(aa=new u(Z.layerDefinition.drawingInfo),
ca[Z.id]=aa)});0<X.length&&Q.setLayerDefinitions(X);0<Y.length&&(Q.setDynamicLayerInfos(Y,!0),0<ca.length&&Q.setLayerDrawingOptions(ca,!0))}I._waitForLayer(Q).then(function(Z){var ba=null;E.forEach(Z.layerInfos,function(ea){var fa=null;k&&E.some(k.layers,function(ia){if(ea.id===ia.id)return fa=ia,!0});var ha=null;fa&&fa.popupInfo&&(ha=fa.popupInfo);ha&&(null===ba&&(ba={}),ba[ea.id]={infoTemplate:I._newInfoTemplate(ha,ea.name)})});null===Z.infoTemplates&&(ba?Z.infoTemplates=ba:I._setDynamicLayerInfoTemplates(Z));
C.resolve(Z)},function(Z){C.reject(Z)})},function(V){C.reject(V)});return C},_getVisibleFeatureLayers:function(k,I){if(!k||!I||0===I.length)return[];I=","+I+",";var C=[],T,N=",";for(T=0;T<k.length;T++)if(null!==k[T].subLayerIds){if(-1===I.indexOf(","+k[T].id+",")||-1<N.indexOf(","+k[T].id+","))N+=k[T].subLayerIds.toString()+","}else-1<I.indexOf(","+k[T].id+",")&&-1===N.indexOf(","+k[T].id+",")&&C.push(k[T].id);return C},_newPopupInfo:function(k,I){if(k&&k.fields){var C={title:k.name,fieldInfos:[],
description:null,showAttachments:!0,mediaInfos:[]};"string"===typeof I&&0<I.length&&(C.title=I);E.forEach(k.fields,function(T){var N=U.getDefaultPortalFieldInfo(T);N.visible=!0;N.isEditable=T.editable;C.fieldInfos.push(N)});return C}return null},_newVectorTileLayer:function(){var k=this,I=new z,C={},T=this.serviceUrl,N=this._generateLayerId();"string"===typeof T&&0<T.length?this._checkVectorTileUrl(T,C).then(function(V){"string"===typeof V&&0<V.length?(V=k._checkMixedContent(V),V=new h(V,{id:N,opacity:1,
visible:!0}),k._waitForLayer(V).then(function(Q){I.resolve(Q)},function(Q){I.reject(Q)})):I.resolve(null)},function(V){I.reject(V)}):I.resolve(null);return I},_newWFSLayer:function(k){var I=new z;try{var C=this._generateLayerId();if(k&&k.wfsInfo&&k.layerDefinition)var T={id:C,mode:k.mode,showLabels:!0,title:k.title,url:this._checkMixedContent(k.url),customParameters:k.wfsInfo.customParameters,maxFeatures:k.wfsInfo.maxFeatures,name:k.wfsInfo.name,swapXY:k.wfsInfo.swapXY,version:k.wfsInfo.version,geometryType:k.layerDefinition.geometryType,
labelingInfo:k.layerDefinition.drawingInfo.labelingInfo};else{var N=this.serviceUrl;N?D.loadWFSByUrl(I,map,this,N,C,!1):I.reject(Error("Error adding WFS, no URL"));return I}var V=new a,Q=V.on("error",function(X){Q&&Q.remove();I.reject(X.error)});V.fromJson(T,function(){try{Q&&Q.remove();if(k&&k.wfsInfo&&k.layerDefinition){w.isDefined(k.opacity)&&V.setOpacity(k.opacity);w.isDefined(k.visibility)&&V.setVisibility(k.visibility);(k.minScale||k.maxScale)&&V.setScaleRange(k.minScale,k.maxScale);var X=k.layerDefinition.drawingInfo;
X&&X.renderer&&(V.renderer=K.fromJson(X.renderer,{geometryType:T.geometryType}));k.popupInfo&&V.setInfoTemplate(new p(k.popupInfo))}I.resolve(V)}catch(R){console.error("Error adding WFS",R),I.reject(ex)}})}catch(X){console.error("Error adding WFS",X),I.reject(X)}return I},_newWMSLayer:function(k){var I=this,C=this.item,T=!1,N=null,V={id:this._generateLayerId()};if(k){var Q=[],X=[];E.forEach(k.layers,function(R){T=!0;X.push(new d({name:R.name,title:R.title,legendURL:R.legendURL,queryable:R.queryable,
showPopup:R.showPopup}));Q.push(R.name)},this);k.visibleLayers&&(Q=k.visibleLayers);V={customLayerParameters:k.customLayerParameters,customParameters:k.customParameters,layerInfos:X,version:k.version,maxWidth:k.maxWidth,maxHeight:k.maxHeight,featureInfoFormat:k.featureInfoFormat,getFeatureInfoURL:k.featureInfoUrl,getMapURL:k.mapUrl,spatialReferences:k.spatialReferences,title:k.title,copyright:k.copyright,minScale:k.minScale||0,maxScale:k.maxScale||0,format:k.format};C&&C.extent&&(C=new P(C.extent[0][0],
C.extent[0][1],C.extent[1][0],C.extent[1][1],new W({wkid:4326})),V.extent=C);k.spatialReferences&&0<k.spatialReferences.length&&(N=k.spatialReferences[0]);V={id:this._generateLayerId(),visibleLayers:Q,format:"png",transparent:k.firstLayer?!1:!0,opacity:k.opacity,visible:null!==k.visibility?k.visibility:!0,resourceInfo:V,refreshInterval:k.refreshInterval}}k=new b(this.serviceUrl,V);k=this._waitForLayer(k);k.then(function(R){T||I._setWMSVisibleLayers(R);N&&R.spatialReference&&(R.spatialReference.wkid=
N)});return k},_newWMTSLayer:function(k){if(k){var I=new l(k.templateUrl,{id:this._generateLayerId(),visible:null!==k.visibility?k.visibility:!0,opacity:k.opacity,copyright:k.copyright,fullExtent:k.fullExtent&&new P(k.fullExtent),initialExtent:k.fullExtent&&new P(k.fullExtent),subDomains:k.subDomains,tileInfo:k.tileInfo?new t(k.tileInfo):null,refreshInterval:k.refreshInterval,wmtsInfo:k.wmtsInfo});if(w.isDefined(k.minScale)||w.isDefined(k.maxScale))I.loaded?I.setScaleRange(k.minScale,k.maxScale):
B.connect(I,"onLoad",function(){I.setScaleRange(k.minScale,k.maxScale)});return this._waitForLayer(I)}var C=new z;C.resolve();return C},_processFeatureLayer:function(k,I,C){var T=this,N=v.search.featureLayerTitlePattern,V=null;C&&C.layers&&0<C.layers.length?E.some(C.layers,function(Q){var X=!1;if(Q.id===k.layerId){if(Q.popupInfo){var R=Q.popupInfo;R=n.parse(n.stringify(R));R=new p(R);k.setInfoTemplate(R);X=!0}w.isDefined(Q.showLabels)&&k.setShowLabels(Q.showLabels);w.isDefined(Q.refreshInterval)&&
k.setRefreshInterval(Q.refreshInterval);w.isDefined(Q.showLegend)&&console.log("");w.isDefined(Q.timeAnimation)&&!1===Q.timeAnimation&&console.log("");if(R=Q.layerDefinition){R.definitionExpression&&k.setDefinitionExpression(R.definitionExpression);R.displayField&&k.displayField(R.displayField);if(R.drawingInfo){if(R.drawingInfo.renderer){var Y=n.parse(n.stringify(R.drawingInfo.renderer));var aa=K.fromJson(Y);Y.type&&"classBreaks"===Y.type&&(aa.isMaxInclusive=!0);k.setRenderer(aa)}w.isDefined(R.drawingInfo.transparency)&&
k.setOpacity(1-R.drawingInfo.transparency/100)}w.isDefined(R.minScale)&&k.setMinScale(R.minScale);w.isDefined(R.maxScale)&&k.setMaxScale(R.maxScale);w.isDefined(R.defaultVisibility)&&!1===R.defaultVisibility&&k.setVisibility(!1)}X||T._setFeatureLayerInfoTemplate(k,Q.popupInfo);V={url:k.url,id:k.id,itemId:I.id,title:T._makeFeatureLayerTitle(N,I.title,k.name)};return!0}}):(V={url:k.url,id:k.id,itemId:I.id,title:T._makeFeatureLayerTitle(N,I.title,k.name)},T._setFeatureLayerInfoTemplate(k,null,V.title));
return V},_readItemJsonData:function(){return J({url:this.itemUrl+"/data",content:{f:"json"},handleAs:"json"},{})},_readRestInfo:function(k){return J({url:k,content:{f:"json"},handleAs:"json",callbackParamName:"callback"},{})},_setDynamicLayerInfoTemplates:function(k){var I=this,C=null,T=[],N=function(V){var Q=I._readRestInfo(k.url+"/"+V.id);Q.then(function(X){try{var R=I._newPopupInfo(X);R&&(C[V.id]={infoTemplate:I._newInfoTemplate(R)})}catch(Y){console.warn("Error setting popup."),console.error(Y)}});
return Q};null===k.infoTemplates&&E.forEach(k.layerInfos,function(V){null===C&&(C={});V.subLayerIds||T.push(N(V))});0<T.length&&A(T).then(function(){C&&(k.infoTemplates=C)}).otherwise(function(V){console.warn("Error reading sublayers.");console.error(V)})},_setFeatureLayerInfoTemplate:function(k,I,C){I||(I=this._newPopupInfo(k,C));I=this._newInfoTemplate(I,C);k.setInfoTemplate(I)},_setWMSVisibleLayers:function(k){var I=[];k&&(E.some(k.layerInfos,function(C){if("string"===typeof C.name&&0<C.name.length)if(10>
I.length)I.push(C.name);else return!0}),10>=I.length&&k.setVisibleLayers(I))},_waitForLayer:function(k){var I=new z,C=[];if(k.loaded)return I.resolve(k),I;if(k.loadError)return I.reject(k.loadError),I;var T=function(){E.forEach(C,function(N){N.remove()})};C.push(k.on("load",function(N){T();I.resolve(N.layer)}));C.push(k.on("error",function(N){T();N=N.error;try{N.message&&-1!==N.message.indexOf("Unable to complete")?(console.warn("layerAccessError",N),I.reject(Error(v.search.layerInaccessible))):I.reject(N)}catch(V){I.reject(N)}}));
return I}})})},"esri/layers/ImageServiceParameters":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../lang".split(" "),function(H,x,E,B,A,z){H=H(null,{declaredClass:"esri.layers.ImageServiceParameters",extent:null,width:null,height:null,imageSpatialReference:null,format:null,interpolation:null,compressionQuality:null,bandIds:null,timeExtent:null,mosaicRule:null,renderingRule:null,renderer:null,noData:null,compressionTolerance:null,adjustAspectRatio:null,lercVersion:null,
toJson:function(n){var v=this.bbox||this.extent;n=(v=v&&n&&v._normalize(!0))?v.spatialReference.wkid||E.toJson(v.spatialReference.toJson()):null;var D=this.imageSpatialReference;v={bbox:v?v.xmin+","+v.ymin+","+v.xmax+","+v.ymax:null,bboxSR:n,size:null!==this.width&&null!==this.height?this.width+","+this.height:null,imageSR:D?D.wkid||E.toJson(D.toJson()):n,format:this.format,interpolation:this.interpolation,compressionQuality:this.compressionQuality,bandIds:this.bandIds?this.bandIds.join(","):null,
mosaicRule:this.mosaicRule?E.toJson(this.mosaicRule.toJson()):null,renderingRule:this.renderingRule?E.toJson(this.renderingRule.toJson()):null,renderer:this.renderer?E.toJson(this.renderer.toJson()):null,noData:this.noData,noDataInterpretation:this.noDataInterpretation,compressionTolerance:this.compressionTolerance,adjustAspectRatio:this.adjustAspectRatio,lercVersion:this.lercVersion};n=this.timeExtent;v.time=n?n.toJson().join(","):null;return z.filter(v,function(w){if(null!==w&&void 0!==w)return!0})}});
x.mixin(H,{INTERPOLATION_BILINEAR:"RSP_BilinearInterpolation",INTERPOLATION_CUBICCONVOLUTION:"RSP_CubicConvolution",INTERPOLATION_MAJORITY:"RSP_Majority",INTERPOLATION_NEARESTNEIGHBOR:"RSP_NearestNeighbor",NODATA_MATCH_ALL:"esriNoDataMatchAll",NODATA_MATCH_ANY:"esriNoDataMatchAny"});B("extend-esri")&&x.setObject("layers.ImageServiceParameters",H,A);return H})},"esri/layers/KMLLayer":function(){define("dojo/_base/kernel dojo/_base/declare dojo/_base/connect dojo/_base/lang dojo/_base/array dojo/_base/json dojo/_base/sniff dojo/io-query dojo/dom-construct dojo/dom-style ../kernel ../config ../lang ../request ../urlUtils ../SpatialReference ../geometry/webMercatorUtils ../dijit/PopupTemplate ./layer ./KMLFolder ./KMLGroundOverlay ./MapImageLayer ./FeatureLayer".split(" "),
function(H,x,E,B,A,z,n,v,D,w,J,F,L,O,S,G,M,m,f,g,u,q,r){var t=x([f],{declaredClass:"esri.layers.KMLLayer",serviceUrl:S.getProtocolForWebResource()+"//utility.arcgis.com/sharing/kml",constructor:function(h,a){h||console.log("KMLLayer:constructor - please provide url for the KML file");this._url=S.urlToObject(this.url=h);this._outSR=a&&a.outSR||new G({wkid:4326});this._options=B.mixin({},a);F.defaults.kmlService&&(this.serviceUrl=F.defaults.kmlService);if(h=this.linkInfo=a&&a.linkInfo)this.visible=
!!h.visibility,this._waitingForMap=!!h.viewFormat;(!h||h&&h.visibility&&!this._waitingForMap)&&this._parseKml();this.refresh=B.hitch(this,this.refresh);this.registerConnectEvents("esri.layers.KMLLayer",!0)},getFeature:function(h){if(h){var a=h.type,b=h.id,d;switch(a){case "esriGeometryPoint":case "esriGeometryPolyline":case "esriGeometryPolygon":(h=this["_"+a])&&(d=B.getObject("_mode._featureMap."+b,!1,h));break;case "GroundOverlay":if(h=this._groundLyr){var c=h.getImages();a=c.length;for(h=0;h<a;h++)if(c[h].id===
b){d=c[h];break}}break;case "ScreenOverlay":break;case "NetworkLink":A.some(this._links,function(e){return e.linkInfo&&e.linkInfo.id===b?(d=e,!0):!1});break;case "Folder":a=(c=this.folders)?c.length:0;for(h=0;h<a;h++)if(c[h].id===b){d=c[h];break}break;default:console.log("KMLLayer:getFeature - unknown feature type")}return d}},getLayers:function(){var h=[];this._groundLyr&&h.push(this._groundLyr);this._fLayers&&(h=h.concat(this._fLayers));this._links&&A.forEach(this._links,function(a){a.declaredClass&&
h.push(a)});return h},setFolderVisibility:function(h,a){h&&(this._fireUpdateStart(),(h.visible=a)&&(a=this._areLocalAncestorsVisible(h)),this._setState(h,a),this._fireUpdateEnd())},_eventMap:{"network-link-error":["error"]},onRefresh:function(){},onOpacityChange:function(){},onNetworkLinkError:function(){},_parseKml:function(h){var a=this;this._fireUpdateStart();this._io=O({url:this.serviceUrl,content:{url:this._url.path+this._getQueryParameters(h),model:"simple",folders:"",refresh:this.loaded?!0:
void 0,outSR:z.toJson(this._outSR.toJson())},callbackParamName:"callback",load:function(b){a._io=null;a._initLayer(b)},error:function(b){a._io=null;b=B.mixin(Error(),b);b.message="Unable to load KML: "+(b.message||"");a._fireUpdateEnd(b);a._errorHandler(b)}})},_initLayer:function(h){if(this.loaded){var a=[];A.forEach(this.folders,function(y){y.visible&&a.push(y.id)});this._options.minScale=this.minScale;this._options.maxScale=this.maxScale;this._options.opacity=this.opacity;this._removeInternalLayers()}this.name=
h.name;this.description=h.description;this.snippet=h.snippet;this.visibility=h.visibility;this.featureInfos=h.featureInfos;var b,d=this.folders=h.folders,c=[];if(d){var e=d.length;for(b=0;b<e;b++){var l=d[b]=new g(d[b]);-1===l.parentFolderId&&c.push(l)}}d=this._links=h.networkLinks;e=d?d.length:0;for(b=0;b<e;b++)if(!d[b].viewRefreshMode||-1===d[b].viewRefreshMode.toLowerCase().indexOf("onregion")){var p=B.mixin({},this._options);p.linkInfo=d[b];p.id&&(p.id=p.id+"_"+b);l=d[b]=new t(d[b].href,p);l._parentLayer=
this;l._parentFolderId=this._getLinkParentId(l.linkInfo.id);l._linkErrorHandle=l.on("error,network-link-error",B.hitch(l,function(y){this._parentLayer.onNetworkLinkError(y.error)}))}if((d=h.groundOverlays)&&0<d.length)for(p=B.mixin({},this._options),p.id&&(p.id+="_mapImage"),l=this._groundLyr=new q(p),e=d.length,b=0;b<e;b++)l.addImage(new u(d[b]));(h=B.getObject("featureCollection.layers",!1,h))&&0<h.length&&(this._fLayers=[],A.forEach(h,function(y,K){var P=B.getObject("featureSet.features",!1,y);
P&&0<P.length&&(p=B.mixin({outFields:["*"],infoTemplate:y.popupInfo?new m(y.popupInfo):null,editable:!1},this._options),p.id&&(p.id=p.id+"_"+K),p.webgl=!1,y.layerDefinition.capabilities="Query,Data",y=new r(y,p),y.geometryType&&(this["_"+y.geometryType]=y),this._fLayers.push(y))},this),0===this._fLayers.length&&delete this._fLayers);if(!this.loaded)for(e=c.length,b=0;b<e;b++)l=c[b],this._setState(l,l.visible);this._fireUpdateEnd();this.loaded?(this._addInternalLayers(),A.forEach(this.folders,function(y){-1<
A.indexOf(a,y.id)?this.setFolderVisibility(y,!0):this.setFolderVisibility(y,!1)},this),this.onRefresh()):(this.loaded=!0,this.onLoad(this))},_addInternalLayers:function(){var h=this._map;this._fireUpdateStart();this._links&&A.forEach(this._links,function(c){c.declaredClass&&(h.addLayer(c),c._waitingForMap&&(c._waitingForMap=null,c.visible?c._parseKml(h):c._wMap=h))});var a=h.spatialReference,b=this._outSR;if(!a.equals(b))if(a.isWebMercator()&&4326===b.wkid)var d=M.geographicToWebMercator;else if(b.isWebMercator()&&
4326===a.wkid)d=M.webMercatorToGeographic;else{console.log("KMLLayer:_setMap - unsupported workflow. Spatial reference of the map and kml layer do not match, and the conversion cannot be done on the client.");return}this._groundLyr&&(d&&A.forEach(this._groundLyr.getImages(),function(c){c.extent=d(c.extent)}),h.addLayer(this._groundLyr));(a=this._fLayers)&&0<a.length&&A.forEach(a,function(c){if(d){var e=c.graphics,l,p,y=e?e.length:0;for(l=0;l<y;l++)(p=e[l].geometry)&&e[l].setGeometry(d(p))}h.addLayer(c)});
this.onVisibilityChange(this.visible)},_removeInternalLayers:function(){var h=this._map;this._links&&A.forEach(this._links,function(a){a.declaredClass&&a._io&&a._io.cancel();a._linkErrorHandle&&(a._linkErrorHandle.remove(),a._linkErrorHandle=null)});h&&A.forEach(this.getLayers(),h.removeLayer,h)},_setState:function(h,a){h=h.featureInfos;var b,d,c=h?h.length:0,e=a?"show":"hide",l=a?"_resume":"_suspend";for(d=0;d<c;d++){var p=h[d];if(b=this.getFeature(p))if("Folder"===p.type)this._setState(b,a&&b.visible);
else if("NetworkLink"===p.type)this._setInternalVisibility(b,a);else if(b[l])b[l]();else b[e]()}},_areLocalAncestorsVisible:function(h){var a=h.parentFolderId;for(h=h.visible;h&&-1!==a;)a=this.getFeature({type:"Folder",id:a}),h=h&&a.visible,a=a.parentFolderId;return h},_setInternalVisibility:function(h,a){var b=h._parentLayer,d=h._parentFolderId;for(a=a&&h.visible;a&&b;)a=a&&b.visible,-1<d&&(a=a&&b._areLocalAncestorsVisible(b.getFeature({type:"Folder",id:d}))),d=b._parentFolderId,b=b._parentLayer;
this._setIntState(h,a)},_setIntState:function(h,a){h&&A.forEach(h.getLayers(),function(b){b.linkInfo?h._setIntState(b,a&&b.visible&&h._areLocalAncestorsVisible(h.getFeature({type:"Folder",id:b._parentFolderId}))):b.setVisibility(a)})},_getLinkParentId:function(h){var a=-1;this.folders&&A.some(this.folders,function(b){return b.networkLinkIds&&-1!==A.indexOf(b.networkLinkIds,h)?(a=b.id,!0):!1});return a},_checkAutoRefresh:function(){var h=this.linkInfo;if(h)if(this.visible){if(this.loaded&&this._map){var a=
h.refreshMode,b=h.refreshInterval,d=h.viewRefreshMode;h=h.viewRefreshTime;a&&-1!==a.toLowerCase().indexOf("oninterval")&&0<b&&(this._stopAutoRefresh(),this._timeoutHandle=setTimeout(this.refresh,1E3*b));d&&-1!==d.toLowerCase().indexOf("onstop")&&0<h&&!this._extChgHandle&&(this._extChgHandle=E.connect(this._map,"onExtentChange",this,this._extentChanged))}}else this._stopAutoRefresh(),E.disconnect(this._extChgHandle),delete this._extChgHandle},_stopAutoRefresh:function(){clearTimeout(this._timeoutHandle);
this._timeoutHandle=null},_getQueryParameters:function(h){h=h||this._map;var a={},b=this.linkInfo,d=h&&h.extent;if(this._url.query){B.mixin(a,this._url.query);var c=!!this._url.query.token}J.id&&!c&&(c=J.id.findCredential(this._url.path))&&(a.token=c.token);if(b){c=b.viewFormat;var e=b.httpQuery;b=b.viewBoundScale;if(d&&c){var l=d,p=d,y=d.spatialReference;y&&(y.isWebMercator()?l=M.webMercatorToGeographic(d):4326===y.wkid&&(p=M.geographicToWebMercator(d)));d=l.getCenter();p=Math.max(p.getWidth(),p.getHeight());
b&&(l=l.expand(b));c=c.replace(/\[bboxWest\]/ig,l.xmin).replace(/\[bboxEast\]/ig,l.xmax).replace(/\[bboxSouth\]/ig,l.ymin).replace(/\[bboxNorth\]/ig,l.ymax).replace(/\[lookatLon\]/ig,d.x).replace(/\[lookatLat\]/ig,d.y).replace(/\[lookatRange\]/ig,p).replace(/\[lookatTilt\]/ig,0).replace(/\[lookatHeading\]/ig,0).replace(/\[lookatTerrainLon\]/ig,d.x).replace(/\[lookatTerrainLat\]/ig,d.y).replace(/\[lookatTerrainAlt\]/ig,0).replace(/\[cameraLon\]/ig,d.x).replace(/\[cameraLat\]/ig,d.y).replace(/\[cameraAlt\]/ig,
p).replace(/\[horizFov\]/ig,60).replace(/\[vertFov\]/ig,60).replace(/\[horizPixels\]/ig,h.width).replace(/\[vertPixels\]/ig,h.height).replace(/\[terrainEnabled\]/ig,0);B.mixin(a,v.queryToObject(c))}e&&(e=e.replace(/\[clientVersion\]/ig,J.version).replace(/\[kmlVersion\]/ig,2.2).replace(/\[clientName\]/ig,"ArcGIS API for JavaScript").replace(/\[language\]/ig,H.locale),B.mixin(a,v.queryToObject(e)))}h=[];for(var K in a)L.isDefined(a[K])&&h.push(K+"\x3d"+a[K]);return(h=h.join("\x26"))?"?"+h:""},setScaleRange:function(h,
a){this.inherited(arguments);A.forEach(this.getLayers(),function(b){b.setScaleRange(h,a)})},setOpacity:function(h){this.opacity!=h&&(A.forEach(this.getLayers(),function(a){a.setOpacity(h)}),this.opacity=h,this.onOpacityChange(h))},_setMap:function(h,a){this.inherited(arguments);this._map=h;var b=this._div=D.create("div",null,a);w.set(b,"position","absolute");this._addInternalLayers();this.evaluateSuspension();return b},_unsetMap:function(h,a){this._io&&this._io.cancel();this._stopAutoRefresh();E.disconnect(this._extChgHandle);
delete this._extChgHandle;this._removeInternalLayers();var b=this._div;b&&(a.removeChild(b),D.destroy(b));this._wMap=this._div=null;this.inherited(arguments)},onVisibilityChange:function(h){this.loaded?(this._fireUpdateStart(),this._setInternalVisibility(this,h),this._checkAutoRefresh(),this._fireUpdateEnd()):this.linkInfo&&h&&(this._waitingForMap||this._parseKml(this._wMap))},refresh:function(){this.loaded&&this._map&&!this._io&&this.visible&&this._parseKml()},getFeatureCollection:function(h){var a,
b=[];(h=this.getFeature({type:"Folder",id:h}))&&(a=A.map(h.featureInfos,function(d){if("esriGeometryPoint"===d.type||"esriGeometryPolyline"===d.type||"esriGeometryPolygon"===d.type)return d.id},this))&&0<a.length&&A.forEach(this._fLayers,function(d){var c;var e=d.toJson();e.featureSet.features&&0<e.featureSet.features.length&&(c=A.filter(e.featureSet.features,function(l){if(-1!==A.indexOf(a,l.attributes[d.objectIdField]))return l},this));c&&0<c.length&&(e.featureSet.features=c,b.push(e))},this);return b},
getFeatureCount:function(h){h=this.getFeature({type:"Folder",id:h});var a={points:0,polylines:0,polygons:0};h&&A.forEach(h.featureInfos,function(b){"esriGeometryPoint"===b.type&&(a.points+=1);"esriGeometryPolyline"===b.type&&(a.polylines+=1);"esriGeometryPolygon"===b.type&&(a.polygons+=1)});return a},_extentChanged:function(){this._stopAutoRefresh();this._timeoutHandle=setTimeout(this.refresh,1E3*this.linkInfo.viewRefreshTime)}});n("extend-esri")&&B.setObject("layers.KMLLayer",t,J);return t})},"esri/layers/KMLFolder":function(){define(["dojo/_base/declare",
"dojo/_base/lang","dojo/has","../kernel","../lang"],function(H,x,E,B,A){H=H(null,{declaredClass:"esri.layers.KMLFolder",constructor:function(z){x.mixin(this,z);A.isDefined(this.visibility)&&(this.visible=!!this.visibility)}});E("extend-esri")&&x.setObject("layers.KMLFolder",H,B);return H})},"esri/layers/KMLGroundOverlay":function(){define("dojo/_base/declare dojo/_base/lang dojo/has ../kernel ../lang ./MapImage".split(" "),function(H,x,E,B,A,z){H=H([z],{declaredClass:"esri.layers.KMLGroundOverlay",
constructor:function(n){A.isDefined(this.visibility)&&(this.visible=!!this.visibility)}});E("extend-esri")&&x.setObject("layers.KMLGroundOverlay",H,B);return H})},"esri/layers/WMSLayer":function(){define("require dojo/_base/kernel dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/sniff ../config ../graphic ../kernel ../request ../urlUtils ../dijit/PopupTemplate ../SpatialReference ../geometry/Extent ../geometry/Point ./DynamicMapServiceLayer ./WMSLayerInfo dojo/query".split(" "),function(H,
x,E,B,A,z,n,v,D,w,J,F,L,O,S,G,M){E=E([G],{declaredClass:"esri.layers.WMSLayer",_CRS_TO_EPSG:{84:4326,83:4269,27:4267},_REVERSED_LAT_LONG_RANGES:[[4001,4999],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],
[3416,3416],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]],_WEB_MERCATOR:[102100,3857,102113,900913],_WORLD_MERCATOR:[3395,54004],allExtents:[],version:null,constructor:function(m,f){var g=J.urlToObject(m);g.query&&(g.query.version||g.query.Version||g.query.VERSION)&&
(this.version=g.query.version||g.query.Version||g.query.VERSION);this.url=m=this._stripParameters(m,"version service request bbox format height width layers srs crs styles transparent bgcolor exceptions time elevation sld wfs".split(" "));this._url=J.urlToObject(m);this._getCapabilitiesURL=m;this._initLayer=B.hitch(this,this._initLayer);this._parseCapabilities=B.hitch(this,this._parseCapabilities);this._getCapabilitiesError=B.hitch(this,this._getCapabilitiesError);f?(this.customParameters=f.customParameters,
this.customLayerParameters=f.customLayerParameters,this.imageFormat=this._getImageFormat(f.format),this.imageTransparency=!1!==f.transparent,this.visibleLayers=f.visibleLayers?f.visibleLayers:[],this.version=f.version||this.version,f.resourceInfo?this._readResourceInfo(f.resourceInfo):this._getCapabilities()):(this.imageFormat="image/png",this.imageTransparency=!0,this.visibleLayers=[],this._getCapabilities());this._blankImageURL=H.toUrl("../images/pixel.png");this.extentProcessor=this._createExtentProcessor(0);
this._createChildLayer()},setVisibleLayers:function(m){this.visibleLayers=(m=this._checkVisibleLayersList(m))?m:[];this.refresh(!0)},setImageFormat:function(m){this.imageFormat=this._getImageFormat(m);this.refresh(!0)},setImageTransparency:function(m){this.imageTransparency=m;this.refresh(!0)},setCustomParameters:function(m,f){this.customParameters=m;this.customLayerParameters=f;this.refresh(!0)},refresh:function(){this._refreshTS=Date.now();this.inherited(arguments);this._childLayer&&this._childLayer.refresh.apply(this._childLayer,
arguments)},getImageUrl:function(m,f,g,u){if(this.visibleLayers&&0!==this.visibleLayers.length){m=this._getImageParams(m,f,g);m=this._mixinCustomLayerParameters(m);f=this.getMapURL;var q;f+=-1===f.indexOf("?")?"?":"";for(q in m)m.hasOwnProperty(q)&&(f+="?"===f.substring(f.length-1,f.length)?"":"\x26",f+=q+"\x3d"+m[q]);f=this.addTimestampToURL(f);u(J.addProxy(f))}else u(this._blankImageURL)},_setMap:function(m,f,g){var u=this.inherited(arguments);m.wrapAround180?this._childLayer&&(this.suspended&&
this._childLayer.suspend(),this._childLayer._setMap(m,u)):this._childLayer=this.extentProcessor=null;return u},_unsetMap:function(m,f){this._childLayer&&this._childLayer._unsetMap(m,this._div);this.inherited(arguments)},onSuspend:function(){this.inherited(arguments);this._childLayer&&this._childLayer.suspend()},onResume:function(){this.inherited(arguments);this._childLayer&&this._childLayer.resume()},_createChildLayer:function(){this._childLayer=new G(null,{extentProcessor:this._createExtentProcessor(1)});
this._childLayer._isChildLayer=!0;this._childLayer.getImageUrl=B.hitch(this,this.getImageUrl);this._childLayer.loaded=!0},_createExtentProcessor:function(m){return B.hitch(this,this._extentProcessor,m)},_extentProcessor:function(m,f){var g=f.extent,u=f.width,q=0;if(g){f=g.getWidth()/u;var r=g.bisect();g=r.extents;var t=g[m];t&&(u=r.marginLeft/f,q=0===m?u:u+g[0].getWidth()/f,u=Math.ceil(t.getWidth()/f),q=Math.ceil(q));g=t}return{extent:g,width:u,marginLeft:q}},_getImageParams:function(m,f,g){var u=
m.spatialReference.wkid;-1===A.indexOf(this.spatialReferences,u)&&m.spatialReference.latestWkid&&(u=m.spatialReference.latestWkid);if(A.some(this._WEB_MERCATOR,function(a){return a==u})){var q=A.filter(this.spatialReferences,function(a){return A.some(this._WEB_MERCATOR,function(b){return b==a})},this);0===q.length&&(q=A.filter(this.spatialReferences,function(a){return A.some(this._WORLD_MERCATOR,function(b){return b==a})},this));u=0<q.length?q[0]:this._WEB_MERCATOR[1]}this.spatialReferences=A.filter(this.spatialReferences,
function(a){return a!==u});this.spatialReferences.unshift(u);q=m.xmin;var r=m.xmax,t=m.ymin;m=m.ymax;var h={SERVICE:"WMS",REQUEST:"GetMap"};h.FORMAT=this.imageFormat;h.TRANSPARENT=this.imageTransparency?"TRUE":"FALSE";h.STYLES="";h.VERSION=this.version;h.LAYERS=this.visibleLayers?this.visibleLayers.toString():null;h.WIDTH=f;h.HEIGHT=g;this.maxWidth<f&&(h.WIDTH=this.maxWidth);this.maxHeight<g&&(h.HEIGHT=this.maxHeight);f=u?u:NaN;isNaN(f)||("1.3.0"==this.version?h.CRS="EPSG:"+f:h.SRS="EPSG:"+f);"1.3.0"==
this.version&&this._useLatLong(f)?h.BBOX=t+","+q+","+m+","+r:h.BBOX=q+","+t+","+r+","+m;return h},_initLayer:function(m,f){this.spatialReference=new L(this.extent.spatialReference);this.initialExtent=new O(this.extent);this.fullExtent=new O(this.extent);this.visibleLayers=this._checkVisibleLayersList(this.visibleLayers);var g=B.hitch(this,function(){this.loaded=!0;this.onLoad(this);var u=this._loadCallback;u&&(delete this._loadCallback,u(this))});z("chrome")?(m=n.defaults.io,f="with-credentials"===
m.useCors?J.canUseXhr(this.getMapURL,!0):-1,(m=-1<f?m.corsEnabledServers[f]:null)&&m.withCredentials?w({url:this.getMapURL,handleAs:"text",content:{SERVICE:"WMS",REQUEST:"GetMap"}}).addBoth(function(){g()}):g()):g()},_readResourceInfo:function(m){m.extent?m.layerInfos?(this.extent=m.extent,this.allExtents[0]=m.extent,this.layerInfos=m.layerInfos,this.description=m.description?m.description:"",this.copyright=m.copyright?m.copyright:"",this.title=m.title?m.title:"",this.getMapURL=m.getMapURL?m.getMapURL:
this._getCapabilitiesURL,this.getFeatureInfoURL=m.getFeatureInfoURL,this.featureInfoFormat=m.featureInfoFormat,this.version=m.version?m.version:"1.3.0",this.maxWidth=m.maxWidth?m.maxWidth:5E3,this.maxHeight=m.maxHeight?m.maxHeight:5E3,this.spatialReferences=m.spatialReferences?m.spatialReferences:[],this.imageFormat=this._getImageFormat(m.format),this.setScaleRange(m.minScale,m.maxScale),this.customLayerParameters=m.customLayerParameters||this.customLayerParameters,this.customParameters=m.customParameters||
this.customParameters,this._initLayer()):this._errorHandler(Error("esri.layers.WMSLayer: unable to find the 'layerInfos' property in resourceInfo")):this._errorHandler(Error("esri.layers.WMSLayer: Unable to find the 'extent' property in resourceInfo."))},_getCapabilities:function(m){var f=this._url.query?this._url.query:{};f.SERVICE="WMS";f.REQUEST="GetCapabilities";this.version&&(f.VERSION=this.version);f=this._mixinCustomParameters(f);var g=this._url.path+"?",u;for(u in f)f.hasOwnProperty(u)&&(g+=
"?"==g.substring(g.length-1,g.length)?"":"\x26",g+=u+"\x3d"+f[u]);w({url:g,handleAs:m||"xml",headers:{"Content-Type":null},load:this._parseCapabilities,error:this._getCapabilitiesError},{usePost:!1})},_parseCapabilities:function(m,f){if(m){if("text"===f.handleAs){try{var g=(new DOMParser).parseFromString(m,"application/xml")}catch(b){}g&&!g.getElementsByTagName("parsererror").length||this._errorHandler(Error("GetCapabilities request for "+this._getCapabilitiesURL+" failed. (XML Parse error.)"))}else g=
m;var u=this;this.version=this._getAttributeValue("WMS_Capabilities","version",g,null);this.version||(this.version=this._getAttributeValue("WMT_MS_Capabilities","version",g,"1.3.0"));m=this._getTag("Service",g);this.title=this._getTagValue("Title",m,"");this.title||(this.title=this._getTagValue("Name",m,""));this.copyright=this._getTagValue("AccessConstraints",m,"");this.description=this._getTagValue("Abstract",m,"");this.maxWidth=parseInt(this._getTagValue("MaxWidth",m,5E3),10);this.maxHeight=parseInt(this._getTagValue("MaxHeight",
m,5E3),10);if(m=this._getTag("Layer",g)){var q=this._getLayerInfo(m),r=0,t=null;m=this._getTag("Capability",g);A.forEach(m.childNodes,function(b){"Layer"==b.nodeName&&(0===r?t=b:(1===r&&q.name&&(q.name="",q.subLayers=[],q.subLayers.push(this._getLayerInfo(t))),q.subLayers.push(this._getLayerInfo(b))),r++)},this);if(q&&(this.layerInfos=q.subLayers,this.layerInfos&&0!==this.layerInfos.length||(this.layerInfos=[q]),this.extent=q.extent,this.extent||(q.extent=new O(this.layerInfos[0].extent.toJson()),
this.extent=q.extent),this.allExtents=q.allExtents,this.allExtents&&this.allExtents.length||(q.allExtents=[],A.forEach(this.layerInfos[0].allExtents,function(b,d){b&&(q.allExtents[d]=new O(b.toJson()))}),this.allExtents=q.allExtents),this.spatialReferences=q.spatialReferences,!this.spatialReferences.length&&0<this.layerInfos.length)){var h=function(b){var d;for(d=0;d<b.subLayers.length;d++){var c=b.subLayers[d],e=c.spatialReferences;!e.length&&c.subLayers&&0<c.subLayers.length&&(e=h(c));if(e.length)return e}return[]};
for(m=0;m<this.layerInfos.length&&(f=this.layerInfos[m],this.spatialReferences=this.layerInfos[0].spatialReferences,!this.spatialReferences.length&&f.subLayers&&0<f.subLayers.length&&(this.spatialReferences=h(f)),!this.spatialReferences.length);m++);}m=function(b){return(b=x.query("DCPType",u._getTag(b,g)))&&0<b.length&&(b=x.query("HTTP",b[0]))&&0<b.length&&(b=x.query("Get",b[0]))&&0<b.length&&(b=u._getAttributeValue("OnlineResource","xlink:href",b[0],null))?(b.indexOf("\x26")===b.length-1&&(b=b.substring(0,
b.length-1)),u._stripParameters(b,["service","request"])):null};f=function(b){var d=[];0===x.query("Operation",g).length?A.forEach(x.query("Format",u._getTag(b,g)),function(c){d.push(c.text?c.text:c.textContent)}):(A.forEach(x.query("Operation",g),function(c){c.getAttribute("name")===b&&A.forEach(x.query("Format",c),function(e){d.push(e.text?e.text:e.textContent)})}),d.length||A.forEach(x.query("Format",u._getTag(b,g)),function(c){d.push(c.text?c.text:c.textContent)}));return d};this.getMapURL=m("GetMap")||
this._getCapabilitiesURL;this.getMapFormats=f("GetMap");this.getMapFormats.length&&!A.some(this.getMapFormats,function(b){return-1<b.indexOf(this.imageFormat)},this)&&(this.imageFormat=this.getMapFormats[0]);if(this.getFeatureInfoURL=m("GetFeatureInfo"))this.getFeatureInfoFormats=f("GetFeatureInfo"),-1<A.indexOf(this.getFeatureInfoFormats,"text/html")?this.featureInfoFormat="text/html":-1<A.indexOf(this.getFeatureInfoFormats,"text/plain")&&(this.featureInfoFormat="text/plain");if(!this.featureInfoFormat){var a=
function(b){if(b&&(b.queryable=!1,b.subLayers))for(var d=0;d<b.subLayers.length;d++)a(b.subLayers[d])};a(q)}this._initLayer()}else this._errorHandler(Error("esri.layers.WMSLayer: Response does not contain any layers."))}else"xml"===f.handleAs?this._getCapabilities("text"):this._errorHandler(Error("GetCapabilities request for "+this._getCapabilitiesURL+" failed. (Response is null.)"))},_getCapabilitiesError:function(m){m&&m.message&&(m.message="GetCapabilities request for "+this._getCapabilitiesURL+
" failed. ("+m.message+")");this._errorHandler(m)},_getLayerInfo:function(m){if(!m)return null;var f=new M;f.name="";f.title="";f.description="";f.allExtents=[];f.spatialReferences=[];f.queryable="1"===m.getAttribute("queryable");f.subLayers=[];var g=this._getTag("LatLonBoundingBox",m);g&&(f.allExtents[0]=this._getExtent(g,4326));var u=this._getTag("EX_GeographicBoundingBox",m);if(u){var q=new O(0,0,0,0,new L({wkid:4326}));q.xmin=parseFloat(this._getTagValue("westBoundLongitude",u,0));q.ymin=parseFloat(this._getTagValue("southBoundLatitude",
u,0));q.xmax=parseFloat(this._getTagValue("eastBoundLongitude",u,0));q.ymax=parseFloat(this._getTagValue("northBoundLatitude",u,0));f.allExtents[0]=q}g||u||(q=new O(-180,-90,180,90,new L({wkid:4326})),f.allExtents[0]=q);f.extent=f.allExtents[0];var r=-1<A.indexOf(["1.0.0","1.1.0","1.1.1"],this.version)?"SRS":"CRS";A.forEach(m.childNodes,function(t){if("Name"==t.nodeName)f.name=(t.text?t.text:t.textContent)||"";else if("Title"==t.nodeName)f.title=(t.text?t.text:t.textContent)||"";else if("Abstract"==
t.nodeName)f.description=(t.text?t.text:t.textContent)||"";else if("BoundingBox"==t.nodeName){var h=t.getAttribute(r);h&&0===h.indexOf("EPSG:")?(h=parseInt(h.substring(5),10),0===h||isNaN(h)||(t="1.3.0"==this.version?this._getExtent(t,h,this._useLatLong(h)):this._getExtent(t,h),f.allExtents[h]=t,f.extent||(f.extent=t))):h&&0===h.indexOf("CRS:")?(h=parseInt(h.substring(4),10),0===h||isNaN(h)||(this._CRS_TO_EPSG[h]&&(h=this._CRS_TO_EPSG[h]),f.allExtents[h]=this._getExtent(t,h))):(h=parseInt(h,10),0===
h||isNaN(h)||(f.allExtents[h]=this._getExtent(t,h)))}else if(t.nodeName==r)t=(t.text?t.text:t.textContent).split(" "),A.forEach(t,function(a){a=-1<a.indexOf(":")?parseInt(a.split(":")[1],10):parseInt(a,10);0===a||isNaN(a)||(this._CRS_TO_EPSG[a]&&(a=this._CRS_TO_EPSG[a]),-1==A.indexOf(f.spatialReferences,a)&&f.spatialReferences.push(a))},this);else if("Style"!=t.nodeName||f.legendURL)"Layer"===t.nodeName&&f.subLayers.push(this._getLayerInfo(t));else if(t=this._getTag("LegendURL",t))if(t=this._getTag("OnlineResource",
t))f.legendURL=t.getAttribute("xlink:href")},this);f.title=f.title||f.name;return f},_getImageFormat:function(m){switch(m?m.toLowerCase():""){case "jpg":return"image/jpeg";case "bmp":return"image/bmp";case "gif":return"image/gif";case "svg":return"image/svg+xml";default:return"image/png"}},getImageFormat:function(){switch(this.imageFormat?this.imageFormat.toLowerCase():""){case "image/jpeg":return"jpg";case "image/bmp":return"bmp";case "image/gif":return"gif";case "image/svg+xml":return"svg";default:return"png"}},
_getExtent:function(m,f,g){if(m){var u=new O;var q=parseFloat(m.getAttribute("minx")),r=parseFloat(m.getAttribute("miny")),t=parseFloat(m.getAttribute("maxx"));m=parseFloat(m.getAttribute("maxy"));g?(u.xmin=isNaN(r)?-1*Number.MAX_VALUE:r,u.ymin=isNaN(q)?-1*Number.MAX_VALUE:q,u.xmax=isNaN(m)?Number.MAX_VALUE:m,u.ymax=isNaN(t)?Number.MAX_VALUE:t):(u.xmin=isNaN(q)?-1*Number.MAX_VALUE:q,u.ymin=isNaN(r)?-1*Number.MAX_VALUE:r,u.xmax=isNaN(t)?Number.MAX_VALUE:t,u.ymax=isNaN(m)?Number.MAX_VALUE:m);u.spatialReference=
new L({wkid:f})}return u},_useLatLong:function(m){var f;for(f=0;f<this._REVERSED_LAT_LONG_RANGES.length;f++){var g=this._REVERSED_LAT_LONG_RANGES[f];if(m>=g[0]&&m<=g[1]){var u=!0;break}}return u},_getTag:function(m,f){return(m=x.query(m,f))&&0<m.length?m[0]:null},_getTagValue:function(m,f,g){return(m=x.query(m,f))&&0<m.length?m[0].text?m[0].text:m[0].textContent:g},_getAttributeValue:function(m,f,g,u){return(m=x.query(m,g))&&0<m.length?m[0].getAttribute(f):u},_checkVisibleLayersList:function(m){if(m&&
0<m.length&&this.layerInfos&&0<this.layerInfos.length&&"number"==typeof m[0]){var f=[];A.forEach(m,function(g){g<this.layerInfos.length&&f.push(this.layerInfos[g].name)},this);m=f}return m},_stripParameters:function(m,f){m=J.urlToObject(m);var g,u=[];for(g in m.query)m.query.hasOwnProperty(g)&&-1===A.indexOf(f,g.toLowerCase())&&u.push(g+"\x3d"+m.query[g]);return m.path+(u.length?"?"+u.join("\x26"):"")},_getPopupGraphic:function(m,f){var g=this.visibleLayers;if(!g||0===g.length)return null;var u=this._popupGraphic;
u||(u=new F({title:this.title||""}),u.setContent(function(a){var b=document.createElement("div");if(a=a&&a.attributes&&a.attributes.QUERY_URL)b.style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%;",b.innerHTML='\x3ciframe sandbox src\x3d"'+a+'" width\x3d"250" height\x3d"147" frameborder\x3d"0" marginwidth\x3d"0" marginheight\x3d"0" style\x3d"position:absolute;top:0;left:0;width:100%;height:100%;border:0;background:url(\''+H.toUrl("../dijit/images/loading-throb.gif")+
"') transparent center no-repeat;\" onload\x3d\"(event.target || event.srcElement).style.background \x3d 'none';\"\x3e\x3c/iframe\x3e";return b}),u=this._popupGraphic=new v(null,null,{},u),u._layer=this);var q=function(a){var b=[];if(a&&(a.queryable&&a.showPopup&&a.name&&b.push(a.name),a.subLayers))for(var d=0;d<a.subLayers.length;d++){var c=q(a.subLayers[d]);c.length&&(b=b.concat(c))}return b},r=q({subLayers:this.layerInfos});r=A.filter(r,function(a){return-1<A.indexOf(g,a)});if(r.length){var t=
this.getFeatureInfoURL;m=this._getImageParams(m.extent,m.width,m.height);m=this._mixinCustomLayerParameters(m);m.REQUEST="GetFeatureInfo";m.INFO_FORMAT=this.featureInfoFormat;m.QUERY_LAYERS=r.join();m.FEATURE_COUNT=25;"1.3.0"===this.version?(m.I=Math.round(f.x),m.J=Math.round(f.y)):(m.X=Math.round(f.x),m.Y=Math.round(f.y));t+=-1===t.indexOf("?")?"?":"";for(var h in m)m.hasOwnProperty(h)&&(t+="?"===t.substring(t.length-1,t.length)?"":"\x26",t+=h+"\x3d"+m[h]);u.attributes.QUERY_URL=t;return u}return null},
_mixinCustomParameters:function(m){if(this.customParameters)for(var f in this.customParameters)m[f]=encodeURIComponent(this.customParameters[f]);return m},_mixinCustomLayerParameters:function(m){if(this.customLayerParameters||this.customParameters){var f=B.clone(this.customParameters||{});B.mixin(f,this.customLayerParameters||{});for(var g in f)"styles"===g.toLowerCase()&&delete m.STYLES,m[g]=encodeURIComponent(f[g])}return m}});z("extend-esri")&&B.setObject("layers.WMSLayer",E,D);return E})},"esri/layers/WMSLayerInfo":function(){define(["dojo/_base/declare",
"dojo/_base/lang","dojo/_base/array","dojo/has","../kernel"],function(H,x,E,B,A){H=H(null,{declaredClass:"esri.layers.WMSLayerInfo",name:null,title:null,description:null,extent:null,legendURL:null,subLayers:[],allExtents:[],spatialReferences:[],queryable:!1,showPopup:!1,constructor:function(z){z&&(this.name=z.name,this.title=z.title,this.description=z.description,this.extent=z.extent,this.legendURL=z.legendURL,this.subLayers=z.subLayers?z.subLayers:[],this.allExtents=z.allExtents?z.allExtents:[],
this.spatialReferences=z.spatialReferences?z.spatialReferences:[],this.queryable=!!z.queryable,this.showPopup=!!z.showPopup)},clone:function(){var z={name:this.name,title:this.title,description:this.description,legendURL:this.legendURL};this.extent&&(z.extent=this.extent.getExtent());z.subLayers=[];E.forEach(this.subLayers,function(v){z.subLayers.push(v.clone())});z.allExtents=[];for(n in this.allExtents){var n=parseInt(n,10);isNaN(n)||(z.allExtents[n]=this.allExtents[n].getExtent())}z.spatialReferences=
[];E.forEach(this.spatialReferences,function(v){z.spatialReferences.push(v)});z.queryable=this.queryable;z.showPopup=this.showPopup;return z}});B("extend-esri")&&x.setObject("layers.WMSLayerInfo",H,A);return H})},"esri/layers/WMTSLayer":function(){define("dojo/_base/kernel dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/sniff dojox/xml/parser ../kernel ../lang ../request ../urlUtils ../WKIDUnitConversion ../SpatialReference ../geometry/Point ../geometry/Extent ../geometry/webMercatorUtils ./TiledMapServiceLayer ./TileInfo ./WMTSLayerInfo dojo/query".split(" "),
function(H,x,E,B,A,z,n,v,D,w,J,F,L,O,S,G,M,m){x=x([G],{declaredClass:"esri.layers.WMTSLayer",copyright:null,extent:null,tileUrl:null,spatialReference:null,tileInfo:null,constructor:function(f,g){this.version="1.0.0";this.tileUrl=this._url=f;this.serviceMode="RESTful";this._parseCapabilities=E.hitch(this,this._parseCapabilities);this._getCapabilitiesError=E.hitch(this,this._getCapabilitiesError);this._formatDictionary={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png",
"image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""};g||(g={});if(g.serviceMode)if("KVP"===g.serviceMode||"RESTful"===g.serviceMode)this.serviceMode=g.serviceMode;else{console.error("WMTS mode could only be 'KVP' or 'RESTful'");return}this.customParameters=g.customParameters;this.customLayerParameters=g.customLayerParameters;this.layerInfo=new m;g.layerInfo&&(this.layerInfo=g.layerInfo,this._identifier=
g.layerInfo.identifier,this._tileMatrixSetId=g.layerInfo.tileMatrixSet,g.layerInfo.format&&(this.format="image/"+g.layerInfo.format),this._style=g.layerInfo.style,this.title=g.layerInfo.title,this._dimension=g.layerInfo.dimension,this._dimension2=g.layerInfo.dimension2);g.resourceInfo?(this.version=g.resourceInfo.version,g.resourceInfo.getTileUrl&&(this._url=this.tileUrl=g.resourceInfo.getTileUrl),this.copyright=g.resourceInfo.copyright,this.layerInfos=g.resourceInfo.layerInfos,this.customParameters=
g.resourceInfo.customParameters||this.customParameters,this.customLayerParameters=g.resourceInfo.customLayerParameters||this.customLayerParameters,this._parseResourceInfo(),this.loaded=!0,this.onLoad(this)):this._getCapabilities()},setActiveLayer:function(f){this.setVisibleLayer(f)},setVisibleLayer:function(f){this._setActiveLayer(f);this.refresh(!0)},setCustomParameters:function(f,g){this.customParameters=f;this.customLayerParameters=g;this.refresh(!0)},getTileUrl:function(f,g,u){f=this._levelToLevelValue[f];
f=this.resourceUrls&&0<this.resourceUrls.length?this.resourceUrls[g%this.resourceUrls.length].template.replace(/\{Style\}/gi,this._style).replace(/\{TileMatrixSet\}/gi,this._tileMatrixSetId).replace(/\{TileMatrix\}/gi,f).replace(/\{TileRow\}/gi,g).replace(/\{TileCol\}/gi,u).replace(/\{dimensionValue\}/gi,this._dimension).replace(/\{dimensionValue2\}/gi,this._dimension2):this.UrlTemplate.replace(/\{level\}/gi,f).replace(/\{row\}/gi,g).replace(/\{col\}/gi,u);f=this._appendCustomLayerParameters(f);f=
this.addTimestampToURL(f);return w.addProxy(f)},getTileUrlTemplate:function(f){var g=f.identifier,u=f.tileMatrixSet,q=f.format,r=f.style,t=f.dimension,h=f.dimension2;g?f=B.filter(this.layers,function(b){return b.identifier===g})[0]:(f=this.layers[0],g=this.layers[0].identifier);if(f){if(!q)q=f.formats[0];else if(!(-1===q.indexOf("image/")&&-1<B.indexOf(f.formats,q))&&(-1===q.indexOf("image/")&&(q="image/"+q),-1===B.indexOf(f.formats,q))){console.error("The layer doesn't support the format of "+q);
this.onError(Error("The layer doesn't support the format of "+q));return}if(!r)r=f.styles[0];else if(-1===B.indexOf(f.styles,r)){console.error("The layer doesn't support the style of "+r);this.onError(Error("The layer doesn't support the style of "+r));return}if(!t&&f.dimensions)t=f.dimensions[0];else if(-1===B.indexOf(f.dimensions,t)){console.error("The layer doesn't support the dimension of "+t);this.onError(Error("The layer doesn't support the dimension of "+t));return}if(!h&&f.dimensions2)h=f.dimensions2[0];
else if(-1===B.indexOf(f.dimensions2,h)){console.error("The layer doesn't support the dimension of "+h);this.onError(Error("The layer doesn't support the dimension of "+h));return}if(u){var a=B.filter(f.tileMatrixSetInfos,function(b){return b.tileMatrixSet===u})[0];if(!a){console.error("The tileMatrixSetId "+u+" is not supported by the layer of "+g);this.onError(Error("The tileMatrixSetId "+u+" is not supported by the layer of "+g));return}}else(a=B.filter(f.tileMatrixSetInfos,function(b){return"GoogleMapsCompatible"===
b.tileMatrixSet})[0])||(a=f.tileMatrixSetInfos[0]),u=a.tileMatrixSet;return this._getTileUrlTemplate(g,u,q,r,t,h)}console.error("couldn't find the layer "+g);this.onError(Error("couldn't find the layer "+g))},_getTileUrlTemplate:function(f,g,u,q,r,t){f||(f=this._identifier);g||(g=this._tileMatrixSetId);u||(u=this.format);q||""===q||(q=this._style);if(this.resourceUrls&&0<this.resourceUrls.length){var h=this.resourceUrls[0].template;h.indexOf(".xxx")===h.length-4&&(h=h.slice(0,h.length-4));h=h.replace(/\{Style\}/gi,
q);h=h.replace(/\{TileMatrixSet\}/gi,g);h=h.replace(/\{TileMatrix\}/gi,"{level}");h=h.replace(/\{TileRow\}/gi,"{row}");h=h.replace(/\{TileCol\}/gi,"{col}");h=h.replace(/\{dimensionValue\}/gi,r);return h=h.replace(/\{dimensionValue2\}/gi,t)}"KVP"===this.serviceMode?h=this._url+"SERVICE\x3dWMTS\x26VERSION\x3d"+this.version+"\x26REQUEST\x3dGetTile\x26LAYER\x3d"+f+"\x26STYLE\x3d"+q+"\x26FORMAT\x3d"+u+"\x26TILEMATRIXSET\x3d"+g+"\x26TILEMATRIX\x3d{level}\x26TILEROW\x3d{row}\x26TILECOL\x3d{col}":"RESTful"===
this.serviceMode&&(r="",this._formatDictionary[u.toLowerCase()]&&(r=this._formatDictionary[u.toLowerCase()]),h=this._url+f+"/"+q+"/"+g+"/{level}/{row}/{col}"+r);return h},_parseResourceInfo:function(){var f=this.layerInfos,g;"KVP"===this.serviceMode&&(this._url+=-1<this._url.indexOf("?")?"":"?");for(g=0;g<f.length;g++)if(!(this._identifier&&f[g].identifier!==this._identifier||this.title&&f[g].title!==this.title||this._tileMatrixSetId&&f[g].tileMatrixSet!==this._tileMatrixSetId||this.format&&"image/"+
f[g].format!==this.format||this._style&&f[g].style!==this._style)){E.mixin(this,{description:f[g].description,tileInfo:f[g].tileInfo,spatialReference:f[g].tileInfo.spatialReference,fullExtent:f[g].fullExtent,initialExtent:f[g].initialExtent,_identifier:f[g].identifier,_tileMatrixSetId:f[g].tileMatrixSet,format:"image/"+f[g].format,_style:f[g].style});break}for(g=0;g<f.length;g++){var u=f[g].tileInfo;96!==u.dpi&&(B.forEach(u.lods,function(q){q.scale=96*q.scale/u.dpi}),u.dpi=96);B.forEach(u.lods,function(q){q.resolution=
this._getResolution(u.spatialReference.wkid,90.71428571428571*q.scale/96,f[g].tileMatrixSet)},this)}this._setActiveLayer();this.UrlTemplate=this._getTileUrlTemplate();this._levelToLevelValue=[];B.forEach(this.tileInfo.lods,function(q){this._levelToLevelValue[q.level]=q.levelValue?q.levelValue:q.level},this)},_getCapabilities:function(){var f;"KVP"===this.serviceMode?f=-1<this._url.indexOf("?")?this._url+"\x26request\x3dGetCapabilities\x26service\x3dWMTS\x26version\x3d"+this.version:this._url+"?request\x3dGetCapabilities\x26service\x3dWMTS\x26version\x3d"+
this.version:"RESTful"===this.serviceMode&&(f=this._url+"/"+this.version+"/WMTSCapabilities.xml");f=this._appendCustomParameters(f);D({url:f,handleAs:"text",load:this._parseCapabilities,error:this._getCapabilitiesError})},_parseCapabilities:function(f){f=f.replace(/ows:/gi,"");f=z.parse(f);var g=H.query("Contents",f)[0];if(g){var u=H.query("OperationsMetadata",f)[0],q=H.query("[name\x3d'GetTile']",u)[0];u=this._url;q=H.query("Get",q);var r,t=!1;for(r=0;r<q.length;r++){var h=H.query("Constraint",q[r])[0];
if(!h||this._getTagWithChildTagValue("AllowedValues","Value",this.serviceMode,h)){u=q[r].attributes[0].nodeValue;t=!0;break}else if(!h||this._getTagWithChildTagValue("AllowedValues","Value","RESTful",h))var a=q[r].attributes[0].nodeValue;else if(!h||this._getTagWithChildTagValue("AllowedValues","Value","KVP",h))var b=q[r].attributes[0].nodeValue}t||("KVP"===this.serviceMode&&a?(u=a,this.serviceMode="RESTful"):"RESTful"===this.serviceMode&&b&&(u=b,this.serviceMode="KVP"));-1===u.indexOf("/1.0.0/")&&
"RESTful"===this.serviceMode&&(u+="/");"KVP"===this.serviceMode&&(u+=-1<u.indexOf("?")?"":"?");this._url=u;this.copyright=this._getTagValues("Capabilities\x3eServiceIdentification\x3eAccessConstraints",f)[0];a=H.query("Layer",g);var d,c=[];this.layers=[];B.forEach(a,function(e){d=this._getTagValues("Identifier",e)[0];c.push(d);this.layers.push(this._getWMTSLayerInfo(d,e,g))},this);this._setActiveLayer();this.loaded=!0;this.onLoad(this)}else console.error("The WMTS capabilities XML is not valid"),
this.onError(Error("The WMTS capabilities XML is not valid"))},_setActiveLayer:function(f){f||(f={});f.identifier&&(this._identifier=f.identifier);f.tileMatrixSet&&(this._tileMatrixSetId=f.tileMatrixSet);f.format&&(this.format=f.format);f.style&&(this._style=f.style);f.dimension&&(this._dimension=f.dimension);f.dimension2&&(this._dimension2=f.dimension2);if(this.layers)if(this._identifier?f=B.filter(this.layers,function(u){return u.identifier===this._identifier},this)[0]:(f=this.layers[0],this._identifier=
this.layers[0].identifier),f){if(this.format){if(-1===this.format.indexOf("image/")&&(this.format="image/"+this.format),-1===B.indexOf(f.formats,this.format)){console.error("The layer doesn't support the format of "+this.format);this.onError(Error("The layer doesn't support the format of "+this.format));return}}else this.format=f.formats[0],-1===this.format.indexOf("image/")&&(this.format="image/"+this.format);if(!this._style)this._style=f.styles[0];else if(-1===B.indexOf(f.styles,this._style)){console.error("The layer doesn't support the style of "+
this._style);this.onError(Error("The layer doesn't support the style of "+this._style));return}if(!this._dimension&&f.dimensions)this._dimension=f.dimensions[0];else if(-1===B.indexOf(f.dimensions,this._dimension)){console.error("The layer doesn't support the dimension of "+this._dimension);this.onError(Error("The layer doesn't support the dimension of "+this._dimension));return}if(!this._dimension2&&f.dimensions2)this._dimension2=f.dimensions2[0];else if(-1===B.indexOf(f.dimensions2,this._dimension2)){console.error("The layer doesn't support the dimension of "+
this._dimension2);this.onError(Error("The layer doesn't support the dimension of "+this._dimension2));return}if(this._tileMatrixSetId){var g=B.filter(f.tileMatrixSetInfos,function(u){return u.tileMatrixSet===this._tileMatrixSetId},this)[0];if(!g){console.error("The tileMatrixSetId "+this._tileMatrixSetId+" is not supported by the layer of "+this._identifier);this.onError(Error("The tileMatrixSetId "+this._tileMatrixSetId+" is not supported by the layer of "+this._identifier));return}}else(g=B.filter(f.tileMatrixSetInfos,
function(u){return"GoogleMapsCompatible"===u.tileMatrixSet})[0])||(g=f.tileMatrixSetInfos[0]),this._tileMatrixSetId=g.tileMatrixSet;this.description=f.description;this.title=f.title;this.spatialReference=g.tileInfo.spatialReference;this.tileInfo=g.tileInfo;this._levelToLevelValue=[];B.forEach(this.tileInfo.lods,function(u){this._levelToLevelValue[u.level]=u.levelValue?u.levelValue:u.level},this);102100===this.spatialReference.wkid||102113===this.spatialReference.wkid?this.fullExtent=this.initialExtent=
S.geographicToWebMercator(f.gcsExtent):4326===this.spatialReference.wkid?this.fullExtent=this.initialExtent=f.gcsExtent:(this.fullExtent=g.fullExtent,this.initialExtent=g.initialExtent);this.resourceUrls=f.resourceUrls;this.UrlTemplate=this._getTileUrlTemplate();this.layerInfo={identifier:this._identifier,tileMatrixSet:this._tileMatrixSetId,format:this.format,style:this._style,fullExtent:this.fullExtent,initialExtent:this.initialExtent,tileInfo:this.tileInfo,title:this.title,description:this.description}}else console.error("couldn't find the layer "+
this._identifier),this.onError(Error("couldn't find the layer "+this._identifier))},_getWMTSLayerInfo:function(f,g,u){var q=this._getTagValues("Abstract",g)[0],r=this._getTagValues("Title",g)[0],t=H.query("WGS84BoundingBox",g)[0],h=t?this._getTagValues("LowerCorner",t)[0].split(" "):["-180","-90"],a=t?this._getTagValues("UpperCorner",t)[0].split(" "):["180","90"];t=parseFloat(h[0]);h=parseFloat(h[1]);var b=parseFloat(a[0]);a=parseFloat(a[1]);t=new O(t,h,b,a,new F({wkid:4326}));a=this._getTagValues("Identifier",
H.query("Style",g)[0]);var d=this._getTagValues("Identifier",H.query("Dimension",g)[0]),c=this._getTagValues("Default",H.query("Dimension",g)[0])||this._getTagValues("Value",H.query("Dimension",g)[0]),e=1<H.query("Dimension",g).length?this._getTagValues("Identifier",H.query("Dimension",g)[1]):[],l=1<H.query("Dimension",g).length?this._getTagValues("Default",H.query("Dimension",g)[1])||this._getTagValues("Value",H.query("Dimension",g)[1]):[];h=this._getTagValues("Format",g);u=this._getLayerMatrixInfos(g,
u);f={identifier:f,tileMatrixSetInfos:u,formats:h,styles:a,title:r,description:q,gcsExtent:t,dimensions:c,dimensions2:l};g=H.query("ResourceURL",g);var p=[],y;B.forEach(g,function(K){y=K.getAttribute("template");if(d&&c&&d[0]&&c[0])if(-1<y.indexOf("{"+d+"}"))y=y.replace("{"+d+"}","{dimensionValue}");else{var P=y.toLowerCase().indexOf("{"+d[0].toLowerCase()+"}");-1<P&&(y=y.substring(0,P)+"{dimensionValue}"+y.substring(P+d[0].length+2))}e&&l&&e[0]&&l[0]&&(-1<y.indexOf("{"+e+"}")?y=y.replace("{"+e+"}",
"{dimensionValue2}"):(P=y.toLowerCase().indexOf("{"+e[0].toLowerCase()+"}"),-1<P&&(y=y.substring(0,P)+"{dimensionValue2}"+y.substring(P+e[0].length+2))));p.push({template:y,format:K.getAttribute("format"),resourceType:K.getAttribute("resourceType")})});p&&0<p.length&&(f.resourceUrls=p);return f},_getLayerMatrixInfos:function(f,g){var u=[],q=this._getTagValues("TileMatrixSet",f);if(q&&0!==q.length)return B.forEach(q,function(r){r=this._getLayerMatrixInfo(r,f,g);u.push(r)},this),u},_getLayerMatrixInfo:function(f,
g,u){var q=[];g=this._getTagWithChildTagValue("TileMatrixSetLink","TileMatrixSet",f,g);var r=this._getTagValues("TileMatrix",g),t=this._getTagWithChildTagValue("TileMatrixSet","Identifier",f,u),h=this._getTagValues("SupportedCRS",t)[0];var a=parseInt(h.split(":").pop(),10);if(900913==a||3857==a)a=102100;if(-1<h.toLowerCase().indexOf("crs84")||-1<h.toLowerCase().indexOf("crs:84")){a=4326;var b=!0}else if(-1<h.toLowerCase().indexOf("crs83")||-1<h.toLowerCase().indexOf("crs:83"))a=4269,b=!0;else if(-1<
h.toLowerCase().indexOf("crs27")||-1<h.toLowerCase().indexOf("crs:27"))a=4267,b=!0;var d=new F({wkid:a}),c=H.query("TileMatrix",t)[0];u=parseInt(this._getTagValues("TileWidth",c)[0],10);g=parseInt(this._getTagValues("TileHeight",c)[0],10);var e=this._getTagValues("TopLeftCorner",c)[0].split(" ");var l=e[0],p=e[1];1<l.split("E").length&&(e=l.split("E"),l=e[0]*Math.pow(10,e[1]));1<p.split("E").length&&(e=p.split("E"),p=e[0]*Math.pow(10,e[1]));l=parseFloat(l);p=parseFloat(p);var y=b&&4326===a&&90===
l&&-180===p;for(e=0;e<this._flippingAxisForWkids.length;e++)if(h.split(":").pop()>=this._flippingAxisForWkids[e][0]&&h.split(":").pop()<=this._flippingAxisForWkids[e][1]||4326===a&&(!b||y)){4326===a&&90<l&&(l="90");var K=new L(p,l,d);break}e===this._flippingAxisForWkids.length&&(K=new L(l,p,d));if(0===r.length)for(r=H.query("TileMatrix",t),e=0;e<r.length;e++)b=this._getLodFromTileMatrix(r[e],a,e,f),q.push(b);else for(e=0;e<r.length;e++)b=this._getTagWithChildTagValue("TileMatrix","Identifier",r[e],
t),b=this._getLodFromTileMatrix(b,a,e,f),q.push(b);a=H.query("BoundingBox",t)[0];if(a){var P=this._getTagValues("LowerCorner",a)[0].split(" ");var W=this._getTagValues("UpperCorner",a)[0].split(" ")}P&&1<P.length&&W&&1<W.length?(c=parseFloat(P[0]),a=parseFloat(P[1]),P=parseFloat(W[0]),W=parseFloat(W[1])):(P=this._getTagValues("MatrixWidth",c)[0],a=this._getTagValues("MatrixHeight",c)[0],c=K.x,W=K.y,P=c+P*g*q[0].resolution,a=W-a*u*q[0].resolution);W=P=new O(c,a,P,W,d);K=new M({dpi:96,spatialReference:d,
format:this.format,rows:u,cols:g,origin:K,lods:q});return{tileMatrixSet:f,fullExtent:W,initialExtent:P,tileInfo:K}},_getCapabilitiesError:function(f){console.error("Failed to get capabilities xml");this.onError(f)},_getLodFromTileMatrix:function(f,g,u,q){var r=this._getTagValues("Identifier",f)[0];f=this._getTagValues("ScaleDenominator",f)[0];1<f.split("E").length?(f=f.split("E"),f=f[0]*Math.pow(10,f[1])):f=parseFloat(f);g=this._getResolution(g,f,q);return{level:u,levelValue:r,scale:1.058267716535433*
f,resolution:g}},_getResolution:function(f,g,u){f=v.isDefined(J[f])?J.values[J[f]]:"default028mm"===u?6370997*Math.PI/180:6378137*Math.PI/180;return 7*g/25E3/f},_getTag:function(f,g){return(f=H.query(f,g))&&0<f.length?f[0]:null},_getTagValues:function(f,g){var u=[];f=f.split("\x3e");var q=H.query(f[0],g)[0];if(1<f.length){for(g=1;g<f.length-1;g++)q=H.query(f[g],q)[0];g=H.query(f[f.length-1],q)}else g=H.query(f[0],g);g&&0<g.length&&B.forEach(g,function(r){9>A("ie")?u.push(r.childNodes.length?r.childNodes[0].nodeValue:
""):u.push(r.textContent)});return u},_getAttributeValues:function(f,g,u){f=H.query(f,u);var q=[];f&&0<f.length&&B.forEach(f,function(r){q.push(r.getAttribute(g))});return q},_getTagWithChildTagValue:function(f,g,u,q){q=q.childNodes;var r;for(r=0;r<q.length;r++)if(-1<q[r].nodeName.indexOf(f)){if(9>A("ie")){if(v.isDefined(H.query(g,q[r])[0]))var t=H.query(g,q[r])[0].childNodes[0].nodeValue}else v.isDefined(H.query(g,q[r])[0])&&(t=H.query(g,q[r])[0].textContent);if(t===u||u.split(":")&&t===u.split(":")[1])return q[r]}},
_appendCustomParameters:function(f){var g;if(this.customParameters)for(g in this.customParameters)f+=(-1===f.indexOf("?")?"?":"\x26")+g+"\x3d"+encodeURIComponent(this.customParameters[g]);return f},_appendCustomLayerParameters:function(f){var g;if(this.customLayerParameters||this.customParameters){var u=E.clone(this.customParameters||{});E.mixin(u,this.customLayerParameters||{});for(g in u)f+=(-1===f.indexOf("?")?"?":"\x26")+g+"\x3d"+encodeURIComponent(u[g])}return f},_flippingAxisForWkids:[[3819,
3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,
5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,
3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]]});A("extend-esri")&&
E.setObject("layers.WMTSLayer",x,n);return x})},"dojox/xml/parser":function(){define(["dojo/_base/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/window","dojo/_base/sniff"],function(H){H.getObject("xml.parser",!0,dojox);dojox.xml.parser.parse=function(x,E){var B=H.doc;E=E||"text/xml";if(x&&H.trim(x)&&"DOMParser"in H.global){var A=(new DOMParser).parseFromString(x,E);x=A.documentElement;if("parsererror"==x.nodeName&&"http://www.mozilla.org/newlayout/xml/parsererror.xml"==x.namespaceURI){if(B=
x.getElementsByTagNameNS("http://www.mozilla.org/newlayout/xml/parsererror.xml","sourcetext")[0])B=B.firstChild.data;throw Error("Error parsing text "+x.firstChild.data+" \n"+B);}return A}if("ActiveXObject"in H.global){B=function(n){return"MSXML"+n+".DOMDocument"};B=["Microsoft.XMLDOM",B(6),B(4),B(3),B(2)];H.some(B,function(n){try{A=new ActiveXObject(n)}catch(v){return!1}return!0});if(x&&A&&(A.async=!1,A.loadXML(x),x=A.parseError,0!==x.errorCode))throw Error("Line: "+x.line+"\nCol: "+x.linepos+"\nReason: "+
x.reason+"\nError Code: "+x.errorCode+"\nSource: "+x.srcText);if(A)return A}else if(B.implementation&&B.implementation.createDocument){if(x&&H.trim(x)&&B.createElement){E=B.createElement("xml");E.innerHTML=x;var z=B.implementation.createDocument("foo","",null);H.forEach(E.childNodes,function(n){z.importNode(n,!0)});return z}return B.implementation.createDocument("","",null)}return null};dojox.xml.parser.textContent=function(x,E){if(1<arguments.length)return dojox.xml.parser.replaceChildren(x,(x.ownerDocument||
H.doc).createTextNode(E)),E;if(void 0!==x.textContent)return x.textContent;var B="";x&&H.forEach(x.childNodes,function(A){switch(A.nodeType){case 1:case 5:B+=dojox.xml.parser.textContent(A);break;case 3:case 2:case 4:B+=A.nodeValue}});return B};dojox.xml.parser.replaceChildren=function(x,E){var B=[];H.isIE&&H.forEach(x.childNodes,function(A){B.push(A)});dojox.xml.parser.removeChildren(x);H.forEach(B,H.destroy);H.isArray(E)?H.forEach(E,function(A){x.appendChild(A)}):x.appendChild(E)};dojox.xml.parser.removeChildren=
function(x){for(var E=x.childNodes.length;x.hasChildNodes();)x.removeChild(x.firstChild);return E};dojox.xml.parser.innerXML=function(x){return x.innerXML?x.innerXML:x.xml?x.xml:"undefined"!=typeof XMLSerializer?(new XMLSerializer).serializeToString(x):null};return dojox.xml.parser})},"esri/layers/WMTSLayerInfo":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(H,x,E,B){H=H(null,{declaredClass:"esri.layers.WMTSLayerInfo",identifier:null,tileMatrixSet:null,
format:null,style:null,tileInfo:null,title:null,fullExtent:null,initialExtent:null,description:null,dimension:null,constructor:function(A){A&&(this.title=A.title,this.tileMatrixSet=A.tileMatrixSet,this.format=A.format,this.style=A.style,this.tileInfo=A.tileInfo,this.fullExtent=A.fullExtent,this.initialExtent=A.initialExtent,this.identifier=A.identifier,this.description=A.description,this.dimension=A.dimension)}});E("extend-esri")&&x.setObject("layers.WMTSLayerInfo",H,B);return H})},"esri/layers/WebTiledLayer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/url dojo/sniff dojo/string ../config ../kernel ../request ../urlUtils ../SpatialReference ../geometry/Extent ./TiledMapServiceLayer ./TileInfo".split(" "),
function(H,x,E,B,A,z,n,v,D,w,J,F,L,O){function S(G,M){var m=[];if(G&&M&&(M.customLayerParameters||M.customParameters)){var f=x.clone(M.customParameters||{});x.mixin(f,M.customLayerParameters||{});G=w.urlToObject(G);for(var g in G.query)f.hasOwnProperty(g)||m.push(g+"\x3d"+G.query[g]);G=G.path+(m.length?"?"+m.join("\x26"):"")}return G}H=H(L,{declaredClass:"esri.layers.WebTiledLayer",constructor:function(G,M){M||(M={});this.urlTemplate=G=S(G,M.wmtsInfo);var m=new F(-2.0037508342787E7,-2.003750834278E7,
2.003750834278E7,2.0037508342787E7,new J({wkid:102100})),f=new F(-2.0037508342787E7,-2.003750834278E7,2.003750834278E7,2.0037508342787E7,new J({wkid:102100}));this.initialExtent=M.initialExtent||m;this.fullExtent=M.fullExtent||f;this.tileInfo=M.tileInfo?M.tileInfo:new O({dpi:96,rows:256,cols:256,origin:{x:-2.0037508342787E7,y:2.0037508342787E7},spatialReference:{wkid:102100},lods:[{level:0,resolution:156543.033928,scale:5.91657527591555E8},{level:1,resolution:78271.5169639999,scale:2.95828763795777E8},
{level:2,resolution:39135.7584820001,scale:1.47914381897889E8},{level:3,resolution:19567.8792409999,scale:7.3957190948944E7},{level:4,resolution:9783.93962049996,scale:3.6978595474472E7},{level:5,resolution:4891.96981024998,scale:1.8489297737236E7},{level:6,resolution:2445.98490512499,scale:9244648.868618},{level:7,resolution:1222.99245256249,scale:4622324.434309},{level:8,resolution:611.49622628138,scale:2311162.217155},{level:9,resolution:305.748113140558,scale:1155581.108577},{level:10,resolution:152.874056570411,
scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,
scale:1128.497176},{level:20,resolution:.14929107082380833,scale:564.248588},{level:21,resolution:.07464553541190416,scale:282.124294},{level:22,resolution:.03732276770595208,scale:141.062147},{level:23,resolution:.01866138385297604,scale:70.5310735}]});this.spatialReference=new J(this.tileInfo.spatialReference.toJson());this.copyright=M.copyright||"";var g=new B(G);m=g.scheme+"://"+g.authority+"/";this.urlPath=G.substring(m.length);this.tileServers=M.tileServers||[];-1===g.authority.indexOf("{subDomain}")&&
this.tileServers.push(m);if(M.subDomains&&0<M.subDomains.length&&1<g.authority.split(".").length){this.subDomains=M.subDomains;var u;E.forEach(M.subDomains,function(t){-1<g.authority.indexOf("${subDomain}")?u=g.scheme+"://"+z.substitute(g.authority,{subDomain:t})+"/":-1<g.authority.indexOf("{subDomain}")&&(u=g.scheme+"://"+g.authority.replace(/\{subDomain\}/gi,t)+"/");this.tileServers.push(u)},this)}this.tileServers=E.map(this.tileServers,function(t){"/"!==t.charAt(t.length-1)&&(t+="/");return t});
this._levelToLevelValue=[];var q=0;E.forEach(this.tileInfo.lods,function(t,h){this._levelToLevelValue[t.level]=t.levelValue||t.level;0===h&&(q=this._levelToLevelValue[t.level])},this);this._wmtsInfo=M.wmtsInfo;var r=x.hitch(this,function(){this.loaded=!0;this.onLoad(this)});A("chrome")?(G=this.getTileUrl(q,0,0),M=n.defaults.io,m="with-credentials"===M.useCors?w.canUseXhr(G,!0):-1,(M=-1<m?M.corsEnabledServers[m]:null)&&M.withCredentials?D({url:G,handleAs:"arraybuffer"}).addBoth(function(){r()}):r()):
r()},getTileUrl:function(G,M,m){G=this._levelToLevelValue[G];var f=this.tileServers[M%this.tileServers.length]+z.substitute(this.urlPath,{level:G,z:G,col:m,x:m,row:M,y:M});f=f.replace(/\{level\}/gi,G).replace(/\{row\}/gi,M).replace(/\{col\}/gi,m).replace(/\{z\}/gi,G).replace(/\{x\}/gi,m).replace(/\{y\}/gi,M);f=this._appendCustomLayerParameters(f);f=this.addTimestampToURL(f);return w.addProxy(f)},_appendCustomLayerParameters:function(G){var M;if(this._wmtsInfo&&(this._wmtsInfo.customLayerParameters||
this._wmtsInfo.customParameters)){var m=x.clone(this._wmtsInfo.customParameters||{});x.mixin(m,this._wmtsInfo.customLayerParameters||{});for(M in m)G+=(-1===G.indexOf("?")?"?":"\x26")+M+"\x3d"+encodeURIComponent(m[M])}return G}});A("extend-esri")&&x.setObject("layers.WebTiledLayer",H,v);return H})},"widgets/AddData/search/Paging":function(){define("dojo/_base/declare dojo/dom-class ./SearchComponent dojo/text!./templates/Paging.html dojo/i18n!../nls/strings ./util".split(" "),function(H,x,E,B,A,z){return H([E],
{i18n:A,templateString:B,hasLess:!1,hasMore:!1,nextStart:-1,numPerPage:null,previousStart:-1,start:1,postCreate:function(){this.inherited(arguments);null===this.numPerPage&&(this.numPerPage=30);this.enableOrDisable()},startup:function(){if(!this._started){this.inherited(arguments);try{var n=this.getConfig().numPerPage,v=Number(n);"number"!==typeof v||isNaN(v)||(v=Math.floor(v),1<=v&&100>=v&&(this.numPerPage=v))}catch(D){console.warn("Error setting numPerPage:"),console.warn(D)}null===this.numPerPage&&
(this.numPerPage=30)}},enableOrDisable:function(){this.hasLess?(x.remove(this.firstButton.parentNode,"disabled"),x.remove(this.previousButton.parentNode,"disabled")):(x.add(this.firstButton.parentNode,"disabled"),x.add(this.previousButton.parentNode,"disabled"));this.hasMore?x.remove(this.nextButton.parentNode,"disabled"):x.add(this.nextButton.parentNode,"disabled")},firstButtonClicked:function(){this.hasLess&&(this.start=1,this.search())},previousButtonClicked:function(){this.hasLess&&(this.start=
this.previousStart,this.search())},nextButtonClicked:function(){this.hasMore&&(this.start=this.nextStart,this.search())},appendQueryParams:function(n){n.start=this.start;n.num=this.numPerPage},processResults:function(n){this.start=1;var v=this.numPerPage,D=n.total,w=n.queryParams.start;1>w&&(w=1);this.hasLess=!1;this.previousStart=-1;1<w&&(this.hasLess=!0,this.previousStart=w-n.queryParams.num,1>this.previousStart&&(this.previousStart=1));this.hasMore=!1;this.nextStart=-1;n.nextQueryParams&&1<n.nextQueryParams.start&&
(this.hasMore=!0,this.nextStart=n.nextQueryParams.start);n="";D>v?(D=1,1<w&&(D=Math.floor(w/v)+1),n=this.i18n.search.paging.pagePattern,n=n.replace("{page}",""+D)):(n=this.i18n.search.paging.pagePattern,n=n.replace("{page}","1"));z.setNodeText(this.pageNode,n);this.enableOrDisable()}})})},"widgets/AddData/search/ResultCount":function(){define("dojo/_base/declare dojo/number ./SearchComponent dojo/text!./templates/ResultCount.html dojo/i18n!../nls/strings ./util".split(" "),function(H,x,E,B,A,z){return H([E],
{i18n:A,templateString:B,typePlural:A.search.resultCount.itemPlural,typeSingular:A.search.resultCount.itemSingular,postCreate:function(){this.inherited(arguments)},processResults:function(n){n=n.total;var v=this.typePlural;1===n&&(v=this.typeSingular);var D=this.i18n.search.resultCount.countPattern;D=D.replace("{count}",x.format(n));D=D.replace("{type}",v);z.setNodeText(this.messageNode,D)}})})},"widgets/AddData/search/AddFromUrlPane":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/on dojo/keys dojo/Deferred dojo/promise/all dojo/dom-class dojo/window dijit/Viewport dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./templates/AddFromUrlPane.html dojo/i18n!../nls/strings ./LayerLoader ./util esri/layers/ArcGISDynamicMapServiceLayer esri/layers/ArcGISImageServiceLayer esri/layers/ArcGISTiledMapServiceLayer esri/layers/CSVLayer esri/layers/FeatureLayer esri/layers/GeoRSSLayer esri/layers/ImageParameters esri/layers/KMLLayer esri/layers/StreamLayer esri/layers/VectorTileLayer esri/layers/WMSLayer esri/layers/WMTSLayer esri/InfoTemplate jimu/dijit/Message dijit/form/Select dijit/form/ValidationTextBox".split(" "),
function(H,x,E,B,A,z,n,v,D,w,J,F,L,O,S,G,M,m,f,g,u,q,r,t,h,a,b,d,c,e,l){return H([J,F,L],{i18n:S,templateString:O,wabWidget:null,_dfd:null,postCreate:function(){this.inherited(arguments);this._updateExamples("ArcGIS");this.urlTextBox.set("invalidMessage",S.addFromUrl.invalidURL);var p=this;this.own(B(this.urlTextBox,"keyup",function(y){y.keyCode===A.ENTER?p.addClicked():v.contains(p.addButton,"disabled")||p._setStatus("")}));this.own(B(this.urlTextBox,"focus",function(){try{p.urlTextBox.select()}catch(y){}}));
this.own(B(this.typeSelect,"change",function(y){p._updateExamples(y)}));this.own(B(this.typeSelect.dropDown,"open",function(){var y=this.domNode.parentElement;y&&v.add(y,"add-data-widget-popup")}));this.own(w.on("resize",p.resize()))},destroy:function(){this.inherited(arguments)},addClicked:function(){var p=this,y=!1,K=this.addButton;if(!v.contains(K,"disabled")){var P=this.typeSelect.get("value"),W=x.trim(this.urlTextBox.value);0<W.length&&W&&(y=!0);y&&(v.add(K,"disabled"),p._setStatus(S.search.item.messages.adding),
y=new z,this._handleAdd(y,this.wabWidget.map,P,W),y.then(function(U){U?p._setStatus(""):p._setStatus(S.search.item.messages.addFailed);v.remove(K,"disabled")}).otherwise(function(U){"string"===typeof U&&"Unsupported"===U?(p._setStatus(S.search.item.messages.unsupported),v.remove(K,"disabled")):(console.warn("Add layer failed."),console.warn(U),p._setStatus(S.search.item.messages.addFailed),v.remove(K,"disabled"),U&&"string"===typeof U.message&&0<U.message.length&&(p._setStatus(U.message),console.log("")))}))}},
examplesExpanderClicked:function(){v.toggle(this.examplesNode,"show")},preHide:function(){},resize:function(){var p=D.getBox(this.ownerDocument);p&&"undefined"!==typeof p.w&&(600<p.w?v.add(this.urlTextBox,"url-textbox-wide"):v.remove(this.urlTextBox,"url-textbox-wide"))},_handleAdd:function(p,y,K,P){P=M.checkMixedContent(P);var W=P.toLowerCase(),U=new G,k=U._generateLayerId(),I=this,C=null;"ArcGIS"===K?0<W.indexOf("/featureserver")||0<W.indexOf("/mapserver")?U._readRestInfo(P).then(function(T){if(T&&
"string"===typeof T.type&&("Feature Layer"===T.type||"Table"===T.type))C=new q(P,{id:k,outFields:["*"],infoTemplate:new e}),I._waitThenAdd(p,y,K,U,C);else if(0<W.indexOf("/featureserver")){var N=[];E.forEach(T.layers,function(Q){Q=new q(P+"/"+Q.id,{id:U._generateLayerId(),outFields:["*"],infoTemplate:new e});N.push(U._waitForLayer(Q))});E.forEach(T.tables,function(Q){Q=new q(P+"/"+Q.id,{id:U._generateLayerId(),outFields:["*"]});N.push(U._waitForLayer(Q))});n(N).then(function(Q){var X=[];E.forEach(Q,
function(R){X.push(R)});X.reverse();E.forEach(X,function(R){U._setFeatureLayerInfoTemplate(R);R.xtnAddData=!0;y.addLayer(R)});p.resolve(X)}).otherwise(function(Q){p.reject(Q)})}else if(0<W.indexOf("/mapserver")){if(T.tileInfo)C=new g(P,{id:k});else{var V={id:k};T&&T.supportedImageFormatTypes&&-1!==T.supportedImageFormatTypes.indexOf("PNG32")&&(V.imageParameters=new t,V.imageParameters.format="png32");C=new m(P,V)}I._waitThenAdd(p,y,K,U,C)}}).otherwise(function(T){p.reject(T)}):0<W.indexOf("/imageserver")?
(C=new f(P,{id:k}),this._waitThenAdd(p,y,K,U,C)):0<W.indexOf("/vectortileserver")||0<W.indexOf("/resources/styles/root.json")?b&&b.supported()?U._checkVectorTileUrl(P,{}).then(function(T){C=new b(T,{id:k});I._waitThenAdd(p,y,K,U,C)}).otherwise(function(T){p.reject(T)}):p.reject("Unsupported"):0<W.indexOf("/streamserver")?(C=new a(P,{id:k,purgeOptions:{displayCount:1E4},infoTemplate:new e}),this._waitThenAdd(p,y,K,U,C)):p.reject("Unsupported"):"WMS"===K?(C=new d(P,{id:k}),this._waitThenAdd(p,y,K,U,
C)):"WMTS"===K?(C=new c(P,{id:k}),this._waitThenAdd(p,y,K,U,C)):"WFS"===K?M.loadWFSByUrl(p,y,U,P,k,!0):"KML"===K?(C=new h(P,{id:k}),this._waitThenAdd(p,y,K,U,C)):"GeoRSS"===K?(C=new r(P,{id:k}),this._waitThenAdd(p,y,K,U,C)):"CSV"===K&&(C=new u(P,{id:k}),C.setInfoTemplate(U._newInfoTemplate()),this._waitThenAdd(p,y,K,U,C))},_persist:function(){try{var p=this.typeSelect.get("value"),y=x.trim(this.urlTextBox.value);this.wabWidget.xtnAddFromUrlPane={type:p,url:y}}catch(K){}},_restore:function(){try{var p=
this.wabWidget.xtnAddFromUrlPane;p&&"string"===typeof p.type&&0<p.type.length&&this.typeSelect.set("value",p.type);p&&"string"===typeof p.url&&0<p.url.length&&(this.urlTextBox.value=p.url)}catch(y){}},_setStatus:function(p){this.wabWidget&&this.wabWidget._setStatus(p)},_showLayers:function(){this.wabWidget&&this.wabWidget.showLayers()},_updateExamples:function(p){E.forEach(this.examplesNode.children,function(y){var K=y.getAttribute("data-examples-type");"string"===typeof K&&0<K.length&&(y.style.display=
K===p?"":"none")})},_waitThenAdd:function(p,y,K,P,W){P._waitForLayer(W).then(function(U){"WMS"===K?P._setWMSVisibleLayers(U):U&&"esri.layers.ArcGISDynamicMapServiceLayer"===U.declaredClass?P._setDynamicLayerInfoTemplates(U):U&&"esri.layers.FeatureLayer"===U.declaredClass?P._setFeatureLayerInfoTemplate(U):U&&"esri.layers.CSVLayer"===U.declaredClass&&P._setFeatureLayerInfoTemplate(U);U.xtnAddData=!0;if("KML"===K){var k=y.spatialReference,I=U._outSR;k&&I&&(k.equals(I)||k.isWebMercator()&&4326===I.wkid||
I.isWebMercator()&&4326===k.wkid)?y.addLayer(U):new l({titleLabel:S._widgetLabel,message:S.addFromFile.kmlProjectionMismatch})}else y.addLayer(U);p.resolve(U)}).otherwise(function(U){p.reject(U)})}})})},"esri/layers/CSVLayer":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../kernel ../arcgis/csv ./FeatureLayer ../geometry/Extent ../tasks/FeatureSet".split(" "),function(H,x,E,B,A,z,n,v,D){x=x(n,{declaredClass:"esri.layers.CSVLayer",_preventInit:!0,_fieldTypeMap:{Date:"esriFieldTypeDate",
Number:"esriFieldTypeDouble",String:"esriFieldTypeString"},constructor:function(w,J){this.url=w;J=E.mixin({},J);this.columnDelimiter=J.columnDelimiter;this.latitudeFieldName=J.latitudeFieldName;this.longitudeFieldName=J.longitudeFieldName;w=J.layerDefinition;w||(w={fields:J.fields||[],geometryType:"esriGeometryPoint",copyrightText:J.copyright},J.fields&&H.forEach(J.fields,function(F){F.type=this._fieldTypeMap[F.type||"String"];F.alias||(F.alias=F.name)},this));this._buildCsvFcParam={url:this.url,
columnDelimiter:this.columnDelimiter,layerDefinition:w,outFields:J.outFields};this.latitudeFieldName&&this.longitudeFieldName&&(this._buildCsvFcParam.locationInfo={locationType:"coordinates",latitudeFieldName:this.latitudeFieldName,longitudeFieldName:this.longitudeFieldName});this._projectFeatures=E.hitch(this,this._projectFeatures);this._addFeatures=E.hitch(this,this._addFeatures);this._initCSVLayer(J)},refresh:function(){this._fireUpdateStart();this.applyEdits(null,null,this.graphics);this._loadFeatures()},
_isWebGLCompatible:function(){return!1},_setMap:function(w){var J=this.inherited(arguments);this._fireUpdateStart();this._projectFeatures(this._csvFC).then(this._addFeatures).otherwise(this._errorHandler);this._csvFC=null;return J},_initCSVLayer:function(w){var J=this;z.buildCSVFeatureCollection(this._buildCsvFcParam).then(function(F){!J._buildCsvFcParam.locationInfo||J.latitudeFieldName&&J.longitudeFieldName||(J.latitudeFieldName=J._buildCsvFcParam.locationInfo.latitudeFieldName,J.longitudeFieldName=
J._buildCsvFcParam.locationInfo.longitudeFieldName);J._csvFC=F;var L=F.layerDefinition;L.extent=J._getFCExtent(F);w.outFields||(w.outFields=["*"]);w.timeInfo&&(L.timeInfo=w.timeInfo);J._initFeatureLayer({layerDefinition:L},w)}).otherwise(this._errorHandler)},_loadFeatures:function(){z.buildCSVFeatureCollection(this._buildCsvFcParam).then(this._projectFeatures).then(this._addFeatures).otherwise(this._errorHandler)},_projectFeatures:function(w){return z.projectFeatureCollection(w,this._map.spatialReference)},
_addFeatures:function(w){w=new D(w.featureSet);this.applyEdits(w.features,null,null);this._fireUpdateEnd()},_getFCExtent:function(w){if(w&&w.featureSet&&w.featureSet.features){w=w.featureSet.features;var J=w.length;if(1<J){var F=w[0].geometry;var L=new v(F.x,F.y,F.x,F.y);for(--J;0<J;J--)F=w[J].geometry,L.xmin=Math.min(L.xmin,F.x),L.ymin=Math.min(L.ymin,F.y),L.xmax=Math.max(L.xmax,F.x),L.ymax=Math.max(L.ymax,F.y);0>=L.getWidth()&&0>=L.getHeight()&&(L=null)}}return L}});B("extend-esri")&&E.setObject("layers.CSVLayer",
x,A);return x})},"esri/arcgis/csv":function(){define("dojo/_base/lang dojo/_base/array dojo/_base/Deferred dojo/sniff dojo/number dojox/data/CsvStore ../kernel ../config ../request ../SpatialReference ../geometry/jsonUtils ../geometry/webMercatorUtils".split(" "),function(H,x,E,B,A,z,n,v,D,w,J,F){function L(q){var r=0,t="";x.forEach([","," ",";","|","\t"],function(h){var a=q.split(h).length;a>r&&(r=a,t=h)});return t}function O(q,r){if(!q||"[object Date]"!==Object.prototype.toString.call(q)||isNaN(q.getTime()))return!1;
q=!0;if(B("chrome")&&/\d+\W*$/.test(r)){if(r.match(/[^0-9a-zA-Z\s]/))return!1;if(r=r.match(/[a-zA-Z]{2,}/)){q=!1;for(var t=0,h=r.length,a=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i;!q&&t<=h&&!(q=!a.test(r[t]));)t++;q=!q}}return q}function S(q,r,t){var h=q.indexOf("\n");h=H.trim(q.substr(0,h));var a=r.columnDelimiter;a||(a=L(h));var b=new z({data:q,separator:a});b.fetch({onComplete:function(d,
c){c=0;var e={layerDefinition:r.layerDefinition,featureSet:{features:[],geometryType:"esriGeometryPoint"}},l=e.layerDefinition.objectIdField,p=e.layerDefinition.fields;l||x.some(p,function(Q){return"esriFieldTypeOID"===Q.type?(l=Q.name,!0):!1})||(p.push({name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1}),l="__OBJECTID");var y=b._attributes,K=[],P=[];x.forEach(p,function(Q){"esriFieldTypeDate"===Q.type?K.push(Q.name):("esriFieldTypeDouble"===Q.type||"esriFieldTypeInteger"===
Q.type)&&P.push(Q.name)});if(r.locationInfo&&"coordinates"===r.locationInfo.locationType){var W=r.locationInfo.latitudeFieldName;var U=r.locationInfo.longitudeFieldName}else x.forEach(y,function(Q){var X=x.indexOf(f,Q.toLowerCase());-1!==X&&(W=Q);X=x.indexOf(g,Q.toLowerCase());-1!==X&&(U=Q)}),W&&U&&(r.locationInfo={locationType:"coordinates",latitudeFieldName:W,longitudeFieldName:U});if(W&&U){-1===x.indexOf(P,W)&&P.push(W);-1===x.indexOf(P,U)&&P.push(U);if(H.isArray(r.outFields)&&-1===x.indexOf(r.outFields,
"*"))var k=r.outFields;x.forEach(y,function(Q){x.some(p,function(X){return Q===X.name})||p.push({name:Q,alias:Q,type:Q===W||Q===U?"esriFieldTypeDouble":"esriFieldTypeString"})});y=0;var I=d.length;for(y;y<I;y++){var C=d[y],T=b.getAttributes(C),N={};x.forEach(T,function(Q){if(Q&&(Q===W||Q===U||!k||-1<x.indexOf(k,Q))){var X=Q;0===Q.length&&x.forEach(p,function(Y,aa){Y.name==="attribute_"+(aa-1)&&(Q="attribute_"+(aa-1))});if(-1<x.indexOf(K,Q)){X=b.getValue(C,X);var R=new Date(X);N[Q]=O(R,X)?R.getTime():
null}else-1<x.indexOf(P,Q)?(R=A.parse(b.getValue(C,X)),Q!==W&&Q!==U||!(isNaN(R)||181<Math.abs(R))||(R=parseFloat(b.getValue(C,X))),isNaN(R)?N[Q]=null:N[Q]=R):N[Q]=b.getValue(C,X)}});N[l]=c;c++;T=N[W];var V=N[U];null==V||null==T||isNaN(T)||isNaN(V)||(k&&-1===x.indexOf(k,W)&&delete N[W],k&&-1===x.indexOf(k,U)&&delete N[U],e.featureSet.features.push({geometry:{x:V,y:T,spatialReference:{wkid:4326}},attributes:N}))}e.layerDefinition.name="csv";t&&t(e)}else setTimeout(function(){console.error("File does not seem to contain fields with point coordinates.")},
1),t&&t(null,Error("File does not seem to contain fields with point coordinates."))},onError:function(d){console.error("Error fetching items from CSV store: ",d);t&&t(null,d)}});return!0}function G(q,r,t,h,a,b){0===q.length&&a(null);var d=J.getGeometryType(r),c=[];x.forEach(q,function(e){e=new d(e);e.spatialReference=t;c.push(e)},this);r=[102113,102100,3857];t.wkid&&4326===t.wkid&&h.wkid&&-1<x.indexOf(r,h.wkid)?(x.forEach(c,function(e){e.xmin?(e.xmin=Math.max(e.xmin,-180),e.xmax=Math.min(e.xmax,180),
e.ymin=Math.max(e.ymin,-89.99),e.ymax=Math.min(e.ymax,89.99)):e.rings?x.forEach(e.rings,function(l){x.forEach(l,function(p){p[0]=Math.min(Math.max(p[0],-180),180);p[1]=Math.min(Math.max(p[1],-89.99),89.99)},this)},this):e.paths?x.forEach(e.paths,function(l){x.forEach(l,function(p){p[0]=Math.min(Math.max(p[0],-180),180);p[1]=Math.min(Math.max(p[1],-89.99),89.99)},this)},this):e.x&&(e.x=Math.min(Math.max(e.x,-180),180),e.y=Math.min(Math.max(e.y,-89.99),89.99))},this),q=[],x.forEach(c,function(e){e=
F.geographicToWebMercator(e);102100!==h.wkid&&(e.spatialReference=h);q.push(e.toJson())},this),a(q)):null!==t.wkid&&-1<x.indexOf(r,t.wkid)&&null!==h.wkid&&4326===h.wkid?(q=[],x.forEach(c,function(e){q.push(F.webMercatorToGeographic(e).toJson())},this),a(q)):(r=function(e,l){e&&e.length===q.length?(q=[],x.forEach(e,function(p){p&&(p.rings&&0<p.rings.length&&0<p.rings[0].length&&0<p.rings[0][0].length&&!isNaN(p.rings[0][0][0])&&!isNaN(p.rings[0][0][1])||p.paths&&0<p.paths.length&&0<p.paths[0].length&&
0<p.paths[0][0].length&&!isNaN(p.paths[0][0][0])&&!isNaN(p.paths[0][0][1])||p.xmin&&!isNaN(p.xmin)&&p.ymin&&!isNaN(p.ymin)||p.x&&!isNaN(p.x)&&p.y&&!isNaN(p.y))?q.push(p.toJson()):q.push(null)},this),a(q)):b(e,l)},v.defaults.geometryService?v.defaults.geometryService.project(c,h,H.hitch(this,r),b):a(null))}function M(q,r){var t=[102113,102100,3857];return q&&r&&q.wkid===r.wkid&&q.wkt===r.wkt||q&&r&&q.wkid&&r.wkid&&-1<x.indexOf(t,q.wkid)&&-1<x.indexOf(t,r.wkid)?!0:!1}function m(q,r,t,h){if(q.featureSet&&
0!==q.featureSet.features.length)if(M(t,r))h(q);else{var a=function(e){var l=[];x.forEach(q.featureSet.features,function(p,y){e[y]&&(p.geometry=e[y],l.push(p))},this);h(q)},b=function(e,l){console.error("error projecting featureSet ("+q.layerDefinition.name+"). Final try.");h(q)},d=function(e,l){console.error("error projecting featureSet ("+q.layerDefinition.name+"). Try one more time.");G(c,q.featureSet.geometryType,r,t,H.hitch(this,a),H.hitch(this,b))};if(q.featureSet.features&&0<q.featureSet.features.length){var c=
[];x.forEach(q.featureSet.features,function(e){if(e.geometry.toJson)c.push(e.geometry);else{var l=J.getGeometryType(q.featureSet.geometryType);c.push(new l(e.geometry))}});r.toJson||(r=new w(r));t.toJson||(t=new w(t));G(c,q.featureSet.geometryType,r,t,H.hitch(this,a),H.hitch(this,d))}else h(q)}}var f="lat latitude y ycenter latitude83 latdecdeg point-y lat_dd".split(" "),g="lon lng long longitude x xcenter longitude83 longdecdeg point-x long_dd".split(" "),u={latFieldStrings:f,longFieldStrings:g,
buildCSVFeatureCollection:function(q){var r=new E,t=function(a,b){b?r.errback(b):r.callback(a)},h={url:q.url,handleAs:"text",load:function(a){S(a,q,H.hitch(this,t))},error:function(a){r.errback(a);console.error("error: "+a)}};-1<q.url.indexOf("arcgis.com")&&-1<q.url.indexOf("/content/items")&&-1<q.url.indexOf("/data")&&(h.headers={"Content-Type":""});D(h,{usePost:!1});return r},projectFeatureCollection:function(q,r,t){var h=new E;t||(t=new w({wkid:4326}));m(q,t,r,H.hitch(this,function(a){h.callback(a)}));
return h},generateDefaultPopupInfo:function(q){var r={esriFieldTypeDouble:1,esriFieldTypeSingle:1},t={esriFieldTypeInteger:1,esriFieldTypeSmallInteger:1},h={esriFieldTypeDate:1},a=null;q=x.map(q.layerDefinition.fields,H.hitch(this,function(b){"NAME"===b.name.toUpperCase()&&(a=b.name);var d="esriFieldTypeOID"!==b.type&&"esriFieldTypeGlobalID"!==b.type&&"esriFieldTypeGeometry"!==b.type,c=null;if(d){var e=b.name.toLowerCase();if(-1<",stretched value,fnode_,tnode_,lpoly_,rpoly_,poly_,subclass,subclass_,rings_ok,rings_nok,".indexOf(","+
e+",")||-1<e.indexOf("area")||-1<e.indexOf("length")||-1<e.indexOf("shape")||-1<e.indexOf("perimeter")||-1<e.indexOf("objectid")||e.indexOf("_")===e.length-1||e.indexOf("_i")===e.length-2&&1<e.length)d=!1;b.type in t?c={places:0,digitSeparator:!0}:b.type in r?c={places:2,digitSeparator:!0}:b.type in h&&(c={dateFormat:"shortDateShortTime"})}return H.mixin({},{fieldName:b.name,label:b.alias,isEditable:!0,tooltip:"",visible:d,format:c,stringFieldOption:"textbox"})}));return{title:a?"{"+a+"}":"",fieldInfos:q,
description:null,showAttachments:!1,mediaInfos:[]}},_getSeparator:L,_isValidDate:O,_processCsvData:S,_projectGeometries:G,_sameSpatialReference:M,_projectFeatureSet:m};B("extend-esri")&&H.setObject("arcgis.csv",u,n);return u})},"dojox/data/CsvStore":function(){define("dojo/_base/lang dojo/_base/declare dojo/_base/xhr dojo/_base/kernel dojo/data/util/filter dojo/data/util/simpleFetch".split(" "),function(H,x,E,B,A,z){x=x("dojox.data.CsvStore",null,{constructor:function(n){this._attributes=[];this._attributeIndexes=
{};this._dataArray=[];this._arrayOfAllItems=[];this._loadFinished=!1;n.url&&(this.url=n.url);this._csvData=n.data;n.label?this.label=n.label:""===this.label&&(this.label=void 0);this._storeProp="_csvStore";this._idProp="_csvId";this._features={"dojo.data.api.Read":!0,"dojo.data.api.Identity":!0};this._loadInProgress=!1;this._queuedFetches=[];this.identifier=n.identifier;""===this.identifier?delete this.identifier:this._idMap={};"separator"in n&&(this.separator=n.separator);"urlPreventCache"in n&&
(this.urlPreventCache=n.urlPreventCache?!0:!1)},url:"",label:"",identifier:"",separator:",",urlPreventCache:!1,_assertIsItem:function(n){if(!this.isItem(n))throw Error(this.declaredClass+": a function was passed an item argument that was not an item");},_getIndex:function(n){n=this.getIdentity(n);this.identifier&&(n=this._idMap[n]);return n},getValue:function(n,v,D){this._assertIsItem(n);var w=D;if("string"===typeof v)v=this._attributeIndexes[v],null!=v&&(w=this._dataArray[this._getIndex(n)][v]||
D);else throw Error(this.declaredClass+": a function was passed an attribute argument that was not a string");return w},getValues:function(n,v){return(n=this.getValue(n,v))?[n]:[]},getAttributes:function(n){this._assertIsItem(n);var v=[];n=this._dataArray[this._getIndex(n)];for(var D=0;D<n.length;D++)""!==n[D]&&v.push(this._attributes[D]);return v},hasAttribute:function(n,v){this._assertIsItem(n);if("string"===typeof v)return v=this._attributeIndexes[v],n=this._dataArray[this._getIndex(n)],"undefined"!==
typeof v&&v<n.length&&""!==n[v];throw Error(this.declaredClass+": a function was passed an attribute argument that was not a string");},containsValue:function(n,v,D){var w=void 0;"string"===typeof D&&(w=A.patternToRegExp(D,!1));return this._containsValue(n,v,D,w)},_containsValue:function(n,v,D,w){n=this.getValues(n,v);for(v=0;v<n.length;++v){var J=n[v];if("string"===typeof J&&w)return null!==J.match(w);if(D===J)return!0}return!1},isItem:function(n){if(n&&n[this._storeProp]===this)if(n=n[this._idProp],
this.identifier){if(this._dataArray[this._idMap[n]])return!0}else if(0<=n&&n<this._dataArray.length)return!0;return!1},isItemLoaded:function(n){return this.isItem(n)},loadItem:function(n){},getFeatures:function(){return this._features},getLabel:function(n){if(this.label&&this.isItem(n))return this.getValue(n,this.label)},getLabelAttributes:function(n){return this.label?[this.label]:null},_fetchItems:function(n,v,D){var w=this,J=function(S,G){var M=null;if(S.query){var m;M=[];var f=S.queryOptions?
S.queryOptions.ignoreCase:!1,g={};for(m in S.query){var u=S.query[m];"string"===typeof u&&(g[m]=A.patternToRegExp(u,f))}for(f=0;f<G.length;++f){var q=!0,r=G[f];for(m in S.query)u=S.query[m],w._containsValue(r,m,u,g[m])||(q=!1);q&&M.push(r)}}else M=G.slice(0,G.length);v(M,S)};if(this._loadFinished)J(n,this._arrayOfAllItems);else if(""!==this.url)if(this._loadInProgress)this._queuedFetches.push({args:n,filter:J});else{this._loadInProgress=!0;var F=E.get({url:w.url,handleAs:"text",preventCache:w.urlPreventCache});
F.addCallback(function(S){try{w._processData(S),J(n,w._arrayOfAllItems),w._handleQueuedFetches()}catch(G){D(G,n)}});F.addErrback(function(S){w._loadInProgress=!1;if(D)D(S,n);else throw S;});var L=null;n.abort&&(L=n.abort);n.abort=function(){var S=F;S&&-1===S.fired&&(S.cancel(),S=null);L&&L.call(n)}}else if(this._csvData)try{this._processData(this._csvData),this._csvData=null,J(n,this._arrayOfAllItems)}catch(S){D(S,n)}else{var O=Error(this.declaredClass+": No CSV source data was provided as either URL or String data input.");
if(D)D(O,n);else throw O;}},close:function(n){},_getArrayOfArraysFromCsvFileContents:function(n){if(H.isString(n)){var v=/^\s+/g,D=/\s+$/g,w=/""/g,J=[],F=this._splitLines(n);for(n=0;n<F.length;++n){var L=F[n];if(0<L.length){L=L.split(this.separator);for(var O=0;O<L.length;){var S=L[O].replace(v,""),G=S.replace(D,""),M=G.charAt(0),m=G.charAt(G.length-1),f=G.charAt(G.length-2),g=G.charAt(G.length-3);if(2===G.length&&'""'==G)L[O]="";else if('"'==M&&('"'!=m||'"'==m&&'"'==f&&'"'!=g)){if(O+1===L.length)return;
L[O]=S+this.separator+L[O+1];L.splice(O+1,1)}else'"'==M&&'"'==m&&(G=G.slice(1,G.length-1),G=G.replace(w,'"')),L[O]=G,O+=1}J.push(L)}}this._attributes=J.shift();for(n=0;n<this._attributes.length;n++)this._attributeIndexes[this._attributes[n]]=n;this._dataArray=J}},_splitLines:function(n){var v=[],D,w="",J=!1;for(D=0;D<n.length;D++){var F=n.charAt(D);switch(F){case '"':J=!J;w+=F;break;case "\r":J?w+=F:(v.push(w),w="",D<n.length-1&&"\n"==n.charAt(D+1)&&D++);break;case "\n":J?w+=F:(v.push(w),w="");break;
default:w+=F}}""!==w&&v.push(w);return v},_processData:function(n){this._getArrayOfArraysFromCsvFileContents(n);this._arrayOfAllItems=[];if(this.identifier&&void 0===this._attributeIndexes[this.identifier])throw Error(this.declaredClass+": Identity specified is not a column header in the data set.");for(n=0;n<this._dataArray.length;n++){var v=n;this.identifier&&(v=this._dataArray[n][this._attributeIndexes[this.identifier]],this._idMap[v]=n);this._arrayOfAllItems.push(this._createItemFromIdentity(v))}this._loadFinished=
!0;this._loadInProgress=!1},_createItemFromIdentity:function(n){var v={};v[this._storeProp]=this;v[this._idProp]=n;return v},getIdentity:function(n){return this.isItem(n)?n[this._idProp]:null},fetchItemByIdentity:function(n){var v=n.scope?n.scope:B.global;if(this._loadFinished){var D=this._createItemFromIdentity(n.identity);this.isItem(D)||(D=null);n.onItem&&n.onItem.call(v,D)}else{var w=this;if(""!==this.url)this._loadInProgress?this._queuedFetches.push({args:n}):(this._loadInProgress=!0,D=E.get({url:w.url,
handleAs:"text"}),D.addCallback(function(J){try{w._processData(J);var F=w._createItemFromIdentity(n.identity);w.isItem(F)||(F=null);n.onItem&&n.onItem.call(v,F);w._handleQueuedFetches()}catch(L){n.onError&&n.onError.call(v,L)}}),D.addErrback(function(J){this._loadInProgress=!1;n.onError&&n.onError.call(v,J)}));else if(this._csvData)try{w._processData(w._csvData),w._csvData=null,D=w._createItemFromIdentity(n.identity),w.isItem(D)||(D=null),n.onItem&&n.onItem.call(v,D)}catch(J){n.onError&&n.onError.call(v,
J)}}},getIdentityAttributes:function(n){return this.identifier?[this.identifier]:null},_handleQueuedFetches:function(){if(0<this._queuedFetches.length){for(var n=0;n<this._queuedFetches.length;n++){var v=this._queuedFetches[n],D=v.filter,w=v.args;D?D(w,this._arrayOfAllItems):this.fetchItemByIdentity(v.args)}this._queuedFetches=[]}}});H.extend(x,z);return x})},"esri/layers/GeoRSSLayer":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../config ../request ../urlUtils ./ServiceGeneratedFeatureCollection".split(" "),
function(H,x,E,B,A,z,n,v,D){H=H([D],{declaredClass:"esri.layers.GeoRSSLayer",serviceUrl:v.getProtocolForWebResource()+"//utility.arcgis.com/sharing/rss",constructor:function(w,J){this._url=v.urlToObject(this.url=w);z.defaults.geoRSSService&&(this.serviceUrl=z.defaults.geoRSSService);this._createLayer()},parse:function(){return this._io=n({url:this.serviceUrl,content:{url:this.url,refresh:this.loaded?!0:void 0,outSR:this._outSR?E.toJson(this._outSR.toJson()):void 0},callbackParamName:"callback"})},
_initLayer:function(w){this.inherited(arguments);this.loaded||(this.loaded=!0,this.onLoad(this))}});B("extend-esri")&&x.setObject("layers.GeoRSSLayer",H,A);return H})},"esri/layers/ServiceGeneratedFeatureCollection":function(){define("dojo/_base/declare dojo/_base/connect dojo/_base/lang dojo/_base/array dojo/dom-construct dojo/dom-style dojo/has ../kernel ../SpatialReference ../geometry/Extent ../geometry/webMercatorUtils ../renderers/SimpleRenderer ./layer ./FeatureLayer ../dijit/PopupTemplate".split(" "),
function(H,x,E,B,A,z,n,v,D,w,J,F,L,O,S){H=H([L],{declaredClass:"esri.layers._ServiceGeneratedFeatureCollection",constructor:function(G,M){this.pointSymbol=M&&M.pointSymbol;this.polylineSymbol=M&&M.polylineSymbol;this.polygonSymbol=M&&M.polygonSymbol;this._outSR=M&&(M.outSpatialReference||M.outSR)||new D({wkid:4326});this._options=E.mixin({},M)},parse:function(){console.error("parse function has not been implemented")},getFeatureLayers:function(){var G=[];this._fLayers&&(G=G.concat(this._fLayers));
return G},onRefresh:function(){},onOpacityChange:function(){},refresh:function(){this.loaded&&this._map&&!this._io&&this.visible&&this._createLayer()},_createLayer:function(G){var M=this;this._fireUpdateStart();G=this.parse(G);G.addCallback(function(m){M._io=null;M._initLayer(m)});G.addErrback(function(m){M._io=null;m=E.mixin(Error(),m);m.message="Unable to load resource: "+M.url+" "+(m.message||"");M._fireUpdateEnd(m);M.onError(m)})},_initLayer:function(G){this.loaded&&this._removeInternalLayers();
this.name=G.name;this.description=G.description;this.snippet=G.snippet;this.featureInfos=G.featureInfos;this.fullExtent=this.initialExtent=new w(G.lookAtExtent);this.copyright=G.author||G.copyright;var M;(G=E.getObject("featureCollection.layers",!1,G))&&0<G.length&&(this._fLayers=[],B.forEach(G,function(m,f){var g=E.getObject("featureSet.features",!1,m);g&&0<g.length&&(M=E.mixin({outFields:["*"],infoTemplate:m.popupInfo?new S(m.popupInfo):null,editable:!1},this._options),M.id&&(M.id=M.id+"_"+f),M.webgl=
!1,m.layerDefinition.capabilities="Query,Data",m=new O(m,M),m.geometryType&&(this["_"+m.geometryType]=m),this._fLayers.push(m))},this),0===this._fLayers.length&&delete this._fLayers);this.items=[];this._esriGeometryPoint&&(this.items=this.items.concat(this._esriGeometryPoint.graphics),this.pointSymbol&&(G=new F(this.pointSymbol),this._esriGeometryPoint.setRenderer(G)));this._esriGeometryPolyline&&(this.items=this.items.concat(this._esriGeometryPolyline.graphics),this.polylineSymbol&&(G=new F(this.polylineSymbol),
this._esriGeometryPolyline.setRenderer(G)));this._esriGeometryPolygon&&(this.items=this.items.concat(this._esriGeometryPolygon.graphics),this.polygonSymbol&&(G=new F(this.polygonSymbol),this._esriGeometryPolygon.setRenderer(G)));this._fireUpdateEnd();this.loaded&&(this._addInternalLayers(),this.onRefresh())},_addInternalLayers:function(){var G=this._map;this._fireUpdateStart();var M=G.spatialReference,m=this._outSR;if(M.wkid)var f=M._isWebMercator()&&m._isWebMercator()||M.wkid===m.wkid;else if(M.wkt)f=
M.wkt===m.wkt;else{console.log("_setMap - map has invalid spatial reference");return}if(!f)if(M._isWebMercator()&&4326===m.wkid)this._converter=J.geographicToWebMercator;else if(m._isWebMercator()&&4326===M.wkid)this._converter=J.webMercatorToGeographic;else{console.log("_setMap - unsupported workflow. Spatial reference of the map and layer do not match, and the conversion cannot be done on the client.");return}(M=this._fLayers)&&0<M.length&&B.forEach(M,function(g){if(this._converter){var u=g.graphics,
q,r,t=u?u.length:0;for(q=0;q<t;q++)(r=u[q].geometry)&&u[q].setGeometry(this._converter(r))}G.addLayer(g)},this);this.setVisibility(this.visible);this._fireUpdateEnd()},_removeInternalLayers:function(){var G=this._map;G&&B.forEach(this.getFeatureLayers(),G.removeLayer,G)},setScaleRange:function(G,M){this.inherited(arguments);B.forEach(this.getFeatureLayers(),function(m){m.setScaleRange(G,M)});this._options.minScale=this.minScale;this._options.maxScale=this.maxScale},setOpacity:function(G){this.opacity!=
G&&(B.forEach(this.getFeatureLayers(),function(M){M.setOpacity(G)}),this.opacity=this._options.opacity=G,this.onOpacityChange(G))},onVisibilityChange:function(G){this._fireUpdateStart();B.forEach(this.getFeatureLayers(),function(M){M.setVisibility(G)});this._fireUpdateEnd()},_setMap:function(G,M){this.inherited(arguments);this._map=G;var m=this._div=A.create("div",null,M);z.set(m,"position","absolute");this._addInternalLayers();this.evaluateSuspension();return m},_unsetMap:function(G,M){this._io&&
this._io.cancel();x.disconnect(this._extChgHandle);delete this._extChgHandle;this._removeInternalLayers();var m=this._div;m&&(M.removeChild(m),A.destroy(m));this._div=null;this.inherited(arguments)}});n("extend-esri")&&E.setObject("layers._ServiceGeneratedFeatureCollection",H,v);return H})},"widgets/AddData/search/AddFromFilePane":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/on dojo/Deferred dojo/dom-class dijit/Viewport dojo/sniff dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./templates/AddFromFilePane.html dojo/i18n!../nls/strings ./LayerLoader ./util dojo/_base/kernel esri/request esri/layers/FeatureLayer esri/layers/KMLLayer esri/geometry/scaleUtils jimu/dijit/Message jimu/dijit/CheckBox".split(" "),
function(H,x,E,B,A,z,n,v,D,w,J,F,L,O,S,G,M,m,f,g,u,q){return H([w,J,F],{i18n:O,templateString:L,wabWidget:null,maxRecordCount:1E3,maxRecordThreshold:1E5,SHAPETYPE_ICONS:[{type:"shapefile",url:"images/filetypes/zip.svg"},{type:"csv",url:"images/filetypes/csv.svg"},{type:"kml",url:"images/filetypes/kml.svg"},{type:"gpx",url:"images/filetypes/gpx.svg"},{type:"geojson",url:"images/filetypes/geojson.svg"}],postCreate:function(){this.inherited(arguments);this.generalizeCheckBox.setLabel(O.addFromFile.generalizeOn);
this.own(v.on("resize",this.resize()))},destroy:function(){this.inherited(arguments)},startup:function(){if(!this._started){this.wabWidget.isPortal&&(this.SHAPETYPE_ICONS=[{type:"shapefile",url:"images/filetypes/zip.svg"},{type:"csv",url:"images/filetypes/csv.svg"},{type:"kml",url:"images/filetypes/kml.svg"},{type:"geojson",url:"images/filetypes/geojson.svg"}]);this.inherited(arguments);var r=this,t=this.dropArea,h=this.wabWidget.config;if(h.addFromFile)try{var a=Number(h.addFromFile.maxRecordCount);
"number"!==typeof a||isNaN(a)||(a=Math.floor(a),1<=a&&a<=this.maxRecordThreshold&&(this.maxRecordCount=a))}catch(d){console.warn("Error setting AddFromFile.maxRecordCount:"),console.warn(d)}if(O.addFromFile.types)try{for(var b in O.addFromFile.types)this._createFileTypeImage(b)}catch(d){console.warn("Error reading support file types:"),console.warn(d)}this.own(A(this.fileNode,"change",function(){if(!r._getBusy()){r._setBusy(!0);var d=r._getFileInfo();d.ok&&r._execute(d);r.fileNode.value=null}}));
this.own(A(this.uploadLabel,"click",function(d){r._getBusy()&&(d.preventDefault(),d.stopPropagation())}));this.own(A(t,"dragenter",function(d){d.preventDefault();r._getBusy()||(n.add(t,"hit"),r._setStatus(""))}));this.own(A(t,"dragleave",function(d){d.preventDefault();n.remove(t,"hit")}));this.own(A(t,"dragover",function(d){d.preventDefault()}));this.own(A(t,"drop",function(d){d.preventDefault();d.stopPropagation();r._getBusy()||(r._setBusy(!0),d=r._getFileInfo(d),d.ok&&r._execute(d))}));a=this.wabWidget.domNode;
this.own(A(a,"dragenter",function(d){d.preventDefault()}));this.own(A(a,"dragleave",function(d){d.preventDefault()}));this.own(A(a,"dragover",function(d){d.preventDefault()}));this.own(A(a,"drop",function(d){d.preventDefault()}));this.own(A(this.hintButton,"click",x.hitch(this,function(d){d.preventDefault();d='\x3cdiv class\x3d"intro"\x3e\x3clabel\x3e'+O.addFromFile.intro+"\x3c/label\x3e\x3cul\x3e\x3cli\x3e"+O.addFromFile.types.Shapefile+"\x3c/li\x3e\x3cli\x3e"+O.addFromFile.types.CSV+"\x3c/li\x3e\x3cli\x3e"+
O.addFromFile.types.KML+"\x3c/li\x3e\x3cli\x3e"+O.addFromFile.types.GPX+"\x3c/li\x3e\x3cli\x3e"+O.addFromFile.types.GeoJSON+'\x3c/li\x3e\x3cli\x3e\x3cspan class\x3d"note"\x3e'+O.addFromFile.maxFeaturesAllowedPattern.replace("{count}",this.maxRecordCount)+"\x3c/span\x3e\x3c/li\x3e\x3c/ul\x3e\x3c/div\x3e";this.wabWidget.isPortal&&(d='\x3cdiv class\x3d"intro"\x3e\x3clabel\x3e'+O.addFromFile.intro+"\x3c/label\x3e\x3cul\x3e\x3cli\x3e"+O.addFromFile.types.Shapefile+"\x3c/li\x3e\x3cli\x3e"+O.addFromFile.types.CSV+
"\x3c/li\x3e\x3cli\x3e"+O.addFromFile.types.KML+"\x3c/li\x3e\x3cli\x3e"+O.addFromFile.types.GeoJSON+'\x3c/li\x3e\x3cli\x3e\x3cspan class\x3d"note"\x3e'+O.addFromFile.maxFeaturesAllowedPattern.replace("{count}",this.maxRecordCount)+"\x3c/span\x3e\x3c/li\x3e\x3c/ul\x3e\x3c/div\x3e");new q({message:d})})))}},_addFeatures:function(r,t){var h,a=[],b=r.map,d=0,c=new S;t.layers&&(d=t.layers.length);E.forEach(t.layers,function(e){e=new f(e,{id:c._generateLayerId(),outFields:["*"]});e.xtnAddData=!0;e.graphics&&
(r.numFeatures+=e.graphics.length);0===d?e.name=r.baseFileName:"string"!==typeof e.name||0===e.name.length?e.name=r.baseFileName:0!==e.name.indexOf(r.baseFileName)&&(e.name=O.addFromFile.layerNamePattern.replace("{filename}",r.baseFileName).replace("{name}",e.name));c._setFeatureLayerInfoTemplate(e,null,null);if(e.fullExtent){var l=e.fullExtent.getCenter();l.x&&l.y&&(h=h?h.union(e.fullExtent):e.fullExtent)}a.push(e)});0<a.length&&(b.addLayers(a),h&&b.setExtent(h.expand(1.25),!0))},_analyze:function(r,
t){if("csv"!==r.fileType.toLowerCase())return t=new z,t.resolve(null),t;var h=null;this.wabWidget.batchGeocoderServers&&0<this.wabWidget.batchGeocoderServers.length&&(h=this.wabWidget.batchGeocoderServers[0]);var a={enableGlobalGeocoding:!0,sourceLocale:M.locale};h&&(a.geocodeServiceUrl=h.url,h.isWorldGeocodeServer&&(a.sourceCountry="world",a.sourceCountryHint=""));h=r.sharingUrl+"/content/features/analyze";a={f:"json",filetype:r.fileType.toLowerCase(),analyzeParameters:window.JSON.stringify(a)};
t=m({url:h,content:a,form:t,handleAs:"json"});t.then(function(b){b&&b.publishParameters&&(r.publishParameters=b.publishParameters)});return t},_createFileTypeImage:function(r){var t=window.isRTL;E.some(this.SHAPETYPE_ICONS,x.hitch(this,function(h,a){if(r.toLowerCase()===h.type.toLowerCase()){var b=document.createElement("IMG");b.src=this.wabWidget.folderUrl+h.url;b.alt=r;0===a?b.className+=" "+(t?"last":"first")+"-type-icon":1===a?b.className+=" second-"+(t?"last":"first")+"-type-icon":a===this.SHAPETYPE_ICONS.length-
2?b.className+=" second-"+(t?"first":"last")+"-type-icon":a===this.SHAPETYPE_ICONS.length-1&&(b.className+=" "+(t?"first":"last")+"-type-icon");this.supportedFileTypes.appendChild(b)}}))},_execute:function(r){var t={map:this.wabWidget.map,sharingUrl:this.wabWidget.getSharingUrl(),baseFileName:r.baseFileName,fileName:r.fileName,fileType:r.fileType,generalize:!!this.generalizeCheckBox.getValue(),publishParameters:{},numFeatures:0};this._setBusy(!0);this._setStatus(O.addFromFile.addingPattern.replace("{filename}",
r.fileName));if("kml"===r.fileType.toLowerCase())return this._executeKml(r);var h=r.fileName,a=this,b=new FormData;b.append("file",r.file);a._analyze(t,b).then(function(d){d&&d.publishParameters&&d.publishParameters.locationType&&"unknown"===d.publishParameters.locationType&&new q({titleLabel:O._widgetLabel,message:O.addFromFile.featureLocationsCouldNotBeFound});return a._generateFeatures(t,b)}).then(function(d){a._addFeatures(t,d.featureCollection);a._setBusy(!1);a._setStatus(O.addFromFile.featureCountPattern.replace("{filename}",
h).replace("{count}",t.numFeatures))}).otherwise(function(d){a._setBusy(!1);a._setStatus(O.addFromFile.addFailedPattern.replace("{filename}",h));console.warn("Error generating features.");console.warn(d);d&&"string"===typeof d.message&&0<d.message.length&&new q({titleLabel:O._widgetLabel,message:O.addFromFile.generalIssue+"\x3cbr\x3e\x3cbr\x3e"+d.message})})},_executeKml:function(r){var t=this,h=new FileReader,a=this.wabWidget.map,b=function(d,c){t._setBusy(!1);t._setStatus(O.addFromFile.addFailedPattern.replace("{filename}",
r.fileName));console.warn(d);console.error(c);c&&"string"===typeof c.message&&0<c.message.length&&new q({titleLabel:O._widgetLabel,message:O.addFromFile.generalIssue+"\x3cbr\x3e\x3cbr\x3e"+c.message})};h.onerror=function(d){b("FileReader::onerror",d)};h.onload=function(d){if(h.error)b("FileReader::error",h.error);else{var c=d.target.result,e=new S;d=e._generateLayerId();var l=new g("",{id:d,name:r.fileName,linkInfo:{visibility:!1}});l.visible=!0;delete l.linkInfo;l._parseKml=function(){var p=this;
this._fireUpdateStart();this._io=m({url:this.serviceUrl,content:{kmlString:encodeURIComponent(c),model:"simple",folders:"",refresh:this.loaded?!0:void 0,outSR:B.toJson(this._outSR.toJson())},callbackParamName:"callback",load:function(y){p._io=null;p._initLayer(y);e._waitForLayer(l).then(function(K){var P=0;K.name=r.fileName;K.xtnAddData=!0;E.forEach(K.getLayers(),function(k){k&&k.graphics&&0<k.graphics.length&&(P+=k.graphics.length)});var W=a.spatialReference,U=K._outSR;W&&U&&(W.equals(U)||W.isWebMercator()&&
4326===U.wkid||U.isWebMercator()&&4326===W.wkid)?a.addLayer(K):new q({titleLabel:O._widgetLabel,message:O.addFromFile.kmlProjectionMismatch});t._setBusy(!1);t._setStatus(O.addFromFile.featureCountPattern.replace("{filename}",r.fileName).replace("{count}",P))}).otherwise(function(K){b("kml-_waitForLayer.error",K)})},error:function(y){p._io=null;y=x.mixin(Error(),y);y.message="Unable to load KML: "+(y.message||"");p._fireUpdateEnd(y);p._errorHandler(y);b("Unable to load KML",y)}},{usePost:!0})};l._parseKml()}};
try{h.readAsText(r.file)}catch(d){b("FileReader::readAsText",d)}},_generateFeatures:function(r,t){var h=r.sharingUrl+"/content/features/generate";r.publishParameters=r.publishParameters||{};var a=x.mixin(r.publishParameters,{name:r.baseFileName,targetSR:r.map.spatialReference,maxRecordCount:this.maxRecordCount,enforceInputFileSizeLimit:!0,enforceOutputJsonSizeLimit:!0});if(r.generalize){var b=u.getExtentForScale(r.map,4E4).getWidth()/r.map.width;a.generalize=!0;a.maxAllowableOffset=b;b/=10;for(var d=
0;1>b;)b*=10,d++;a.reducePrecision=!0;a.numberOfDigitsAfterDecimal=d}r={f:"json",filetype:r.fileType.toLowerCase(),publishParameters:window.JSON.stringify(a)};return m({url:h,content:r,form:t,handleAs:"json"})},_getBaseFileName:function(r){D("ie")&&(r=r.split("\\"),r=r[r.length-1]);r=r.split(".");return r=r[0].replace("c:\\fakepath\\","")},_getBusy:function(){return n.contains(this.uploadLabel,"disabled")},_getFileInfo:function(r){var t={ok:!1,file:null,fileName:null,fileType:null};if((r=r?r.dataTransfer.files:
this.fileNode.files)&&1===r.length)if(t.file=r=r[0],t.fileName=r.name,G.endsWith(r.name,".zip"))t.ok=!0,t.fileType="Shapefile";else if(G.endsWith(r.name,".csv"))t.ok=!0,t.fileType="CSV";else if(G.endsWith(r.name,".kml"))t.ok=!0,t.fileType="KML";else if(G.endsWith(r.name,".gpx"))t.ok=!0,t.fileType="GPX";else if(G.endsWith(r.name,".geojson")||G.endsWith(r.name,".geo.json"))t.ok=!0,t.fileType="GeoJSON";t.ok&&(t.ok=E.some(this.SHAPETYPE_ICONS,function(a){return a.type.toLowerCase()===t.fileType.toLowerCase()}));
if(t.ok)t.baseFileName=this._getBaseFileName(t.fileName);else{r=O.addFromFile.invalidType;"string"===typeof t.fileName&&0<t.fileName.length&&(r=O.addFromFile.invalidTypePattern.replace("{filename}",t.fileName));this._setBusy(!1);this._setStatus(r);var h=document.createElement("div");h.appendChild(document.createTextNode(r));new q({titleLabel:O._widgetLabel,message:h})}return t},resize:function(){},_setBusy:function(r){r?(n.add(this.uploadLabel,"disabled"),n.add(this.dropArea,["hit","disabled"])):
(n.remove(this.uploadLabel,"disabled"),n.remove(this.dropArea,["hit","disabled"]))},_setStatus:function(r){this.wabWidget&&this.wabWidget._setStatus(r)}})})},"widgets/AddData/search/LayerListPane":function(){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(H,x,E,B,A,z,n,v,D,w,J){return H([z,n,v],{i18n:w,
templateString:D,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(F,L){var O=this,S=this._getLayerTitle(L),G=A.create("div",{"class":"add-data-layerlist--listitem"},F);A.create("A",{"class":"remove-button",href:"#",innerHTML:"\x3cspan class\x3d'esri-icon-trash'\x3e\x3c/span\x3e",title:w.layerList.removeLayer,onclick:function(M){M.preventDefault();
try{O.wabWidget&&O.wabWidget.map&&(O.wabWidget.map.removeLayer(L),A.destroy(G))}catch(m){console.warn("Error removing layer."),console.warn(m)}}},G);F=A.create("label",{"class":"layer-name"},G);J.setNodeText(F,S)},_buildList:function(){var F=this,L=!1,O=[],S=this.wabWidget.map,G=A.create("div",{"class":"add-data-layerlist--list"});x.forEach(S.layerIds,function(M){O.push(M)});x.forEach(S.graphicsLayerIds,function(M){O.push(M)});O.reverse();x.forEach(O,function(M){(M=S.getLayer(M))&&M.xtnAddData&&(L=
!0,F._addLayer(G,M))});return L?G:A.create("div",{"class":"no-data-message",innerHTML:w.layerList.noLayersAdded})},_getLayerTitle:function(F){var L="...";if("string"===typeof F.label&&0<F.label.length)L=F.label;else if("string"===typeof F.title&&0<F.title.length)L=F.title;else if("string"===typeof F.name&&0<F.name.length)L=F.name;else if(F.url){var O=F.url.indexOf("/FeatureServer");-1===O&&(O=F.url.indexOf("/MapServer"));-1===O&&(O=F.url.indexOf("/ImageServer"));-1===O&&(O=F.url.indexOf("/service"));
-1<O&&(F=F.url.substring(0,O),L=F=F.substring(F.lastIndexOf("/")+1,F.length))}return L},_initListeners:function(){var F=this;this.own(E(this._backButton,"click",function(L){L.preventDefault();F.hide()}))},show:function(){var F=this._buildList();this._title.innerHTML=w.layerList.caption;this._layerlist.innerHTML="";F&&F.tagName&&this._layerlist.appendChild(F);this.wabWidget&&this.wabWidget.domNode&&B.add(this.wabWidget.domNode,"layerlist-show");B.add(this.domNode,"show")},hide:function(){this.wabWidget&&
this.wabWidget.domNode&&B.remove(this.wabWidget.domNode,"layerlist-show");B.remove(this.domNode,"show")}})})},"widgets/AddData/_build-generate_module":function(){define(["dojo/text!./Widget.html","dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"url:widgets/AddData/search/templates/SearchPane.html":'\x3cdiv class\x3d"search-pane"\x3e\r\n  \x3cdiv class\x3d"search-pane-header" data-dojo-attach-point\x3d"headerNode"\x3e\r\n    \x3cdiv class\x3d"search-bar main-search-bar"\x3e\r\n      \x3cdiv data-dojo-type\x3d"widgets/AddData/search/ScopeOptions"\r\n        data-dojo-attach-point\x3d"scopeOptions"\x3e\r\n      \x3c/div\x3e\r\n      \x3c!--\x3cspan class\x3d"search-box-placeholder" data-dojo-attach-point\x3d"searchBoxPlaceholder"\x3e\x3c/span\x3e--\x3e\r\n      \x3cdiv data-dojo-type\x3d"widgets/AddData/search/SearchBox"\r\n        data-dojo-attach-point\x3d"searchBox"\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"search-bar-separator"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"search-bar search-bar-secondary" data-dojo-attach-point\x3d"optionsNode"\x3e\r\n      \x3cdiv data-dojo-type\x3d"widgets/AddData/search/BBoxOption"\r\n        data-dojo-attach-point\x3d"bboxOption"\x3e\r\n      \x3c/div\x3e\r\n      \x3c!--\r\n      \x3cdiv class\x3d"filter-wrapper2"\x3e\r\n        \x3cdiv data-dojo-type\x3d"widgets/AddData/search/TypeOptions"\r\n          data-dojo-attach-point\x3d"typeOptions"\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-dojo-type\x3d"widgets/AddData/search/SortOptions"\r\n          data-dojo-attach-point\x3d"sortOptions"\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n      --\x3e\r\n      \x3cspan class\x3d"filter-placeholder" data-dojo-attach-point\x3d"filterPlaceholder"\x3e\x3c/span\x3e\r\n      \x3cdiv class\x3d"filter-wrapper" data-dojo-attach-point\x3d"filterWrapper"\x3e\r\n        \x3cdiv data-dojo-type\x3d"widgets/AddData/search/TypeOptions"\r\n          data-dojo-attach-point\x3d"typeOptions"\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-dojo-type\x3d"widgets/AddData/search/SortOptions"\r\n          data-dojo-attach-point\x3d"sortOptions"\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"search-pane-content" data-dojo-attach-point\x3d"contentNode"\x3e\r\n    \x3cdiv data-dojo-type\x3d"widgets/AddData/search/ResultsPane"\r\n      data-dojo-attach-point\x3d"resultsPane"\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"search-pane-footer jimu-float-leading" data-dojo-attach-point\x3d"footerNode"\x3e\r\n    \x3cdiv data-dojo-type\x3d"widgets/AddData/search/Paging"\r\n      data-dojo-attach-point\x3d"paging"\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv data-dojo-type\x3d"widgets/AddData/search/ResultCount"\r\n      data-dojo-attach-point\x3d"resultCount"\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv style\x3d"clear:both"\x3e\x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/AddData/search/templates/SearchBox.html":'\x3cdiv class\x3d"search-box2"\x3e\r\n\t\x3cinput type\x3d"text" class\x3d"search-textbox"\r\n\t\tplaceholder\x3d"${i18n.search.searchBox.placeholder}"\r\n\t\tdata-dojo-attach-point\x3d"searchTextBox"\r\n\t\x3e\x3cbutton class\x3d"btn btn-confirm" type\x3d"button"\r\n\t\tdata-dojo-attach-point\x3d"searchButton"\r\n\t\tdata-dojo-attach-event\x3d"onClick: searchButtonClicked"\r\n\t\ttitle\x3d"${i18n.search.searchBox.search}"\r\n\t\t\x3e\x3cspan class\x3d"esri-icon-search"\x3e\x3c/span\x3e\r\n\t\x3c/button\x3e\r\n\x3c!--\r\n\x3cdiv class\x3d"search-box"\x3e\r\n\t\x3cdiv class\x3d"input-group"\x3e\r\n\t\t\x3cinput type\x3d"text" class\x3d"search-textbox"\r\n\t\t\tplaceholder\x3d"${i18n.search.searchBox.placeholder}"\r\n\t\t\tdata-dojo-attach-point\x3d"searchTextBox"\x3e\r\n    \x3cspan class\x3d"search-btn"\x3e\r\n\t\t\t\x3cbutton class\x3d"btn btn-clear hidden" type\x3d"button"\r\n\t\t\t\tdata-dojo-attach-point\x3d"clearButton"\r\n\t\t\t\tdata-dojo-attach-event\x3d"onClick: clearButtonClicked"\x3e\r\n\t\t\t\t\x3cspan class\x3d"esri-icon-close"\x3e\x3c/span\x3e\r\n\t\t\t\x3c/button\x3e\r\n\t\t\t\x3cbutton class\x3d"btn btn-confirm" type\x3d"button"\r\n\t\t\t\tdata-dojo-attach-point\x3d"searchButton"\r\n\t\t\t\tdata-dojo-attach-event\x3d"onClick: searchButtonClicked"\r\n\t\t\t\ttitle\x3d"${i18n.search.searchBox.search}"\r\n\t\t\t\t\x3e\x3cspan class\x3d"esri-icon-search"\x3e\x3c/span\x3e\r\n\t\t\t\x3c/button\x3e\r\n\t\t\x3c/span\x3e\r\n\t\x3c/div\x3e\r\n\x3c/div\x3e\r\n--\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/AddData/search/templates/BBoxOption.html":'\x3cdiv class\x3d"search-bbox-option"\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"bboxSection" class\x3d"switch-toggle-group"\x3e\r\n    \x3clabel class\x3d"checkbox-inline"\x3e\r\n      \x3cinput id\x3d"${id}_bboxId"\r\n\t      data-dojo-type\x3d"dijit/form/CheckBox"\r\n\t      data-dojo-attach-point\x3d"bboxToggle"\r\n\t      data-dojo-attach-event\x3d"onClick: bboxClicked"\r\n\t      data-dojo-props\x3d"class: \'switch-toggle\'"\r\n        title\x3d"${i18n.search.bboxOption.bbox}"/\x3e\r\n      \x3cspan class\x3d"label-text"\x3e${i18n.search.bboxOption.bbox}\x3c/span\x3e\r\n    \x3c/label\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/AddData/search/templates/ScopeOptions.html":'\x3cdiv class\x3d"search-scope-options"\x3e\r\n  \x3ca href\x3d"#" class\x3d"scope-placeholder"\r\n    data-dojo-attach-point\x3d"scopePlaceholder"\r\n    data-dojo-attach-event\x3d"onClick: scopePlaceholderClicked"\x3e\r\n    \x3cspan data-dojo-attach-point\x3d"scopePlaceholderText"\x3e\x3c/span\x3e\r\n    \x3cspan class\x3d"dropdown-arrow"\x3e\x3c/span\x3e\r\n  \x3c/a\x3e\r\n  \x3cdiv class\x3d"btn-group" data-dojo-attach-point\x3d"btnGroup"\x3e\r\n    \x3cbutton type\x3d"button" class\x3d"btn btn-sm btn-default" name\x3d"${id}_scope"\r\n      data-dojo-attach-point\x3d"MyContentToggle"\r\n      data-dojo-attach-event\x3d"onClick: optionClicked"\r\n      data-option-name\x3d"MyContent"\x3e\r\n      ${i18n.search.scopeOptions.myContent}\r\n    \x3c/button\x3e\r\n    \x3cbutton type\x3d"button" class\x3d"btn btn-sm btn-default" name\x3d"${id}_scope"\r\n      data-dojo-attach-point\x3d"MyOrganizationToggle"\r\n      data-dojo-attach-event\x3d"onClick: optionClicked"\r\n      data-option-name\x3d"MyOrganization"\x3e\r\n      ${i18n.search.scopeOptions.myOrganization}\r\n    \x3c/button\x3e\r\n    \x3cbutton type\x3d"button" class\x3d"btn btn-sm btn-default" name\x3d"${id}_scope"\r\n      data-dojo-attach-point\x3d"CuratedToggle"\r\n      data-dojo-attach-event\x3d"onClick: optionClicked"\r\n      data-option-name\x3d"Curated"\x3e\r\n      ${i18n.search.scopeOptions.curated}\r\n    \x3c/button\x3e\r\n    \x3cbutton type\x3d"button" class\x3d"btn btn-sm btn-default" name\x3d"${id}_scope"\r\n      data-dojo-attach-point\x3d"ArcGISOnlineToggle"\r\n      data-dojo-attach-event\x3d"onClick: optionClicked"\r\n      data-option-name\x3d"ArcGISOnline"\x3e\r\n      ${i18n.search.scopeOptions.ArcGISOnline}\r\n    \x3c/button\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/AddData/search/templates/TypeOptions.html":'\x3cdiv class\x3d"search-data-type-options"\x3e\r\n  \x3cdiv data-dojo-type\x3d"dijit/form/DropDownButton"\x3e\r\n    \x3cspan\x3e${i18n.search.typeOptions.prompt}\x3c/span\x3e\r\n    \x3cdiv data-dojo-type\x3d"dijit/TooltipDialog"\r\n         data-dojo-attach-point\x3d"tooltipDialog"\r\n         data-dojo-props\x3d"\'class\':\'add-data-widget-popup\'"\x3e\r\n      \x3clabel for\x3d"${id}_mapServiceId" class\x3d"search-type-option"\x3e\r\n        \x3cdiv id\x3d"${id}_mapServiceId"\r\n          data-dojo-type\x3d"jimu/dijit/CheckBox"\r\n          data-dojo-attach-point\x3d"mapServiceToggle"\r\n          data-dojo-attach-event\x3d"onClick: optionClicked"\r\n          data-option-q\x3d\'type:\x26quot;Map Service\x26quot;\'\x3e\x3c/div\x3e\r\n        ${i18n.search.typeOptions.mapService}\r\n      \x3c/label\x3e\r\n      \x3clabel for\x3d"${id}_featureServiceId" class\x3d"search-type-option"\x3e\r\n        \x3cdiv id\x3d"${id}_featureServiceId"\r\n          data-dojo-type\x3d"jimu/dijit/CheckBox"\r\n          data-dojo-attach-point\x3d"featureServiceToggle"\r\n          data-dojo-attach-event\x3d"onClick: optionClicked"\r\n          data-option-q\x3d\'type:\x26quot;Feature Service\x26quot;\'\x3e\x3c/div\x3e\r\n        ${i18n.search.typeOptions.featureService}\r\n      \x3c/label\x3e\r\n      \x3clabel for\x3d"${id}_imageServiceId" class\x3d"search-type-option"\x3e\r\n        \x3cdiv id\x3d"${id}_imageServiceId"\r\n          data-dojo-type\x3d"jimu/dijit/CheckBox"\r\n          data-dojo-attach-point\x3d"imageServiceToggle"\r\n          data-dojo-attach-event\x3d"onClick: optionClicked"\r\n          data-option-q\x3d\'type:\x26quot;Image Service\x26quot;\'\x3e\x3c/div\x3e\r\n        ${i18n.search.typeOptions.imageService}\r\n      \x3c/label\x3e\r\n      \x3clabel for\x3d"${id}_vectorTileServiceId" class\x3d"search-type-option"\r\n        data-dojo-attach-point\x3d"vectorTileNode"\x3e\r\n        \x3cdiv id\x3d"${id}_vectorTileServiceId"\r\n          data-dojo-type\x3d"jimu/dijit/CheckBox"\r\n          data-dojo-attach-point\x3d"vectorTileServiceToggle"\r\n          data-dojo-attach-event\x3d"onClick: optionClicked"\r\n          data-option-q\x3d\'type:\x26quot;Vector Tile Service\x26quot;\'\x3e\x3c/div\x3e\r\n        ${i18n.search.typeOptions.vectorTileService}\r\n      \x3c/label\x3e\r\n      \x3clabel for\x3d"${id}_kmlId" class\x3d"search-type-option"\x3e\r\n        \x3cdiv id\x3d"${id}_kmlId"\r\n          data-dojo-type\x3d"jimu/dijit/CheckBox"\r\n          data-dojo-attach-point\x3d"kmlToggle"\r\n          data-dojo-attach-event\x3d"onClick: optionClicked"\r\n          data-option-q\x3d\'type:\x26quot;KML\x26quot;\'\x3e\x3c/div\x3e\r\n        ${i18n.search.typeOptions.kml}\r\n      \x3c/label\x3e\r\n      \x3clabel for\x3d"${id}_wmsId" class\x3d"search-type-option"\x3e\r\n        \x3cdiv id\x3d"${id}_wmsId"\r\n          data-dojo-type\x3d"jimu/dijit/CheckBox"\r\n          data-dojo-attach-point\x3d"wmsToggle"\r\n          data-dojo-attach-event\x3d"onClick: optionClicked"\r\n          data-option-q\x3d\'type:\x26quot;WMS\x26quot;\'\x3e\x3c/div\x3e\r\n        ${i18n.search.typeOptions.wms}\r\n      \x3c/label\x3e\r\n      \x3clabel for\x3d"${id}_wfsId" class\x3d"search-type-option"\x3e\r\n        \x3cdiv id\x3d"${id}_wfsId"\r\n          data-dojo-type\x3d"jimu/dijit/CheckBox"\r\n          data-dojo-attach-point\x3d"wfsToggle"\r\n          data-dojo-attach-event\x3d"onClick: optionClicked"\r\n          data-option-q\x3d\'type:\x26quot;WFS\x26quot;\'\x3e\x3c/div\x3e\r\n        WFS\r\n      \x3c/label\x3e\r\n      \x3clabel for\x3d"${id}_wmtsId" class\x3d"search-type-option"\x3e\r\n        \x3cdiv id\x3d"${id}_wmtsId"\r\n          data-dojo-type\x3d"jimu/dijit/CheckBox"\r\n          data-dojo-attach-point\x3d"wmtsToggle"\r\n          data-dojo-attach-event\x3d"onClick: optionClicked"\r\n          data-option-q\x3d\'type:\x26quot;WMTS\x26quot;\'\x3e\x3c/div\x3e\r\n        WMTS\r\n      \x3c/label\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/AddData/search/templates/SortOptions.html":'\x3cdiv class\x3d"search-sort-options"\x3e\r\n  \x3clabel for\x3d"${id}_select" class\x3d"sort-prompt"\x3e${i18n.search.sortOptions.prompt}\x3c/label\x3e \r\n  \x3cselect id\x3d"${id}_select"\r\n    data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"sortSelect"\x3e\r\n    \x3coption value\x3d"" selected\x3d"selected"\x3e${i18n.search.sortOptions.relevance}\x3c/option\x3e\r\n    \x3coption value\x3d"title"\x3e${i18n.search.sortOptions.title}\x3c/option\x3e\r\n    \x3coption value\x3d"owner"\x3e${i18n.search.sortOptions.owner}\x3c/option\x3e\r\n    \x3coption value\x3d"avgrating"\x3e${i18n.search.sortOptions.rating}\x3c/option\x3e\r\n    \x3coption value\x3d"numviews"\x3e${i18n.search.sortOptions.views}\x3c/option\x3e\r\n    \x3coption value\x3d"modified"\x3e${i18n.search.sortOptions.date}\x3c/option\x3e\r\n  \x3c/select\x3e\r\n  \x3ca href\x3d"#" class\x3d"sort-order-icon"\r\n    title\x3d"${i18n.search.sortOptions.switchOrder}"\r\n    data-dojo-attach-point\x3d"sortOrderBtn"\r\n    data-dojo-attach-event\x3d"onclick: sortOrderClicked"\x3e\r\n  \x3c/a\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/AddData/search/templates/ResultsPane.html":'\x3cdiv class\x3d"search-results-pane" data-dojo-attach-point\x3d"containerNode"\x3e\r\n  \x3cdiv class\x3d"search-results-pane-no-match empty-data-label" data-dojo-attach-point\x3d"noMatchNode" style\x3d"display:none;"\x3e\x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"itemsNode" class\x3d"search-results"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',"url:widgets/AddData/search/templates/ItemCard.html":'\x3cdiv class\x3d"item-card"\x3e\r\n  \x3cdiv class\x3d"item-card-inner"\x3e\r\n    \x3cdiv class\x3d"thumbnail" data-dojo-attach-point\x3d"thumbnailNode"\x3e\x3c/div\x3e\r\n    \x3ch3 class\x3d"title" data-dojo-attach-point\x3d"titleNode"\x3e\x3c/h3\x3e\r\n    \x3cdiv class\x3d"info" data-dojo-attach-point\x3d"typeByOwnerNode"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"info" data-dojo-attach-point\x3d"dateNode"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"action-bar"\x3e\r\n      \x3cspan class\x3d"message" data-dojo-attach-point\x3d"messageNode"\x3e\x3c/span\x3e\r\n      \x3ca href\x3d"javascript:void(0)"\r\n        data-dojo-attach-point\x3d"addButton"\r\n        data-dojo-attach-event\x3d"onClick: addClicked"\r\n        \x3e${i18n.search.item.actions.add}\r\n      \x3c/a\x3e\r\n      \x3ca href\x3d"javascript:void(0)"\r\n        data-dojo-attach-point\x3d"detailsButton"\r\n        data-dojo-attach-event\x3d"onClick: detailsClicked"\r\n        \x3e${i18n.search.item.actions.details}\r\n      \x3c/a\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/AddData/search/templates/Paging.html":'\x3cdiv class\x3d"search-paging"\x3e\r\n\t\x3cul class\x3d"pagination pagination-sm"\x3e\r\n\t\t\x3cli\x3e\r\n\t\t\t\x3ca href\x3d"#" aria-label\x3d"First"\r\n\t\t\t\tdata-dojo-attach-point\x3d"firstButton"\r\n\t\t\t\tdata-dojo-attach-event\x3d"onClick: firstButtonClicked"\r\n\t\t\t\ttitle\x3d"${i18n.search.paging.firstTip}"\x3e\r\n\t\t\t\t\x3cspan aria-hidden\x3d"true" class\x3d"esri-icon-expand"\x3e\x3c/span\x3e\r\n\t\t\t\x3c/a\x3e\r\n\t\t\x3c/li\x3e\r\n\t\t\x3cli\x3e\r\n\t\t\t\x3ca href\x3d"#" aria-label\x3d"Previous"\r\n\t\t\t\tdata-dojo-attach-point\x3d"previousButton"\r\n\t\t\t\tdata-dojo-attach-event\x3d"onClick: previousButtonClicked"\r\n\t\t\t\ttitle\x3d"${i18n.search.paging.previousTip}"\x3e\r\n\t\t\t\t\x3cspan aria-hidden\x3d"true" class\x3d"esri-icon-left"\x3e\x3c/span\x3e\r\n\t\t\t\x3c/a\x3e\r\n\t\t\x3c/li\x3e\r\n\t\t\x3cli class\x3d"current-page"\x3e\r\n\t\t  \x3cspan data-dojo-attach-point\x3d"pageNode"\x3e\x3c/span\x3e\r\n\t\t\x3c/li\x3e\r\n\t\t\x3cli\x3e\r\n\t\t\t\x3ca href\x3d"#" aria-label\x3d"Next"\r\n\t\t\t\tdata-dojo-attach-point\x3d"nextButton"\r\n\t\t\t\tdata-dojo-attach-event\x3d"onClick: nextButtonClicked"\r\n\t\t\t\ttitle\x3d"${i18n.search.paging.nextTip}"\x3e\r\n\t\t\t\t\x3cspan aria-hidden\x3d"true" class\x3d"esri-icon-right"\x3e\x3c/span\x3e\r\n\t\t\t\x3c/a\x3e\r\n\t\t\x3c/li\x3e\r\n\t\x3c/ul\x3e\r\n\x3c/div\x3e',
"url:widgets/AddData/search/templates/ResultCount.html":'\x3cdiv class\x3d"search-result-count"\x3e\r\n  \x3cspan class\x3d"search-count" data-dojo-attach-point\x3d"messageNode"\x3e\x3c/span\x3e\r\n\x3c/div\x3e',"url:widgets/AddData/search/templates/AddFromUrlPane.html":'\x3cdiv class\x3d"secondary-pane add-url-pane"\x3e\r\n  \x3cdiv class\x3d"add-url-pane-container"\x3e\r\n    \x3cdiv class\x3d"add-url-pane-container--inner"\x3e\r\n      \x3clabel for\x3d"${id}_select"\x3e${i18n.addFromUrl.type}\x3c/label\x3e\r\n      \x3cselect id\x3d"${id}_select"\r\n        data-dojo-type\x3d"dijit/form/Select" data-dojo-attach-point\x3d"typeSelect"\x3e\r\n        \x3coption value\x3d"ArcGIS" selected\x3d"selected"\x3e${i18n.addFromUrl.types.ArcGIS}\x3c/option\x3e\r\n        \x3coption value\x3d"WMS"\x3e${i18n.addFromUrl.types.WMS}\x3c/option\x3e\r\n        \x3coption value\x3d"WMTS"\x3e${i18n.addFromUrl.types.WMTS}\x3c/option\x3e\r\n        \x3coption value\x3d"WFS"\x3e${i18n.addFromUrl.types.WFS}\x3c/option\x3e\r\n        \x3coption value\x3d"KML"\x3e${i18n.addFromUrl.types.KML}\x3c/option\x3e\r\n        \x3coption value\x3d"GeoRSS"\x3e${i18n.addFromUrl.types.GeoRSS}\x3c/option\x3e\r\n        \x3coption value\x3d"CSV"\x3e${i18n.addFromUrl.types.CSV}\x3c/option\x3e\r\n      \x3c/select\x3e\r\n      \x3clabel for\x3d"${id}_url"\x3e${i18n.addFromUrl.url}\x3c/label\x3e\r\n      \x3cinput id\x3d"${id}_url" type\x3d"text" class\x3d"url-textbox jimu-input"\r\n          data-dojo-attach-point\x3d"urlTextBox"\r\n          data-dojo-type\x3d"dijit/form/ValidationTextBox"\r\n          data-dojo-props\x3d"\r\n            regExp: \'^(http|https):\\/\\/[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?$\'\r\n          "/\x3e\r\n      \x3cdiv class\x3d"action-bar"\x3e\r\n        \x3ca class\x3d"jimu-float-leading" href\x3d"javascript:void(0)"\r\n          data-dojo-attach-point\x3d"examplesExpander"\r\n          data-dojo-attach-event\x3d"onClick: examplesExpanderClicked"\r\n          \x3e${i18n.addFromUrl.samplesHint}\x3c/a\x3e\r\n        \x3ca class\x3d"jimu-btn"\r\n          href\x3d"javascript:void(0)"\r\n          data-dojo-attach-point\x3d"addButton"\r\n          data-dojo-attach-event\x3d"onClick: addClicked"\r\n          \x3e${i18n.search.item.actions.add}\r\n        \x3c/a\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"examples" data-dojo-attach-point\x3d"examplesNode"\x3e\r\n        \x3cdiv data-examples-type\x3d"ArcGIS"\x3e\r\n          \x3cdiv\x3ehttp://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/World_Cities/FeatureServer/0\x3c/div\x3e\r\n          \x3cdiv\x3ehttp://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Tapestry/MapServer\x3c/div\x3e\r\n          \x3cdiv\x3ehttp://imagery.arcgisonline.com/ArcGIS/rest/services/LandsatGLS/VegetationAnalysis/ImageServer\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-examples-type\x3d"WMS"\x3e\r\n          \x3cdiv\x3ehttp://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?service\x3dWMS\x26amp;request\x3dGetCapabilities\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-examples-type\x3d"WMTS"\x3e\r\n          \x3cdiv\x3ehttps://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-examples-type\x3d"WFS"\x3e\r\n          \x3cdiv\x3ehttps://dservices.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/services/JapanPrefectures2018/WFSServer\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-examples-type\x3d"KML"\x3e\r\n          \x3cdiv\x3ehttp://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_month_age_animated.kml\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-examples-type\x3d"GeoRSS"\x3e\r\n          \x3cdiv\x3ehttp://www.gdacs.org/xml/rss.xml\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-examples-type\x3d"CSV"\x3e\r\n          \x3cdiv\x3ehttp://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv\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\x3c/div\x3e\r\n',
"url:widgets/AddData/search/templates/AddFromFilePane.html":'\x3cdiv class\x3d"secondary-pane add-file-pane"\x3e\r\n\r\n  \x3cdiv class\x3d"generalize-options"\x3e\r\n    \x3cdiv data-dojo-type\x3d"jimu/dijit/CheckBox"\r\n      data-dojo-attach-point\x3d"generalizeCheckBox"\r\n      data-dojo-props\x3d"checked:true"\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\r\n  \x3cdiv class\x3d"browse-or-drop"\x3e\r\n    \x3cdiv class\x3d"drop-container" data-dojo-attach-point\x3d"dropContainer"\x3e\r\n      \x3cdiv class\x3d"drop-area" data-dojo-attach-point\x3d"dropArea"\x3e\r\n        \x3cdiv class\x3d"supported-file-types" data-dojo-attach-point\x3d"supportedFileTypes"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"or"\x3e${i18n.addFromFile.dropOrBrowse}\x3c/div\x3e\r\n        \x3cform class\x3d"file-form" enctype\x3d"multipart/form-data" method\x3d"post"\r\n          data-dojo-attach-point\x3d"fileForm"\x3e\r\n          \x3clabel for\x3d"${id}_file" class\x3d"jimu-btn"\r\n            data-dojo-attach-point\x3d"uploadLabel"\x3e${i18n.addFromFile.browse}\x3c/label\x3e\r\n          \x3cinput id\x3d"${id}_file" name\x3d"file" type\x3d"file" style\x3d"display:none"\r\n            data-dojo-attach-point\x3d"fileNode" /\x3e\r\n        \x3c/form\x3e\r\n        \x3ca href\x3d"#" class\x3d"drop-area-hint" data-dojo-attach-point\x3d"hintButton"\x3e\r\n          \x3ci class\x3d"esri-icon-question"\x3e\x3c/i\x3e\r\n        \x3c/a\x3e\r\n        \x3cspan class\x3d"upload-arrow"\x3e\x3c/span\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\r\n\x3c/div\x3e\r\n',
"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',
"url:widgets/AddData/Widget.html":'\x3cdiv\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"tabsNode"\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"searchNode"\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"urlNode"\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"fileNode"\x3e\x3c/div\x3e\r\n\x3c/div\x3e\r\n',"url:widgets/AddData/css/style.css":'.jimu-widget-add-data .jimu-tab3 {height: 100%;}.jimu-widget-add-data .search-pane,.jimu-widget-add-data .secondary-pane {height: 100%; width: 100%; background-color: #f8f8f8; position: relative;}.jimu-widget-add-data .search-pane \x3e *,.jimu-widget-add-data .secondary-pane \x3e * {width: 100%;}.jimu-widget-add-data .search-pane-content {position: absolute; top: 140px; bottom: 0; overflow: auto; background-color: #efefef;}.jimu-widget-add-data .search-pane .search-bar {padding: 10px 15px; line-height: 20px;}.jimu-widget-add-data .search-pane .search-bar .btn-group \x3e .btn {min-width: 40px; padding-top: 10px; padding-bottom: 13px; background-color: transparent; border: 0; border-bottom: 2px solid transparent; margin-left: 5px; margin-right: 5px; color: #898989; font-size: 12px; font-weight: bold; font-family: inherit;}.jimu-widget-add-data .search-pane .search-bar .btn-group \x3e .btn.active,.jimu-widget-add-data .search-pane .search-bar .btn-group \x3e .btn.active:active,.jimu-widget-add-data .search-pane .search-bar .btn-group \x3e .btn.active:hover {background-color: transparent !important; color: #000 !important; border-bottom-color: #24b5cc; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;}.jimu-widget-add-data .search-pane .search-bar.main-search-bar {background-color: #fff; padding-bottom: 0; position: relative; display: flex;}.jimu-widget-add-data .search-pane .search-scope-options {flex: 1; overflow: hidden;}.jimu-widget-add-data .search-pane .search-bar.search-scope-bar .search-sort-options {margin-top: 5px;}.jimu-widget-add-data .search-pane .search-bar-secondary {background-color: #f8f8f8; padding-top: 5px; padding-bottom: 5px; font-size: 11px;}.jimu-widget-add-data .search-pane .search-pane-header {border-bottom: 1px solid #cccccc;}.jimu-widget-add-data .search-pane .search-pane-header:before,.jimu-widget-add-data .search-pane .search-pane-header:after {content: " "; display: table;}.jimu-widget-add-data .search-pane .search-pane-header:after {clear: both;}.jimu-widget-add-data .search-pane .search-bar:before,.jimu-widget-add-data .search-pane .search-bar:after {content: " "; display: table;}.jimu-widget-add-data .search-pane .search-bar:after {clear: both;}.jimu-widget-add-data .search-pane .search-data-type-options {margin-right: 15px;}.jimu-widget-add-data .search-pane .search-curated-option {display: inline-block; margin-left: 30px;}.jimu-widget-add-data .search-pane .search-bar-separator {border-bottom: 1px solid #e7e7e7;}.jimu-widget-add-data .search-pane .search-pane-default .search-bar {text-align: right; margin-bottom: 24px;}.jimu-widget-add-data .search-pane .search-results-pane {padding: 10px 5px;}.jimu-widget-add-data .search-pane .search-results-pane:after {content: ""; display: table; clear: both;}.jimu-widget-add-data .search-pane .item-card {float: left; width: 100%; padding-left: 5px; padding-right: 5px; -webkit-transition: width 0.1s ease; -moz-transition: width 0.1s ease; -o-transition: width 0.1s ease; transition: width 0.1s ease;}.jimu-widget-add-data .search-pane .item-card .item-card-inner {height: 70px; background: #ffffff; border: 1px solid #e0e0e0; border-bottom-color: #cccccc; padding: 5px; margin-bottom: 10px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}.jimu-widget-add-data .search-pane .item-card .thumbnail {float: left; margin-right: 10px;}.jimu-widget-add-data .search-pane .item-card .thumbnail img {height: 60px; width: 90px;}.jimu-widget-add-data .search-pane .item-card h3.title {margin: 0 5px; padding: 0; font-size: 12px; font-weight: bold; color: #4c4c4c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}.jimu-widget-add-data .search-pane .item-card div.info {color: #898989; font-size: 10px; overflow: hidden; white-space: nowrap; padding-top: 3px;}.jimu-widget-add-data .search-pane .item-card .action-bar,.jimu-widget-add-data .secondary-pane .action-bar {text-align: right;}.jimu-rtl .jimu-widget-add-data .search-pane .item-card .action-bar,.jimu-rtl .jimu-widget-add-data .secondary-pane .action-bar {text-align: left;}.jimu-widget-add-data .secondary-pane {padding: 20px 15px; overflow: auto;}.jimu-widget-add-data .secondary-pane label {color: #898989; display: block; margin-bottom: 10px;}.jimu-widget-add-data .secondary-pane .dijit {margin-bottom: 10px;}.jimu-widget-add-data .secondary-pane div.action-bar {margin-top: 20px;}.jimu-widget-add-data .secondary-pane .jimu-btn {color: #fff; line-height: 20px; text-decoration: none;}.jimu-widget-add-data .secondary-pane .jimu-btn:active {}.jimu-widget-add-data .search-pane .item-card .action-bar a,.jimu-widget-add-data .add-url-pane .action-bar a,.jimu-widget-add-data .add-file-pane .file-form label {display: inline-block; font-size: 11px; text-transform: uppercase; padding: 5px; margin-right: 5px;}.jimu-widget-add-data .search-pane .item-card .action-bar a.disabled,.jimu-widget-add-data .add-url-pane .action-bar a.disabled,.jimu-widget-add-data .add-file-pane .file-form label.disabled,.jimu-widget-add-data .add-file-pane .drop-area.disabled {opacity: 0.3;}.jimu-widget-add-data .search-pane .item-card .action-bar .message {font-size: 10px; font-style: italic; margin-left: 4px; margin-right: 4px;}.jimu-widget-add-data .add-url-pane .action-bar .jimu-btn,.jimu-widget-add-data .add-file-pane .file-form label {margin-right: 0; min-width: 180px; white-space: normal;}.jimu-widget-add-data .add-url-pane {padding: 0;}.jimu-widget-add-data .add-url-pane-container {background-color: #fff; border-bottom: 1px solid #ccc; padding: 15px 15px 35px;}.jimu-widget-add-data .add-url-pane-container--inner {max-width: 960px; margin: 0 auto;}.jimu-widget-add-data .add-file-pane .intro ul {font-size: 10px; margin: 0; padding: 2px 0 2px 20px;}.jimu-widget-add-data .add-file-pane .intro ul .note {font-style: italic;}.jimu-rtl .jimu-widget-add-data .add-file-pane .intro ul {padding: 2px 20px 2px 0;}.jimu-widget-add-data .add-file-pane .generalize-options .jimu-checkbox .checkbox {margin-top: 0; vertical-align: middle;}.jimu-widget-add-data .add-file-pane .generalize-options .jimu-checkbox .label {font-size: 12px; vertical-align: middle; cursor: pointer;}.jimu-widget-add-data .add-file-pane .browse-or-drop {}.jimu-widget-add-data .add-file-pane .or {display: block; margin: 20px auto; font-size: 11px; color: #898989; width: 90%; max-width: 400px; line-height: 20px; position: relative;}.jimu-widget-add-data .add-file-pane .or:before,.jimu-widget-add-data .add-file-pane .or:after {content: ""; display: block; height: 1px; width: 35%; background: #eee; position: absolute; top: 9px; left: 0;}.jimu-widget-add-data .add-file-pane .or:after {right: 0; left: auto;}.jimu-widget-add-data .add-file-pane .or b {display: inline-block; padding-right: 5px;}.jimu-widget-add-data .add-file-pane .drop-area {width: 100%; background: #fff; margin: 10px auto 0; padding: 25px 50px 35px; border: 1px dashed #ccc; color: #898989; font-size: 12px; text-align: center; line-height: 1.75; text-transform: uppercase; position: relative; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; -webkit-transition: opacity ease-in-out 0.15s; -moz-transition: opacity ease-in-out 0.15s; -o-transition: opacity ease-in-out 0.15s; transition: opacity ease-in-out 0.15s;}.jimu-widget-add-data .add-file-pane .drop-area i {color: #485566; font-style: normal;}.jimu-widget-add-data .add-file-pane .drop-area a.drop-area-hint {position: absolute; top: 0; right: 0; margin: 5px; padding: 10px; font-size: 14px; line-height: 1;}.jimu-widget-add-data .add-file-pane .drop-area.hit {background: #f9f9f9; border-color: #24b5cc;}.jimu-widget-add-data .add-file-pane .drop-area.hit \x3e * {pointer-events: none; display: none;}.jimu-widget-add-data .add-file-pane .drop-area.hit .supported-file-types {display: block;}.jimu-widget-add-data .add-file-pane .drop-area.hit .upload-arrow {display: block; width: 48px; height: 48px; background: url(images/arrow_up.png) no-repeat; margin: 0 auto; -moz-animation: updload-arrow-animation 1s infinite; -webkit-animation: updload-arrow-animation 1s infinite; animation: updload-arrow-animation 1s infinite;}.jimu-widget-add-data .add-file-pane .drop-area .supported-file-types {margin: 15px 0 35px; opacity: .5; pointer-events: none; -webkit-transition: opacity ease-in-out 0.15s; -moz-transition: opacity ease-in-out 0.15s; -o-transition: opacity ease-in-out 0.15s; transition: opacity ease-in-out 0.15s;}.jimu-widget-add-data .add-file-pane .drop-area .supported-file-types img {width: 45px; margin-left: -5px; position: relative; -webkit-transition: all ease-in-out 0.2s; -moz-transition: all ease-in-out 0.2s; -o-transition: all ease-in-out 0.2s; transition: all ease-in-out 0.2s;}.jimu-widget-add-data .add-file-pane .drop-area .supported-file-types img.first-type-icon {-moz-transform: rotate(-8deg); -moz-transform-origin: right bottom; -webkit-transform: rotate(-8deg); -webkit-transform-origin: right bottom; -o-transform: rotate(-8deg); -o-transform-origin: right bottom; transform: rotate(-8deg); transform-origin: right bottom; bottom: -1px;}.jimu-widget-add-data .add-file-pane .drop-area .supported-file-types img.second-first-type-icon {-moz-transform: rotate(-3deg); -moz-transform-origin: right bottom; -webkit-transform: rotate(-3deg); -webkit-transform-origin: right bottom; -o-transform: rotate(-3deg); -o-transform-origin: right bottom; transform: rotate(-3deg); transform-origin: right bottom;}.jimu-widget-add-data .add-file-pane .drop-area .supported-file-types img.second-last-type-icon {-moz-transform: rotate(3deg); -moz-transform-origin: left bottom; -webkit-transform: rotate(3deg); -webkit-transform-origin: left bottom; -o-transform: rotate(3deg); -o-transform-origin: left bottom; transform: rotate(3deg); transform-origin: left bottom;}.jimu-widget-add-data .add-file-pane .drop-area .supported-file-types img.last-type-icon {-moz-transform: rotate(8deg); -moz-transform-origin: left bottom; -webkit-transform: rotate(8deg); -webkit-transform-origin: left bottom; -o-transform: rotate(8deg); -o-transform-origin: left bottom; transform: rotate(8deg); transform-origin: left bottom; bottom: -1px;}.jimu-widget-add-data .add-file-pane .drop-area.hit .supported-file-types {opacity: 1;}.jimu-widget-add-data .add-file-pane .drop-area.hit .supported-file-types img {margin-left: 0px;}.jimu-widget-add-data .add-file-pane .drop-area.hit .supported-file-types img.first-type-icon {-moz-transform: rotate(-12deg); -webkit-transform: rotate(-12deg); -o-transform: rotate(-12deg); transform: rotate(-12deg); bottom: -3px;}.jimu-widget-add-data .add-file-pane .drop-area.hit .supported-file-types img.second-first-type-icon {-moz-transform: rotate(-5deg); -webkit-transform: rotate(-5deg); -o-transform: rotate(-5deg); transform: rotate(-5deg);}.jimu-widget-add-data .add-file-pane .drop-area.hit .supported-file-types img.second-last-type-icon {-moz-transform: rotate(5deg); -webkit-transform: rotate(5deg); -o-transform: rotate(5deg); transform: rotate(5deg);}.jimu-widget-add-data .add-file-pane .drop-area.hit .supported-file-types img.last-type-icon {-moz-transform: rotate(12deg); -webkit-transform: rotate(12deg); -o-transform: rotate(12deg); transform: rotate(12deg); bottom: -3px;}.jimu-widget-add-data .add-file-pane .file-form {display: inline-block;}.jimu-widget-add-data .search-box2 {display: inline-block;}.jimu-widget-add-data .search-box2 {float: right;}.jimu-widget-add-data .search-box2 .search-textbox {vertical-align: middle; height: 30px; width: 200px; padding: 5px 10px; font-size: 12px; line-height: 1.5; background-color: #ffffff; background-image: none; border: 1px solid #cccccc; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; -moz-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;}.jimu-widget-add-data .search-box2 .btn {display: inline-block; height: 30px; margin-left: -1px; margin-bottom: 0; font-weight: normal; text-align: center; vertical-align: middle; touch-action: manipulation; cursor: pointer; color: #196fa6; background-color: #ffffff; background-image: none; border: 1px solid #cccccc; padding: 5px 10px; white-space: nowrap; font-size: 12px; line-height: 1.5; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;}.jimu-widget-add-data.width-small .search-box2 .search-textbox {width: 150px;}.jimu-widget-add-data.width-small .add-file-pane .or:before,.jimu-widget-add-data.width-small .add-file-pane .or:after {width: 25%;}.jimu-widget-add-data.width-medium .search-box2 .search-textbox {width: 140px;}.jimu-widget-add-data.width-medium .filter-wrapper .sort-prompt,.jimu-widget-add-data.width-small .filter-wrapper .sort-prompt {display: none;}.jimu-widget-add-data.width-medium .search-pane .search-results-pane {padding: 5px 0;}.jimu-widget-add-data.width-medium .search-pane .item-card .item-card-inner {margin-bottom: 5px;}.jimu-widget-add-data.height-small .add-file-pane {padding-top: 15px; padding-bottom: 15px;}.jimu-widget-add-data.height-small .add-file-pane .drop-area {padding-top: 15px; padding-bottom: 25px;}.jimu-widget-add-data.height-small .add-file-pane .drop-area .supported-file-types {margin-bottom: 20px;}.jimu-widget-add-data .search-bbox-option .checkbox-inline,.jimu-widget-add-data .search-bbox-option .checkbox-inline input,.jimu-widget-add-data .search-pane .filter-placeholder {cursor: pointer;}.jimu-widget-add-data.width-small .search-bbox-option {max-width: 120px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}.jimu-widget-add-data.width-small .search-bbox-option .switch-toggle-group {overflow: hidden; text-overflow: ellipsis;}.jimu-widget-add-data .search-pane .search-bbox-option .checkbox-inline {padding-left: 38px; margin-right: 25px;}.jimu-widget-add-data .search-pane .search-box .input-group {position: relative; display: table; border-collapse: separate;}.jimu-widget-add-data .search-pane .search-box .input-group \x3e * {display: table-cell; vertical-align: middle;}.jimu-widget-add-data .search-pane .search-box .search-textbox {height: 30px; width: 200px; padding: 5px 10px; font-size: 12px; line-height: 1.5; background-color: #ffffff; background-image: none; border: 1px solid #cccccc; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; -moz-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;}.jimu-widget-add-data .search-pane .search-box .btn {display: inline-block; margin-left: -1px; margin-bottom: 0; font-weight: normal; text-align: center; vertical-align: middle; touch-action: manipulation; cursor: pointer; color: #196fa6; background-color: #ffffff; background-image: none; border: 1px solid #cccccc; padding: 5px 10px; white-space: nowrap; font-size: 12px; line-height: 1.5; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;}.jimu-widget-add-data .search-pane .search-box .btn-clear {border-color: transparent; background: transparent; position: absolute; left: -32px;}.jimu-widget-add-data .search-pane .search-box-placeholder,.jimu-widget-add-data .search-pane .filter-placeholder,.jimu-widget-add-data .search-pane .scope-placeholder {display: none;}.jimu-widget-add-data .search-pane .search-sort-options \x3e * {vertical-align: middle;}.jimu-widget-add-data .search-pane .search-sort-options label {font-weight: normal; font-size: 11px; color: #898989;}.jimu-widget-add-data .search-pane .search-sort-options .sort-order-icon {float: right; width: 24px; height: 24px; margin: 3px 0;}.jimu-widget-add-data .search-pane .search-sort-options .dropdown-toggle .sort-order-icon {float: none; padding: 0 5px;}.jimu-widget-add-data .search-pane .sort-order-icon {background-image: url("images/down-arrow.png"); background-position: center center; background-repeat: no-repeat; width: 16px; height: 16px; background-image: url("images/sort-down-arrow.png");}.jimu-widget-add-data .search-pane .sort-order-icon.descending {background-image: url("images/sort-up-arrow.png");}.jimu-widget-add-data .search-pane .scope-options \x3e * {display: inline-block;}.jimu-widget-add-data .search-pane .checkbox-inline,.jimu-widget-add-data .search-pane .radio-inline {position: relative; padding-left: 21px; margin-right: 10px;}.jimu-widget-add-data .search-pane .checkbox-inline .dijitCheckBox,.jimu-widget-add-data .search-pane .radio-inline .dijitCheckBox {}.jimu-widget-add-data .search-pane .search-item-ratings-comments-views {display: block; padding: 5px;}.jimu-widget-add-data .search-pane .search-item-ratings-comments-views [class*\x3d"gd-icon-"] {margin-right: 10px; vertical-align: middle;}.jimu-widget-add-data .search-pane .search-paging .pagination {margin: 0;}.jimu-widget-add-data .search-pane .search-paging,.jimu-widget-add-data .search-pane .search-result-count {display: inline-block; vertical-align: middle; line-height: 1;}.jimu-widget-add-data .search-pane .pagination \x3e li \x3e span,.jimu-widget-add-data .search-pane .pagination \x3e li \x3e span:focus,.jimu-widget-add-data .search-pane .pagination \x3e li \x3e span:hover {color: inherit; border-color: transparent; background-color: transparent;}.jimu-widget-add-data .search-pane .pagination \x3e li.current-page \x3e span {padding-left: 15px; padding-right: 15px;}.jimu-widget-add-data .search-pane .pagination [class*\x3d" esri-icon-"],.jimu-widget-add-data .search-pane .pagination [class^\x3d"esri-icon-"] {position: relative; top: 1px;}.jimu-widget-add-data .search-pane .search-result-count {margin: 0 10px;}.jimu-widget-add-data.width-768 .item-card {width: 50%;}.jimu-widget-add-data.width-1200 .item-card {width: 33.3333333333%;}.jimu-widget-add-data.width-medium .search-pane .search-bar,.jimu-widget-add-data.width-small .search-pane .search-bar {padding-left: 5px; padding-right: 5px;}.jimu-widget-add-data.width-medium .search-pane .search-bar .btn-group \x3e .btn,.jimu-widget-add-data.width-small .search-pane .search-bar .btn-group \x3e .btn {margin-left: 0;}.jimu-rtl .jimu-widget-add-data.width-medium .search-pane .search-bar .btn-group \x3e .btn,.jimu-rtl .jimu-widget-add-data.width-small .search-pane .search-bar .btn-group \x3e .btn {margin-left: auto; margin-right: 0;}.jimu-widget-add-data.width-medium .search-box-placeholder,.jimu-widget-add-data.width-small .search-box-placeholder,.jimu-widget-add-data.filter-placeholder-on .filter-placeholder {display: block; height: 30px; width: 30px; background-image: url("images/search.png"); background-position: center center; background-repeat: no-repeat; background-size: 12px;}.jimu-widget-add-data.width-medium .search-box,.jimu-widget-add-data.width-small .search-box {display: none; padding: 10px; position: absolute; top: 0; left: 0; right: 40px; background: #ffffff;}.jimu-widget-add-data.width-small .search-box {padding-top: 8px; padding-bottom: 8px;}.jimu-widget-add-data.width-medium .search-box .input-group,.jimu-widget-add-data.width-small .search-box .input-group {width: 100%;}.jimu-widget-add-data.width-medium .search-box .search-textbox,.jimu-widget-add-data.width-small .search-box .search-textbox {width: 100%;}.jimu-widget-add-data.width-medium .search-box .search-btn,.jimu-widget-add-data.width-small .search-box .search-btn {width: 1%; position: relative;}.jimu-widget-add-data.width-medium .search-box.show,.jimu-widget-add-data.width-small .search-box.show {display: block;}.jimu-widget-add-data.width-medium .search-box-placeholder,.jimu-widget-add-data.width-small .search-box-placeholder {margin: 0 0 8px;}.jimu-widget-add-data.width-medium .search-box-placeholder.opened,.jimu-widget-add-data.width-small .search-box-placeholder.opened {background-image: url("images/close.png");}.jimu-widget-add-data.width-medium .filter-placeholder,.jimu-widget-add-data.width-small .filter-placeholder {background-image: url("images/menu.png");}.jimu-widget-add-data.width-medium .scope-placeholder,.jimu-widget-add-data.width-small .scope-placeholder {display: block; padding: 5px 10px 15px; color: #196fa6; font-weight: bold;}.jimu-widget-add-data.width-small .scope-placeholder {display: flex;}.jimu-widget-add-data.width-small .scope-placeholder \x3e span:first-child {white-space: nowrap; text-overflow: ellipsis; overflow: hidden; width: calc(100% - 16px); flex: 1;}.jimu-widget-add-data.width-medium .scope-placeholder:focus,.jimu-widget-add-data.width-small .scope-placeholder:focus {text-decoration: none;}.jimu-widget-add-data.width-medium .scope-placeholder \x3e *,.jimu-widget-add-data.width-small .scope-placeholder \x3e * {vertical-align: middle;}.jimu-widget-add-data.width-medium .scope-placeholder .dropdown-arrow,.jimu-widget-add-data.width-small .scope-placeholder .dropdown-arrow {display: inline-block; background-image: url("images/down-arrow.png"); background-position: center center; background-repeat: no-repeat; width: 16px; height: 16px;}.jimu-widget-add-data.width-medium .btn-group,.jimu-widget-add-data.filter-placeholder-on .filter-wrapper,.jimu-widget-add-data.width-small .btn-group {display: none;}.jimu-widget-add-data.width-medium .filter-wrapper.show,.jimu-widget-add-data.width-medium .btn-group.show,.jimu-widget-add-data.width-small .filter-wrapper.show,.jimu-widget-add-data.width-small .btn-group.show {display: block; position: absolute; right: 0; top: 91px; z-index: 10; padding: 5px 10px; background: #ffffff; border: 1px solid #cccccc; -webkit-box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.2); box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.2);}.jimu-rtl .jimu-widget-add-data.width-medium .filter-wrapper.show,.jimu-rtl .jimu-widget-add-data.width-medium .btn-group.show,.jimu-rtl .jimu-widget-add-data.width-small .filter-wrapper.show,.jimu-rtl .jimu-widget-add-data.width-small .btn-group.show {left: 0; right: auto;}.jimu-widget-add-data.width-medium .btn-group.show,.jimu-widget-add-data.width-small .btn-group.show {top: 48px; left: 0; padding: 0; right: auto; min-width: 50%;}.jimu-rtl .jimu-widget-add-data.width-medium .btn-group.show,.jimu-rtl .jimu-widget-add-data.width-small .btn-group.show {left: auto; right: 0;}.jimu-widget-add-data.width-medium .btn-group.show .btn,.jimu-widget-add-data.width-small .btn-group.show .btn {display: block; width: 100%; padding: 10px 15px; border: 0; font-weight: normal;}.jimu-widget-add-data.width-medium .btn-group.show .btn:hover,.jimu-widget-add-data.width-small .btn-group.show .btn:hover {background-color: #f4f4f4;}.jimu-widget-add-data.width-medium .btn-group.show .btn.active,.jimu-widget-add-data.width-medium .btn-group.show .btn.active:hover,.jimu-widget-add-data.width-small .btn-group.show .btn.active,.jimu-widget-add-data.width-small .btn-group.show .btn.active:hover {background-color: #196fa6 !important; color: #fff !important;}.jimu-widget-add-data.width-small .jimu-tab3 .tab-item-td {padding-left: 20px; padding-right: 20px;}.jimu-widget-add-data.width-small .search-pane .search-bar {padding-top: 5px; padding-left: 5px; padding-right: 5px;}.jimu-widget-add-data.width-small .search-pane .search-bar .btn-group \x3e .btn {margin: 0; padding-left: 5px; padding-right: 5px; font-size: 11px;}.jimu-widget-add-data.width-small .search-pane .search-results-pane {padding: 0; overflow: hidden;}.jimu-widget-add-data.width-small .search-pane .item-card {padding-left: 0; padding-right: 0;}.jimu-widget-add-data.width-small .search-pane .item-card .item-card-inner {margin-bottom: 0; border-top: 0; border-left: 0; border-right: 0; border-bottom-color: #e0e0e0;}.add-data-widget-popup .search-type-option {display: flex; align-items: center;}.add-data-widget-popup .search-type-option + .search-type-option {margin-top: 10px;}.add-data-widget-popup .search-type-option .jimu-checkbox {margin-right: 5px;}.jimu-rtl .add-data-widget-popup .search-type-option .jimu-checkbox {margin-right: 0; margin-left: 5px;}.add-data-widget-popup .search-type-option,.add-data-widget-popup .search-type-option input {cursor: pointer;}.jimu-widget-add-data {position: absolute; top: 0; bottom: 0; left: 0; right: 0; padding-top: 5px;}.jimu-widget-add-data .btn.hidden {visibility: hidden;}.jimu-widget-add-data .search-bbox-option,.jimu-widget-add-data .search-box {display: inline-block;}.jimu-widget-add-data .search-box,.jimu-widget-add-data .search-box-placeholder {float: right;}.jimu-widget-add-data .search-scope-options,.jimu-widget-add-data .search-sort-options {display: inline-block;}.jimu-widget-add-data .search-data-type-options {float: left;}.jimu-widget-add-data .filter-wrapper,.jimu-widget-add-data .filter-placeholder {float: right;}.jimu-widget-add-data .search-scope-options button.active {background-color: #cce6ff;}.jimu-widget-add-data .search-results-pane {overflow-y: auto;}.jimu-widget-add-data .search-paging,.jimu-widget-add-data .search-result-count {display: inline-block;}.jimu-widget-add-data .search-paging ul {margin: 0; padding: 0;}.jimu-widget-add-data .search-paging li {display: inline-block;}.jimu-widget-add-data .search-paging li.disabled a,.jimu-widget-add-data .search-paging li.disabled a:hover,.jimu-widget-add-data .search-paging li.disabled a:active,.jimu-widget-add-data .search-paging li.disabled a:focus {cursor: default; opacity: 0.35;}.jimu-widget-add-data .search-item-card .action-bar {margin-left: 20px;}.jimu-widget-add-data .search-item-card .action-bar a {margin-right: 8px;}.jimu-widget-add-data .dijitDropDownButton {margin: 0;}.jimu-widget-add-data .dijitSelect,.jimu-widget-add-data .dijitDropDownButton .dijitButtonNode {background: transparent; border: 0; padding: 7px 5px; color: #196fa6; font-weight: bold; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;}.jimu-widget-add-data .dijitSelect .dijitButtonContents,.jimu-widget-add-data .dijitDropDownButton .dijitButtonNode .dijitButtonContents {border-color: transparent;}.jimu-widget-add-data .dijitSelect .dijitInputField,.jimu-widget-add-data .dijitDropDownButton .dijitButtonNode .dijitInputField {padding: 0 5px;}.jimu-widget-add-data .dijitSelect .dijitArrowButton,.jimu-widget-add-data .dijitDropDownButton .dijitButtonNode .dijitArrowButton {background: transparent; border: 0;}.jimu-widget-add-data .dijitSelect.dijitSelectFocused .dijitArrowButton,.jimu-widget-add-data .dijitDropDownButton .dijitButtonNode.dijitSelectFocused .dijitArrowButton {padding: 0;}.jimu-widget-add-data .dijitSelect .dijitArrowButton .dijitArrowButtonInner,.jimu-widget-add-data .dijitSelectHover .dijitArrowButton .dijitArrowButtonInner,.jimu-widget-add-data .dijitSelectFocused .dijitArrowButton .dijitArrowButtonInner {background-image: url("images/down-arrow.png"); background-position: center center; background-repeat: no-repeat; width: 16px; height: 16px;}.jimu-widget-add-data .dijitDropDownButton .dijitArrowButtonInner {background-image: url("images/down-arrow.png"); background-position: center center; background-repeat: no-repeat; width: 16px; height: 16px;}.jimu-widget-add-data-dialog {background-color: #FFFFFF !important; border-color: #555555 !important; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.35) !important; -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.35) !important; box-shadow: 0 0 5px rgba(0, 0, 0, 0.35) !important;}.jimu-widget-add-data-dialog .dijitDialogPaneContent {border-top: 1px solid #cccccc;}.jimu-widget-add-data-dialog .dijitDialogTitleBar {background: none repeat scroll 0 0 rgba(0, 0, 0, 0); background-color: #FFFFFF; -moz-border-radius: 3px 3px 0 0; -webkit-border-radius: 3px 3px 0 0; border-radius: 3px 3px 0 0;}.jimu-widget-add-data-dialog .dijitDialogTitle {background-color: #FFFFFF; color: #000000; font-size: 16px; font-weight: bold;}.jimu-widget-add-data-dialog div.gap {margin-top: 20px;}.jimu-widget-add-data-dialog div.small-gap {margin-top: 4px;}.jimu-widget-add-data-dialog div.action-bar {margin-top: 10px;}.jimu-widget-add-data-dialog .url-textbox {height: 30px; width: 200px; padding: 5px 10px; font-size: 12px; line-height: 1.5; background-color: #ffffff; background-image: none; border: 1px solid #cccccc; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; -moz-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;}.jimu-widget-add-data-dialog .url-textbox-wide {width: 500px;}.jimu-widget-add-data-dialog .examples {font-size: 9px; font-style: italic; margin-top: 4px; margin-left: 4px; opacity: 0.5;}.jimu-widget-add-data .btn-link {color: #196fa6 !important;}.jimu-widget-add-data .switch-toggle-group {padding: 5px;}.jimu-widget-add-data .switch-toggle-group .checkbox-inline {padding-left: 36px; vertical-align: top;}.jimu-widget-add-data .switch-toggle-group .switch-toggle.dijitCheckBox {margin-left: -36px;}.jimu-widget-add-data .switch-toggle.dijitCheckBox {height: 16px; width: 28px; border: 0 none; background: #e04f1d; position: relative; display: inline-block; cursor: pointer; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px;}.jimu-widget-add-data .switch-toggle.dijitCheckBox:before {content: ""; background: #f8f8f8; position: absolute; padding: 0; height: 12px; width: 12px; left: auto; right: 2px; top: 2px; z-index: 1; -webkit-transition: right 0.3s; -moz-transition: right 0.3s; -o-transition: right 0.3s; transition: right 0.3s; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%;}.jimu-widget-add-data .switch-toggle.dijitCheckBox input {width: 100%; height: 100%; position: absolute; left: 0; z-index: 2;}.jimu-widget-add-data .switch-toggle.dijitCheckBox.dijitCheckBoxChecked {background: #50ad4e;}.jimu-widget-add-data .switch-toggle.dijitCheckBox.dijitCheckBoxChecked:before {right: 14px;}.jimu-widget-add-data .panel-default \x3e .panel-heading {background-color: transparent; border-color: #e0e0e0;}.jimu-widget-add-data .panel-title {font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}.jimu-widget-add-data .panel-footer .btn + .btn {margin-left: 10px;}.jimu-widget-add-data .gp-panel {width: 300px;}.jimu-widget-add-data .gp-panel \x3e .panel-heading {background-color: transparent; border-left: 1px solid rgba(0, 0, 0, 0.35); color: #efefef; height: 40px;}.jimu-widget-add-data .gp-panel \x3e .panel-heading .panel-title {font-weight: normal; line-height: 1.5;}.jimu-widget-add-data .gp-panel \x3e .panel-heading [class^\x3d"esri-icon-"],.jimu-widget-add-data .gp-panel \x3e .panel-heading [class*\x3d" esri-icon-"] {display: inline-block; margin-right: 10px; position: relative; top: 1px;}.jimu-widget-add-data .gp-panel \x3e .panel-heading .btn-icon {width: 20px; padding: 0; color: #efefef; float: right; margin-right: 0; font-size: 16px; line-height: 1.25; line-height: 20px; text-align: center;}.jimu-widget-add-data .gp-panel \x3e .panel-body {background-color: #f8f8f8; border-left: 1px solid #cccccc; position: absolute; top: 40px; bottom: 0; width: 100%; overflow: auto; padding: 0;}.jimu-widget-add-data .gp-panel .panel-section {background-color: #ffffff;}.jimu-widget-add-data .panel-section {border-bottom: 1px solid #cccccc;}.jimu-widget-add-data .panel-section .section-header {display: block; font-size: 16px; line-height: 1.25; line-height: 20px; padding: 10px 15px;}.jimu-widget-add-data .panel-section .section-header:after {content: ""; display: block; clear: both;}.jimu-widget-add-data .panel-section .section-header [class^\x3d"esri-icon-"],.jimu-widget-add-data .panel-section .section-header [class*\x3d" esri-icon-"],.jimu-widget-add-data .panel-section .section-header .btn {margin: 0 5px; float: right;}.jimu-widget-add-data .panel-section .section-header .btn {margin: 0; min-width: 80px;}.jimu-widget-add-data .panel-section .btn.section-header {border: 0; text-align: left; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transition: all 0.25s ease; -moz-transition: all 0.25s ease; -o-transition: all 0.25s ease; transition: all 0.25s ease;}.jimu-widget-add-data .panel-section .btn.section-header:hover {background-color: #e2f1fb; text-decoration: none;}.jimu-widget-add-data .panel-section .btn.section-header:active,.jimu-widget-add-data .panel-section .btn.section-header:focus {background-color: #aadbfa; text-decoration: none;}.jimu-widget-add-data .panel-section .section-body {padding: 10px 15px;}.jimu-widget-add-data a, .add-url-pane a {display: block; color: #196fa6; text-decoration: none; line-height: 20px; padding: 10px 5px;}.jimu-widget-add-data .btn.hidden {visibility: hidden;}.jimu-widget-add-data .search-bbox-option, .search-box {display: inline-block;}.jimu-widget-add-data .search-box,.jimu-widget-add-data .search-box-placeholder {float: right;}.jimu-widget-add-data .search-scope-options,.jimu-widget-add-data .search-sort-options {display: inline-block;}.jimu-widget-add-data .search-data-type-options {float: left;}.jimu-widget-add-data .filter-wrapper,.jimu-widget-add-data .filter-placeholder {float: right;}.jimu-widget-add-data .search-scope-options button.active {background-color: #cce6ff;}.jimu-widget-add-data .search-results-pane {overflow-y: auto;}.jimu-widget-add-data .search-paging,.jimu-widget-add-data .search-result-count {display: inline-block;}.jimu-widget-add-data .search-paging ul {margin: 0; padding: 0;}.jimu-widget-add-data .search-paging li {display: inline-block;}.jimu-rtl .jimu-widget-add-data .search-paging li {-moz-transform: rotate(180deg); -webkit-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg);}.jimu-rtl .jimu-widget-add-data .search-paging li.current-page {-moz-transform: rotate(0); -webkit-transform: rotate(0); -o-transform: rotate(0); transform: rotate(0);}.jimu-widget-add-data .search-item-card .action-bar {margin-left: 20px;}.jimu-widget-add-data .search-item-card .action-bar a {margin-right: 8px;}.jimu-widget-add-data .add-url-pane .url-textbox {width: 100%; font-size: 12px; color: #000000; padding: 0;}.jimu-widget-add-data .add-url-pane .examples {display: none; margin: 15px -15px 0; padding: 15px; font-size: 12px; color: #898989; word-wrap: break-word;}.jimu-widget-add-data .add-url-pane .examples \x3e div \x3e div {margin-bottom: 15px;}.jimu-widget-add-data .add-url-pane .examples.show {display: block;}.jimu-widget-add-data .jimu-tab3 \x3e .jimu-viewstack {position: absolute; top: 39px; left: 0px; right: 0; bottom: 0; padding-bottom: 40px;}.jimu-widget-add-data-footer {height: 40px; overflow: hidden; background-color: #f8f8f8; border-top: 1px solid #ccc; padding: 0 15px; color: #898989; font-size: 11px;}.jimu-widget-add-data-footer [class^\x3d"esri-icon-"],.jimu-widget-add-data-footer [class*\x3d" esri-icon-"] {line-height: 20px;}.jimu-widget-add-data-footer .layerlist-button {text-transform: uppercase;}.jimu-widget-add-data-footer .layerlist-button .esri-icon-layers {margin: 0 5px; vertical-align: middle; display: inline-block;}.jimu-widget-add-data-footer .message {display: block; color: #898989; line-height: 20px; padding: 10px 10px 10px 0; text-overflow: ellipsis; overflow: hidden; word-break: break-all; white-space: nowrap;}.jimu-widget-add-data.layerlist-show {overflow: hidden;}.jimu-widget-add-data.layerlist-show .jimu-tab3 {-webkit-filter: blur(5px); filter: blur(5px);}.jimu-widget-add-data.layerlist-show .add-data-layerlist--container {-moz-animation: slide-from-right .4s; -webkit-animation: slide-from-right .4s; animation: slide-from-right .4s;}.add-data-widget-layers {width: 100%; height: 100%; background: rgba(0, 0, 0, 0.3); position: absolute; top: 0; right: 0; z-index: 1;}.add-data-widget-layers {display: none;}.add-data-widget-layers.show {display: block;}.add-data-widget-layers .add-data-layerlist--container {background: #fff; position: absolute; top: 0; right: 0; width: 320px; height: 100%; -webkit-transition: width 0.4s ease; -moz-transition: width 0.4s ease; -o-transition: width 0.4s ease; transition: width 0.4s ease;}.width-small .add-data-widget-layers .add-data-layerlist--container {width: 100%;}.add-data-widget-layers .add-data-layerlist--container h2 {margin: 0; padding: 7px 15px; border-bottom: 1px solid #ccc; color: #898989; font-size: 14px; font-weight: normal; line-height: 2;}.add-data-layerlist--list {width: 100%; padding: 10px 15px; line-height: 20px; position: absolute; top: 45px; bottom: 40px; overflow: auto;}.add-data-layerlist--listitem {margin-bottom: 5px;}.add-data-layerlist--listitem:after {content: ""; display: table; clear: both;}.add-data-layerlist--listitem .remove-button {float: right; padding: 5px 10px;}.add-data-layerlist--listitem .layer-name {display: block; padding-top: 5px;}.add-data-widget-layers .add-data-layerlist--footer {width: 100%; position: absolute; bottom: 0;}.add-data-widget-layers .back-button {float: right; text-transform: uppercase;}.add-data-widget-layers .back-button i {display: inline-block; margin-left: 5px;}.add-data-widget-layers .no-data-message {color: #898989; padding: 25px; text-align: center;}.add-data-widget-popup {padding: 0;}.add-data-widget-popup .dijitTooltipConnector {display: none;}.add-data-widget-popup .dijitTooltipContainer {padding: 10px; border-color: #ccc; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);}.add-data-widget-popup.dijitMenuPopup {-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);}.add-data-widget-popup .dijitMenu {border-color: #ccc;}.add-data-widget-popup .dijitMenu .dijitMenuItem td {padding: 10px 15px; border: 0;}.add-data-widget-popup .dijitMenu .dijitMenuItemHover td,.add-data-widget-popup .dijitMenu .dijitMenuItemActive td,.add-data-widget-popup .dijitMenu .dijitMenuItemSelected td {background-color: #f4f4f4; background-image: none;}.add-data-widget-popup .dijitMenu .dijitSelectSelectedOption td,.add-data-widget-popup .dijitMenu .dijitSelectSelectedOption.dijitMenuItemHover td,.add-data-widget-popup .dijitMenu .dijitSelectSelectedOption.dijitMenuItemSelected td {background-color: #196fa6; background-image: none; color: #fff; font-weight: normal;}.LaunchpadTheme .jimu-widget-add-data.jimu-widget {position: absolute;}.LaunchpadTheme .jimu-widget-add-data .search-pane .item-card h3.title {height: auto; width: auto; position: static;}.LaunchpadTheme .jimu-widget-add-data .dijitSelect.dijitSelectFocused .dijitArrowButton,.LaunchpadTheme .jimu-widget-add-data .dijitDropDownButton .dijitButtonNode.dijitSelectFocused .dijitArrowButton {padding: 5px;}.LaunchpadTheme .jimu-widget-add-data .dijitButton .dijitButtonNode,.LaunchpadTheme .jimu-widget-add-data .dijitDropDownButton .dijitButtonNode,.LaunchpadTheme .jimu-widget-add-data .dijitComboButton .dijitButtonNode,.LaunchpadTheme .jimu-widget-add-data .dijitToggleButton .dijitButtonNode {color: #196fa6; font-size: inherit; letter-spacing: 0;}.LaunchpadTheme .jimu-widget-add-data .dijitSelect,.LaunchpadTheme .jimu-widget-add-data .dijitButton .dijitButtonNode,.LaunchpadTheme .jimu-widget-add-data .dijitDropDownButton .dijitButtonNode,.LaunchpadTheme .jimu-widget-add-data .dijitComboButton .dijitButtonNode,.LaunchpadTheme .jimu-widget-add-data .dijitToggleButton .dijitButtonNode {background-color: transparent; border: 0;}.LaunchpadTheme .jimu-widget-add-data .secondary-pane .jimu-btn {background-color: #3b8fc4; border: 0;}.LaunchpadTheme .jimu-widget-add-data .secondary-pane .jimu-btn:hover {background-color: #2c6b93;}.DartTheme .jimu-widget-add-data .search-pane {background-color: transparent;}.DartTheme .jimu-widget-add-data .search-pane .search-bar {background-color: transparent;}.DartTheme .jimu-widget-add-data .search-pane .search-bar-secondary {background: #3a3a3a;}.DartTheme .jimu-widget-add-data .secondary-pane {background-color: transparent;}.DartTheme .jimu-widget-add-data .search-pane-content {background-color: #222;}.DartTheme .jimu-tab3 .tab-item-td.jimu-state-active {background: #4C4C4C;}.DartTheme .jimu-widget-add-data .search-pane .search-bar-separator,.DartTheme .jimu-widget-add-data .search-pane .search-pane-header {border-bottom: 1px solid #262626;}.DartTheme .jimu-widget-add-data .search-box2 .search-textbox {background: #393939; border: 0; -moz-border-radius: 2px; -webkit-border-radius: 2px; border-radius: 2px;}.DartTheme .jimu-widget-add-data.width-small .search-box2 .search-textbox {width: 100px;}.DartTheme .jimu-widget-add-data .search-box2 .btn {background: #393939; border: 0;}.DartTheme .jimu-widget-add-data .search-pane .item-card .item-card-inner {background: #4c4c4c; border-color: #787878;}.DartTheme .jimu-widget-add-data .search-pane .item-card h3.title {height: auto; width: auto; position: static;}.DartTheme .jimu-widget-add-data.width-medium .filter-wrapper.show,.DartTheme .jimu-widget-add-data.width-medium .btn-group.show,.DartTheme .jimu-widget-add-data.width-small .filter-wrapper.show,.DartTheme .jimu-widget-add-data.width-small .btn-group.show {background: #393939; border: 1px solid #7f8183; -webkit-box-shadow: 0 2px 3px rgba(0,0,0,0.15); -moz-box-shadow: 0 2px 3px rgba(0,0,0,0.15); box-shadow: 0 2px 3px rgba(0,0,0,0.15);}.DartTheme .jimu-widget-add-data.width-medium .btn-group.show .btn:hover,.DartTheme .jimu-widget-add-data.width-small .btn-group.show .btn:hover {background-color: #222;}.DartTheme .jimu-widget-add-data .search-pane .search-bar .btn-group \x3e .btn.active,.DartTheme .jimu-widget-add-data .search-pane .search-bar .btn-group \x3e .btn.active:active,.DartTheme .jimu-widget-add-data .search-pane .search-bar .btn-group \x3e .btn.active:hover {color: #f8f8f8 !important;}.DartTheme .jimu-widget-add-data .search-pane .search-sort-options label {color: #a7a7a7 !important;}.DartTheme .jimu-widget-add-data .secondary-pane {border-bottom: 0;}.DartTheme .jimu-widget-add-data .search-pane .item-card div.info {color: #ddd !important;}.DartTheme .jimu-widget-add-data .search-pane .item-card .action-bar a,.DartTheme .jimu-widget-add-data .add-url-pane .action-bar a,.DartTheme .jimu-widget-add-data .add-file-pane .file-form label {color: #15a4fa !important;}.DartTheme .jimu-widget-add-data .dijitDropDownButton .dijitButtonNode {padding: 7px;}.DartTheme .jimu-widget-add-data .dijitSelect {background-color: transparent; border: 0;}.DartTheme .jimu-widget-add-data .dijitSelect .dijitArrowButton {background-color: transparent; border: 0;}.DartTheme .jimu-widget-add-data.width-medium .scope-placeholder .dropdown-arrow,.DartTheme .jimu-widget-add-data.width-small .scope-placeholder .dropdown-arrow,.DartTheme .jimu-widget-add-data .dijitDropDownButton .dijitArrowButtonInner,.DartTheme .jimu-widget-add-data .dijitSelect .dijitArrowButton .dijitArrowButtonInner,.DartTheme .jimu-widget-add-data .dijitSelectHover .dijitArrowButton .dijitArrowButtonInner,.DartTheme .jimu-widget-add-data .dijitSelectFocused .dijitArrowButton .dijitArrowButtonInner {background-image: url("images/down-arrow_white.png");}.DartTheme .jimu-widget-add-data.width-medium .search-box-placeholder,.DartTheme .jimu-widget-add-data.width-medium .filter-placeholder,.DartTheme .jimu-widget-add-data.width-small .search-box-placeholder,.DartTheme .jimu-widget-add-data.width-small .filter-placeholder {background-image: url("images/search_white.png");}.DartTheme .jimu-widget-add-data.width-medium .filter-placeholder,.DartTheme .jimu-widget-add-data.width-small .filter-placeholder {background-image: url("images/menu_white.png");}.DartTheme .jimu-widget-add-data.width-medium .search-box-placeholder.opened,.DartTheme .jimu-widget-add-data.width-small .search-box-placeholder.opened {background-image: url("images/close_white.png");}.DartTheme.add-data-widget-popup .dijitTooltipContainer {color: #f8f8f8; background: #4c4c4c; border: 1px solid #7f8183; -webkit-box-shadow: 0 2px 3px rgba(0,0,0,0.15); -moz-box-shadow: 0 2px 3px rgba(0,0,0,0.15); box-shadow: 0 2px 3px rgba(0,0,0,0.15);}.DartTheme .add-data-widget-layers .add-data-layerlist--container {background-color: #4c4c4c;}.DartTheme .add-data-widget-layers .add-data-layerlist--container h2 {border-color: #262626;}.DartTheme .jimu-widget-add-data-footer,.DartTheme .add-data-widget-layers .add-data-layerlist--footer {background-color: transparent; border-top-color: #262626;}.DartTheme .jimu-widget-add-data .add-url-pane-container {background-color: transparent; border-color: transparent;}.DartTheme .jimu-widget-add-data .add-url-pane .action-bar a {padding-top: 0; padding-bottom: 0;}.DartTheme .jimu-widget-add-data .add-url-pane .action-bar .jimu-btn {min-width: 140px;}.DartTheme .jimu-widget-add-data .add-file-pane .drop-area {background: transparent; border-color: #ccc;}.DartTheme .jimu-widget-add-data.height-small .add-file-pane .drop-area {padding-left: 15px; padding-right: 15px;}.jimu-rtl .jimu-widget-add-data .search-pane .item-card {float: right;}.jimu-rtl .jimu-widget-add-data .search-pane .item-card .thumbnail {float: right; margin-left: 10px; margin-right: 0;}.jimu-rtl .jimu-widget-add-data .search-pane .search-bbox-option .checkbox-inline {padding-left: auto; padding-right: 38px; margin-right: auto; margin-left: 25px;}.jimu-rtl .jimu-widget-add-data .search-box2 {float: left;}.jimu-rtl .jimu-widget-add-data .search-box2 .btn {margin-left: auto; margin-right: -1px;}.jimu-rtl .jimu-widget-add-data .search-pane .search-sort-options .sort-order-icon {float: left;}.jimu-rtl .jimu-widget-add-data .search-box, .search-box-placeholder {float: left;}.jimu-rtl .jimu-widget-add-data .search-data-type-options {float: right;}.jimu-rtl .jimu-widget-add-data .filter-wrapper,.jimu-rtl .jimu-widget-add-data .filter-placeholder {float: left;}.jimu-rtl .jimu-widget-add-data .switch-toggle-group .checkbox-inline {padding-left: auto; padding-right: 36px;}.jimu-rtl .jimu-widget-add-data .switch-toggle-group .switch-toggle.dijitCheckBox {margin-left: auto; margin-right: -36px;}.jimu-rtl .jimu-widget-add-data .gp-panel \x3e .panel-heading .btn-icon {float: left;}.jimu-rtl .jimu-widget-add-data .panel-section .section-header [class^\x3d"esri-icon-"],.jimu-rtl .jimu-widget-add-data .panel-section .section-header [class*\x3d" esri-icon-"],.jimu-rtl .jimu-widget-add-data .panel-section .section-header .btn {float: left;}.jimu-rtl .jimu-widget-add-data .search-box,.jimu-rtl .jimu-widget-add-data .search-box-placeholder {float: left;}.jimu-rtl .jimu-widget-add-data .search-data-type-options {float: right;}.jimu-rtl .jimu-widget-add-data .filter-wrapper,.jimu-rtl .jimu-widget-add-data .filter-placeholder {float: left;}.jimu-widget-add-data .add-file-pane .or b {padding-left: 5px; padding-right: 0;}.jimu-rtl .jimu-widget-add-data .add-file-pane .drop-area a.drop-area-hint {left: 0; right: auto;}.jimu-rtl .add-data-widget-layers .add-data-layerlist--container {left: 0; right: auto;}.jimu-rtl .jimu-widget-add-data.layerlist-show .add-data-layerlist--container {-moz-animation: slide-from-left .4s; -webkit-animation: slide-from-left .4s; animation: slide-from-left .4s;}.jimu-rtl .add-data-layerlist--listitem .remove-button {float: left;}.jimu-rtl .add-data-widget-layers .back-button {float: left;}.jimu-rtl .add-data-widget-layers .back-button i {margin-left: 0; margin-right: 5px;}.jimu-rtl .add-data-widget-layers .back-button i.esri-icon-collapse:before {content: "\\e631";}.ar .esri-icon-question {-webkit-transform: rotateY(180deg); transform: rotateY(180deg); display: inline-block;}@-moz-keyframes updload-arrow-animation {0% {-moz-transform: translateY(0px);} 50% {-moz-transform: translateY(-10px);} 100% {-moz-transform: translateY(0px);}}@-webkit-keyframes updload-arrow-animation {0% {-webkit-transform: translateY(0px);} 50% {-webkit-transform: translateY(-10px);} 100% {-webkit-transform: translateY(0px);}}@keyframes updload-arrow-animation {0% {transform: translateY(0px);} 50% {transform: translateY(-10px);} 100% {transform: translateY(0px);}}@-moz-keyframes slide-from-right {0% {-moz-transform: translateX(50%); opacity: 0.5;} 100% {-moz-transform: translateX(0%); opacity: 1;}}@-webkit-keyframes slide-from-right {0% {-webkit-transform: translateX(50%); opacity: 0.5;} 100% {-webkit-transform: translateX(0%); opacity: 1;}}@keyframes slide-from-right {0% {transform: translateX(50%); opacity: 0.5;} 100% {transform: translateX(0%); opacity: 1;}}@-moz-keyframes slide-from-left {0% {-moz-transform: translateX(-50%); opacity: 0.5;} 100% {-moz-transform: translateX(0%); opacity: 1;}}@-webkit-keyframes slide-from-left {0% {-webkit-transform: translateX(-50%); opacity: 0.5;} 100% {-webkit-transform: translateX(0%); opacity: 1;}}@keyframes slide-from-left {0% {transform: translateX(-50%); opacity: 0.5;} 100% {transform: translateX(0%); opacity: 1;}}',
"*now":function(H){H(['dojo/i18n!*preload*widgets/AddData/nls/Widget*["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/lang dojo/on dojo/aspect dojo/Deferred dojo/dom-class jimu/portalUrlUtils jimu/portalUtils jimu/tokenUtils jimu/BaseWidget jimu/dijit/TabContainer3 dijit/_WidgetsInTemplateMixin ./search/SearchContext ./search/util ./search/SearchPane ./search/AddFromUrlPane ./search/AddFromFilePane ./search/LayerListPane dojo/_base/array".split(" "),function(H,x,E,B,A,z,n,v,D,w,J,F,L,O,S,G,M,m,f){return H([w,F],{name:"AddData",baseClass:"jimu-widget-add-data",batchGeocoderServers:null,
isPortal:!1,_isOpen:!1,_searchOnOpen:!1,tabContainer:null,searchPane:null,addFromUrlPane:null,addFromFilePane:null,postCreate:function(){this.inherited(arguments)},startup:function(){if(!this._started){var g=this,u=arguments;this._getUser().then(function(q){g._checkConfig();g._initTabs();return g._initContext(q)}).then(function(){g.inherited(u);g.tabContainer?g.tabContainer.startup():g.searchPane?g.searchPane.startup():g.addFromUrlPane?g.addFromUrlPane.startup():g.addFromFilePane&&g.addFromFilePane.startup();
g._initFooter(g.tabContainer,{searchWidget:g.searchPane,addFromUrlWidget:g.addFromUrlPane,addFromFileWidget:g.addFromFilePane});g._initListeners();g.resize()}).otherwise(function(q){console.warn("AddData.startup error:",q);g.inherited(u);g.resize()})}},_checkConfig:function(){this.config||(this.config={});var g=function(r,t){var h=r[t];h||(h=r[t]={allow:!0,label:null});"boolean"!==typeof h.allow&&(h.allow=!0);"Curated"!==t||"string"===typeof h.filter&&0!==x.trim(h.filter).length||(h.allow=!1)},u=
this.config;u.scopeOptions||(u.scopeOptions={});var q=u.scopeOptions;g(q,"MyContent");g(q,"MyOrganization");g(q,"Curated");g(q,"ArcGISOnline");g(u,"addFromUrl");g(u,"addFromFile")},getSharingUrl:function(){var g=v.getPortal(this.appConfig.portalUrl);return n.getSharingUrl(g.portalUrl)},_getUser:function(){var g=new A,u=this.appConfig.portalUrl;D.userHaveSignInPortal(u)?v.getPortal(u).getUser().then(function(q){g.resolve(q)}).otherwise(function(q){console.warn("AddData._getUser error:",q);g.resolve(null)}):
g.resolve(null);return g},_initBatchGeocoder:function(g,u){var q=!1,r=/(arcgis.com\/arcgis\/rest\/services\/world\/geocodeserver).*/ig,t=/(\/servers\/[\da-z\.-]+\/rest\/services\/world\/geocodeserver).*/ig,h=g&&g.helperServices&&g.helperServices.geocode||[],a,b,d=[];u&&u.privileges&&(q=-1<f.indexOf(u.privileges,"premium:user:geocode"));f.forEach(h,function(c){a=!!c.url.match(r);b=!!c.url.match(t);(a&&!g.isPortal&&q||b||c.batch)&&d.push({isWorldGeocodeServer:a||b,isWorldGeocodeServerProxy:b,label:c.name,
value:c.url,url:c.url,name:c.name})});this.batchGeocoderServers=d},_initContext:function(g){var u=new A,q=!0,r=O.checkMixedContent("http://www.arcgis.com"),t=this.config.scopeOptions,h=g&&"string"===typeof g.username&&0<g.username.length,a=new L,b=v.getPortal(this.appConfig.portalUrl);this.isPortal=b.isPortal;a.portal=b;b.isPortal&&(a.orgId=b.id);g&&"string"===typeof g.orgId&&0<g.orgId.length&&(a.orgId=g.orgId);h?a.username=g.username:t.MyContent.allow=!1;this.searchPane&&(this.searchPane.searchContext=
a,this.searchPane.portal=b);this._initBatchGeocoder(b,g);if(b.isPortal)try{var d=n.getSharingUrl(b.portalUrl)+"/kml";d=d.replace("/sharing/rest/kml","/sharing/kml");window.esri.config.defaults.kmlService=d;window.esri.config.defaults.geoRSSService=d.replace("/kml","/rss")}catch(p){console.error(p)}var c=this.nls.search.loadError+r,e=t.ArcGISOnline;a.allowArcGISOnline=e.allow;if(b.isPortal&&a.allowArcGISOnline){var l=v.getPortal(r);l?l.helperServices||(q=!1,l.loadSelfInfo().then(function(){l.helperServices?
a.arcgisOnlinePortal=l:(console.warn(c),a.allowArcGISOnline=!1,e.allow=!1);u.resolve()}).otherwise(function(p){a.allowArcGISOnline=!1;e.allow=!1;console.warn(c);console.warn(p);u.resolve()})):(console.warn(c),a.allowArcGISOnline=!1,e.allow=!1)}else!h&&!b.isPortal&&t.MyOrganization.allow&&t.ArcGISOnline.allow&&(t.MyOrganization.allow=!1);q&&u.resolve();return u},_initFooter:function(g,u){if(g){var q=u.searchWidget,r=!1;q&&q.footerNode&&q.footerNode.nodeName&&(r=!0);u=this.footerContainer=document.createElement("DIV");
u.className=this.baseClass+"-footer";r&&u.appendChild(q.footerNode);var t=document.createElement("A");t.className="layerlist-button jimu-float-trailing";t.href="#";t.innerHTML="\x3cspan class\x3d'esri-icon-layers'\x3e\x3c/span\x3e"+this.nls.layerList.caption;this.own(E(t,"click",x.hitch(this,function(a){a.preventDefault();this.showLayers()})));u.appendChild(t);var h=this.messageNode=document.createElement("SPAN");h.className="message";u.appendChild(h);g=g.containerNode||g.domNode||g;g.nodeName&&g.appendChild(u);
this.own(E(this.tabContainer,"tabChanged",x.hitch(this,function(a){this._setStatus("");r&&(q.footerNode.style.display=a===this.nls.tabs.search?"":"none");this.nls.tabs.search===a?(r&&(q.footerNode.style.display=""),h.style.display="none"):(r&&(q.footerNode.style.display="none"),h.style.display="")})))}},_initListeners:function(){var g=this;this.map&&this.own(this.map.on("extent-change",function(){try{g.searchPane&&g.searchPane.bboxOption.bboxToggle.get("checked")&&(g._isOpen?g.searchPane.search():
g._searchOnOpen=!0)}catch(u){console.warn(u)}}))},_initTabs:function(){var g=this.config,u=[],q=!!(window.File&&window.FileReader&&window.FormData),r=!1,t=g.scopeOptions,h=function(b){r||t&&t[b]&&t[b].allow&&(r=!0)};h("MyContent");h("MyOrganization");h("Curated");h("ArcGISOnline");r&&(this.searchPane=new S({wabWidget:this},this.searchNode),u.push({title:this.nls.tabs.search,content:this.searchPane.domNode}));g.addFromUrl&&g.addFromUrl.allow&&(this.addFromUrlPane=new G({wabWidget:this},this.urlNode),
u.push({title:this.nls.tabs.url,content:this.addFromUrlPane.domNode}));q&&g.addFromFile&&g.addFromFile.allow&&(this.addFromFilePane=new M({wabWidget:this},this.fileNode),u.push({title:this.nls.tabs.file,content:this.addFromFilePane.domNode}));var a=this;if(0<u.length){this.tabContainer=new J({average:!0,tabs:u},this.tabsNode);try{1===u.length&&this.tabContainer.controlNode&&this.tabContainer.containerNode&&(this.tabContainer.controlNode.style.display="none",this.tabContainer.containerNode.style.top=
"0px")}catch(b){}this.own(B.after(this.tabContainer,"selectTab",function(b){a.searchPane&&b===a.nls.tabs.search&&a.searchPane.resize()},!0))}else 0===u.length&&this.tabsNode.appendChild(document.createTextNode(this.nls.noOptionsConfigured))},_setStatus:function(g){this.messageNode&&(O.setNodeText(this.messageNode,g),this.messageNode.title=g)},onClose:function(){this._isOpen=!1},onOpen:function(){var g=this.searchPane&&this._searchOnOpen;this._isOpen=!0;this._searchOnOpen=!1;this.resize();g&&this.searchPane.search()},
resize:function(){var g=this.domNode.clientWidth,u=this.domNode.clientHeight;1E3<g?(z.remove(this.domNode,"width-768"),z.add(this.domNode,"width-1200")):768<g?(z.remove(this.domNode,"width-1200"),z.add(this.domNode,"width-768")):z.remove(this.domNode,["width-768","width-1200"]);420>g?(z.remove(this.domNode,"width-medium"),z.add(this.domNode,"width-small")):750>g?(z.remove(this.domNode,"width-small"),z.add(this.domNode,"width-medium")):z.remove(this.domNode,["width-small","width-medium"]);340>g?z.add(this.domNode,
"filter-placeholder-on"):z.remove(this.domNode,"filter-placeholder-on");400>u?z.add(this.domNode,"height-small"):z.remove(this.domNode,"height-small");this.searchPane&&this.searchPane.resize()},showLayers:function(){this.layerListPane||(this.layerListPane=new m({wabWidget:this}),this.layerListPane.placeAt(this.domNode));this.layerListPane.show()}})});