text: "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7049,3172],{25929:(e,t,r)=>{r.d(t,{f:()=>o,i:()=>d,p:()=>h,r:()=>a,t:()=>i,w:()=>l});var n=r(70586),s=r(17452);function o(e,t){const r=t&&t.url&&t.url.path;if(e&&r&&(e=(0,s.hF)(e,r,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const r=(0,s.PF)(e,t.portalItem.itemUrl);c.test(r)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(r).path)}return p(e,t&&t.portal)}function i(e,t,r=0){if(!e)return e;!(0,s.YP)(e)&&t&&t.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let n=(0,s.hF)(e);if(t){const r=t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.rootPath||t.url&&t.url.path;if(r){const o=p(r,t.portal);n=(0,s.PF)(p(n,t.portal),o,o),n!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(n)}}return n=function(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?(0,s.Ie)(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}(n,t&&t.portal),(0,s.YP)(n)&&(n=(0,s.Fv)(n)),null!=t&&t.resources&&null!=t&&t.portalItem&&!(0,s.YP)(n)&&!(0,s.HK)(n)&&0===r&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(n)}),n}function a(e,t,r){return o(e,r)}function l(e,t,r,n){const s=i(e,n);void 0!==s&&(t[r]=s)}const u=/\/items\/([^\/]+)\/resources\//,c=/^\.\/resources\//;function d(e){const t=(0,n.pC)(e)?e.match(u):null;return(0,n.pC)(t)?t[1]:null}function p(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const r=`${t.urlKey}.${t.customBaseUrl}`;return(0,s.D6)(s.Gd,`${s.Gd.scheme}://${r}`)?(0,s.Ie)(e,t.portalHostname,r):(0,s.Ie)(e,r,t.portalHostname)}var h=Object.freeze({__proto__:null,fromJSON:o,toJSON:i,read:a,write:l,itemIdFromResourceUrl:d})},32448:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(43697),s=r(18855),o=r(50758),i=r(52525);class a{constructor(){this._emitter=new a.EventEmitter(this)}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}}!function(e){class t{constructor(e=null){this.target=e,this._listenersMap=null}clear(){this._listenersMap&&this._listenersMap.clear(),this._listenersMap=null}emit(e,t){const r=this._listenersMap&&this._listenersMap.get(e);if(!r)return!1;const n=this.target||this;return[...r].forEach((e=>{e.call(n,t)})),r.length>0}on(e,t){if(Array.isArray(e)){const r=e.map((e=>this.on(e,t)));return(0,o.AL)(r)}if(e.indexOf(",")>-1)throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap||(this._listenersMap=new Map);const r=this._listenersMap.get(e)||[];return r.push(t),this._listenersMap.set(e,r),{remove:()=>{const r=this._listenersMap&&this._listenersMap.get(e)||[],n=r.indexOf(t);n>=0&&r.splice(n,1)}}}once(e,t){const r=this.on(e,(e=>{r.remove(),t.call(null,e)}));return r}hasEventListener(e){const t=this._listenersMap&&this._listenersMap.get(e);return null!=t&&t.length>0}}e.EventEmitter=t,e.EventedMixin=e=>{let r=class extends e{constructor(){super(...arguments),this._emitter=new t}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};return r=(0,n._)([(0,i.j)("esri.core.Evented")],r),r};let r=class extends s.Z{constructor(){super(...arguments),this._emitter=new a.EventEmitter(this)}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};r=(0,n._)([(0,i.j)("esri.core.Evented")],r),e.EventedAccessor=r}(a||(a={}));var l=a},16453:(e,t,r)=>{r.d(t,{R:()=>v,w:()=>w});var n=r(43697),s=r(18855),o=r(70586),i=r(22974),a=r(31263);class l{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(a.kk),this._values=new Map}clone(e){const t=new l,r=this._originStores[0];r&&r.forEach(((e,r)=>{t.set(r,(0,i.d9)(e),0)}));for(let r=2;r<a.kk;r++){const n=this._originStores[r];n&&n.forEach(((n,s)=>{e&&e.has(s)||t.set(s,(0,i.d9)(n),r)}))}return t}get(e,t){const r=void 0===t?this._values:this._originStores[t];return r?r.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,r=6){let n=this._originStores[r];if(n||(n=new Map,this._originStores[r]=n),n.set(e,t),!this._values.has(e)||(0,o.j0)(this._propertyOriginMap.get(e))<=r){const n=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,r),n!==t}return!1}delete(e,t=6){const r=this._originStores[t];if(!r)return;const n=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const t=this._originStores[r];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,r);break}}}return n}has(e,t){const r=void 0===t?this._values:this._originStores[t];return!!r&&r.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const r=this._originStores[t],n=r&&r.get(e),s=this._values.get(e);return this._values.set(e,n),this._propertyOriginMap.set(e,t),s!==n}originOf(e){return this._propertyOriginMap.get(e)||0}forEach(e){this._values.forEach(e)}}var u=r(50549),c=r(1153),d=r(52525);const p=e=>{let t=class extends e{constructor(...e){super(...e);const t=(0,o.j0)((0,c.vw)(this)),r=t.metadatas,n=t.store,s=new l;t.store=s,n.keys().forEach((e=>{s.set(e,n.get(e),0)})),Object.keys(r).forEach((e=>{t.internalGet(e)&&s.set(e,t.internalGet(e),0)}))}read(e,t){(0,u.ij)(this,e,t)}getAtOrigin(e,t){const r=h(this),n=(0,a.M9)(t);if("string"==typeof e)return r.get(e,n);const s={};return e.forEach((e=>{s[e]=r.get(e,n)})),s}originOf(e){return(0,a.x3)(this.originIdOf(e))}originIdOf(e){return h(this).originOf(e)}revert(e,t){const r=h(this),n=(0,a.M9)(t),s=(0,c.vw)(this);let o;o="string"==typeof e?"*"===e?r.keys(n):[e]:e,o.forEach((e=>{s.invalidate(e),r.revert(e,n),s.commit(e)}))}};return t=(0,n._)([(0,d.j)("esri.core.ReadOnlyMultiOriginJSONSupport")],t),t};function h(e){return(0,c.vw)(e).store}let m=class extends(p(s.Z)){};m=(0,n._)([(0,d.j)("esri.core.ReadOnlyMultiOriginJSONSupport")],m);var f=r(76169);const y=e=>{let t=class extends e{constructor(...e){super(...e)}clear(e,t="user"){return g(this).delete(e,(0,a.M9)(t))}write(e={},t){return(0,f.cW)(this,e=e||{},t),e}setAtOrigin(e,t,r){(0,c.vw)(this).setAtOrigin(e,t,(0,a.M9)(r))}removeOrigin(e){const t=g(this),r=(0,a.M9)(e),n=t.keys(r);for(const e of n)t.originOf(e)===r&&t.set(e,t.get(e,r),6)}updateOrigin(e,t){const r=g(this),n=(0,a.M9)(t),s=this.get(e);for(let t=n+1;t<a.kk;++t)r.delete(e,t);r.set(e,s,n)}toJSON(e){return this.write({},e)}};return t=(0,n._)([(0,d.j)("esri.core.WriteableMultiOriginJSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function g(e){return(0,c.vw)(e).store}const v=e=>{let t=class extends(y(p(e))){constructor(...e){super(...e)}};return t=(0,n._)([(0,d.j)("esri.core.MultiOriginJSONSupport")],t),t};let w=class extends(v(s.Z)){};w=(0,n._)([(0,d.j)("esri.core.MultiOriginJSONSupport")],w)},66577:(e,t,r)=>{r.d(t,{qM:()=>c});var n=r(75215),s=r(6570),o=r(9361),i=r(65091),a=r(13473),l=r(17332),u=r(58901);r(82971),r(86973),r(33955);const c={base:o.Z,key:"type",typeMap:{extent:s.Z,multipoint:i.Z,point:a.Z,polyline:u.Z,polygon:l.Z}};(0,n.N7)(c)},33955:(e,t,r)=>{r.d(t,{im:()=>f,q9:()=>v,Ji:()=>y,YX:()=>c,aW:()=>d,wp:()=>p,oU:()=>m,l9:()=>h});var n=r(70586),s=r(6570),o=r(9361),i=r(65091),a=r(13473),l=r(17332),u=r(58901);function c(e){return void 0!==e.xmin&&void 0!==e.ymin&&void 0!==e.xmax&&void 0!==e.ymax}function d(e){return void 0!==e.points}function p(e){return void 0!==e.x&&void 0!==e.y}function h(e){return void 0!==e.paths}function m(e){return void 0!==e.rings}function f(e){return(0,n.Wi)(e)?null:e instanceof o.Z?e:p(e)?a.Z.fromJSON(e):h(e)?u.Z.fromJSON(e):m(e)?l.Z.fromJSON(e):d(e)?i.Z.fromJSON(e):c(e)?s.Z.fromJSON(e):null}function y(e){return e?p(e)?"esriGeometryPoint":h(e)?"esriGeometryPolyline":m(e)?"esriGeometryPolygon":c(e)?"esriGeometryEnvelope":d(e)?"esriGeometryMultipoint":null:null}const g={esriGeometryPoint:a.Z,esriGeometryPolyline:u.Z,esriGeometryPolygon:l.Z,esriGeometryEnvelope:s.Z,esriGeometryMultipoint:i.Z};function v(e){return e&&g[e]||null}},86973:(e,t,r)=>{r.d(t,{Mk:()=>s,P$:()=>o});var n=r(35454);const s=(0,n.wY)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),o=(0,n.wY)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"})},40330:(e,t,r)=>{r.d(t,{Dp:()=>u,id:()=>a,qh:()=>l,i8:()=>o,Nv:()=>i});var n=r(80442),s=r(17452);const o="4.21",i={request(e,t){var n;const s=null==(n=e.options)?void 0:n.responseType;return r.e(3172).then(r.bind(r,3172)).then((({default:r})=>{const n=e.options||{};return n.responseType="native"===s||"native-request-init"===s?"native-request-init":"array-buffer",n.signal=null==t?void 0:t.signal,r(e.url,n)})).then((e=>{const t={data:e.data,ssl:e.ssl};return"native-request-init"===e.requestOptions.responseType?(delete t.data.signal,t):{result:t,transferList:[t.data]}}))}};let a;function l(e){a=e}function u(e){const t=a&&a.findCredential(e);return t&&t.token?(0,s.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")||((0,n.Z)("edge")||(0,n.Z)("trident"))&&console.warn("Deprecated browser - see http://esriurl.com/oldbrowser")},29600:(e,t,r)=>{r.d(t,{Z:()=>b});var n=r(43697),s=r(68773),o=(r(66577),r(3172)),i=r(20102),a=r(32448),l=r(10699),u=r(83379),c=r(92604),d=r(95330),p=r(17452),h=r(5600),m=(r(80442),r(75215),r(52525)),f=r(6570),y=r(82971);let g=0;const v=c.Z.getLogger("esri.layers.Layer");let w=class extends(a.Z.EventedMixin((0,l.I)(u.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.Z(-180,-90,180,90,y.Z.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=y.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e,n=await r.e(3529).then(r.bind(r,63529));try{return await n.fromUrl(t)}catch(e){throw v.error("#fromArcGISServerUrl({ url: '"+t.url+"'})","Failed to create layer from arcgis server url",e),e}}static async fromPortalItem(e){const t="portalItem"in e?e:{portalItem:e},n=await r.e(8008).then(r.bind(r,28008));try{return await n.fromItem(t)}catch(e){const r=t&&t.portalItem,n=r&&r.id||"unset",o=r&&r.portal&&r.portal.url||s.Z.portalUrl;throw v.error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+n+"')",e),e}}initialize(){this.when().catch((e=>{var t,r;(0,d.D_)(e)||c.Z.getLogger(this.declaredClass).error("#load()",`Failed to load layer (title: '${null!=(t=this.title)?t:"no title"}', id: '${null!=(r=this.id)?r:"no id"}')`,{error:e})}))}destroy(){if(this.parent){const e=this,t=this.parent;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"baseLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){const e=this.url;return e?(0,p.mN)(e):null}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,o.default)(e,{query:{f:"json"},responseType:"json"})).data;throw new i.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,n._)([(0,h.Cb)({type:String})],w.prototype,"attributionDataUrl",void 0),(0,n._)([(0,h.Cb)({type:f.Z})],w.prototype,"fullExtent",void 0),(0,n._)([(0,h.Cb)({readOnly:!0})],w.prototype,"hasAttributionData",null),(0,n._)([(0,h.Cb)({type:String})],w.prototype,"id",void 0),(0,n._)([(0,h.Cb)({type:Boolean,nonNullable:!0})],w.prototype,"legendEnabled",void 0),(0,n._)([(0,h.Cb)({type:["show","hide","hide-children"]})],w.prototype,"listMode",void 0),(0,n._)([(0,h.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],w.prototype,"opacity",void 0),(0,n._)([(0,h.Cb)()],w.prototype,"parent",void 0),(0,n._)([(0,h.Cb)({readOnly:!0})],w.prototype,"parsedUrl",null),(0,n._)([(0,h.Cb)({type:Boolean})],w.prototype,"popupEnabled",void 0),(0,n._)([(0,h.Cb)({type:Boolean})],w.prototype,"attributionVisible",void 0),(0,n._)([(0,h.Cb)({type:y.Z})],w.prototype,"spatialReference",void 0),(0,n._)([(0,h.Cb)({type:String})],w.prototype,"title",void 0),(0,n._)([(0,h.Cb)({type:String,readOnly:!0,json:{read:!1}})],w.prototype,"type",void 0),(0,n._)([(0,h.Cb)()],w.prototype,"url",void 0),(0,n._)([(0,h.Cb)({type:Boolean,nonNullable:!0})],w.prototype,"visible",void 0),w=(0,n._)([(0,m.j)("esri.layers.Layer")],w);var b=w},3172:(e,t,r)=>{r.r(t),r.d(t,{default:()=>m});var n=r(68773),s=r(40330),o=r(20102),i=r(16358),a=r(80442),l=r(22974),u=r(70586),c=r(95330),d=r(17452),p=r(71058),h=r(85958);async function m(e,t){const l=(0,d.HK)(e),h=(0,d.jc)(e);h||l||(e=(0,d.Fv)(e));const v={url:e,requestOptions:{...(0,u.Wg)(t)}};let w=(0,d.oh)(e);if(w){const e=await async function(e,t){if(null!=e.responseData)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let r,n;try{n=await e.before(t)}catch(e){r=E("request:interceptor",e,t)}if((n instanceof Error||n instanceof o.Z)&&(r=E("request:interceptor",n,t)),r)throw e.error&&e.error(r),r;return n}}(w,v);if(null!=e)return{data:e,getHeader:_,requestOptions:v.requestOptions,url:v.url};w.after||w.error||(w=null)}if(e=v.url,"image"===(t=v.requestOptions).responseType){if((0,a.Z)("host-webworker")||(0,a.Z)("host-node"))throw E("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),v)}else if(l)throw E("request:invalid-parameters",new Error("Data URLs are not supported for responseType = "+t.responseType),v);if("head"===t.method){if(t.body)throw E("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),v);if(l||h)throw E("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),v)}if(await async function(){(0,a.Z)("host-webworker")?f||(f=await r.e(9884).then(r.bind(r,29884))):m._abortableFetch||(m._abortableFetch=i.Z.fetch.bind(i.Z))}(),f)return f.execute(e,t);const b=(0,c.yi)();(0,c.fu)(t,(()=>b.abort()));const O={controller:b,credential:null,credentialToken:null,fetchOptions:null,hasToken:!1,interceptor:w,params:v,redoRequest:!1,useIdentity:y.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},S=await async function(e){var t,r;let o,a;await async function(e){const t=e.params.url,r=e.params.requestOptions,o=e.controller.signal,a=r.body;let l=null,u=null,d=null;if(g&&"HTMLFormElement"in i.Z&&(a instanceof FormData?l=a:a instanceof HTMLFormElement&&(u=a,l=new FormData(u))),"string"==typeof a&&(d=a),e.fetchOptions={cache:r.cacheBust&&!m._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:r.headers||{},method:"head"===r.method?"HEAD":"GET",mode:"cors",redirect:"follow",signal:o},(l||d)&&(e.fetchOptions.body=l||d),"anonymous"===r.authMode&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(t)||r.query&&r.query.token||l&&l.get&&l.get("token")||u&&u.elements.token),!e.hasToken&&n.Z.apiKey&&(0,p.r)(t)&&(r.query||(r.query={}),r.query.token=n.Z.apiKey,e.hasToken=!0),e.useIdentity&&!e.hasToken&&!e.credentialToken&&!q(t)&&!(0,c.Hc)(o)){let n;"immediate"===r.authMode?(await k(),n=await s.id.getCredential(t,{signal:o}),e.credential=n):"no-prompt"===r.authMode?(await k(),n=await s.id.getCredential(t,{prompt:!1,signal:o}).catch((()=>{})),e.credential=n):s.id&&(n=s.id.findCredential(t)),n&&(e.credentialToken=n.token,e.useSSL=!!n.ssl)}}(e);try{do{[o,a]=await M(e)}while(!await Z(e,o,a))}catch(t){const r=E("request:server",t,e.params,o);throw r.details.ssl=e.useSSL,e.interceptor&&e.interceptor.error&&e.interceptor.error(r),r}const l=e.params.url;if(/\/sharing\/rest\/(accounts|portals)\/self/i.test(l)&&!e.hasToken&&!e.credentialToken&&null!=(t=a)&&null!=(r=t.user)&&r.username&&!(0,d.kl)(l)){const e=(0,d.P$)(l,!0);e&&y.trustedServers.push(e)}const u=e.credential;if(u&&s.id){const e=s.id.findServerInfo(u.server);let t=e&&e.owningSystemUrl;if(t){t=t.replace(/\/?$/,"/sharing");const e=s.id.findCredential(t,u.userId);e&&-1===s.id._getIdenticalSvcIdx(t,e)&&e.resources.unshift(t)}}return{data:a,getHeader:o?e=>o.headers.get(e):_,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}(O);return w&&w.after&&w.after(S),S}let f;const y=n.Z.request,g="FormData"in i.Z,v=[499,498,403,401],w=["COM_0056","COM_0057","SB_0008"],b=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],_=()=>null,O=Symbol();function S(e){const t=(0,d.P$)(e);return!t||t.endsWith(".arcgis.com")||m._corsServers.includes(t)||(0,d.kl)(t)}function E(e,t,r,n){let s="Error";const i={url:r.url,requestOptions:r.requestOptions,getHeader:_,ssl:!1};if(t instanceof o.Z)return t.details?(t.details=(0,l.d9)(t.details),t.details.url=r.url,t.details.requestOptions=r.requestOptions):t.details=i,t;if(t){const e=n&&(e=>n.headers.get(e)),r=n&&n.status,o=t.message;o&&(s=o),e&&(i.getHeader=e),i.httpStatus=(null!=t.httpCode?t.httpCode:t.code)||r||0,i.subCode=t.subcode,i.messageCode=t.messageCode,"string"==typeof t.details?i.messages=[t.details]:i.messages=t.details,i.raw=O in t?t[O]:t}return(0,c.D_)(t)?(0,c.zE)():new o.Z(e,s,i)}async function k(){s.id||await Promise.all([r.e(7824),r.e(8778),r.e(9625)]).then(r.bind(r,79339))}function q(e){return b.some((t=>t.test(e)))}async function M(e){let t=e.params.url;const r=e.params.requestOptions,n=e.fetchOptions,o=(0,d.jc)(t)||(0,d.HK)(t),i=r.responseType||"json",l=o?0:null!=r.timeout?r.timeout:y.timeout;let u=!1;if(!o){e.useSSL&&(t=(0,d.hO)(t)),r.cacheBust&&"default"===n.cache&&(t=(0,d.ZN)(t,"request.preventCache",Date.now()));let o={...r.query};e.credentialToken&&(o.token=e.credentialToken);let i=(0,d.B7)(o);(0,a.Z)("esri-url-encodes-apostrophe")&&(i=i.replace(/'/g,"%27"));const l=t.length+1+i.length;let c;u="delete"===r.method||"post"===r.method||"put"===r.method||!!r.body||l>y.maxUrlLength;const p=r.useProxy||!!(0,d.ed)(t);if(p){const e=(0,d.b7)(t);c=e.path,!u&&c.length+1+l>y.maxUrlLength&&(u=!0),e.query&&(o={...e.query,...o})}if("HEAD"===n.method&&(u||p)){if(u){if(l>y.maxUrlLength)throw E("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params);throw E("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params)}if(p)throw E("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(u?(n.method="delete"===r.method?"DELETE":"put"===r.method?"PUT":"POST",r.body?t=(0,d.fl)(t,o):(n.body=(0,d.B7)(o),n.headers["Content-Type"]="application/x-www-form-urlencoded")):t=(0,d.fl)(t,o),p&&(e.useProxy=!0,t=`${c}?${t}`),o.token&&g&&n.body instanceof FormData){const e=n.body;e.set?e.set("token",o.token):e.append("token",o.token)}if(r.hasOwnProperty("withCredentials"))e.withCredentials=r.withCredentials;else if(!(0,d.D6)(t,d.Gd))if((0,d.kl)(t))e.withCredentials=!0;else if(s.id){const r=s.id.findServerInfo(t);r&&r.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(n.credentials="include")}let p,h,f=0,v=!1;l>0&&(f=setTimeout((()=>{v=!0,e.controller.abort()}),l));try{if("native-request-init"===r.responseType)h=n,h.url=t;else if("image"!==r.responseType||"default"!==n.cache||"GET"!==n.method||u||function(e){if(e)for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0;return!1}(r.headers)||!o&&!e.useProxy&&y.proxyUrl&&!S(t)){if(p=await m._abortableFetch(t,n),e.useProxy||function(e){const t=(0,d.P$)(e);t&&!m._corsServers.includes(t)&&m._corsServers.push(t)}(t),"native"===r.responseType)h=p;else if("HEAD"!==n.method)if(p.ok){switch(i){case"array-buffer":h=await p.arrayBuffer();break;case"blob":case"image":h=await p.blob();break;default:h=await p.text()}if(f&&(clearTimeout(f),f=0),"json"===i||"xml"===i||"document"===i)if(h)switch(i){case"json":h=JSON.parse(h);break;case"xml":h=x(h,"application/xml");break;case"document":h=x(h,"text/html")}else h=null;if(h){if("array-buffer"===i||"blob"===i){const e=p.headers.get("Content-Type");if(/application\/json|text\/plain/i.test(e)&&h["blob"===i?"size":"byteLength"]<=750)try{const e=await new Response(h).json();e.error&&(h=e)}catch{}}"image"===i&&h instanceof Blob&&(h=await C(URL.createObjectURL(h),e,!0))}}else h=await p.text()}else h=await C(t,e)}catch(n){if("AbortError"===n.name){if(v)throw new Error("Timeout exceeded");throw(0,c.zE)("Request canceled")}if(!(!p&&n instanceof TypeError&&y.proxyUrl)||r.body||"delete"===r.method||"head"===r.method||"post"===r.method||"put"===r.method||e.useProxy||S(t))throw n;e.redoRequest=!0,(0,d.tD)({proxyUrl:y.proxyUrl,urlPrefix:(0,d.P$)(t)})}finally{f&&clearTimeout(f)}return[p,h]}function x(e,t){let r;try{r=(new DOMParser).parseFromString(e,t)}catch{}if(!r||r.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return r}async function Z(e,t,r){if(e.redoRequest)return e.redoRequest=!1,!1;const n=e.params.requestOptions;if(!t||"native"===n.responseType||"native-request-init"===n.responseType)return!0;let o,i,a,l;if(!t.ok)throw o=new Error(`Unable to load ${t.url} status: ${t.status}`),o[O]=r,o;null!=r&&r.error&&(o=r.error),o&&(i=Number(o.code),a=o.hasOwnProperty("subcode")?Number(o.subcode):null,l=o.messageCode,l=l&&l.toUpperCase());const u=n.authMode;if(403===i&&(4===a||o.message&&o.message.toLowerCase().indexOf("ssl")>-1&&-1===o.message.toLowerCase().indexOf("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===i)&&-1!==v.indexOf(i)&&!q(e.params.url)&&(403!==i||-1===w.indexOf(l)&&(null==a||2===a&&e.credentialToken))){await k();try{const t=await s.id.getCredential(e.params.url,{error:E("request:server",o,e.params),prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=t,e.credentialToken=t.token,e.useSSL=e.useSSL||t.ssl,!1}catch(t){if("no-prompt"===u)return e.credential=null,e.credentialToken=null,!1;o=t}}if(o)throw o;return!0}function C(e,t,r=!1){const n=t.controller.signal,s=new Image;return t.withCredentials?s.crossOrigin="use-credentials":s.crossOrigin="anonymous",s.alt="",s.src=e,(0,h.f)(s,e,r,n)}m._abortableFetch=null,m._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"]},71058:(e,t,r)=>{r.d(t,{r:()=>o});var n=r(17452);const s=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function o(e){const t=(0,n.P$)(e,!0);return t&&t.endsWith(".arcgis.com")&&!s.includes(t)&&!e.endsWith("/sharing/rest/generateToken")}},85958:(e,t,r)=>{r.d(t,{f:()=>i});var n=r(80442),s=r(70586),o=r(95330);function i(e,t,r=!1,i){return new Promise(((l,u)=>{if((0,o.Hc)(i))return void u(a());let c=()=>{h(),u(new Error(`Unable to load ${t}`))},d=()=>{const t=e;h(),l(t)},p=()=>{if(!e)return;const t=e;h(),t.src="",u(a())};const h=()=>{(0,n.Z)("esri-image-decode")||(e.removeEventListener("error",c),e.removeEventListener("load",d)),c=null,d=null,e=null,(0,s.pC)(i)&&i.removeEventListener("abort",p),p=null,r&&URL.revokeObjectURL(t)};(0,s.pC)(i)&&i.addEventListener("abort",p),(0,n.Z)("esri-image-decode")?e.decode().then(d,c):(e.addEventListener("error",c),e.addEventListener("load",d))}))}function a(){try{return new DOMException("Aborted","AbortError")}catch{const e=new Error;return e.name="AbortError",e}}}}]);