@arcgis/core 4.34.0-next.10 → 4.34.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/2ddb776434a93b8d9e63.js +1 -0
- package/assets/esri/core/workers/chunks/3ae2e9f469020f777d9f.js +1 -0
- package/assets/esri/core/workers/chunks/3cbc498388fb1931a9f8.js +1 -0
- package/assets/esri/core/workers/chunks/{81614beb51405d064a6c.js → 462cc6966d060be59c7c.js} +1 -1
- package/assets/esri/core/workers/chunks/{3a74654fa539f78ceb86.js → 467cacb501b0417bb4df.js} +1 -1
- package/assets/esri/core/workers/chunks/a1a42b0d7cd47b647f8a.js +1 -0
- package/assets/esri/core/workers/chunks/{3025e420e13e2bc8c0a1.js → a622ed3f182648ab3ff6.js} +1 -1
- package/assets/esri/core/workers/chunks/ec922f876e1465d36045.js +1 -0
- package/config.js +1 -1
- package/interfaces.d.ts +12 -0
- package/intl/date.js +1 -1
- package/intl/number.js +1 -1
- package/kernel.js +1 -1
- package/package.json +1 -1
- package/renderers/RasterStretchRenderer.js +1 -1
- package/support/revision.js +1 -1
- package/assets/esri/core/workers/chunks/074498a4d685223ec058.js +0 -1
- package/assets/esri/core/workers/chunks/15b3eb60f86954783fab.js +0 -1
- package/assets/esri/core/workers/chunks/9fe62638dc7dce466612.js +0 -1
- package/assets/esri/core/workers/chunks/adf6982e2d8102669cdf.js +0 -1
- package/assets/esri/core/workers/chunks/cc37bfa72c34bc2ef993.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9926],{18047:(e,t,n)=>{n.d(t,{ZV:()=>u,yx:()=>l});var r=n(73444);const i={ar:"ar-u-nu-latn",bs:"hr",nn:"no-NN"};let a=new WeakMap,o={};function l(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function u(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||o;if(!a.has(t)){const n=(0,r.JK)(),o=(0,r.ZS)(n)?.language,l=o&&i[o]||n;a.set(t,new Intl.NumberFormat(l,e))}return a.get(t)}(t).format(e)}(0,r.Ml)((()=>{a=new WeakMap,o={}})),new Map},29926:(e,t,n)=>{n.r(t),n.d(t,{applyTextFormattingHTML:()=>K,createFieldInfoMap:()=>J,findRelatedLayer:()=>oe,findUtilityNetwork:()=>le,fixTokens:()=>j,formatAttributes:()=>Y,formatEditInfo:()=>V,formatValueToFieldInfo:()=>G,getAllFieldInfos:()=>P,getFieldInfo:()=>Q,getFieldInfoLabel:()=>A,getFixedFieldName:()=>k,getFixedFieldNames:()=>q,getSourceLayer:()=>N,graphicCallback:()=>x,htmlEntities:()=>_,isAssociatedFeatureSupportedLayer:()=>O,isExpressionField:()=>Z,isFeatureSupportedLayer:()=>S,isGraphicForRelatableFeatureSupportedLayer:()=>z,isRelatableFeatureSupportedLayer:()=>$,isRelatableLayer:()=>D,isRelatedField:()=>ee,preLayerQueryCallback:()=>ie,preRequestCallback:()=>ae,querySourceLayer:()=>B,queryUpdatedFeature:()=>X,shouldOpenInNewTab:()=>C,substituteAttributes:()=>v,substituteFieldsInLinksAndAttributes:()=>M});var r=n(44208),i=n(53966),a=n(799),o=n(97770),l=n(18047),u=n(30524),s=n(77548),f=n(4560),c=n(43668),d=n(56400);const p=()=>i.A.getLogger("esri.widgets.Feature.support.featureUtils"),y=/href=(""|'')/gi,m=/(\{([^{\r\n]+)\})/g,b=/'/g,g=/^\s*expression\//i,h=/(\n)/gi,I=/[\u00A0-\u9999<>&]/gim,F=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,w=/^(?:mailto:|tel:)/,T="relationships/",L=(0,o.J2)("short-date-short-time");function N(e){if(null!=e)return(e.sourceLayer||e.layer)??void 0}async function x({type:e,value:t,event:n}){try{return"function"==typeof t?t(n):await t}catch(r){return void p().error("error",`An error occurred when calling the "${e}" function`,{error:r,graphic:n.graphic,value:t})}}function C(e=""){if(e)return!w.test(e.trim().toLowerCase())}function Z(e){return!!e&&g.test(e)}function A(e,t){const n=function(e,t){if(!t||!Z(t)||!e)return;const n=t.replace(g,"").toLowerCase();return e.find((({name:e})=>e.toLowerCase()===n))}(t,e?.fieldName);return n?n.title||null:e?e.label||e.fieldName:null}function k(e,t){const n=R(t,e);return n?n.name:e}function q(e,t){return e&&e.map((e=>k(e,t)))}function R(e,t){return e&&"function"==typeof e.getField&&t?e.getField(t)??null:null}function E(e){return`${e}`.trim()}function M({attributes:e,globalAttributes:t,layer:n,text:r,expressionAttributes:i,fieldInfoMap:a}){return r?v({formattedAttributes:t,template:U(r,{...t,...i,...e},n),fieldInfoMap:a}):""}function v({formattedAttributes:e,template:t,fieldInfoMap:n}){return E(function(e){return e.replaceAll(y,"")}((0,a.HC)((0,a.HC)(t,(e=>function(e,t){const n=t.get(e.toLowerCase());return`{${n?.fieldName||e}}`}(e,n))),e)))}function j(e,t){return e.replaceAll(m,((e,n,r)=>{const i=R(t,r);return i?`{${i.name}}`:n}))}function U(e,t,n){const r=j(e,n);return r?r.replaceAll(F,((e,n,r)=>function(e,t,n){const r=(t=E(t))&&"{"!==t[0];return(0,a.HC)(e,function(e,t=!1){const n={...e};return Object.keys(n).forEach((e=>function(e,t,n=!1){const r=t[e];if("string"==typeof r){const i="%27",a=(n?encodeURIComponent(r):r).replaceAll(b,i);t[e]=a}}(e,n,t))),n}(n,r||!1))}(e,n||r,t))):r}function S(e){return null!=e&&"object"==typeof e&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&("feature"===e.type||"scene"===e.type||"subtype-group"===e.type||"subtype-sublayer"===e.type||"sublayer"===e.type)&&"when"in e}function D(e){return null!=e&&"object"==typeof e&&"createQuery"in e&&"queryFeatureCount"in e&&"queryObjectIds"in e&&"queryRelatedFeatures"in e&&"queryRelatedFeaturesCount"in e&&"relationships"in e}function $(e){return S(e)&&D(e)}function O(e){return!(!(e&&"object"==typeof e&&"createQuery"in e&&"getField"in e&&"queryFeatureCount"in e&&"queryFeatures"in e&&"queryObjectIds"in e&&"capabilities"in e&&"fields"in e&&"fieldsIndex"in e&&"type"in e)||"feature"!==e.type&&"subtype-group"!==e.type&&"subtype-sublayer"!==e.type&&"sublayer"!==e.type||!("when"in e))&&("subtype-sublayer"===e.type&&"parent"in e&&e.parent&&"object"==typeof e.parent?"globalIdField"in e.parent:"globalIdField"in e)}function z(e){return!!e&&"object"==typeof e&&"sourceLayer"in e&&$(e.sourceLayer)}function G(e,t){const{fieldInfos:n,fieldName:r,preventPlacesFormatting:i,layer:a,timeZone:o}=t,s=Q(n,r),c=R(a,r);if(s&&!(0,u.JL)(r)){const t=c?.type,n=s.format?.dateFormat;if("date"===t||"date-only"===t||"time-only"===t||"timestamp-offset"===t||n)return(0,f.i0)(e,{format:n,fieldType:t,timeZoneOptions:{layerTimeZone:a&&"preferredTimeZone"in a?a.preferredTimeZone:null,viewTimeZone:o,datesInUnknownTimezone:!(!a||!("datesInUnknownTimezone"in a)||!a.datesInUnknownTimezone)}})}const d=s?.format;return"string"==typeof e&&(0,u.JL)(r)&&d?function(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?H(e,",",", ",t):e.includes(";")?H(e,";","; ",t):e.includes(" ")?H(e," "," ",t):(0,l.ZV)(Number(e),(0,l.yx)(t))}(e,d):"string"==typeof(e=function(e,t){if("string"==typeof e&&t&&null==t.dateFormat&&(null!=t.places||null!=t.digitSeparator)){const t=Number(e);if(!isNaN(t))return t}return e}(e,d))||null==e||null==d?K(e):(0,l.ZV)(e,i?{...(0,l.yx)(d),minimumFractionDigits:0,maximumFractionDigits:20}:(0,l.yx)(d))}function H(e,t,n,r){return e.trim().split(t).map((e=>(0,l.ZV)(Number(e),(0,l.yx)(r)))).join(n)}function Q(e,t){if(e?.length&&t)return e.find((e=>e.fieldName?.toLowerCase()===t.toLowerCase()))}function V(e,t,n,r){const{creatorField:i,creationDateField:a,editorField:l,editDateField:u}=e;if(!t)return;const s=(0,d.hv)(r&&"preferredTimeZone"in r?r.preferredTimeZone:null,!(!r||!("datesInUnknownTimezone"in r)||!r.datesInUnknownTimezone),n,L,"date"),f={...L,...s},c=t[u];if("number"==typeof c){const e=t[l];return{type:"edit",date:(0,o.Yq)(c,f),user:e}}const p=t[a];if("number"==typeof p){const e=t[i];return{type:"create",date:(0,o.Yq)(p,f),user:e}}return null}function J(e,t){const n=new Map;if(!e)return n;for(const r of e){if(!r.fieldName)continue;const e=k(r.fieldName,t);r.fieldName=e,n.set(e.toLowerCase(),r)}return n}function P(e){const t=[];if(!e)return t;const{fieldInfos:n,content:r}=e;return n&&t.push(...n),r&&Array.isArray(r)?(r.forEach((e=>{if("fields"===e.type){const n=e?.fieldInfos;n&&t.push(...n)}})),t):t}function _(e){return e.replaceAll(I,(e=>`&#${e.charCodeAt(0)};`))}function K(e){return"string"==typeof e?e.replaceAll(h,'<br class="esri-text-new-line" />'):e}function W(e){const{value:t,fieldName:n,fieldInfos:i,fieldInfoMap:a,layer:o,graphic:l,timeZone:s}=e;if(null==t)return"";const c=function({fieldName:e,value:t,graphic:n,layer:i}){if(ee(e))return null;if(!i||"function"!=typeof i.getFieldDomain)return null;const a=n&&i.getFieldDomain(e,{feature:n,excludeImpliedDomains:(0,r.A)("esri-widget-legacy-field-domain-calculation")});return a&&"coded-value"===a.type?a.getName(t):null}({fieldName:n,value:t,graphic:l,layer:o});if(c)return c;const d=function({fieldName:e,graphic:t,layer:n}){if(ee(e))return null;if(!n||"function"!=typeof n.getFeatureType)return null;const{typeIdField:r}=n;if(!r||e!==r)return null;const i=n.getFeatureType(t);return i?i.name:null}({fieldName:n,graphic:l,layer:o});if(d)return d;if(a.get(n.toLowerCase()))return G(t,{fieldInfos:i||Array.from(a.values()),fieldName:n,layer:o,timeZone:s});const p=o?.fieldsIndex?.get(n);return p&&((0,f.fs)(p)||(0,u.OH)(p))?(0,f.i0)(t,{fieldType:p.type,timeZoneOptions:{layerTimeZone:o&&"preferredTimeZone"in o?o.preferredTimeZone:null,viewTimeZone:s,datesInUnknownTimezone:!(!o||!("datesInUnknownTimezone"in o)||!o.datesInUnknownTimezone)}}):K(t)}function Y({fieldInfos:e,attributes:t,layer:n,graphic:r,fieldInfoMap:i,relatedInfos:a,timeZone:o}){const l={};return a?.forEach((t=>function({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a}){e&&t&&(t.relatedFeatures?.forEach((o=>te({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a}))),t.relatedStatsFeatures?.forEach((o=>te({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a}))))}({attributes:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:e,layer:n,timeZone:o}))),t&&Object.keys(t).forEach((a=>{const u=t[a];l[a]=W({fieldName:a,fieldInfos:e,fieldInfoMap:i,layer:n,value:u,graphic:r,timeZone:o})})),l}async function B(e,t){const{layer:n,graphic:r,outFields:i,objectIds:a,returnGeometry:o,spatialReference:l}=e,u=a[0];if("number"!=typeof u&&"string"!=typeof u){const e="Could not query required fields for the specified feature. The feature's ID is invalid.",t={layer:n,graphic:r,objectId:u,requiredFields:i};return p().warn(e,t),null}if(!(0,s.BR)(n)?.operations?.supportsQuery){const e="The specified layer cannot be queried. The following fields will not be available.",t={layer:n,graphic:r,requiredFields:i,returnGeometry:o};return p().warn(e,t),null}const f=n.createQuery();return f.objectIds=a,f.outFields=i?.length?i:[n.objectIdField],f.returnGeometry=!!o,f.returnZ=!!o,f.returnM=!!o,f.outSpatialReference=l,(await n.queryFeatures(f,t)).features[0]}async function X({graphic:e,popupTemplate:t,layer:n,spatialReference:r},i){if(!n||!t)return;if("function"==typeof n.load&&await n.load(i),!e.attributes)return;const a=n.objectIdField,o=e.attributes[a];if(null==o)return;const l=[o],s=await t.getRequiredFields(n.fieldsIndex),f=(0,u.Kl)(e,s),d=f?[]:s.includes(a)?s:[...s,a],p=t.returnGeometry||await async function(e){if(!e.expressionInfos?.length)return!1;const t=await(0,c.l)(),{arcadeUtils:{hasGeometryFunctions:n}}=t;return n(e)}(t);if(f&&!p)return;const y=await B({layer:n,graphic:e,outFields:d,objectIds:l,returnGeometry:p,spatialReference:r},i);y&&(y.geometry&&(e.geometry=y.geometry),y.attributes&&(e.attributes={...e.attributes,...y.attributes}))}function ee(e=""){return!!e&&e.includes(T)}function te({attributes:e,graphic:t,relatedInfo:n,fieldInfos:r,fieldInfoMap:i,layer:a,timeZone:o}){e&&t&&n&&Object.keys(t.attributes).forEach((l=>{const u=function(e){return e?`${T}${e.layerId}/${e.fieldName}`:""}({layerId:n.relation.id.toString(),fieldName:l}),s=t.attributes[l];e[u]=W({fieldName:u,fieldInfos:r,fieldInfoMap:i,layer:a,value:s,graphic:t,timeZone:o})}))}const ne=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},re=({layer:e,method:t,query:n,definitionExpression:r})=>{if(!e.capabilities?.query?.supportsCacheHint||"attachments"===t)return;const i=null!=n.where?n.where:null,a=null!=n.geometry?n.geometry:null;ne(r)||ne(i)||"extent"===a?.type||"tile"===n.resultType||(n.cacheHint=!0)},ie=({query:e,layer:t,method:n})=>{re({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},ae=({queryPayload:e,layer:t,method:n})=>{re({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function oe(e,t,n){return e&&t&&n?"sublayer"===t.type?se({layers:t.layer?.allSublayers,map:e,relatedLayer:t,relationship:n})||se({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:n}):se({layers:e.allLayers,map:e,relatedLayer:t,relationship:n})||se({layers:e.allTables,map:e,relatedLayer:t,relationship:n}):null}function le(e,t){return e&&"utilityNetworks"in e&&t?e.utilityNetworks?.find((e=>e.isUtilityLayer(t))):null}function ue(e,t){return e?.allTables.find((e=>"feature"===e.type&&e.layerId===t.id&&e.url===t.layer?.url))}function se({map:e,relationship:t,relationship:{relatedTableId:n},relatedLayer:r,layers:i}){if(!i)return null;for(const a of i){if("map-image"===a.type){const n=se({layers:a.sublayers,map:e,relatedLayer:r,relationship:t})||se({layers:a.subtables,map:e,relatedLayer:r,relationship:t});if(n)return n;continue}if(!$(a))continue;if("sublayer"===r.type){if(a!==r&&a.id===n)return a.isTable?ue(e,a):a;continue}const i="scene"===r.type&&r.associatedLayer?r.associatedLayer.url:r.url;if(!i)return null;if("sublayer"!==a.type){if(a!==r&&a.url===i&&a.layerId===n)return a}else if(a!==r&&a.layer?.url===i&&a.id===n)return a.isTable?ue(e,a):a}return null}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3747],{13069:(e,t,r)=>{r.d(t,{AG:()=>a,lk:()=>i,vD:()=>o,yS:()=>n});const s="randomUUID"in crypto;function i(){if(s)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function n(){return`{${i().toUpperCase()}}`}function o(){return`{${i()}}`}function a(e){const t=e.toUpperCase();return"{"!==e[0]?`{${t}}`:t}},16494:(e,t,r)=>{r.d(t,{W5:()=>o});var s=r(37330);const i=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce(((e,t)=>(e[t]=[],e)),{}),n=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],o=new s.I({whiteList:i,onTagAttr:(e,t,r)=>{const s=`${t}="${r}"`;if(n.includes(t))return s},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0)},18047:(e,t,r)=>{r.d(t,{ZV:()=>l,yx:()=>a});var s=r(73444);const i={ar:"ar-u-nu-latn",bs:"hr",nn:"no-NN"};let n=new WeakMap,o={};function a(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function l(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||o;if(!n.has(t)){const r=(0,s.JK)(),o=(0,s.ZS)(r)?.language,a=o&&i[o]||r;n.set(t,new Intl.NumberFormat(a,e))}return n.get(t)}(t).format(e)}(0,s.Ml)((()=>{n=new WeakMap,o={}})),new Map},36708:(e,t,r)=>{r.d(t,{C_:()=>u,OH:()=>_,Vh:()=>m,on:()=>d,pc:()=>g,wB:()=>l,z7:()=>h});var s=r(37955),i=r(36563),n=r(97768),o=r(74887),a=r(14012);function l(e,t,r={}){return c(e,t,r,p)}function h(e,t,r={}){return c(e,t,r,f)}function c(e,t,r={},s){let i=null;const o=r.once?(e,r)=>{s(e)&&((0,n.xt)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,a.Cn)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return i}function d(e,t,r,o={}){let a=null,h=null,c=null;function d(){a&&h&&(h.remove(),o.onListenerRemove?.(a),a=null,h=null)}function u(e){o.once&&o.once&&(0,n.xt)(c),r(e)}const p=l(e,((e,r)=>{d(),(0,s.wb)(e)&&(a=e,h=(0,s.on)(e,t,u),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return c=(0,i.hA)((()=>{p.remove(),d()})),c}function u(e,t){return function(e,t,r){if((0,o.G4)(r))return Promise.reject((0,o.NK)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,n.xt)(a)}return new Promise(((s,n)=>{a=(0,i.vE)([(0,o.u7)(r,(()=>{l(),n((0,o.NK)())})),c(e,(e=>{l(),s(e)}),{sync:!1,once:!0},t??p)])}))}(e,f,t)}function p(e){return!0}function f(e){return!!e}r(80559);const _={sync:!0},m={initial:!0},g={sync:!0,initial:!0}},47566:(e,t,r)=>{r(97770),r(18047),r(71754),r(73444);var s=r(10838),i=r(78888),n=r(49186);async function o(e){if(null!=l.fetchBundleAsset)return l.fetchBundleAsset(e);const t=await(0,i.A)(e,{responseType:"text"});return JSON.parse(t.data)}class a{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let s;s="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=s,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)\\/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,i){const a=t.exec(r);if(!a)throw new n.A("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",h=a[2],c=(0,s.xO)(i),d=`${l}${h}.json`,u=c?`${l}${h}_${c}.json`:d;let p;try{p=await o(e(u))}catch(t){if(u===d)throw new n.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{p=await o(e(d))}catch(e){throw new n.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return p}(this.getAssetUrl,this.matcher,e,t)}}const l={};var h,c=r(2741);(0,s.ao)((h={pattern:"esri/",location:c.s},new a(h)))},61893:(e,t,r)=>{r.d(t,{A:()=>d});var s,i,n=r(90237),o=r(69622),a=r(74887),l=r(40608);(i=s||(s={}))[i.PENDING=0]="PENDING",i[i.RESOLVED=1]="RESOLVED",i[i.REJECTED=2]="REJECTED";class h{constructor(){this._resolver=(0,a.Tw)(),this._status=s.PENDING,this._resolvingPromises=[],this._resolver.promise.then((()=>{this._status=s.RESOLVED,this._cleanUp()}),(()=>{this._status=s.REJECTED,this._cleanUp()})),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===s.RESOLVED}isRejected(){return this._status===s.REJECTED}isFulfilled(){return this._status!==s.PENDING}abort(){this._resolver.reject((0,a.NK)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=(0,a.Tw)(),t=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(t);r.then((()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()}),(e=>{this.isFulfilled()||this._allPromise!==r||(0,a.zf)(e)||this._resolver.reject(e)})),e.resolve()}}const c=e=>{let t=class extends e{constructor(...e){super(...e),this._promiseProps=new h,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return this._promiseProps.promise.then((()=>this)).then(e,t)}catch(e){return this.when(null,e)}addResolvingPromise(e){e&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in e?e.when():e)}};return t=(0,n._)([(0,l.$)("esri.core.Promise")],t),t};let d=class extends(c(o.A)){};d=(0,n._)([(0,l.$)("esri.core.Promise")],d),function(e){e.EsriPromiseMixin=c}(d||(d={}))},65529:(e,t,r)=>{r.d(t,{A:()=>l});var s=r(90237),i=r(69622),n=r(36563),o=r(40608);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?.clear(),this._listenersMap=null}destroy(){this.clear()}emit(e,t){let r=this._listenersMap?.get(e);if(!r)return!1;const s=this._target||this;let i=!1;for(const e of r.slice()){const r="deref"in e?e.deref():e;r?r?.call(s,t):i=!0}return i&&(r=r.filter((e=>!("deref"in e)||null!=e.deref())),this._listenersMap.set(e,r)),r.length>0}on(e,t){if(Array.isArray(e)){const r=e.map((e=>this.on(e,t)));return(0,n.vE)(r)}if(e.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap??=new Map;const r=this._listenersMap.get(e)||[];return r.push(t),this._listenersMap.set(e,r),(0,n.hA)((()=>{const r=this._listenersMap?.get(e),s=r?.indexOf(t)??-1;s>=0&&r.splice(s,1)}))}once(e,t){const r=this.on(e,(e=>{r.remove();const s="deref"in t?t.deref():t;s?.call(null,e)}));return r}hasEventListener(e){const t=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,s._)([(0,o.$)("esri.core.Evented")],r),r};let r=class extends i.A{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,s._)([(0,o.$)("esri.core.Evented.EventedAccessor")],r),e.EventedAccessor=r}(a||(a={}));const l=a},71754:(e,t,r)=>{r.d(t,{V:()=>h});var s=r(53966),i=r(93637),n=r(799),o=r(97770),a=r(18047);const l=()=>s.A.getLogger("esri.intl.substitute");function h(e,t,r={}){const{format:s={}}=r;return(0,n.HC)(e,(e=>function(e,t,r){let s,n;const o=e.indexOf(":");if(-1===o?s=e.trim():(s=e.slice(0,o).trim(),n=e.slice(o+1).trim()),!s)return"";const a=(0,i.wc)(s,t);if(null==a)return"";const l=(n?r?.[n]:null)??r?.[s];return l?c(a,l):n?d(a,n):u(a)}(e,t,s)))}function c(e,t){switch(t.type){case"date":return(0,o.Yq)(e,t.intlOptions);case"number":return(0,a.ZV)(e,t.intlOptions);default:return l().warn("missing format descriptor for key {key}"),u(e)}}function d(e,t){switch(t.toLowerCase()){case"dateformat":return(0,o.Yq)(e);case"numberformat":return(0,a.ZV)(e);default:return l().warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,o.Yq)(e):/^numberformat/i.test(t)?(0,a.ZV)(e):u(e)}}function u(e){switch(typeof e){case"string":return e;case"number":return(0,a.ZV)(e);case"boolean":return""+e;default:return e instanceof Date?(0,o.Yq)(e):""}}},73747:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ct});var s=r(70333),i=r(90237),n=r(92602),o=r(78888),a=r(49186),l=r(65529),h=r(37955),c=r(4718),d=r(93637),u=r(74887),p=r(84952),f=r(10107),_=(r(44208),r(53966)),m=r(40608);r(47566),r(87811);var g=r(97768),v=r(61893),w=r(36708),y=r(13069),S=r(79901),I=r(62788),A=r(71429),k=r(16494);const U="http://www.w3.org/",P=`${U}2000/svg`,b=`${U}1999/xlink`;let x=[],T=(e,t)=>{let r={};return Object.keys(e).forEach((t=>{r[t]=e[t]})),t&&Object.keys(t).forEach((e=>{r[e]=t[e]})),r},R=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),O=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},C=(e,t,r)=>{if(""!==t.vnodeSelector)for(let s=r;s<e.length;s++)if(R(e[s],t))return s;return-1},E=(e,t,r,s)=>{let i=e[t];if(""===i.vnodeSelector)return;let n=i.properties;if(!(n?void 0===n.key?n.bind:n.key:void 0))for(let n=0;n<e.length;n++)if(n!==t){let t=e[n];if(R(t,i))throw new Error(`${r.vnodeSelector} had a ${i.vnodeSelector} child ${"added"===s?s:"removed"}, but there is now more than one. You must add unique key properties to make them distinguishable.`)}},M=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},N=[],D=!1,j=e=>{(e.children||[]).forEach(j),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},L=()=>{D=!1,N.forEach(j),N.length=0},q=e=>{N.push(e),D||(D=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(L,{timeout:16}):setTimeout(L,16))},$=e=>{let t=e.domNode;if(e.properties){let r=e.properties.exitAnimation;if(r){t.style.pointerEvents="none";let s=()=>{t.parentNode&&(t.parentNode.removeChild(t),q(e))};return void r(t,s,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),q(e))},Z=(e,t,r)=>{if(!t)return;let s=r.eventHandlerInterceptor,i=Object.keys(t),n=i.length;for(let o=0;o<n;o++){let n=i[o],a=t[n];if("className"===n)throw new Error('Property "className" is not supported, use "class".');if("class"===n)z(e,a,!0);else if("classes"===n){let t=Object.keys(a),r=t.length;for(let s=0;s<r;s++){let r=t[s];a[r]&&e.classList.add(r)}}else if("styles"===n){let t=Object.keys(a),s=t.length;for(let i=0;i<s;i++){let s=t[i],n=a[s];n&&(O(n),r.styleApplyer(e,s,n))}}else if("key"!==n&&null!=a){let i=typeof a;"function"===i?(0===n.lastIndexOf("on",0)&&(s&&(a=s(n,a,e,t)),"oninput"===n&&function(){let e=a;a=function(t){e.apply(this,[t]),t.target["oninput-value"]=t.target.value}}()),e[n]=a):r.namespace===P?"href"===n?e.setAttributeNS(b,n,a):e.setAttribute(n,a):"string"===i&&"value"!==n?"innerHTML"===n?e[n]=k.W5.sanitize(a):V(e)&&n in e?e[n]=a:e.setAttribute(n,a):e[n]=a}}};function V(e){if(!(e instanceof Element&&e.tagName.includes("-")))return!1;const t=window.customElements.get(e.tagName.toLowerCase());return!!t&&e instanceof t}let F,B=(e,t,r)=>{((e,t,r)=>{if(t)for(let s of t)H(s,e,void 0,r)})(e,t.children,r),t.text&&(e.textContent=t.text),Z(e,t.properties,r),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,r,t.vnodeSelector,t.properties,t.children])},H=(e,t,r,s)=>{let i,n=0,o=e.vnodeSelector,a=t.ownerDocument;if(""===o)i=e.domNode=a.createTextNode(e.text),void 0!==r?t.insertBefore(i,r):t.appendChild(i);else{for(let l=0;l<=o.length;++l){let h=o.charAt(l);if(l===o.length||"."===h||"#"===h){let h=o.charAt(n-1),c=o.slice(n,l);"."===h?i.classList.add(c):"#"===h?i.id=c:("svg"===c&&(s=T(s,{namespace:P})),void 0!==s.namespace?i=e.domNode=a.createElementNS(s.namespace,c):(i=e.domNode=e.domNode||a.createElement(c),"input"===c&&e.properties&&void 0!==e.properties.type&&i.setAttribute("type",e.properties.type)),void 0!==r?t.insertBefore(i,r):i.parentNode!==t&&t.appendChild(i)),n=l+1}}B(i,e,s)}},z=(e,t,r)=>{t&&t.split(" ").forEach((t=>{t&&e.classList.toggle(t,r)}))},W=(e,t,r,s)=>{if(!r)return;let i=!1,n=Object.keys(r),o=n.length;for(let a=0;a<o;a++){let o=n[a],l=r[o],h=t[o];if("class"===o)h!==l&&(z(e,h,!1),z(e,l,!0));else if("classes"===o){let t=e.classList,r=Object.keys(l),s=r.length;for(let e=0;e<s;e++){let s=r[e],n=!!l[s];n!==!!h[s]&&(i=!0,n?t.add(s):t.remove(s))}}else if("styles"===o){let t=Object.keys(l),r=t.length;for(let n=0;n<r;n++){let r=t[n],o=l[r];o!==h[r]&&(i=!0,o?(O(o),s.styleApplyer(e,r,o)):s.styleApplyer(e,r,""))}}else if(l||"string"!=typeof h||(l=""),"value"!==o||V(e)){if(l!==h){let t=typeof l;"function"===t&&s.eventHandlerInterceptor||(s.namespace===P?"href"===o?e.setAttributeNS(b,o,l):e.setAttribute(o,l):"string"===t?"innerHTML"===o?e[o]=k.W5.sanitize(l):"role"===o&&""===l?e.removeAttribute(o):V(e)&&o in e?e[o]=l:e.setAttribute(o,l):e[o]!==l&&(e[o]=l),i=!0)}}else{let t=e[o];t!==l&&(e["oninput-value"]?t===e["oninput-value"]:l!==h)&&(e[o]=l,e["oninput-value"]=void 0),l!==h&&(i=!0)}}return i},J=(e,t,r,s,i)=>{if(r===s)return!1;s=s||x;let n,o=(r=r||x).length,a=s.length,l=0,h=0,c=!1;for(;h<a;){let a=l<o?r[l]:void 0,d=s[h];if(void 0!==a&&R(a,d))c=F(a,d,i)||c,l++;else{let a=C(r,d,l+1);if(a>=0){for(n=l;n<a;n++)$(r[n]),E(r,n,e,"removed");c=F(r[a],d,i)||c,l=a+1}else H(d,t,l<o?r[l].domNode:void 0,i),M(d),E(s,h,e,"added")}h++}if(o>l)for(n=l;n<o;n++)$(r[n]),E(r,n,e,"removed");return c};F=(e,t,r)=>{let s=e.domNode,i=!1;if(e===t)return!1;let n=!1;if(""===t.vnodeSelector){if(t.text!==e.text){let e=s.ownerDocument.createTextNode(t.text);return s.parentNode.replaceChild(e,s),t.domNode=e,i=!0,i}t.domNode=s}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(r=T(r,{namespace:P})),e.text!==t.text&&(n=!0,void 0===t.text?s.removeChild(s.firstChild):s.textContent=t.text),t.domNode=s,n=J(t,s,e.children,t.children,r)||n,n=W(s,e.properties,t.properties,r)||n,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[s,r,t.vnodeSelector,t.properties,t.children]);return n&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(s,t.properties,e.properties),i};let G=(e,t)=>({getLastRender:()=>e,update:r=>{if(e.vnodeSelector!==r.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let s=e;e=r,F(s,r,t)},domNode:e.domNode});const X={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}};let Y,K=e=>T(X,e),Q=(e,t,r)=>(r=K(r),H(t,e,void 0,r),G(t,r)),ee=(e,t,r)=>(r=K(r),H(t,e.parentNode,e,r),G(t,r)),te=(e,t,r)=>(r=K(r),t.domNode=e,B(e,t,r),G(t,r)),re=(e,t,r)=>(r=K(r),H(t,e.parentNode,e,r),e.parentNode.removeChild(e),G(t,r));Y=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];const se={handleInterceptedEvent:(e,t,r,s)=>(e.scheduleRender(),t.properties[`on${s.type}`].apply(t.properties.bind||r,[s]))},ie={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}},ne=(e,t,r=!1)=>{let s=e;return t.forEach(((e,i)=>{const n=s?.children?((e,t)=>e.find(t))(s.children,(t=>t.domNode===e)):void 0;r&&!n&&i!==t.length-1||(s=n)})),s};var oe=r(14813),ae=r(2741);let le;le="components/assets";var he=r(36563);const ce=Symbol("widget"),de=Symbol("widget-test-data"),ue=[],pe={},fe=new WeakMap;function _e(e,t){let r=t.children;if(r?.length)for(let t=0;t<r.length;++t)r[t]=_e(e,r[t]);else r=ue;const s=t.vnodeSelector;if(we(s)){const i=t.properties||pe,n=i.key||s,o={key:n,afterCreate:me,afterUpdate:ge,afterRemoved:ve,parentWidget:e,widgetConstructor:s,widgetProperties:{...i,key:n,children:r}};return{vnodeSelector:s.vnodeSelector,properties:o,children:void 0,text:void 0,domNode:null}}return t}function me(e,t,r,{parentWidget:s,widgetConstructor:i,widgetProperties:n}){const o=new i(n);o.container=e,fe.set(e,o),o.afterCreate?.(o,e),s.addHandles((0,he.hA)((()=>ve(e)))),queueMicrotask((()=>{o[de].projector.renderNow()}))}function ge(e,t,r,{widgetProperties:s}){const i=fe.get(e);i&&(i.set(s),i.afterUpdate?.(i,e))}function ve(e){const t=fe.get(e);t&&(t.afterRemoved?.(t,e),t.destroy(),fe.delete(e))}function we(e){return"function"==typeof e&&e[ce]}const ye=new Set;new Map;const Se=new Map;function Ie(){Se.clear()}function Ae(e){Se.delete(e)}var ke=r(98291),Ue=r(11932);function Pe(...e){const t=ke.A.acquire();for(let r=0;r<e.length;r++){const s=e[r],i=typeof s;if("string"===i)t.push(s);else if(Array.isArray(s))t.push.apply(t,s);else if("object"===i)for(const e in s)s[e]&&t.push(e)}const r=t.join(" ");return ke.A.release(t),r}(()=>{const e=new Map;new ResizeObserver((t=>{Ie();for(const r of t)e.get(r.target)?.(r)}))})();var be,xe=r(10838),Te=r(73444);let Re=0;function Oe(e,t){const r=Object.prototype.hasOwnProperty;for(const s in t)r.call(t,s)&&r.call(e,s)&&(null!=e[s]&&null!=t[s]&&"object"==typeof e[s]&&"object"==typeof t[s]?Oe(e[s],t[s]):e[s]=t[s]);return e}const Ce=(e=>{let t;const r={...se,...e},s=(n=r,{...ie,...n}),i=s.performanceLogger;var n;let o,a=!0,l=!1;const h=[],c=[],d=(e,n,o)=>{let a;s.eventHandlerInterceptor=(e,s,n,o)=>function(e){let s;i("domEvent",e);const n=((e,t)=>{const r=[];for(;e&&e!==t;)r.push(e),e=e.parentNode;return r})(e.currentTarget,a.domNode),o=n.some((e=>customElements.get(e?.tagName?.toLowerCase())));if(e.eventPhase!==Event.CAPTURING_PHASE&&o){const t=e.composedPath(),r=t.slice(t.indexOf(e.currentTarget),t.indexOf(a.domNode)).reverse();s=ne(a.getLastRender(),r,!0)}else n.reverse(),s=ne(a.getLastRender(),n);let l;return s&&(l=r.handleInterceptedEvent(t,s,this,e)),i("domEventProcessed",e),l},r.postProcessProjectionOptions?.(s);const l=o();a=e(n,l,s),s.eventHandlerInterceptor=void 0,h.push(a),c.push(o),r.afterFirstVNodeRendered&&r.afterFirstVNodeRendered(a,l)};let u=()=>{if(o=void 0,a){a=!1,i("renderStart",void 0);for(let e=0;e<h.length;e++){const t=c[e]();i("rendered",void 0);try{h[e].update(t)}catch(e){console.error(e)}i("patched",void 0)}i("renderDone",void 0),a=!0}};return r.modifyDoRenderImplementation&&(u=r.modifyDoRenderImplementation(u,h,c)),t={renderNow:u,scheduleRender:()=>{o||l||(o=requestAnimationFrame(u))},stop:()=>{o&&(cancelAnimationFrame(o),o=void 0),l=!0},resume:()=>{l=!1,a=!0,t.scheduleRender()},append:(e,t)=>{d(Q,e,t)},insertBefore:(e,t)=>{d(ee,e,t)},merge:(e,t)=>{d(te,e,t)},replace:(e,t)=>{d(re,e,t)},detach:e=>{for(let t=0;t<c.length;t++)if(c[t]===e)return c.splice(t,1),h.splice(t,1)[0];throw new Error("renderFunction was not found")}},t})({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,s,i,n)=>{const o=t?.(e,s,i,n),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in i)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>o?.call(i,e);i.addEventListener(t,r,a);const s=()=>i.removeEventListener(t,r,a),l=n.afterRemoved;n.afterRemoved=e=>{l?.(e),s()}}return o}},handleInterceptedEvent(e,t,r,s){const{eventPhase:i,type:n}=s,o=i===Event.CAPTURING_PHASE;let a=`on${n}${o?"capture":""}`;const l=t.properties;(l&&a in l||(a=`on${n[0].toUpperCase()}${n.slice(1)}${o?"Capture":""}`,l&&a in l))&&(Ie(),e.scheduleRender(),l[a].call(l.bind||r,s))}});let Ee=!1,Me=class extends(v.A.EsriPromiseMixin(l.A.EventedAccessor)){static{this[be]=!0}constructor(e,t){super(e,t),this._attached=!1,this._projector=Ce,this._readyForTrueRender=!1,this.key=this,this.autoRenderingEnabled=!0,this._loadLocale=(0,u.sg)((async()=>{if(this._messageBundleProps?.length){const e=await Promise.allSettled(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{if(this.destroyed)return;let r=await(0,xe.ud)(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=Oe((0,c.o8)(r),this.uiStrings)),this[t]=r})));if(this.destroyed)return;for(const t of e)"rejected"===t.status&&_.A.getLogger(this).error("widget-intl:locale-error",this.declaredClass,t.reason)}await this.loadLocale()})),this.addHandles((0,he.hA)()),oe.qu||(0,oe.Qu)((0,p.s2)((0,ae.s)("components/assets")));const r="esri-widget-uid-"+(0,y.lk)(),s=this.render.bind(this);this._trackingTarget=new A.r((()=>{this.autoRenderingEnabled&&this.scheduleRender()}));const i=()=>({vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}),n=()=>{if(!this._readyForTrueRender||this.destroyed)return null;const e=s()??i(),t=e.properties??={};if(t.key??=r,we(e.vnodeSelector)){if(!this.visible)return i()}else this.visible?t.styles||(t.styles={}):(t.class="",t.styles={display:"none"}),t.styles.display??="";let n=0;return e.children?.forEach((e=>{we(e.vnodeSelector)||(e.properties??={},e.properties.key??=`${this.id}--${n++}`)})),_e(this,e)};this.render=()=>{if(Ee)return n();let e=function(e){return Se.get(e)}(this)??null;if(e)return e;this._trackingTarget.clear(),Ee=!0;try{e=(0,I.a)(this._trackingTarget,n)}catch(e){throw _.A.getLogger(this).error(e),e}finally{Ee=!1}return e&&function(e,t){Se.set(e,t)}(this,e),e};const o=this.beforeFirstRender();o?this._resourcesFetch=o.then((()=>{this._readyForTrueRender=!0,this._postInitialize()})):(this._resourcesFetch=Promise.resolve().then((()=>{this._postInitialize()})),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),function(e){ye.add(e),e.finally((()=>ye.delete(e)))}(this._resourcesFetch)}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){const e=this.loadDependencies();return this._messageBundleProps?.length||e?Promise.all([e,this._loadLocale()]).then((()=>{})).catch(u.jH):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||((0,g.pR)(this._trackingTarget),(0,g.pR)(this.viewModel),this._detach(this.container),this._set("container",null),this._emitter.clear(),this.render=()=>null,this._projector=null,Ae(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return"string"==typeof(t=e)?document.getElementById(t):t??null;var t}get domNode(){return this.container}set domNode(e){this.container=e}get icon(){return null}set icon(e){this._overrideIfSome("icon",e)}get id(){return this._get("id")||this.container?.id||Date.now().toString(16)+"-widget-"+Re++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(be=ce,de)](){return{projector:this._projector}}static{this.vnodeSelector="div"}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(Ae(this),this._projector.scheduleRender())}classes(...e){return Pe.apply(this,e)}renderNow(){Ae(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this.addHandles((0,w.wB)((()=>this.viewModel),((e,t)=>{t&&this.removeHandles("delegated-events"),e&&(0,h.wb)(e)&&this.addHandles(this._delegatedEventNames.map((t=>(0,h.on)(e,t,(e=>{this.emit(t,e)})))),"delegated-events")}),w.pc)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(u.jH),this.scheduleRender()};this.addHandles([(0,Te.oQ)(e),(0,w.wB)((()=>this.uiStrings),e)]),this.addHandles((0,w.z7)((()=>this.container),(e=>{this.destroyed||this._attach(e)}),{initial:!0,once:!0}))}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){this._attached&&(this._projector.detach(this.render),this._attached=!1),e?.parentNode?.removeChild(e)}};(0,i._)([(0,f.MZ)()],Me.prototype,"_readyForTrueRender",void 0),(0,i._)([(0,f.MZ)({value:null})],Me.prototype,"container",null),(0,i._)([(0,S.w)("container")],Me.prototype,"castContainer",null),(0,i._)([(0,f.MZ)()],Me.prototype,"icon",null),(0,i._)([(0,f.MZ)()],Me.prototype,"id",null),(0,i._)([(0,f.MZ)()],Me.prototype,"label",null),(0,i._)([(0,f.MZ)()],Me.prototype,"renderable",null),(0,i._)([(0,f.MZ)()],Me.prototype,"uiStrings",void 0),(0,i._)([(0,f.MZ)()],Me.prototype,"viewModel",void 0),(0,i._)([(0,f.MZ)({value:!0})],Me.prototype,"visible",null),(0,i._)([(0,f.MZ)()],Me.prototype,"key",void 0),(0,i._)([(0,f.MZ)()],Me.prototype,"children",void 0),(0,i._)([(0,f.MZ)()],Me.prototype,"afterCreate",void 0),(0,i._)([(0,f.MZ)()],Me.prototype,"afterUpdate",void 0),(0,i._)([(0,f.MZ)()],Me.prototype,"afterRemoved",void 0),Me=(0,i._)([(0,m.$)("esri.widgets.Widget")],Me);const Ne=Me;function De(e){return(t,r)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:r})}}var je=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},Le=function(e,t){for(var r=0,s=e.length;r<s;r++){var i=e[r];Array.isArray(i)?Le(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=je(i)),t.push(i))}};function qe(e,t,...r){return"function"!=typeof e||we(e)?function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(1===r.length&&"string"==typeof r[0])return{vnodeSelector:e,properties:t||void 0,children:void 0,text:r[0],domNode:null};var i=[];return Le(r,i),{vnodeSelector:e,properties:t||void 0,children:i,text:void 0,domNode:null}}(e,t??null,...r):e(t,...r)}const $e=/\W/g;function Ze(){const e=getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replaceAll($e,"").toLowerCase();switch(e){case"dark":case"light":return`calcite-mode-${e}`;default:return null}}var Ve=r(71754);const Fe="esri-identity-modal",Be={base:Fe,info:`${Fe}__info`,notice:`${Fe}__notice`};let He=class extends Ne{constructor(e,t){super(e,t),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return function(e){const t=[];for(const r of Object.keys(e))customElements.get(`calcite-${r}`)||t.push(e[r]?.());return t.length>0?Promise.all(t):null}({button:()=>Promise.all([r.e(9e3),r.e(9402),r.e(7836)]).then(r.bind(r,37836)),dialog:()=>Promise.all([r.e(9e3),r.e(9402),r.e(2893)]).then(r.bind(r,52893)),input:()=>Promise.all([r.e(9e3),r.e(9402),r.e(2165)]).then(r.bind(r,2165)),label:()=>Promise.all([r.e(9e3),r.e(224)]).then(r.bind(r,87843)),notice:()=>Promise.all([r.e(9e3),r.e(9402),r.e(8098)]).then(r.bind(r,48098))})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:e,title:t,messages:r,signingIn:s,oAuthPrompt:i,server:n,resource:o,error:a}=this,{info:l,oAuthInfo:h,lblItem:c,invalidUser:d,noAuthService:u,lblUser:p,lblPwd:f,lblCancel:_,lblSigning:m,lblOk:g}=r;return qe("div",{class:this.classes(Be.base,Ze())},qe("form",{bind:this,onsubmit:this._submit},qe("calcite-dialog",{bind:this,heading:t,modal:!0,open:e,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},qe("div",{class:Be.info},(0,Ve.V)(i?h:l,{server:n&&/\.arcgis\.com/i.test(n)?"ArcGIS Online":n,resource:`(${o||c})`})),a?qe("calcite-notice",{class:Be.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},qe("div",{slot:"message"},a.details?.httpStatus?d:u)):null,i?null:[qe("calcite-label",null,p,qe("calcite-input",{afterCreate:e=>this._usernameInputNode=e,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),qe("calcite-label",null,f,qe("calcite-input",{afterCreate:e=>this._passwordInputNode=e,bind:this,name:"password",required:!0,type:"password",value:""}))],qe("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"footer-end",type:"button"},_),qe("calcite-button",{loading:!!s,slot:"footer-end",type:"submit"},s?m:g))))}_focusUsernameInput(){return async function(e){await(0,Ue.$m)((0,u.Mq)(void 0));const t=e();t&&("setFocus"in t&&"function"==typeof t.setFocus?await t.setFocus():t instanceof HTMLElement&&t.focus())}((()=>this._usernameInputNode))}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",t)}};(0,i._)([(0,f.MZ)({readOnly:!0})],He.prototype,"container",void 0),(0,i._)([(0,f.MZ)(),De("esri/t9n/common")],He.prototype,"commonMessages",void 0),(0,i._)([(0,f.MZ)()],He.prototype,"error",void 0),(0,i._)([(0,f.MZ)(),De("esri/identity/t9n/identity")],He.prototype,"messages",void 0),(0,i._)([(0,f.MZ)()],He.prototype,"oAuthPrompt",void 0),(0,i._)([(0,f.MZ)()],He.prototype,"open",void 0),(0,i._)([(0,f.MZ)()],He.prototype,"signingIn",void 0),(0,i._)([(0,f.MZ)()],He.prototype,"server",void 0),(0,i._)([(0,f.MZ)({readOnly:!0})],He.prototype,"title",null),(0,i._)([(0,f.MZ)()],He.prototype,"resource",void 0),He=(0,i._)([(0,m.$)("esri.identity.IdentityModal")],He);const ze=He,We="esriJSAPIOAuth";class Je{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token))if(null==this.expires&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t?.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r||(r=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),r[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(We,JSON.stringify(e))}catch(e){return console.warn(e),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t?.appId&&t?.portalUrl&&(null==this.expires||this.expires>Date.now())&&(this.refreshToken||this.token)){const e=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",r=new FormData;if(r.append("f","json"),r.append("auth_token",this.refreshToken||this.token),r.append("client_id",t.appId),r.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),"function"==typeof navigator.sendBeacon)navigator.sendBeacon(e,r);else{const t=new XMLHttpRequest;t.open("POST",e),t.send(r)}}if(t?.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(We,JSON.stringify(e))}catch(e){console.log(e)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t?.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r&&(r=r[t.portalUrl],r&&(this.appId=r.appId,this.codeVerifier=r.codeVerifier,this.expires=r.expires,this.refreshToken=r.refreshToken,this.ssl=r.ssl,this.stateUID=r.stateUID,this.token=r.token,this.userId=r.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(We);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}Je.prototype.declaredClass="esri.identity.OAuthCredential";var Ge,Xe=r(25482);let Ye=class extends Xe.A{static{Ge=this}constructor(e){super(e),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Ge.fromJSON(this.toJSON())}};(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"appId",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"authNamespace",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"expiration",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"flowType",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"forceLogin",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"forceUserId",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"locale",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"minTimeUntilExpiration",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"popup",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"popupCallbackUrl",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"popupWindowFeatures",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"portalUrl",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"preserveUrlHash",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"userId",void 0),Ye=Ge=(0,i._)([(0,m.$)("esri.identity.OAuthInfo")],Ye);const Ke=Ye;let Qe=class extends Xe.A{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"adminTokenServiceUrl",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"currentVersion",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"hasPortal",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"hasServer",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"owningSystemUrl",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"owningTenant",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"server",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"shortLivedTokenValidity",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"tokenServiceUrl",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"webTierAuth",void 0),Qe=(0,i._)([(0,m.$)("esri.identity.ServerInfo")],Qe);const et=Qe;var tt=r(39131);const rt={},st=e=>{const t=new p.s0(e.owningSystemUrl).host,r=new p.s0(e.server).host,s=/.+\.arcgis\.com$/i;return s.test(t)&&s.test(r)},it=(e,t)=>!!(st(e)&&t&&t.some((t=>t.test(e.server))));let nt=null,ot=null;try{nt=window.localStorage,ot=window.sessionStorage}catch{}class at extends l.A{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=(0,p.An)(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",(e=>{this._pageShowHandler(e)}))}registerServers(e){const t=this.serverInfos;t?(e=e.filter((e=>!this.findServerInfo(e.server))),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach((e=>{e.owningSystemUrl&&this._portals.push(e.owningSystemUrl),e.hasPortal&&this._portals.push(e.server)}))}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const e=this.findOAuthInfo(r.portalUrl);e&&t.splice(t.indexOf(e),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let s,i=this.findServerInfo(t),n=!0;i||(i=new et,i.server=this._getServerInstanceRoot(t),r?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(t),i.hasPortal=!0),this.registerServers([i])),s=this._findCredential(t),s?(delete e.server,Object.assign(s,e),n=!1):(s=new lt({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),s.resources=[t],this.credentials.push(s)),s.emitTokenChange(!1),n||s.refreshServerTokens()}toJSON(){return(0,c.oy)({serverInfos:this.serverInfos.map((e=>e.toJSON())),oAuthInfos:this.oAuthInfos.map((e=>e.toJSON())),credentials:this.credentials.map((e=>e.toJSON()))})}initialize(e){if(!e)return;"string"==typeof e&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,s=e.credentials;if(t){const e=[];t.forEach((t=>{t.server&&t.tokenServiceUrl&&e.push(t.declaredClass?t:new et(t))})),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach((t=>{t.appId&&e.push(t.declaredClass?t:new Ke(t))})),e.length&&this.registerOAuthInfos(e)}s&&s.forEach((e=>{e.server&&e.token&&e.expires&&e.expires>Date.now()&&((e=e.declaredClass?e:new lt(e)).emitTokenChange(),this.credentials.push(e))}))}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const s=this._isServerRsrc(e)?"server":"portal";if(t){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&t===i.userId&&i.scope===s){r=i;break}}else for(const t of this.credentials)if(this._hasSameServerInstance(t.server,e)&&-1!==this._getIdenticalSvcIdx(e,t)&&t.scope===s){r=t;break}return r}getCredential(e,t){let r,s=!1,i=!0;t&&(s=!(!t.token&&!t.credential),r=t.error,i=!1!==t.prompt),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,o=(0,u.Tw)();if(t.signal&&(0,u.u7)(t.signal,(()=>{n.abort()})),(0,u.u7)(n,(()=>{o.reject(new a.A("identity-manager:user-aborted","ABORTED"))})),(0,u.G4)(n))return o.promise;t.signal=n.signal;const l=this._isAdminResource(e),h=s?this.findCredential(e):null;let c;if(h&&498===r?.details?.httpStatus)h.destroy();else if(h)return c=new a.A("identity-manager:not-authorized","You are currently signed in as: '"+h.userId+"'. You do not have access to this resource: "+e,{error:r}),o.reject(c),o.promise;const d=this._findCredential(e,t);if(d)return o.resolve(d),o.promise;let f=this.findServerInfo(e);if(f)!f.hasPortal&&f.server&&f.owningSystemUrl&&this._hasSameServerInstance(f.server,f.owningSystemUrl)&&(f.hasPortal=!0),!f.hasServer&&this._isServerRsrc(e)&&(f._restInfoPms=this._getTokenSvcUrl(e),f.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return c=new a.A("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),o.reject(c),o.promise;f=new et,f.server=this._getServerInstanceRoot(e),"string"==typeof t?(f.tokenServiceUrl=t,f.hasPortal=!0):(f._restInfoPms=t,f.hasServer=!0),this.registerServers([f])}return f.hasPortal&&void 0===f._selfReq&&(i||(0,p.FX)(f.tokenServiceUrl,this._appOrigin)||this._gwDomains.some((e=>e.tokenServiceUrl===f.tokenServiceUrl)))&&(f._selfReq={owningTenant:t?.owningTenant,selfDfd:this._getPortalSelf(f.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,f,t,o,l)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const s=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new p.s0(this._appOrigin),n=e.shortLivedTokenValidity;let l,h,c,d,u,f,_,m;t&&(m=this.tokenValidity||n||this._defaultTokenValidity,m>n&&n>0&&(m=n)),r&&(l=r.isAdmin,h=r.serverUrl,c=r.token,f=r.signal,_=r.ssl,e.customParameters=r.customParameters),l?d=e.adminTokenServiceUrl:(d=e.tokenServiceUrl,u=new p.s0(d.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!_&&"http"===i.scheme&&((0,p.FX)(i.uri,d,!0)||"https"===u.scheme&&i.host===u.host&&"7080"===i.port&&"7443"===u.port)&&(d=d.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const g={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:h,token:c,expiration:m,referer:l||s?this._appOrigin:null,client:l?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:f,...r?.ioArgs};return s||(g.withCredentials=!1),(0,o.A)(d,g).then((r=>{const s=r.data;if(!s?.token)return new a.A("identity-manager:authentication-failed","Unable to generate token");const i=e.server;return rt[i]||(rt[i]={}),t&&(rt[i][t.username]=t.password),s.validity=m,s}))}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,t,r){let s=!1;return this.getCredential(e,{prompt:!1}).then((i=>{let n;const l={f:"json"};if("portal"===i.scope)if(t&&(this._doPortalSignIn(e)||r?.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(l.token=i.token),(0,o.A)(n,{query:l,authMode:"anonymous"}).then((e=>{if(!1===e.data.valid)throw new a.A("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,e.data);return s=!!e.data.viewOnlyUserTypeApp,{credential:i}})).catch((e=>{if("identity-manager:not-authorized"===e.name)throw e;const t=e.details?.httpStatus;if(498===t)throw i.destroy(),new a.A("identity-manager:not-authenticated","User is not signed in.");if(400===t)throw new a.A("identity-manager:invalid-request","Bad request");return{credential:i}}))})).then((e=>({credential:e.credential,viewOnly:s})))}setOAuthResponseHash(e){e&&("#"===e.charAt(0)&&(e=e.slice(1)),this._processOAuthPopupParams((0,p.zf)(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const s=(0,u.Tw)(),i=()=>{l?.remove(),h?.remove(),this.dialog?.destroy(),this.dialog=l=h=null},n=()=>{i(),this._oAuthDfd=null,s.reject(new a.A("identity-manager:user-aborted","ABORTED"))};r.signal&&(0,u.u7)(r.signal,(()=>{n()}));const o=new ze({open:!0,resource:this.getResourceName(e),server:t.server});this.dialog=o,this.emit("dialog-create");let l=o.on("cancel",n),h=o.on("submit",(e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then((n=>{i();const o=new lt({userId:e.username,server:t.server??void 0,token:n.token,expires:null!=n.expires?Number(n.expires):null,ssl:!!n.ssl,isAdmin:r.isAdmin,validity:n.validity});s.resolve(o)})).catch((e=>{o.error=e,o.signingIn=!1}))}));return s.promise}oAuthSignIn(e,t,r,s){this._oAuthDfd=(0,u.Tw)();const i=this._oAuthDfd;let n;s?.signal&&(0,u.u7)(s.signal,(()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&c()})),i.resUrl_=e,i.sinfo_=t,i.oinfo_=r;const o=r._oAuthCred;if(o.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));n=(0,p.$1)(e),o.codeVerifier=n,e=crypto.getRandomValues(new Uint8Array(32)),o.stateUID=(0,p.$1)(e),o.save()||(o.codeVerifier=n=null)}else o.codeVerifier=null;let l,h;this._getCodeChallenge(n).then((i=>{const n=!s||!1!==s.oAuthPopupConfirmation;if(!r.popup||!n)return void this._doOAuthSignIn(e,t,r,i);const o=new ze({oAuthPrompt:!0,server:t.server,open:!0});this.dialog=o,this.emit("dialog-create"),l=o.on("cancel",c),h=o.on("submit",(()=>{d(),this._doOAuthSignIn(e,t,r,i)}))}));const c=()=>{d(),this._oAuthDfd=null,i.reject(new a.A("identity-manager:user-aborted","ABORTED"))},d=()=>{l?.remove(),h?.remove(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach((e=>{e.destroy()})),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=(0,h.on)(window,"message",(t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&"arcgis:auth:requestCredential"===t.data?.type){const r=t.source;this.getCredential(e).then((e=>{r.postMessage({type:"arcgis:auth:credential",credential:{expires:e.expires,server:e.server,ssl:e.ssl,token:e.token,userId:e.userId}},t.origin)})).catch((e=>{r.postMessage({type:"arcgis:auth:error",error:{name:e.name,message:e.message}},t.origin)}))}}))}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){"#"===e.charAt(0)&&(e=e.slice(1));const t=(0,p.zf)(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),"access_denied"===t.error&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let t=window.location.search;if(t){"?"===t.charAt(0)&&(t=t.slice(1));const e=(0,p.zf)(t);let r=!1;if(e.code&&e.state)try{e.state=JSON.parse(e.state),e.state.portalUrl&&e.state.uid&&(this._oAuthLocationParams=e,r=!0)}catch{}else if(e.error&&e.error_description&&(console.log("IdentityManager OAuth Error: ",e.error," - ",e.error_description),"access_denied"===e.error&&(r=!0,e.state)))try{e.state=JSON.parse(e.state)}catch{}if(r){const t={...e};["code","error","error_description","message_code","persist","state"].forEach((e=>{delete t[e]}));const r=(0,p.x0)(t),s=window.location.pathname+(r?`?${r}`:"")+(e.state?.hash||"");window.history.replaceState(window.history.state,"",s)}}}_getOAuthToken(e,t,r,s,i){return e=e.replace(/^http:/i,"https:"),(0,o.A)(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:s&&i?{grant_type:"authorization_code",code:t,redirect_uri:s,client_id:r,code_verifier:i}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then((e=>e.data))}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t);return(0,p.$1)(new Uint8Array(r))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const e=new a.A("identity-manager:user-aborted","ABORTED");this._errbackFunc(e)}}_findCredential(e,t){let r,s,i,n,o=-1;const a=t?.token,l=t?.resource,h=this._isServerRsrc(e)?"server":"portal",c=this.credentials.filter((t=>this._hasSameServerInstance(t.server,e)&&t.scope===h));if(e=l||e,c.length)if(1===c.length){if(r=c[0],i=this.findServerInfo(r.server),s=i?.owningSystemUrl,n=s?this.findCredential(s,r.userId):void 0,o=this._getIdenticalSvcIdx(e,r),!a)return-1===o&&r.resources.push(e),this._addResource(e,n),r;-1!==o&&(r.resources.splice(o,1),this._removeResource(e,n))}else{let t,r;if(c.some((a=>(r=this._getIdenticalSvcIdx(e,a),-1!==r&&(t=a,i=this.findServerInfo(t.server),s=i?.owningSystemUrl,n=s?this.findCredential(s,t.userId):void 0,o=r,!0)))),a)t&&(t.resources.splice(o,1),this._removeResource(e,n));else if(t)return this._addResource(e,n),t}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t)for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}return t}_addResource(e,t){t&&-1===this._getIdenticalSvcIdx(e,t)&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t?.isAdmin&&!(0,p.FX)(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!(0,p.FX)(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new p.s0(e);return t.scheme+"://"+t.host+(null!=t.port?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return-1===r&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),-1!==r||(0,tt.$E)(t)||(r=t.indexOf("/sharing")),-1===r&&t.endsWith("/")&&(r=t.length-1),r>-1?e.slice(0,r):e}_hasSameServerInstance(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=(0,tt.qG)(e),t=(0,tt.qG)(t),(e=e.slice(Math.max(0,e.indexOf(":"))))===t.slice(Math.max(0,t.indexOf(":")))}_sanitizeUrl(e){const t=(n.A.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return-1!==r&&(e=e.slice(r+t.length+1)),e=(0,p.S8)(e),(0,p.An)(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const s=this._getSuffix(e).toLowerCase(),i=this._getSuffix(t).toLowerCase();if(r=s===i,!r){const e=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=s.replaceAll(e,"$1")===i.replaceAll(e,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const t=new p.s0(e.toLowerCase()),r=this._portalConfig;let s=this._gwDomains.some((e=>e.regex.test(t.uri)));return!s&&r&&(s=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),t.uri)),s||n.A.portalUrl&&(s=(0,p.FX)(t,n.A.portalUrl,!0)),s||(s=this._portals.some((e=>this._hasSameServerInstance(e,t.uri)))),s=s||this._agsPortal.test(t.path),s}_isIdProvider(e,t){let r=-1,s=-1;this._gwDomains.forEach(((i,n)=>{-1===r&&i.regex.test(e)&&(r=n),-1===s&&i.regex.test(t)&&(s=n)}));let i=!1;if(r>-1&&s>-1&&(0===r||4===r?0!==s&&4!==s||(i=!0):1===r?1!==s&&2!==s||(i=!0):2===r?2===s&&(i=!0):3===r&&3===s&&(i=!0)),!i){const r=this.findServerInfo(t),s=r?.owningSystemUrl;s&&st(r)&&this._isPortalDomain(s)&&this._isIdProvider(e,s)&&(i=!0)}return i}_getIdenticalSvcIdx(e,t){let r=-1;for(let s=0;s<t.resources.length;s++){const i=t.resources[s];if(this._isIdenticalService(e,i)){r=s;break}}return r}_getSuffix(e){return e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"$1")}_getTokenSvcUrl(e){let t,r,s;if(this._isRESTService(e)||this._isAdminResource(e)){const s=this._getServerInstanceRoot(e);return t=s+"/admin/generateToken",r=(0,o.A)(e=s+"/rest/info",{query:{f:"json"}}).then((e=>e.data)),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let t="";if(this._gwDomains.some((r=>(r.regex.test(e)&&(t=r.tokenServiceUrl),!!t))),t||this._portals.some((r=>(this._hasSameServerInstance(r,e)&&(t=r+this._gwTokenUrl),!!t))),t||(s=e.toLowerCase().indexOf("/sharing"),-1!==s&&(t=e.slice(0,s)+this._gwTokenUrl)),t||(t=this._getOrigin(e)+this._gwTokenUrl),t){const r=new p.s0(e).port;/^http:\/\//i.test(e)&&"7080"===r&&(t=t.replace(/:7080/i,":7443")),t=t.replace(/http:/i,"https:")}return t}}_processOAuthResponseParams(e,t,r){const s=t._oAuthCred;if(e.code){const i=s.codeVerifier;return s.codeVerifier=null,s.stateUID=null,s.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),i).then((i=>{const n=new lt({userId:i.username,server:r.server??void 0,token:i.access_token,expires:Date.now()+1e3*i.expires_in,ssl:i.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=n.userId,s.storage=i.persist?nt:ot,s.refreshToken=i.refresh_token,s.token=null,s.expires=i.refresh_token_expires_in?Date.now()+1e3*i.refresh_token_expires_in:null,s.userId=n.userId,s.ssl=n.ssl,s.save(),n}))}const i=new lt({userId:e.username,server:r.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:"true"===e.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=i.userId,s.storage=e.persist?nt:ot,s.refreshToken=null,s.token=i.token,s.expires=i.expires,s.userId=i.userId,s.ssl=i.ssl,s.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r="access_denied"===e.error,s=new a.A(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(s)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then((e=>{t.resolve(e)})).catch((e=>{t.reject(e)}))}_setOAuthResponseQueryString(e){e&&("?"===e.charAt(0)&&(e=e.slice(1)),this._processOAuthPopupParams((0,p.zf)(e)))}async _exchangeToken(e,t,r){return(await(0,o.A)(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}})).data.token}async _getPlatformSelf(e,t){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const r=await(0,o.A)(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,r.data}catch(e){throw"OAUTH_0066"===e.details?.messageCode&&(this._getPlatformSelfError=[e,Date.now()]),e}}_getPortalSelf(e,t){let r;return this._gwDomains.some((t=>(t.regex.test(e)&&(r=t.customBaseUrl),!!r))),r?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),(0,o.A)(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then((e=>e.data)))}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,s=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(s?s.hasPortal||s.owningSystemUrl&&this._isPortalDomain(s.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||(0,p.FX)(r,e,!0)))}_checkProtocol(e,t,r,s){let i=!0;const n=s?t.adminTokenServiceUrl:t.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&(0,p.zs)(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!i)&&r(new a.A("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,t,r,s,i,n){return s||(s=(0,u.Tw)()),s.resUrl_=e,s.sinfo_=t,s.options_=r,s.admin_=i,s.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(s)):this._xoReqs.push(s):this._doSignIn(s),s.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=t=>{const r=e.options_?.resource,s=e.resUrl_,i=e.refresh_;let n=!1;this.credentials.includes(t)||(i&&this.credentials.includes(i)?(i.userId=t.userId,i.token=t.token,i.expires=t.expires,i.validity=t.validity,i.ssl=t.ssl,i.creationTime=t.creationTime,n=!0,t=i):this.credentials.push(t)),t.resources||(t.resources=[]),t.resources.includes(r||s)||t.resources.push(r||s),t.scope=this._isServerRsrc(s)?"server":"portal",t.emitTokenChange();const o=this._soReqs,a={};this._soReqs=[],o.forEach((e=>{if(!this._isIdenticalService(s,e.resUrl_)){const r=this._getSuffix(e.resUrl_);a[r]||(a[r]=!0,t.resources.push(e.resUrl_))}})),e.resolve(t),o.forEach((e=>{this._hasSameServerInstance(this._getServerInstanceRoot(s),e.resUrl_)?e.resolve(t):this._soReqs.push(e)})),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,n||this.emit("credential-create",{credential:t}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=t=>{e.reject(t),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=(i,n,o,l)=>{const c=e.sinfo_,d=!e.options_||!1!==e.options_.prompt,f=c.hasPortal&&this._findOAuthInfo(e.resUrl_);let _,m;if(i)t(new lt({userId:i,server:c.server??void 0,token:o??void 0,expires:null!=l?Number(l):null,ssl:!!n}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const s=(0,h.on)(window,"message",(e=>{e.source===window.parent&&e.data&&("arcgis:auth:credential"===e.data.type?(s.remove(),e.data.credential.expires<Date.now()?r(new a.A("identity-manager:credential-request-failed","Parent application's token has expired.")):t(new lt(e.data.credential))):"arcgis:auth:error"===e.data.type&&(s.remove(),"tokenExpiredError"===e.data.error.name?r(new a.A("identity-manager:credential-request-failed","Parent application's token has expired.")):r(a.A.fromJSON(e.data.error))))}));(0,u.u7)(e.options_?.signal,(()=>{s.remove()}))}else if(f){let i=f._oAuthCred;if(!i){const e=new Je(f,nt),t=new Je(f,ot);e.isValid()&&t.isValid()?e.expires>t.expires?(i=e,t.destroy()):(i=t,e.destroy()):i=e.isValid()?e:t,f._oAuthCred=i}if(i.isValid()){_=new lt({userId:i.userId??void 0,server:c.server??void 0,token:i.token??void 0,expires:i.expires,ssl:i.ssl??void 0,_oAuthCred:i});const n=f.appId!==i.appId&&this._doPortalSignIn(e.resUrl_);n||i.refreshToken?(e._pendingDfd=i.refreshToken?this._getOAuthToken(c.server,i.refreshToken,i.appId).then((e=>(_.expires=Date.now()+1e3*e.expires_in,_.token=e.access_token,_))):Promise.resolve(_),e._pendingDfd.then((e=>n?this._exchangeToken(e.server,f.appId,e.token).then((t=>(e.token=t,e))).catch((()=>e)):e)).then((e=>{t(e)})).catch((e=>{const t=e.details?.httpStatus;t>0&&404!==t?(i.destroy(),s()):r(e)}))):t(_)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(f.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===i.stateUID&&i.codeVerifier)){const s=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(s,f,c).then((e=>{t(e)})).catch(r)}else{const s=()=>{d?e._pendingDfd=this.oAuthSignIn(e.resUrl_,c,f,e.options_).then(t,r):(m=new a.A("identity-manager:not-authenticated","User is not signed in."),r(m))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(c.server,f.appId).then((e=>{(0,p.FX)(e.portalUrl,this._appOrigin,!0)?(_=new lt({userId:e.username,server:c.server??void 0,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(_)):s()})).catch(s):s()}}else if(d){if(this._checkProtocol(e.resUrl_,c,r,e.admin_)){let s=e.options_;e.admin_&&(s=s||{},s.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,c,s).then(t,r)}}else m=new a.A("identity-manager:not-authenticated","User is not signed in."),r(m)},i=()=>{const s=e.sinfo_,i=s.owningSystemUrl,n=e.options_;let o,a,l,h;if(n&&(o=n.token,a=n.error,l=n.prompt),h=this._findCredential(i,{token:o,resource:e.resUrl_}),!h)for(const e of this.credentials)if(this._isIdProvider(i,e.server)){h=e;break}if(h){const i=this.findCredential(e.resUrl_,h.userId);if(i)t(i);else if(it(s,this._legacyFed)){const e=h.toJSON();e.server=s.server,e.resources=null,t(new lt(e))}else(e._pendingDfd=this.generateToken(this.findServerInfo(h.server),null,{serverUrl:e.resUrl_,token:h.token,signal:e.options_.signal,ssl:h.ssl})).then((r=>{t(new lt({userId:h?.userId,server:s.server??void 0,token:r.token,expires:null!=r.expires?Number(r.expires):null,ssl:!!r.ssl,isAdmin:e.admin_,validity:r.validity}))}),r)}else this._busy=null,o&&(e.options_.token=null),(e._pendingDfd=this.getCredential(i.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:s.owningTenant,signal:e.options_.signal,token:o,error:a,prompt:l})).then((()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)}),(t=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(t)}))};this._errbackFunc=r;const n=e.sinfo_.owningSystemUrl,o=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then((t=>{const r=e.sinfo_;if(r._restInfoPms){r.adminTokenServiceUrl=r._restInfoPms.adminUrl,r._restInfoPms=null,r.tokenServiceUrl=((0,d.wc)("authInfo.tokenServicesUrl",t)||(0,d.wc)("authInfo.tokenServiceUrl",t)||(0,d.wc)("tokenServiceUrl",t))??null,r.shortLivedTokenValidity=(0,d.wc)("authInfo.shortLivedTokenValidity",t)??null,r.currentVersion=t.currentVersion,r.owningTenant=t.owningTenant;const e=r.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}o&&r.owningSystemUrl?i():s()}),(()=>{e.sinfo_._restInfoPms=null;const t=new a.A("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(t)})):o&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then((t=>{const r={};let s,i,n,o;return t&&(s=t.user?.username,r.username=s,r.allSSL=t.allSSL,i=t.supportsOAuth,o=parseFloat(t.currentVersion),"multitenant"===t.portalMode&&(n=t.customBaseUrl),e.sinfo_.currentVersion=o),e.sinfo_.webTierAuth=!!s,s&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:r.allSSL}).catch((()=>null)).then((e=>(r.portalToken=e?.token,r.tokenExpiration=e?.expires,r))):!s&&i&&o>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:n,owningTenant:e.sinfo_._selfReq.owningTenant}).catch((()=>null)).then((()=>r)):r})).catch((()=>null)).then((t=>{e.sinfo_._selfReq=null,t?s(t.username,t.allSSL,t.portalToken,t.tokenExpiration):s()})):s()}_generateOAuthInfo(e){let t,r=null,s=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=this._appUrlObj.path;const e=r.search(/\/(apps|home)\//);r=e>-1?r.slice(0,e):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=(0,o.A)(r+"/sharing/rest",{query:{f:"json"}}).then((()=>{this._defaultOAuthInfo=new Ke({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})}))):t=Promise.resolve(),t.then((()=>{if(this._defaultOAuthInfo)return s=s.replace(/^http:/i,"https:"),(0,o.A)(s+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:(0,p.s2)(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then((e=>{if(e.data.valid){const t=this._defaultOAuthInfo.clone();e.data.urlKey&&i?t.portalUrl="https://"+e.data.urlKey.toLowerCase()+"."+i:t.portalUrl=s,t.popup=window!==window.top||!((0,p.FX)(s,this._appOrigin)||this._gwDomains.some((e=>e.regex.test(s)&&e.regex.test(this._appOrigin)))),this.oAuthInfos.push(t)}}))}))}_doOAuthSignIn(e,t,r,s){const i=r._oAuthCred,n={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const o={client_id:r.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!i.codeVerifier)};r.forceLogin&&(o.force_login=!0),r.forceUserId&&r.userId&&(o.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(o.redirectToUserOrgUrl=!0),i.codeVerifier&&(o.code_challenge=s||i.codeVerifier,o.code_challenge_method=s?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",c=l+"?"+(0,p.x0)(o);if(r.popup){const e=window.open(c,"esriJSAPIOAuth",r.popupWindowFeatures);if(e)e.focus(),this._oAuthDfd.oAuthWin_=e,this._oAuthIntervalId=setInterval((()=>{if(e.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const e=this._oAuthDfd;if(e){const t=new a.A("identity-manager:user-aborted","ABORTED");e.reject(t)}}}),500),this._oAuthOnPopupHandle=(0,h.on)(window,["arcgis:auth:hash","arcgis:auth:location:search"],(e=>{"arcgis:auth:hash"===e.type?this.setOAuthResponseHash(e.detail):this._setOAuthResponseQueryString(e.detail)}));else{const e=new a.A("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(e)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:o,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=c}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return(0,p.s2)(e.popupCallbackUrl);if(t){const e=(0,p.An)(r);return e.query&&["code","error","error_description","message_code","persist","state"].forEach((t=>{delete e.query[t]})),(0,p.a6)(e.path,e.query)}return r}}at.prototype.declaredClass="esri.identity.IdentityManagerBase";let lt=class extends l.A.EventedAccessor{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e?._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],null==this.creationTime&&(this.creationTime=Date.now())}refreshToken(){const e=s.id,t=e.findServerInfo(this.server),r=t?.owningSystemUrl,i=!!r&&"server"===this.scope,n=i&&it(t,e._legacyFed),o=t.webTierAuth,a=o&&e.normalizeWebTierAuth,l=rt[this.server],h=l?.[this.userId];let c,d=this.resources&&this.resources[0],u=i?e.findServerInfo(r):null,p={username:this.userId,password:h};if(o&&!a)return;i&&!u&&e.serverInfos.some((t=>(e._isIdProvider(r,t.server)&&(u=t),!!u)));const f=u?e.findCredential(u.server,this.userId):null;if(!i||f){if(!n){if(i)c={serverUrl:d,token:f?.token,ssl:f?.ssl};else if(a)p=null,c={ssl:this.ssl};else{if(!h){let r;return d&&(d=e._sanitizeUrl(d),this._enqueued=1,r=e._enqueue(d,t,null,null,this.isAdmin,this),r.then((()=>{this._enqueued=0,this.refreshServerTokens()})).catch((()=>{this._enqueued=0}))),r}this.isAdmin&&(c={isAdmin:!0})}return e.generateToken(i?u:t,i?null:p,c).then((e=>{this.token=e.token,this.expires=null!=e.expires?Number(e.expires):null,this.creationTime=Date.now(),this.validity=e.validity,this.emitTokenChange(),this.refreshServerTokens()})).catch((()=>{}))}f?.refreshToken()}}refreshServerTokens(){if("portal"===this.scope){const e=s.id;e.credentials.forEach((t=>{const r=e.findServerInfo(t.server),s=r?.owningSystemUrl;t!==this&&t.userId===this.userId&&s&&"server"===t.scope&&(e._hasSameServerInstance(this.server,s)||e._isIdProvider(s,this.server))&&(it(r,e._legacyFed)?(t.token=this.token,t.expires=this.expires,t.creationTime=this.creationTime,t.validity=this.validity,t.emitTokenChange()):t.refreshToken())}))}}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=s.id,r=this.server?t.findServerInfo(this.server):null,i=r?.owningSystemUrl,n=i?t.findServerInfo(i):null;!1===e||i&&"portal"!==this.scope&&(!n?.webTierAuth||t.normalizeWebTierAuth)||null==this.expires&&null==this.validity||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=s.id,t=e.credentials.indexOf(this);t>-1&&e.credentials.splice(t,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=(0,c.oy)({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>t&&(r=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};(0,i._)([(0,f.MZ)()],lt.prototype,"creationTime",void 0),(0,i._)([(0,f.MZ)()],lt.prototype,"expires",void 0),(0,i._)([(0,f.MZ)()],lt.prototype,"isAdmin",void 0),(0,i._)([(0,f.MZ)()],lt.prototype,"oAuthState",void 0),(0,i._)([(0,f.MZ)()],lt.prototype,"resources",void 0),(0,i._)([(0,f.MZ)()],lt.prototype,"scope",void 0),(0,i._)([(0,f.MZ)()],lt.prototype,"server",void 0),(0,i._)([(0,f.MZ)()],lt.prototype,"ssl",void 0),(0,i._)([(0,f.MZ)()],lt.prototype,"token",void 0),(0,i._)([(0,f.MZ)()],lt.prototype,"tokenRefreshBuffer",void 0),(0,i._)([(0,f.MZ)()],lt.prototype,"userId",void 0),(0,i._)([(0,f.MZ)()],lt.prototype,"validity",void 0),lt=(0,i._)([(0,m.$)("esri.identity.Credential")],lt);class ht extends at{}ht.prototype.declaredClass="esri.identity.IdentityManager";const ct=new ht;(0,s.Aq)(ct)}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9953],{9775:(e,t,r)=>{r.d(t,{A:()=>o});var s=r(62788),n=r(95488);class o{constructor(e=e=>e.values().next().value){this._peeker=e,this._observable=new n.I,this._items=new Set}get length(){return(0,s.gc)(this._observable),this._items.size}clear(){0!==this.length&&(this._items.clear(),this._observable.notify())}last(){if(0===this.length)return;let e;for(e of this._items);return e}peek(){if(0!==this.length)return this._peeker(this._items)}push(e){this.contains(e)||(this._items.add(e),this._observable.notify())}contains(e){return(0,s.gc)(this._observable),this._items.has(e)}pop(){if(0===this.length)return;const e=this.peek();return this._items.delete(e),this._observable.notify(),e}popLast(){if(0===this.length)return;const e=this.last();return this._items.delete(e),this._observable.notify(),e}remove(e){this.contains(e)&&(this._items.delete(e),this._observable.notify())}filter(e){const t=this.length;return this._items.forEach((t=>{e(t)||this._items.delete(t)})),t!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){(0,s.gc)(this._observable),yield*this._items}}},10382:(e,t,r)=>{r.d(t,{A:()=>c});var s=r(36563),n=(r(44208),r(74887)),o=r(9775),i=r(72457),a=r(52268),l=r(61322);class c{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new o.A,this._ongoingLowPriorityJobsQueue=new o.A}destroy(){this.close()}get closed(){return!this._clients?.length}open(e,t){return new Promise(((r,s)=>{let o=!0;const i=e=>{(0,n.Te)(t.signal),o&&(o=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let o=0;o<e.length;++o){const a=e[o];(0,n.$X)(a)?this._clientPromises[o]=a.then((e=>(this._clients[o]=new l.default(e,t,this._ongoingJobsQueue,this._ongoingLowPriorityJobsQueue),i(r),this._clients[o])),(()=>(i(s),null))):(this._clients[o]=new l.default(a,t,this._ongoingJobsQueue,this._ongoingLowPriorityJobsQueue),this._clientPromises[o]=Promise.resolve(this._clients[o]),i(r))}}))}broadcast(e,t,r){const s=new Array(this._clientPromises.length);for(let n=0;n<this._clientPromises.length;++n){const o=this._clientPromises[n];s[n]=o.then((s=>s?.invoke(e,t,r)))}return s}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.resolver.reject((0,n.NK)(`Worker closing, aborting job calling '${e.methodName}'`));for(;e=this._ongoingLowPriorityJobsQueue.pop();)e.resolver.reject((0,n.NK)(`Worker closing, aborting job calling '${e.methodName}'`));for(const e of this._clientPromises)e.then((e=>e?.close()));this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0,(0,i.h)(this)}invoke(e,t,r){return this.apply(e,[t],r)}apply(e,t,r){const s=(0,n.Tw)();("low"===r?.priority?this._ongoingLowPriorityJobsQueue:this._ongoingJobsQueue).push({methodName:e,data:t,invokeOptions:r,resolver:s});for(let e=0;e<this._clientPromises.length;e++){const t=this._clients[e];t?t.jobAdded():this._clientPromises[e].then((e=>e?.jobAdded()))}return s.promise}createInvokeProxy(e){return(0,a.L)(this,e)}on(e,t){return Promise.all(this._clientPromises).then((()=>(0,s.vE)(this._clients.map((r=>r.on(e,t))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let r=t.length;for(let s=0;s<this._clientPromises.length;++s)this._clientPromises[s].then((n=>{n&&(t[s]=n.openPort()),0===--r&&e(t)}))}))}get test(){}}},18047:(e,t,r)=>{r.d(t,{ZV:()=>l,yx:()=>a});var s=r(73444);const n={ar:"ar-u-nu-latn",bs:"hr",nn:"no-NN"};let o=new WeakMap,i={};function a(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function l(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||i;if(!o.has(t)){const r=(0,s.JK)(),i=(0,s.ZS)(r)?.language,a=i&&n[i]||r;o.set(t,new Intl.NumberFormat(a,e))}return o.get(t)}(t).format(e)}(0,s.Ml)((()=>{o=new WeakMap,i={}})),new Map},29953:(e,t,r)=>{r.d(t,{ho:()=>D});var s=r(49186),n=r(44208),o=r(74887),i=r(10382),a=r(72457),l=r(61322),c=r(53966),u=r(97768),h=r(78888),d=r(84952);const f={async request(e,t){const r=e.options,s=r.responseType;r.signal=t?.signal,r.responseType="native"===s||"native-request-init"===s?"native-request-init":s&&["blob","json","text"].includes(s)&&(0,d.sC)(e.url)?.after?s:"array-buffer";const n=await(0,h.A)(e.url,r),o={data:n.data,httpStatus:n.httpStatus,ssl:n.ssl};switch(n.requestOptions?.responseType){case"native-request-init":return delete o.data.signal,o;case"blob":o.data=await o.data.arrayBuffer();break;case"json":o.data=(new TextEncoder).encode(JSON.stringify(o.data)).buffer;break;case"text":o.data=(new TextEncoder).encode(o.data).buffer}return{result:o,transferList:[o.data]}}};var g=r(8341),m=r(2741),p=r(92602),b=(r(47566),r(70333));const w={};var y=r(26390);class k{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...r)=>e[t](...r)}))}}class _{constructor(){this._dispatcher=new k,this._workerPostMessage({type:g.Go.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,y.d)((()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){(0,y.d)((()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))}))}async _workerMessageHandler(e){const t=(0,g.VI)(e);if(t&&t.type===g.Go.OPEN){const{modulePath:e,jobId:r}=t;let s=await l.default.loadWorker(e);s||(s=await import(e));const n=l.default.connect(s);this._workerPostMessage({type:g.Go.OPENED,jobId:r,data:n})}}}var v=r(73444),A=r(18357);const P=()=>c.A.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:E}=g.Go;let L,N;const O="Failed to create Worker. Fallback to execute module in main thread";async function I(e){return new Promise((t=>{function r(n){const o=(0,g.VI)(n);o&&o.type===E&&(e.removeEventListener("message",r),e.removeEventListener("error",s),t(e))}function s(t){t.preventDefault(),e.removeEventListener("message",r),e.removeEventListener("error",s),P().warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new _).addEventListener("message",r),e.addEventListener("error",s)}e.addEventListener("message",r),e.addEventListener("error",s)}))}let M=0;const{ABORT:j,INVOKE:C,OPEN:J,OPENED:S,RESPONSE:R}=g.Go;class x{static async create(e){const t=await async function(){if(!(0,n.A)("esri-workers"))return I(new _);if(!L&&!N)try{const e='let globalId=0;const outgoing=new Map,configuration={CONFIGURATION};self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;let s=null;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());s=()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))},t.addEventListener("abort",s)}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})})).finally((()=>{t&&t.removeEventListener("abort",s)}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\nModules version: ${r}\nAssets version: ${n??s}\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let n;function t(e){const o=n.connect(e);self.postMessage({type:2,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.split("{CONFIGURATION}").join(function(){let e;if(null!=p.A.default){const t={...p.A};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(p.A));e.assetsPath=(0,d.s2)(e.assetsPath),e.defaultAssetsPath=e.defaultAssetsPath?(0,d.s2)(e.defaultAssetsPath):void 0,e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,v.JK)(),e.has={"esri-csp-restrictions":(0,n.A)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,n.A)("esri-2d-update-debug"),"esri-2d-log-updating":(0,n.A)("esri-2d-log-updating"),"featurelayer-pbf":(0,n.A)("featurelayer-pbf"),"featurelayer-fast-triangulation-enabled":(0,n.A)("featurelayer-fast-triangulation-enabled"),"featurelayer-simplify-thresholds":(0,n.A)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,n.A)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,n.A)("featurelayer-simplify-mobile-factor"),"featurelayer-query-max-depth":(0,n.A)("featurelayer-query-max-depth"),"featurelayer-query-tile-max-features":(0,n.A)("featurelayer-query-tile-max-features"),"featurelayer-query-tile-concurrency":(0,n.A)("featurelayer-query-tile-concurrency"),"featurelayer-query-pausing-enabled":(0,n.A)("featurelayer-query-pausing-enabled"),"featurelayer-snapshot-concurrency":(0,n.A)("featurelayer-snapshot-concurrency"),"featurelayer-snapshot-enabled":(0,n.A)("featurelayer-snapshot-enabled"),"esri-atomics":(0,n.A)("esri-atomics"),"esri-shared-array-buffer":(0,n.A)("esri-shared-array-buffer"),"esri-tiles-debug":(0,n.A)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,n.A)("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":(0,n.A)("feature-polyline-generalization-factor"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,d.s2)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,d.s2)(e.workers.workerPath):e.workers.workerPath=(0,d.s2)((0,m.s)("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=p.A.workers.loaderConfig,r=function(e){const t={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages?.slice()||[],paths:{...w.paths,...e.paths}};return e.hasOwnProperty("async")||(t.async=!0),e.hasOwnProperty("isDebug")||(t.isDebug=!1),e.baseUrl||(t.baseUrl=w.baseUrl),t}({baseUrl:t?.baseUrl,locale:(0,v.JK)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...t?.has},map:{...t?.map},paths:{...t?.paths},packages:t?.packages||[]}),s={buildDate:A.$,fullVersion:b.ol,revision:A.u};return JSON.stringify({esriConfig:e,loaderConfig:r,kernelInfo:s})}());L=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){N=e||{}}let e;if(L)try{e=new Worker(L,{name:"esri-worker-"+M++})}catch(t){P().warn(O,N),e=new _}else P().warn(O,N),e=new _;return I(e)}();return new x(t,e)}constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),c.A.getLogger("esri.core.workers.WorkerOwner").error(e)}))}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,s=(0,g.Jc)();return new Promise(((t,n)=>{const i={resolve:t,reject:n,abortHandle:(0,o.NY)(r,(()=>{this._outJobs.delete(s),this._post({type:j,jobId:s})}))};this._outJobs.set(s,i),this._post({type:J,jobId:s,modulePath:e})}))}_onMessage(e){const t=(0,g.VI)(e);if(t)switch(t.type){case S:this._onOpenedMessage(t);break;case R:this._onResponseMessage(t);break;case j:this._onAbortMessage(t);break;case C:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,s=t.get(r);s&&(s.controller&&s.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:s,abortable:n}=e,i=n?new AbortController:null,a=this._inJobs,l=f[t];let c;try{if("function"!=typeof l)throw new TypeError(`${t} is not a function`);c=l.call(null,s,{signal:i?i.signal:null})}catch(e){return void this._post({type:R,jobId:r,error:(0,g.mF)(e)})}(0,o.$X)(c)?(a.set(r,{controller:i,promise:c}),c.then((e=>{a.has(r)&&(a.delete(r),this._post({type:R,jobId:r},e))}),(e=>{a.has(r)&&(a.delete(r),e||(e={message:"Error encountered at method"+t}),(0,o.zf)(e)||this._post({type:R,jobId:r,error:(0,g.mF)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:R,jobId:r},c)}_onOpenedMessage(e){const{jobId:t,data:r}=e,s=this._outJobs.get(t);s&&(this._outJobs.delete(t),(0,u.xt)(s.abortHandle),s.resolve(r))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,o=this._outJobs.get(t);o&&(this._outJobs.delete(t),(0,u.xt)(o.abortHandle),r?o.reject(s.A.fromJSON(JSON.parse(r))):o.resolve(n))}_post(e,t,r){return(0,g.u1)(this.worker,e,t,r)}}const H=(0,n.A)("host-browser")?Math.min(navigator.hardwareConcurrency-1,(0,n.A)("workers-pool-size")??8):0;let U=(0,n.A)("esri-mobile")?Math.min(H,3):H;U||(U=(0,n.A)("safari")&&(0,n.A)("mac")?7:2);let $=0;const q=[];async function W(e,t){const r=new i.A,{registryTarget:s,...n}=t;return await r.open(e,n),s&&(0,a.k)(s,r),r}async function D(e,t={}){if("string"!=typeof e)throw new s.A("workers:undefined-module","modulePath is missing");let r=t.strategy||"distributed";if((0,n.A)("host-webworker")&&!(0,n.A)("esri-workers")&&(r="local"),"local"===r){let r=await l.default.loadWorker(e);r||(r=await import(e)),(0,o.Te)(t.signal);const s=t.client||r;return W([l.default.connect(r,t.schedule)],{...t,client:s})}if(await async function(){if(F)return F;T=new AbortController;const e=[];for(let t=0;t<U;t++){const r=x.create(t).then((e=>(q[t]=e,e)));e.push(r)}return F=Promise.all(e),F}(),(0,o.Te)(t.signal),"dedicated"===r){const r=$++%U;return W([await q[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,U);if(r<U){const s=new Array(r);for(let n=0;n<r;++n){const r=$++%U;s[n]=q[r].open(e,t)}return W(s,t)}}return W(q.map((r=>r.open(e,t))),t)}let T,F=null},47566:(e,t,r)=>{r(97770),r(18047),r(71754),r(73444);var s=r(10838),n=r(78888),o=r(49186);async function i(e){if(null!=l.fetchBundleAsset)return l.fetchBundleAsset(e);const t=await(0,n.A)(e,{responseType:"text"});return JSON.parse(t.data)}class a{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let s;s="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=s,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)\\/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,n){const a=t.exec(r);if(!a)throw new o.A("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",c=a[2],u=(0,s.xO)(n),h=`${l}${c}.json`,d=u?`${l}${c}_${u}.json`:h;let f;try{f=await i(e(d))}catch(t){if(d===h)throw new o.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{f=await i(e(h))}catch(e){throw new o.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return f}(this.getAssetUrl,this.matcher,e,t)}}const l={};var c,u=r(2741);(0,s.ao)((c={pattern:"esri/",location:u.s},new a(c)))},71754:(e,t,r)=>{r.d(t,{V:()=>c});var s=r(53966),n=r(93637),o=r(799),i=r(97770),a=r(18047);const l=()=>s.A.getLogger("esri.intl.substitute");function c(e,t,r={}){const{format:s={}}=r;return(0,o.HC)(e,(e=>function(e,t,r){let s,o;const i=e.indexOf(":");if(-1===i?s=e.trim():(s=e.slice(0,i).trim(),o=e.slice(i+1).trim()),!s)return"";const a=(0,n.wc)(s,t);if(null==a)return"";const l=(o?r?.[o]:null)??r?.[s];return l?u(a,l):o?h(a,o):d(a)}(e,t,s)))}function u(e,t){switch(t.type){case"date":return(0,i.Yq)(e,t.intlOptions);case"number":return(0,a.ZV)(e,t.intlOptions);default:return l().warn("missing format descriptor for key {key}"),d(e)}}function h(e,t){switch(t.toLowerCase()){case"dateformat":return(0,i.Yq)(e);case"numberformat":return(0,a.ZV)(e);default:return l().warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,i.Yq)(e):/^numberformat/i.test(t)?(0,a.ZV)(e):d(e)}}function d(e){switch(typeof e){case"string":return e;case"number":return(0,a.ZV)(e);case"boolean":return""+e;default:return e instanceof Date?(0,i.Yq)(e):""}}},72457:(e,t,r)=>{r.d(t,{h:()=>o,k:()=>n});const s=new FinalizationRegistry((e=>{e.close()}));function n(e,t){s.register(e,t,t)}function o(e){s.unregister(e)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3116],{751:(e,t,r)=>{r.d(t,{CJ:()=>p});var s=r(49186),i=r(4718),a=r(93637),n=r(67124),o=r(77548);const l=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wcs","wms","wmts"]),c=new Set(["catalog","csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","knowledge-graph","map-image","map-notes","media","ogc-feature","oriented-imagery","route","stream","subtype-group","tile","unknown","unsupported","vector-tile","video","web-tile","wcs","wfs","wms","wmts"]),d=new Set([...c,"link-chart"]);function h(e,t){if(t.restrictedWebMapWriting){const r=function(e){switch(e.layerContainerType){case"basemap":return l;case"operational-layers":return"link-chart"===e.origin?d:c;default:return null}}(t);return null==r||r.has(e.type)&&!(0,o.Ov)(e)}return!0}function u(e,t){"maxScale"in e&&(t.maxScale=(0,n.B)(e.maxScale)??void 0),"minScale"in e&&(t.minScale=(0,n.B)(e.minScale)??void 0)}function p(e,t,r){if(!e.persistenceEnabled)return null;if(!("write"in e)||!e.write)return r?.messages&&r.messages.push(new s.A("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted`,{layer:e})),null;if((0,o.Ov)(e)&&!e.isTable)t=e.resourceInfo;else if(h(e,r)){const t={};return e.write(t,r)?t:null}return null!=t&&function(e,t){if(function(e,t){if(t)if((0,o.Ov)(e)){const r=(0,a.wc)("featureCollection.layers",t),s=r?.[0]?.layerDefinition;s&&u(e,s)}else"group"!==e.type&&u(e,t)}(e,t),t&&(t.id=e.id,"blendMode"in e&&(t.blendMode=e.blendMode,"normal"===t.blendMode&&delete t.blendMode),t.opacity=(0,n.B)(e.opacity)??void 0,t.title=e.title||"Layer",t.visibility=e.visible,"legendEnabled"in e&&"wmts"!==e.type))if((0,o.Ov)(e)){const r=t.featureCollection;r&&(r.showLegend=e.legendEnabled)}else t.showLegend=e.legendEnabled}(e,t=(0,i.o8)(t)),t}},5503:(e,t,r)=>{r.d(t,{A:()=>k});var s,i=r(90237),a=r(98291),n=r(65529),o=r(36563),l=r(4718),c=r(93687);!function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"}(s||(s={}));var d,h=r(11932),u=r(56507),p=r(62788),y=r(10107),g=r(7695),m=r(40608),b=r(95488),f=r(12195);class v{constructor(e,t,r,s,i){this.target=e,this.added=t,this.removed=r,this.start=s,this.deleteCount=i}}const _=new c.A(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}));function w(e){e&&"object"==typeof e&&"destroy"in e&&"function"==typeof e.destroy&&e.destroy()}function S(e){return e?e instanceof D?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function L(e){if(e?.length)return e[0]}function M(e,t,r,s){const i=Math.min(e.length-r,t.length-s);let a=0;for(;a<i&&e[r+a]===t[s+a];)a++;return a}function A(e,t,r,s){t&&t.forEach(((t,i,a)=>{e.push(t),A(e,r.call(s,t,i,a),r,s)}))}const I=new Set,T=new Set,E=new Set,O=new Map;let C=0,D=class extends n.A.EventedAccessor{static{d=this}static{this.ofType=e=>{if(!e)return d;if(O.has(e))return O.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const r in e.typeMap){const s=e.typeMap[r].prototype.declaredClass;t?t+=` | ${s}`:t=s}let r=class extends d{};return(0,i._)([(0,g.u)({Type:e,ensureType:"function"==typeof e?(0,u.dp)(e):(0,u.aq)(e)})],r.prototype,"itemType",void 0),r=(0,i._)([(0,m.$)(`esri.core.Collection<${t}>`)],r),O.set(e,r),r}}static isCollection(e){return null!=e&&e instanceof d}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new b.I,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:C++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof d?{items:e}:e:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),this._emitter.destroy(),this._notifications=null}*[Symbol.iterator](){yield*this.items}get items(){return(0,p.gc)(this._observable),this._items}set items(e){this._emitBeforeChanges(s.ADD)||(this._splice(0,this.length,S(e)),this._emitAfterChanges(s.ADD))}hasEventListener(e){return!this.destroyed&&("change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e))}on(e,t){if(this.destroyed)return(0,o.hA)();if("change"===e){const e=this._chgListeners,r={removed:!1,callback:t};return e.push(r),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),(0,o.hA)((()=>{r.removed=!0,e.splice(e.indexOf(r),1)}))}return this._emitter.on(e,t)}once(e,t){const r="deref"in t?()=>t.deref():()=>t,s=this.on(e,(e=>{r()?.call(null,e),s.remove()}));return s}add(e,t){if((0,p.gc)(this._observable),this._emitBeforeChanges(s.ADD))return this;const r=this.getNextIndex(t??null);return this._splice(r,0,[e]),this._emitAfterChanges(s.ADD),this}addMany(e,t=this._items.length){if((0,p.gc)(this._observable),!e?.length)return this;if(this._emitBeforeChanges(s.ADD))return this;const r=this.getNextIndex(t);return this._splice(r,0,S(e)),this._emitAfterChanges(s.ADD),this}at(e){if((0,p.gc)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(s.REMOVE),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return(0,p.gc)(this._observable),this._createNewInstance({items:this._items.map(l.o8)})}concat(...e){(0,p.gc)(this._observable);const t=e.map(S);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return;const r=this._splice(0,this.length),i=r.length;for(let s=0;s<i;s++)e.call(t,r[s],s,r);this._emitAfterChanges(s.REMOVE)}destroyAll(){this.drain(w)}destroyMany(e){const t=this.removeMany(e);return t.forEach(w),t}every(e,t){return(0,p.gc)(this._observable),this._items.every(e,t)}filter(e,t){(0,p.gc)(this._observable);const r=2===arguments.length?this._items.filter(e,t):this._items.filter(e);return this._createNewInstance({items:r})}find(e,t){return(0,p.gc)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,p.gc)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,p.gc)(this._observable);const r=[];return A(r,this,e,t),new d(r)}forEach(e,t){return(0,p.gc)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,p.gc)(this._observable),this._items[e]}getNextIndex(e){(0,p.gc)(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,p.gc)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,p.gc)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,p.gc)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,p.gc)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,p.gc)(this._observable);const r=this._items.map(e,t);return new d({items:r})}reorder(e,t=this.length-1){(0,p.gc)(this._observable);const r=this.indexOf(e);if(-1!==r){if(t<0?t=0:t>=this.length&&(t=this.length-1),r!==t){if(this._emitBeforeChanges(s.MOVE))return e;this._splice(r,1),this._splice(t,0,[e]),this._emitAfterChanges(s.MOVE)}return e}}pop(){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return;const e=L(this._splice(this.length-1,1));return this._emitAfterChanges(s.REMOVE),e}push(...e){return(0,p.gc)(this._observable),this._emitBeforeChanges(s.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(s.ADD)),this.length}reduce(e,t){(0,p.gc)(this._observable);const r=this._items;return 2===arguments.length?r.reduce(e,t):r.reduce(e)}reduceRight(e,t){(0,p.gc)(this._observable);const r=this._items;return 2===arguments.length?r.reduceRight(e,t):r.reduceRight(e)}remove(e){return(0,p.gc)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,p.gc)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(s.REMOVE))return;const t=L(this._splice(e,1));return this._emitAfterChanges(s.REMOVE),t}removeMany(e){if((0,p.gc)(this._observable),!e?.length||this._emitBeforeChanges(s.REMOVE))return[];const t=e instanceof d?e.toArray():e,r=this._items,i=[],a=t.length;for(let e=0;e<a;e++){const s=t[e],a=r.indexOf(s);if(a>-1){const s=1+M(t,r,e+1,a+1),n=this._splice(a,s);n&&n.length>0&&i.push.apply(i,n),e+=s-1}}return this._emitAfterChanges(s.REMOVE),i}reverse(){if((0,p.gc)(this._observable),this._emitBeforeChanges(s.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(s.MOVE),this}shift(){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(s.REMOVE))return;const e=L(this._splice(0,1));return this._emitAfterChanges(s.REMOVE),e}slice(e=0,t=this.length){return(0,p.gc)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,p.gc)(this._observable),this._items.some(e,t)}sort(e){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(s.MOVE)||!this._requiresSort(e))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(s.MOVE),this}_requiresSort(e=(e,t)=>e===t?0:e<t?-1:1){const t=this.length-1;for(let r=0;r<t;r++)if(e(this.items[r],this.items[r+1])>0)return!0;return!1}splice(e,t,...r){(0,p.gc)(this._observable),1===arguments.length&&(t=this.length),t??=0;const i=(t?s.REMOVE:0)|(r.length?s.ADD:0);if(this._emitBeforeChanges(i))return[];const a=this._splice(e,t,r)||[];return this._emitAfterChanges(i),a}toArray(){return(0,p.gc)(this._observable),this._items.slice()}toJSON(e){return(0,p.gc)(this._observable),this.toArray().map((t=>(0,f.W)(t)?t.toJSON(e):t))}toLocaleString(){return(0,p.gc)(this._observable),this._items.toLocaleString()}toString(){return(0,p.gc)(this._observable),this._items.toString()}unshift(...e){return(0,p.gc)(this._observable),!e.length||this._emitBeforeChanges(s.ADD)||(this._splice(0,0,e),this._emitAfterChanges(s.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,r){const s=this._items,i=this.itemType;let a,n;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=(0,h._)((()=>this._dispatchChange()))),e<0&&(e+=this.length),t){if(n=s.splice(e,t),this.hasEventListener("before-remove")){const t=_.acquire();t.target=this,t.cancellable=!0;for(let r=0,i=n.length;r<i;r++)a=n[r],t.reset(a),this.emit("before-remove",t),t.defaultPrevented&&(n.splice(r,1),s.splice(e,0,a),e+=1,r-=1,i-=1);_.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=_.acquire();e.target=this,e.cancellable=!1;const t=n.length;for(let r=0;r<t;r++)e.reset(n[r]),this.emit("after-remove",e);_.release(e)}}if(r?.length){if(i){const e=[];for(const t of r){const r=i.ensureType(t);null==r&&null!=t||e.push(r)}r=e}const t=this.hasEventListener("before-add"),a=this.hasEventListener("after-add"),n=e===this.length;if(t||a){const i=_.acquire();i.target=this,i.cancellable=!0;const o=_.acquire();o.target=this,o.cancellable=!1;for(const l of r)t?(i.reset(l),this.emit("before-add",i),i.defaultPrevented||(n?s.push(l):s.splice(e++,0,l),this._set("length",s.length),a&&(o.reset(l),this.emit("after-add",o)))):(n?s.push(l):s.splice(e++,0,l),this._set("length",s.length),o.reset(l),this.emit("after-add",o));_.release(o),_.release(i)}else{if(n)for(const e of r)s.push(e);else s.splice(e,0,...r);this._set("length",s.length)}}if((r?.length||n?.length)&&this._notifyChangeEvent(r,n),this.hasEventListener("after-splice")){const s=new v(this,r,n,e,t);this.emit("after-splice",s)}return n}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const r=_.acquire();r.target=this,r.cancellable=!0,r.type=e,this.emit("before-changes",r),t=r.defaultPrevented,_.release(r)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=_.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),_.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),this._updating=!1,!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;I.clear(),T.clear(),E.clear();for(const{added:t,removed:r}of e){if(t)if(0===E.size&&0===T.size)for(const e of t)I.add(e);else for(const e of t)T.has(e)?(E.add(e),T.delete(e)):E.has(e)||I.add(e);if(r)if(0===E.size&&0===I.size)for(const e of r)T.add(e);else for(const e of r)I.has(e)?I.delete(e):(E.delete(e),T.add(e))}const r=a.A.acquire();I.forEach((e=>{r.push(e)}));const s=a.A.acquire();T.forEach((e=>{s.push(e)}));const i=this._items,n=t.items,o=a.A.acquire();if(E.forEach((e=>{n.indexOf(e)!==i.indexOf(e)&&o.push(e)})),t.listeners&&(r.length||s.length||o.length)){const e={target:this,added:r,removed:s,moved:o},i=t.listeners.length;for(let r=0;r<i;r++){const s=t.listeners[r];s.removed||s.callback.call(this,e)}}a.A.release(r),a.A.release(s),a.A.release(o)}I.clear(),T.clear(),E.clear()}};(0,i._)([(0,y.MZ)()],D.prototype,"_updating",void 0),(0,i._)([(0,y.MZ)()],D.prototype,"length",void 0),(0,i._)([(0,y.MZ)()],D.prototype,"items",null),(0,i._)([(0,y.MZ)({readOnly:!0})],D.prototype,"updating",null),D=d=(0,i._)([(0,m.$)("esri.core.Collection")],D);const k=D},7695:(e,t,r)=>{function s(e){return(t,r)=>{t[r]=e}}r.d(t,{u:()=>s})},18047:(e,t,r)=>{r.d(t,{ZV:()=>l,yx:()=>o});var s=r(73444);const i={ar:"ar-u-nu-latn",bs:"hr",nn:"no-NN"};let a=new WeakMap,n={};function o(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function l(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||n;if(!a.has(t)){const r=(0,s.JK)(),n=(0,s.ZS)(r)?.language,o=n&&i[n]||r;a.set(t,new Intl.NumberFormat(o,e))}return a.get(t)}(t).format(e)}(0,s.Ml)((()=>{a=new WeakMap,n={}})),new Map},36708:(e,t,r)=>{r.d(t,{C_:()=>u,OH:()=>g,Vh:()=>m,on:()=>h,pc:()=>b,wB:()=>l,z7:()=>c});var s=r(37955),i=r(36563),a=r(97768),n=r(74887),o=r(14012);function l(e,t,r={}){return d(e,t,r,p)}function c(e,t,r={}){return d(e,t,r,y)}function d(e,t,r={},s){let i=null;const n=r.once?(e,r)=>{s(e)&&((0,a.xt)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,o.Cn)(e,n,r.sync,r.equals),r.initial){const t=e();n(t,t)}return i}function h(e,t,r,n={}){let o=null,c=null,d=null;function h(){o&&c&&(c.remove(),n.onListenerRemove?.(o),o=null,c=null)}function u(e){n.once&&n.once&&(0,a.xt)(d),r(e)}const p=l(e,((e,r)=>{h(),(0,s.wb)(e)&&(o=e,c=(0,s.on)(e,t,u),n.onListenerAdd?.(e))}),{sync:n.sync,initial:!0});return d=(0,i.hA)((()=>{p.remove(),h()})),d}function u(e,t){return function(e,t,r){if((0,n.G4)(r))return Promise.reject((0,n.NK)());const s=e();if(t?.(s))return Promise.resolve(s);let o=null;function l(){o=(0,a.xt)(o)}return new Promise(((s,a)=>{o=(0,i.vE)([(0,n.u7)(r,(()=>{l(),a((0,n.NK)())})),d(e,(e=>{l(),s(e)}),{sync:!1,once:!0},t??p)])}))}(e,y,t)}function p(e){return!0}function y(e){return!!e}r(80559);const g={sync:!0},m={initial:!0},b={sync:!0,initial:!0}},43281:(e,t,r)=>{r.d(t,{H:()=>n,q:()=>a});var s=r(2741),i=r(10838);async function a(e){if(!e)return;const t=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,r=await(0,i.ud)("esri/t9n/basemaps");return r[e]||r[t]}const n={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]}}},47566:(e,t,r)=>{r(97770),r(18047),r(71754),r(73444);var s=r(10838),i=r(78888),a=r(49186);async function n(e){if(null!=l.fetchBundleAsset)return l.fetchBundleAsset(e);const t=await(0,i.A)(e,{responseType:"text"});return JSON.parse(t.data)}class o{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let s;s="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=s,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)\\/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,i){const o=t.exec(r);if(!o)throw new a.A("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=o[1]?`${o[1]}/`:"",c=o[2],d=(0,s.xO)(i),h=`${l}${c}.json`,u=d?`${l}${c}_${d}.json`:h;let p;try{p=await n(e(u))}catch(t){if(u===h)throw new a.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{p=await n(e(h))}catch(e){throw new a.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return p}(this.getAssetUrl,this.matcher,e,t)}}const l={};var c,d=r(2741);(0,s.ao)((c={pattern:"esri/",location:d.s},new o(c)))},60999:(e,t,r)=>{r.d(t,{DZ:()=>y,Ke:()=>p,Tj:()=>d,UT:()=>g,jJ:()=>c});var s=r(90237),i=r(69622),a=r(97768),n=r(74887),o=r(10107),l=r(40608);function c(e,t,r){return(0,n.Lx)(e.map(((e,s)=>t.apply(r,[e,s]))))}async function d(e,t,r){return(await(0,n.Lx)(e.map(((e,s)=>t.apply(r,[e,s]))))).map((e=>e.value))}function h(e){return{ok:!0,value:e}}function u(e){return{ok:!1,error:e}}async function p(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return h(await e)}catch(e){return u(e)}}async function y(e){try{return h(await e)}catch(e){return(0,n.QP)(e),u(e)}}function g(e,t){return new m(e,t)}let m=class extends i.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,a.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=e(r),this.promise.then((e=>{this._result=h(e),this._cleanup()}),(e=>{this._result=u(e),this._cleanup()})),this._abortHandle=(0,n.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,a.xt)(this._abortHandle),this._abortController=null}};(0,s._)([(0,o.MZ)()],m.prototype,"value",null),(0,s._)([(0,o.MZ)()],m.prototype,"error",null),(0,s._)([(0,o.MZ)()],m.prototype,"finished",null),(0,s._)([(0,o.MZ)()],m.prototype,"promise",void 0),(0,s._)([(0,o.MZ)()],m.prototype,"_result",void 0),m=(0,s._)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],m)},62885:(e,t,r)=>{r.d(t,{H:()=>a,V:()=>i});var s=r(5503);function i(e,t,r=s.A){return t||(t=new r),t===e||(t.removeAll(),(i=e)&&(Array.isArray(i)||"items"in i&&Array.isArray(i.items))?t.addMany(e):e&&t.add(e)),t;var i}function a(e){return e}},65529:(e,t,r)=>{r.d(t,{A:()=>l});var s=r(90237),i=r(69622),a=r(36563),n=r(40608);class o{constructor(){this._emitter=new o.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?.clear(),this._listenersMap=null}destroy(){this.clear()}emit(e,t){let r=this._listenersMap?.get(e);if(!r)return!1;const s=this._target||this;let i=!1;for(const e of r.slice()){const r="deref"in e?e.deref():e;r?r?.call(s,t):i=!0}return i&&(r=r.filter((e=>!("deref"in e)||null!=e.deref())),this._listenersMap.set(e,r)),r.length>0}on(e,t){if(Array.isArray(e)){const r=e.map((e=>this.on(e,t)));return(0,a.vE)(r)}if(e.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap??=new Map;const r=this._listenersMap.get(e)||[];return r.push(t),this._listenersMap.set(e,r),(0,a.hA)((()=>{const r=this._listenersMap?.get(e),s=r?.indexOf(t)??-1;s>=0&&r.splice(s,1)}))}once(e,t){const r=this.on(e,(e=>{r.remove();const s="deref"in t?t.deref():t;s?.call(null,e)}));return r}hasEventListener(e){const t=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,s._)([(0,n.$)("esri.core.Evented")],r),r};let r=class extends i.A{constructor(){super(...arguments),this._emitter=new o.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,s._)([(0,n.$)("esri.core.Evented.EventedAccessor")],r),e.EventedAccessor=r}(o||(o={}));const l=o},71754:(e,t,r)=>{r.d(t,{V:()=>c});var s=r(53966),i=r(93637),a=r(799),n=r(97770),o=r(18047);const l=()=>s.A.getLogger("esri.intl.substitute");function c(e,t,r={}){const{format:s={}}=r;return(0,a.HC)(e,(e=>function(e,t,r){let s,a;const n=e.indexOf(":");if(-1===n?s=e.trim():(s=e.slice(0,n).trim(),a=e.slice(n+1).trim()),!s)return"";const o=(0,i.wc)(s,t);if(null==o)return"";const l=(a?r?.[a]:null)??r?.[s];return l?d(o,l):a?h(o,a):u(o)}(e,t,s)))}function d(e,t){switch(t.type){case"date":return(0,n.Yq)(e,t.intlOptions);case"number":return(0,o.ZV)(e,t.intlOptions);default:return l().warn("missing format descriptor for key {key}"),u(e)}}function h(e,t){switch(t.toLowerCase()){case"dateformat":return(0,n.Yq)(e);case"numberformat":return(0,o.ZV)(e);default:return l().warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,n.Yq)(e):/^numberformat/i.test(t)?(0,o.ZV)(e):u(e)}}function u(e){switch(typeof e){case"string":return e;case"number":return(0,o.ZV)(e);case"boolean":return""+e;default:return e instanceof Date?(0,n.Yq)(e):""}}},77548:(e,t,r)=>{r.d(t,{tk:()=>h,BR:()=>d,wI:()=>c,Ov:()=>o,W_:()=>l,TU:()=>n,XX:()=>a});var s=r(70333),i=r(78888);r(5503),r(36563),r(36708),new WeakMap;const a={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function n(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function o(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function l(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}async function c(e,t){const r=s.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const a=e.toLowerCase().indexOf("/rest/services");if(-1===a)return null;const n=`${e.slice(0,a)}/rest/info`,o=null!=t?t.signal:null,{data:l}=await(0,i.A)(n,{query:{f:"json"},responseType:"json",signal:o});return l?.owningSystemUrl||null}function d(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function h(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}},81583:(e,t,r)=>{r.d(t,{L:()=>o,g:()=>n});var s=r(60999),i=r(5503),a=r(92474);async function n(e,t){return await e.load(),o(e,t)}async function o(e,t){const r=[],n=(...e)=>{for(const t of e)null!=t&&(Array.isArray(t)?n(...t):i.A.isCollection(t)?t.forEach((e=>n(e))):a.A.isLoadable(t)&&r.push(t))};t(n);let o=null;if(await(0,s.Tj)(r,(async e=>{const t=await(0,s.Ke)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load());!1!==t.ok||o||(o=t)})),o)throw o.error;return e}},83116:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var s=r(90237),i=r(92602),a=r(78888),n=r(5503),o=r(62885),l=r(25482),c=r(4718),d=r(92474),h=r(81583),u=r(53966),p=r(97768),y=r(74887),g=r(84952),m=r(10107),b=(r(44208),r(40608)),f=r(43937),v=r(16930),_=r(20655),w=r(80812),S=r(43281),L=(r(47566),r(69622)),M=(r(87811),r(73444)),A=r(10838);let I=class extends L.A{constructor(e){super(e),this.apiKey=null,this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2",this.worldview=null}get languageParameter(){const e=this.language;let t="local"===e||"global"===e?e:(0,A.xO)(e??(0,M.JK)())??"global";return t="no"===t?"nb":t,t}};(0,s._)([(0,m.MZ)()],I.prototype,"apiKey",void 0),(0,s._)([(0,m.MZ)()],I.prototype,"id",void 0),(0,s._)([(0,m.MZ)()],I.prototype,"language",void 0),(0,s._)([(0,m.MZ)()],I.prototype,"places",void 0),(0,s._)([(0,m.MZ)()],I.prototype,"serviceUrl",void 0),(0,s._)([(0,m.MZ)()],I.prototype,"worldview",void 0),I=(0,s._)([(0,b.$)("esri.support.BasemapStyle")],I);const T=I;var E,O=r(751);let C=0,D=E=class extends(l.A.JSONSupportMixin(d.A)){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+C++,this.baseLayers=new n.A,this.referenceLayers=new n.A;const t=e=>{e.parent&&e.parent!==this&&"remove"in e.parent&&e.parent.remove(e),e.parent=this,"elevation"===e.type&&u.A.getLogger(this).error(`Layer '${e.title}, id:${e.id}' of type '${e.type}' is not supported as a basemap layer and will therefore be ignored.`)},r=e=>{e.parent=null};this.addHandles([this.baseLayers.on("after-add",(e=>t(e.item))),this.referenceLayers.on("after-add",(e=>t(e.item))),this.baseLayers.on("after-remove",(e=>r(e.item))),this.referenceLayers.on("after-remove",(e=>r(e.item)))])}initialize(){this.when().catch((e=>{u.A.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)})),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const t of e)t.destroy();const t=this.referenceLayers.toArray();for(const e of t)e.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=(0,p.pR)(this.portalItem)}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set("baseLayers",(0,o.V)(e,this._get("baseLayers")))}_writeBaseLayers(e,t,r){const s=[];e?(r={...r,layerContainerType:"basemap"},this.baseLayers.forEach((e=>{const t=(0,O.CJ)(e,r.webmap?r.webmap.getLayerJSONFromResourceInfo(e):null,r);null!=t&&s.push(t)})),this.referenceLayers.forEach((e=>{const t=(0,O.CJ)(e,r.webmap?r.webmap.getLayerJSONFromResourceInfo(e):null,r);null!=t&&("scene"!==e.type&&(t.isReference=!0),s.push(t))})),t.baseMapLayers=s):t.baseMapLayers=s}set referenceLayers(e){this._set("referenceLayers",(0,o.V)(e,this._get("referenceLayers")))}writeTitle(e,t){t.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return(0,h.g)(this,(e=>{e(this.baseLayers,this.referenceLayers)}))}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map((e=>(0,c.Nb)(e)?e.clone():e)),referenceLayers:this.referenceLayers.map((e=>(0,c.Nb)(e)?e.clone():e))};return this.loaded&&(e.loadStatus="loaded"),new E({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}write(e,t){return e=e||{},t?.origin||(t={origin:"web-map",...t}),super.write(e,t),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map((e=>{const t=(0,c.o8)(e);return t.url&&(0,g.BQ)(t.url)&&(t.url=`https:${t.url}`),t.templateUrl&&(0,g.BQ)(t.templateUrl)&&(t.templateUrl=`https:${t.templateUrl}`),t}))),e}async _loadFromSource(e){const{resourceInfo:t,portalItem:r,style:s}=this;(0,y.Te)(e);const i=[];if(t){const r=t.context?t.context.url:null;if(i.push(this._loadLayersFromJSON(t.data,r,e)),t.data.id&&!t.data.title){const e=t.data.id;i.push((0,S.q)(e).then((e=>{e&&this.read({title:e},t.context)})))}}else r?i.push(this._loadFromItem(r,e)):s&&i.push(this._loadFromStylesService(s,e));await Promise.all(i)}async _loadLayersFromJSON(e,t,s){const i=this.resourceInfo?.context,a=this.portalItem?.portal||i?.portal||null,n=U[i?.origin||""]??"web-map",{populateOperationalLayers:o}=await Promise.all([r.e(8988),r.e(5356)]).then(r.bind(r,75356)),l=[];if((0,y.Te)(s),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const r={context:{...i,origin:n,url:t,portal:a,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},s=e=>"web-scene"===n&&"ArcGISSceneServiceLayer"===e.layerType||e.isReference,c=o(this.baseLayers,e.baseMapLayers.filter((e=>!s(e))),r);l.push(c);const d=o(this.referenceLayers,e.baseMapLayers.filter(s),r);l.push(d)}await Promise.allSettled(l)}async _loadFromItem(e,t){const r=await e.load(t),s=await r.fetchData("json",t),i=(0,g.An)(e.itemUrl??"");return this._set("resourceInfo",{data:s.baseMap??{},context:{origin:k[e.type||""]??"web-map",portal:e.portal||_.A.getDefault(),url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:s.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||_.A.getDefault(),url:i}),this._loadLayersFromJSON(this.resourceInfo.data,i,t)}async _loadFromStylesService(e,t){const r=e.serviceUrl.endsWith("/webmaps")?e.serviceUrl.slice(0,-8):e.serviceUrl,s=`${r}/styles/${e.id}/self`,n=`${r}/webmaps/${e.id}`,o=e.apiKey??i.A.apiKeys.basemapStyles,[l,c]=await Promise.all([(await(0,a.A)(s,{query:{token:o},signal:t?.signal})).data,(await(0,a.A)(n,{query:{language:e.languageParameter,places:e.places,worldview:e.worldview,token:o},signal:t?.signal})).data]);this.thumbnailUrl??=l.thumbnailUrl;const d=(0,g.An)(n);if(this._set("resourceInfo",{data:c.baseMap??{},context:{origin:"web-map",url:d}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:c.spatialReference},this.resourceInfo.context),await this._loadLayersFromJSON(this.resourceInfo.data,d,t),o)for(const e of[...this.baseLayers,...this.referenceLayers])"apiKey"in e&&(e.apiKey=o)}static fromId(e){const t=S.H[e];return t?t.itemId?new E({portalItem:{id:t.itemId,portal:{url:"https://www.arcgis.com"}}}):E.fromJSON(t,t.is3d?{origin:"web-scene",portal:new _.A({url:"https://www.arcgis.com"})}:{origin:"web-map"}):null}};(0,s._)([(0,m.MZ)({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,t,r,s){this._writeBaseLayers(e,t,s)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:n.A}},writer(e,t,r,s){this._writeBaseLayers(e,t,s)}}}}}})],D.prototype,"baseLayers",null),(0,s._)([(0,m.MZ)({type:String,json:{origins:{"web-scene":{write:!0}}}})],D.prototype,"id",void 0),(0,s._)([(0,m.MZ)({type:w.default})],D.prototype,"portalItem",void 0),(0,s._)([(0,m.MZ)()],D.prototype,"referenceLayers",null),(0,s._)([(0,m.MZ)({readOnly:!0})],D.prototype,"resourceInfo",void 0),(0,s._)([(0,m.MZ)({type:v.A})],D.prototype,"spatialReference",void 0),(0,s._)([(0,m.MZ)({type:T})],D.prototype,"style",void 0),(0,s._)([(0,m.MZ)()],D.prototype,"thumbnailUrl",void 0),(0,s._)([(0,m.MZ)({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],D.prototype,"title",void 0),(0,s._)([(0,f.K)("title")],D.prototype,"writeTitle",null),D=E=(0,s._)([(0,b.$)("esri.Basemap")],D);const k={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},U={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},x=D}}]);
|