@arcgis/core 4.27.0-next.20230321 → 4.27.0-next.20230322
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/analysis/LineOfSightAnalysisObserver.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02b6227c156ee0d8eb66.js +1 -0
- package/assets/esri/core/workers/chunks/{7e0c65aa61c2ff0c3504.js → 1c98b92933a48cf96c1e.js} +1 -1
- package/assets/esri/core/workers/chunks/321f272d4c7ed6b0cb46.js +1 -0
- package/assets/esri/core/workers/chunks/47bd558e2ce89f47f908.js +1 -0
- package/assets/esri/core/workers/chunks/76d6c1fc25f02bcf258e.js +1 -0
- package/assets/esri/core/workers/chunks/{c5d872adce711ec61ede.js → 8980c5dc389c27368b73.js} +1 -1
- package/assets/esri/core/workers/chunks/8d0143c0ff009b98a31f.js +1 -0
- package/assets/esri/core/workers/chunks/{6acaf28cba5d49a98fb6.js → 91b292f310f06a0cbf72.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff9efa829497557ec26a.js → aa4640a0207e0be224e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{92951b85676df776961f.js → ab8139e3a875a8b8dab9.js} +23 -25
- package/assets/esri/core/workers/chunks/{c8cd3fde6d8d43ddb954.js → b6cdf4daf07d9e55f61e.js} +1 -1
- package/assets/esri/core/workers/chunks/{6b14673a4afd6ef81487.js → c76cabd2d2510a653dff.js} +1 -1
- package/assets/esri/core/workers/chunks/{4be7647605300e07e843.js → c90fff7e28ba5b443b11.js} +1 -1
- package/assets/esri/core/workers/chunks/{e637e47000f4dc48054d.js → cc7f4fd20443a2acf0f1.js} +1 -1
- package/assets/esri/core/workers/chunks/d19e9fab4f4fb765c6a3.js +1 -0
- package/assets/esri/core/workers/chunks/d9ef4891c8b0bdd90f5b.js +1 -0
- package/assets/esri/core/workers/chunks/{d92d6a43270fb0d366b4.js → de4f5c48efbcee82c3c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{32f9b488915a4a8864e5.js → f8b9e0c1671e55b61904.js} +1 -1
- package/assets/esri/views/3d/analysis/Slice/images/heading-rotate.ts.svg +7 -28
- package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.svg +11 -0
- package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
- package/chunks/ComponentShader.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +4 -4
- package/chunks/vec42.js +1 -1
- package/core/Loadable.js +1 -1
- package/core/accessorSupport/Property.js +1 -1
- package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
- package/geometry/support/buffer/math/vec4.js +1 -1
- package/interfaces.d.ts +1 -1
- package/layers/LineOfSightLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/RefreshableLayer.js +1 -1
- package/layers/support/rasterFunctions/clipUtils.js +1 -1
- package/layers/support/rasterFunctions/stretchUtils.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/images/Factory.js +1 -1
- package/views/3d/analysis/Slice/images/generateTextures.js +1 -1
- package/views/3d/analysis/Slice/images/heading-rotate-svg.js +1 -1
- package/views/3d/analysis/Slice/images/tilt-rotate-svg.js +5 -0
- package/views/3d/analysis/Slice/settings.js +5 -0
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/PointCloudRendererUtil.js +1 -1
- package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
- package/views/3d/layers/i3s/PointGraphic.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
- package/views/3d/terrain/GeometryState.js +1 -1
- package/views/3d/terrain/PatchGeometry.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +6 -5
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +11 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/AnimationTimeStep.js +1 -1
- package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/Normals.js +5 -0
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/LayerViewManager.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/layers/SceneLayerView.js +1 -1
- package/views/webgl/ShaderTranspiler.js +1 -1
- package/widgets/Expand.js +1 -1
- package/assets/esri/core/workers/chunks/0487ab23a20ec356ab4c.js +0 -1
- package/assets/esri/core/workers/chunks/29ee4f14602caf6967e4.js +0 -1
- package/assets/esri/core/workers/chunks/2c0775541cfec9d43acb.js +0 -1
- package/assets/esri/core/workers/chunks/4879164b48da9ad4547a.js +0 -1
- package/assets/esri/core/workers/chunks/69060e5cffc19e76062a.js +0 -1
- package/assets/esri/core/workers/chunks/a71a5c8a9aa302bf6f01.js +0 -1
- package/assets/esri/core/workers/chunks/bc002e4dff8859571a7a.js +0 -1
- package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.svg +0 -80
- package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.png +0 -0
- package/views/3d/analysis/Slice/images/tilt-rotate-png.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/DecodeNormal.glsl.js +0 -8
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1400],{43697:(t,e,r)=>{function n(t,e,r,n){var s,i=arguments.length,o=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}r.d(e,{_:()=>n})},15923:(t,e,r)=>{r.d(e,{Z:()=>P});var n=r(61247),s=r(70586),i=r(88022),o=r(67723),a=r(7628),c=(r(80442),r(22974)),l=r(92604),u=r(71143),h=r(97831),f=r(42100),d=r(31263),p=r(58971),y=r(44550);class g{constructor(t,e,r){this.properties=t,this.propertyName=e,this.metadata=r,this.observerObject=new _,this._accessed=null,this._handles=null,this.observerObject.flags=y.v.Dirty|(r.nonNullable?y.v.NonNullable:0)|(r.hasOwnProperty("value")?y.v.HasDefaultValue:0)|(void 0===r.get?y.v.DepTrackingInitialized:0)|(void 0===r.dependsOn?y.v.AutoTracked:0),v.register(this,this.observerObject,this.observerObject)}destroy(){v.unregister(this.observerObject),this.observerObject.destroy(),this._accessed=null,this._clearObservationHandles()}getComputed(){const t=this.observerObject;(0,p.it)(t);const e=this.properties.store,r=this.propertyName,n=t.flags,s=e.get(r);if(n&y.v.Computing)return s;if(~n&y.v.Dirty&&e.has(r))return s;t.flags|=y.v.Computing;const i=this.properties.host;let o;n&y.v.AutoTracked?o=(0,p.LJ)(this,this.metadata.get,i):((0,p.GF)(i,this),o=this.metadata.get.call(i)),e.set(r,o,d.s3.COMPUTED);const a=e.get(r);return a===s?t.flags&=~y.v.Dirty:(0,p.gb)(this.commit,this),t.flags&=~y.v.Computing,a}onObservableAccessed(t){t!==this.observerObject&&(null===this._accessed&&(this._accessed=[]),this._accessed.includes(t)||this._accessed.push(t))}onTrackingEnd(){this._clearObservationHandles();const t=this.observerObject;t.flags|=y.v.DepTrackingInitialized;const e=this._accessed;if(null===e)return;let r=this._handles;null===r&&(r=this._handles=[]);for(let n=0;n<e.length;++n)r.push(e[n].observe(t));e.length=0}notifyChange(){const t=this.observerObject;t.onInvalidated(),t.onCommitted()}invalidate(){this.observerObject.onInvalidated()}commit(){const t=this.observerObject;t.flags&=~y.v.Dirty,t.onCommitted()}_clearObservationHandles(){const t=this._handles;if(null!==t){for(let e=0;e<t.length;++e)t[e].remove();t.length=0}}}class _ extends f.s{constructor(){super(...arguments),this.flags=0}onInvalidated(){~this.flags&y.v.Overriden&&(this.flags|=y.v.Dirty);const t=this._observers;if(t&&t.length>0)for(const e of t)e.onInvalidated()}onCommitted(){const t=this._observers;if(t&&t.length>0){const e=t.slice();for(const t of e)t.onCommitted()}}destroy(){this.flags&y.v.Dirty&&this.onCommitted(),super.destroy()}}const v=new FinalizationRegistry((t=>{t.destroy()}));class m{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(t){const e=new m;return this._values.forEach(((r,n)=>{t&&t.has(n)||e.set(n,(0,c.d9)(r))})),e}get(t){return this._values.get(t)}originOf(){return d.s3.USER}keys(){return[...this._values.keys()]}set(t,e){this._values.set(t,e)}delete(t){this._values.delete(t)}has(t){return this._values.has(t)}forEach(t){this._values.forEach(t)}}var b=r(1153);function w(t,e,r){return void 0!==t}function O(t,e,r,n){return!(void 0===t||null==r&&t.observerObject.flags&y.v.NonNullable&&(n.lifecycle,h.F.INITIALIZING,1))}function A(t){return t&&"function"==typeof t.destroy}l.Z.getLogger("esri.core.accessorSupport.Properties");class j{constructor(t){this.host=t,this.properties=new Map,this.ctorArgs=null,this.destroyed=!1,this.lifecycle=h.F.INITIALIZING,this.store=new m,this._origin=d.s3.USER;const e=(0,s.j0)(this.host.constructor.__accessorMetadata__);for(const t in e){const r=new g(this,t,e[t]);this.properties.set(t,r)}this.metadatas=e}initialize(){this.lifecycle=h.F.CONSTRUCTING}constructed(){this.lifecycle=h.F.CONSTRUCTED}destroy(){this.destroyed=!0;for(const[t,e]of this.properties){if(e.metadata.autoDestroy){const r=this.internalGet(t);r&&A(r)&&(r.destroy(),~e.observerObject.flags&y.v.NonNullable&&this._internalSet(e,null))}e.destroy()}}get initialized(){return this.lifecycle!==h.F.INITIALIZING}get(t){const e=this.properties.get(t);if(e.metadata.get)return e.getComputed();(0,p.it)(e.observerObject);const r=this.store;return r.has(t)?r.get(t):e.metadata.value}originOf(t){const e=this.store.originOf(t);if(void 0===e){const e=this.properties.get(t);if(void 0!==e&&e.observerObject.flags&y.v.HasDefaultValue)return"defaults"}return(0,d.x3)(e)}has(t){return!!this.properties.has(t)&&this.store.has(t)}keys(){return[...this.properties.keys()]}internalGet(t){const e=this.properties.get(t);if(w(e))return this.store.has(t)?this.store.get(t):e.metadata.value}internalSet(t,e){const r=this.properties.get(t);w(r)&&this._internalSet(r,e)}getDependsInfo(t,e,r){const n=this.properties.get(e);if(!w(n))return"";const s=new Set,i=(0,p.LJ)({onObservableAccessed:t=>s.add(t),onTrackingEnd:()=>{}},(()=>n.metadata.get?.call(t)));let o=`${r}${t.declaredClass.split(".").pop()}.${e}: ${i}\n`;if(0===s.size)return o;r+=" ";for(const t of s){if(!(t instanceof g))continue;const e=t.properties.host,n=t.propertyName,s=(0,b.vw)(e);o+=s?s.getDependsInfo(e,n,r):`${r}${n}: undefined\n`}return o}setAtOrigin(t,e,r){const n=this.properties.get(t);if(w(n))return this._setAtOrigin(n,e,r)}isOverridden(t){const e=this.properties.get(t);return void 0!==e&&!!(e.observerObject.flags&y.v.Overriden)}clearOverride(t){const e=this.properties.get(t),r=e?.observerObject;r&&r.flags&y.v.Overriden&&(r.flags&=~y.v.Overriden,e.notifyChange())}override(t,e){const r=this.properties.get(t);if(!O(r,0,e,this))return;const n=r.metadata.cast;if(n){const t=this._cast(n,e),{valid:r,value:s}=t;if(S.release(t),!r)return;e=s}r.observerObject.flags|=y.v.Overriden,this._internalSet(r,e)}set(t,e){const r=this.properties.get(t);if(!O(r,0,e,this))return;const n=r.metadata.cast;if(n){const t=this._cast(n,e),{valid:r,value:s}=t;if(S.release(t),!r)return;e=s}const s=r.metadata.set;s?s.call(this.host,e):this._internalSet(r,e)}setDefaultOrigin(t){this._origin=(0,d.M9)(t)}getDefaultOrigin(){return(0,d.x3)(this._origin)}notifyChange(t){const e=this.properties.get(t);void 0!==e&&e.notifyChange()}invalidate(t){const e=this.properties.get(t);void 0!==e&&e.invalidate()}commit(t){const e=this.properties.get(t);void 0!==e&&e.commit()}_internalSet(t,e){const r=this.lifecycle!==h.F.INITIALIZING?this._origin:d.s3.DEFAULTS;this._setAtOrigin(t,e,r)}_setAtOrigin(t,e,r){const n=this.store,s=t.propertyName;n.has(s,r)&&(0,c.fS)(e,n.get(s))&&~t.observerObject.flags&y.v.Overriden&&r===n.originOf(s)||(t.invalidate(),n.set(s,e,r),t.commit(),(0,p.mS)(this.host,t))}_cast(t,e){const r=S.acquire();return r.valid=!0,r.value=e,t&&(r.value=t.call(this.host,e,r)),r}}const S=new u.Z(class{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}});var T,E,N=r(37697),k=r(26258),C=r(5600),I=r(52011);function M(t){if(null==t)return{value:t};if(Array.isArray(t))return{type:[t[0]],value:null};switch(typeof t){case"object":return t.constructor?.__accessorMetadata__||t instanceof Date?{type:t.constructor,value:t}:t;case"boolean":return{type:Boolean,value:t};case"string":return{type:String,value:t};case"number":return{type:Number,value:t};case"function":return{type:t,value:null};default:return}}const D=Symbol("Accessor-Handles"),U=Symbol("Accessor-Initialized");class P{static createSubclass(t={}){if(Array.isArray(t))throw new Error("Multi-inheritance unsupported since 4.16");const{properties:e,declaredClass:r,constructor:n}=t;delete t.declaredClass,delete t.properties,delete t.constructor;const s=this;class i extends s{constructor(...t){super(...t),this.inherited=null,n&&n.apply(this,t)}}(0,a.fp)(i.prototype);for(const e in t){const r=t[e];i.prototype[e]="function"==typeof r?function(...t){const n=this.inherited;let i;this.inherited=function(...t){if(s.prototype[e])return s.prototype[e].apply(this,t)};try{i=r.apply(this,t)}catch(t){throw this.inherited=n,t}return this.inherited=n,i}:t[e]}for(const t in e){const r=M(e[t]);(0,C.Cb)(r)(i.prototype,t)}return(0,I.j)(r)(i)}constructor(...t){if(this[T]=null,this[E]=!1,this.constructor===P)throw new Error("[accessor] cannot instantiate Accessor. This can be fixed by creating a subclass of Accessor");Object.defineProperty(this,"__accessor__",{enumerable:!1,value:new j(this)}),t.length>0&&this.normalizeCtorArgs&&(this.__accessor__.ctorArgs=this.normalizeCtorArgs.apply(this,t))}postscript(t){const e=this.__accessor__,r=e.ctorArgs||t;e.initialize(),r&&(this.set(r),e.ctorArgs=null),e.constructed(),this.initialize(),this[U]=!0}initialize(){}[i.F](){this[D]=(0,s.SC)(this[D])}destroy(){this.destroyed||((0,k.BT)(this),this.__accessor__.destroy())}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[U]}get destroyed(){return this.__accessor__&&this.__accessor__.destroyed||!1}commitProperty(t){this.get(t)}get(t){return(0,o.U2)(this,t)}hasOwnProperty(t){return this.__accessor__?this.__accessor__.has(t):Object.prototype.hasOwnProperty.call(this,t)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(t,e){return(0,N.t)(this,t,e),this}watch(t,e,r){return(0,k.YP)(this,t,e,r)}own(t){this.addHandles(t)}addHandles(t,e){if(this.destroyed){const e=Array.isArray(t)?t:[t];for(const t of e)t.remove();return}let r=this[D];null==r&&(r=this[D]=new n.Z),r.add(t,e)}removeHandles(t){const e=this[D];null!=e&&e.remove(t)}removeAllHandles(){const t=this[D];null!=t&&t.removeAll()}hasHandles(t){const e=this[D];return null!=e&&e.has(t)}_override(t,e){void 0===e?this.__accessor__.clearOverride(t):this.__accessor__.override(t,e)}_clearOverride(t){return this.__accessor__.clearOverride(t)}_overrideIfSome(t,e){null==e?this.__accessor__.clearOverride(t):this.__accessor__.override(t,e)}_isOverridden(t){return this.__accessor__.isOverridden(t)}notifyChange(t){this.__accessor__.notifyChange(t)}_get(t){return this.__accessor__.internalGet(t)}_set(t,e){return this.__accessor__.internalSet(t,e),this}}T=D,E=U},3894:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(71143);function s(t){t.length=0}class i{constructor(t=50,e=50){this._pool=new n.Z(Array,void 0,s,e,t)}acquire(){return this._pool.acquire()}release(t){this._pool.release(t)}prune(){this._pool.prune(0)}static acquire(){return o.acquire()}static release(t){return o.release(t)}static prune(){o.prune()}}const o=new i(100)},61247:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(66374),s=r(70586);class i{constructor(){this._groups=new Map}destroy(){this.removeAll()}get size(){let t=0;return this._groups.forEach((e=>{t+=e.length})),t}add(t,e){if((0,n.TW)(t)){const r=this._getOrCreateGroup(e);for(const e of t)this._isHandle(e)&&r.push(e)}else this._isHandle(t)&&this._getOrCreateGroup(e).push(t);return this}forEach(t,e){if("function"==typeof t)this._groups.forEach((e=>e.forEach(t)));else{const r=this._getGroup(t);r&&e&&r.forEach(e)}}has(t){return this._groups.has(this._ensureGroupKey(t))}remove(t){if("string"!=typeof t&&(0,n.TW)(t)){for(const e of t)this.remove(e);return this}return this.has(t)?(this._removeAllFromGroup(this._getGroup(t)),this._groups.delete(this._ensureGroupKey(t)),this):this}removeAll(){return this._groups.forEach((t=>this._removeAllFromGroup(t))),this._groups.clear(),this}_isHandle(t){return t&&!!t.remove}_getOrCreateGroup(t){if(this.has(t))return this._getGroup(t);const e=[];return this._groups.set(this._ensureGroupKey(t),e),e}_getGroup(t){return(0,s.j0)(this._groups.get(this._ensureGroupKey(t)))}_ensureGroupKey(t){return t||"_default_"}_removeAllFromGroup(t){t.forEach((t=>t.remove()))}}},96674:(t,e,r)=>{r.d(e,{wq:()=>_,eC:()=>y});var n=r(43697),s=r(15923),i=r(70586),o=r(22974),a=r(31263);class c{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(t){const e=new c;return this._values.forEach(((r,n)=>{t&&t.has(n)||e.set(n,(0,o.d9)(r.value),r.origin)})),e}get(t,e){e=this._normalizeOrigin(e);const r=this._values.get(t);return null==e||r?.origin===e?r?.value:void 0}originOf(t){return this._values.get(t)?.origin??a.s3.USER}keys(t){t=this._normalizeOrigin(t);const e=[...this._values.keys()];return null==t?e:e.filter((e=>this._values.get(e)?.origin===t))}set(t,e,r){if((r=this._normalizeOrigin(r))===a.s3.DEFAULTS){const e=this._values.get(t);if(e&&null!=e.origin&&e.origin>r)return}this._values.set(t,new l(e,r))}delete(t,e){null!=(e=this._normalizeOrigin(e))&&this._values.get(t)?.origin!==e||this._values.delete(t)}has(t,e){return null!=(e=this._normalizeOrigin(e))?this._values.get(t)?.origin===e:this._values.has(t)}forEach(t){this._values.forEach((({value:e},r)=>t(e,r)))}_normalizeOrigin(t){if(null!=t)return t===a.s3.DEFAULTS?t:a.s3.USER}}class l{constructor(t,e){this.value=t,this.origin=e}}var u=r(41103),h=r(50549),f=r(1153),d=r(76169),p=r(52011);const y=t=>{let e=class extends t{constructor(...t){super(...t);const e=(0,i.j0)((0,f.vw)(this)),r=e.store,n=new c;e.store=n,(0,u.M)(e,r,n)}read(t,e){(0,h.i)(this,t,e)}write(t,e){return(0,d.c)(this,t??{},e)}toJSON(t){return this.write({},t)}static fromJSON(t,e){return g.call(this,t,e)}};return e=(0,n._)([(0,p.j)("esri.core.JSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function g(t,e){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const r=new this;return r.read(t,e),r}let _=class extends(y(s.Z)){};_=(0,n._)([(0,p.j)("esri.core.JSONSupport")],_)},30175:(t,e,r)=>{function n(t,e,r){const n=t.get(e);if(void 0!==n)return n;const s=r();return t.set(e,s),s}r.d(e,{s1:()=>n})},71143:(t,e,r)=>{r.d(e,{Z:()=>n});class n{constructor(t,e,r,n=1,s=0){if(this._ctor=t,this._acquireFunction=e,this._releaseFunction=r,this.allocationSize=n,this._pool=new Array(s),this._initialSize=s,this._ctor)for(let t=0;t<s;t++)this._pool[t]=new this._ctor;this.allocationSize=Math.max(n,1)}destroy(){this.prune(0)}acquire(...t){let e;if(n.test.disabled)e=new this._ctor;else{if(0===this._pool.length){const t=this.allocationSize;for(let e=0;e<t;e++)this._pool[e]=new this._ctor}e=this._pool.pop()}return this._acquireFunction?this._acquireFunction(e,...t):function(t){return t&&t.acquire&&"function"==typeof t.acquire}(e)&&e.acquire(...t),e}release(t){var e;t&&!n.test.disabled&&(this._releaseFunction?this._releaseFunction(t):(e=t)&&e.release&&"function"==typeof e.release&&t.release(),this._pool.push(t))}prune(t=this._initialSize){if(!(t>=this._pool.length)){for(let e=t;e<this._pool.length;++e){const t=this._pool[e];this._dispose(t)}this._pool.length=t}}_dispose(t){t.dispose&&"function"==typeof t.dispose&&t.dispose()}}n.test={disabled:!1}},54790:(t,e,r)=>{r.d(e,{Z:()=>n});class n{constructor(t,e=30){this.name=t,this._counter=0,this._samples=new Array(e)}record(t){null!=t&&(this._samples[++this._counter%this._samples.length]=t)}get median(){return this._samples.slice().sort(((t,e)=>t-e))[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce(((t,e)=>t+e),0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}}},44553:(t,e,r)=>{r.d(e,{Z:()=>c});var n,s=r(67676);!function(t){const e=(t,e,r,n)=>{let s=e,i=e;const o=r>>>1,a=t[s-1];for(;i<=o;){i=s<<1,i<r&&n(t[i-1],t[i])<0&&++i;const e=t[i-1];if(n(e,a)<=0)break;t[s-1]=e,s=i}t[s-1]=a},r=(t,e)=>t<e?-1:t>e?1:0;t.sort=function(t,n,s,i){void 0===n&&(n=0),void 0===s&&(s=t.length),void 0===i&&(i=r);for(let r=s>>>1;r>n;r--)e(t,r,s,i);const o=n+1;for(let r=s-1;r>n;r--){const s=t[n];t[n]=t[r],t[r]=s,e(t,o,r,i)}},t.iterableSort=function*(t,n,s,i){void 0===n&&(n=0),void 0===s&&(s=t.length),void 0===i&&(i=r);for(let r=s>>>1;r>n;r--)e(t,r,s,i),yield;const o=n+1;for(let r=s-1;r>n;r--){const s=t[n];t[n]=t[r],t[r]=s,e(t,o,r,i),yield}}}(n||(n={}));const i=n,o=1.5,a=1.1;class c{constructor(t){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new s.SO,t&&(t.initialSize&&(this.data=new Array(t.initialSize)),t.allocator&&(this._allocator=t.allocator),void 0!==t.deallocator&&(this._deallocator=t.deallocator),t.shrink&&(this._shrink=()=>l(this)))}toArray(){return this.data.slice(0,this.length)}filter(t){const e=new Array;for(let r=0;r<this._length;r++){const n=this.data[r];t(n)&&e.push(n)}return e}getItemAt(t){if(!(t<0||t>=this._length))return this.data[t]}includes(t,e){const r=this.data.indexOf(t,e);return-1!==r&&r<this.length}get length(){return this._length}set length(t){if(t>this._length){if(this._allocator){for(;this._length<t;)this.data[this._length++]=this._allocator(this.data[this._length]);return}this._length=t}else{if(this._deallocator)for(let e=t;e<this._length;++e)this.data[e]=this._deallocator(this.data[e]);this._length=t,this._shrink()}}clear(){this.length=0}prune(){this.clear(),this.data=[]}push(t){this.data[this._length++]=t}pushArray(t,e=t.length){for(let r=0;r<e;r++)this.data[this._length++]=t[r]}fill(t,e){for(let r=0;r<e;r++)this.data[this._length++]=t}pushNew(){this._allocator&&(this.data[this.length]=this._allocator(this.data[this.length]));const t=this.data[this._length];return++this._length,t}unshift(t){this.data.unshift(t),this._length++,l(this)}pop(){if(0===this.length)return;const t=this.data[this.length-1];return this.length=this.length-1,this._shrink(),t}remove(t){const e=(0,s.cq)(this.data,t,this.length,this._hint);if(-1!==e)return this.data.splice(e,1),this.length=this.length-1,t}removeUnordered(t){return this.removeUnorderedIndex((0,s.cq)(this.data,t,this.length,this._hint))}removeUnorderedIndex(t){if(!(t>=this.length||t<0))return this.swapElements(t,this.length-1),this.pop()}removeUnorderedMany(t,e=t.length,r){this.length=(0,s.FY)(this.data,t,this.length,e,this._hint,r),this._shrink()}front(){if(0!==this.length)return this.data[0]}back(){if(0!==this.length)return this.data[this.length-1]}swapElements(t,e){if(t>=this.length||e>=this.length||t===e)return;const r=this.data[t];this.data[t]=this.data[e],this.data[e]=r}sort(t){i.sort(this.data,0,this.length,t)}iterableSort(t){return i.iterableSort(this.data,0,this.length,t)}some(t,e){for(let r=0;r<this.length;++r)if(t.call(e,this.data[r],r,this.data))return!0;return!1}find(t,e){for(let r=0;r<this.length;++r){const n=this.data[r];if(t.call(e,n,r))return n}}filterInPlace(t,e){let r=0;for(let n=0;n<this._length;++n){const s=this.data[n];t.call(e,s,n,this.data)&&(this.data[n]=this.data[r],this.data[r]=s,r++)}if(this._deallocator)for(let t=r;t<this._length;t++)this.data[t]=this._deallocator(this.data[t]);return this._length=r,this._shrink(),this}forAll(t,e){const r=this.length,n=this.data;for(let s=0;s<r;++s)t.call(e,n[s],s,n)}forEach(t,e){for(let r=0;r<this.length;++r)t.call(e,this.data[r],r,this.data)}map(t,e){const r=new Array(this.length);for(let n=0;n<this.length;++n)r[n]=t.call(e,this.data[n],n,this.data);return r}reduce(t,e){let r=e;for(let e=0;e<this.length;++e)r=t(r,this.data[e],e,this.data);return r}has(t){const e=this.length,r=this.data;for(let n=0;n<e;++n)if(r[n]===t)return!0;return!1}}function l(t){t.data.length>o*t.length&&(t.data.length=Math.floor(t.length*a))}},20941:(t,e,r)=>{r.d(e,{Z:()=>s});var n=r(58896);class s extends n.Z{constructor(t,e,r){super(t,e,r)}}s.prototype.type="warning"},42100:(t,e,r)=>{r.d(e,{s:()=>i});var n=r(67676);class s{constructor(t,e){this._observers=t,this._observer=e}remove(){(0,n.Od)(this._observers,this._observer)}}class i{constructor(){this._observers=null,this.destroyed=!1}observe(t){if(this.destroyed||t.destroyed)return o;null==this._observers&&(this._observers=[]);const e=this._observers;let r=!1,n=!1;const i=e.length;for(let s=0;s<i;++s){const i=e[s];if(i.destroyed)n=!0;else if(i===t){r=!0;break}}return r||(e.push(t),n&&this._removeDestroyedObservers()),new s(e,t)}_removeDestroyedObservers(){const t=this._observers;if(!t||0===t.length)return;const e=t.length;let r=0;for(let n=0;n<e;++n){for(;n+r<e&&t[n+r].destroyed;)++r;if(r>0){if(!(n+r<e))break;t[n]=t[n+r]}}t.length=e-r}destroy(){if(this.destroyed)return;this.destroyed=!0;const t=this._observers;if(null!=t){for(const e of t)e.onCommitted();this._observers=null}}}const o={remove:()=>{}}},31263:(t,e,r)=>{r.d(e,{M9:()=>a,Wm:()=>l,kk:()=>o,s3:()=>n,x3:()=>c});var n,s,i=r(70586);(s=n||(n={}))[s.DEFAULTS=0]="DEFAULTS",s[s.COMPUTED=1]="COMPUTED",s[s.SERVICE=2]="SERVICE",s[s.PORTAL_ITEM=3]="PORTAL_ITEM",s[s.WEB_SCENE=4]="WEB_SCENE",s[s.WEB_MAP=5]="WEB_MAP",s[s.USER=6]="USER";const o=n.USER+1;function a(t){switch(t){case"defaults":return n.DEFAULTS;case"service":return n.SERVICE;case"portal-item":return n.PORTAL_ITEM;case"web-scene":return n.WEB_SCENE;case"web-map":return n.WEB_MAP;case"user":return n.USER;default:return null}}function c(t){switch(t){case n.DEFAULTS:return"defaults";case n.SERVICE:return"service";case n.PORTAL_ITEM:return"portal-item";case n.WEB_SCENE:return"web-scene";case n.WEB_MAP:return"web-map";case n.USER:return"user"}return(0,i.j0)(void 0)}function l(t){return c(t)}},88022:(t,e,r)=>{r.d(e,{F:()=>n});const n=Symbol("Accessor-beforeDestroy")},90578:(t,e,r)=>{r.d(e,{p:()=>c});var n=r(75215),s=r(7628);const i=Object.prototype.toString;function o(t){const e="__accessorMetadata__"in t?(0,n.se)(t):t;return function(...t){if(t.push(e),"number"==typeof t[2])throw new Error("Using @cast has parameter decorator is not supported since 4.16");return a.apply(this,t)}}function a(t,e,r,n){(0,s.Oe)(t,e).cast=n}function c(...t){if(3!==t.length||"string"!=typeof t[1])return 1===t.length&&"[object Function]"===i.call(t[0])?o(t[0]):1===t.length&&"string"==typeof t[0]?function(t){return(e,r)=>{(0,s.Oe)(e,t).cast=e[r]}}(t[0]):void 0}},5600:(t,e,r)=>{r.d(e,{CJ:()=>l,Cb:()=>c,Eg:()=>u});var n=r(92604),s=r(75215),i=r(67723),o=r(7628),a=r(37697);function c(t={}){return(e,r)=>{if(e===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${e.name}.${r}. Accessor does not support static properties.`);const c=Object.getOwnPropertyDescriptor(e,r),l=(0,o.Oe)(e,r);c&&(c.get||c.set?(l.get=c.get||l.get,l.set=c.set||l.set):"value"in c&&("value"in t&&n.Z.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${r}" on "${e.constructor.name}" already defined in the metadata`,t),l.value=t.value=c.value)),null!=t.readOnly&&(l.readOnly=t.readOnly);const h=t.aliasOf;if(h){const t="string"==typeof h?h:h.source,e="string"==typeof h?null:!0===h.overridable;let n;l.dependsOn=[t],l.get=function(){let e=(0,i.U2)(this,t);if("function"==typeof e){n||(n=t.split(".").slice(0,-1).join("."));const r=(0,i.U2)(this,n);r&&(e=e.bind(r))}return e},l.readOnly||(l.set=e?function(t){this._override(r,t)}:function(e){(0,a.t)(this,t,e)})}const f=t.type,d=t.types;l.cast||(f?l.cast=function(t){let e=0,r=t;if((0,s.AY)(t))return(0,s.sY)(t);for(;Array.isArray(r)&&1===r.length&&"string"!=typeof r[0]&&"number"!=typeof r[0];)r=r[0],e++;const n=r;if((0,s.gB)(n))return 0===e?(0,s.i$)(n):(0,s.Iu)((0,s.i$)(n),e);if(1===e)return(0,s.rY)(n);if(e>1)return(0,s.di)(n,e);const i=t;return i.from?i.from:(0,s.se)(i)}(f):d&&(Array.isArray(d)?l.cast=(0,s.Ls)((0,s.N7)(d[0])):l.cast=(0,s.N7)(d))),(0,o.tz)(l,t),t.range&&(l.cast=u(l.cast,t.range))}}function l(t,e,r){const n=(0,o.Oe)(t,r);n.json||(n.json={});let s=n.json;return void 0!==e&&(s.origins||(s.origins={}),s.origins[e]||(s.origins[e]={}),s=s.origins[e]),s}function u(t,e){return r=>{let n=+t(r);return null!=e.step&&(n=Math.round(n/e.step)*e.step),null!=e.min&&(n=Math.max(e.min,n)),null!=e.max&&(n=Math.min(e.max,n)),n}}},52011:(t,e,r)=>{r.d(e,{j:()=>u}),r(80442);var n=r(88022),s=r(97831),i=r(7628),o=r(58971),a=r(53906);const c=new Set,l=new Set;function u(t){return e=>{e.prototype.declaredClass=t,f(e);const r=[],s=[];let o=e.prototype;for(;o;)o.hasOwnProperty("initialize")&&!c.has(o.initialize)&&(c.add(o.initialize),r.push(o.initialize)),o.hasOwnProperty("destroy")&&!l.has(o.destroy)&&(l.add(o.destroy),s.push(o.destroy)),o=Object.getPrototypeOf(o);c.clear(),l.clear();class a extends e{constructor(...t){if(super(...t),this.constructor===a&&"function"==typeof this.postscript){if(r.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let t=r.length-1;t>=0;t--)r[t].call(this)}}),s.length){let t=!1;const e=this[n.F];Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!t){t=!0,e.call(this);for(let t=0;t<s.length;t++)s[t].call(this)}}})}this.postscript(...t)}}}return a.__accessorMetadata__=(0,i.fp)(e.prototype),a.prototype.declaredClass=t,a}}function h(t,e){return null==e.get?function(){const e=this.__accessor__.properties.get(t);if(void 0===e)return;(0,o.it)(e.observerObject);const r=this.__accessor__.store;return r.has(t)?r.get(t):e.metadata.value}:function(){const e=this.__accessor__.properties.get(t);if(void 0!==e)return e.getComputed()}}function f(t){const e=t.prototype,r=(0,i.fp)(e),n={};for(const t of Object.getOwnPropertyNames(r)){const e=r[t];(0,a.OM)(e),n[t]={enumerable:!0,configurable:!0,get:h(t,e),set(r){const n=this.__accessor__;if(void 0!==n){if(!Object.isFrozen(this)){if(n.initialized&&e.readOnly)throw new TypeError(`[accessor] cannot assign to read-only property '${t}' of ${this.declaredClass}`);if(n.lifecycle===s.F.CONSTRUCTED&&e.constructOnly)throw new TypeError(`[accessor] cannot assign to construct-only property '${t}' of ${this.declaredClass}`);n.set(t,r)}}else Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:r})}}}Object.defineProperties(t.prototype,n)}},41103:(t,e,r)=>{r.d(e,{M:()=>s});var n=r(31263);function s(t,e,r){e.keys().forEach((t=>{r.set(t,e.get(t),n.s3.DEFAULTS)}));const s=t.metadatas;Object.keys(s).forEach((e=>{t.internalGet(e)&&r.set(e,t.internalGet(e),n.s3.DEFAULTS)}))}},75215:(t,e,r)=>{r.d(e,{AY:()=>C,Iu:()=>A,Ls:()=>b,N7:()=>E,TJ:()=>g,V5:()=>k,Zs:()=>c,di:()=>j,gB:()=>S,i$:()=>T,q9:()=>l,rY:()=>w,sY:()=>I,se:()=>m,vU:()=>u,z8:()=>N}),r(80442);var n=r(92604),s=r(30175);const i=n.Z.getLogger("esri.core.accessorSupport.ensureTypes");function o(t){return null==t?t:new Date(t)}function a(t){return null==t?t:!!t}function c(t){return null==t?t:t.toString()}function l(t){return null==t?t:(t=parseFloat(t),isNaN(t)?0:t)}function u(t){return null==t?t:Math.round(parseFloat(t))}function h(t){return t&&t.constructor&&void 0!==t.constructor.__accessorMetadata__}function f(t,e){return null!=e&&t&&!(e instanceof t)}function d(t){return t&&"isCollection"in t}function p(t){return t&&t.Type?"function"==typeof t.Type?t.Type:t.Type.base:null}function y(t,e){return!!h(e)&&(i.error("Accessor#set","Assigning an instance of '"+(e.declaredClass||"unknown")+"' which is not a subclass of '"+_(t)+"'"),!0)}function g(t,e){return null==e?e:d(t)?function(t,e){if(!e||!e.constructor||!d(e.constructor))return y(t,e)?e:new t(e);const r=p(t.prototype.itemType),n=p(e.constructor.prototype.itemType);return r?n?r===n?e:r.prototype.isPrototypeOf(n.prototype)?new t(e):(y(t,e),e):new t(e):e}(t,e):f(t,e)?y(t,e)?e:new t(e):e}function _(t){return t&&t.prototype&&t.prototype.declaredClass||"unknown"}const v=new WeakMap;function m(t,e){const r=function(t){switch(t){case Number:return l;case N:return u;case Boolean:return a;case String:return c;case Date:return o;default:return(0,s.s1)(v,t,(()=>g.bind(null,t)))}}(t);return 1===arguments.length?r:r(e)}function b(t,e,r){return 1===arguments.length?b.bind(null,t):e?Array.isArray(e)?e.map((e=>t(e,r))):[t(e,r)]:e}function w(t,e){return 1===arguments.length?b(m.bind(null,t)):b(m.bind(null,t),e)}function O(t,e,r){return 0!==e&&Array.isArray(r)?r.map((r=>O(t,e-1,r))):t(r)}function A(t,e,r){if(2===arguments.length)return A.bind(null,t,e);if(!r)return r;let n=e,s=r=O(t,e,r);for(;n>0&&Array.isArray(s);)n--,s=s[0];if(void 0!==s)for(let t=0;t<n;t++)r=[r];return r}function j(t,e,r){return 2===arguments.length?A(m.bind(null,t),e):A(m.bind(null,t),e,r)}function S(t){return!!Array.isArray(t)&&!t.some((e=>{const r=typeof e;return!("string"===r||"number"===r||"function"===r&&t.length>1)}))}function T(t,e){if(2===arguments.length)return T(t).call(null,e);const r=new Set,n=t.filter((t=>"function"!=typeof t)),s=t.filter((t=>"function"==typeof t));for(const e of t)"string"!=typeof e&&"number"!=typeof e||r.add(e);let o=null,a=null;return(t,e)=>{if(null==t)return t;const c=typeof t,l="string"===c||"number"===c;return l&&(r.has(t)||s.some((t=>"string"===c&&t===String||"number"===c&&t===Number)))||"object"===c&&s.some((e=>!f(t,e)))?t:(l&&n.length?(o||(o=n.map((t=>"string"==typeof t?`'${t}'`:`${t}`)).join(", ")),i.error("Accessor#set",`'${t}' is not a valid value for this property, only the following values are valid: ${o}`)):"object"==typeof t&&s.length?(a||(a=s.map((t=>_(t))).join(", ")),i.error("Accessor#set",`'${t}' is not a valid value for this property, value must be one of ${a}`)):i.error("Accessor#set",`'${t}' is not a valid value for this property`),e&&(e.valid=!1),null)}}function E(t,e){if(2===arguments.length)return E(t).call(null,e);const r={},n=[],s=[];for(const e in t.typeMap){const i=t.typeMap[e];r[e]=m(i),n.push(_(i)),s.push(e)}const o=()=>`'${n.join("', '")}'`,a=()=>`'${s.join("', '")}'`,c="string"==typeof t.key?e=>e[t.key]:t.key;return e=>{if(t.base&&!f(t.base,e))return e;if(null==e)return e;const n=c(e)||t.defaultKeyValue,s=r[n];if(!s)return i.error("Accessor#set",`Invalid property value, value needs to be one of ${o()}, or a plain object that can autocast (having .type = ${a()})`),null;if(!f(t.typeMap[n],e))return e;if("string"==typeof t.key&&!h(e)){const r={};for(const n in e)n!==t.key&&(r[n]=e[n]);return s(r)}return s(e)}}class N{}const k={native:t=>({type:"native",value:t}),array:t=>({type:"array",value:t}),oneOf:t=>({type:"one-of",values:t})};function C(t){if(!t||!("type"in t))return!1;switch(t.type){case"native":case"array":case"one-of":return!0}return!1}function I(t){switch(t.type){case"native":return m(t.value);case"array":return b(I(t.value));case"one-of":return function(t){let e=null;return(r,n)=>D(r,t)?r:(null==e&&(e=M(t)),i.error("Accessor#set",`Invalid property value, value needs to be of type ${e}`),n&&(n.valid=!1),null)}(t);default:return null}}function M(t){switch(t.type){case"native":switch(t.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case N:return"integer";case Date:return"date";default:return _(t.value)}case"array":return`array of ${M(t.value)}`;case"one-of":{const e=t.values.map((t=>M(t)));return`one of ${e.slice(0,e.length-1)} or ${e[e.length-1]}`}}return"unknown"}function D(t,e){if(null==t)return!0;switch(e.type){case"native":switch(e.value){case Number:case N:return"number"==typeof t;case Boolean:return"boolean"==typeof t;case String:return"string"==typeof t}return t instanceof e.value;case"array":return!!Array.isArray(t)&&!t.some((t=>!D(t,e.value)));case"one-of":return e.values.some((e=>D(t,e)))}}},53906:(t,e,r)=>{r.d(e,{hk:()=>f,HS:()=>u,Ah:()=>h,OM:()=>g});var n=r(75215),s=r(63213);function i(t){if(t.json||(t.json={}),a(t.json),c(t.json),o(t.json),t.json.origins)for(const e in t.json.origins)a(t.json.origins[e]),c(t.json.origins[e]),o(t.json.origins[e]);return!0}function o(t){t.name&&(t.read&&"object"==typeof t.read?void 0===t.read.source&&(t.read.source=t.name):t.read={source:t.name},t.write&&"object"==typeof t.write?void 0===t.write.target&&(t.write.target=t.name):t.write={target:t.name})}function a(t){"boolean"==typeof t.read?t.read={enabled:t.read}:"function"==typeof t.read?t.read={enabled:!0,reader:t.read}:t.read&&"object"==typeof t.read&&void 0===t.read.enabled&&(t.read.enabled=!0)}function c(t){"boolean"==typeof t.write?t.write={enabled:t.write}:"function"==typeof t.write?t.write={enabled:!0,writer:t.write}:t.write&&"object"==typeof t.write&&void 0===t.write.enabled&&(t.write.enabled=!0)}var l=r(827);function u(t,e){return f(t,"read",e)}function h(t,e){return f(t,"write",e)}function f(t,e,r){let n=t&&t.json;if(t&&t.json&&t.json.origins&&r){const s=r.origin&&t.json.origins[r.origin];s&&("any"===e||e in s)&&(n=s)}return n}function d(t){return t.type?p(t):y(t)}function p(t){if(!t.type)return;let e=0,r=t.type;for(;Array.isArray(r)&&!(0,n.gB)(r);)r=r[0],e++;return{type:r,ndimArray:e}}function y(t){if(!t.types)return;let e=0,r=t.types;for(;Array.isArray(r);)r=r[0],e++;return{types:r,ndimArray:e}}function g(t){i(t)&&(function(t){if(t.json&&t.json.origins){const e=t.json.origins,r={"web-document":["web-scene","web-map"]};for(const t in r)if(e[t]){const n=e[t];r[t].forEach((t=>{e[t]=n})),delete e[t]}}}(t),function(t){const e=function(t){return t.json.types?y(t.json):t.type?p(t):y(t)}(t);if(t.json.origins)for(const r in t.json.origins){const n=t.json.origins[r],i=n.types?d(n):e;(0,s.U)(i,n,!1),n.types&&!n.write&&t.json.write&&t.json.write.enabled&&(n.write={...t.json.write}),(0,l.U)(i,n)}(0,s.U)(e,t.json,!0),(0,l.U)(e,t.json)}(t))}},63213:(t,e,r)=>{r.d(e,{U:()=>l,d:()=>u});var n=r(92604),s=r(78286),i=r(20941),o=r(7628),a=r(14062);const c=n.Z.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function l(t,e,r){t&&(!r&&!e.read||e.read?.reader||!1===e.read?.enabled||function(t){return"types"in t?g(t.types):y(t.type)}(t)&&(0,s.RB)("read.reader",u(t),e))}function u(t){const e=t.ndimArray??0;if(e>1)return function(t){const e=h(t),r=f.bind(null,e),n=t.ndimArray??0;return(t,e,s)=>{if(null==t)return t;t=r(t,s,n);let i=n,o=t;for(;i>0&&Array.isArray(o);)i--,o=o[0];if(void 0!==o)for(let e=0;e<i;e++)t=[t];return t}}(t);if(1===e)return d(t);if("type"in t&&p(t.type)){const e=t.type.prototype?.itemType?.Type,r=d("function"==typeof e?{type:e}:{types:e});return(e,n,s)=>{const i=r(e,n,s);return i?new t.type(i):i}}return h(t)}function h(t){return"type"in t?function(t){return t.prototype.read?(e,r,n)=>{if(null==e)return e;const s=typeof e;if("object"!==s)return void c.error(`Expected JSON value of type 'object' to deserialize type '${t.prototype.declaredClass}', but got '${s}'`);const i=new t;return i.read(e,n),i}:t.fromJSON}(t.type):function(t){let e=null;const r=t.errorContext??"type";return(n,s,a)=>{if(null==n)return n;const l=typeof n;if("object"!==l)return void c.error(`Expected JSON value of type 'object' to deserialize, but got '${l}'`);e||(e=function(t){const e={};for(const r in t.typeMap){const n=t.typeMap[r],s=(0,o.fp)(n.prototype);if("function"==typeof t.key)continue;const i=s[t.key];if(!i)continue;i.json?.type&&Array.isArray(i.json.type)&&1===i.json.type.length&&"string"==typeof i.json.type[0]&&(e[i.json.type[0]]=n);const a=i.json?.write;if(!a||!a.writer){e[r]=n;continue}const c=a.target,l="string"==typeof c?c:t.key,u={};a.writer(r,u,l),u[l]&&(e[u[l]]=n)}return e}(t));const u=t.key;if("string"!=typeof u)return;const h=n[u],f=h?e[h]:t.defaultKeyValue?t.typeMap[t.defaultKeyValue]:void 0;if(!f){const t=`Type '${h||"unknown"}' is not supported`;return a&&a.messages&&n&&a.messages.push(new i.Z(`${r}:unsupported`,t,{definition:n,context:a})),void c.error(t)}const d=new f;return d.read(n,a),d}}(t.types)}function f(t,e,r,n){return 0!==n&&Array.isArray(e)?e.map((e=>f(t,e,r,n-1))):t(e,void 0,r)}function d(t){const e=h(t);return(t,r,n)=>{if(null==t)return t;if(Array.isArray(t)){const r=[];for(const s of t){const t=e(s,void 0,n);void 0!==t&&r.push(t)}return r}const s=e(t,void 0,n);return void 0!==s?[s]:void 0}}function p(t){if(!(0,a.u)(t))return!1;const e=t.prototype.itemType;return!(!e||!e.Type)&&("function"==typeof e.Type?y(e.Type):g(e.Type))}function y(t){return!Array.isArray(t)&&!!t&&t.prototype&&("read"in t.prototype||"fromJSON"in t||p(t))}function g(t){for(const e in t.typeMap)if(!y(t.typeMap[e]))return!1;return!0}},14062:(t,e,r)=>{function n(t){return!!t&&t.prototype&&t.prototype.declaredClass&&0===t.prototype.declaredClass.indexOf("esri.core.Collection")}r.d(e,{u:()=>n})},827:(t,e,r)=>{r.d(e,{U:()=>a,k:()=>h});var n=r(20102),s=r(92604),i=r(78286),o=r(14062);function a(t,e){if(!e.write||e.write.writer||!1===e.write.enabled&&!e.write.overridePolicy)return;const r=t?.ndimArray??0;t&&(1===r||"type"in t&&(0,o.u)(t.type))?e.write.writer=f:r>1?e.write.writer=function(t){return(e,r,n,s)=>{let o;if(null===e)o=null;else{o=d(e,s,t);let r=t,n=o;for(;r>0&&Array.isArray(n);)r--,n=n[0];if(void 0!==n)for(let t=0;t<r;t++)o=[o]}(0,i.RB)(n,o,r)}}(r):e.types?Array.isArray(e.types)?e.write.writer=function(t){return(e,r,n,s)=>e&&Array.isArray(e)?l(e.filter((e=>c(e,t,s))),r,n,s):l(e,r,n,s)}(e.types[0]):e.write.writer=function(t){return(e,r,n,s)=>e?c(e,t,s)?l(e,r,n,s):void 0:l(e,r,n,s)}(e.types):e.write.writer=l}function c(t,e,r){for(const r in e.typeMap)if(t instanceof e.typeMap[r])return!0;if(r?.messages){const i=e.errorContext??"type",o=`Values of type '${("function"!=typeof e.key?t[e.key]:t.declaredClass)??"Unknown"}' cannot be written`;r&&r.messages&&t&&r.messages.push(new n.Z(`${i}:unsupported`,o,{definition:t,context:r})),s.Z.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(o)}return!1}function l(t,e,r,n){(0,i.RB)(r,u(t,n),e)}function u(t,e){return t&&"function"==typeof t.write?t.write({},e):t&&"function"==typeof t.toJSON?t.toJSON():"number"==typeof t?h(t):t}function h(t){return t===-1/0?-Number.MAX_VALUE:t===1/0?Number.MAX_VALUE:isNaN(t)?null:t}function f(t,e,r,n){let s;null===t?s=null:t&&"function"==typeof t.map?(s=t.map((t=>u(t,n))),"function"==typeof s.toArray&&(s=s.toArray())):s=[u(t,n)],(0,i.RB)(r,s,e)}function d(t,e,r){return 0!==r&&Array.isArray(t)?t.map((t=>d(t,e,r-1))):u(t,e)}},67723:(t,e,r)=>{r.d(e,{$z:()=>o,Gg:()=>c,U2:()=>a});var n=r(1153);function s(t,e){const r="?"===t[t.length-1]?t.slice(0,-1):t;if(null!=e.getItemAt||Array.isArray(e)){const t=parseInt(r,10);if(!isNaN(t))return Array.isArray(e)?e[t]:e.getItemAt(t)}const s=(0,n.vw)(e);return(0,n.b6)(s,r)?s.get(r):e[r]}function i(t,e,r){if(null==t)return t;const n=s(e[r],t);return!n&&r<e.length-1?void 0:r===e.length-1?n:i(n,e,r+1)}function o(t,e,r=0){return"string"!=typeof e||e.includes(".")?i(t,(0,n.NI)(e),r):s(e,t)}function a(t,e){return o(t,e)}function c(t,e){return void 0!==o(e,t)}},97831:(t,e,r)=>{var n;r.d(e,{F:()=>n}),function(t){t[t.INITIALIZING=0]="INITIALIZING",t[t.CONSTRUCTING=1]="CONSTRUCTING",t[t.CONSTRUCTED=2]="CONSTRUCTED"}(n||(n={}))},7628:(t,e,r)=>{r.d(e,{Oe:()=>a,fp:()=>o,tz:()=>c});var n=r(22974),s=r(70586),i=r(1153);function o(t){let e=t.constructor.__accessorMetadata__;const r=Object.prototype.hasOwnProperty.call(t.constructor,"__accessorMetadata__");if(e){if(!r){e=Object.create(e);for(const t in e)e[t]=(0,n.d9)(e[t]);Object.defineProperty(t.constructor,"__accessorMetadata__",{value:e,enumerable:!1,configurable:!0,writable:!0})}}else e={},Object.defineProperty(t.constructor,"__accessorMetadata__",{value:e,enumerable:!1,configurable:!0,writable:!0});return(0,s.j0)(t.constructor.__accessorMetadata__)}function a(t,e){const r=o(t);let n=r[e];return n||(n=r[e]={}),n}function c(t,e){return(0,i.TS)(t,e,u)}const l=/^(?:[^.]+\.)?(?:value|type|(?:json\.type|json\.origins\.[^.]\.type))$/;function u(t){return l.test(t)?"replace":"merge"}},50549:(t,e,r)=>{r.d(e,{$:()=>h,i:()=>u});var n=r(67723),s=r(1153),i=r(53906);function o(t,e,r){if(!t||!t.read||!1===t.read.enabled||!t.read.source)return!1;const s=t.read.source;if("string"==typeof s){if(s===e)return!0;if(s.includes(".")&&0===s.indexOf(e)&&(0,n.Gg)(s,r))return!0}else for(const t of s){if(t===e)return!0;if(t.includes(".")&&0===t.indexOf(e)&&(0,n.Gg)(t,r))return!0}return!1}function a(t,e,r,n,s){let a=(0,i.HS)(e[r],s);(function(t){return t&&(!t.read||!1!==t.read.enabled&&!t.read.source)})(a)&&(t[r]=!0);for(const c of Object.getOwnPropertyNames(e))a=(0,i.HS)(e[c],s),o(a,r,n)&&(t[c]=!0)}function c(t,e,r,n){const s=r.metadatas,o=(0,i.hk)(s[e],"any",n),a=o&&o.default;if(void 0===a)return;const c="function"==typeof a?a.call(t,e,n):a;void 0!==c&&r.set(e,c)}const l={origin:"service"};function u(t,e,r=l){if(!e||"object"!=typeof e)return;const o=(0,s.vw)(t),u=o.metadatas,h={};for(const t of Object.getOwnPropertyNames(e))a(h,u,t,e,r);o.setDefaultOrigin(r.origin);for(const s of Object.getOwnPropertyNames(h)){const a=(0,i.HS)(u[s],r).read,c=a&&a.source;let l;l=c&&"string"==typeof c?(0,n.$z)(e,c):e[s],a&&a.reader&&(l=a.reader.call(t,l,e,r)),void 0!==l&&o.set(s,l)}if(!r||!r.ignoreDefaults){o.setDefaultOrigin("defaults");for(const e of Object.getOwnPropertyNames(u))h[e]||c(t,e,o,r)}o.setDefaultOrigin("user")}function h(t,e,r,n=l){const s={...n,messages:[]};r(s),s.messages?.forEach((e=>{"warning"!==e.type||t.loaded?n&&n.messages&&n.messages.push(e):t.loadWarnings.push(e)}))}},37697:(t,e,r)=>{r.d(e,{t:()=>o});var n=r(20102),s=r(80442),i=(r(92604),r(67723));function o(t,e,r){if(t&&e)if("object"==typeof e)for(const r of Object.getOwnPropertyNames(e))o(t,r,e[r]);else{if(e.includes(".")){const n=e.split("."),s=n.splice(n.length-1,1)[0];return void o((0,i.U2)(t,n),s,r)}const a=t.__accessor__;null!=a&&function(t,e){if((0,s.Z)("esri-unknown-property-errors")&&!function(t,e){return null!=e.metadatas[t]}(t,e))throw new n.Z("set:unknown-property",function(t,e){return"setting unknown property '"+t+"' on instance of "+e.host.declaredClass}(t,e))}(e,a),t[e]=r}}},58971:(t,e,r)=>{r.d(e,{GF:()=>m,LJ:()=>f,gb:()=>d,it:()=>l,mS:()=>_}),r(80442);var n=r(92604),s=r(1153),i=r(44550);const o={onObservableAccessed:()=>{},onTrackingEnd:()=>{}},a=[];let c=o;function l(t){c.onObservableAccessed(t)}let u=!1,h=!1;function f(t,e,r){if(u)return p(t,e,r);y(t);const n=e.call(r);return g(),n}function d(t,e){return f(o,t,e)}function p(t,e,r){const s=u;u=!0,y(t);let i=null;try{i=e.call(r)}catch(t){h&&n.Z.getLogger("esri.core.accessorSupport.tracking").error(t)}return g(),u=s,i}function y(t){c=t,a.push(t)}function g(){const t=a.length;if(t>1){const e=a.pop();c=a[t-2],e.onTrackingEnd()}else if(1===t){const t=a.pop();c=o,t.onTrackingEnd()}else c=o}function _(t,e){const r=e.observerObject;if(r.flags&i.v.DepTrackingInitialized)return;const n=h;h=!1,r.flags&i.v.AutoTracked?p(e,e.metadata.get,t):m(t,e),h=n}const v=[];function m(t,e){const r=e.observerObject;r.flags&i.v.ExplicitlyTracking||(r.flags|=i.v.ExplicitlyTracking,p(e,(()=>{const r=e.metadata.dependsOn||v;for(const e of r)if("string"!=typeof e||e.includes(".")){const r=(0,s.NI)(e);for(let e=0,n=t;e<r.length&&null!=n&&"object"==typeof n;++e)n=b(n,r[e],e!==r.length-1)}else b(t,e,!1)})),r.flags&=~i.v.ExplicitlyTracking)}function b(t,e,r){const n="?"===e[e.length-1]?e.slice(0,-1):e;if(null!=t.getItemAt||Array.isArray(t)){const e=parseInt(n,10);if(!isNaN(e))return Array.isArray(t)?t[e]:t.getItemAt(e)}const i=(0,s.vw)(t),o=i?.properties.get(n);return o&&(l(o.observerObject),_(t,o)),r?t[n]:void 0}},44550:(t,e,r)=>{var n;r.d(e,{v:()=>n}),function(t){t[t.Dirty=1]="Dirty",t[t.Overriden=2]="Overriden",t[t.Computing=4]="Computing",t[t.NonNullable=8]="NonNullable",t[t.HasDefaultValue=16]="HasDefaultValue",t[t.DepTrackingInitialized=32]="DepTrackingInitialized",t[t.AutoTracked=64]="AutoTracked",t[t.ExplicitlyTracking=128]="ExplicitlyTracking"}(n||(n={}))},38805:(t,e,r)=>{r.d(e,{M:()=>n});class n{constructor(t){this._accessed=[],this._handles=[],this._observerObject=new s(t),i.register(this,this._observerObject,this._observerObject)}destroy(){i.unregister(this._observerObject),this._accessed.length=0,this._observerObject?.destroy(),this.clear()}onObservableAccessed(t){const e=this._accessed;e.includes(t)||e.push(t)}onTrackingEnd(){const t=this._handles,e=this._accessed,r=this._observerObject;for(let n=0;n<e.length;++n)t.push(e[n].observe(r));e.length=0}clear(){const t=this._handles;for(let e=0;e<t.length;++e)t[e].remove();t.length=0}}class s{constructor(t){this._notify=t,this._invalidCount=0,this.destroyed=!1}onInvalidated(){this._invalidCount++}onCommitted(){if(this.destroyed)return;const t=this._invalidCount;if(1===t)return this._invalidCount=0,void this._notify();this._invalidCount=t>0?t-1:0}destroy(){this.destroyed=!0,this._notify=o}}const i=new FinalizationRegistry((t=>{t.destroy()}));function o(){}},87538:(t,e,r)=>{r.d(e,{EH:()=>l,U5:()=>a,Xz:()=>c});var n=r(58971),s=r(38805);let i=!1;const o=[];function a(t,e){let r=new s.M((function s(){if(!r||a)return;if(i)return void u(s);const c=o;r.clear(),i=!0,a=!0,o=(0,n.LJ)(r,t),a=!1,i=!1,e(o,c),h()})),o=null,a=!1;return a=!0,o=(0,n.LJ)(r,t),a=!1,{remove:function(){r&&(r.destroy(),r=null,o=null)}}}function c(t,e){let r=new s.M((function(){e(i,o)})),i=null;function o(){return r?(r.clear(),i=(0,n.LJ)(r,t),i):null}return o(),{remove:function(){r&&(r.destroy(),r=null),i=null}}}function l(t){let e=new s.M((function s(){e&&!r&&(i?u(s):(e.clear(),i=!0,r=!0,(0,n.LJ)(e,t),r=!1,i=!1,h()))})),r=!1;return r=!0,(0,n.LJ)(e,t),r=!1,{remove:function(){e&&(e.destroy(),e=null)}}}function u(t){o.includes(t)||o.unshift(t)}function h(){for(;o.length;)o.pop()()}},1153:(t,e,r)=>{r.d(e,{IH:()=>d,NI:()=>u,Qc:()=>f,TS:()=>c,b6:()=>a,vw:()=>o});var n=r(50758),s=r(22974),i=r(70586);function o(t){return t?t.__accessor__?t.__accessor__:t.propertyInvalidated?t:null:null}function a(t,e){return null!=t&&t.metadatas&&null!=t.metadatas[e]}function c(t,e,r){return l(t,e,r?{policy:r,path:""}:null)}function l(t,e,r){return e?Object.keys(e).reduce(((t,n)=>{let o=null,a="merge";if(r&&(o=r.path?`${r.path}.${n}`:n,a=r.policy(o)),"replace"===a)return t[n]=e[n],t;if("replace-arrays"===a&&Array.isArray(t[n]))return t[n]=e[n],t;if(void 0===t[n])return t[n]=(0,s.d9)(e[n]),t;let c=t[n],u=e[n];if(c===u)return t;if(Array.isArray(u)||Array.isArray(t))c=c?Array.isArray(c)?t[n]=c.concat():t[n]=[c]:t[n]=[],u&&(Array.isArray(u)||(u=[u]),u.forEach((t=>{c.includes(t)||c.push(t)})));else if(u&&"object"==typeof u)if(r){const e=r.path;r.path=(0,i.j0)(o),t[n]=l(c,u,r),r.path=e}else t[n]=l(c,u,null);else t.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(t[n]=u);return t}),t||{}):t}function u(t){return Array.isArray(t)?t:t.split(".")}function h(t){return t.includes(",")?t.split(",").map((t=>t.trim())):[t.trim()]}function f(t,e,r,s){const i=function(t){if(Array.isArray(t)){const e=[];for(const r of t)e.push(...h(r));return e}return h(t)}(e);if(1!==i.length){const e=i.map((e=>s(t,e,r)));return(0,n.AL)(e)}return s(t,i[0],r)}function d(t){let e=!1;return()=>{e||(e=!0,t())}}},26258:(t,e,r)=>{r.d(e,{BT:()=>w,YP:()=>S,aQ:()=>T});var n=r(3894),s=r(22974),i=r(70586),o=r(71143);class a extends o.Z{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=(0,i.wN)(this._set)}acquire(...t){const e=super.acquire(...t);return this._set.delete(e),e}release(t){t&&!this._set.has(t)&&(super.release(t),this._set.add(t))}_dispose(t){this._set.delete(t),super._dispose(t)}}var c,l,u=r(1654),h=r(99001),f=r(67723),d=r(87538),p=r(1153);(l=c||(c={}))[l.Untracked=0]="Untracked",l[l.Tracked=1]="Tracked";class y{constructor(){this.uid=(0,h.D)(),this.removed=!1,this.type=null,this.oldValue=null,this.callback=null,this.getValue=null,this.target=null,this.path=null,this.equals=null}static acquireUntracked(t,e,r,n,i){return this.pool.acquire(c.Untracked,t,e,r,n,i,s.fS)}static acquireTracked(t,e,r,n){return this.pool.acquire(c.Tracked,t,e,r,null,null,n)}notify(t,e){this.type===c.Untracked?this.callback.call(this.target,t,e,this.path,this.target):this.callback.call(null,t,e)}acquire(t,e,r,n,s,i,o){this.uid=(0,h.D)(),this.removed=!1,this.type=t,this.oldValue=e,this.callback=r,this.getValue=n,this.target=s,this.path=i,this.equals=o}release(){this.target=this.path=this.oldValue=this.callback=this.getValue=null,this.uid=(0,h.D)(),this.removed=!0}}y.pool=new a(y);const g=new n.Z,_=new Set;let v;function m(t){_.delete(t),_.add(t),v||(v=(0,u.Os)(O))}function b(t){if(t.removed)return;const e=t.oldValue,r=t.getValue();t.equals(e,r)||(t.oldValue=r,t.notify(r,e))}function w(t){for(const e of _.values())e.target===t&&(e.removed=!0)}function O(){let t=10;for(;v&&t--;){v=null;const t=A(),e=g.acquire();for(const r of t){const t=r.uid;b(r),t===r.uid&&r.removed&&e.push(r)}for(const t of _)t.removed&&(e.push(t),_.delete(t));for(const t of e)y.pool.release(t);g.release(e),g.release(t),j.forEach((t=>t()))}}function A(){const t=g.acquire();t.length=_.size;let e=0;for(const r of _)t[e]=r,++e;return _.clear(),t}const j=new Set;function S(t,e,r,n=!1){return!t.__accessor__||t.__accessor__.destroyed?{remove(){}}:n?function(t,e,r){const n=(0,p.Qc)(t,e,r,((t,e,r)=>{let i=!1;return(0,d.U5)((()=>(0,f.$z)(t,e)),((o,a)=>{t.__accessor__.destroyed?n.remove():i||(i=!0,(0,s.fS)(a,o)||r.call(t,o,a,e,t),i=!1)}))}));return n}(t,e,r):function(t,e,r){let n=(0,p.Qc)(t,e,r,((t,e,r)=>{let s,i,o=(0,d.Xz)((()=>(0,f.$z)(t,e)),((o,a)=>{t.__accessor__.destroyed||s&&s.uid!==i?n.remove():(s||(s=y.acquireUntracked(o,r,a,t,e),i=s.uid),m(s))}));return{remove:(0,p.IH)((()=>{o.remove(),s&&(s.uid!==i||s.removed||(s.removed=!0,m(s)),s=null),n=o=null}))}}));return n}(t,e,r)}function T(t,e,r=!1,n=s.y7){return r?function(t,e,r){let n=!1;return(0,d.U5)(t,((t,s)=>{n||(n=!0,r(s,t)||e(t,s),n=!1)}))}(t,e,n):function(t,e,r){let n,s,i=(0,d.Xz)(t,((t,o)=>{n&&n.uid!==s?i.remove():(n||(n=y.acquireTracked(t,e,o,r),s=n.uid),m(n))}));return{remove:(0,p.IH)((()=>{i.remove(),n&&(n.uid!==s||n.removed||(n.removed=!0,m(n)),n=null),i=null}))}}(t,e,n)}},76169:(t,e,r)=>{r.d(e,{c:()=>f,d:()=>h});var n=r(67676),s=r(20102),i=r(92604),o=r(31263),a=r(1153),c=r(53906);function l(t,e,r,n,s){const i={};return e.write?.writer?.call(t,n,i,r,s),i}function u(t,e,r,a,c,l){if(!a||!a.write)return!1;const u=t.get(r);if(!c&&a.write.overridePolicy){const e=a.write.overridePolicy.call(t,u,r,l);void 0!==e&&(c=e)}if(c||(c=a.write),!c||!1===c.enabled)return!1;if((null===u&&!c.allowNull&&!c.writerEnsuresNonNull||void 0===u)&&c.isRequired){const e=new s.Z("web-document-write:property-required",`Missing value for required property '${r}' on '${t.declaredClass}'`,{propertyName:r,target:t});return e&&l&&l.messages?l.messages.push(e):e&&!l&&i.Z.getLogger("esri.core.accessorSupport.write").error(e.name,e.message),!1}return!(void 0===u||null===u&&!c.allowNull&&!c.writerEnsuresNonNull||(!e.store.multipleOriginsSupported||e.store.originOf(r)===o.s3.DEFAULTS)&&function(t,e,r,s,i){const o=s.default;if(void 0===o)return!1;if(null!=s.defaultEquals)return s.defaultEquals(i);if("function"==typeof o){if(Array.isArray(i)){const s=o.call(t,e,r);return(0,n.fS)(s,i)}return!1}return o===i}(t,r,l,a,u)||!c.ignoreOrigin&&l&&l.origin&&e.store.multipleOriginsSupported&&e.store.originOf(r)<(0,o.M9)(l.origin))}function h(t,e,r,n){const s=(0,a.vw)(t),i=s.metadatas,o=(0,c.Ah)(i[e],n);return!!o&&u(t,s,e,o,r,n)}function f(t,e,r){if(t&&"function"==typeof t.toJSON&&(!t.toJSON.isDefaultToJSON||!t.write))return(0,a.TS)(e,t.toJSON(r));const n=(0,a.vw)(t),s=n.metadatas;for(const i in s){const h=(0,c.Ah)(s[i],r);if(!u(t,n,i,h,void 0,r))continue;const f=t.get(i),d=l(t,h,h.write&&"string"==typeof h.write.target?h.write.target:i,f,r);Object.keys(d).length>0&&(e=(0,a.TS)(e,d),r?.resources?.pendingOperations?.length&&r.resources.pendingOperations.push(Promise.all(r.resources.pendingOperations).then((()=>(0,a.TS)(e,d,(()=>"replace-arrays"))))),r&&r.writtenProperties&&r.writtenProperties.push({target:t,propName:i,oldOrigin:(0,o.Wm)(n.store.originOf(i)),newOrigin:r.origin}))}return e}},50758:(t,e,r)=>{function n(t){return s((()=>t.forEach((t=>null!=t&&t.remove()))))}function s(t){return{remove:()=>{t&&(t(),t=void 0)}}}r.d(e,{AL:()=>n,kB:()=>s})},66374:(t,e,r)=>{function n(t){const e=[];return function*(){yield*e;for(const r of t)e.push(r),yield r}}function s(t,e){for(const r of t)if(null!=r&&e(r))return r}function i(t){return null!=t&&"function"==typeof t[Symbol.iterator]}r.d(e,{Fs:()=>n,TW:()=>i,sE:()=>s})},35454:(t,e,r)=>{r.d(e,{X:()=>s,w:()=>i});var n=r(78286);class s{constructor(t,e={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=t,this._options=e,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(t),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=t=>this.fromJSON(t),this.write=(t,e,r)=>{const s=this.toJSON(t);void 0!==s&&(0,n.RB)(r,s,e)},this.write.isJSONMapWriter=!0}toJSON(t){if(null==t)return null;if(this._apiToJSON.hasOwnProperty(t)){const e=this._apiToJSON[t];return this._options.useNumericKeys?+e:e}return this._options.ignoreUnknown?void 0:t}fromJSON(t){return null!=t&&this._jsonToAPI.hasOwnProperty(t)?this._jsonToAPI[t]:this._options.ignoreUnknown?void 0:t}_invertMap(t){const e={};for(const r in t)e[t[r]]=r;return e}_getKeysSorted(t){const e=[];for(const r in t)e.push(r);return e.sort(),e}}function i(){return function(t,e){return new s(t,{ignoreUnknown:!0,...e})}}},41213:(t,e,r)=>{r.d(e,{Y:()=>s});const n=[];function s(t){n.push(t),1===n.length&&queueMicrotask((()=>{const t=n.slice();n.length=0;for(const e of t)e()}))}},1654:(t,e,r)=>{r.d(e,{MU:()=>b,Os:()=>g});var n=r(70586),s=r(41213),i=r(54790),o=r(44553),a=r(95330),c=r(76882);class l{constructor(t){this.callback=t,this.isActive=!0}remove(){this.isActive=!1}}let u=0;const h={time:(0,c.HA)(0),deltaTime:(0,c.HA)(0),elapsedFrameTime:(0,c.HA)(0),frameDuration:(0,c.HA)(0)},f=["prepare","preRender","render","postRender","update","finish"],d=[],p=new o.Z,y={frameTasks:p,willDispatch:!1,clearFrameTasks:function(t=!1){p.forAll((t=>{t.removed=!0})),t&&v()},dispatch:m,executeFrameTasks:function(t){const e=(0,c.HA)(t-u);u=t;const r=1e3/60,n=Math.max(0,e-r);h.time=t,h.frameDuration=(0,c.HA)(r-n);for(let r=0;r<f.length;r++){const n=performance.now(),s=f[r];p.forAll((n=>{n.paused||n.removed||(0===r&&n.ticks++,n.phases[s]&&(h.elapsedFrameTime=(0,c.HA)(performance.now()-t),h.deltaTime=0===n.ticks?(0,c.HA)(0):e,n.phases[s]?.call(n,h)))})),w[r].record(performance.now()-n)}v(),O.record(performance.now()-t)}};function g(t){const e=new l(t);return d.push(e),y.willDispatch||(y.willDispatch=!0,(0,s.Y)(m)),e}const _=new o.Z;function v(){p.forAll((t=>{t.removed&&_.push(t)})),p.removeUnorderedMany(_.data,_.length),_.clear()}function m(){for(;d.length;){const t=(0,n.j0)(d.shift());t.isActive&&t.callback()}y.willDispatch=!1}function b(t=1,e){const r=(0,a.hh)(),n=()=>{(0,a.Hc)(e)?r.reject((0,a.zE)()):0===t?r():(--t,(0,s.Y)((()=>n())))};return n(),r.promise}const w=f.map((t=>new i.Z(t))),O=new i.Z("total")},76882:(t,e,r)=>{function n(t){return t}r.d(e,{HA:()=>n})},99001:(t,e,r)=>{r.d(e,{D:()=>s});let n=0;function s(){return++n}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8598],{93860:(e,t,r)=>{function n(e,t){const r=e.count;t||(t=new e.TypedArrayConstructor(r));for(let n=0;n<r;n++)t[n]=e.get(n);return t}r.d(t,{m:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,makeDense:n},Symbol.toStringTag,{value:"Module"}))},10816:(e,t,r)=>{r.d(t,{a:()=>o,f:()=>a,n:()=>s});var n=r(1533);function o(e,t){s(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r=2,o=r){const s=t.length/2;let a=0,i=0;if((0,n.kJ)(t)||(0,n.Q7)(t)){for(let n=0;n<s;++n)e[a]=t[i],e[a+1]=t[i+1],a+=r,i+=o;return}const u=(0,n.Op)(t);if((0,n.B3)(t))for(let n=0;n<s;++n)e[a]=Math.max(t[i]/u,-1),e[a+1]=Math.max(t[i+1]/u,-1),a+=r,i+=o;else for(let n=0;n<s;++n)e[a]=t[i]/u,e[a+1]=t[i+1]/u,a+=r,i+=o}function a(e,t,r,n){const o=e.typedBuffer,s=e.typedBufferStride,a=n?.count??e.count;let i=(n?.dstIndex??0)*s;for(let e=0;e<a;++e)o[i]=t,o[i+1]=r,i+=s}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:s,normalizeIntegerBufferView:o},Symbol.toStringTag,{value:"Module"}))},56067:(e,t,r)=>{function n(e,t){o(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r=3,n=r){const o=t.length/n;let s=0,a=0;for(let i=0;i<o;++i)e[s]=t[a],e[s+1]=t[a+1],e[s+2]=t[a+2],s+=r,a+=n}function s(e,t,r,n,o){const s=e.typedBuffer,a=e.typedBufferStride,i=o?.count??e.count;let u=(o?.dstIndex??0)*a;for(let e=0;e<i;++e)s[u]=t,s[u+1]=r,s[u+2]=n,u+=a}r.d(t,{a:()=>n,c:()=>o,f:()=>s}),Object.freeze(Object.defineProperty({__proto__:null,copy:o,copyView:n,fill:s},Symbol.toStringTag,{value:"Module"}))},11077:(e,t,r)=>{r.d(t,{a:()=>o,b:()=>i,n:()=>a,s:()=>u,t:()=>s});var n=r(72220);function o(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=4,s=o){if(e.length/o!=t.length/s)return void n.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,i=r[0],u=r[1],l=r[2],c=r[3],f=r[4],d=r[5],p=r[6],h=r[7],m=r[8];let w=0,T=0;for(let r=0;r<a;r++){const r=t[w],n=t[w+1],a=t[w+2],g=t[w+3];e[T]=i*r+c*n+p*a,e[T+1]=u*r+f*n+h*a,e[T+2]=l*r+d*n+m*a,e[T+3]=g,w+=s,T+=o}}function a(e,t){const r=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*o,r=e*a,i=s[r],u=s[r+1],l=s[r+2],c=i*i+u*u+l*l;if(c>0){const e=1/Math.sqrt(c);n[t]=e*i,n[t+1]=e*u,n[t+2]=e*l}}}function i(e,t,r){u(e.typedBuffer,t,r,e.typedBufferStride)}function u(e,t,r,n=4){const o=Math.min(e.length/n,t.count),s=t.typedBuffer,a=t.typedBufferStride;let i=0,u=0;for(let t=0;t<o;t++)e[u]=r*s[i],e[u+1]=r*s[i+1],e[u+2]=r*s[i+2],e[u+3]=r*s[i+3],i+=a,u+=n}Object.freeze(Object.defineProperty({__proto__:null,normalize:a,scale:u,scaleView:i,shiftRight:function(e,t,r){const n=Math.min(e.count,t.count),o=e.typedBuffer,s=e.typedBufferStride,a=t.typedBuffer,i=t.typedBufferStride;for(let e=0;e<n;e++){const t=e*s,n=e*i;o[t]=a[n]>>r,o[t+1]=a[n+1]>>r,o[t+2]=a[n+2]>>r,o[t+3]=a[n+3]>>r}},transformMat3:s,transformMat3View:o,transformMat4:function(e,t,r){if(e.count!==t.count)return void n.c.error("source and destination buffers need to have the same number of elements");const o=e.count,s=r[0],a=r[1],i=r[2],u=r[3],l=r[4],c=r[5],f=r[6],d=r[7],p=r[8],h=r[9],m=r[10],w=r[11],T=r[12],g=r[13],y=r[14],_=r[15],x=e.typedBuffer,b=e.typedBufferStride,S=t.typedBuffer,O=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*b,r=e*O,n=S[r],o=S[r+1],N=S[r+2],A=S[r+3];x[t]=s*n+l*o+p*N+T*A,x[t+1]=a*n+c*o+h*N+g*A,x[t+2]=i*n+f*o+m*N+y*A,x[t+3]=u*n+d*o+w*N+_*A}}},Symbol.toStringTag,{value:"Module"}))},75488:(e,t,r)=>{function n(e,t){o(e.typedBuffer,t,e.typedBufferStride)}function o(e,t,r=4){const n=t.typedBuffer,o=t.typedBufferStride,s=t.count;let a=0,i=0;for(let t=0;t<s;++t)e[a]=n[i],e[a+1]=n[i+1],e[a+2]=n[i+2],e[a+3]=n[i+3],a+=r,i+=o}function s(e,t,r,n,o,s){const a=e.typedBuffer,i=e.typedBufferStride,u=s?.count??e.count;let l=(s?.dstIndex??0)*i;for(let e=0;e<u;++e)a[l]=t,a[l+1]=r,a[l+2]=n,a[l+3]=o,l+=i}r.d(t,{a:()=>n,c:()=>o,f:()=>s}),Object.freeze(Object.defineProperty({__proto__:null,copy:o,copyView:n,fill:s},Symbol.toStringTag,{value:"Module"}))},23670:(e,t,r)=>{r.d(t,{G:()=>o});var n=r(20102);let o=class{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new n.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,s]=e.split("."),a=/^\s*\d+\s*$/;if(!r||!r.match||!r.match(a))throw new n.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!s||!s.match||!s.match(a))throw new n.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const i=parseInt(r,10),u=parseInt(s,10);return new o(i,u,t)}}},40270:(e,t,r)=>{r.d(t,{C:()=>u});var n=r(3172),o=r(66643),s=r(20102),a=r(95330),i=r(17452);class u{constructor(e){this._streamDataRequester=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,i.HK)(e)?((0,a.k_)(t),(0,i.AH)(e)):this._load("binary",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){if(null==this._streamDataRequester)return(await(0,n.default)(t,{responseType:l[e]})).data;const i=await(0,o.q6)(this._streamDataRequester.request(t,e,r));if(!0===i.ok)return i.value;throw(0,a.r9)(i.error),new s.Z("",`Request for resource failed: ${i.error}`)}}const l={image:"image",binary:"array-buffer",json:"json"}},91911:(e,t,r)=>{r.d(t,{p:()=>a});var n=r(1533),o=r(24882),s=r(35371);function a(e,t){switch(t){case s.MX.TRIANGLES:return"number"==typeof(r=e)?(0,o.KF)(r):(0,n.lq)(r)?new Uint16Array(r):r;case s.MX.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,n=(0,o.$z)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(n[e++]=t,n[e++]=t+1,n[e++]=t+2):(n[e++]=t+1,n[e++]=t,n[e++]=t+2)}else{let t=0;for(let o=0;o<r;o+=1)o%2==0?(n[t++]=e[o],n[t++]=e[o+1],n[t++]=e[o+2]):(n[t++]=e[o+1],n[t++]=e[o],n[t++]=e[o+2])}return n}(e);case s.MX.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,n=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)n[e++]=0,n[e++]=t+1,n[e++]=t+2;return n}const o=e[0];let s=e[1],a=0;for(let t=0;t<r;++t){const r=e[t+2];n[a++]=o,n[a++]=s,n[a++]=r,s=r}return n}(e)}var r}},15317:(e,t,r)=>{r.d(t,{$A:()=>s,Ml:()=>i,NM:()=>o,i$:()=>a});var n=r(47026);class o{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding=n.Ti.KTX2_ENCODING}}function s(e){return"encoded-mesh-texture"===e?.type}async function a(e){return new Promise(((t,r)=>{const n=new Blob([e]),o=new FileReader;o.onload=()=>{const e=o.result;t(JSON.parse(e))},o.onerror=e=>{r(e)},o.readAsText(n)}))}async function i(e,t){return t===n.Ti.KTX2_ENCODING?new o(e):new Promise(((r,n)=>{const o=new Blob([e],{type:t}),s=URL.createObjectURL(o),a=new Image,i=()=>{URL.revokeObjectURL(s),"decode"in a?a.decode().then((()=>r(a)),(()=>r(a))).then(l):(r(a),l())},u=e=>{URL.revokeObjectURL(s),n(e),l()},l=()=>{a.removeEventListener("load",i),a.removeEventListener("error",u)};a.addEventListener("load",i),a.addEventListener("error",u),a.src=s}))}},91695:(e,t,r)=>{r.d(t,{Q:()=>U});var n,o,s=r(92604),a=r(13598),i=r(35371),u=r(20102),l=r(30175),c=r(95330),f=r(17452),d=r(23670),p=r(52138),h=r(51305),m=r(94961),w=r(56481),T=r(93860);r(80442);class g{constructor(e){this._data=e,this._offset4=0,this._dataUint32=new Uint32Array(this._data,0,Math.floor(this._data.byteLength/4))}readUint32(){const e=this._offset4;return this._offset4+=1,this._dataUint32[e]}readUint8Array(e){const t=4*this._offset4;return this._offset4+=e/4,new Uint8Array(this._data,t,e)}remainingBytes(){return this._data.byteLength-4*this._offset4}}!function(e){e.SCALAR="SCALAR",e.VEC2="VEC2",e.VEC3="VEC3",e.VEC4="VEC4",e.MAT2="MAT2",e.MAT3="MAT3",e.MAT4="MAT4"}(n||(n={})),function(e){e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"}(o||(o={}));var y=r(74085);const _={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1},x={pbrMetallicRoughness:_,emissiveFactor:[0,0,0],alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1},b={ESRI_externalColorMixMode:"tint"},S=(e={})=>{const t={..._,...e.pbrMetallicRoughness},r=function(e){switch(e.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:(0,y.Bg)(e.ESRI_externalColorMixMode),e.ESRI_externalColorMixMode="tint"}return e}({...b,...e.extras});return{...x,...e,pbrMetallicRoughness:t,extras:r}},O={magFilter:i.cw.LINEAR,minFilter:i.cw.LINEAR_MIPMAP_LINEAR,wrapS:i.e8.REPEAT,wrapT:i.e8.REPEAT},N=e=>({...O,...e});var A=r(15317);const E=1179937895;class v{constructor(e,t,r,n){if(this._context=e,this.uri=t,this.json=r,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu"],this._baseUri=function(e){let t,r;return e.replace(/^(.*\/)?([^/]*)$/,((e,n,o)=>(t=n||"",r=o||"",""))),{dirPart:t,filePart:r}}(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),null==r.scenes)throw new u.Z("gltf-loader-unsupported-feature","Scenes must be defined.");if(null==r.meshes)throw new u.Z("gltf-loader-unsupported-feature","Meshes must be defined");if(null==r.nodes)throw new u.Z("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,t,r){if((0,f.HK)(t)){const r=(0,f.sJ)(t);if(r&&"model/gltf-binary"!==r.mediaType)try{const n=JSON.parse(r.isBase64?atob(r.data):r.data);return new v(e,t,n)}catch{}const n=(0,f.AH)(t);if(v._isGLBData(n))return this._fromGLBData(e,t,n)}if(t.endsWith(".gltf")){const n=await e.loadJSON(t,r);return new v(e,t,n)}const n=await e.loadBinary(t,r);if(v._isGLBData(n))return this._fromGLBData(e,t,n);const o=await e.loadJSON(t,r);return new v(e,t,o)}static _isGLBData(e){if(null==e)return!1;const t=new g(e);return t.remainingBytes()>=4&&t.readUint32()===E}static async _fromGLBData(e,t,r){const n=await v._parseGLBData(r);return new v(e,t,n.json,n.binaryData)}static async _parseGLBData(e){const t=new g(e);if(t.remainingBytes()<12)throw new u.Z("gltf-loader-error","GLB binary data is insufficiently large.");const r=t.readUint32(),n=t.readUint32(),o=t.readUint32();if(r!==E)throw new u.Z("gltf-loader-error","Magic first 4 bytes do not fit to expected GLB value.");if(e.byteLength<o)throw new u.Z("gltf-loader-error","GLB binary data is smaller than header specifies.");if(2!==n)throw new u.Z("gltf-loader-unsupported-feature","An unsupported GLB container version was detected. Only version 2 is supported.");let a,i,l=0;for(;t.remainingBytes()>=8;){const e=t.readUint32(),r=t.readUint32();if(0===l){if(1313821514!==r)throw new u.Z("gltf-loader-error","First GLB chunk must be JSON.");if(e<0)throw new u.Z("gltf-loader-error","No JSON data found.");a=await(0,A.i$)(t.readUint8Array(e))}else if(1===l){if(5130562!==r)throw new u.Z("gltf-loader-unsupported-feature","Second GLB chunk expected to be BIN.");i=t.readUint8Array(e)}else s.Z.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 GLB chunks detected. Skipping.");l+=1}if(!a)throw new u.Z("gltf-loader-error","No GLB JSON chunk detected.");return{json:a,binaryData:i}}async getBuffer(e,t){const r=this.json.buffers[e];if(null==r.uri){if(null==this._glbBuffer)throw new u.Z("gltf-loader-error","GLB buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(e,t);if(n.byteLength!==r.byteLength)throw new u.Z("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const n=this.json.buffers[e].uri,o=this._context.loadBinary(this._resolveUri(n),t).then((e=>new Uint8Array(e)));return this._bufferLoaders.set(e,o),o}async getAccessor(e,t){if(!this.json.accessors)throw new u.Z("gltf-loader-unsupported-feature","Accessors missing.");const r=this.json.accessors[e];if(null==r?.bufferView)throw new u.Z("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(r.type in[n.MAT2,n.MAT3,n.MAT4])throw new u.Z("gltf-loader-unsupported-feature",`AttributeType ${r.type} is not supported`);const o=this.json.bufferViews[r.bufferView],s=await this.getBuffer(o.buffer,t),a=B[r.type],i=L[r.componentType],l=a*i,c=o.byteStride||l;return{raw:s.buffer,byteStride:c,byteOffset:s.byteOffset+(o.byteOffset||0)+(r.byteOffset||0),entryCount:r.count,isDenselyPacked:c===l,componentCount:a,componentByteSize:i,componentType:r.componentType,min:r.min,max:r.max,normalized:!!r.normalized}}async getIndexData(e,t){if(null==e.indices)return;const r=await this.getAccessor(e.indices,t);if(r.isDenselyPacked)switch(r.componentType){case i.g.UNSIGNED_BYTE:return new Uint8Array(r.raw,r.byteOffset,r.entryCount);case i.g.UNSIGNED_SHORT:return new Uint16Array(r.raw,r.byteOffset,r.entryCount);case i.g.UNSIGNED_INT:return new Uint32Array(r.raw,r.byteOffset,r.entryCount)}else switch(r.componentType){case i.g.UNSIGNED_BYTE:return(0,T.m)(this._wrapAccessor(w.D_,r));case i.g.UNSIGNED_SHORT:return(0,T.m)(this._wrapAccessor(w.av,r));case i.g.UNSIGNED_INT:return(0,T.m)(this._wrapAccessor(w.Nu,r))}}async getPositionData(e,t){if(null==e.attributes.POSITION)throw new u.Z("gltf-loader-unsupported-feature","No POSITION vertex data found.");const r=await this.getAccessor(e.attributes.POSITION,t);if(r.componentType!==i.g.FLOAT)throw new u.Z("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+i.g[r.componentType]);if(3!==r.componentCount)throw new u.Z("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+r.componentCount.toFixed());return this._wrapAccessor(w.ct,r)}async getNormalData(e,t){if(null==e.attributes.NORMAL)throw new u.Z("gltf-loader-error","No NORMAL vertex data found.");const r=await this.getAccessor(e.attributes.NORMAL,t);if(r.componentType!==i.g.FLOAT)throw new u.Z("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+i.g[r.componentType]);if(3!==r.componentCount)throw new u.Z("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+r.componentCount.toFixed());return this._wrapAccessor(w.ct,r)}async getTangentData(e,t){if(null==e.attributes.TANGENT)throw new u.Z("gltf-loader-error","No TANGENT vertex data found.");const r=await this.getAccessor(e.attributes.TANGENT,t);if(r.componentType!==i.g.FLOAT)throw new u.Z("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+i.g[r.componentType]);if(4!==r.componentCount)throw new u.Z("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+r.componentCount.toFixed());return new w.ek(r.raw,r.byteOffset,r.byteStride,r.byteOffset+r.byteStride*r.entryCount)}async getTextureCoordinates(e,t){if(null==e.attributes.TEXCOORD_0)throw new u.Z("gltf-loader-error","No TEXCOORD_0 vertex data found.");const r=await this.getAccessor(e.attributes.TEXCOORD_0,t);if(2!==r.componentCount)throw new u.Z("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+r.componentCount.toFixed());if(r.componentType===i.g.FLOAT)return this._wrapAccessor(w.Eu,r);if(!r.normalized)throw new u.Z("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return function(e){switch(e.componentType){case i.g.BYTE:return new w.Vs(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case i.g.UNSIGNED_BYTE:return new w.xA(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case i.g.SHORT:return new w.or(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case i.g.UNSIGNED_SHORT:return new w.TS(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case i.g.UNSIGNED_INT:return new w.qt(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case i.g.FLOAT:return new w.Eu(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}(r)}async getVertexColors(e,t){if(null==e.attributes.COLOR_0)throw new u.Z("gltf-loader-error","No COLOR_0 vertex data found.");const r=await this.getAccessor(e.attributes.COLOR_0,t);if(4!==r.componentCount&&3!==r.componentCount)throw new u.Z("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+r.componentCount.toFixed());if(4===r.componentCount){if(r.componentType===i.g.FLOAT)return this._wrapAccessor(w.ek,r);if(r.componentType===i.g.UNSIGNED_BYTE)return this._wrapAccessor(w.mc,r);if(r.componentType===i.g.UNSIGNED_SHORT)return this._wrapAccessor(w.v6,r)}else if(3===r.componentCount){if(r.componentType===i.g.FLOAT)return this._wrapAccessor(w.ct,r);if(r.componentType===i.g.UNSIGNED_BYTE)return this._wrapAccessor(w.ne,r);if(r.componentType===i.g.UNSIGNED_SHORT)return this._wrapAccessor(w.mw,r)}throw new u.Z("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+i.g[r.componentType])}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let n=e.material?this._materialCache.get(e.material):void 0;if(!n){const o=null!=e.material?S(this.json.materials[e.material]):S(),s=o.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(s.baseColorTexture,t),u=this.getTexture(o.normalTexture,t),l=r?this.getTexture(o.occlusionTexture,t):void 0,c=r?this.getTexture(o.emissiveTexture,t):void 0,f=r?this.getTexture(s.metallicRoughnessTexture,t):void 0,d=null!=e.material?e.material:-1;n={alphaMode:o.alphaMode,alphaCutoff:o.alphaCutoff,color:s.baseColorFactor,doubleSided:!!o.doubleSided,colorTexture:await i,normalTexture:await u,name:o.name,id:d,occlusionTexture:await l,emissiveTexture:await c,emissiveFactor:o.emissiveFactor,metallicFactor:s.metallicFactor,roughnessFactor:s.roughnessFactor,metallicRoughnessTexture:await f,hasVertexColors:a,ESRI_externalColorMixMode:o.extras.ESRI_externalColorMixMode,colorTextureTransform:s?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:o.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:o.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:o.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:s?.metallicRoughnessTexture?.extensions?.KHR_texture_transform}}return n}async getTexture(e,t){if(!e)return;if(0!==(e.texCoord||0))throw new u.Z("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const r=e.index,n=this.json.textures[r],o=N(null!=n.sampler?this.json.samplers[n.sampler]:{}),s=this._getTextureSourceId(n),a=this.json.images[s],i=await this._loadTextureImageData(r,n,t);return(0,l.s1)(this._textureCache,r,(()=>{const e=e=>33071===e||33648===e||10497===e,t=e=>{throw new u.Z("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${e}`)};return{data:i,wrapS:e(o.wrapS)?o.wrapS:t(o.wrapS),wrapT:e(o.wrapT)?o.wrapT:t(o.wrapT),minFilter:o.minFilter,name:a.name,id:r}}))}getNodeTransform(e){if(void 0===e)return R;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),n=this.json.nodes[e];n.matrix?t=(0,p.m)((0,a.c)(),r,n.matrix):n.translation||n.rotation||n.scale?(t=(0,a.b)(r),n.translation&&(0,p.w)(t,t,n.translation),n.rotation&&(M[3]=(0,h.g)(M,n.rotation),(0,p.e)(t,t,M[3],M)),n.scale&&(0,p.k)(t,t,n.scale)):t=(0,a.b)(r),this._nodeTransformCache.set(e,t)}return t}_wrapAccessor(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}_resolveUri(e){return(0,f.hF)(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=d.G.parse(this.json.asset.version,"glTF");C.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every((e=>this._supportedExtensions.includes(e))))throw new u.Z("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach(((e,t)=>{e.children&&e.children.forEach((e=>{this._nodeParentMap.set(e,t)}))}))}async _loadTextureImageData(e,t,r){const n=this._textureLoaders.get(e);if(n)return n;const o=this._createTextureLoader(t,r);return this._textureLoaders.set(e,o),o}_getTextureSourceId(e){if(void 0!==e.extensions&&null!==e.extensions.KHR_texture_basisu)return e.extensions.KHR_texture_basisu.source;if(null!==e.source)return e.source;throw new u.Z("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}async _createTextureLoader(e,t){const r=this._getTextureSourceId(e),n=this.json.images[r];if(n.uri){if(n.uri.endsWith(".ktx2")){const e=await this._context.loadBinary(this._resolveUri(n.uri),t);return new A.NM(new Uint8Array(e))}return this._context.loadImage(this._resolveUri(n.uri),t)}if(null==n.bufferView)throw new u.Z("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(null==n.mimeType)throw new u.Z("gltf-loader-unsupported-feature","Image mimeType must be defined.");const o=this.json.bufferViews[n.bufferView],s=await this.getBuffer(o.buffer,t);if(null!=o.byteStride)throw new u.Z("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const a=s.byteOffset+(o.byteOffset||0);return(0,A.Ml)(new Uint8Array(s.buffer,a,o.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await(0,c.WW)(Array.from(this._bufferLoaders.values())),t=await(0,c.WW)(Array.from(this._textureLoaders.values()));return e.reduce(((e,t)=>e+(t?.byteLength??0)),0)+t.reduce(((e,t)=>e+(t?(0,A.$A)(t)?t.data.byteLength:t.width*t.height*4:0)),0)}}const R=(0,p.A)((0,a.c)(),Math.PI/2),C=new d.G(2,0,"glTF"),M=(0,m.a)(),B={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},L={[i.g.BYTE]:1,[i.g.UNSIGNED_BYTE]:1,[i.g.SHORT]:2,[i.g.UNSIGNED_SHORT]:2,[i.g.FLOAT]:4,[i.g.UNSIGNED_INT]:4};let I=0;async function U(e,t,r={},n=!0){const o=await v.load(e,t,r),u="gltf_"+I++,l={lods:[],materials:new Map,textures:new Map,meta:D(o)},c=!(!o.json.asset.extras||"symbolResource"!==o.json.asset.extras.ESRI_type),f=new Map;await F(o,(async(e,t,c,d)=>{const p=f.get(c)??0;f.set(c,p+1);const h=void 0!==e.mode?e.mode:i.MX.TRIANGLES,m=h===i.MX.TRIANGLES||h===i.MX.TRIANGLE_STRIP||h===i.MX.TRIANGLE_FAN?h:null;if(null==m)return void s.Z.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+i.MX[h]+"). Skipping primitive.");if(!o.hasPositions(e))return void s.Z.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const w=o.getPositionData(e,r),T=o.getMaterial(e,r,n),g=o.hasNormals(e)?o.getNormalData(e,r):null,y=o.hasTangents(e)?o.getTangentData(e,r):null,_=o.hasTextureCoordinates(e)?o.getTextureCoordinates(e,r):null,x=o.hasVertexColors(e)?o.getVertexColors(e,r):null,b=o.getIndexData(e,r),S={transform:(0,a.b)(t),attributes:{position:await w,normal:g?await g:null,texCoord0:_?await _:null,color:x?await x:null,tangent:y?await y:null},indices:await b,primitiveType:m,material:P(l,await T,u)};let O=null;null!=l.meta&&null!=l.meta.ESRI_lod&&"screenSpaceRadius"===l.meta.ESRI_lod.metric&&(O=l.meta.ESRI_lod.thresholds[c]),l.lods[c]=l.lods[c]||{parts:[],name:d,lodThreshold:O},l.lods[c].parts[p]=S}));for(const e of l.lods)e.parts=e.parts.filter((e=>!!e));const d=await o.getLoadedBuffersSize();return{model:l,meta:{isEsriSymbolResource:c,uri:o.uri},customMeta:{},size:d}}function D(e){const t=e.json;let r=null;return t.nodes.forEach((e=>{const t=e.extras;null!=t&&(t.ESRI_proxyEllipsoid||t.ESRI_lod)&&(r=t)})),r}async function F(e,t){const r=e.json,n=r.scenes[r.scene||0].nodes,o=n.length>1,a=[];for(const e of n){const t=r.nodes[e];a.push(i(e,0)),G(t)&&!o&&t.extensions.MSFT_lod.ids.forEach(((e,t)=>i(e,t+1)))}async function i(n,o){const u=r.nodes[n],l=e.getNodeTransform(n);if(null!=u.weights&&s.Z.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),null!=u.mesh){const e=r.meshes[u.mesh];for(const r of e.primitives)a.push(t(r,l,o,e.name))}for(const e of u.children||[])a.push(i(e,o))}await Promise.all(a)}function G(e){return e.extensions&&e.extensions.MSFT_lod&&Array.isArray(e.extensions.MSFT_lod.ids)}function P(e,t,r){const n=t=>{const n=`${r}_tex_${t&&t.id}${t&&t.name?"_"+t.name:""}`;if(t&&!e.textures.has(n)){const r=function(e,t={}){return{data:e,parameters:{wrap:{s:i.e8.REPEAT,t:i.e8.REPEAT,...t.wrap},noUnpackFlip:!0,mipmap:!1,...t}}}(t.data,{wrap:{s:t.wrapS,t:t.wrapT},mipmap:j.includes(t.minFilter),noUnpackFlip:!0});e.textures.set(n,r)}return n},o=`${r}_mat_${t.id}_${t.name}`;if(!e.materials.has(o)){const r=function(e={}){return{color:[1,1,1],opacity:1,alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1,castShadows:!0,receiveShadows:!0,receiveAmbientOcclustion:!0,textureColor:null,textureNormal:null,textureOcclusion:null,textureEmissive:null,textureMetallicRoughness:null,colorTextureTransform:null,normalTextureTransform:null,occlusionTextureTransform:null,emissiveTextureTransform:null,metallicRoughnessTextureTransform:null,emissiveFactor:[0,0,0],metallicFactor:1,roughnessFactor:1,colorMixMode:"multiply",...e}}({color:[t.color[0],t.color[1],t.color[2]],opacity:t.color[3],alphaMode:t.alphaMode,alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,colorMixMode:t.ESRI_externalColorMixMode,textureColor:t.colorTexture?n(t.colorTexture):void 0,textureNormal:t.normalTexture?n(t.normalTexture):void 0,textureOcclusion:t.occlusionTexture?n(t.occlusionTexture):void 0,textureEmissive:t.emissiveTexture?n(t.emissiveTexture):void 0,textureMetallicRoughness:t.metallicRoughnessTexture?n(t.metallicRoughnessTexture):void 0,emissiveFactor:[t.emissiveFactor[0],t.emissiveFactor[1],t.emissiveFactor[2]],colorTextureTransform:t.colorTextureTransform,normalTextureTransform:t.normalTextureTransform,occlusionTextureTransform:t.occlusionTextureTransform,emissiveTextureTransform:t.emissiveTextureTransform,metallicRoughnessTextureTransform:t.metallicRoughnessTextureTransform,metallicFactor:t.metallicFactor,roughnessFactor:t.roughnessFactor});e.materials.set(o,r)}return o}const j=[i.cw.LINEAR_MIPMAP_LINEAR,i.cw.LINEAR_MIPMAP_NEAREST]},47026:(e,t,r)=>{var n,o,s,a,i,u,l,c,f,d,p;r.d(t,{CE:()=>l,Gv:()=>o,JJ:()=>f,Rw:()=>a,Ti:()=>p,V_:()=>u,Vr:()=>n,hU:()=>i}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(n||(n={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(s||(s={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(i||(i={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(u||(u={})),function(e){e[e.STRETCH=1]="STRETCH",e[e.PAD=2]="PAD"}(l||(l={})),function(e){e[e.CHANGED=0]="CHANGED",e[e.UNCHANGED=1]="UNCHANGED"}(c||(c={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(f||(f={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(d||(d={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(p||(p={}))},57758:(e,t,r)=>{r.d(t,{K:()=>n});const n=2.1}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3381,819,1433],{13867:(e,t,i)=>{i.d(t,{Z:()=>r});var n=i(69801);class r{constructor(e,t){this._storage=new n.WJ,this._storage.maxSize=e,t&&this._storage.registerRemoveFunc("",t)}put(e,t,i){this._storage.put(e,t,i,1)}pop(e){return this._storage.pop(e)}get(e){return this._storage.get(e)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}}},80819:(e,t,i)=>{i.r(t),i.d(t,{hydratedAdapter:()=>l});var n=i(6570),r=i(65091),s=i(94139),a=i(38913),o=i(58901);const l={convertToGEGeometry:function(e,t){if(null==t)return null;let i="cache"in t?t.cache._geVersion:void 0;return null==i&&(i=e.convertJSONToGeometry(t),"cache"in t&&(t.cache._geVersion=i)),i},exportPoint:function(e,t,i){const n=e.hasZ(t),r=e.hasM(t),a=new s.Z({x:e.getPointX(t),y:e.getPointY(t),spatialReference:i});return n&&(a.z=e.getPointZ(t)),r&&(a.m=e.getPointM(t)),a.cache._geVersion=t,a},exportPolygon:function(e,t,i){const n=new a.Z({rings:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:i});return n.cache._geVersion=t,n},exportPolyline:function(e,t,i){const n=new o.Z({paths:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:i});return n.cache._geVersion=t,n},exportMultipoint:function(e,t,i){const n=new r.Z({hasZ:e.hasZ(t),hasM:e.hasM(t),points:e.exportPoints(t),spatialReference:i});return n.cache._geVersion=t,n},exportExtent:function(e,t,i){const r=e.hasZ(t),s=e.hasM(t),a=new n.Z({xmin:e.getXMin(t),ymin:e.getYMin(t),xmax:e.getXMax(t),ymax:e.getYMax(t),spatialReference:i});if(r){const i=e.getZExtent(t);a.zmin=i.vmin,a.zmax=i.vmax}if(s){const i=e.getMExtent(t);a.mmin=i.vmin,a.mmax=i.vmax}return a.cache._geVersion=t,a}}},61433:(e,t,i)=>{i.r(t),i.d(t,{buffer:()=>C,changeDefaultSpatialReferenceTolerance:()=>W,clearDefaultSpatialReferenceTolerance:()=>q,clip:()=>o,contains:()=>c,convexHull:()=>b,crosses:()=>u,cut:()=>l,densify:()=>z,difference:()=>S,disjoint:()=>y,distance:()=>h,equals:()=>f,extendedSpatialReferenceInfo:()=>a,flipHorizontal:()=>Z,flipVertical:()=>A,generalize:()=>B,geodesicArea:()=>H,geodesicBuffer:()=>k,geodesicDensify:()=>J,geodesicLength:()=>L,intersect:()=>R,intersectLinesToPoints:()=>G,intersects:()=>d,isSimple:()=>w,nearestCoordinate:()=>F,nearestVertex:()=>M,nearestVertices:()=>P,offset:()=>T,overlaps:()=>g,planarArea:()=>N,planarLength:()=>E,relate:()=>x,rotate:()=>D,simplify:()=>I,symmetricDifference:()=>_,touches:()=>p,union:()=>v,within:()=>m});var n=i(45837),r=i(80819);function s(e){return Array.isArray(e)?e[0].spatialReference:e&&e.spatialReference}function a(e){return n.G.extendedSpatialReferenceInfo(e)}function o(e,t){return n.G.clip(r.hydratedAdapter,s(e),e,t)}function l(e,t){return n.G.cut(r.hydratedAdapter,s(e),e,t)}function c(e,t){return n.G.contains(r.hydratedAdapter,s(e),e,t)}function u(e,t){return n.G.crosses(r.hydratedAdapter,s(e),e,t)}function h(e,t,i){return n.G.distance(r.hydratedAdapter,s(e),e,t,i)}function f(e,t){return n.G.equals(r.hydratedAdapter,s(e),e,t)}function d(e,t){return n.G.intersects(r.hydratedAdapter,s(e),e,t)}function p(e,t){return n.G.touches(r.hydratedAdapter,s(e),e,t)}function m(e,t){return n.G.within(r.hydratedAdapter,s(e),e,t)}function y(e,t){return n.G.disjoint(r.hydratedAdapter,s(e),e,t)}function g(e,t){return n.G.overlaps(r.hydratedAdapter,s(e),e,t)}function x(e,t,i){return n.G.relate(r.hydratedAdapter,s(e),e,t,i)}function w(e){return n.G.isSimple(r.hydratedAdapter,s(e),e)}function I(e){return n.G.simplify(r.hydratedAdapter,s(e),e)}function b(e,t=!1){return n.G.convexHull(r.hydratedAdapter,s(e),e,t)}function S(e,t){return n.G.difference(r.hydratedAdapter,s(e),e,t)}function _(e,t){return n.G.symmetricDifference(r.hydratedAdapter,s(e),e,t)}function R(e,t){return n.G.intersect(r.hydratedAdapter,s(e),e,t)}function v(e,t=null){return n.G.union(r.hydratedAdapter,s(e),e,t)}function T(e,t,i,a,o,l){return n.G.offset(r.hydratedAdapter,s(e),e,t,i,a,o,l)}function C(e,t,i,a=!1){return n.G.buffer(r.hydratedAdapter,s(e),e,t,i,a)}function k(e,t,i,a,o,l){return n.G.geodesicBuffer(r.hydratedAdapter,s(e),e,t,i,a,o,l)}function F(e,t,i=!0){return n.G.nearestCoordinate(r.hydratedAdapter,s(e),e,t,i)}function M(e,t){return n.G.nearestVertex(r.hydratedAdapter,s(e),e,t)}function P(e,t,i,a){return n.G.nearestVertices(r.hydratedAdapter,s(e),e,t,i,a)}function O(e){return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e?e.extent?.center??null:null}function D(e,t,i){if(null==e)throw new j;const r=e.spatialReference;if(null==(i=i??O(e)))throw new j;const s=e.constructor.fromJSON(n.G.rotate(e,t,i));return s.spatialReference=r,s}function Z(e,t){if(null==e)throw new j;const i=e.spatialReference;if(null==(t=t??O(e)))throw new j;const r=e.constructor.fromJSON(n.G.flipHorizontal(e,t));return r.spatialReference=i,r}function A(e,t){if(null==e)throw new j;const i=e.spatialReference;if(null==(t=t??O(e)))throw new j;const r=e.constructor.fromJSON(n.G.flipVertical(e,t));return r.spatialReference=i,r}function B(e,t,i,a){return n.G.generalize(r.hydratedAdapter,s(e),e,t,i,a)}function z(e,t,i){return n.G.densify(r.hydratedAdapter,s(e),e,t,i)}function J(e,t,i,a=0){return n.G.geodesicDensify(r.hydratedAdapter,s(e),e,t,i,a)}function N(e,t){return n.G.planarArea(r.hydratedAdapter,s(e),e,t)}function E(e,t){return n.G.planarLength(r.hydratedAdapter,s(e),e,t)}function H(e,t,i){return n.G.geodesicArea(r.hydratedAdapter,s(e),e,t,i)}function L(e,t,i){return n.G.geodesicLength(r.hydratedAdapter,s(e),e,t,i)}function G(e,t){return n.G.intersectLinesToPoints(r.hydratedAdapter,s(e),e,t)}function W(e,t){n.G.changeDefaultSpatialReferenceTolerance(e,t)}function q(e){n.G.clearDefaultSpatialReferenceTolerance(e)}class j extends Error{constructor(){super("Illegal Argument Exception")}}},16306:(e,t,i)=>{i.d(t,{aX:()=>S});var n=i(68773),r=i(20102),s=i(92604),a=i(38913),o=i(58901),l=i(73913),c=i(8744),u=i(40488),h=(i(66577),i(3172)),f=i(33955),d=i(11282),p=i(17452);async function m(e,t,i){const n="string"==typeof e?(0,p.mN)(e):e,r=t[0].spatialReference,s=(0,f.Ji)(t[0]),a={...i,query:{...n.query,f:"json",sr:r.wkid??JSON.stringify(r),geometries:JSON.stringify((l=t,{geometryType:(0,f.Ji)(l[0]),geometries:l.map((e=>e.toJSON()))}))}},{data:o}=await(0,h.default)(n.path+"/simplify",a);var l;return function(e,t,i){const n=(0,f.q9)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=i,t}))}(o.geometries,s,r)}const y=s.Z.getLogger("esri.geometry.support.normalizeUtils");function g(e){return"polygon"===e[0].type}function x(e){return"polyline"===e[0].type}function w(e,t,i){if(t){const t=function(e,t){if(!(e instanceof o.Z||e instanceof a.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw y.error(e),new r.Z(e)}const i=(0,l.x3)(e),n=[];for(const e of i){const i=[];n.push(i),i.push([e[0][0],e[0][1]]);for(let n=0;n<e.length-1;n++){const r=e[n][0],s=e[n][1],a=e[n+1][0],o=e[n+1][1],l=Math.sqrt((a-r)*(a-r)+(o-s)*(o-s)),c=(o-s)/l,u=(a-r)/l,h=l/t;if(h>1){for(let e=1;e<=h-1;e++){const n=e*t,a=u*n+r,o=c*n+s;i.push([a,o])}const e=(l+Math.floor(h-1)*t)/2,n=u*e+r,a=c*e+s;i.push([n,a])}i.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new a.Z({rings:n,spatialReference:e.spatialReference}):new o.Z({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,u.Sx)(t,!0)}return i&&(e=(0,l.Sy)(e,i)),e}function I(e,t,i){if(Array.isArray(e)){const n=e[0];if(n>t){const i=(0,l.XZ)(n,t);e[0]=n+i*(-2*t)}else if(n<i){const t=(0,l.XZ)(n,i);e[0]=n+t*(-2*i)}}else{const n=e.x;if(n>t){const i=(0,l.XZ)(n,t);e=e.clone().offset(i*(-2*t),0)}else if(n<i){const t=(0,l.XZ)(n,i);e=e.clone().offset(t*(-2*i),0)}}return e}function b(e,t){let i=-1;for(let n=0;n<t.cutIndexes.length;n++){const r=t.cutIndexes[n],s=t.geometries[n],a=(0,l.x3)(s);for(let e=0;e<a.length;e++){const t=a[e];t.some((i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const n=t[e][0];i=n>i?n:i}i=Number(i.toFixed(9));const n=-360*(0,l.XZ)(i,180);for(let i=0;i<t.length;i++){const t=s.getPoint(e,i);s.setPoint(e,i,t.clone().offset(n,0))}return!0}}))}if(r===i){if(g(e))for(const t of(0,l.x3)(s))e[r]=e[r].addRing(t);else if(x(e))for(const t of(0,l.x3)(s))e[r]=e[r].addPath(t)}else i=r,e[r]=s}return e}async function S(e,t,i){if(!Array.isArray(e))return S([e],t);t&&"string"!=typeof t&&y.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const r="string"==typeof t?t:t?.url??n.Z.geometryServiceUrl;let s,p,g,x,_,R,v,T,C=0;const k=[],F=[];for(const t of e)if(null!=t)if(s||(s=t.spatialReference,p=(0,c.C5)(s),g=s.isWebMercator,R=g?102100:4326,x=l.UZ[R].maxX,_=l.UZ[R].minX,v=l.UZ[R].plus180Line,T=l.UZ[R].minus180Line),p)if("mesh"===t.type)F.push(t);else if("point"===t.type)F.push(I(t.clone(),x,_));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>I(e,x,_))),F.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,p);F.push(e.rings?new a.Z(e):e)}else if(t.extent){const e=t.extent,i=(0,l.XZ)(e.xmin,_)*(2*x);let n=0===i?t.clone():(0,l.Sy)(t.clone(),i);e.offset(i,0),e.intersects(v)&&e.xmax!==x?(C=e.xmax>C?e.xmax:C,n=w(n,g),k.push(n),F.push("cut")):e.intersects(T)&&e.xmin!==_?(C=e.xmax*(2*x)>C?e.xmax*(2*x):C,n=w(n,g,360),k.push(n),F.push("cut")):F.push(n)}else F.push(t.clone());else F.push(t);else F.push(t);let M=(0,l.XZ)(C,x),P=-90;const O=M,D=new o.Z;for(;M>0;){const e=360*M-180;D.addPath([[e,P],[e,-1*P]]),P*=-1,M--}if(k.length>0&&O>0){const t=b(k,await async function(e,t,i,n){const r=(0,d.en)(e),s=t[0].spatialReference,a={...n,query:{...r.query,f:"json",sr:JSON.stringify(s),target:JSON.stringify({geometryType:(0,f.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await(0,h.default)(r.path+"/cut",a),{cutIndexes:l,geometries:c=[]}=o.data;return{cutIndexes:l,geometries:c.map((e=>{const t=(0,f.im)(e);return t.spatialReference=s,t}))}}(r,k,D,i)),n=[],s=[];for(let i=0;i<F.length;i++){const r=F[i];if("cut"!==r)s.push(r);else{const r=t.shift(),a=e[i];null!=a&&"polygon"===a.type&&a.rings&&a.rings.length>1&&r.rings.length>=a.rings.length?(n.push(r),s.push("simplify")):s.push(g?(0,u.$)(r):r)}}if(!n.length)return s;const a=await m(r,n,i),o=[];for(let e=0;e<s.length;e++){const t=s[e];"simplify"!==t?o.push(t):o.push(g?(0,u.$)(a.shift()):a.shift())}return o}const Z=[];for(let e=0;e<F.length;e++){const t=F[e];if("cut"!==t)Z.push(t);else{const e=k.shift();Z.push(!0===g?(0,u.$)(e):e)}}return Z}},73913:(e,t,i)=>{i.d(t,{Sy:()=>l,UZ:()=>a,XZ:()=>o,x3:()=>c});var n=i(58901),r=i(82971),s=i(33955);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:r.Z.WebMercator}),minus180Line:new n.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:r.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.Z({paths:[[[180,-180],[180,180]]],spatialReference:r.Z.WGS84}),minus180Line:new n.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:r.Z.WGS84})}};function o(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const i=c(e);for(const e of i)for(const i of e)i[0]+=t;return e}function c(e){return(0,s.oU)(e)?e.rings:e.paths}},74878:(e,t,i)=>{i.r(t),i.d(t,{default:()=>ht});var n=i(43697),r=i(51773),s=i(30030),a=i(20102),o=i(92604),l=i(16453),c=i(95330),u=i(17445),h=i(5600),f=i(75215),d=(i(67676),i(80442)),p=i(36030),m=i(71715),y=i(52011),g=i(87085),x=i(17287),w=i(71612),I=i(17017),b=(i(66577),i(3172)),S=i(8744),_=i(66677),R=i(21506),v=i(35956),T=i(29876),C=i(40297),k=i(88281),F=i(11145),M=i(96674),P=i(70586),O=i(609),D=i(39450),Z=i(36679),A=i(99815),B=i(73506),z=i(94139);const J=new Map,N=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,n=this._cachedBlocks;if(n.has(i)){const e=n.get(i);return e.refCount--,e.refCount<=0&&(n.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,n=this._cachedBlocks;if(n.has(i)){const e=n.get(i);return e.ts=Date.now(),e.refCount++,n.delete(i),n.set(i,e),e.block}return null}putBlock(e,t,i,n){const r=this._cachedBlocks,s=e+"/"+t;if(r.has(s)){const e=r.get(s);e.ts=Date.now(),e.refCount++}else r.set(s,{block:i,ts:Date.now(),refCount:1,controller:n});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,n=e+"/"+t;i.has(n)&&i.delete(n)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),i=Date.now();for(let n=0;n<t.length&&t[n][1].ts<=i-this._duration;n++)e.delete(t[n][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function E(e,t){return null==t?e:`${e}?sliceId=${t}`}function H(e,t,i){const n=J.get(e);if(!n)return null==t?N.decreaseRefCount(e,i):0;if(null==t||null==n[t])return N.decreaseRefCount(e,i);const r=n[t]?.cache,s=r?.get(i);if(r&&s){if(s.refCount--,0===s.refCount){r.delete(i);for(let e=0;e<n.length;e++)n[e]?.cache.delete(i);s.controller&&s.controller.abort()}return s.refCount}return 0}function L(e,t,i){const n=J.get(e);if(!n)return null==t?N.getBlock(e,i):null;if(null==t||null==n[t]){for(let e=0;e<n.length;e++){const t=n[e]?.cache.get(i);if(t)return t.refCount++,t.block}return N.getBlock(e,i)}const r=n[t]?.cache.get(i);if(r)return r.refCount++,r.block;for(let e=0;e<n.length;e++){if(e===t||!n[e])continue;const r=n[e]?.cache,s=r?.get(i);if(r&&s)return s.refCount++,r.set(i,s),s.block}return null}function G(e,t,i,n,r=null){const s=J.get(e);if(!s)return void(null==t&&N.putBlock(e,i,n,r));if(null==t||null==s[t])return void N.putBlock(e,i,n,r);const a={refCount:1,block:n,isResolved:!1,isRejected:!1,controller:r};n.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),s[t]?.cache.set(i,a)}function W(e,t,i){const n=J.get(e);n?null!=t&&null!=n[t]?n[t]?.cache.delete(i):N.deleteBlock(e,i):null==t&&N.deleteBlock(e,i)}var q=i(81578),j=i(75993),U=i(55914),V=i(80676),$=i(6570);let X=class extends((0,O.v)(M.wq)){constructor(){super(...arguments),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=(0,B.zD)();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:F.Z.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,B.ut)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),"Function"===this.datasetFormat&&this.primaryRasters?.rasters?.forEach((t=>t.rasterJobHandler=e))}set url(e){this._set("url",(0,_.Nm)(e,o.Z.getLogger(this.declaredClass)))}async open(e){throw new a.Z("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,i,n={}){const r=n.tileInfo||this.rasterInfo.storageInfo.tileInfo,s=this.getTileExtentFromTileInfo(e,t,i,r);return this.fetchPixels(s,r.size[0],r.size[1],n)}async identify(e,t={}){e=(0,f.TJ)(z.Z,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:n}=t,{rasterInfo:r}=this,{hasMultidimensionalTranspose:s,multidimensionalInfo:a}=r;let{transposedVariableName:o}=t;const l=null!=a&&s&&(null!=n||(0,A.WU)(i));l&&!o&&(o=null!=i&&i.length>0?i[0].variableName??void 0:a.variables[0].name,t={...t,transposedVariableName:o}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=r,{datumTransformation:h}=t;let d=(0,B.nF)(e,c,h);if(!u.intersects(d))return{location:d,value:null};if(null!=r.transform){const e=r.transform.inverseTransform(d);if(!r.nativeExtent.intersects(e))return{location:e,value:null};d=e}let p=0;const m=null!=o&&null!=a&&r.hasMultidimensionalTranspose;if("Function"===this.datasetFormat){const e=this.primaryRasters.rasters[0];if(m)return e.identify(d,t);const{pixelSize:i}=r,n=3,s=i.x*n/2,a=i.y*n/2,o=new $.Z({xmin:d.x-s,xmax:d.x+s,ymin:d.y-a,ymax:d.y+a,spatialReference:c}),l={interpolation:"nearest"},{pixelBlock:u}=await e.fetchPixels(o,n,n,l),{pixelBlock:h}=await this.fetchPixels(o,n,n,l);if(null==u)return{location:d,value:null};const f=Math.floor(n*n*.5),p=!u.mask||u.mask[f]?u.pixels.map((e=>e[f])):null;let y;return null!=h&&(y=!h.mask||h.mask[f]?h.pixels.map((e=>e[f])):void 0),{location:d,value:p,processedValue:y,pyramidLevel:0}}if(!m)if(t.srcResolution)p=(0,B.kr)(t.srcResolution,r,this.ioConfig.sampling).pyramidLevel;else if(p=await this.computeBestPyramidLevelForLocation(e,t),null==p)return{location:d,value:null};const y=this.identifyPixelLocation(d,p,null,m);if(null===y)return{location:d,value:null};const{row:g,col:x,rowOffset:w,colOffset:I,blockWidth:b}=y,S=o??t.sliceId,_=E(this.url,S),R=`${p}/${g}/${x}`;let v=L(_,null,R);null==v&&(v=this.fetchRawTile(p,g,x,t),G(_,null,R,v));const T=await v;if(null==T||!T.pixels?.length)return{location:d,value:null};const C=w*b+I;return this._processIdentifyResult(T,{srcLocation:d,position:C,pyramidLevel:p,useTransposedTile:!!m,requestSomeSlices:l,identifyOptions:t})}async fetchPixels(e,t,i,n={}){e=(0,B.kZ)(e),n=this._getRequestOptionsWithSliceId(n);const{_hasNoneOrGCSShiftTransform:r}=this;if(n.requestRawData&&r)return this._fetchPixels(e,t,i,n);const s=(0,B.ut)(e.spatialReference),a=(0,B.Hq)(e);if(null==s||0===a||1===a&&this._isGlobalWrappableSource&&r)return this._fetchPixels(e,t,i,n);if(a>=3)return{extent:e,pixelBlock:null};const o=[],{xmin:l,xmax:c}=e,u=Math.round(s/(c-l)*t),h=u-Math.round((s/2-l)/(c-l)*t);let f=0;const d=[];for(let r=0;r<=a;r++){const p=new $.Z({xmin:0===r?l:-s/2,xmax:r===a?c-s*r:s/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),m=0===r?u-h:r===a?t-f:u;f+=m,d.push(m);const y=n.disableWrapAround&&r>0?null:this._fetchPixels(p,m,i,n);o.push(y)}const p=(await Promise.all(o)).map((e=>e?.pixelBlock));let m=null;const y={width:t,height:i};return m=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:d},n)).pixelBlock:(0,U.us)(p,y,{blockWidths:d}),{extent:e,srcExtent:(0,B.tB)(e,this.rasterInfo.spatialReference,n.datumTransformation),pixelBlock:m}}async fetchRawPixels(e,t,i,n={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const r=await this._fetchRawTiles(e,t,i,n),{nativeExtent:s,nativePixelSize:a,storageInfo:o}=this.rasterInfo,l=2**e,c=a.x*l,u=a.y*l,h=new $.Z({xmin:s.xmin+c*t.x,xmax:s.xmin+c*(t.x+i.width-1),ymin:s.ymax-u*(t.y+i.height-1),ymax:s.ymax-u*t.y,spatialReference:s.spatialReference});if(!r)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:f,mosaicSize:d}=r;if(1===f.length&&null!=f[0]&&f[0].width===i.width&&f[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:r.pixelBlocks[0]};const p=e>0?o.pyramidBlockWidth:o.blockWidth,m=e>0?o.pyramidBlockHeight:o.blockHeight,y={x:t.x%p,y:t.y%m};let g;return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:f,srcMosaicSize:d,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:n.interpolation,alignmentInfo:null,blockWidths:null},n)).pixelBlock:(0,U.us)(f,d,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:g}}fetchRawTile(e,t,i,n){throw new a.Z("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,B.tB)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,j.J)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:n}=this.ioConfig,{range:r,query:s,headers:a}=t;i=i??t.retryCount??this.ioConfig.retryCount;const o=r?{Range:`bytes=${r.from}-${r.to}`}:null;try{return await(0,b.default)(e,{...t,query:{...s,...n},headers:{...a,...o}})}catch(n){if(i>0)return i--,this.request(e,t,i);throw n}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,A.gk)(e,t)}getTileExtentFromTileInfo(e,t,i,n){const r=(0,P.s3)(n.lodAt(e));return this.getTileExtent({x:r.resolution,y:r.resolution},t,i,n.origin,n.spatialReference,n.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:n}=this.rasterInfo;if(!e.tileInfo){const r=[],s=e.maximumPyramidLevel||0;let a=Math.max(n.x,n.y),o=1/.0254*96*a;for(let e=0;e<=s;e++)r.push(new D.Z({level:s-e,resolution:a,scale:o})),a*=2,o*=2;const l=new z.Z({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new F.Z({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,n){const{width:r,height:s,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new z.Z({x:a.xmin,y:a.ymax,spatialReference:l});null==n&&(n=Math.max(0,Math.round(Math.log(Math.max(r,s))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],n);e.storageInfo=new Z.Z({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:n,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,n,r,s=0,a=2){if(1===r.length&&s>0){r=[...r];let{x:e,y:t}=r[0];for(let i=0;i<s;i++)e*=a,t*=a,r.push({x:e,y:t})}const o=[],{x:l,y:c}=n;for(let n=0;n<r.length;n++){const{x:s,y:a}=r[n];o.push({minCol:Math.floor((e.xmin-l+.1*s)/t/s),maxCol:Math.floor((e.xmax-l-.1*s)/t/s),minRow:Math.floor((c-e.ymax+.1*a)/i/a),maxRow:Math.floor((c-e.ymin-.1*a)/i/a)})}return o}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:n}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const r=n**e;return{x:t.x*r,y:t.y*r}}identifyPixelLocation(e,t,i,n){const{spatialReference:r,nativeExtent:s,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:o,origin:l,transposeInfo:c}=a,u=n&&null!=c?c.tileSize[0]:a.blockWidth,h=n&&null!=c?c.tileSize[1]:a.blockHeight,f=(0,B.nF)(e,r,i);if(!s.intersects(f))return null;if(t<0||t>o)return null;const d=this.getPyramidPixelSize(t),{x:p,y:m}=d,y=(l.y-f.y)/m/h,g=(f.x-l.x)/p/u,x=Math.min(h-1,Math.floor((y-Math.floor(y))*h)),w=Math.min(u-1,Math.floor((g-Math.floor(g))*u));return{pyramidLevel:t,row:Math.floor(y),col:Math.floor(g),rowOffset:x,colOffset:w,blockWidth:u,srcLocation:f}}getTileExtent(e,t,i,n,r,s){const[a,o]=s,l=n.x+i*a*e.x,c=l+a*e.x,u=n.y-t*o*e.y,h=u-o*e.y;return new $.Z({xmin:l,xmax:c,ymin:h,ymax:u,spatialReference:r})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const n=this.rasterInfo.storageInfo.blockBoundary[e];return!n||n.maxRow<t||n.maxCol<i||n.minRow>t||n.minCol>i}async _fetchPixels(e,t,i,n={}){let r=(0,B.Hq)(e);if(r>=2)return{extent:e,pixelBlock:null};const s=this._getSourceDataInfo(e,t,i,n),{pyramidLevel:a,srcResolution:o,srcExtent:l,srcWidth:c,srcHeight:u,ul:h}=s;if(0===c||0===u)return{extent:e,srcExtent:l,pixelBlock:null};const{rasterInfo:f}=this,d=f.transform,p="gcs-shift"===d?.type,m=null!=(0,B.ut)(e.spatialReference);!p&&m||(r=(0,B.Hq)(s.srcExtent,p));const y=await this._fetchRawTiles(a,h,{width:c,height:u,wrapCount:r},n);if(!y)return{extent:e,srcExtent:l,pixelBlock:null};const g=f.storageInfo,x=a>0?g.pyramidBlockWidth:g.blockWidth,w=a>0?g.pyramidBlockHeight:g.blockHeight;let{x:I,y:b}=f.pixelSize;if(a>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=g;if(null!=e&&e[a-1])({x:I,y:b}=e[a-1]);else{const e=t**a;I*=e,b*=e}}const S=new z.Z({x:I,y:b,spatialReference:f.spatialReference}),_=x===c&&w===u&&h.x%x==0&&h.y%w==0,R=new z.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),v=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:T}=n;if(!v&&_&&1===y.pixelBlocks.length&&x===t&&w===i&&o.x===R.x&&o.y===R.y)return{extent:e,srcExtent:l,srcTilePixelSize:S,pixelBlock:y.pixelBlocks[0]};const C=m&&null!=(0,B.ut)(l.spatialReference)&&this._hasNoneOrGCSShiftTransform,k=n.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");k&&!this.rasterJobHandler&&await(0,B.zD)();const F=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:R.toJSON(),datumTransformation:T,rasterTransform:d,hasWrapAround:r>0||C,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:k},n):(0,B.Qp)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:R,datumTransformation:T,rasterTransform:d,hasWrapAround:r>0||C,isAdaptive:!1,includeGCSGrid:k});let M;const P=!n.requestRawData,O={rows:F.spacing[0],cols:F.spacing[1]},D=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(a,y.extent.xmin):void 0,{pixelBlocks:Z,mosaicSize:A,isPartiallyFilled:J}=y;let N=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:Z,srcMosaicSize:A,destDimension:P?{width:t,height:i}:null,coefs:P?F.coefficients:null,sampleSpacing:P?O:null,projectDirections:k,gcsGrid:k?F.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:n.interpolation,alignmentInfo:D,blockWidths:null},n);({pixelBlock:M,localNorthDirections:N}=e)}else{const e=(0,U.us)(Z,A,{alignmentInfo:D});M=P?(0,U.Uk)(e,{width:t,height:i},F.coefficients,O,n.interpolation):e,k&&F.gcsGrid&&(N=(0,U.Qh)({width:t,height:i},F.gcsGrid),M=(0,V.xQ)(M,this.rasterInfo.dataType,N))}return n.requestRawData||k?{extent:e,srcExtent:l,srcTilePixelSize:S,pixelBlock:M,transformGrid:F,localNorthDirections:N,isPartiallyFilled:J}:{extent:e,srcExtent:l,srcTilePixelSize:S,pixelBlock:M}}async _fetchRawTiles(e,t,i,n){const{origin:r,blockBoundary:s}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:o}=this.getBlockWidthHeight(e);let{x:l,y:c}=t,{width:u,height:h,wrapCount:f}=i;const d=this._getRasterTileAlignmentInfo(e,0);n.buffer&&(l-=n.buffer.cols,c-=n.buffer.rows,u+=2*n.buffer.cols,h+=2*n.buffer.rows);let p=0,m=0,y=0;f&&null!=d&&(({worldColumnCountFromOrigin:m,originColumnOffset:y,rightPadding:p}=d),m*d.blockWidth-p>=l+u&&(p=0));const g=Math.floor(l/a),x=Math.floor(c/o),w=Math.floor((l+u+p-1)/a),I=Math.floor((c+h+p-1)/o),b=s[e];if(!b)return null;const{minRow:S,minCol:_,maxCol:R,maxRow:v}=b;if(0===f&&(I<S||w<_||x>v||g>R))return null;const T=new Array;let C=!1;const k=null==this.ioConfig.allowPartialFill?n.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=x;t<=I;t++)for(let i=g;i<=w;i++){let r=i;if(!n.disableWrapAround&&f&&null!=d&&m<=i&&(r=i-m-y),t>=S&&r>=_&&v>=t&&R>=r){const i=this._fetchRawTile(e,t,r,n);k?T.push(new Promise((e=>{i.then((t=>e(t))).catch((()=>{C=!0,e(null)}))}))):T.push(i)}else T.push(Promise.resolve(null))}if(0===T.length)return null;const F=await Promise.all(T),M={height:(I-x+1)*o,width:(w-g+1)*a},{spatialReference:P}=this.rasterInfo,O=this.getPyramidPixelSize(e),{x:D,y:Z}=O;return{extent:new $.Z({xmin:r.x+g*a*D,xmax:r.x+(w+1)*a*D,ymin:r.y-(I+1)*o*Z,ymax:r.y-x*o*Z,spatialReference:P}),pixelBlocks:F,mosaicSize:M,isPartiallyFilled:C}}_fetchRawTile(e,t,i,n){const r=this.rasterInfo.storageInfo.blockBoundary[e];if(!r)return Promise.resolve(null);const{minRow:s,minCol:a,maxCol:o,maxRow:l}=r;if(t<s||i<a||t>l||i>o)return Promise.resolve(null);const u=E(this.url,n.sliceId),h=`${e}/${t}/${i}`;let f=L(u,n.registryId,h);if(null==f){const r=new AbortController;f=this.fetchRawTile(e,t,i,{...n,signal:r.signal}),G(u,n.registryId,h,f,r),f.catch((()=>W(u,n.registryId,h)))}return n.signal&&(0,c.fu)(n,(()=>{H(u,n.registryId,h)})),f}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const n=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[r,s]=e,a=[],o=[];for(let e=0;e<n;e++){const[t,i]=(0,V.Tg)([r[e],s[e]]);a.push(t),o.push(i)}return[a,o]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=(0,B.P_)(this.rasterInfo)),null==this._rasterTileAlighmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,n={}){const r={datumTransformation:n.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};n.srcResolution&&(r.srcResolution=n.srcResolution,this._updateSourceDataInfo(e,r));const s=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=r,c=a/t,u=o/i,h=l<s&&c*u>=16,f=l===s&&this._requireTooManySrcTiles(a,o,t,i);if(h||f||0===a||0===o){const a=new z.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let o=(0,B.VO)(a,this.rasterInfo.spatialReference,e,r.datumTransformation);const f=!o||n.srcResolution&&o.x+o.y<n.srcResolution.x+n.srcResolution.y;if(h&&n.srcResolution&&f){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(s-l+3>=e){const t=2**e;o={x:n.srcResolution.x*t,y:n.srcResolution.y*t}}}o&&(r.srcResolution=o,this._updateSourceDataInfo(e,r))}return this._requireTooManySrcTiles(r.srcWidth,r.srcHeight,t,i)&&(r.srcWidth=0,r.srcHeight=0),r}_requireTooManySrcTiles(e,t,i,n){const{tileInfo:r}=this.rasterInfo.storageInfo;return Math.ceil(e/r.size[0])*Math.ceil(t/r.size[1])>=256||e/i>8||t/n>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,n=i.spatialReference,{srcResolution:r,datumTransformation:s}=t,{pyramidLevel:a,pyramidResolution:o,excessiveReading:l}=(0,B.kr)(r,i,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,B.tB)(e,n,s);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{x:h,y:f}=i.storageInfo.origin,d=Math.floor((c.xmin-h)/o.x+.1),p=Math.floor((f-c.ymax)/o.y+.1),m=Math.floor((c.xmax-h)/o.x-.1),y=Math.floor((f-c.ymin)/o.y-.1),g=c.width<.1*o.x?0:m-d+1,x=c.height<.1*o.y?0:y-p+1;t.pyramidLevel=a,t.pyramidResolution=o,t.srcWidth=g,t.srcHeight=x,t.ul={x:d,y:p}}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:n,pyramidLevel:r,useTransposedTile:s}=t,a=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[n])return{location:i,value:null};const{multidimensionalInfo:o}=this.rasterInfo;if(null==o||!s){const t=e.pixels.map((e=>e[n])),s={location:i,value:t,pyramidLevel:r},a=this._computeMagDirValues(t.map((e=>[e])));return a?.length&&(s.magdirValue=a.map((e=>e[0]))),s}let l=e.pixels.map((e=>e.slice(n*a,n*a+a))),c=this._computeMagDirValues(l);const{requestSomeSlices:u,identifyOptions:h}=t;let f=(0,A.MO)(o,h.transposedVariableName);if(u){const e=(0,A.Ur)(f,h.multidimensionalDefinition,h.timeExtent);l=l.map((t=>e.map((e=>t[e])))),c=c?.map((t=>e.map((e=>t[e])))),f=e.map((e=>f[e]))}const d=e.noDataValues||this.rasterInfo.noDataValue,p={pixels:l,pixelType:e.pixelType};let m;return null!=d&&((0,q.A)(p,d),m=p.mask),{location:i,value:null,dataSeries:f.map(((e,t)=>{const i={value:0===m?.[t]?null:l.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new v.Z({...e,isSlice:!0})))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i})),pyramidLevel:r}}};(0,n._)([(0,h.Cb)()],X.prototype,"_rasterTileAlighmentInfo",void 0),(0,n._)([(0,h.Cb)({readOnly:!0})],X.prototype,"_isGlobalWrappableSource",null),(0,n._)([(0,h.Cb)({readOnly:!0})],X.prototype,"_hasNoneOrGCSShiftTransform",null),(0,n._)([(0,h.Cb)()],X.prototype,"rasterJobHandler",null),(0,n._)([(0,h.Cb)(R.HQ)],X.prototype,"url",null),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],X.prototype,"datasetName",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],X.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],X.prototype,"hasUniqueSourceStorageInfo",void 0),(0,n._)([(0,h.Cb)()],X.prototype,"rasterInfo",void 0),(0,n._)([(0,h.Cb)()],X.prototype,"ioConfig",void 0),(0,n._)([(0,h.Cb)()],X.prototype,"sourceJSON",void 0),X=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.BaseRaster")],X);const Y=X;let K=class extends Y{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null}async open(e){await this.init();const{rasterFunction:t}=this;this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((e=>e.rasterJobHandler=this.rasterJobHandler)));const{rasters:i,rasterIds:n}=this.primaryRasters,r=i.map((t=>t.rasterInfo?void 0:t.open(e)));await Promise.all(r);const s=i.map((({rasterInfo:e})=>e)),o=t.bind({rasterInfos:s,rasterIds:n});if(!o.success||0===s.length)throw new a.Z("raster-function:open",`cannot bind the function: ${o.error??""}`);await this.syncJobHandler();const l=s[0];this.hasUniqueSourceStorageInfo=1===s.length||s.slice(1).every((e=>this._hasSameStorageInfo(e,l))),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo)}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async fetchPixels(e,t,i,n={}){const{rasters:r,rasterIds:s}=this.primaryRasters;let a=!1;const{interpolation:o}=n,l=this.rasterFunction.flatWebGLFunctionChain?.hasSurfaceFunction;!n.requestRawData&&"bilinear"!==o&&l&&(a=1===r.length&&!n.skipRasterFunction,n={...n,interpolation:"bilinear",requestRawData:a});const c=r.map((r=>r.fetchPixels(e,t,i,n))),u=await Promise.all(c),h=u.map((e=>e.pixelBlock)),f=a||n.requestRawData?u.map((e=>e.srcTilePixelSize)):null;if(n.skipRasterFunction||h.every((e=>null==e)))return u[0];const d=u.find((e=>null!=e.pixelBlock))?.extent??e,p=this.rasterJobHandler?await this.rasterJobHandler.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:s}):this.rasterFunction.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:s}),{transformGrid:m}=u[0];if(!a||null==p||null==m)return{...u[0],pixelBlock:p};const y={rows:m.spacing[0],cols:m.spacing[1]};let g;return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[p],srcMosaicSize:{width:p.width,height:p.height},destDimension:{width:t,height:i},coefs:m.coefficients,sampleSpacing:y,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:o,alignmentInfo:void 0,blockWidths:null},n)).pixelBlock:(0,U.Uk)(p,{width:t,height:i},m.coefficients,y,o),{extent:e,srcExtent:u[0].srcExtent,pixelBlock:g}}_hasSameStorageInfo(e,t){const{storageInfo:i,pixelSize:n,spatialReference:r,extent:s}=e,{storageInfo:a,pixelSize:o,spatialReference:l,extent:c}=t;return n.x===o.x&&n.y===o.y&&r.equals(l)&&s.equals(c)&&i.blockHeight===a.blockHeight&&i.blockWidth===a.blockWidth&&i.maximumPyramidLevel===a.maximumPyramidLevel}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],K.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],K.prototype,"tileType",void 0),(0,n._)([(0,h.Cb)()],K.prototype,"rasterFunction",void 0),(0,n._)([(0,h.Cb)()],K.prototype,"primaryRasters",void 0),K=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.FunctionRaster")],K);const Q=K;var ee=i(67900),te=i(61433),ie=i(5847);var ne=i(90036),re=i(15612),se=i(67058),ae=i(72758),oe=i(79681),le=i(23808),ce=i(82971);const ue=o.Z.getLogger("esri.layers.mixins.ImageryTileMixin"),he=e=>{let t=class extends e{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalSubset=null,this.raster=null,this.rasterFunction=null,this.rasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster="Function"===e[0]?.raster?.datasetFormat}get fullExtent(){return this.rasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}get tileInfo(){return this.rasterInfo?.storageInfo.tileInfo}set url(e){this._set("url",(0,_.Nm)(e,ue))}set renderer(e){this._set("renderer",e),this.updateRenderer()}async convertVectorFieldData(e,t){if(null==e||!this.rasterInfo)return null;const i=this._rasterJobHandler.instance,n=this.rasterInfo.dataType;return i?i.convertVectorFieldData({pixelBlock:e,dataType:n},t):(0,V.KC)(e,n)}async computeStatisticsHistograms(e,t){e=(0,f.TJ)(oe.Z,e).clone();const{rasterInfo:i}=this,{geometry:n}=e;if(null==n)throw new a.Z("imagery-tile-mixin:compute-statistics-histograms","gemetry must be specified");let r=n;const{spatialReference:s}=i;n.spatialReference.equals(s)||(await(0,B.zD)(),r="extent"===n.type?(0,B.tB)(n,s):(0,B.Wt)(n,s));const o=e.pixelSize??new z.Z({...i.pixelSize,spatialReference:s}),{extent:l,width:c,height:u}=function(e,t,i,n=!0){const{spatialReference:r}=e,{x:s,y:a}=function(e,t){if(e.spatialReference.equals(t))return e;const i=(0,ee.c9)(e.spatialReference),n=(0,ee.c9)(t);if(i===n)return e;const r=i/n;return{x:e.x*r,y:e.y*r}}(i,r);let o,l,c;const u="extent"===t.type?t:t.extent;let{xmin:h,xmax:f,ymax:d,ymin:p}=u;const{xmin:m,ymax:y}=e.extent;return n?(h=m+(h>m?s*Math.round((h-m)/s):0),d=y-(d<y?a*Math.round((y-d)/a):0),f=m+(f>m?s*Math.round((f-m)/s):0),p=y-(p<y?a*Math.round((y-p)/a):0),o=new $.Z({xmin:h,ymax:d,xmax:f,ymin:p,spatialReference:r}),l=Math.round(o.width/s),c=Math.round(o.height/a)):(l=Math.floor((f-h)/s+.8),c=Math.floor((d-p)/a+.8),h=m+(h>m?s*Math.floor((h-m)/s+.1):0),d=y-(d<y?a*Math.floor((y-d)/a+.1):0),f=h+l*s,p=d-c*a,o=new $.Z({xmin:h,ymax:d,xmax:f,ymin:p,spatialReference:r})),{extent:o,width:l,height:c}}(i,r,o),h=await this.fetchPixels(l,c,u,{...t,interpolation:"nearest"});if(null==h.pixelBlock)throw new a.Z("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const d=function(e,t,i){if("extent"===i.type)return function(e,t,i){const{width:n,height:r}=e,s=new Uint8Array(n*r),a=t.width/n,o=t.height/r;if(i.width/a<.5||i.height/o<.5)return new ie.Z({pixelType:e.pixelType,width:n,height:r,mask:s,pixels:[...e.pixels]});const{xmin:l,xmax:c,ymin:u,ymax:h}=t,{xmin:f,xmax:d,ymin:p,ymax:m}=i,y=Math.max(l,f),g=Math.min(c,d),x=Math.max(u,p),w=Math.min(h,m),I=.5*a,b=.5*o;if(g-y<I||w-x<b||g<l+I||y>c-I||x>h-b||w<u+b)return new ie.Z({pixelType:e.pixelType,width:n,height:r,mask:s,pixels:[...e.pixels]});const S=Math.max(0,(y-l)/a),_=Math.min(n,Math.max(0,(g-l)/a)),R=Math.max(0,(h-w)/o),v=Math.min(r,Math.max(0,(h-x)/o)),T=Math.round(S),C=Math.round(_)-1,k=Math.round(R),F=Math.round(v)-1;if(T===C&&S%1>.5&&_%1<.5||k===F&&R%1>.5&&v%1<.5)return new ie.Z({pixelType:e.pixelType,width:n,height:r,mask:s,pixels:[...e.pixels]});if(0===T&&0===k&&C===n&&F===r)return e;const M=e.mask;for(let e=k;e<=F;e++)for(let t=T;t<=C;t++){const i=e*n+t;s[i]=M?M[i]:255}return new ie.Z({pixelType:e.pixelType,width:n,height:r,mask:s,pixels:[...e.pixels]})}(e,t,i);const{width:n,height:r}=e,s=new Uint8Array(n*r);return(0,te.intersects)(t,i)?(0,te.contains)(i,t)?e:function(e,t,i){if(!e)return e;const{width:n,height:r}=e,s=t.width/n,a=t.height/r,{xmin:o,ymax:l}=t;let c;if("extent"===i.type){const e=(i.xmin-o)/s,t=(i.xmax-o)/s,n=(l-i.ymax)/a,r=(l-i.ymin)/a;c=[[[e,n],[e,r],[t,r],[t,n],[e,n]]]}else c=i.rings.map((e=>e.map((([e,t])=>[(e-o)/s,(l-t)/a]))));const u=document.createElement("canvas");u.width=n,u.height=r;const h=u.getContext("2d");h.fillStyle="#f00",c.forEach((e=>{h.beginPath(),h.moveTo(e[0][0],e[0][1]);for(let t=0;t<e.length;t++)h.lineTo(e[t][0],e[t][1]);h.closePath(),h.fill()}));const f=h.getImageData(0,0,n,r).data,d=e.mask,p=n*r,m=new Uint8Array(p);for(let e=0;e<p;e++)d&&!d[e]||(m[e]=f[4*e+3]>127?255:0);return new ie.Z({pixelType:e.pixelType,width:n,height:r,mask:m,maskIsAlpha:!1,pixels:[...e.pixels]})}(e,t,i):new ie.Z({pixelType:e.pixelType,width:n,height:r,mask:s,maskIsAlpha:!1,pixels:[...e.pixels]})}(h.pixelBlock,l,r),p=this._rasterJobHandler.instance;return p?p.computeStatisticsHistograms({pixelBlock:d},t):(0,re.js)(d)}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,le.GE)(e.meshType,e.simulationSettings,e.flowData,null!=t.signal?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo??{};if(null==t)return e;let i=e.multidimensionalDefinition||this.multidimensionalDefinition;null!=i&&i.length||(i=(0,A.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const n=e.timeExtent||this.timeExtent;if(null!=i&&null!=n&&(null!=n.start||null!=n.end)){i=i.map((e=>e.clone()));const r=t.variables.find((({name:e})=>e===i[0].variableName))?.dimensions?.find((({name:e})=>"StdTime"===e)),s=i.find((({dimensionName:e})=>"StdTime"===e));if(!r||!s)return{...e,multidimensionalDefinition:null};const{start:a,end:o}=n,l=null==a?null:a.getTime(),c=null==o?null:o.getTime(),u=l??c,h=c??l;if(null!=r.values){const e=r.values.filter((e=>{if(Array.isArray(e)){if(u===h)return e[0]<=u&&e[1]>=u;const t=e[0]<=u&&e[1]>u||e[0]<h&&e[1]>=h,i=e[0]>=u&&e[1]<=h||e[0]<u&&e[1]>h;return t||i}return u===h?e===u:e>=u&&e<=h}));if(e.length){const t=e.sort(((e,t)=>u===h?(e[0]??e)-(t[0]??t):Math.abs((e[1]??e)-h)-Math.abs((t[1]??t)-h)))[0];s.values=[t]}else i=null}else if(r.hasRegularIntervals&&r.extent){const[e,t]=r.extent;u>t||h<e?i=null:s.values=u===h?[u]:[Math.max(e,u),Math.min(t,h)]}}return null!=i&&(0,A.nb)(i,this.multidimensionalSubset)?{...e,multidimensionalDefinition:null}:{...e,multidimensionalDefinition:i}}async updateRasterFunction(){if("imagery-tile"!==this.type||!this.rasterFunction&&!this._cachedRasterFunctionJson||JSON.stringify(this.rasterFunction)===JSON.stringify(this._cachedRasterFunctionJson))return;if(this._isConstructedFromFunctionRaster&&"Function"===this.raster.datasetFormat){const e=this.raster.rasterFunction.toJSON();return!this.rasterFunction&&e&&this._set("rasterFunction",C.Z.fromJSON(e)),void(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON())}let e,t=this.raster,i=!1;"Function"===t.datasetFormat?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:n}=this;if(n){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const r=(0,ne.Ue)(n.rasterFunctionDefinition??n.toJSON(),i),s=new Q({rasterFunction:r});s.rasterJobHandler=this._rasterJobHandler.instance,await s.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=s}else this.raster=t,this._cachedRasterFunctionJson=null;if(this._cachedRendererJson=null,!i&&!n)return;const{bandIds:r}=this,{bandCount:s}=this.raster.rasterInfo,a=r?.length?r.some((e=>e>=s)):s>=3;r&&(a||"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:e,symbolizer:t}=this;if(!e||!t)return;const{rasterInfo:i}=this.raster,n=(0,A.WY)(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),r=n?.name,s=(0,se.ol)({...this.renderer.toJSON(),variableName:r});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(s))return;const a=this._rasterJobHandler.instance;a&&(t.rasterInfo=(0,se.FI)(i,r),t.rendererJSON=s,t.bind(),await a.updateSymbolizer(t),this._cachedRendererJson=s)}async applyRenderer(e,t){const i=e&&e.pixelBlock;if(!(null!=i&&i.pixels&&i.pixels.length>0))return null;let n;await this.updateRenderer();const r=this._rasterJobHandler.instance,s=this.bandIds??[];return n=r?await r.symbolize({...e,simpleStretchParams:t,bandIds:s}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:s}),n}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const n=(0,S.C5)(e);return F.Z.create({size:256,spatialReference:e,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,n,r={}){if(i(this),r.requestAsImageElement){const i=this.getTileUrl(e,t,n);return(0,b.default)(i,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:r.signal}).then((e=>e.data))}const{rasterInfo:s}=this;if(null!=s.multidimensionalInfo&&null==(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition){const i=r.tileInfo||s.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,n,i),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer.type&&(r={...r,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,n,r)}async fetchPixels(e,t,i,n={}){return null!=this.rasterInfo.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,n))}async identify(e,t={}){const{raster:i,rasterInfo:n}=this;if(null!=n.multidimensionalInfo&&!(n.hasMultidimensionalTranspose&&((0,A.WU)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||null!=(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition))return{location:e,value:null};const r=this.multidimensionalSubset?.areaOfInterest;if(r&&!r.contains(e))throw new a.Z("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return i.identify(e,t)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.rasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.rasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(e){const t=e??this.rasterInfo?.multidimensionalInfo;return(0,A.jj)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,A.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new k.Z;return this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{i(this),this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,this.renderer&&this.updateRenderer(),"Function"===this.raster.datasetFormat&&this.raster.syncJobHandler()})).catch((()=>{})),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(null==this.interpolation){i(this);const{raster:e}=this,t=(0,se.In)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){i(this);const{rasterInfo:t}=this.raster;!this.bandIds&&t.bandCount>1&&(this.bandIds=(0,se.YD)(t));const n=(0,A.WY)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),r=n?.name;if(!this.renderer||"override"===e){const e=(0,se.Ob)(t,{bandIds:this.bandIds,variableName:r}),i=t.statistics,n=i&&i.length>0?i[0]:null,s=n?.max??0,a=n?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===e.type&&(s>1e24||a<-1e24)&&(e.dynamicRangeAdjustment=!0,e.statistics=null,"none"===e.stretchType&&(e.stretchType="min-max")),this.renderer=e}const s=(0,se.ol)({...this.renderer.toJSON(),variableName:r}),a=(0,se.FI)(t,r);this.symbolizer?(this.symbolizer.rendererJSON=s,this.symbolizer.rasterInfo=a):this.symbolizer=new ae.Z({rendererJSON:s,rasterInfo:a});const o=this.symbolizer.bind();if(o.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e)if("raster-colormap"!==t.type)this._configDefaultRenderer("override");else{const e=(0,se.Ob)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.statistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else ue.warn("imagery-tile-mixin",o.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}};function i(e){if(!e.raster||!e.rasterInfo)throw new a.Z("imagery-tile","no raster")}return(0,n._)([(0,h.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"_cachedRasterFunctionJson",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"_compatibleFullExtent",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"_isConstructedFromFunctionRaster",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"bandIds",void 0),(0,n._)([(0,h.Cb)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,n._)([(0,h.Cb)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,n._)([(0,h.Cb)()],t.prototype,"interpolation",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"ioConfig",void 0),(0,n._)([(0,h.Cb)({type:[v.Z],json:{write:!0}})],t.prototype,"multidimensionalDefinition",null),(0,n._)([(0,h.Cb)({type:T.Z,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"raster",void 0),(0,n._)([(0,h.Cb)({type:C.Z})],t.prototype,"rasterFunction",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"rasterInfo",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"sourceJSON",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,type:ce.Z,json:{read:!1}})],t.prototype,"spatialReference",void 0),(0,n._)([(0,h.Cb)({json:{read:!1}})],t.prototype,"tileInfo",null),(0,n._)([(0,h.Cb)(R.HQ)],t.prototype,"url",null),(0,n._)([(0,h.Cb)({types:s.dr})],t.prototype,"renderer",null),(0,n._)([(0,h.Cb)()],t.prototype,"symbolizer",void 0),t=(0,n._)([(0,y.j)("esri.layers.ImageryTileMixin")],t),t};var fe=i(38009),de=i(16859),pe=i(34760),me=i(72965),ye=i(28294),ge=i(1231),xe=i(69608),we=i(48526),Ie=i(20095);function be(e){const t=e.fields,i=e.records,n=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",r=[{name:n,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),s=r.map((e=>e.name)),a=[];let o=0,l=0;return i.forEach((e=>{const t={};for(t[n]=o++,l=1;l<s.length;l++)t[s[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:r,features:a}}class Se{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const n=t.getUint32(4,!0),r=t.getUint16(8,!0),s=t.getUint16(10,!0),a={version:i,recordCount:n,headerByteCount:r,recordByteCount:s};let o=32;const l=[],c=[];let u;if(3===i){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,Ie.f)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<n&&e.byteLength-o>s;){const i=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)i.push((0,Ie.f)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const n=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();i.push(new Date(parseInt(n.substring(0,4),10),parseInt(n.substring(4,6),10)-1,parseInt(n.substring(6,8),10)))}o+=t.length})),c.push(i)):o+=s}}return{header:a,fields:l,records:c,recordSet:be({fields:l,records:c})}}}var _e=i(87521),Re=i(74889);const ve=new Map;ve.set("int16","esriFieldTypeSmallInteger"),ve.set("int32","esriFieldTypeInteger"),ve.set("int64","esriFieldTypeInteger"),ve.set("float32","esriFieldTypeSingle"),ve.set("float64","esriFieldTypeDouble"),ve.set("text","esriFieldTypeString");let Te=class extends Y{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:e?.signal});if(!this._validateHeader(t))throw new a.Z("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:i,rasterInfo:n}=this._parseHeader(t);if("thematic"===n.dataType){const e=await this._fetchAuxiliaryInformation();n.attributeTable=e}this._set("storageInfo",i),this._set("rasterInfo",n),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,i,n={}){const{transposeInfo:r}=this.rasterInfo.storageInfo,{transposedVariableName:s}=n,a=!(!r||!s),o=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(o<0)return null;const l=this._buildCacheFilePath(o,t,i,n.multidimensionalDefinition,s),c=this._getIndexRecordFromBundle(t,i,a),u=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:n.signal});if(!u)return null;const h=new Uint8Array(u.data),f=this._getTileEndAndContentType(h,c);if(0===f.recordSize)return null;const d=await this.request(l,{range:{from:f.position,to:f.position+f.recordSize},responseType:"array-buffer",signal:n.signal});if(!d)return null;const[p,m]=this._getTileSize(a);return this.decodePixelBlock(d.data,{width:p,height:m,planes:null,pixelType:null,returnInterleaved:a})}_validateHeader(e){return e&&"RasterInfo"===e.type&&!["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"].some((t=>!e[t]))}_parseHeader(e){const t=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:i,histograms:n,colormap:r,blockWidth:s,blockHeight:a,firstPyramidLevel:o,maximumPyramidLevel:l}=e,c=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),u=e.extent.spatialReference,h=e.geodataXform?.spatialReference,f=new ce.Z(u?.wkid||u?.wkt?u:h);let d=new $.Z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const p=new z.Z({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:f}),m=Math.round((d.xmax-d.xmin)/p.x),y=Math.round((d.ymax-d.ymin)/p.y),g=this._parseTransform(e.geodataXform),x=g?d:null;g&&(d=g.forwardTransform(d),p.x=(d.xmax-d.xmin)/m,p.y=(d.ymax-d.ymin)/y);const w=e.properties??{},I=e.format.toLowerCase().replace("cache/",""),b=new z.Z(e.origin.x,e.origin.y,f);let S,_,R,v;if(r&&r.colors)for(S=[],_=0;_<r.colors.length;_++)R=r.colors[_],v=r.values?r.values[_]:_,S.push([v,255&R,R<<16>>>24,R<<8>>>24,R>>>24]);const T=e.LODInfos,C=[];for(_=0;_<T.levels.length;_++)C.push(new D.Z({level:T.levels[_],resolution:T.resolutions[_],scale:96/.0254*T.resolutions[_]}));const k=new F.Z({dpi:96,lods:C,format:I,origin:b,size:[s,a],spatialReference:f}),M={recordSize:8,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*8+64},P=[{maxCol:Math.ceil(m/s)-1,maxRow:Math.ceil(y/a)-1,minCol:0,minRow:0}];let O=2;if(l>0)for(_=0;_<l;_++)P.push({maxCol:Math.ceil(m/O/s)-1,maxRow:Math.ceil(y/O/a)-1,minCol:0,minRow:0}),O*=2;const A=e.mdInfo;let B=null;if(A&&w._yxs){const e=w._yxs;B={packetSize:e.PacketSize,tileSize:[e.TileXSize,e.TileYSize]}}return{storageInfo:M,rasterInfo:new we.Z({width:m,height:y,pixelType:t,bandCount:i,extent:d,nativeExtent:x,transform:g,spatialReference:f,pixelSize:p,keyProperties:w,statistics:c,histograms:n,multidimensionalInfo:A,colormap:S,storageInfo:new Z.Z({blockWidth:s,blockHeight:a,pyramidBlockWidth:s,pyramidBlockHeight:a,origin:b,tileInfo:k,transposeInfo:B,firstPyramidLevel:o,maximumPyramidLevel:l,blockBoundary:P})})}}_parseTransform(e){if(!(0,_e.j)(e))throw new a.Z("cloudraster:open","the data contains unsupported geodata transform types");const t=(0,_e.c)(e);if("identity"===t.type)return null;if("polynomial"!==t.type||!t.forwardCoefficients?.length||!t.inverseCoefficients?.length)throw new a.Z("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return t}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),i=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),n=await Promise.all([t,i]);let r;if(n[0]){let e=n[0].fields;const t=n[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":ve.get(e.type),name:e.name,alias:e.alias||e.name})));const i=t.map((e=>({attributes:e})));e&&t&&(r={fields:e,features:i})}}return!r&&n[1]&&(r=Se.parse(n[1]).recordSet),Re.Z.fromJSON(r)}_buildCacheFilePath(e,t,i,n,r){const s=this._getPackageSize(!!r),a=Math.floor(t/s)*s,o=Math.floor(i/s)*s,l="R"+this._toHexString4(a)+"C"+this._toHexString4(o);let c="L";c+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:u}=this.rasterInfo,h=n?.[0];if(null==u||!h)return`${this.url}/_alllayers/${c}/${l}.bundle`;let f="_yxs";if(!r){f=u.variables.find((e=>e.name===h.variableName)).dimensions[0].values.indexOf(h.values[0]).toString(16);const e=4-f.length;for(let t=0;t<e;t++)f="0"+f;f="S"+f}const d=this._getVariableFolderName(r||h.variableName);return`${this.url}/_alllayers/${d}/${f}/${c}/${l}.bundle`}_getPackageSize(e=!1){const{transposeInfo:t}=this.rasterInfo.storageInfo;return e&&null!=t?t.packetSize??0:this.storageInfo.packetSize}_getTileSize(e=!1){const{storageInfo:t}=this.rasterInfo,{transposeInfo:i}=t;return e&&null!=i?i.tileSize:t.tileInfo.size}_getVariableFolderName(e){return""===(e=e.trim())?"_v":e.replace(/[\{|\}\-]/g,"_").replace("\\*","_v")}_getIndexRecordFromBundle(e,t,i=!1){const n=this._getPackageSize(i),r=n*(e%n)+t%n;if(r<0)throw new Error("Invalid level / row / col");return 20+r*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const i=e.subarray(t,t+8);let n,r=0;for(n=0;n<5;n++)r|=(255&i[n])<<8*n;const s=0xffffffffff&r;for(r=0,n=5;n<8;n++)r|=(255&i[n])<<8*(n-5);return{position:s,recordSize:0xffffffffff&r}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};(0,n._)([(0,h.Cb)({readOnly:!0})],Te.prototype,"storageInfo",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Te.prototype,"datasetFormat",void 0),Te=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.CloudRaster")],Te);const Ce=Te;let ke=class extends Y{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.data=null}async open(e){await this.init();const t=this.data,{pixelBlock:i,statistics:n,histograms:r,name:s,keyProperties:a,nativeExtent:o,transform:l}=this.data,{width:c,height:u,pixelType:h}=i,f=t.extent??new $.Z({xmin:-.5,ymin:.5,xmax:c-.5,ymax:u-.5,spatialReference:new ce.Z({wkid:3857})}),d=t.isPseudoSpatialReference??!t.extent,p={x:f.width/c,y:f.height/u},m=new we.Z({width:c,height:u,pixelType:h,extent:f,nativeExtent:o,transform:l,pixelSize:p,spatialReference:f.spatialReference,bandCount:i.pixels.length,keyProperties:a||{},statistics:n,isPseudoSpatialReference:d,histograms:r});this.createRemoteDatasetStorageInfo(m,512,512),this._set("rasterInfo",m),this.updateTileInfo(),await this._buildInMemoryRaster(i,{width:512,height:512},e),this.datasetName=s,this.url="/InMemory/"+s}fetchRawTile(e,t,i,n={}){const r=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(r)}async _buildInMemoryRaster(e,t,i){const n=this.rasterInfo.storageInfo.maximumPyramidLevel,r=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:n},i):Promise.resolve((0,U.Vl)(e,t,n)),s=null!=this.rasterInfo.statistics,o=null!=this.rasterInfo.histograms,l=s?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,re.Hv)(e)),u=await(0,c.as)([r,l]);if(!u[0].value&&u[1].value)throw new a.Z("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,s||(this.rasterInfo.statistics=u[1].value?.statistics),o||(this.rasterInfo.histograms=u[1].value?.histograms)}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],ke.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],ke.prototype,"data",void 0),ke=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.InMemoryRaster")],ke);const Fe=ke;function Me(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=[];if(t){const r=Me(e,i);for(let e=0;e<r.length;e++)Me(r[e],t).forEach((e=>n.push(e)));return n}const r=e.getElementsByTagNameNS("*",i);if(!r||0===r.length)return[];for(let e=0;e<r.length;e++)n.push(r[e]||r.item[e]);return n}function Pe(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=Me(e,i);return n.length>0?t?Pe(n[0],t):n[0]:null}function Oe(e,t=null){const i=t?Pe(e,t):e;let n;return i?(n=i.textContent||i.nodeValue,n?n.trim():null):null}function De(e,t){return function(e,t){const i=Me(e,t),n=[];let r;for(let e=0;e<i.length;e++)r=i[e].textContent||i[e].nodeValue,r&&(r=r.trim(),""!==r&&n.push(r));return n}(e,t).map((e=>Number(e)))}function Ze(e,t){const i=Oe(e,t);return Number(i)}function Ae(e,t){const i=e?.nodeName?.toLowerCase(),n=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===n}var Be=i(87390);function ze(e,t){if(!e||!t)return null;const i=[];for(let n=0;n<e.length;n++)i.push(e[n]),i.push(t[n]);return i}function Je(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new ce.Z({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const i=e.indexOf("VERTCS"),n=e.indexOf("PROJCS"),r=n>-1?n:e.indexOf("GEOGCS");if(-1===r)return null;const s=e.slice(r,e.lastIndexOf("]",i)+1).trim(),a=e.slice(i,e.lastIndexOf("]")).trim();t=Ne(s);const o=new ce.Z(t?{wkid:t}:{wkt:s}),l=Ne(a);return l&&(o.vcsWkid=l),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=Ne(e),new ce.Z(0!==t?{wkid:t}:{wkt:e})):null}function Ne(e){const t=e.replace(/\]/g,"[").replace(/\"/g,"").split("[").map((e=>e.trim())).filter((e=>""!==e)),i=t[t.length-1].split(","),n=i[0]?.toLowerCase();if(("epsg"===n||"esri"===n)&&e.endsWith('"]]')){const e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Ee(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(Ae(e,"SRS")){if(!t.spatialReference){const i=Oe(e);t.spatialReference=Je(i)}}else if(Ae(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:i,transform:n}=function(e){const t=Pe(e,"GeodataXform"),i=Je(Ze(t,"SpatialReference/WKID")||Oe(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};const n=Ze(t,"PolynomialOrder")??1,r=De(t,"CoeffX/Double"),s=De(t,"CoeffY/Double"),a=De(t,"InverseCoeffX/Double"),o=De(t,"InverseCoeffY/Double"),l=ze(r,s),c=ze(a,o);return{spatialReference:i,transform:l&&c&&l.length&&c.length?new Be.Z({spatialReference:i,polynomialOrder:n,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=n,t.spatialReference||(t.spatialReference=i)}else Me(e,"MDI").forEach((e=>t.metadata[e.getAttribute("key")]=Oe(e)));else if(Ae(e,"PAMRasterBand")){const i=function(e){const t=Ze(e,"NoDataValue"),i=Pe(e,"Histograms/HistItem"),n=Ze(i,"HistMin"),r=Ze(i,"HistMax"),s=Ze(i,"BucketCount"),a=Oe(i,"HistCounts")?.split("|").map((e=>Number(e)));let o,l,c,u;Me(e,"Metadata/MDI").forEach((e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}}));const h=Ze(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:a?.length&&null!=n&&null!=r?{min:n,max:r,size:s||a.length,counts:a}:null,sourceBandIndex:h,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}}));const i=t.rasterBands;if(i.length){const e=!!i[0].statistics;t.statistics=e?i.map((e=>e.statistics)).filter(P.pC):null;const n=!!i[0].histogram;t.histograms=n?i.map((e=>e.histogram)).filter(P.pC):null}return t}let He=class extends Y{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:i,statistics:n,histograms:r,transform:s}=await this._fetchAuxiliaryData(e);const a=!i;a&&(i=new ce.Z({wkid:3857})),r?.length&&null==n&&(n=(0,re.Oh)(r));const{width:o,height:l}=t;let c=new $.Z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:i});const u=s?s.forwardTransform(c):c;let h=!0;if(s){const e=s.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(s=null,c=u)}const f=new Fe({data:{extent:u,nativeExtent:c,transform:s,pixelBlock:t,statistics:n,histograms:r,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await f.open(),f.data=null,this._set("rasterInfo",f.rasterInfo),this._inMemoryRaster=f}fetchRawTile(e,t,i,n={}){return this._inMemoryRaster.fetchRawTile(e,t,i,n)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,j.y)(t).toUpperCase();if("JPG"!==i&&"PNG"!==i&&"GIF"!==i&&"BMP"!==i)throw new a.Z("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",i);const n=i.toLowerCase(),r="gif"===n||"bmp"===n||!(0,d.Z)("ios"),s=await this.decodePixelBlock(t,{format:n,useCanvas:r,hasNoZlibMask:!0});if(null==s)throw new a.Z("image-aux-raster:open","the data cannot be decoded");return s}async _fetchAuxiliaryData(e){const t=e?.signal,i=this.ioConfig.skipExtensions??[],n=i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),r=this.datasetFormat,s="JPG"===r?"jgw":"PNG"===r?"pgw":"BMP"===r?"bpw":null,a=s&&i.includes(s)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+s,{responseType:"text",signal:t}),o=await(0,c.as)([n,a]);if(t?.aborted)throw(0,c.zE)();const l=Ee(o[0].value?.data);if(!l.transform){const e=o[1].value?o[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;l.transform=6===e?.length?new Be.Z({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return l}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],He.prototype,"datasetFormat",void 0),He=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.ImageAuxRaster")],He);const Le=He;var Ge=i(17452),We=i(45322),qe=i(56608),je=i(29680),Ue=i(26059);let Ve=class extends Y{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async open(e){await this.init();const t=e&&e.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const n=i.data;if(this.sourceJSON=n,!n)throw new a.Z("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!n.tileInfo)throw new a.Z("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=n.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(n.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===n.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=n.name?.slice(n.name.indexOf("/")+1)??"";const r=await this._fetchRasterInfo({signal:t});if(null==r)throw new a.Z("image-server-raster:open","cannot initialize image service");const s="Map"===this.tileType?(0,We.d)(n.tileInfo,n):F.Z.fromJSON(n.tileInfo);(0,P.O3)(s);const[o,l]=this._computeMinMaxLOD(r,s),{extent:c,pixelSize:u}=r,h=.5/r.width*u.x,f=Math.max(u.x,u.y),{lods:d}=s;("Map"!==this.tileType&&0!==n.maxScale||Math.abs(u.x-u.y)>h||!d.some((e=>Math.abs(e.resolution-f)<h)))&&(u.x=u.y=o.resolution,r.width=Math.ceil((c.xmax-c.xmin)/u.x-.1),r.height=Math.ceil((c.ymax-c.ymin)/u.y-.1));const p=o.level-l.level,[m,y]=s.size,g=[],x=[];d.forEach(((e,t)=>{e.level>=l.level&&e.level<=o.level&&g.push({x:e.resolution,y:e.resolution}),t<d.length-1&&x.push(Math.round(10*e.resolution/d[t+1].resolution)/10)})),g.sort(((e,t)=>e.x-t.x));const w=this.computeBlockBoundary(c,m,y,s.origin,g,p),I=g.length>1?g.slice(1):null;let b;n.transposeInfo&&(b={tileSize:[n.transposeInfo.rows,n.transposeInfo.cols],packetSize:r.keyProperties?._yxs.PacketSize??0});const S=x.length<=1||x.length>=3&&x.slice(0,x.length-1).every((e=>e===x[0]))?x[0]??2:Math.round(10/(l.resolution/o.resolution)**(-1/p))/10;if(r.storageInfo=new Z.Z({blockWidth:s.size[0],blockHeight:s.size[1],pyramidBlockWidth:s.size[0],pyramidBlockHeight:s.size[1],pyramidResolutions:I,pyramidScalingFactor:S,compression:s.format,origin:s.origin,firstPyramidLevel:1,maximumPyramidLevel:p,tileInfo:s,transposeInfo:b,blockBoundary:w}),this._fixGCSShift(r),this._set("rasterInfo",r),n.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:r.storageInfo.tileInfo,parsedUrl:(0,Ge.mN)(this.url),url:this.url,tileServers:[],type:"tile"};this._tilemapCache=new qe.y({layer:e})}}async fetchRawTile(e,t,i,n={}){const{storageInfo:r,extent:s}=this.rasterInfo,{transposeInfo:a}=r,o=null!=a&&!!n.transposedVariableName;if(this._slices&&!o&&null==n.sliceId)return null;const l=o?0:r.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${l}/${t}/${i}`,u=this._slices?o?{variable:n.transposedVariableName}:{sliceId:n.sliceId||0}:null,{data:h}=await this.request(c,{query:u,responseType:"array-buffer",signal:n.signal});if(!h)return null;const f=o?a.tileSize:r.tileInfo.size,d=await this.decodePixelBlock(h,{width:f[0],height:f[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==d)return null;const p=r.blockBoundary[e];if("jpg"!==r.compression||i>p.minCol&&i<p.maxCol&&t>p.minRow&&t<p.maxRow)return d;const{origin:m,blockWidth:y,blockHeight:g}=r,{x,y:w}=this.getPyramidPixelSize(e),I=Math.round((s.xmin-m.x)/x)%y,b=Math.round((s.xmax-m.x)/x)%y||y,S=Math.round((m.y-s.ymax)/w)%g,_=Math.round((m.y-s.ymin)/w)%g||g,R=i===p.minCol?I:0,v=t===p.minRow?S:0,T=i===p.maxCol?b:y,C=t===p.maxRow?_:g;return(0,U.pW)(d,{x:R,y:v},{width:T-R,height:C-v}),d}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some((e=>{const i=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])})))return e}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.statistics)),n=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),r=await Promise.all([i,n]);return r[0]&&r[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:r[0]||null,histograms:r[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let n=0;const{maximumPyramidLevel:r}=this.rasterInfo.storageInfo;let s=r-n+this._levelOffset;const a=i.srcLocation;for(;s>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(s,i.row,i.col,t))break}catch{}if(s--,n++,i=this.identifyPixelLocation(a,n,t.datumTransformation),null===i)return null}return-1===s||null==i?null:n}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),n=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),r=ce.Z.fromJSON(t.spatialReference||e.spatialReference),s=new z.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:r});return new we.Z({width:i,height:n,bandCount:3,extent:$.Z.fromJSON(e),spatialReference:r,pixelSize:s,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,n=(0,Ue.g)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),r=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then((e=>e.data&&e.data.slices)).catch((()=>null)):null,s=await Promise.all([n,r]);return this._slices=s[1],s[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new je.Z,e.extent=e.transform.forwardTransform(t))}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,n=.5/e.width*i.x,{lods:r}=t,s=t.lodAt(Math.max.apply(null,r.map((e=>e.level)))),a=t.lodAt(Math.min.apply(null,r.map((e=>e.level)))),{tileType:o}=this;if("Map"===o)return this._levelOffset=r[0].level,[s,a];if("Raster"===o)return[r.find((e=>e.resolution===i.x))??s,a];const{minScale:l,maxScale:c}=this.sourceJSON;let u=s;c>0&&(u=r.find((e=>Math.abs(e.scale-c)<n)),u||(u=r.filter((e=>e.scale>c)).sort(((e,t)=>e.scale>t.scale?1:-1))[0]??s));let h=a;return l>0&&(h=r.find((e=>Math.abs(e.scale-l)<n))??a,this._levelOffset=h.level-a.level),[u,h]}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Ve.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],Ve.prototype,"tileType",void 0),Ve=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.ImageServerRaster")],Ve);const $e=Ve;var Xe=i(48279);const Ye=new Map;Ye.set("Int8","s8"),Ye.set("UInt8","u8"),Ye.set("Int16","s16"),Ye.set("UInt16","u16"),Ye.set("Int32","s32"),Ye.set("UInt32","u32"),Ye.set("Float32","f32"),Ye.set("Float64","f32"),Ye.set("Double64","f32");const Ke=new Map;Ke.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Ke.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Ke.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Ke.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let Qe=class extends Y{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(e){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:n,files:r}=this._parseHeader(i.data);if(-1===this.ioConfig.skipExtensions?.indexOf("aux.xml")){const t=await this._fetchAuxiliaryData(e);null!=t&&(n.statistics=t.statistics??n.statistics,n.histograms=t.histograms,t.histograms&&null==n.statistics&&(n.statistics=(0,re.Oh)(t.histograms)))}this._set("rasterInfo",n),this._files=r;const s=await this.request(r.index,{responseType:"array-buffer",signal:t});this._storageIndex=this._parseIndex(s.data);const{blockWidth:a,blockHeight:o}=this.rasterInfo.storageInfo,l=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:c,height:u}=this.rasterInfo,h=[],f=this._getBandSegmentCount();let d=0,p=-1;for(;d<this._storageIndex.length;){p++;const e=Math.ceil(c/a/l**p)-1,t=Math.ceil(u/o/l**p)-1;d+=(e+1)*(t+1)*f*4,h.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=h,p>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=p),this.updateTileInfo()}async fetchRawTile(e,t,i,n={}){const{blockWidth:r,blockHeight:s,blockBoundary:a}=this.rasterInfo.storageInfo,o=a[e];if(!o||o.maxRow<t||o.maxCol<i||o.minRow>t||o.minCol>i)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:h,actualTileHeight:f}=this._getTileLocation(e,t,i);if(!u||0===u.length)return null;if(0===u[0].from&&0===u[0].to){const e=new Uint8Array(r*s);return new ie.Z({width:r,height:s,pixels:null,mask:e,validPixelCount:0})}const{bandIds:d}=this.ioConfig,p=this._getBandSegmentCount(),m=[];let y=0;for(y=0;y<p;y++)(!d||d.indexOf[y]>-1)&&m.push(this.request(this._files.data,{range:{from:u[y].from,to:u[y].to},responseType:"array-buffer",signal:n.signal}));const g=await Promise.all(m),x=g.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),w=new Uint8Array(x);let I=0;for(y=0;y<p;y++)w.set(new Uint8Array(g[y].data),I),I+=g[y].data.byteLength;const b=Ke.get(this.rasterInfo.storageInfo.compression).decoderFormat,S=await this.decodePixelBlock(w.buffer,{width:r,height:s,format:b,planes:d?.length||l,pixelType:c});if(null==S)return null;if(null!=this.rasterInfo.noDataValue&&"lerc"!==b&&!S.mask){const e=this.rasterInfo.noDataValue[0];if(null!=e){const t=S.width*S.height,i=new Uint8Array(t);if(Math.abs(e)>1e24)for(y=0;y<t;y++)Math.abs((S.pixels[0][y]-e)/e)>1e-6&&(i[y]=1);else for(y=0;y<t;y++)S.pixels[0][y]!==e&&(i[y]=1);S.mask=i}}let _=0,R=0;if(h!==r||f!==s){let e=S.mask;if(e)for(y=0;y<s;y++)if(R=y*r,y<f)for(_=h;_<r;_++)e[R+_]=0;else for(_=0;_<r;_++)e[R+_]=0;else for(e=new Uint8Array(r*s),S.mask=e,y=0;y<f;y++)for(R=y*r,_=0;_<h;_++)e[R+_]=1}return S}_parseIndex(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,i,n,r,s,a;if(Xe.f){for(i=new Uint8Array(e),r=new ArrayBuffer(e.byteLength),n=new Uint8Array(r),s=0;s<e.byteLength/4;s++)for(a=0;a<4;a++)n[4*s+a]=i[4*s+3-a];t=new Uint32Array(r)}else t=new Uint32Array(e);return t}_getBandSegmentCount(){return Ke.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){const{blockWidth:n,blockHeight:r,pyramidScalingFactor:s}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,h,f=0,d=0;for(h=0;h<e;h++)d=s**h,c=Math.ceil(a/n/d),u=Math.ceil(o/r/d),f+=c*u;d=s**e,c=Math.ceil(a/n/d),u=Math.ceil(o/r/d),f+=t*c+i,f*=4*l;const p=this._storageIndex.subarray(f,f+4*l);let m=0,y=0;const g=[];for(let e=0;e<l;e++)m=p[4*e]*2**32+p[4*e+1],y=m+p[4*e+2]*2**32+p[4*e+3],g.push({from:m,to:y});return{ranges:g,actualTileWidth:i<c-1?n:Math.ceil(a/d)-n*(c-1),actualTileHeight:t<u-1?r:Math.ceil(o/d)-r*(u-1)}}_parseHeader(e){const t=Pe(e,"MRF_META/Raster");if(!t)throw new a.Z("mrf:open","not a valid MRF format");const i=Pe(t,"Size"),n=parseInt(i.getAttribute("x"),10),r=parseInt(i.getAttribute("y"),10),s=parseInt(i.getAttribute("c"),10),o=(Oe(t,"Compression")||"none").toLowerCase();if(!Ke.has(o))throw new a.Z("mrf:open","currently does not support compression "+o);const l=Oe(t,"DataType")||"UInt8",c=Ye.get(l);if(null==c)throw new a.Z("mrf:open","currently does not support pixel type "+l);const u=Pe(t,"PageSize"),h=parseInt(u.getAttribute("x"),10),f=parseInt(u.getAttribute("y"),10),d=Pe(t,"DataValues");let p,m;if(d&&(m=d.getAttribute("NoData"),null!=m&&(p=m.trim().split(" ").map((e=>parseFloat(e))))),Pe(e,"MRF_META/CachedSource"))throw new a.Z("mrf:open","currently does not support MRF referencing other data files");const y=Pe(e,"MRF_META/GeoTags"),g=Pe(y,"BoundingBox");let x,w=!1;if(null!=g){const e=parseFloat(g.getAttribute("minx")),t=parseFloat(g.getAttribute("miny")),i=parseFloat(g.getAttribute("maxx")),n=parseFloat(g.getAttribute("maxy")),r=Oe(y,"Projection")||"";let s=ce.Z.WGS84;if("LOCAL_CS[]"!==r)if(r.toLowerCase().startsWith("epsg:")){const e=Number(r.slice(5));isNaN(e)||0===e||(s=new ce.Z({wkid:e}))}else s=Je(r)??ce.Z.WGS84;else w=!0,s=new ce.Z({wkid:3857});x=new $.Z(e,t,i,n),x.spatialReference=s}else w=!0,x=new $.Z({xmin:-.5,ymin:.5-r,xmax:n-.5,ymax:.5,spatialReference:new ce.Z({wkid:3857})});const I=Pe(e,"MRF_META/Rsets"),b=parseInt(I&&I.getAttribute("scale")||"2",10),S=x.spatialReference,_=new Z.Z({origin:new z.Z({x:x.xmin,y:x.ymax,spatialReference:S}),blockWidth:h,blockHeight:f,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:o,pyramidScalingFactor:b}),R=new z.Z({x:x.width/n,y:x.height/r,spatialReference:S}),v=new we.Z({width:n,height:r,extent:x,isPseudoSpatialReference:w,spatialReference:S,bandCount:s,pixelType:c,pixelSize:R,noDataValue:p,storageInfo:_}),T=Oe(e,"datafile"),C=Oe(e,"IndexFile");return{rasterInfo:v,files:{mrf:this.url,index:C||this.url.replace(".mrf",".idx"),data:T||this.url.replace(".mrf",Ke.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Ee(t)}catch{return null}}};(0,n._)([(0,h.Cb)()],Qe.prototype,"_files",void 0),(0,n._)([(0,h.Cb)()],Qe.prototype,"_storageIndex",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Qe.prototype,"datasetFormat",void 0),Qe=(0,n._)([(0,y.j)("esri.layers.support.rasterIO.MRFRaster")],Qe);const et=Qe;var tt=i(94793),it=i(9832);const nt=(e,t)=>e.get(t)?.values,rt=(e,t)=>e.get(t)?.values?.[0];let st=class extends Y{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){await this.init();const t=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!i)throw new a.Z("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:n,firstIFDPos:r,isBigTiff:s}=(0,tt.cK)(i),o=[];await this._readIFDs(o,i,n,r,0,s?8:4,t);const{imageInfo:l,rasterInfo:c}=this._parseIFDs(o),u=(0,tt.ee)(o),h=(0,tt.I7)(o);if(this._headerInfo={littleEndian:n,isBigTiff:s,ifds:o,pyramidIFDs:u,maskIFDs:h,...l},this._set("rasterInfo",c),!l.isSupported)throw new a.Z("tiffraster:open","this tiff is not supported: "+l.message);if(!l.tileWidth)throw new a.Z("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");const{skipExtensions:f=[]}=this.ioConfig;if(!f.includes("aux.xml")){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&this._processPAMInfo(t,c)}f.includes("vat.dbf")||1!==c.bandCount||"u8"!==c.pixelType||(c.attributeTable=await this._fetchAuxiliaryTable(e),null!=c.attributeTable&&(c.keyProperties.DataType="thematic")),this.updateTileInfo()}async fetchRawTile(e,t,i,n={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const r=await this._fetchRawTiffTile(e,t,i,!1,n);if(null!=r&&this._headerInfo.hasMaskBand){const s=await this._fetchRawTiffTile(e,t,i,!0,n);null!=s&&s.pixels[0]instanceof Uint8Array&&(r.mask=s.pixels[0])}return r}_parseIFDs(e){const t=(0,tt.FI)(e),{width:i,height:n,tileWidth:r,tileHeight:s,planes:a,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:h,pyramidBlockHeight:f,tileBoundary:d,affine:p,metadata:m}=t;let y=Je(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),g=!!t.isPseudoGeographic;null==y&&(g=!0,y=new ce.Z({wkid:3857}));const x=new $.Z({...t.extent,spatialReference:y}),w=new z.Z(x?{x:x.xmin,y:x.ymax,spatialReference:y}:{x:0,y:0}),I=new Z.Z({blockWidth:r,blockHeight:s,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:l,origin:w,firstPyramidLevel:c,maximumPyramidLevel:u,blockBoundary:d}),b=new z.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/n,spatialReference:y}),S=m?{BandProperties:m.bandProperties,DataType:m.dataType}:{};let _=null;const R=rt(e[0],"PHOTOMETRICINTERPRETATION"),v=nt(e[0],"COLORMAP");if(R<=3&&v?.length>3&&v.length%3==0){_=[];const e=v.length/3;for(let t=0;t<e;t++)_.push([t,v[t]>>>8,v[t+e]>>>8,v[t+2*e]>>>8])}const T=new we.Z({width:i,height:n,bandCount:a,pixelType:o,pixelSize:b,storageInfo:I,spatialReference:y,isPseudoSpatialReference:g,keyProperties:S,extent:x,colormap:_,statistics:m?m.statistics:null});return p?.length&&(T.nativeExtent=new $.Z({xmin:-.5,ymin:.5-n,xmax:i-.5,ymax:.5,spatialReference:y}),T.transform=new Be.Z({polynomialOrder:1,forwardCoefficients:[p[2]+p[0]/2,p[5]-p[3]/2,p[0],p[3],-p[1],-p[4]]}),T.extent=T.transform.forwardTransform(T.nativeExtent),T.pixelSize=new z.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/n,spatialReference:y}),I.origin.x=-.5,I.origin.y=.5),{imageInfo:t,rasterInfo:T}}_processPAMInfo(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,re.Oh)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new z.Z({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}async _readIFDs(e,t,i,n,r,s=4,a){if(!n)return null;(n>=t.byteLength||n<0)&&(t=(await this.request(this.url,{range:{from:n+r,to:n+r+this._bufferSize},responseType:"array-buffer",signal:a})).data,r=n+r,n=0);const o=await this._readIFD(t,i,n,r,it.Z.TIFF_TAGS,s,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,i,o.nextIFD-r,r,s,a)}async _readIFD(e,t,i,n,r=it.Z.TIFF_TAGS,s=4,a){if(!e)return null;const o=(0,tt.vr)(e,t,i,n,r,s);if(o.success){const i=[];if(o.ifd?.forEach((e=>{e.values||i.push(e)})),i.length>0){const r=i.map((e=>e.offlineOffsetSize)).filter(P.pC),s=Math.min.apply(null,r.map((e=>e[0])));if(Math.min.apply(null,r.map((e=>e[0]+e[1])))-s<=this._bufferSize){const{data:r}=await this.request(this.url,{range:{from:s,to:s+this._bufferSize},responseType:"array-buffer",signal:a});e=r,n=s,i.forEach((i=>(0,tt.Dq)(e,t,i,n)))}}if(o.ifd?.has("GEOKEYDIRECTORY")){const i=o.ifd.get("GEOKEYDIRECTORY"),r=i?.values;if(r&&r.length>4){const s=r[0]+"."+r[1]+"."+r[2],o=await this._readIFD(e,t,i.valueOffset+6-n,n,it.Z.GEO_KEYS,2,a);i.data=o.ifd,i.data&&i.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[s]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const i=await this.request(this.url,{range:{from:n,to:n+o.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=i.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,n,it.Z.TIFF_TAGS,4,a)}}async _fetchRawTiffTile(e,t,i,n,r={}){const s=this._getTileLocation(e,t,i,n);if(!s)return null;const{ranges:a,actualTileWidth:o,actualTileHeight:l,ifd:c}=s,u=a.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:r.signal}))),h=await Promise.all(u),f=h.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),d=1===h.length?h[0].data:new ArrayBuffer(f),p=[0],m=[0];if(h.length>1){const e=new Uint8Array(d);for(let t=0,i=0;t<h.length;t++){const n=h[t].data;e.set(new Uint8Array(n),i),p[t]=i,i+=n.byteLength,m[t]=n.byteLength}}const{blockWidth:y,blockHeight:g}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(d,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:p,sizes:m},width:y,height:g,planes:null,pixelType:null});if(null==x)return null;let w,I,b;if(o!==y||l!==g){let e=x.mask;if(e)for(w=0;w<g;w++)if(b=w*y,w<l)for(I=o;I<y;I++)e[b+I]=0;else for(I=0;I<y;I++)e[b+I]=0;else for(e=new Uint8Array(y*g),x.mask=e,w=0;w<l;w++)for(b=w*y,I=0;I<o;I++)e[b+I]=1}return x}_getTileLocation(e,t,i,n=!1){const{firstPyramidLevel:r,blockBoundary:s}=this.rasterInfo.storageInfo,a=0===e?0:e-(r-1),{_headerInfo:o}=this;if(!o)return null;const l=n?o.maskIFDs[a]:0===a?o?.ifds[0]:o?.pyramidIFDs[a-1];if(!l)return null;const c=(0,tt.If)(l,o),u=nt(l,"TILEOFFSETS");if(void 0===u)return null;const h=nt(l,"TILEBYTECOUNTS"),{minRow:f,minCol:d,maxRow:p,maxCol:m}=s[a];if(t>p||i>m||t<f||i<d)return null;const y=rt(l,"IMAGEWIDTH"),g=rt(l,"IMAGELENGTH"),x=rt(l,"TILEWIDTH"),w=rt(l,"TILELENGTH"),I=c?this.rasterInfo.bandCount:1,b=I*t*(m+1)+i,S=[{from:u[b],to:u[b+I-1]+h[b+I-1]-1}];if(c){let e=!0;for(let t=0;t<I;t++)if(u[b+t]+h[b+t]!==u[b+t+1]){e=!1;break}if(!e)for(let e=0;e<I;e++)S[e]={from:u[b+e],to:u[b+e]+h[b+e]-1}}const _=u[b],R=h[b];return null==_||null==R?null:{ranges:S,ifd:l,actualTileWidth:i===m&&y%x||x,actualTileHeight:t===p&&g%w||w}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Ee(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=Se.parse(t);return i?.recordSet?Re.Z.fromJSON(i.recordSet):null}catch{return null}}};(0,n._)([(0,h.Cb)()],st.prototype,"_files",void 0),(0,n._)([(0,h.Cb)()],st.prototype,"_headerInfo",void 0),(0,n._)([(0,h.Cb)()],st.prototype,"_bufferSize",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],st.prototype,"datasetFormat",void 0),st=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.TIFFRaster")],st);const at=st,ot=new Map;ot.set("CRF",{desc:"Cloud Raster Format",constructor:Ce}),ot.set("MRF",{desc:"Meta Raster Format",constructor:et}),ot.set("TIFF",{desc:"GeoTIFF",constructor:at}),ot.set("RasterTileServer",{desc:"Raster Tile Server",constructor:$e}),ot.set("JPG",{desc:"JPG Raster Format",constructor:Le}),ot.set("PNG",{desc:"PNG Raster Format",constructor:Le}),ot.set("GIF",{desc:"GIF Raster Format",constructor:Le}),ot.set("BMP",{desc:"BMP Raster Format",constructor:Le});class lt{static get supportedFormats(){const e=new Set;return ot.forEach(((t,i)=>e.add(i))),e}static async open(e){const{url:t,ioConfig:i,sourceJSON:n}=e;let r=e.datasetFormat;null==r&&t.lastIndexOf(".")&&(r=t.slice(t.lastIndexOf(".")+1).toUpperCase()),"OVR"===r||"TIF"===r?r="TIFF":"JPG"!==r&&"JPEG"!==r&&"JFIF"!==r||(r="JPG"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(r="RasterTileServer");const s={url:t,sourceJSON:n,datasetFormat:r,ioConfig:i??{bandIds:null,sampling:null}};let o,l;if(r&&this.supportedFormats.has(r)){if("CRF"===r&&!i?.enableCRF)throw new a.Z("rasterfactory:open",`cannot open raster: ${t}`);return o=ot.get(r).constructor,l=new o(s),await l.open({signal:e.signal}),l}if(r)throw new a.Z("rasterfactory:open","not a supported format "+r);const c=Array.from(ot.keys());let u=0;const h=()=>(r=c[u++],r&&("CRF"!==r||i?.enableCRF)?(o=ot.get(r).constructor,l=new o(s),l.open({signal:e.signal}).then((()=>l)).catch((()=>h()))):null);return h()}static register(e,t,i){ot.has(e.toUpperCase())||ot.set(e.toUpperCase(),{desc:t,constructor:i})}}var ct=i(32163);let ut=class extends((0,w.h)((0,me.M)((0,fe.q)((0,de.I)((0,I.N)(he((0,ye.n)((0,x.Y)((0,pe.Q)((0,l.R)(g.Z))))))))))){constructor(...e){super(...e),this._primaryRasters=null,this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(c.r9).then((()=>this._openRaster(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[new ge.Z({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"})];const{rasterInfo:t}=this,i=t?.attributeTable,n=null!=i?i.fields:null;if(n){const t=n.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));e=e.concat(t)}const r=t?.dataType,s=t?.multidimensionalInfo;if(("vector-magdir"===r||"vector-uv"===r)&&null!=s){const t=s.variables[0].unit?.trim(),i="Magnitude"+(t?` (${t})`:"");e.push(new ge.Z({name:"Raster.Magnitude",alias:i,domain:null,editable:!1,type:"double"})),e.push(new ge.Z({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return e}set renderer(e){this._set("renderer",e),this.updateRenderer()}readRenderer(e,t,i){const n=t&&t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.renderer,r=(0,s.ij)(n,i)||void 0;if(null!=r)return r}createPopupTemplate(e){return(0,ct.eZ)({fields:this.rasterFields,title:this.title},e)}async generateRasterInfo(e,t){if(!(e=(0,f.TJ)(C.Z,e)))return this._primaryRasters[0].rasterInfo;try{const i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((e=>i[e.url]=e));const n=(0,ne.Ue)(e.toJSON(),i),r=new Q({rasterFunction:n});return await r.open(t),r.rasterInfo}catch{return null}}write(e,t){const{raster:i}=this;if(this.loaded?"RasterTileServer"===i.datasetFormat&&("Raster"===i.tileType||"Map"===i.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t&&t.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new a.Z("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)this.raster.rasterInfo||await this.raster.open(),"Function"===this.raster.datasetFormat?(t=!0,this._primaryRasters=this.raster.primaryRasters.rasters):this._primaryRasters=[this.raster],this.url=this.raster.url;else{const{rasterFunction:t}=this,i=[this.url];t&&(0,ne.G8)(t.toJSON(),i);const n=await Promise.all(i.map((t=>lt.open({url:t,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e})))),r=n.findIndex((e=>null==e));if(r>-1)throw new a.Z("imagery-tile-layer:open",`cannot open raster: ${i[r]}`);if(this._primaryRasters=n,t){const e={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((t=>e[t.url]=t));const i=(0,ne.Ue)(t.rasterFunctionDefinition??t.toJSON(),e),r=new Q({rasterFunction:i});try{await r.open(),this.raster=r}catch(e){const t=o.Z.getLogger(this.declaredClass);e instanceof a.Z&&t.error("imagery-tile-layer:open",e.message),t.warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=n[0]}}else this.raster=n[0]}const i=this.raster.rasterInfo;if(!i)throw new a.Z("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("rasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,u.YP)((()=>this.customParameters),(e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)})))}};(0,n._)([(0,h.Cb)()],ut.prototype,"_primaryRasters",void 0),(0,n._)([(0,h.Cb)({type:[f.z8],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],ut.prototype,"bandIds",void 0),(0,n._)([(0,h.Cb)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,p.J)(xe.c)],ut.prototype,"interpolation",void 0),(0,n._)([(0,h.Cb)(R.rn)],ut.prototype,"legendEnabled",void 0),(0,n._)([(0,h.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ut.prototype,"isReference",void 0),(0,n._)([(0,h.Cb)({type:["show","hide"]})],ut.prototype,"listMode",void 0),(0,n._)([(0,h.Cb)({json:{read:!0,write:!0}})],ut.prototype,"blendMode",void 0),(0,n._)([(0,h.Cb)()],ut.prototype,"sourceJSON",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],ut.prototype,"version",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],ut.prototype,"type",void 0),(0,n._)([(0,h.Cb)({type:["ArcGISTiledImageServiceLayer"]})],ut.prototype,"operationalLayerType",void 0),(0,n._)([(0,h.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],ut.prototype,"popupEnabled",void 0),(0,n._)([(0,h.Cb)({type:r.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],ut.prototype,"popupTemplate",void 0),(0,n._)([(0,h.Cb)({readOnly:!0})],ut.prototype,"defaultPopupTemplate",null),(0,n._)([(0,h.Cb)({readOnly:!0,type:[ge.Z]})],ut.prototype,"fields",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,type:[ge.Z]})],ut.prototype,"rasterFields",null),(0,n._)([(0,h.Cb)({types:s.dr,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:s.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],ut.prototype,"renderer",null),(0,n._)([(0,m.r)("renderer")],ut.prototype,"readRenderer",null),ut=(0,n._)([(0,y.j)("esri.layers.ImageryTileLayer")],ut);const ht=ut},11282:(e,t,i)=>{i.d(t,{cv:()=>o,en:()=>a,lA:()=>s}),i(68773),i(40330);var n=i(22974),r=i(17452);function s(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function a(e){return"string"==typeof e?(0,r.mN)(e):(0,n.d9)(e)}function o(e,t,i){const n={};for(const r in e){if("declaredClass"===r)continue;const s=e[r];if(null!=s&&"function"!=typeof s)if(Array.isArray(s)){n[r]=[];for(let e=0;e<s.length;e++)n[r][e]=o(s[e])}else if("object"==typeof s)if(s.toJSON){const e=s.toJSON(i&&i[r]);n[r]=t?e:JSON.stringify(e)}else n[r]=t?s:JSON.stringify(s);else n[r]=s}return n}i(71058)}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5587],{83379:(t,e,r)=>{r.d(e,{Z:()=>y});var o=r(43697),s=r(20102),i=r(609),l=r(95330),n=r(20941),a=r(5600),u=r(52011);const p="loaded",d=t=>{let e=class extends t{constructor(...t){super(...t),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise((t=>{const e=this.load.bind(this);this.load=r=>{const o=new Promise(((t,e)=>{const o=(0,l.$F)(r,e);this.destroyed&&e(new s.Z("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this._promiseProps.when(t,e).finally((()=>{o&&o.remove()}))}));if("not-loaded"===this.loadStatus){this._set("loadStatus","loading");const t=this._loadController=new AbortController;e({signal:t.signal}),(0,l.fu)(t.signal,(()=>{this._promiseProps.abort()}))}return t(),o}}))),this.when((()=>{this._set("loadStatus",p),this._loadController=null}),(t=>{this._set("loadStatus","failed"),this._set("loadError",t),this._loadController=null}))}destroy(){this._loadController=null,this._set("loadError",null),this._set("loadWarnings",[])}get loaded(){return this.loadStatus===p}get loadWarnings(){return this._get("loadWarnings")}load(){return null}cancelLoad(){return this.isFulfilled()||(this._set("loadError",new s.Z("load:cancelled","Cancelled")),this._loadController?.abort()),this}};return(0,o._)([(0,a.Cb)({readOnly:!0})],e.prototype,"loaded",null),(0,o._)([(0,a.Cb)({readOnly:!0})],e.prototype,"loadError",void 0),(0,o._)([(0,a.Cb)({clonable:!1})],e.prototype,"loadStatus",void 0),(0,o._)([(0,a.Cb)({type:[n.Z],readOnly:!0})],e.prototype,"loadWarnings",null),e=(0,o._)([(0,u.j)("esri.core.Loadable")],e),e};let h=class extends(d(i.D)){};var c;h=(0,o._)([(0,u.j)("esri.core.Loadable")],h),(c=h||(h={})).LoadableMixin=d,c.isLoadable=function(t){return!(!t||!t.load)};const y=h},609:(t,e,r)=>{r.d(e,{D:()=>h,v:()=>d});var o,s,i=r(43697),l=r(15923),n=r(70586),a=r(95330),u=r(52011);(s=o||(o={}))[s.PENDING=0]="PENDING",s[s.RESOLVED=1]="RESOLVED",s[s.REJECTED=2]="REJECTED";class p{constructor(t){this.instance=t,this._resolver=(0,a.dD)(),this._status=o.PENDING,this._resolvingPromises=[],this._resolver.promise.then((()=>{this._status=o.RESOLVED,this._cleanUp()}),(()=>{this._status=o.REJECTED,this._cleanUp()}))}destroy(){this._cleanUp()}addResolvingPromise(t){this._resolvingPromises.push(t),this._tryResolve()}isResolved(){return this._status===o.RESOLVED}isRejected(){return this._status===o.REJECTED}isFulfilled(){return this._status!==o.PENDING}abort(){this._resolver.reject((0,a.zE)())}when(t,e){return this._resolver.promise.then(t,e)}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const t=(0,a.dD)(),e=[...this._resolvingPromises,(0,n.j0)(t.promise)],r=this._allPromise=Promise.all(e);r.then((()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve(this.instance)}),(t=>{this.isFulfilled()||this._allPromise!==r||(0,a.D_)(t)||this._resolver.reject(t)})),t.resolve()}}const d=t=>{let e=class extends t{constructor(...t){super(...t),this._promiseProps=new p(this),this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps?.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(t,e){return new Promise(((t,e)=>{this._promiseProps.when(t,e)})).then(t,e)}catch(t){return this.when(null,t)}addResolvingPromise(t){t&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in t?t.when():t)}};return e=(0,i._)([(0,u.j)("esri.core.Promise")],e),e};let h=class extends(d(l.Z)){};h=(0,i._)([(0,u.j)("esri.core.Promise")],h)},70171:(t,e,r)=>{let o;r.d(e,{Kd:()=>l,Ze:()=>p,qe:()=>a});const s=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function i(){return s??globalThis.navigator?.language??"en"}function l(){return void 0===o&&(o=i()),o}const n=[];function a(t){return n.push(t),{remove(){n.splice(n.indexOf(t),1)}}}const u=[];function p(t){return u.push(t),{remove(){n.splice(u.indexOf(t),1)}}}globalThis.addEventListener?.("languagechange",(function(){const t=i();o!==t&&(o=t,[...u].forEach((e=>{e.call(null,t)})),[...n].forEach((e=>{e.call(null,t)})))}))},65587:(t,e,r)=>{r.d(e,{Z:()=>U});var o=r(43697),s=r(68773),i=r(40330),l=r(3172),n=r(20102),a=r(96674),u=r(83379),p=r(70586),d=r(95330),h=r(5600),c=r(75215),y=(r(67676),r(80442),r(71715)),m=r(52011),_=r(6570),v=r(70171),C=r(41253),b=r(15923);let f=class extends b.Z{constructor(t){super(t),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};(0,o._)([(0,h.Cb)()],f.prototype,"nextQueryParams",void 0),(0,o._)([(0,h.Cb)()],f.prototype,"queryParams",void 0),(0,o._)([(0,h.Cb)()],f.prototype,"results",void 0),(0,o._)([(0,h.Cb)()],f.prototype,"total",void 0),f=(0,o._)([(0,m.j)("esri.portal.PortalQueryResult")],f);const g=f;var S,P=r(86082),O=r(71058);let w;const q={PortalGroup:()=>Promise.resolve().then(r.bind(r,68916)),PortalItem:()=>Promise.all([r.e(5235),r.e(9880)]).then(r.bind(r,15235)),PortalUser:()=>Promise.resolve().then(r.bind(r,86082))};let G=S=class extends((0,a.eC)(u.Z)){constructor(t){super(t),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=s.Z.portalUrl,this.urlKey=null,this.user=null,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null,this._finalizationToken={}}normalizeCtorArgs(t){return"string"==typeof t?{url:t}:t}destroy(){E.unregister(this._finalizationToken),this.defaultBasemap=(0,p.SC)(this.defaultBasemap),this.defaultDevBasemap=(0,p.SC)(this.defaultDevBasemap),this.defaultVectorBasemap=(0,p.SC)(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=(0,p.hw)(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(t){if(t)for(const e of t)s.Z.request.trustedServers.includes(e)||s.Z.request.trustedServers.push(e);return t}readDefaultBasemap(t){return this._readBasemap(t)}readDefaultDevBasemap(t){return this._readBasemap(t)}readDefaultVectorBasemap(t){return this._readBasemap(t)}get extraQuery(){const t=!(this.user&&this.user.orgId)||this.canSearchPublic;return this.id&&!t?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let t=this.url;if(t){const e=t.indexOf("/sharing");t=e>0?t.substring(0,e):this.url.replace(/\/+$/,""),t+="/sharing/rest"}return t}get thumbnailUrl(){const t=this.restUrl,e=this.thumbnail;return t&&e?this._normalizeSSL(t+"/portals/self/resources/"+e):null}readUrlKey(t){return t?t.toLowerCase():t}readUser(t){let e=null;return t&&(e=P.default.fromJSON(t),e.portal=this),e}load(t){const e=Promise.all([r.e(5235),r.e(3668)]).then(r.bind(r,93668)).then((({default:e})=>{(0,d.k_)(t),w=e})).then((()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,t))).then((t=>{if(i.id){const t=i.id;this.credential=t.findCredential(this.restUrl),this.credential||this.authMode!==S.AUTH_MODE_AUTO||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=t.on("credential-create",function(t){const e=i.id;return()=>{const r=t.deref();r&&e.findCredential(r.restUrl)&&r.signIn().catch((()=>{}))}}(new WeakRef(this))),E.register(this,this._esriIdCredentialCreateHandle,this._finalizationToken))}this.sourceJSON=t,this.read(t)}));return this.addResolvingPromise(e),Promise.resolve(this)}async createElevationLayers(){await this.load();const t=this._getHelperService("defaultElevationLayers"),e=(await Promise.all([r.e(163),r.e(4547),r.e(5235),r.e(3055),r.e(2763),r.e(9393)]).then(r.bind(r,65665))).default;return t?t.map((t=>new e({id:t.id,url:t.url}))):[]}fetchBasemaps(t,e){const r=new C.Z;return r.query=t||(s.Z.apiKey&&(0,O.r)(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),r.disableExtraQuery=!0,this.queryGroups(r,e).then((t=>{if(r.num=100,r.query='type:"Web Map" -type:"Web Application"',t.total){const o=t.results[0];return r.sortField=o.sortField||"name",r.sortOrder=o.sortOrder||"desc",o.queryItems(r,e)}return null})).then((t=>{let e;return e=t&&t.total?t.results.filter((t=>"Web Map"===t.type)).map((t=>new w({portalItem:t}))):[],e}))}fetchCategorySchema(t){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",t).then((t=>t.categorySchema)):(0,d.Hc)(t)?Promise.reject((0,d.zE)()):Promise.resolve([])}fetchFeaturedGroups(t){const e=this.featuredGroups,r=new C.Z;if(r.num=100,r.sortField="title",e&&e.length){const o=[];for(const t of e)o.push(`(title:"${t.title}" AND owner:${t.owner})`);return r.query=o.join(" OR "),this.queryGroups(r,t).then((t=>t.results))}return(0,d.Hc)(t)?Promise.reject((0,d.zE)()):Promise.resolve([])}fetchRegions(t){const e=this.user?.culture||this.culture||(0,v.Kd)();return this.request(this.restUrl+"/portals/regions",{...t,query:{culture:e}})}fetchSettings(t){const e=this.user?.culture||this.culture||(0,v.Kd)();return this.request(this.restUrl+"/portals/self/settings",{...t,query:{culture:e}})}static getDefault(){return S._default&&!S._default.destroyed||(S._default=new S),S._default}queryGroups(t,e){return this.queryPortal("/community/groups",t,"PortalGroup",e)}queryItems(t,e){return this.queryPortal("/search",t,"PortalItem",e)}queryUsers(t,e){return t.sortField||(t.sortField="username"),this.queryPortal("/community/users",t,"PortalUser",e)}fetchSelf(t=this.authMode,e=!1,r){const o=this.restUrl+"/portals/self",s={authMode:t,query:{culture:(0,v.Kd)().toLowerCase()},...r};return"auto"===s.authMode&&(s.authMode="no-prompt"),e&&(s.query.default=!0),this.request(o,s)}queryPortal(t,e,r,o){const s=(0,c.se)(C.Z,e),i=e=>this.request(this.restUrl+t,{...s.toRequestOptions(this),...o}).then((t=>{const r=s.clone();return r.start=t.nextStart,new g({nextQueryParams:r,queryParams:s,total:t.total,results:S._resultsToTypedArray(e,{portal:this},t,o)})})).then((t=>Promise.all(t.results.map((e=>"function"==typeof e.when?e.when():t))).then((()=>t),(e=>((0,d.r9)(e),t)))));return r&&q[r]?q[r]().then((({default:t})=>((0,d.k_)(o),i(t)))):i()}signIn(){if(this.authMode===S.AUTH_MODE_ANONYMOUS)return Promise.reject(new n.Z("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if("failed"===this.loadStatus)return Promise.reject(this.loadError);const t=t=>Promise.resolve().then((()=>"not-loaded"===this.loadStatus?(t||(this.authMode="immediate"),this.load().then((()=>null))):"loading"===this.loadStatus?this.load().then((()=>this.credential?null:(this.credential=t,this.fetchSelf("immediate")))):this.user&&this.credential===t?null:(this.credential=t,this.fetchSelf("immediate")))).then((t=>{t&&(this.sourceJSON=t,this.read(t))}));return i.id?i.id.getCredential(this.restUrl).then((e=>t(e))):t(this.credential)}normalizeUrl(t){const e=this.credential&&this.credential.token;return this._normalizeSSL(e?t+(t.includes("?")?"&":"?")+"token="+e:t)}requestToTypedArray(t,e,r){return this.request(t,e).then((t=>{const e=S._resultsToTypedArray(r,{portal:this},t);return Promise.all(e.map((e=>"function"==typeof e.when?e.when():t))).then((()=>e),(()=>e))}))}request(t,e={}){const r={f:"json",...e.query},{authMode:o=(this.authMode===S.AUTH_MODE_ANONYMOUS?"anonymous":"auto"),body:s=null,cacheBust:i=!1,method:n="auto",responseType:a="json",signal:u}=e,p={authMode:o,body:s,cacheBust:i,method:n,query:r,responseType:a,timeout:0,signal:u};return(0,l.default)(this._normalizeSSL(t),p).then((t=>t.data))}toJSON(){throw new n.Z("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");return new S({sourceJSON:t})}_getHelperService(t){const e=this.helperServices&&this.helperServices[t];if(!e)throw new n.Z("portal:service-not-found",`The \`helperServices\` do not include an entry named "${t}"`);return e}_normalizeSSL(t){return t.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(t){if(t){const e=w.fromJSON(t);return e.portalItem={portal:this},e}return null}static _resultsToTypedArray(t,e,r,o){let s=[];if(r){const i=null!=o?o.signal:null;s=r.listings||r.notifications||r.userInvitations||r.tags||r.items||r.groups||r.comments||r.provisions||r.results||r.relatedItems||r,(t||e)&&(s=s.map((r=>{const o=Object.assign(t?t.fromJSON(r):r,e);return"function"==typeof o.load&&o.load(i),o})))}else s=[];return s}};G.AUTH_MODE_ANONYMOUS="anonymous",G.AUTH_MODE_AUTO="auto",G.AUTH_MODE_IMMEDIATE="immediate",(0,o._)([(0,h.Cb)()],G.prototype,"access",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"allSSL",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"authMode",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"authorizedCrossOriginDomains",void 0),(0,o._)([(0,y.r)("authorizedCrossOriginDomains")],G.prototype,"readAuthorizedCrossOriginDomains",null),(0,o._)([(0,h.Cb)()],G.prototype,"basemapGalleryGroupQuery",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"bingKey",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"canListApps",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"canListData",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"canListPreProvisionedItems",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"canProvisionDirectPurchase",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"canSearchPublic",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"canShareBingPublic",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"canSharePublic",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"canSignInArcGIS",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"canSignInIDP",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"colorSetsGroupQuery",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"commentsEnabled",void 0),(0,o._)([(0,h.Cb)({type:Date})],G.prototype,"created",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"credential",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"culture",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"currentVersion",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"customBaseUrl",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"defaultBasemap",void 0),(0,o._)([(0,y.r)("defaultBasemap")],G.prototype,"readDefaultBasemap",null),(0,o._)([(0,h.Cb)()],G.prototype,"defaultDevBasemap",void 0),(0,o._)([(0,y.r)("defaultDevBasemap")],G.prototype,"readDefaultDevBasemap",null),(0,o._)([(0,h.Cb)({type:_.Z})],G.prototype,"defaultExtent",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"defaultVectorBasemap",void 0),(0,o._)([(0,y.r)("defaultVectorBasemap")],G.prototype,"readDefaultVectorBasemap",null),(0,o._)([(0,h.Cb)()],G.prototype,"description",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"devBasemapGalleryGroupQuery",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"eueiEnabled",void 0),(0,o._)([(0,h.Cb)({readOnly:!0})],G.prototype,"extraQuery",null),(0,o._)([(0,h.Cb)()],G.prototype,"featuredGroups",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"featuredItemsGroupQuery",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"galleryTemplatesGroupQuery",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"livingAtlasGroupQuery",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"hasCategorySchema",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"helpBase",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"helperServices",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"helpMap",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"homePageFeaturedContent",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"homePageFeaturedContentCount",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"httpPort",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"httpsPort",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"id",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"ipCntryCode",void 0),(0,o._)([(0,h.Cb)({readOnly:!0})],G.prototype,"isOrganization",null),(0,o._)([(0,h.Cb)()],G.prototype,"isPortal",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"isReadOnly",void 0),(0,o._)([(0,h.Cb)({readOnly:!0})],G.prototype,"itemPageUrl",null),(0,o._)([(0,h.Cb)()],G.prototype,"layerTemplatesGroupQuery",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"maxTokenExpirationMinutes",void 0),(0,o._)([(0,h.Cb)({type:Date})],G.prototype,"modified",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"name",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"portalHostname",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"portalMode",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"portalProperties",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"region",void 0),(0,o._)([(0,h.Cb)({readOnly:!0})],G.prototype,"restUrl",null),(0,o._)([(0,h.Cb)()],G.prototype,"rotatorPanels",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"showHomePageDescription",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"sourceJSON",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"staticImagesUrl",void 0),(0,o._)([(0,h.Cb)({json:{name:"2DStylesGroupQuery"}})],G.prototype,"stylesGroupQuery2d",void 0),(0,o._)([(0,h.Cb)({json:{name:"stylesGroupQuery"}})],G.prototype,"stylesGroupQuery3d",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"supportsHostedServices",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"symbolSetsGroupQuery",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"templatesGroupQuery",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"thumbnail",void 0),(0,o._)([(0,h.Cb)({readOnly:!0})],G.prototype,"thumbnailUrl",null),(0,o._)([(0,h.Cb)()],G.prototype,"units",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"url",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"urlKey",void 0),(0,o._)([(0,y.r)("urlKey")],G.prototype,"readUrlKey",null),(0,o._)([(0,h.Cb)()],G.prototype,"user",void 0),(0,o._)([(0,y.r)("user")],G.prototype,"readUser",null),(0,o._)([(0,h.Cb)()],G.prototype,"useStandardizedQuery",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"useVectorBasemaps",void 0),(0,o._)([(0,h.Cb)()],G.prototype,"vectorBasemapGalleryGroupQuery",void 0),G=S=(0,o._)([(0,m.j)("esri.portal.Portal")],G);const U=G,E=new FinalizationRegistry((t=>{t.remove()}))},68916:(t,e,r)=>{r.r(e),r.d(e,{default:()=>h});var o=r(43697),s=r(20102),i=r(96674),l=r(70586),n=r(5600),a=r(75215),u=(r(67676),r(80442),r(52011)),p=r(41253);let d=class extends i.wq{constructor(t){super(t),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.tags=null,this.title=null}get thumbnailUrl(){const t=this.url,e=this.thumbnail;return t&&e&&this.portal?this.portal?.normalizeUrl(`${t}/info/${e}?f=json`):null}get url(){const t=this.get("portal.restUrl");return t?t+"/community/groups/"+this.id:null}fetchCategorySchema(t){return(0,l.s3)(this.portal).request(this.url+"/categorySchema",t).then((e=>{const r=e.categorySchema||[];return r.some((t=>"contentCategorySetsGroupQuery.LivingAtlas"===t.source))?this._fetchCategorySchemaSet("LivingAtlas",t):r}))}fetchMembers(t){return(0,l.s3)(this.portal).request(this.url+"/users",t)}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}toJSON(){throw new s.Z("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}queryItems(t,e){let r=(0,a.se)(p.Z,t);const o=(0,l.s3)(this.portal);return parseFloat(o.currentVersion)>5?(r=r||new p.Z,o.queryPortal(`/content/groups/${this.id}/search`,r,"PortalItem",e)):(r=r?r.clone():new p.Z,r.query="group:"+this.id+(r.query?" "+r.query:""),o.queryItems(r,e))}_fetchCategorySchemaSet(t,e){const r=(0,l.s3)(this.portal);return r.fetchSelf(r.authMode,!0,e).then((t=>{const o=t.contentCategorySetsGroupQuery;if(o){const t=new p.Z;return t.disableExtraQuery=!0,t.num=1,t.query=o,r.queryGroups(t,e)}throw new s.Z("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")})).then((r=>{if(r.total){const o=r.results[0],s=new p.Z;return s.num=1,s.query=`typekeywords:"${t}"`,o.queryItems(s,e)}throw new s.Z("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")})).then((t=>t.total?t.results[0].fetchData("json",e).then((t=>{const e=t&&t.categorySchema;return e&&e.length?e:[]})):[]))}};(0,o._)([(0,n.Cb)()],d.prototype,"access",void 0),(0,o._)([(0,n.Cb)({type:Date})],d.prototype,"created",void 0),(0,o._)([(0,n.Cb)()],d.prototype,"description",void 0),(0,o._)([(0,n.Cb)()],d.prototype,"id",void 0),(0,o._)([(0,n.Cb)()],d.prototype,"isInvitationOnly",void 0),(0,o._)([(0,n.Cb)({type:Date})],d.prototype,"modified",void 0),(0,o._)([(0,n.Cb)()],d.prototype,"owner",void 0),(0,o._)([(0,n.Cb)()],d.prototype,"portal",void 0),(0,o._)([(0,n.Cb)()],d.prototype,"snippet",void 0),(0,o._)([(0,n.Cb)()],d.prototype,"sortField",void 0),(0,o._)([(0,n.Cb)()],d.prototype,"sortOrder",void 0),(0,o._)([(0,n.Cb)()],d.prototype,"tags",void 0),(0,o._)([(0,n.Cb)()],d.prototype,"thumbnail",void 0),(0,o._)([(0,n.Cb)({readOnly:!0})],d.prototype,"thumbnailUrl",null),(0,o._)([(0,n.Cb)()],d.prototype,"title",void 0),(0,o._)([(0,n.Cb)({readOnly:!0})],d.prototype,"url",null),d=(0,o._)([(0,u.j)("esri.portal.PortalGroup")],d);const h=d},41253:(t,e,r)=>{r.d(e,{Z:()=>m});var o,s=r(43697),i=r(15923),l=r(35454),n=r(22974),a=r(5600),u=(r(75215),r(52011)),p=r(6570),d=r(82971),h=r(40488);const c=new l.X({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let y=o=class extends i.Z{constructor(t){super(t),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(t){"asc"!==t&&"desc"!==t||this._set("sortOrder",t)}clone(){return new o({categories:this.categories?(0,n.d9)(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(t,e){let r=[];this.categories&&(r=this.categories.map((t=>Array.isArray(t)?JSON.stringify(t):t)));let o="";if(this.extent){const t=(0,h.iV)(this.extent,d.Z.WGS84);null!=t&&(o=`${t.xmin},${t.ymin},${t.xmax},${t.ymax}`)}let s=this.query;!this.disableExtraQuery&&t.extraQuery&&(s="("+s+")"+t.extraQuery);const i={categories:r,bbox:o,q:s,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(i.sortField=this.sortField.split(",").map((t=>c.toJSON(t.trim()))).join(","),i.sortOrder=this.sortOrder),{query:{...e,...i}}}};(0,s._)([(0,a.Cb)()],y.prototype,"categories",void 0),(0,s._)([(0,a.Cb)()],y.prototype,"disableExtraQuery",void 0),(0,s._)([(0,a.Cb)({type:p.Z})],y.prototype,"extent",void 0),(0,s._)([(0,a.Cb)()],y.prototype,"filter",void 0),(0,s._)([(0,a.Cb)()],y.prototype,"num",void 0),(0,s._)([(0,a.Cb)()],y.prototype,"query",void 0),(0,s._)([(0,a.Cb)()],y.prototype,"sortField",void 0),(0,s._)([(0,a.Cb)()],y.prototype,"sortOrder",null),(0,s._)([(0,a.Cb)()],y.prototype,"start",void 0),y=o=(0,s._)([(0,u.j)("esri.portal.PortalQueryParams")],y);const m=y},86082:(t,e,r)=>{r.r(e),r.d(e,{default:()=>c});var o=r(43697),s=r(20102),i=r(96674),l=r(5600),n=(r(75215),r(67676),r(80442),r(52011));let a=class extends i.wq{constructor(t){super(t),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const t=this.get("portal.restUrl");return t?`${t}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new s.Z("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};(0,o._)([(0,l.Cb)({type:Date})],a.prototype,"created",void 0),(0,o._)([(0,l.Cb)()],a.prototype,"id",void 0),(0,o._)([(0,l.Cb)()],a.prototype,"portal",void 0),(0,o._)([(0,l.Cb)()],a.prototype,"title",void 0),(0,o._)([(0,l.Cb)({readOnly:!0})],a.prototype,"url",null),(0,o._)([(0,l.Cb)()],a.prototype,"username",void 0),a=(0,o._)([(0,n.j)("esri.portal.PortalFolder")],a);const u=a;var p,d=r(68916);let h=p=class extends i.wq{constructor(...t){super(...t),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userType=null}get thumbnailUrl(){const t=this.url,e=this.thumbnail;return t&&e?this.portal.normalizeUrl(`${t}/info/${e}?f=json`):null}get userContentUrl(){const t=this.get("portal.restUrl");return t?`${t}/content/users/${this.username}`:null}get url(){const t=this.get("portal.restUrl");return t?`${t}/community/users/${this.username}`:null}addItem(t){const e=t&&t.item,r=t&&t.data,o=t&&t.folder,s={method:"post"};e&&(s.query=e.createPostQuery(),null!=r&&("string"==typeof r?s.query.text=r:"object"==typeof r&&(s.query.text=JSON.stringify(r))));let i=this.userContentUrl;return o&&(i+="/"+("string"==typeof o?o:o.id)),this.portal.request(i+"/addItem",s).then((t=>(e.id=t.id,e.portal=this.portal,e.loaded?e.reload():e.load())))}deleteItem(t){let e=this.userContentUrl;return t.ownerFolder&&(e+="/"+t.ownerFolder),this.portal.request(e+`/items/${t.id}/delete`,{method:"post"}).then((()=>{t.id=null,t.portal=null}))}deleteItems(t){const e=this.userContentUrl+"/deleteItems",r=t.map((t=>t.id));if(r.length){const o={method:"post",query:{items:r.join(",")}};return this.portal.request(e,o).then((()=>{t.forEach((t=>{t.id=null,t.portal=null}))}))}return Promise.resolve(void 0)}fetchFolders(){return this.portal.request(this.userContentUrl??"",{query:{num:1}}).then((t=>{let e;return e=t&&t.folders?t.folders.map((t=>{const e=u.fromJSON(t);return e.portal=this.portal,e})):[],e}))}fetchGroups(){return this.portal.request(this.url??"").then((t=>{let e;return e=t&&t.groups?t.groups.map((t=>{const e=d.default.fromJSON(t);return e.portal=this.portal,e})):[],e}))}fetchItems(t){const e=t??{};let o,s=this.userContentUrl??"";return e.folder&&(s+="/"+e.folder.id),Promise.all([r.e(5235),r.e(9880)]).then(r.bind(r,15235)).then((({default:t})=>{o=t;const r={folders:!1,num:e.num||10,start:e.start||1,sortField:e.sortField||"created",sortOrder:e.sortOrder||"asc"};return this.portal.request(s,{query:r})})).then((t=>{let e;return t&&t.items?(e=t.items.map((t=>{const e=o.fromJSON(t);return e.portal=this.portal,e})),Promise.all(e.map((t=>t.load()))).catch((t=>t)).then((()=>({items:e,nextStart:t.nextStart,total:t.total})))):{items:[],nextStart:-1,total:0}}))}fetchTags(){return this.portal.request(this.url+"/tags").then((t=>t.tags))}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}queryFavorites(t){return this.favGroupId?(this._favGroup||(this._favGroup=new d.default({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(t)):Promise.reject(new s.Z("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}toJSON(){throw new s.Z("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const e=new p;return e.sourceJSON=t,e.read(t),e}};(0,o._)([(0,l.Cb)()],h.prototype,"access",void 0),(0,o._)([(0,l.Cb)({type:Date})],h.prototype,"created",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"culture",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"description",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"email",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"favGroupId",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"fullName",void 0),(0,o._)([(0,l.Cb)({type:Date})],h.prototype,"modified",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"orgId",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"portal",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"preferredView",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"privileges",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"region",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"role",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"roleId",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"sourceJSON",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"thumbnail",void 0),(0,o._)([(0,l.Cb)({readOnly:!0})],h.prototype,"thumbnailUrl",null),(0,o._)([(0,l.Cb)()],h.prototype,"units",void 0),(0,o._)([(0,l.Cb)({readOnly:!0})],h.prototype,"userContentUrl",null),(0,o._)([(0,l.Cb)({readOnly:!0})],h.prototype,"url",null),(0,o._)([(0,l.Cb)()],h.prototype,"username",void 0),(0,o._)([(0,l.Cb)()],h.prototype,"userType",void 0),h=p=(0,o._)([(0,n.j)("esri.portal.PortalUser")],h);const c=h}}]);
|