text: (function(){var e={"esri/layers/support/wmsUtils":612,"esri/layers/support/ExportWMSImageParameters":724,"esri/layers/WMSLayer":754,"esri/layers/support/WMSSublayer":2263},t=this||window,r=t.webpackJsonp=t.webpackJsonp||[];r.registerAbsMids?r.registerAbsMids(e):(r.absMidsWaiting=r.absMidsWaiting||[]).push(e)})(),(window.webpackJsonp=window.webpackJsonp||[]).push([[112],{2263:function(e,t,r){var n,a;n=[r.dj.c(e.i),t,r(117),r(169),r(167),r(225),r(151),r(179),r(184)],void 0===(a=function(e,t,r,n,a,o,i,s,l){var u=0;return function(e){function t(t){var r=e.call(this,t)||this;return r._sublayersHandles=new a,r.fullExtents=null,r.featureInfoFormat=null,r.featureInfoUrl=null,r.legendUrl=null,r.legendEnabled=!0,r.maxScale=0,r.minScale=0,r.popupEnabled=!1,r.queryable=!1,r.spatialReferences=null,r}var o;return r.__extends(t,e),o=t,Object.defineProperty(t.prototype,"description",{get:function(){return this._get("description")},set:function(e){this._set("description",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fullExtent",{get:function(){return this._get("fullExtent")},set:function(e){this._set("fullExtent",e)},enumerable:!0,configurable:!0}),t.prototype.readExtent=function(e,t){return(e=t.extent)?l.fromJSON(e):null},Object.defineProperty(t.prototype,"id",{get:function(){var e=this._get("id");return null==e?u++:e},set:function(e){this._set("id",e)},enumerable:!0,configurable:!0}),t.prototype.readLegendUrl=function(e,t){return t?t.legendUrl||t.legendURL:null},Object.defineProperty(t.prototype,"layer",{set:function(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach((function(t){return t.layer=e}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._get("name")},set:function(e){this._set("name",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sublayers",{set:function(e){var t=this,r=this._get("sublayers");r&&(r.forEach((function(e){e.layer=null})),this._sublayersHandles.removeAll(),this._sublayersHandles=null),e&&(e.forEach((function(e){e.parent=t,e.layer=t.layer})),this._sublayersHandles.add([e.on("after-add",(function(e){var r=e.item;r.parent=t,r.layer=t.layer})),e.on("after-remove",(function(e){var t=e.item;t.parent=null,t.layer=null}))])),this._set("sublayers",e)},enumerable:!0,configurable:!0}),t.prototype.castSublayers=function(e){return s.default(n.ofType(o),e)},Object.defineProperty(t.prototype,"title",{get:function(){return this._get("title")},set:function(e){this._set("title",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visible",{get:function(){return this._get("visible")},set:function(e){this._setAndNotifyLayer("visible",e)},enumerable:!0,configurable:!0}),t.prototype.clone=function(){var e=new o;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=this.fullExtents.map((function(e){return e.clone()}))),this.hasOwnProperty("featureInfoFormat")&&(e.featureInfoFormat=this.featureInfoFormat),this.hasOwnProperty("featureInfoUrl")&&(e.featureInfoUrl=this.featureInfoUrl),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(e.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("name")&&(e.name=this.name),this.hasOwnProperty("parent")&&(e.parent=this.parent),this.hasOwnProperty("queryable")&&(e.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(e.sublayers=this.sublayers&&this.sublayers.map((function(e){return e.clone()}))),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=this.spatialReferences.map((function(e){return e}))),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e},t.prototype._setAndNotifyLayer=function(e,t){var r=this.layer;this._get(e)!==t&&(this._set(e,t),r&&r.emit("wms-sublayer-update",{propertyName:e,id:this.id}))},r.__decorate([i.property()],t.prototype,"description",null),r.__decorate([i.property({value:null})],t.prototype,"fullExtent",null),r.__decorate([i.reader("fullExtent",["extent"])],t.prototype,"readExtent",null),r.__decorate([i.property()],t.prototype,"fullExtents",void 0),r.__decorate([i.property()],t.prototype,"featureInfoFormat",void 0),r.__decorate([i.property()],t.prototype,"featureInfoUrl",void 0),r.__decorate([i.property({type:Number,json:{write:{enabled:!1,overridePolicy:function(){return{ignoreOrigin:!0,enabled:!0}}}}})],t.prototype,"id",null),r.__decorate([i.property({type:String,json:{origins:{"web-document":{read:{source:["legendUrl","legendURL"]},write:{target:"legendUrl",ignoreOrigin:!0}}},read:{source:"legendURL"},write:{ignoreOrigin:!0}}})],t.prototype,"legendUrl",void 0),r.__decorate([i.reader(["web-document"],"legendUrl")],t.prototype,"readLegendUrl",null),r.__decorate([i.property({value:!0,type:Boolean,json:{read:{source:"showLegend"},write:{target:"showLegend"},origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],t.prototype,"legendEnabled",void 0),r.__decorate([i.property({value:null})],t.prototype,"layer",null),r.__decorate([i.property()],t.prototype,"maxScale",void 0),r.__decorate([i.property()],t.prototype,"minScale",void 0),r.__decorate([i.property({type:String,value:null,json:{read:{source:"name"},write:{ignoreOrigin:!0}}})],t.prototype,"name",null),r.__decorate([i.property()],t.prototype,"parent",void 0),r.__decorate([i.property({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],t.prototype,"popupEnabled",void 0),r.__decorate([i.property({type:Boolean,json:{write:{ignoreOrigin:!0}}})],t.prototype,"queryable",void 0),r.__decorate([i.property()],t.prototype,"sublayers",null),r.__decorate([i.cast("sublayers")],t.prototype,"castSublayers",null),r.__decorate([i.property({type:[Number],json:{read:{source:"spatialReferences"}}})],t.prototype,"spatialReferences",void 0),r.__decorate([i.property({type:String,value:null,json:{write:{ignoreOrigin:!0}}})],t.prototype,"title",null),r.__decorate([i.property({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],t.prototype,"visible",null),o=r.__decorate([i.subclass("esri.layers.support.WMSSublayer")],t)}(o.MultiOriginJSONSupport)}.apply(null,n))||(e.exports=a)},612:function(e,t,r){var n,a;n=[r.dj.c(e.i),t,r(154),r(172),r(184),r(170)],void 0===(a=function(e,t,r,n,a,o){Object.defineProperty(t,"__esModule",{value:!0});var i=[[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]],s={84:4326,83:4269,27:4267};function l(e){return i.some((function(t){var r=t[0],n=t[1];return e>=r&&e<=n}))}function u(e,t){var r=t&&t.getElementsByTagName(e);return r&&r.length>0?r[0]:null}function p(e,t,r){var n=u(e,t);return n?n.textContent:r}function y(e,t,r){if(!e)return null;var n,i,s,l,u=parseFloat(e.getAttribute("minx")),p=parseFloat(e.getAttribute("miny")),y=parseFloat(e.getAttribute("maxx")),c=parseFloat(e.getAttribute("maxy"));r?(n=isNaN(p)?-Number.MAX_VALUE:p,i=isNaN(u)?-Number.MAX_VALUE:u,s=isNaN(c)?Number.MAX_VALUE:c,l=isNaN(y)?Number.MAX_VALUE:y):(n=isNaN(u)?-Number.MAX_VALUE:u,i=isNaN(p)?-Number.MAX_VALUE:p,s=isNaN(y)?Number.MAX_VALUE:y,l=isNaN(c)?Number.MAX_VALUE:c);var d=new o({wkid:t});return new a({xmin:n,ymin:i,xmax:s,ymax:l,spatialReference:d})}function c(e,t){var r=u(t,e),a=u("DCPType",r);if(a){var o=u("HTTP",a);if(o){var i=u("Get",o);if(i){var s=function(e,t,r,n){var a=u("OnlineResource",r);return a?a.getAttribute("xlink:href"):null}(0,0,i);if(s)return s.indexOf("&")===s.length-1&&(s=s.substring(0,s.length-1)),function(e,t){var r=[],a=n.urlToObject(e);for(var o in a.query)a.query.hasOwnProperty(o)&&-1===t.indexOf(o.toLowerCase())&&r.push(o+"="+a.query[o]);return a.path+(r.length?"?"+r.join("&"):"")}(s,["service","request"])}}}return null}function d(e,t){var r=e.getElementsByTagName("Operation");if(!r||!r.length){var n=u(t,e).getElementsByTagName("Format");return Array.prototype.slice.call(n).map((function(e){return e.textContent}))}var a=Array.prototype.slice.call(r),o=[];return a.forEach((function(e){if(e.getAttribute("name")===t){var r=e.getElementsByTagName("Format");Array.prototype.slice.call(r).forEach((function(e){o.push(e.textContent)}))}})),o}function f(e,t,r){var n=function(e,t){for(var r=0;r<t.childNodes.length;r++){var n=t.childNodes[r];if(n.nodeType===Node.ELEMENT_NODE&&n.nodeName===e)return n}return null}(t,e);if(!n)return r;var a=n.textContent;if(null==a||""===a)return r;var o=Number(a);return isNaN(o)?r:o}function m(e,t,r){if(!e)return null;var n={id:r.idCounter++,fullExtents:[],parentLayerId:null,queryable:"1"===e.getAttribute("queryable"),spatialReferences:[],sublayers:null},i=u("LatLonBoundingBox",e),c=u("EX_GeographicBoundingBox",e),d=null;i&&(d=y(i,4326)),c&&((d=new a(0,0,0,0,new o({wkid:4326}))).xmin=parseFloat(p("westBoundLongitude",c,0)),d.ymin=parseFloat(p("southBoundLatitude",c,0)),d.xmax=parseFloat(p("eastBoundLongitude",c,0)),d.ymax=parseFloat(p("northBoundLatitude",c,0))),i||c||(d=new a(-180,-90,180,90,new o({wkid:4326}))),n.minScale=f(e,"MaxScaleDenominator",0),n.maxScale=f(e,"MinScaleDenominator",0);var h=["1.0.0","1.1.0","1.1.1"].indexOf(t)>-1?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach((function(e){if("Name"===e.nodeName)n.name=e.textContent||"";else if("Title"===e.nodeName)n.title=e.textContent||"";else if("Abstract"===e.nodeName)n.description=e.textContent||"";else if("BoundingBox"===e.nodeName){var a=e.getAttribute(h);a&&0===a.indexOf("EPSG:")&&(0===(i=parseInt(a.substring(5),10))||isNaN(i)||d||(d="1.3.0"===t?y(e,i,l(i)):y(e,i)));var o=a&&a.indexOf(":");if(o&&o>-1){var i;0===(i=parseInt(a.substring(o+1,a.length),10))||isNaN(i)||(i=s[i]?s[i]:i);var p="1.3.0"===t?y(e,i,l(i)):y(e,i);n.fullExtents.push(p)}}else if(e.nodeName===h)e.textContent.split(" ").forEach((function(e){0===(e=e.indexOf(":")>-1?parseInt(e.split(":")[1],10):parseInt(e,10))||isNaN(e)||(s[e]&&(e=s[e]),-1===n.spatialReferences.indexOf(e)&&n.spatialReferences.push(e))}));else if("Style"!==e.nodeName||n.legendURL){if("Layer"===e.nodeName){var c=m(e,t,r);c&&(c.parentLayerId=n.id,n.sublayers||(n.sublayers=[]),n.sublayers.push(c))}}else{var f=u("LegendURL",e);if(f){var g=u("OnlineResource",f);g&&(n.legendURL=g.getAttribute("xlink:href"))}}})),n.extent=d&&d.toJSON(),n}t.parseCapabilities=function(e){if(!e)return null;var t={idCounter:-1};"string"==typeof e&&(e=(new DOMParser).parseFromString(e,"text/xml"));var n=e.documentElement;if("ServiceExceptionReport"===n.nodeName){var o=Array.prototype.slice.call(n.childNodes).map((function(e){return e.textContent})).join("\r\n");throw new r("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",o)}var i=u("Layer",n);if(!i)return null;var s,l,y,f,h="WMS_Capabilities"===n.nodeName||"WMT_MS_Capabilities"===n.nodeName?n.getAttribute("version"):"1.3.0",g=u("Service",n),b=p("Title",g,"")||p("Name",g,""),_=p("AccessConstraints",g,""),v=p("Abstract",g,""),x=parseInt(p("MaxWidth",g,5e3),10),w=parseInt(p("MaxHeight",g,5e3),10),E=u("Capability",n),S=d(n,"GetMap"),O=c(n,"GetMap"),N=m(i,h,t),P=0;if(Array.prototype.slice.call(E.childNodes).forEach((function(e){"Layer"===e.nodeName&&(0===P?s=e:1===P?(N.name&&(N.name="",N.sublayers.push(m(s,h,t))),N.sublayers.push(m(e,h,t))):N.sublayers.push(m(e,h,t)),P++)})),!N)return null;var R=N.fullExtents;if((l=N.sublayers)||(l=[]),0===l.length&&l.push(N),!(y=N.extent)){var I=new a(l[0].extent);N.extent=I.toJSON(),y=N.extent}if(!(f=N.spatialReferences).length&&l.length>0){var U=function(e){var t=[];return e.sublayers.forEach((function(e){!t.length&&e.spatialReferences.length&&(t=e.spatialReferences||U(e))})),t};l.forEach((function(e){f.length||(f=e.spatialReferences||U(e))}))}var L,M=c(n,"GetFeatureInfo");if(M){var j=d(n,"GetFeatureInfo");j.indexOf("text/html")>-1?L="text/html":j.indexOf("text/plain")>-1&&(L="text/plain")}if(!L){var A=function(e){e&&(e.queryable=!1,e.sublayers&&e.sublayers.forEach((function(e){A(e)})))};A(N)}var F=function e(t){var r=[];return t.forEach((function(t){r.push(t),t.sublayers&&t.sublayers.length&&(r=r.concat(e(t.sublayers)),delete t.sublayers)})),r}(l),q=N.minScale||0;return{copyright:_,description:v,extent:y,fullExtents:R,featureInfoFormat:L,featureInfoUrl:M,mapUrl:O,maxImageWidth:x,maxImageHeight:w,maxScale:N.maxScale||0,minScale:q,layers:F,spatialReferences:f,supportedImageFormatTypes:S,title:b,version:h}},t.coordsReversed=l,t.getPopupLayers=function(e){return e.length?e.filter((function(e){return e.popupEnabled&&e.name&&e.queryable})).map((function(e){return e.name})).join(","):""}}.apply(null,n))||(e.exports=a)},724:function(e,t,r){var n,a;n=[r.dj.c(e.i),t,r(117),r(158),r(167),r(151),r(612)],void 0===(a=function(e,t,r,n,a,o,i){var s={visible:"visibleSublayers"},l=[102100,3857,102113,900913],u=[3395,54004];return function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._layerHandles=new a,t.extent=null,t._scale=null,t.view=null,t}return r.__extends(t,e),Object.defineProperty(t.prototype,"layer",{set:function(e){var t=this;this._get("layer")!==e&&(this._set("layer",e),this._layerHandles&&(this._layerHandles.removeAll(),this._layerHandles=null),e&&(this._layerHandles||(this._layerHandles=new a),this._layerHandles.add([e.sublayers.on("change",(function(){return t.notifyChange("visibleSublayers")})),e.on("wms-sublayer-update",(function(e){return t.notifyChange(s[e.propertyName])}))])))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"layers",{get:function(){return this.visibleSublayers.filter((function(e){return e.name})).map((function(e){return e.name})).join(",")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return null!=this._scale?this._scale:this.view&&this.view.scale||0},set:function(e){this.view||(this._scale=e,this.notifyChange("scale"))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return(this._get("version")||0)+1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visibleSublayers",{get:function(){var e=this.layer,t=this.scale,r=e.sublayers,n=[],a=function(e){var r=e.minScale,o=e.maxScale,i=e.sublayers;e.visible&&(0===t||(0===r||t<=r)&&(0===o||t>=o))&&(n.unshift(e),i&&i.forEach(a))};return r&&r.forEach(a),n},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wkid",{get:function(){var e=this.extent,t=this.layer.spatialReferences,r=e.spatialReference&&e.spatialReference.wkid;t&&-1===t.indexOf(r)&&e.spatialReference.latestWkid&&(r=e.spatialReference.latestWkid);var n=l.some((function(e){return e===r}));if(!t)return r;if(n){var a=[];t.forEach((function(e){l.indexOf(e)>-1&&a.push(e)})),a.length||t.forEach((function(e){u.indexOf(e)>-1&&a.push(e)})),r=a.length>0?a[0]:l[0]}return r},enumerable:!0,configurable:!0}),t.prototype.toJSON=function(){var e=this.extent,t=this.layer,n=this.layers,a=t.imageFormat,o=t.imageTransparency,s=t.spatialReferences,l=t.version,u=this.wkid;s&&-1===s.indexOf(u)&&e.spatialReference.latestWkid&&(u=e.spatialReference.latestWkid);var p=e.xmin,y=e.ymin,c=e.xmax,d=e.ymax,f={bbox:"1.3.0"===t.version&&i.coordsReversed(u)?y+","+p+","+d+","+c:p+","+y+","+c+","+d,format:a,request:"GetMap",service:"WMS",styles:"",transparent:o,version:l};return isNaN(u)||("1.3.0"===l?f.crs="EPSG:"+u:f.srs="EPSG:"+u),r.__assign(r.__assign({},f),{layers:n})},r.__decorate([o.property()],t.prototype,"extent",void 0),r.__decorate([o.property()],t.prototype,"layer",null),r.__decorate([o.property({readOnly:!0,dependsOn:["visibleSublayers"]})],t.prototype,"layers",null),r.__decorate([o.property({type:Number,dependsOn:["view.scale"]})],t.prototype,"scale",null),r.__decorate([o.property()],t.prototype,"view",void 0),r.__decorate([o.property({dependsOn:["layers","layer.imageTransparency"],readOnly:!0})],t.prototype,"version",null),r.__decorate([o.property({readOnly:!0,dependsOn:["layer.sublayers","scale"]})],t.prototype,"visibleSublayers",null),r.__decorate([o.property()],t.prototype,"wkid",null),r.__decorate([o.subclass("esri.layers.support.ExportWMSImageParameters")],t)}(n)}.apply(null,n))||(e.exports=a)},754:function(e,t,r){var n,a;n=[r.dj.c(e.i),t,r(117),r(100),r(174),r(297),r(165),r(169),r(487),r(167),r(166),r(118),r(152),r(225),r(153),r(172),r(151),r(619),r(184),r(170),r(491),r(178),r(208),r(244),r(240),r(298),r(265),r(324),r(233),r(724),r(2263),r(612)],void 0===(a=function(e,t,r,n,a,o,i,s,l,u,p,y,c,d,f,m,h,g,b,_,v,x,w,E,S,O,N,P,R,I,U,L){var M=new p.JSONMap({svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",bmp:"image/bmp"},{ignoreUnknown:!1});function j(e,t,r){var n=new Map;e.every((function(e){return null==e.id}))&&(e=y.clone(e)).forEach((function(e,t){return e.id=t}));for(var a=0,o=e;a<o.length;a++){var i=o[a];(c=new U).read(i,t),-1===(null==r?void 0:r.indexOf(c.name))&&(c.visible=!1),n.set(c.id,c)}for(var l=[],u=0,p=e;u<p.length;u++){i=p[u];var c=n.get(i.id);if(i.parentLayerId>=0){var d=n.get(i.parentLayerId);d.sublayers||(d.sublayers=new s),d.sublayers.unshift(c)}else l.unshift(c)}return l}return function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=e.apply(this,t)||this;return n._sublayersHandles=new u,n.allSublayers=new l({root:n,rootCollectionNames:["sublayers"],getChildrenFunction:function(e){return e.sublayers}}),n.customParameters=null,n.customLayerParameters=null,n.copyright=null,n.description=null,n.fullExtent=null,n.fullExtents=null,n.featureInfoFormat=null,n.featureInfoUrl=null,n.imageFormat=null,n.imageMaxHeight=2048,n.imageMaxWidth=2048,n.imageTransparency=!0,n.legendEnabled=!0,n.mapUrl=null,n.isReference=null,n.operationalLayerType="WMS",n.spatialReference=null,n.spatialReferences=null,n.sublayers=null,n.type="wms",n.url=null,n.version=null,n.watch("sublayers",(function(e,t){t&&(t.forEach((function(e){e.layer=null})),n._sublayersHandles.removeAll(),n._sublayersHandles=null),e&&(e.forEach((function(e){e.parent=n,e.layer=n})),n._sublayersHandles||(n._sublayersHandles=new u),n._sublayersHandles.add([e.on("after-add",(function(e){var t=e.item;t.parent=n,t.layer=n})),e.on("after-remove",(function(e){var t=e.item;t.parent=null,t.layer=null}))]))}),!0),n}return r.__extends(t,e),t.prototype.normalizeCtorArgs=function(e,t){return"string"==typeof e?r.__assign({url:e},t):e},t.prototype.load=function(e){var t=this,r=c.isSome(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).then((function(){return t._fetchService(r)}),(function(){return t._fetchService(r)}))),f.resolve(this)},t.prototype.readFullExtentFromItemOrMap=function(e,t){var r=t.extent;return new b({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]})},t.prototype.writeFullExtent=function(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]},t.prototype.readImageFormat=function(e,t){var r=t.supportedImageFormatTypes;return r&&r.indexOf("image/png")>-1?"image/png":r&&r[0]},t.prototype.readSpatialReferenceFromItemOrDocument=function(e,t){return new _(t.spatialReferences[0])},t.prototype.writeSpatialReferences=function(e,t){var r=this.spatialReference&&this.spatialReference.wkid;e&&r?(t.spatialReferences=e.filter((function(e){return e!==r})),t.spatialReferences.unshift(r)):t.spatialReferences=e},t.prototype.readSublayersFromItemOrMap=function(e,t,r){return j(t.layers,r,t.visibleLayers)},t.prototype.readSublayers=function(e,t,r){return j(t.layers,r)},t.prototype.writeSublayers=function(e,t,n,a){t.layers=[];var o=new Map,i=e.flatten((function(e){var t=e.sublayers;return t&&t.toArray()})).toArray();i.forEach((function(e){"number"==typeof e.parent.id&&(o.has(e.parent.id)?o.get(e.parent.id).push(e.id):o.set(e.parent.id,[e.id]))})),i.forEach((function(e){var n=r.__assign({sublayer:e},a),i=e.write({parentLayerId:"number"==typeof e.parent.id?e.parent.id:-1},n);if(o.has(e.id)&&(i.sublayerIds=o.get(e.id)),!e.sublayers&&e.name){var s=e.write({},n);delete s.id,t.layers.push(s)}})),t.visibleLayers=i.filter((function(e){return e.visible&&!e.sublayers})).map((function(e){return e.name}))},t.prototype.createExportImageParameters=function(e,t,r,n){var a=n&&n.pixelRatio||1,o=v.getScale({extent:e,width:t})*a;return this._exportWMSImageParameters=new I({layer:this,extent:e,scale:o}),this._exportWMSImageParameters.toJSON()},t.prototype.fetchImage=function(e,t,n,a){return r.__awaiter(this,void 0,void 0,(function(){var o,s,l,u;return r.__generator(this,(function(p){return o=this.mapUrl,(s=this.createExportImageParameters(e,t,n,a)).layers?(u={responseType:"image",query:this._mixCustomParameters(r.__assign({width:t,height:n},s)),signal:a&&a.signal},a&&a.timestamp&&(u.query=r.__assign({_ts:a.timestamp},u.query)),[2,i(o,u).then((function(e){return e.data}))]):((l=document.createElement("canvas")).width=t,l.height=n,[2,l])}))}))},t.prototype.fetchFeatureInfo=function(e,t,n,s,l){var u=this,p=L.getPopupLayers(this._exportWMSImageParameters.visibleSublayers);if(!this.featureInfoUrl||!p)return null;var y="1.3.0"===this.version?{I:s,J:l}:{x:s,y:l},c=r.__assign({query_layers:p,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:n},y),d=r.__assign(r.__assign({},this.createExportImageParameters(e,t,n)),c);return d=this._mixCustomParameters(d),i(this.featureInfoUrl,{query:d,responseType:"text"}).then((function(e){var t=u.featureInfoUrl;for(var r in t+=-1===t.indexOf("?")?"?":"",d)t+="?"===t.substring(t.length-1,t.length)?"":"&",t+=r+"="+d[r];var n=document.createElement("iframe");return n.src=t,n.frameBorder="0",n.marginHeight="0",n.marginWidth="0",n.innerHTML=e.data,n.style.width="100%",new a({sourceLayer:u,popupTemplate:new o({title:u.title,content:n})})}))},t.prototype.findSublayerById=function(e){return this.allSublayers.find((function(t){return t.id===e}))},t.prototype.supportsSpatialReference=function(e){return P.isWmsServer(this.url)||this.spatialReferences.some((function(t){var r=900913===t?_.WebMercator:new _({wkid:t});return x.equals(r,e)}))},t.prototype._fetchService=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t,a;return r.__generator(this,(function(o){switch(o.label){case 0:return this.resourceInfo?[3,2]:(this.parsedUrl.query&&this.parsedUrl.query.service&&(this.parsedUrl.query.SERVICE=this.parsedUrl.query.service,delete this.parsedUrl.query.service),this.parsedUrl.query&&this.parsedUrl.query.request&&(this.parsedUrl.query.REQUEST=this.parsedUrl.query.request,delete this.parsedUrl.query.request),[4,i(this.parsedUrl.path,{query:r.__assign(r.__assign({SERVICE:"WMS",REQUEST:"GetCapabilities"},this.parsedUrl.query),this.customParameters),responseType:"xml",signal:e})]);case 1:t=o.sent(),this.resourceInfo=L.parseCapabilities(t.data),o.label=2;case 2:return this.parsedUrl&&("https"!==(a=new m.Url(this.parsedUrl.path)).scheme||a.port&&"443"!==a.port||-1!==n.request.httpsDomains.indexOf(a.host)||n.request.httpsDomains.push(a.host)),this.read(this.resourceInfo,{origin:"service"}),[2]}}))}))},t.prototype._mixCustomParameters=function(e){if(!this.customLayerParameters&&!this.customParameters)return e;var t=r.__assign(r.__assign({},this.customParameters),this.customLayerParameters);for(var n in t)e[n.toLowerCase()]=t[n];return e},r.__decorate([h.property({readOnly:!0})],t.prototype,"allSublayers",void 0),r.__decorate([h.property({json:{type:Object,write:!0}})],t.prototype,"customParameters",void 0),r.__decorate([h.property({type:["show","hide","hide-children"]})],t.prototype,"listMode",void 0),r.__decorate([h.property({json:{type:Object,write:!0}})],t.prototype,"customLayerParameters",void 0),r.__decorate([h.property({type:String,json:{write:!0}})],t.prototype,"copyright",void 0),r.__decorate([h.property()],t.prototype,"description",void 0),r.__decorate([h.property({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{service:{read:{source:"extent"}}}}})],t.prototype,"fullExtent",void 0),r.__decorate([h.reader(["web-document","portal-item"],"fullExtent",["extent"])],t.prototype,"readFullExtentFromItemOrMap",null),r.__decorate([h.writer(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],t.prototype,"writeFullExtent",null),r.__decorate([h.property()],t.prototype,"fullExtents",void 0),r.__decorate([h.property({type:String,json:{write:{ignoreOrigin:!0}}})],t.prototype,"featureInfoFormat",void 0),r.__decorate([h.property({type:String,json:{write:{ignoreOrigin:!0}}})],t.prototype,"featureInfoUrl",void 0),r.__decorate([h.property({type:String,json:{origins:{"web-document":{default:"image/png",type:M.jsonValues,read:{reader:M.read,source:"format"},write:{writer:M.write,target:"format"}}}}})],t.prototype,"imageFormat",void 0),r.__decorate([h.reader("imageFormat",["supportedImageFormatTypes"])],t.prototype,"readImageFormat",null),r.__decorate([h.property({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],t.prototype,"imageMaxHeight",void 0),r.__decorate([h.property({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],t.prototype,"imageMaxWidth",void 0),r.__decorate([h.property()],t.prototype,"imageTransparency",void 0),r.__decorate([h.property(R.legendEnabled)],t.prototype,"legendEnabled",void 0),r.__decorate([h.property({type:String,json:{write:{ignoreOrigin:!0}}})],t.prototype,"mapUrl",void 0),r.__decorate([h.property({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:function(){return{enabled:!1}}}}})],t.prototype,"isReference",void 0),r.__decorate([h.property({type:["WMS"]})],t.prototype,"operationalLayerType",void 0),r.__decorate([h.property({type:_,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],t.prototype,"spatialReference",void 0),r.__decorate([h.reader(["web-document","portal-item"],"spatialReference",["spatialReferences"])],t.prototype,"readSpatialReferenceFromItemOrDocument",null),r.__decorate([h.property({type:[Number],json:{read:{source:"spatialReferences"},write:{ignoreOrigin:!0}}})],t.prototype,"spatialReferences",void 0),r.__decorate([h.writer(["web-document","portal-item"],"spatialReferences")],t.prototype,"writeSpatialReferences",null),r.__decorate([h.property({type:s.ofType(U),json:{write:{target:"layers",overridePolicy:function(e,t,r){if(function(e,t){return e.some((function(e){for(var r in e)if(g.willPropertyWrite(e,r,null,t))return!0;return!1}))}(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],t.prototype,"sublayers",void 0),r.__decorate([h.reader(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],t.prototype,"readSublayersFromItemOrMap",null),r.__decorate([h.reader("service","sublayers",["layers"])],t.prototype,"readSublayers",null),r.__decorate([h.writer("sublayers",{layers:{type:[U]},visibleLayers:{type:[String]}})],t.prototype,"writeSublayers",null),r.__decorate([h.property({json:{read:!1},readOnly:!0,value:"wms"})],t.prototype,"type",void 0),r.__decorate([h.property(R.url)],t.prototype,"url",void 0),r.__decorate([h.property({type:String,json:{write:{ignoreOrigin:!0}}})],t.prototype,"version",void 0),r.__decorate([h.subclass("esri.layers.WMSLayer")],t)}(O.RefreshableLayer(N.ScaleRangeLayer(E.OperationalLayer(S.PortalLayer(d.MultiOriginJSONMixin(w))))))}.apply(null,n))||(e.exports=a)}}]);
  //# sourceMappingURL=112.js.map