@arcgis/core 5.0.0-next.5 → 5.0.0-next.7
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/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/020c8913d8e35d63080b.js +1 -0
- package/assets/esri/core/workers/chunks/{c2b47a7dc961863d283f.js → 02e69f0c63d97661da60.js} +1 -1
- package/assets/esri/core/workers/chunks/087973e7c4fea5fcfa5e.js +1 -0
- package/assets/esri/core/workers/chunks/{929ece362604dc301229.js → 17acde0245ecd956306c.js} +1 -1
- package/assets/esri/core/workers/chunks/{8cea114168d849c38b1b.js → 20278683bddc8c2d8136.js} +1 -1
- package/assets/esri/core/workers/chunks/{dc4982b0ac007bd70213.js → 22d6b8102e75bdef204c.js} +1 -1
- package/assets/esri/core/workers/chunks/{3271614322ba4b44fb5a.js → 279366e6b743f9680603.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7c99e9c8d19352af38d.js → 3ac7562ea90f91a9f30c.js} +1 -1
- package/assets/esri/core/workers/chunks/3f3d492f1093b7832aab.js +1 -0
- package/assets/esri/core/workers/chunks/464d42bebb365287808d.js +1 -0
- package/assets/esri/core/workers/chunks/{d570c75a425aa29672c8.js → 4d599008e1ea42321b37.js} +1 -1
- package/assets/esri/core/workers/chunks/{0686243904381ef863dc.js → 53bd8996e8812f1ad7b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{762fe93015b705546188.js → 5bd36dbf46c25bd961c8.js} +1 -1
- package/assets/esri/core/workers/chunks/{b7a17927e14f502006b4.js → 5ea0c62016d56990787b.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ea6985da4eb0107bb9d.js → 5fc7b61f467f1d60a284.js} +1 -1
- package/assets/esri/core/workers/chunks/{a87521ebe632bf783ef4.js → 62a49cfd9a2508950e9f.js} +1 -1
- package/assets/esri/core/workers/chunks/{ec13053af1999701464a.js → 6826fe54562dcdc054d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{309c5f69ea06f3081d83.js → 73487b9d85e726e9c012.js} +1 -1
- package/assets/esri/core/workers/chunks/7413e582bc2b16af6a0f.js +1 -0
- package/assets/esri/core/workers/chunks/{88d942cd25bef74fd50a.js → 7461124454bfb4fb6474.js} +1 -1
- package/assets/esri/core/workers/chunks/{147ad5fdd02f46b6da24.js → 7544316a75dbd981aea6.js} +1 -1
- package/assets/esri/core/workers/chunks/{0f8847f9ae3068833fa4.js → 75bf27271a31e26e1b21.js} +1 -1
- package/assets/esri/core/workers/chunks/{630efe10c871425b6a95.js → 76ae1702fecc7ad7017c.js} +1 -1
- package/assets/esri/core/workers/chunks/{de1f75c907152df7e788.js → 794748fd1edc29a621cd.js} +1 -1
- package/assets/esri/core/workers/chunks/{e1258b6a404e58878c7a.js → 7aaaebbabee27690283c.js} +1 -1
- package/assets/esri/core/workers/chunks/{6a69dafeb7c9ca8a3d84.js → 7c4a63aeead2505d6f02.js} +1 -1
- package/assets/esri/core/workers/chunks/{d84373a6ec94dcfec8c2.js → 88074189fa10c335370b.js} +1 -1
- package/assets/esri/core/workers/chunks/{a8c4fd779e454e4075c4.js → 8833c3d168951be4bf20.js} +1 -1
- package/assets/esri/core/workers/chunks/{85622fe99f4d08afe875.js → 8a314b3790313e6dc5db.js} +1 -1
- package/assets/esri/core/workers/chunks/{b0b2670596d6d8c32b5e.js → 8c056eac35d05d9524b7.js} +1 -1
- package/assets/esri/core/workers/chunks/{1a713dcc9971e1935401.js → 8f56f298e7c1a283f407.js} +1 -1
- package/assets/esri/core/workers/chunks/{dabc5a38a472c9719df9.js → 8ffd4710d168c2fcfd96.js} +1 -1
- package/assets/esri/core/workers/chunks/{1da74aa308ded5748ef5.js → 90250e9239c173aace88.js} +1 -1
- package/assets/esri/core/workers/chunks/90b2b43b8b54c9a1ec35.js +1 -0
- package/assets/esri/core/workers/chunks/90f8b4bda28af43ea019.js +1 -0
- package/assets/esri/core/workers/chunks/{89027f6800e17fab8973.js → 9486032af3e934d85582.js} +1 -1
- package/assets/esri/core/workers/chunks/95c594a87b732f5c4979.js +1 -0
- package/assets/esri/core/workers/chunks/{239377336a2009caea01.js → 99859dce1925b406ccd0.js} +1 -1
- package/assets/esri/core/workers/chunks/{a137c27ce078bea44f89.js → 9e8dceef4c961f56940d.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5b7e7f2860a825ed373.js → 9fac5a12e878cd745354.js} +1 -1
- package/assets/esri/core/workers/chunks/{f779034623980bf9a37c.js → a06bac9b8f9e18874de8.js} +2 -2
- package/assets/esri/core/workers/chunks/{01642fe19e81bfa33eb5.js → a395373e3173e6458a56.js} +1 -1
- package/assets/esri/core/workers/chunks/a3991ae8caa713d4ddcd.js +1 -0
- package/assets/esri/core/workers/chunks/{a6ac1ff89c40f3a4797a.js → a712cdff78fc826acd8c.js} +1 -1
- package/assets/esri/core/workers/chunks/{af3fc2562bb6d217adf6.js → aa54b6f2aba6952af149.js} +1 -1
- package/assets/esri/core/workers/chunks/ac26e3e77df4302f47a2.js +1 -0
- package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
- package/assets/esri/core/workers/chunks/{bc3bcf88b252760e2574.js → b3028b1ff75eafd0c358.js} +1 -1
- package/assets/esri/core/workers/chunks/{5875a51b97ee9bd438a0.js → bc241c7735e4efba734a.js} +1 -1
- package/assets/esri/core/workers/chunks/{56916e56c20465428dd4.js → be3b874f86f627f4fa98.js} +1 -1
- package/assets/esri/core/workers/chunks/c4e4da69969499a89a2c.js +1 -0
- package/assets/esri/core/workers/chunks/c8733cd621105afab2ac.js +1 -0
- package/assets/esri/core/workers/chunks/ccc0da0e01f023c8aa1f.js +1 -0
- package/assets/esri/core/workers/chunks/{c0b7e86860838638537f.js → cd1930f08e1fc8b30b14.js} +1 -1
- package/assets/esri/core/workers/chunks/{551c6c89b51b99f4864b.js → d1fe816b6990918c13c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{8605ec4678eb4511c715.js → d305a21666b1ed5bf33d.js} +1 -1
- package/assets/esri/core/workers/chunks/{037b2548bf85e2d7c6ac.js → d40f57f9fc47f9a9f97c.js} +1 -1
- package/assets/esri/core/workers/chunks/{a29d7205394cb8b2a847.js → d97fadbc69e055d183a0.js} +1 -1
- package/assets/esri/core/workers/chunks/dedc4583b5f32a278124.js +1 -0
- package/assets/esri/core/workers/chunks/{e5bcc44f3dc6fc90835a.js → e5a06ce0ef6a9a90e100.js} +1 -1
- package/assets/esri/core/workers/chunks/f0e0a63962784acb4ba1.js +1 -0
- package/assets/esri/core/workers/chunks/f4d0ae6be1b3984228d0.js +1 -0
- package/assets/esri/core/workers/chunks/{7c5c272612198db83851.js → f5e47eea8720ba84665b.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa4411e0a5ac3fcba365.js → f65c0102af17390a50ac.js} +1 -1
- package/assets/esri/core/workers/chunks/f6c11c8ac687de3ef1ab.js +1 -0
- package/assets/esri/core/workers/chunks/{7596d005a4dc3964b140.js → f6c8beb60f6d29945a2e.js} +1 -1
- package/assets/esri/core/workers/chunks/{a2a284d4dd5caaecbc2e.js → f746e3f7ebff2bbdf333.js} +1 -1
- package/assets/esri/core/workers/chunks/f9324e88c359c03f35aa.js +1 -0
- package/assets/esri/core/workers/chunks/{cfa3164e7fa1884dc2b9.js → facb3886714222772ab2.js} +1 -1
- package/assets/esri/core/workers/chunks/{aa6eb55e4fb57c4e8eeb.js → fd2efd1d1cf9d95a87e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe3f95fda29e4844b153.js → fe77ae6cf232a7a3298e.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ce4a0fe4fae63c43a81.js → ff35a077ac6776469805.js} +1 -1
- package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +14 -4
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/config.js +1 -1
- package/core/Identifiable.js +1 -1
- package/core/MultiOriginJSONSupport.js +1 -1
- package/core/NumericIdentifiable.js +5 -0
- package/core/WriteableMultiOriginJSONMixin.js +5 -0
- package/core/performance.js +5 -0
- package/core/scheduling.js +1 -1
- package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
- package/interfaces.d.ts +18 -2
- package/kernel.js +1 -1
- package/layers/support/MediaElementBase.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/package.json +3 -3
- package/support/basemapDefinitions.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/views/2d/constraints/GeometryConstraint.js +1 -1
- package/views/2d/constraints/RotationConstraint.js +1 -1
- package/views/2d/constraints/ZoomConstraint.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
- package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
- package/views/analysis/ElevationProfile/constants.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/widgets/Attachments/AttachmentsViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/Search/LayerSearchSource.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/assets/esri/core/workers/chunks/0366b78b0ccf4ed5f6ac.js +0 -1
- package/assets/esri/core/workers/chunks/0429c1a3690f20647c9f.js +0 -1
- package/assets/esri/core/workers/chunks/0f100e163e1847e04155.js +0 -1
- package/assets/esri/core/workers/chunks/1eedac33c9fcd7681427.js +0 -1
- package/assets/esri/core/workers/chunks/2f03d33f4ca8a48461fc.js +0 -1
- package/assets/esri/core/workers/chunks/50864c1924030e62497d.js +0 -1
- package/assets/esri/core/workers/chunks/655360995c1cbc78a5a3.js +0 -1
- package/assets/esri/core/workers/chunks/71762199aef5d3107da2.js +0 -1
- package/assets/esri/core/workers/chunks/72c851c400752094b162.js +0 -1
- package/assets/esri/core/workers/chunks/7558919912f7fdc4837b.js +0 -1
- package/assets/esri/core/workers/chunks/829bc5dbda2f51561446.js +0 -1
- package/assets/esri/core/workers/chunks/98311fec6c16a1b23586.js +0 -1
- package/assets/esri/core/workers/chunks/a61cb4f1ca282bf8b75d.js +0 -1
- package/assets/esri/core/workers/chunks/bc6619307f312f9241bf.js +0 -1
- package/assets/esri/core/workers/chunks/bfc1e8aec7aace3ff30e.js +0 -1
- package/assets/esri/core/workers/chunks/c134ebbaeac514cbd657.js +0 -1
- package/assets/esri/core/workers/chunks/c368a8e8d2f1535af446.js +0 -1
- package/assets/esri/core/workers/chunks/d886fb97bdb348a16f25.js +0 -1
- package/assets/esri/core/workers/chunks/e6a86cad44056735ed26.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7677],{563:(e,t,i)=>{i.d(t,{QueueProcessor:()=>c});var s=i(97768),n=i(74887),r=i(9775),o=i(32587),l=i(96211),a=i(44794);class c{constructor(e){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,a.v)(!1),this.concurrency=1,this.process=e.process,this.concurrency=e.concurrency,this._queue=new r.A(e.peeker)}destroy(){this.clear(),this._schedule=(0,s.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}abort(e){const t=this._controllers.get(e);t?.abort()}clear(){this._queue.clear();const e=Array.from(this._controllers.values());this._controllers.clear(),e.forEach(e=>e.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((t,i)=>e(i))}_get(e){const t=this._deferreds.get(e);return t?.promise}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const i=this._get(e);if(i)return i;const s=new AbortController,r=(0,n.Tw)(),o=t?(0,n.u7)(t,()=>s.abort()):null,l=(0,n.NY)(s.signal,()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),a(),r.reject((0,n.NK)())}),a=()=>{l.remove(),o?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()};return this._deferreds.set(e,r),this._controllers.set(e,s),r.promise.then(a,a),this._queue.push(e),this._scheduleNext(),r.promise}last(){return this._queue.last()}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.delete(e)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,l._)(()=>{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const i=new AbortController,s=new u(e,i);this._processingItems.set(e,s);try{t=this.process(e,i.signal)}catch(e){this._processError(s,e)}(0,n.$X)(t)?(s.promise=t,t.then(e=>this._processResult(s,e),e=>this._processError(s,e))):this._processResult(s,t)}}class u{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}},4916:(e,t,i)=>{i.d(t,{A:()=>N});var s=i(31635),n=i(78888),r=i(49186),o=i(25482),l=i(53966),a=i(74887),c=i(563),u=i(10107),h=i(56507),d=(i(44208),i(87811),i(64108)),p=i(5443),f=i(86738),m=i(16930),g=i(60694),y=i(10873),x=i(45617),_=i(91806),w=i(20223),b=i(87045),v=i(76353),I=i(77301),R=i(70834);const S=new Map,C=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,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const n=this._cachedBlocks,r=e+"/"+t;if(n.has(r)){const e=n.get(r);e.ts=Date.now(),e.refCount++}else n.set(r,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}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 s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][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 k(e,t,i){const s=S.get(e);if(!s)return null==t?C.decreaseRefCount(e,i):0;if(null==t||null==s[t])return C.decreaseRefCount(e,i);const n=s[t]?.cache,r=n?.get(i);if(n&&r){if(r.refCount--,0===r.refCount){n.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);r.controller&&r.controller.abort()}return r.refCount}return 0}function M(e,t,i){const s=S.get(e);if(!s)return null==t?C.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return C.getBlock(e,i)}const n=s[t]?.cache.get(i);if(n)return n.refCount++,n.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const n=s[e]?.cache,r=n?.get(i);if(n&&r)return r.refCount++,n.set(i,r),r.block}return null}function T(e,t,i,s,n=null){const r=S.get(e);if(!r)return void(null==t&&C.putBlock(e,i,s,n));if(null==t||null==r[t])return void C.putBlock(e,i,s,n);const o={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:n};s.then(()=>o.isResolved=!0).catch(()=>o.isRejected=!0),r[t]?.cache.set(i,o)}function A(e,t,i){const s=S.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):C.deleteBlock(e,i):null==t&&C.deleteBlock(e,i)}var z=i(16019),F=i(77649),P=i(28435),B=i(14636);let D=0,N=class extends o.o{constructor(){super(...arguments),this._tileFetchQueue=new c.QueueProcessor({concurrency:32,process:(e,t)=>this.fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:b.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,R.FT)(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),(0,v.qg)(this)&&this.primaryRasters?.rasters?.forEach(t=>t.rasterJobHandler=e)}get rasterId(){return this.url||"rasterId-"+D++}set url(e){this._set("url",(0,g.Jf)(e,l.A.getLogger(this)))}async open(e){return this._openPromise??=(0,R.Hh)().then(()=>this._open(e)),this._openPromise}async fetchTile(e,t,i,s={}){const n=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,o=this.getTileExtentFromTileInfo(e,t,i,n);if(!o)throw new r.A("imagery-tile:out-of-bounds","Level for fetch tile out of range");return s={noClip:!0,...s},this.fetchPixels(o,n.size[0],n.size[1],s)}async identify(e,t={}){e=(0,h.PZ)(f.A,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{rasterInfo:n}=this,{hasMultidimensionalTranspose:r,multidimensionalInfo:o}=n;let{transposedVariableName:l}=t;const a=null!=o&&r&&(null!=s||(0,I.DY)(i));a&&!l&&(l=null!=i&&i.length>0?i[0].variableName??void 0:o.variables[0].name,t={...t,transposedVariableName:l}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=n,{datumTransformation:d}=t;let m=(0,R._I)(e,c,d);if(!u.intersects(m))return{location:m,value:null};if(null!=n.transform){const e=n.transform.inverseTransform(m);if(!n.nativeExtent.intersects(e))return{location:e,value:null};m=e}let g=0;const y=null!=l&&null!=o&&n.hasMultidimensionalTranspose;if((0,v.qg)(this)){const e=this.primaryRasters.rasters[0];if(y)return e.identify(m,t);const{pixelSize:s}=n,r=3,o=s.x*r/2,l=s.y*r/2,a=new p.A({xmin:m.x-o,xmax:m.x+o,ymin:m.y-l,ymax:m.y+l,spatialReference:c}),u={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId,bandIds:t.bandIds},{pixelBlock:h}=await e.fetchPixels(a,r,r,u),{pixelBlock:d}=await this.fetchPixels(a,r,r,u);if(null==h)return{location:m,value:null};const f=Math.floor(r*r*.5),g=!h.mask||h.mask[f]?h.pixels.map(e=>e[f]):null;let x;return null!=d&&(x=!d.mask||d.mask[f]?d.pixels.map(e=>e[f]):void 0),{location:m,value:g,processedValue:x,pyramidLevel:0}}if(!y)if(t.srcResolution)g=(0,R.t$)(t.srcResolution,n,this.ioConfig.sampling).pyramidLevel;else if(g=await this.computeBestPyramidLevelForLocation(e,t),null==g)return{location:m,value:null};const x=this.identifyPixelLocation(m,g,null,y);if(null===x)return{location:m,value:null};const{row:_,col:w,rowOffset:b,colOffset:S,blockWidth:C}=x,k=await this._fetchRawTile(g,_,w,t);if(!k?.pixels?.length)return{location:m,value:null};const M=b*C+S;return this._processIdentifyResult(k,{srcLocation:m,position:M,pyramidLevel:g,useTransposedTile:!!y,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,s={}){e=(0,R.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:n}=this;if(s.requestRawData&&n)return this._fetchPixels(e,t,i,s);const r=(0,R.FT)(e.spatialReference),o=(0,R.OM)(e);if(null==r||0===o||1===o&&this._isGlobalWrappableSource&&n)return this._fetchPixels(e,t,i,s);if(o>=3)return{extent:e,pixelBlock:null};const l=[],{xmin:a,xmax:c}=e,u=Math.round(r/(c-a)*t),h=u-Math.round((r/2-a)/(c-a)*t);let d=0;const f=[];for(let n=0;n<=o;n++){const m=new p.A({xmin:0===n?a:-r/2,xmax:n===o?c-r*n:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),g=0===n?u-h:n===o?t-d:u;d+=g,f.push(g);const y=s.disableWrapAround&&n>0?null:this._fetchPixels(m,g,i,s);l.push(y)}const m=(await Promise.all(l)).map(e=>e?.pixelBlock);let g=null;const y={width:t,height:i};return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},s)).pixelBlock:(0,P.z7)(m,y,{blockWidths:f}),{extent:e,srcExtent:(0,R._l)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:g}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const n=await this._fetchRawTiles(e,t,i,s),{nativeExtent:r,nativePixelSize:o,storageInfo:l}=this.rasterInfo,a=2**e,c=o.x*a,u=o.y*a,h=new p.A({xmin:r.xmin+c*t.x,xmax:r.xmin+c*(t.x+i.width-1),ymin:r.ymax-u*(t.y+i.height-1),ymax:r.ymax-u*t.y,spatialReference:r.spatialReference});if(!n)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:d,mosaicSize:f}=n;if(1===d.length&&null!=d[0]&&d[0].width===i.width&&d[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:n.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,g=e>0?l.pyramidBlockHeight:l.blockHeight,y={x:t.x%m,y:t.y%g};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:f,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,P.z7)(d,f,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:x}}fetchRawTile(e,t,i,s){throw new r.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,R._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,F.D)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:r,query:o,headers:l}=t;i=i??t.retryCount??this.ioConfig.retryCount;const a=r?{Range:`bytes=${r.from}-${r.to}`}:null;try{return await(0,n.A)(e,{...t,query:{...o,...s},headers:{...l,...a}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,I.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const n=s.lodAt(e);return n?this.getTileExtent({x:n.resolution,y:n.resolution},t,i,s.origin,s.spatialReference,s.size):null}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo,{pyramidResolutions:n}=e;if(!e.tileInfo){const r=[],o=e.maximumPyramidLevel||0;let l=(s.x+s.y)/2,a=1/.0254*96*l;for(let e=0;e<=o&&(r.unshift(new _.A({level:o-e,resolution:l,scale:a})),e!==o);e++)if(n){const t=(n[e].x+n[e].y)/2;a*=t/l,l=t}else l*=2,a*=2;const c=new f.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new b.A({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:n,height:r,nativeExtent:o,pixelSize:l,spatialReference:a}=e,c=new f.A({x:o.xmin,y:o.ymax,spatialReference:a});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(n,r))/Math.LN2-8)));const u=this.computeBlockBoundary(o,512,512,{x:o.xmin,y:o.ymax},[l],s);e.storageInfo=new w.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,n,r=0,o=2){if(1===n.length&&r>0){n=[...n];let{x:e,y:t}=n[0];for(let i=0;i<r;i++)e*=o,t*=o,n.push({x:e,y:t})}const l=[],{x:a,y:c}=s;for(let s=0;s<n.length;s++){const{x:r,y:o}=n[s];l.push({minCol:Math.floor((e.xmin-a+.1*r)/t/r),maxCol:Math.floor((e.xmax-a-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return l}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const n=s**e;return{x:t.x*n,y:t.y*n}}identifyPixelLocation(e,t,i,s){const{spatialReference:n,nativeExtent:r,storageInfo:o}=this.rasterInfo,{maximumPyramidLevel:l,origin:a,transposeInfo:c}=o,u=s&&null!=c?c.tileSize[0]:o.blockWidth,h=s&&null!=c?c.tileSize[1]:o.blockHeight,d=(0,R._I)(e,n,i);if(!r.intersects(d))return null;if(t<0||t>l)return null;const p=this.getPyramidPixelSize(t),{x:f,y:m}=p,g=(a.y-d.y)/m/h,y=(d.x-a.x)/f/u,x=Math.min(h-1,Math.floor((g-Math.floor(g))*h)),_=Math.min(u-1,Math.floor((y-Math.floor(y))*u));return{pyramidLevel:t,row:Math.floor(g),col:Math.floor(y),rowOffset:x,colOffset:_,blockWidth:u,srcLocation:d}}getTileExtent(e,t,i,s,n,r){const[o,l]=r,a=s.x+i*o*e.x,c=a+o*e.x,u=s.y-t*l*e.y,h=u-l*e.y;return new p.A({xmin:a,xmax:c,ymin:h,ymax:u,spatialReference:n})}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 s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}updateImageSpaceRasterInfo(e){const{pixelSize:t}=e,{width:i,height:s}=e,n=m.A.WebMercator;e.spatialReference=n,e.extent=e.nativeExtent=new p.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:n}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new f.A({x:1,y:1,spatialReference:n});const{extent:r,storageInfo:o}=e;if(o){o.origin=new f.A({x:r.xmin,y:r.ymax,spatialReference:n});const{pyramidResolutions:i,tileInfo:s}=o;if(i&&i.forEach(e=>{e.x/=t.x,e.y/=t.y}),s){s.origin=o.origin;const t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;s.lods.forEach((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254})}}}async _fetchPixels(e,t,i,s={}){let n=(0,R.OM)(e);if(n>=2)return{extent:e,pixelBlock:null};const r=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:o,srcResolution:l,srcExtent:a,srcWidth:c,srcHeight:u,ul:h}=r;if(0===c||0===u)return{extent:e,srcExtent:a,pixelBlock:null};const{rasterInfo:d}=this,p=d.transform,m="gcs-shift"===p?.type,g=null!=(0,R.FT)(e.spatialReference);!m&&g||(n=(0,R.OM)(r.srcExtent,m));const y=await this._fetchRawTiles(o,h,{width:c,height:u,wrapCount:n},s);if(!y)return{extent:e,srcExtent:a,pixelBlock:null};const x=d.storageInfo,_=o>0?x.pyramidBlockWidth:x.blockWidth,w=o>0?x.pyramidBlockHeight:x.blockHeight;let{x:b,y:v}=d.pixelSize;if(o>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=x;if(null!=e&&e[o-1])({x:b,y:v}=e[o-1]);else{const e=t**o;b*=e,v*=e}}const I=d.spatialReference,S=new f.A({x:b,y:v,spatialReference:I}),C=_===c&&w===u&&h.x%_===0&&h.y%w===0,k=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),M=!e.spatialReference.equals(I),T=I.isGeographic?1e-9:1e-4,{datumTransformation:A}=s;if(!M&&C&&1===y.pixelBlocks.length&&_===t&&w===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(l,k,T))return{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:y.pixelBlocks[0]};const z=g&&null!=(0,R.FT)(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,F=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");F&&!this.rasterJobHandler&&await(0,R.Hh)();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k.toJSON(),datumTransformation:A,rasterTransform:p,hasWrapAround:n>0||z,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:F},s):(0,R.l0)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k,datumTransformation:A,rasterTransform:p,hasWrapAround:n>0||z,isAdaptive:!1,includeGCSGrid:F});let N;const J=!s.requestRawData,O={rows:D.spacing[0],cols:D.spacing[1]},H=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(o,y.extent.xmin):void 0,{pixelBlocks:E,mosaicSize:L,isPartiallyFilled:q}=y;let Z=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:E,srcMosaicSize:L,destDimension:J?{width:t,height:i}:null,coefs:J?D.coefficients:null,sampleSpacing:J?O:null,projectDirections:F,gcsGrid:F?D.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:H,blockWidths:null},s);({pixelBlock:N,localNorthDirections:Z}=e)}else{const e=(0,P.z7)(E,L,{alignmentInfo:H});N=J?(0,P.$i)(e,{width:t,height:i},D.coefficients,O,s.interpolation):e,F&&D.gcsGrid&&(Z=(0,P.QF)({width:t,height:i},D.gcsGrid),N=(0,B.Y2)(N,this.rasterInfo.dataType,Z))}return s.requestRawData||F?{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N,transformGrid:D,localNorthDirections:Z,isPartiallyFilled:q}:{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N}}async _fetchRawTiles(e,t,i,s){const{origin:n,blockBoundary:r}=this.rasterInfo.storageInfo,{blockWidth:o,blockHeight:l}=this.getBlockWidthHeight(e);let{x:a,y:c}=t,{width:u,height:h,wrapCount:d}=i;const f=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(a-=s.buffer.cols,c-=s.buffer.rows,u+=2*s.buffer.cols,h+=2*s.buffer.rows);let m=0,g=0,y=0;d&&null!=f&&(({worldColumnCountFromOrigin:g,originColumnOffset:y,rightPadding:m}=f),g*f.blockWidth-m>=a+u&&(m=0));const x=Math.floor(a/o),_=Math.floor(c/l),w=Math.floor((a+u+m-1)/o),b=Math.floor((c+h+m-1)/l),v=r[e];if(!v)return null;const{minRow:I,minCol:R,maxCol:S,maxRow:C}=v;if(0===d&&(b<I||w<R||_>C||x>S))return null;const k=new Array;let M=!1;const T=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=_;t<=b;t++)for(let i=x;i<=w;i++){let n=i;if(!s.disableWrapAround&&d&&null!=f&&g<=i&&(n=i-g-y),t>=I&&n>=R&&C>=t&&S>=n){const i=this._fetchRawTile(e,t,n,s);T?k.push(new Promise(e=>{i.then(t=>e(t)).catch(()=>{M=!0,e(null)})})):k.push(i)}else k.push(Promise.resolve(null))}if(0===k.length)return null;const A=await Promise.all(k),z={height:(b-_+1)*l,width:(w-x+1)*o},{spatialReference:F}=this.rasterInfo,P=this.getPyramidPixelSize(e),{x:B,y:D}=P;return{extent:new p.A({xmin:n.x+x*o*B,xmax:n.x+(w+1)*o*B,ymin:n.y-(b+1)*l*D,ymax:n.y-_*l*D,spatialReference:F}),pixelBlocks:A,mosaicSize:z,isPartiallyFilled:M}}_fetchRawTile(e,t,i,s){const{storageInfo:n}=this.rasterInfo,r=null!=n.transposeInfo&&!!s.transposedVariableName;if(!r){const s=n.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:r,minCol:o,maxCol:l,maxRow:a}=s;if(t<r||i<o||t>a||i>l)return Promise.resolve(null)}const o=r?s.transposeVariableName:s.sliceId,l=n.isBsqTile?s.bandIds:null,c=function(e,t,i){const s=[];return null!=t&&s.push(`sliceId=${t}`),null!=i&&s.push(`bandIds=${i.join(",")}`),s.length?`${e}?${s.join("&")}`:e}(this.rasterId,o,l),u=`${e}/${t}/${i}`;let h=M(c,s.registryId,u);if(null==h){const r=new AbortController,o=s.bandIds?.slice();if(o?.length&&n.isBsqTile){const n=new Set(o),l=[],a=Array.from(n);for(const n of o)l.push(this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:{...s,bandIds:[n]}},{signal:r.signal}));h=Promise.all(l).then(e=>{if(e.some(e=>null==e))return null;if(a.length!==o.length){const t=[];for(const i of o){let s=e[a.indexOf(i)];t.includes(s)&&(s=s.clone()),t.push(s)}e=t}return this.rasterJobHandler?this.rasterJobHandler.compositeBands({pixelBlocks:e},{signal:r.signal,transferPixelsToWorker:!0}):(0,P.Wy)(e)})}else h=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:s},{signal:r.signal});T(c,s.registryId,u,h,r),h.catch(()=>A(c,s.registryId,u))}return s.signal&&(0,a.u7)(s,()=>{k(c,s.registryId,u)}),h}_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 s=e[0].length;if("vector-magdir"===i){const t=e[1].map(e=>(e+360)%360);return[e[0],t]}const[n,r]=e,o=[],l=[];for(let e=0;e<s;e++){const[t,i]=(0,B.Lu)([n[e],r[e]]);o.push(t),l.push(i)}return[o,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,R.DO)(this.rasterInfo)),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const n={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};s.srcResolution&&(n.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,n));const r=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:o,srcHeight:l,pyramidLevel:a}=n,c=o/t,u=l/i,h=a<r&&c*u>=16,d=a===r&&this._requireTooManySrcTiles(o,l,t,i);if(h||d||0===o||0===l){const o=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=(0,R.Wo)(o,this.rasterInfo.spatialReference,e,n.datumTransformation);const d=!l||s.srcResolution&&l.x+l.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&d){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(r-a+3>=e){const t=2**e;l={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}l&&(n.srcResolution=l,this._updateSourceDataInfo(e,n))}return this._requireTooManySrcTiles(n.srcWidth,n.srcHeight,t,i)&&(n.srcWidth=0,n.srcHeight=0),n}_requireTooManySrcTiles(e,t,i,s){const{tileInfo:n}=this.rasterInfo.storageInfo,r=e/i,o=t/s;return Math.ceil(e/n.size[0])*Math.ceil(t/n.size[1])>=256*Math.max(1,(i+s)/1024)||r>8||o>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,s=i.spatialReference,{srcResolution:n,datumTransformation:r}=t,{pyramidLevel:o,pyramidResolution:l,excessiveReading:a}=(0,R.t$)(n,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,R._l)(e,s,r);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{origin:h}=i.storageInfo,{width:d,height:p,ul:f}=(0,v.$g)(c,h,l,o);t.pyramidLevel=o,t.pyramidResolution=l,t.srcWidth=d,t.srcHeight=p,t.ul=f}_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:s,pyramidLevel:n,useTransposedTile:r}=t,o=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(null==l||!r){const t=e.pixels.map(e=>e[s]),r={location:i,value:t,pyramidLevel:n},o=this._computeMagDirValues(t.map(e=>[e]));return o?.length&&(r.magdirValue=o.map(e=>e[0])),r}let a=e.pixels.map(e=>e.slice(s*o,s*o+o)),c=this._computeMagDirValues(a);const{requestSomeSlices:u,identifyOptions:h}=t;let d=(0,I.QW)(l,h.transposedVariableName);if(u){const e=(0,I.xx)(d,h.multidimensionalDefinition,h.timeExtent);a=a.map(t=>e.map(e=>t[e])),c=c?.map(t=>e.map(e=>t[e])),d=e.map(e=>d[e])}const p=e.noDataValues||this.rasterInfo.noDataValue,f={pixels:a,pixelType:e.pixelType};let m;return null!=p&&((0,z.Sp)(f,p),m=f.mask),{location:i,value:null,dataSeries:d.map((e,t)=>{const i={value:0===m?.[t]?null:a.map(e=>e[t]),multidimensionalDefinition:e.multidimensionalDefinition.map(e=>new x.A({...e,isSlice:!0}))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i}),pyramidLevel:n}}};(0,s.Cg)([(0,u.MZ)()],N.prototype,"_rasterTileAlignmentInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"_tileFetchQueue",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"_isGlobalWrappableSource",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s.Cg)([(0,u.MZ)()],N.prototype,"_openPromise",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"rasterJobHandler",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"rasterId",null),(0,s.Cg)([(0,u.MZ)(y.OZ)],N.prototype,"url",null),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],N.prototype,"datasetName",void 0),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],N.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"rasterInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"ioConfig",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"sourceJSON",void 0),N=(0,s.Cg)([(0,d.$)("esri.layers.support.rasterDatasets.BaseRaster")],N)},32587:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(62788),n=i(95488);class r{constructor(e){this._observable=new n.I,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,s.gc)(this._observable),this._map.entries()}forEach(e,t){(0,s.gc)(this._observable),this._map.forEach((i,s)=>e.call(t,i,s,this),t)}get(e){return(0,s.gc)(this._observable),this._map.get(e)}has(e){return(0,s.gc)(this._observable),this._map.has(e)}keys(){return(0,s.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,s.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,s.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},44794:(e,t,i)=>{i.d(t,{v:()=>l});var s=i(4718),n=i(62788),r=i(95488);class o{constructor(e,t){this._observable=new r.I,this._value=e,this._equalityFunction=t}get value(){return(0,n.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function l(e,t=s.gh){return new o(e,t)}},50103:(e,t,i)=>{function s(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=s(e,i);for(let e=0;e<r.length;e++)s(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 n(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 r=s(e,i);return r.length>0?t?n(r[0],t):r[0]:null}function r(e,t=null){const i=t?n(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function o(e,t){const i=s(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}function l(e,t=null){const i=r(e,t);return i?.split(" ").map(e=>Number(e))??[]}function a(e,t){return o(e,t).map(e=>Number(e))}function c(e,t){const i=r(e,t);return Number(i)}function u(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}function h(e){return e.nodeName.slice(e.nodeName.lastIndexOf(":")+1)}i.d(t,{Dy:()=>o,IC:()=>s,Ui:()=>a,V6:()=>n,g7:()=>u,mX:()=>r,pN:()=>l,v7:()=>c,vv:()=>h})},72802:(e,t,i)=>{i.d(t,{U:()=>n});var s=i(19419);class n{constructor(e,t,i,n=(0,s.vt)()){this._level=e,this._row=t,this._col=i,this.extent=n}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new n(e.level,e.row,e.col,e.extent)}}},84169:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(31635),n=i(49186),r=i(10107),o=(i(44208),i(53966),i(87811),i(64108)),l=i(39829),a=i(4916),c=i(77359),u=i(28435),h=i(70834),d=i(22671);let p=class extends a.A{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(e,t,i,s={}){const{rasters:n,rasterIds:r}=this.primaryRasters;let o=!1;const{interpolation:l}=s,a=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&a&&(o=1===n.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:o}),s.requestRawData&&n.length>1&&!this.hasUniqueSourceStorageInfo&&(o=!1,s={...s,requestRawData:!1});const h=n.map(n=>n.fetchPixels(e,t,i,s)),d=await Promise.all(h),p=d.map(e=>e.pixelBlock),f=o||s.requestRawData?d.map(e=>e.srcTilePixelSize):null;if(s.skipRasterFunction||p.every(e=>null==e))return d[0];const m=d.find(e=>null!=e.pixelBlock)?.extent??e;let g=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:f,primaryRasterIds:r});const{transformGrid:y}=d[0];if(!o||null==g||null==y){const e=s.noClip?null:this.getClippingGeometry(m.spatialReference);return!s.noClip&&null!=g&&e&&(g=await(0,c.$Q)(g,m,e)),{...d[0],pixelBlock:g}}const x={rows:y.spacing[0],cols:y.spacing[1]};let _;_=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[g],srcMosaicSize:{width:g.width,height:g.height},destDimension:{width:t,height:i},coefs:y.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:(0,u.$i)(g,{width:t,height:i},y.coefficients,x,l);const w=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||null==_||null==w||(_=await(0,c.$Q)(_,e,w)),{extent:e,srcExtent:d[0].srcExtent,pixelBlock:_}}getClippingGeometry(e){const t=this._clippingGeometry.get("0");if(!e||!t)return t;const i=function(e){return String(e.wkid??e.wkt??e.wkt2)}(e);let s=this._clippingGeometry.get(i);return null!=s||(s=e.equals(t.spatialReference)?t:(0,h.uk)(t,e),this._clippingGeometry.set(i,s)),s}async _open(e){const{rasterFunction:t}=this;t.isRoot=!0,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:s}=this.primaryRasters,r=i.map(t=>t.rasterInfo?void 0:t.open(e));await Promise.all(r);const o=i.map(({rasterInfo:e})=>e),l=t.bind({rasterInfos:o,rasterIds:s});if(t.rawSourceRasterInfos=o,!l.success||0===o.length)throw new n.A("raster-function:open",`cannot bind the function: ${l.error??""}`);const a="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===a?.functionName&&(t.rasterInfo.attributeTable=d.A.fromJSON(a.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every(e=>function(e,t){const{storageInfo:i,pixelSize:s,spatialReference:n,extent:r}=e,{storageInfo:o,pixelSize:l,spatialReference:a,extent:c}=t;return s.x===l.x&&s.y===l.y&&n.equals(a)&&r.equals(c)&&i.blockHeight===o.blockHeight&&i.blockWidth===o.blockWidth&&i.maximumPyramidLevel===o.maximumPyramidLevel&&i.firstPyramidLevel===o.firstPyramidLevel&&i.pyramidBlockWidth===o.pyramidBlockWidth&&i.pyramidBlockHeight===o.pyramidBlockHeight&&i.pyramidScalingFactor===o.pyramidScalingFactor}(e,c)),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let t=e?.clippingGeometry;if(t&&"inside"===e.clippingType){const{extent:e}=this.rasterInfo,s=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),n=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(3054)]).then(i.bind(i,93054));let r=s.execute(l.A.fromExtent(e),2*(e.width+e.height)/40);r=(0,h.uk)(r,t.spatialReference),t=n.execute(r,t)}this._clippingGeometry.clear(),t&&this._clippingGeometry.set("0",t)}};(0,s.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],p.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"tileType",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"rasterFunction",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"primaryRasters",void 0),p=(0,s.Cg)([(0,o.$)("esri.layers.support.rasterDatasets.FunctionRaster")],p)},87045:(e,t,i)=>{i.d(t,{A:()=>w});var s,n=i(31635),r=i(66552),o=i(25482),l=i(83047),a=i(10107),c=i(56507),u=(i(44208),i(87811),i(36005)),h=i(64108),d=i(43937),p=i(86738),f=i(16930),m=i(21325),g=i(28735),y=i(91806),x=i(72802);const _=new r.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let w=class extends o.o{static{s=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:n=256,spatialReference:r=f.A.WebMercator,numLODs:o=24}=e;if(!(0,m.fn)(r)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new y.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new y.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new p.A(0,0,r),size:[n,n],spatialReference:r})}const a=(0,m.Vp)(r),c=e.origin?new p.A({x:e.origin.x,y:e.origin.y,spatialReference:r}):new p.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),u=1/(39.37*(0,l.GA)(r)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*u;h.push(new y.A({level:e,scale:t,resolution:s}))}else{let e=(0,m.EA)(r)?512/n*591657527.5917094:256/n*591657527.591555;const i=Math.ceil(o/t);h.push(new y.A({level:0,scale:e,resolution:e*u}));for(let s=1;s<i;s++){const i=e/2**t,n=i*u;h.push(new y.A({level:s,scale:i,resolution:n})),e=i}}return new s({dpi:96,lods:h,origin:c,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,m.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return p.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const s=[],n=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{s.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,n[e.level]=e})),this._set("scales",s),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;s<i;s++){const i=t[s],n=t[s+1];if(i<=e)return s;if(n===e)return s+1;if(i>e&&n<e)return s+Math.log(i/e)/Math.log(i/n)}return s}tileAt(e,t,i,s){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=i;else if((0,m.aI)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,s=i;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,s=i}const l=n.resolution*this.size[0],a=n.resolution*this.size[1];return s??=new x.U(0,0,0),s.level=e,s.row=Math.floor((this.origin.y-o)/a+.001),s.col=Math.floor((r-this.origin.x)/l+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;const s=e.level-i.level,n=i.resolution*this.size[0]/2**s,r=i.resolution*this.size[1]/2**s;return e.extent[0]=this.origin.x+e.col*n,e.extent[1]=this.origin.y-(e.row+1)*r,e.extent[2]=e.extent[0]+n,e.extent[3]=e.extent[1]+r,!0}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:s}=i,n=s*this.size[0],r=s*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return s.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],n=this.lods.length-t;for(let e=0;e<n;e++){const s=e+t,{scale:n,resolution:r}=s>=0?this.lods[s]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new y.A({level:e,scale:n,resolution:r}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const s=e[i];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};(0,n.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,n.Cg)([(0,a.MZ)({type:p.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,n.Cg)([(0,u.w)("origin")],w.prototype,"readOrigin",null),(0,n.Cg)([(0,a.MZ)({type:[y.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,n.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,n.Cg)([(0,u.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,n.Cg)([(0,d.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],w.prototype,"writeSize",null),(0,n.Cg)([(0,a.MZ)({type:f.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=s=(0,n.Cg)([(0,h.$)("esri.layers.support.TileInfo")],w)},89015:(e,t,i)=>{i.d(t,{o:()=>N});var s=i(31635),n=i(78888),r=i(49186),o=i(53966),l=i(10107),a=i(56507),c=(i(44208),i(87811),i(93223)),u=i(36005),h=i(64108),d=i(86738),p=i(16930),f=i(21325),m=i(60694),g=i(10873),y=i(45617),x=i(43577),_=i(13868),w=i(22796),b=i(87045),v=i(76353),I=i(84169),R=i(77301),S=i(77359),C=i(6049),k=i(70834),M=i(6952),T=i(12711),A=i(85676),z=i(94359),F=i(22048),P=i(49410),B=i(34606),D=i(51508);const N=e=>{const t=e;let N=class extends t{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=(0,v.qg)(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,m.Jf)(e,o.A.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find(({name:t})=>t===e);return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const s=t?.layerDefinition?.drawingInfo?.renderer;return(0,z.LF)(s,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,a.PZ)(F.A,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:o}=i;if(!s.spatialReference.equals(o)){await(0,k.Hh)();const e="extent"===s.type?(0,k._l)(s,o):(0,k.uk)(s,o);if(null==e)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");n=e}const l=e.pixelSize??new d.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=(0,S.b7)(i,n,l),p=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const f=await(0,S.$Q)(p.pixelBlock,c,n),m=this._rasterJobHandler;return m?m.computeStatisticsHistograms({pixelBlock:f},t):(0,M.eH)(f)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,R.XU)({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:s}=this.raster,n=(0,R.ct)(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),r=n?.name,o=(0,T.m7)(s,r);return this._updateSymbolizer(t,i,r,o)}async applyRenderer(e,t,i){const s=e?.pixelBlock;if(!(null!=s&&s.pixels&&s.pixels.length>0))return null;await this.updateRenderer();const n=this.bandIds??[],{pixelBlock:r}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:n,symbolizer:this.symbolizer},i);return r}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&(0,v.qg)(t)){const i=t.rasterFunction.rawInputBandIds;e=e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):i}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}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 s=(0,f.Vp)(e);return b.A.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,s={}){if(J(this),s.requestAsImageElement){const r=this.getTileUrl(e,t,i);return(0,n.A)(r,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then(e=>e.data)}const{serviceRasterInfo:r}=this;if(null!=r.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const n=s.tileInfo||r.storageInfo.tileInfo,o=this.raster.getTileExtentFromTileInfo(e,t,i,n);if(o)return{extent:o,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,s)}async fetchPixels(e,t,i,s={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i);const n=await this.raster.fetchPixels(e,t,i,s);return s.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(n.pixelBlock=n.pixelBlock?.extractBands(s.bandIds)),n}async getSamples(e,t){if(await this.load(),(e=(0,a.PZ)(B.A,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new r.A("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const i=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:i},n=(await this._getSampleLocations(e)).map(e=>this.identify(e,s).then(t=>(t.location=e,t))),o=(await Promise.all(n)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new D.A({samples:o})}async identify(e,t={}){await this.load();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&(!s.hasMultidimensionalTranspose||!(0,R.DY)(t.multidimensionalDefinition)&&!t.transposedVariableName)&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null};const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new r.A("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let o;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=(0,v.qg)(i)?this.getRawDisplayBandIds():this.bandIds;o=e?.length?e:void 0}return i.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.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((0,R.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,R.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,R.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,v.qg)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;J(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,(0,v.qg)(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:s,type:n}=t;if("multipoint"===n)return t.points.map(e=>new d.A({x:e[0],y:e[1],spatialReference:s}));if("polyline"===n){let n=t;if(e.sampleCount||e.sampleDistance){const s=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),r=(await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(4929)]).then(i.bind(i,965))).execute(t,{unit:"meters"}),o=Math.min(e.sampleCount||100,1e3);let l=e.sampleDistance;l||(l=r/(o+(2===n.paths[0].length?1:0))),n=s.execute(t,l,{unit:"meters"})}return n.paths.flatMap(e=>e.map(e=>new d.A({x:e[0],y:e[1],spatialReference:s})))}const r=Math.min(e.sampleCount||100,1e3),o="extent"===t.type,l=o?t:t.extent,a=Math.sqrt(l.width*l.height/r),c=l.height/a,u=l.width/a,{xmin:h,ymax:p}=l,f=[];for(let e=0;e<c;e++)for(let i=0;i<u;i++){const n=new d.A({x:h+(i+.5)*a,y:p-(e+.5)*a,spatialReference:s});(o||t.contains(n))&&f.push(n)}return f}_configDefaultInterpolation(){if(null==this.interpolation){J(this);const{raster:e}=this,t=(0,T.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){J(this);const{rasterInfo:t}=this.raster,i=(0,R.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=(0,T.I8)({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??(0,T.ci)(t)),!this.renderer||"override"===e){const e=(0,T.Mm)(this.raster),i=n?.renderer??(0,T.PD)(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,l=o?.max??0,a=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(l>1e24||a<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const r=(0,T.$P)({...this.renderer.toJSON(),variableName:s}),l=(0,T.m7)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=r,this.symbolizer.rasterInfo=l):this.symbolizer=new A.A({rendererJSON:r,rasterInfo:l});const a=this.symbolizer.bind();if(a.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,T.PD)(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.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else o.A.getLogger(this).warn("imagery-tile-mixin",a.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&(0,v.qg)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",w.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,v.qg)(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:s}=this;if(s){const i={raster:t};e.length>1&&e.forEach(e=>i[e.url]=e);const n=(0,C.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),r=new I.A({rasterFunction:n});r.rasterJobHandler=this._rasterJobHandler,await r.open(),this.raster=r}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!s)return;const{bandIds:n}=this,{bandCount:r}=this.raster.rasterInfo,o=n?.length?n.some(e=>e>=r):r>=3;n&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,s=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),n=(i.pixelSize.x+i.pixelSize.y)/2*s;if(!e.dataSeries?.length)return[new P.A({location:e.location,pixelValue:e.value,locationId:t,resolution:n})];const r=[];return e.dataSeries.forEach(({value:i,multidimensionalDefinition:s},o)=>{const l={Variables:s[0].variableName,Dimensions:s.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of s){l[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];l[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const a=new P.A({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:n,attributes:l});r.push(a)}),r}};function J(e){if(!e.raster||!e.serviceRasterInfo)throw new r.A("imagery-tile","no raster")}return(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_cachedRasterFunctionJson",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_compatibleFullExtent",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_rasterFunctionUpdatePromise",void 0),(0,s.Cg)([(0,l.MZ)({type:[a.jz],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],N.prototype,"bandIds",void 0),(0,s.Cg)([(0,l.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],N.prototype,"copyright",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!1}})],N.prototype,"fullExtent",null),(0,s.Cg)([(0,l.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,c.e)(_.SZ)],N.prototype,"interpolation",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"ioConfig",void 0),(0,s.Cg)([(0,l.MZ)({type:[y.A],json:{write:!0}})],N.prototype,"multidimensionalDefinition",null),(0,s.Cg)([(0,l.MZ)({type:x.A,json:{write:!0}})],N.prototype,"multidimensionalSubset",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"raster",void 0),(0,s.Cg)([(0,l.MZ)({type:w.A})],N.prototype,"rasterFunction",null),(0,s.Cg)([(0,l.MZ)()],N.prototype,"serviceRasterInfo",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0,type:p.A,json:{read:!1}})],N.prototype,"spatialReference",void 0),(0,s.Cg)([(0,l.MZ)({type:b.A})],N.prototype,"tileInfo",void 0),(0,s.Cg)([(0,l.MZ)(g.OZ)],N.prototype,"url",null),(0,s.Cg)([(0,l.MZ)()],N.prototype,"renderer",null),(0,s.Cg)([(0,l.MZ)({types:z.uy,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:z.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],N.prototype,"internalRenderer",null),(0,s.Cg)([(0,u.w)("internalRenderer")],N.prototype,"readRenderer",null),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"symbolizer",void 0),N=(0,s.Cg)([(0,h.$)("esri.layers.mixins.ImageryTileMixin")],N),N}},91806:(e,t,i)=>{i.d(t,{A:()=>c});var s,n=i(31635),r=i(25482),o=i(10107),l=i(56507),a=(i(44208),i(87811),i(64108));let c=class extends r.o{static{s=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,n.Cg)([(0,o.MZ)({type:l.jz,json:{write:!0}})],c.prototype,"level",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=s=(0,n.Cg)([(0,a.$)("esri.layers.support.LOD")],c)}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7677],{563:(e,t,i)=>{i.d(t,{QueueProcessor:()=>c});var s=i(97768),n=i(74887),r=i(9775),o=i(32587),l=i(76030),a=i(44794);class c{constructor(e){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,a.v)(!1),this.concurrency=1,this.process=e.process,this.concurrency=e.concurrency,this._queue=new r.A(e.peeker)}destroy(){this.clear(),this._schedule=(0,s.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}abort(e){const t=this._controllers.get(e);t?.abort()}clear(){this._queue.clear();const e=Array.from(this._controllers.values());this._controllers.clear(),e.forEach(e=>e.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((t,i)=>e(i))}_get(e){const t=this._deferreds.get(e);return t?.promise}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const i=this._get(e);if(i)return i;const s=new AbortController,r=(0,n.Tw)(),o=t?(0,n.u7)(t,()=>s.abort()):null,l=(0,n.NY)(s.signal,()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),a(),r.reject((0,n.NK)())}),a=()=>{l.remove(),o?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()};return this._deferreds.set(e,r),this._controllers.set(e,s),r.promise.then(a,a),this._queue.push(e),this._scheduleNext(),r.promise}last(){return this._queue.last()}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.delete(e)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,l._)(()=>{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const i=new AbortController,s=new u(e,i);this._processingItems.set(e,s);try{t=this.process(e,i.signal)}catch(e){this._processError(s,e)}(0,n.$X)(t)?(s.promise=t,t.then(e=>this._processResult(s,e),e=>this._processError(s,e))):this._processResult(s,t)}}class u{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}},4916:(e,t,i)=>{i.d(t,{A:()=>N});var s=i(31635),n=i(78888),r=i(49186),o=i(25482),l=i(53966),a=i(74887),c=i(563),u=i(10107),h=i(56507),d=(i(44208),i(87811),i(64108)),p=i(5443),f=i(86738),m=i(16930),g=i(60694),y=i(10873),x=i(45617),_=i(91806),w=i(20223),b=i(87045),v=i(76353),I=i(77301),R=i(70834);const S=new Map,C=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,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const n=this._cachedBlocks,r=e+"/"+t;if(n.has(r)){const e=n.get(r);e.ts=Date.now(),e.refCount++}else n.set(r,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}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 s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][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 k(e,t,i){const s=S.get(e);if(!s)return null==t?C.decreaseRefCount(e,i):0;if(null==t||null==s[t])return C.decreaseRefCount(e,i);const n=s[t]?.cache,r=n?.get(i);if(n&&r){if(r.refCount--,0===r.refCount){n.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);r.controller&&r.controller.abort()}return r.refCount}return 0}function M(e,t,i){const s=S.get(e);if(!s)return null==t?C.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return C.getBlock(e,i)}const n=s[t]?.cache.get(i);if(n)return n.refCount++,n.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const n=s[e]?.cache,r=n?.get(i);if(n&&r)return r.refCount++,n.set(i,r),r.block}return null}function T(e,t,i,s,n=null){const r=S.get(e);if(!r)return void(null==t&&C.putBlock(e,i,s,n));if(null==t||null==r[t])return void C.putBlock(e,i,s,n);const o={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:n};s.then(()=>o.isResolved=!0).catch(()=>o.isRejected=!0),r[t]?.cache.set(i,o)}function A(e,t,i){const s=S.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):C.deleteBlock(e,i):null==t&&C.deleteBlock(e,i)}var z=i(16019),F=i(77649),P=i(28435),B=i(14636);let D=0,N=class extends o.o{constructor(){super(...arguments),this._tileFetchQueue=new c.QueueProcessor({concurrency:32,process:(e,t)=>this.fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:b.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,R.FT)(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),(0,v.qg)(this)&&this.primaryRasters?.rasters?.forEach(t=>t.rasterJobHandler=e)}get rasterId(){return this.url||"rasterId-"+D++}set url(e){this._set("url",(0,g.Jf)(e,l.A.getLogger(this)))}async open(e){return this._openPromise??=(0,R.Hh)().then(()=>this._open(e)),this._openPromise}async fetchTile(e,t,i,s={}){const n=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,o=this.getTileExtentFromTileInfo(e,t,i,n);if(!o)throw new r.A("imagery-tile:out-of-bounds","Level for fetch tile out of range");return s={noClip:!0,...s},this.fetchPixels(o,n.size[0],n.size[1],s)}async identify(e,t={}){e=(0,h.PZ)(f.A,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{rasterInfo:n}=this,{hasMultidimensionalTranspose:r,multidimensionalInfo:o}=n;let{transposedVariableName:l}=t;const a=null!=o&&r&&(null!=s||(0,I.DY)(i));a&&!l&&(l=null!=i&&i.length>0?i[0].variableName??void 0:o.variables[0].name,t={...t,transposedVariableName:l}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=n,{datumTransformation:d}=t;let m=(0,R._I)(e,c,d);if(!u.intersects(m))return{location:m,value:null};if(null!=n.transform){const e=n.transform.inverseTransform(m);if(!n.nativeExtent.intersects(e))return{location:e,value:null};m=e}let g=0;const y=null!=l&&null!=o&&n.hasMultidimensionalTranspose;if((0,v.qg)(this)){const e=this.primaryRasters.rasters[0];if(y)return e.identify(m,t);const{pixelSize:s}=n,r=3,o=s.x*r/2,l=s.y*r/2,a=new p.A({xmin:m.x-o,xmax:m.x+o,ymin:m.y-l,ymax:m.y+l,spatialReference:c}),u={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId,bandIds:t.bandIds},{pixelBlock:h}=await e.fetchPixels(a,r,r,u),{pixelBlock:d}=await this.fetchPixels(a,r,r,u);if(null==h)return{location:m,value:null};const f=Math.floor(r*r*.5),g=!h.mask||h.mask[f]?h.pixels.map(e=>e[f]):null;let x;return null!=d&&(x=!d.mask||d.mask[f]?d.pixels.map(e=>e[f]):void 0),{location:m,value:g,processedValue:x,pyramidLevel:0}}if(!y)if(t.srcResolution)g=(0,R.t$)(t.srcResolution,n,this.ioConfig.sampling).pyramidLevel;else if(g=await this.computeBestPyramidLevelForLocation(e,t),null==g)return{location:m,value:null};const x=this.identifyPixelLocation(m,g,null,y);if(null===x)return{location:m,value:null};const{row:_,col:w,rowOffset:b,colOffset:S,blockWidth:C}=x,k=await this._fetchRawTile(g,_,w,t);if(!k?.pixels?.length)return{location:m,value:null};const M=b*C+S;return this._processIdentifyResult(k,{srcLocation:m,position:M,pyramidLevel:g,useTransposedTile:!!y,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,s={}){e=(0,R.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:n}=this;if(s.requestRawData&&n)return this._fetchPixels(e,t,i,s);const r=(0,R.FT)(e.spatialReference),o=(0,R.OM)(e);if(null==r||0===o||1===o&&this._isGlobalWrappableSource&&n)return this._fetchPixels(e,t,i,s);if(o>=3)return{extent:e,pixelBlock:null};const l=[],{xmin:a,xmax:c}=e,u=Math.round(r/(c-a)*t),h=u-Math.round((r/2-a)/(c-a)*t);let d=0;const f=[];for(let n=0;n<=o;n++){const m=new p.A({xmin:0===n?a:-r/2,xmax:n===o?c-r*n:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),g=0===n?u-h:n===o?t-d:u;d+=g,f.push(g);const y=s.disableWrapAround&&n>0?null:this._fetchPixels(m,g,i,s);l.push(y)}const m=(await Promise.all(l)).map(e=>e?.pixelBlock);let g=null;const y={width:t,height:i};return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},s)).pixelBlock:(0,P.z7)(m,y,{blockWidths:f}),{extent:e,srcExtent:(0,R._l)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:g}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const n=await this._fetchRawTiles(e,t,i,s),{nativeExtent:r,nativePixelSize:o,storageInfo:l}=this.rasterInfo,a=2**e,c=o.x*a,u=o.y*a,h=new p.A({xmin:r.xmin+c*t.x,xmax:r.xmin+c*(t.x+i.width-1),ymin:r.ymax-u*(t.y+i.height-1),ymax:r.ymax-u*t.y,spatialReference:r.spatialReference});if(!n)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:d,mosaicSize:f}=n;if(1===d.length&&null!=d[0]&&d[0].width===i.width&&d[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:n.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,g=e>0?l.pyramidBlockHeight:l.blockHeight,y={x:t.x%m,y:t.y%g};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:f,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,P.z7)(d,f,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:x}}fetchRawTile(e,t,i,s){throw new r.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,R._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,F.D)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:r,query:o,headers:l}=t;i=i??t.retryCount??this.ioConfig.retryCount;const a=r?{Range:`bytes=${r.from}-${r.to}`}:null;try{return await(0,n.A)(e,{...t,query:{...o,...s},headers:{...l,...a}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,I.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const n=s.lodAt(e);return n?this.getTileExtent({x:n.resolution,y:n.resolution},t,i,s.origin,s.spatialReference,s.size):null}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo,{pyramidResolutions:n}=e;if(!e.tileInfo){const r=[],o=e.maximumPyramidLevel||0;let l=(s.x+s.y)/2,a=1/.0254*96*l;for(let e=0;e<=o&&(r.unshift(new _.A({level:o-e,resolution:l,scale:a})),e!==o);e++)if(n){const t=(n[e].x+n[e].y)/2;a*=t/l,l=t}else l*=2,a*=2;const c=new f.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new b.A({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:n,height:r,nativeExtent:o,pixelSize:l,spatialReference:a}=e,c=new f.A({x:o.xmin,y:o.ymax,spatialReference:a});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(n,r))/Math.LN2-8)));const u=this.computeBlockBoundary(o,512,512,{x:o.xmin,y:o.ymax},[l],s);e.storageInfo=new w.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,n,r=0,o=2){if(1===n.length&&r>0){n=[...n];let{x:e,y:t}=n[0];for(let i=0;i<r;i++)e*=o,t*=o,n.push({x:e,y:t})}const l=[],{x:a,y:c}=s;for(let s=0;s<n.length;s++){const{x:r,y:o}=n[s];l.push({minCol:Math.floor((e.xmin-a+.1*r)/t/r),maxCol:Math.floor((e.xmax-a-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return l}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const n=s**e;return{x:t.x*n,y:t.y*n}}identifyPixelLocation(e,t,i,s){const{spatialReference:n,nativeExtent:r,storageInfo:o}=this.rasterInfo,{maximumPyramidLevel:l,origin:a,transposeInfo:c}=o,u=s&&null!=c?c.tileSize[0]:o.blockWidth,h=s&&null!=c?c.tileSize[1]:o.blockHeight,d=(0,R._I)(e,n,i);if(!r.intersects(d))return null;if(t<0||t>l)return null;const p=this.getPyramidPixelSize(t),{x:f,y:m}=p,g=(a.y-d.y)/m/h,y=(d.x-a.x)/f/u,x=Math.min(h-1,Math.floor((g-Math.floor(g))*h)),_=Math.min(u-1,Math.floor((y-Math.floor(y))*u));return{pyramidLevel:t,row:Math.floor(g),col:Math.floor(y),rowOffset:x,colOffset:_,blockWidth:u,srcLocation:d}}getTileExtent(e,t,i,s,n,r){const[o,l]=r,a=s.x+i*o*e.x,c=a+o*e.x,u=s.y-t*l*e.y,h=u-l*e.y;return new p.A({xmin:a,xmax:c,ymin:h,ymax:u,spatialReference:n})}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 s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}updateImageSpaceRasterInfo(e){const{pixelSize:t}=e,{width:i,height:s}=e,n=m.A.WebMercator;e.spatialReference=n,e.extent=e.nativeExtent=new p.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:n}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new f.A({x:1,y:1,spatialReference:n});const{extent:r,storageInfo:o}=e;if(o){o.origin=new f.A({x:r.xmin,y:r.ymax,spatialReference:n});const{pyramidResolutions:i,tileInfo:s}=o;if(i&&i.forEach(e=>{e.x/=t.x,e.y/=t.y}),s){s.origin=o.origin;const t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;s.lods.forEach((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254})}}}async _fetchPixels(e,t,i,s={}){let n=(0,R.OM)(e);if(n>=2)return{extent:e,pixelBlock:null};const r=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:o,srcResolution:l,srcExtent:a,srcWidth:c,srcHeight:u,ul:h}=r;if(0===c||0===u)return{extent:e,srcExtent:a,pixelBlock:null};const{rasterInfo:d}=this,p=d.transform,m="gcs-shift"===p?.type,g=null!=(0,R.FT)(e.spatialReference);!m&&g||(n=(0,R.OM)(r.srcExtent,m));const y=await this._fetchRawTiles(o,h,{width:c,height:u,wrapCount:n},s);if(!y)return{extent:e,srcExtent:a,pixelBlock:null};const x=d.storageInfo,_=o>0?x.pyramidBlockWidth:x.blockWidth,w=o>0?x.pyramidBlockHeight:x.blockHeight;let{x:b,y:v}=d.pixelSize;if(o>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=x;if(null!=e&&e[o-1])({x:b,y:v}=e[o-1]);else{const e=t**o;b*=e,v*=e}}const I=d.spatialReference,S=new f.A({x:b,y:v,spatialReference:I}),C=_===c&&w===u&&h.x%_===0&&h.y%w===0,k=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),M=!e.spatialReference.equals(I),T=I.isGeographic?1e-9:1e-4,{datumTransformation:A}=s;if(!M&&C&&1===y.pixelBlocks.length&&_===t&&w===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(l,k,T))return{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:y.pixelBlocks[0]};const z=g&&null!=(0,R.FT)(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,F=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");F&&!this.rasterJobHandler&&await(0,R.Hh)();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k.toJSON(),datumTransformation:A,rasterTransform:p,hasWrapAround:n>0||z,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:F},s):(0,R.l0)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k,datumTransformation:A,rasterTransform:p,hasWrapAround:n>0||z,isAdaptive:!1,includeGCSGrid:F});let N;const J=!s.requestRawData,O={rows:D.spacing[0],cols:D.spacing[1]},H=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(o,y.extent.xmin):void 0,{pixelBlocks:E,mosaicSize:L,isPartiallyFilled:q}=y;let Z=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:E,srcMosaicSize:L,destDimension:J?{width:t,height:i}:null,coefs:J?D.coefficients:null,sampleSpacing:J?O:null,projectDirections:F,gcsGrid:F?D.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:H,blockWidths:null},s);({pixelBlock:N,localNorthDirections:Z}=e)}else{const e=(0,P.z7)(E,L,{alignmentInfo:H});N=J?(0,P.$i)(e,{width:t,height:i},D.coefficients,O,s.interpolation):e,F&&D.gcsGrid&&(Z=(0,P.QF)({width:t,height:i},D.gcsGrid),N=(0,B.Y2)(N,this.rasterInfo.dataType,Z))}return s.requestRawData||F?{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N,transformGrid:D,localNorthDirections:Z,isPartiallyFilled:q}:{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N}}async _fetchRawTiles(e,t,i,s){const{origin:n,blockBoundary:r}=this.rasterInfo.storageInfo,{blockWidth:o,blockHeight:l}=this.getBlockWidthHeight(e);let{x:a,y:c}=t,{width:u,height:h,wrapCount:d}=i;const f=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(a-=s.buffer.cols,c-=s.buffer.rows,u+=2*s.buffer.cols,h+=2*s.buffer.rows);let m=0,g=0,y=0;d&&null!=f&&(({worldColumnCountFromOrigin:g,originColumnOffset:y,rightPadding:m}=f),g*f.blockWidth-m>=a+u&&(m=0));const x=Math.floor(a/o),_=Math.floor(c/l),w=Math.floor((a+u+m-1)/o),b=Math.floor((c+h+m-1)/l),v=r[e];if(!v)return null;const{minRow:I,minCol:R,maxCol:S,maxRow:C}=v;if(0===d&&(b<I||w<R||_>C||x>S))return null;const k=new Array;let M=!1;const T=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=_;t<=b;t++)for(let i=x;i<=w;i++){let n=i;if(!s.disableWrapAround&&d&&null!=f&&g<=i&&(n=i-g-y),t>=I&&n>=R&&C>=t&&S>=n){const i=this._fetchRawTile(e,t,n,s);T?k.push(new Promise(e=>{i.then(t=>e(t)).catch(()=>{M=!0,e(null)})})):k.push(i)}else k.push(Promise.resolve(null))}if(0===k.length)return null;const A=await Promise.all(k),z={height:(b-_+1)*l,width:(w-x+1)*o},{spatialReference:F}=this.rasterInfo,P=this.getPyramidPixelSize(e),{x:B,y:D}=P;return{extent:new p.A({xmin:n.x+x*o*B,xmax:n.x+(w+1)*o*B,ymin:n.y-(b+1)*l*D,ymax:n.y-_*l*D,spatialReference:F}),pixelBlocks:A,mosaicSize:z,isPartiallyFilled:M}}_fetchRawTile(e,t,i,s){const{storageInfo:n}=this.rasterInfo,r=null!=n.transposeInfo&&!!s.transposedVariableName;if(!r){const s=n.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:r,minCol:o,maxCol:l,maxRow:a}=s;if(t<r||i<o||t>a||i>l)return Promise.resolve(null)}const o=r?s.transposeVariableName:s.sliceId,l=n.isBsqTile?s.bandIds:null,c=function(e,t,i){const s=[];return null!=t&&s.push(`sliceId=${t}`),null!=i&&s.push(`bandIds=${i.join(",")}`),s.length?`${e}?${s.join("&")}`:e}(this.rasterId,o,l),u=`${e}/${t}/${i}`;let h=M(c,s.registryId,u);if(null==h){const r=new AbortController,o=s.bandIds?.slice();if(o?.length&&n.isBsqTile){const n=new Set(o),l=[],a=Array.from(n);for(const n of o)l.push(this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:{...s,bandIds:[n]}},{signal:r.signal}));h=Promise.all(l).then(e=>{if(e.some(e=>null==e))return null;if(a.length!==o.length){const t=[];for(const i of o){let s=e[a.indexOf(i)];t.includes(s)&&(s=s.clone()),t.push(s)}e=t}return this.rasterJobHandler?this.rasterJobHandler.compositeBands({pixelBlocks:e},{signal:r.signal,transferPixelsToWorker:!0}):(0,P.Wy)(e)})}else h=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:s},{signal:r.signal});T(c,s.registryId,u,h,r),h.catch(()=>A(c,s.registryId,u))}return s.signal&&(0,a.u7)(s,()=>{k(c,s.registryId,u)}),h}_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 s=e[0].length;if("vector-magdir"===i){const t=e[1].map(e=>(e+360)%360);return[e[0],t]}const[n,r]=e,o=[],l=[];for(let e=0;e<s;e++){const[t,i]=(0,B.Lu)([n[e],r[e]]);o.push(t),l.push(i)}return[o,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,R.DO)(this.rasterInfo)),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const n={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};s.srcResolution&&(n.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,n));const r=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:o,srcHeight:l,pyramidLevel:a}=n,c=o/t,u=l/i,h=a<r&&c*u>=16,d=a===r&&this._requireTooManySrcTiles(o,l,t,i);if(h||d||0===o||0===l){const o=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=(0,R.Wo)(o,this.rasterInfo.spatialReference,e,n.datumTransformation);const d=!l||s.srcResolution&&l.x+l.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&d){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(r-a+3>=e){const t=2**e;l={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}l&&(n.srcResolution=l,this._updateSourceDataInfo(e,n))}return this._requireTooManySrcTiles(n.srcWidth,n.srcHeight,t,i)&&(n.srcWidth=0,n.srcHeight=0),n}_requireTooManySrcTiles(e,t,i,s){const{tileInfo:n}=this.rasterInfo.storageInfo,r=e/i,o=t/s;return Math.ceil(e/n.size[0])*Math.ceil(t/n.size[1])>=256*Math.max(1,(i+s)/1024)||r>8||o>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,s=i.spatialReference,{srcResolution:n,datumTransformation:r}=t,{pyramidLevel:o,pyramidResolution:l,excessiveReading:a}=(0,R.t$)(n,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,R._l)(e,s,r);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{origin:h}=i.storageInfo,{width:d,height:p,ul:f}=(0,v.$g)(c,h,l,o);t.pyramidLevel=o,t.pyramidResolution=l,t.srcWidth=d,t.srcHeight=p,t.ul=f}_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:s,pyramidLevel:n,useTransposedTile:r}=t,o=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(null==l||!r){const t=e.pixels.map(e=>e[s]),r={location:i,value:t,pyramidLevel:n},o=this._computeMagDirValues(t.map(e=>[e]));return o?.length&&(r.magdirValue=o.map(e=>e[0])),r}let a=e.pixels.map(e=>e.slice(s*o,s*o+o)),c=this._computeMagDirValues(a);const{requestSomeSlices:u,identifyOptions:h}=t;let d=(0,I.QW)(l,h.transposedVariableName);if(u){const e=(0,I.xx)(d,h.multidimensionalDefinition,h.timeExtent);a=a.map(t=>e.map(e=>t[e])),c=c?.map(t=>e.map(e=>t[e])),d=e.map(e=>d[e])}const p=e.noDataValues||this.rasterInfo.noDataValue,f={pixels:a,pixelType:e.pixelType};let m;return null!=p&&((0,z.Sp)(f,p),m=f.mask),{location:i,value:null,dataSeries:d.map((e,t)=>{const i={value:0===m?.[t]?null:a.map(e=>e[t]),multidimensionalDefinition:e.multidimensionalDefinition.map(e=>new x.A({...e,isSlice:!0}))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i}),pyramidLevel:n}}};(0,s.Cg)([(0,u.MZ)()],N.prototype,"_rasterTileAlignmentInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"_tileFetchQueue",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"_isGlobalWrappableSource",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s.Cg)([(0,u.MZ)()],N.prototype,"_openPromise",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"rasterJobHandler",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"rasterId",null),(0,s.Cg)([(0,u.MZ)(y.OZ)],N.prototype,"url",null),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],N.prototype,"datasetName",void 0),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],N.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"rasterInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"ioConfig",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"sourceJSON",void 0),N=(0,s.Cg)([(0,d.$)("esri.layers.support.rasterDatasets.BaseRaster")],N)},32587:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(62788),n=i(95488);class r{constructor(e){this._observable=new n.I,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,s.gc)(this._observable),this._map.entries()}forEach(e,t){(0,s.gc)(this._observable),this._map.forEach((i,s)=>e.call(t,i,s,this),t)}get(e){return(0,s.gc)(this._observable),this._map.get(e)}has(e){return(0,s.gc)(this._observable),this._map.has(e)}keys(){return(0,s.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,s.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,s.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},44794:(e,t,i)=>{i.d(t,{v:()=>l});var s=i(4718),n=i(62788),r=i(95488);class o{constructor(e,t){this._observable=new r.I,this._value=e,this._equalityFunction=t}get value(){return(0,n.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function l(e,t=s.gh){return new o(e,t)}},50103:(e,t,i)=>{function s(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=s(e,i);for(let e=0;e<r.length;e++)s(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 n(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 r=s(e,i);return r.length>0?t?n(r[0],t):r[0]:null}function r(e,t=null){const i=t?n(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function o(e,t){const i=s(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}function l(e,t=null){const i=r(e,t);return i?.split(" ").map(e=>Number(e))??[]}function a(e,t){return o(e,t).map(e=>Number(e))}function c(e,t){const i=r(e,t);return Number(i)}function u(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}function h(e){return e.nodeName.slice(e.nodeName.lastIndexOf(":")+1)}i.d(t,{Dy:()=>o,IC:()=>s,Ui:()=>a,V6:()=>n,g7:()=>u,mX:()=>r,pN:()=>l,v7:()=>c,vv:()=>h})},72802:(e,t,i)=>{i.d(t,{U:()=>n});var s=i(19419);class n{constructor(e,t,i,n=(0,s.vt)()){this._level=e,this._row=t,this._col=i,this.extent=n}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new n(e.level,e.row,e.col,e.extent)}}},84169:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(31635),n=i(49186),r=i(10107),o=(i(44208),i(53966),i(87811),i(64108)),l=i(39829),a=i(4916),c=i(77359),u=i(28435),h=i(70834),d=i(22671);let p=class extends a.A{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(e,t,i,s={}){const{rasters:n,rasterIds:r}=this.primaryRasters;let o=!1;const{interpolation:l}=s,a=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&a&&(o=1===n.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:o}),s.requestRawData&&n.length>1&&!this.hasUniqueSourceStorageInfo&&(o=!1,s={...s,requestRawData:!1});const h=n.map(n=>n.fetchPixels(e,t,i,s)),d=await Promise.all(h),p=d.map(e=>e.pixelBlock),f=o||s.requestRawData?d.map(e=>e.srcTilePixelSize):null;if(s.skipRasterFunction||p.every(e=>null==e))return d[0];const m=d.find(e=>null!=e.pixelBlock)?.extent??e;let g=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:f,primaryRasterIds:r});const{transformGrid:y}=d[0];if(!o||null==g||null==y){const e=s.noClip?null:this.getClippingGeometry(m.spatialReference);return!s.noClip&&null!=g&&e&&(g=await(0,c.$Q)(g,m,e)),{...d[0],pixelBlock:g}}const x={rows:y.spacing[0],cols:y.spacing[1]};let _;_=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[g],srcMosaicSize:{width:g.width,height:g.height},destDimension:{width:t,height:i},coefs:y.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:(0,u.$i)(g,{width:t,height:i},y.coefficients,x,l);const w=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||null==_||null==w||(_=await(0,c.$Q)(_,e,w)),{extent:e,srcExtent:d[0].srcExtent,pixelBlock:_}}getClippingGeometry(e){const t=this._clippingGeometry.get("0");if(!e||!t)return t;const i=function(e){return String(e.wkid??e.wkt??e.wkt2)}(e);let s=this._clippingGeometry.get(i);return null!=s||(s=e.equals(t.spatialReference)?t:(0,h.uk)(t,e),this._clippingGeometry.set(i,s)),s}async _open(e){const{rasterFunction:t}=this;t.isRoot=!0,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:s}=this.primaryRasters,r=i.map(t=>t.rasterInfo?void 0:t.open(e));await Promise.all(r);const o=i.map(({rasterInfo:e})=>e),l=t.bind({rasterInfos:o,rasterIds:s});if(t.rawSourceRasterInfos=o,!l.success||0===o.length)throw new n.A("raster-function:open",`cannot bind the function: ${l.error??""}`);const a="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===a?.functionName&&(t.rasterInfo.attributeTable=d.A.fromJSON(a.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every(e=>function(e,t){const{storageInfo:i,pixelSize:s,spatialReference:n,extent:r}=e,{storageInfo:o,pixelSize:l,spatialReference:a,extent:c}=t;return s.x===l.x&&s.y===l.y&&n.equals(a)&&r.equals(c)&&i.blockHeight===o.blockHeight&&i.blockWidth===o.blockWidth&&i.maximumPyramidLevel===o.maximumPyramidLevel&&i.firstPyramidLevel===o.firstPyramidLevel&&i.pyramidBlockWidth===o.pyramidBlockWidth&&i.pyramidBlockHeight===o.pyramidBlockHeight&&i.pyramidScalingFactor===o.pyramidScalingFactor}(e,c)),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let t=e?.clippingGeometry;if(t&&"inside"===e.clippingType){const{extent:e}=this.rasterInfo,s=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),n=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(3054)]).then(i.bind(i,93054));let r=s.execute(l.A.fromExtent(e),2*(e.width+e.height)/40);r=(0,h.uk)(r,t.spatialReference),t=n.execute(r,t)}this._clippingGeometry.clear(),t&&this._clippingGeometry.set("0",t)}};(0,s.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],p.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"tileType",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"rasterFunction",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"primaryRasters",void 0),p=(0,s.Cg)([(0,o.$)("esri.layers.support.rasterDatasets.FunctionRaster")],p)},87045:(e,t,i)=>{i.d(t,{A:()=>w});var s,n=i(31635),r=i(66552),o=i(25482),l=i(83047),a=i(10107),c=i(56507),u=(i(44208),i(87811),i(36005)),h=i(64108),d=i(43937),p=i(86738),f=i(16930),m=i(21325),g=i(28735),y=i(91806),x=i(72802);const _=new r.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let w=class extends o.o{static{s=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:n=256,spatialReference:r=f.A.WebMercator,numLODs:o=24}=e;if(!(0,m.fn)(r)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new y.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new y.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new p.A(0,0,r),size:[n,n],spatialReference:r})}const a=(0,m.Vp)(r),c=e.origin?new p.A({x:e.origin.x,y:e.origin.y,spatialReference:r}):new p.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),u=1/(39.37*(0,l.GA)(r)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*u;h.push(new y.A({level:e,scale:t,resolution:s}))}else{let e=(0,m.EA)(r)?512/n*591657527.5917094:256/n*591657527.591555;const i=Math.ceil(o/t);h.push(new y.A({level:0,scale:e,resolution:e*u}));for(let s=1;s<i;s++){const i=e/2**t,n=i*u;h.push(new y.A({level:s,scale:i,resolution:n})),e=i}}return new s({dpi:96,lods:h,origin:c,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,m.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return p.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const s=[],n=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{s.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,n[e.level]=e})),this._set("scales",s),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;s<i;s++){const i=t[s],n=t[s+1];if(i<=e)return s;if(n===e)return s+1;if(i>e&&n<e)return s+Math.log(i/e)/Math.log(i/n)}return s}tileAt(e,t,i,s){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=i;else if((0,m.aI)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,s=i;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,s=i}const l=n.resolution*this.size[0],a=n.resolution*this.size[1];return s??=new x.U(0,0,0),s.level=e,s.row=Math.floor((this.origin.y-o)/a+.001),s.col=Math.floor((r-this.origin.x)/l+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;const s=e.level-i.level,n=i.resolution*this.size[0]/2**s,r=i.resolution*this.size[1]/2**s;return e.extent[0]=this.origin.x+e.col*n,e.extent[1]=this.origin.y-(e.row+1)*r,e.extent[2]=e.extent[0]+n,e.extent[3]=e.extent[1]+r,!0}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:s}=i,n=s*this.size[0],r=s*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return s.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],n=this.lods.length-t;for(let e=0;e<n;e++){const s=e+t,{scale:n,resolution:r}=s>=0?this.lods[s]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new y.A({level:e,scale:n,resolution:r}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const s=e[i];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};(0,n.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,n.Cg)([(0,a.MZ)({type:p.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,n.Cg)([(0,u.w)("origin")],w.prototype,"readOrigin",null),(0,n.Cg)([(0,a.MZ)({type:[y.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,n.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,n.Cg)([(0,u.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,n.Cg)([(0,d.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],w.prototype,"writeSize",null),(0,n.Cg)([(0,a.MZ)({type:f.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=s=(0,n.Cg)([(0,h.$)("esri.layers.support.TileInfo")],w)},89015:(e,t,i)=>{i.d(t,{o:()=>N});var s=i(31635),n=i(78888),r=i(49186),o=i(53966),l=i(10107),a=i(56507),c=(i(44208),i(87811),i(93223)),u=i(36005),h=i(64108),d=i(86738),p=i(16930),f=i(21325),m=i(60694),g=i(10873),y=i(45617),x=i(43577),_=i(13868),w=i(22796),b=i(87045),v=i(76353),I=i(84169),R=i(77301),S=i(77359),C=i(6049),k=i(70834),M=i(6952),T=i(12711),A=i(85676),z=i(94359),F=i(22048),P=i(49410),B=i(34606),D=i(51508);const N=e=>{const t=e;let N=class extends t{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=(0,v.qg)(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,m.Jf)(e,o.A.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find(({name:t})=>t===e);return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const s=t?.layerDefinition?.drawingInfo?.renderer;return(0,z.LF)(s,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,a.PZ)(F.A,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:o}=i;if(!s.spatialReference.equals(o)){await(0,k.Hh)();const e="extent"===s.type?(0,k._l)(s,o):(0,k.uk)(s,o);if(null==e)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");n=e}const l=e.pixelSize??new d.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=(0,S.b7)(i,n,l),p=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const f=await(0,S.$Q)(p.pixelBlock,c,n),m=this._rasterJobHandler;return m?m.computeStatisticsHistograms({pixelBlock:f},t):(0,M.eH)(f)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,R.XU)({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:s}=this.raster,n=(0,R.ct)(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),r=n?.name,o=(0,T.m7)(s,r);return this._updateSymbolizer(t,i,r,o)}async applyRenderer(e,t,i){const s=e?.pixelBlock;if(!(null!=s&&s.pixels&&s.pixels.length>0))return null;await this.updateRenderer();const n=this.bandIds??[],{pixelBlock:r}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:n,symbolizer:this.symbolizer},i);return r}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&(0,v.qg)(t)){const i=t.rasterFunction.rawInputBandIds;e=e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):i}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}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 s=(0,f.Vp)(e);return b.A.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,s={}){if(J(this),s.requestAsImageElement){const r=this.getTileUrl(e,t,i);return(0,n.A)(r,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then(e=>e.data)}const{serviceRasterInfo:r}=this;if(null!=r.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const n=s.tileInfo||r.storageInfo.tileInfo,o=this.raster.getTileExtentFromTileInfo(e,t,i,n);if(o)return{extent:o,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,s)}async fetchPixels(e,t,i,s={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i);const n=await this.raster.fetchPixels(e,t,i,s);return s.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(n.pixelBlock=n.pixelBlock?.extractBands(s.bandIds)),n}async getSamples(e,t){if(await this.load(),(e=(0,a.PZ)(B.A,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new r.A("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const i=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:i},n=(await this._getSampleLocations(e)).map(e=>this.identify(e,s).then(t=>(t.location=e,t))),o=(await Promise.all(n)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new D.A({samples:o})}async identify(e,t={}){await this.load();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&(!s.hasMultidimensionalTranspose||!(0,R.DY)(t.multidimensionalDefinition)&&!t.transposedVariableName)&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null};const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new r.A("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let o;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=(0,v.qg)(i)?this.getRawDisplayBandIds():this.bandIds;o=e?.length?e:void 0}return i.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.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((0,R.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,R.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,R.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,v.qg)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;J(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,(0,v.qg)(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:s,type:n}=t;if("multipoint"===n)return t.points.map(e=>new d.A({x:e[0],y:e[1],spatialReference:s}));if("polyline"===n){let n=t;if(e.sampleCount||e.sampleDistance){const s=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),r=(await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(4929)]).then(i.bind(i,965))).execute(t,{unit:"meters"}),o=Math.min(e.sampleCount||100,1e3);let l=e.sampleDistance;l||(l=r/(o+(2===n.paths[0].length?1:0))),n=s.execute(t,l,{unit:"meters"})}return n.paths.flatMap(e=>e.map(e=>new d.A({x:e[0],y:e[1],spatialReference:s})))}const r=Math.min(e.sampleCount||100,1e3),o="extent"===t.type,l=o?t:t.extent,a=Math.sqrt(l.width*l.height/r),c=l.height/a,u=l.width/a,{xmin:h,ymax:p}=l,f=[];for(let e=0;e<c;e++)for(let i=0;i<u;i++){const n=new d.A({x:h+(i+.5)*a,y:p-(e+.5)*a,spatialReference:s});(o||t.contains(n))&&f.push(n)}return f}_configDefaultInterpolation(){if(null==this.interpolation){J(this);const{raster:e}=this,t=(0,T.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){J(this);const{rasterInfo:t}=this.raster,i=(0,R.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=(0,T.I8)({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??(0,T.ci)(t)),!this.renderer||"override"===e){const e=(0,T.Mm)(this.raster),i=n?.renderer??(0,T.PD)(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,l=o?.max??0,a=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(l>1e24||a<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const r=(0,T.$P)({...this.renderer.toJSON(),variableName:s}),l=(0,T.m7)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=r,this.symbolizer.rasterInfo=l):this.symbolizer=new A.A({rendererJSON:r,rasterInfo:l});const a=this.symbolizer.bind();if(a.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,T.PD)(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.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else o.A.getLogger(this).warn("imagery-tile-mixin",a.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&(0,v.qg)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",w.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,v.qg)(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:s}=this;if(s){const i={raster:t};e.length>1&&e.forEach(e=>i[e.url]=e);const n=(0,C.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),r=new I.A({rasterFunction:n});r.rasterJobHandler=this._rasterJobHandler,await r.open(),this.raster=r}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!s)return;const{bandIds:n}=this,{bandCount:r}=this.raster.rasterInfo,o=n?.length?n.some(e=>e>=r):r>=3;n&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,s=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),n=(i.pixelSize.x+i.pixelSize.y)/2*s;if(!e.dataSeries?.length)return[new P.A({location:e.location,pixelValue:e.value,locationId:t,resolution:n})];const r=[];return e.dataSeries.forEach(({value:i,multidimensionalDefinition:s},o)=>{const l={Variables:s[0].variableName,Dimensions:s.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of s){l[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];l[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const a=new P.A({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:n,attributes:l});r.push(a)}),r}};function J(e){if(!e.raster||!e.serviceRasterInfo)throw new r.A("imagery-tile","no raster")}return(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_cachedRasterFunctionJson",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_compatibleFullExtent",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_rasterFunctionUpdatePromise",void 0),(0,s.Cg)([(0,l.MZ)({type:[a.jz],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],N.prototype,"bandIds",void 0),(0,s.Cg)([(0,l.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],N.prototype,"copyright",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!1}})],N.prototype,"fullExtent",null),(0,s.Cg)([(0,l.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,c.e)(_.SZ)],N.prototype,"interpolation",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"ioConfig",void 0),(0,s.Cg)([(0,l.MZ)({type:[y.A],json:{write:!0}})],N.prototype,"multidimensionalDefinition",null),(0,s.Cg)([(0,l.MZ)({type:x.A,json:{write:!0}})],N.prototype,"multidimensionalSubset",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"raster",void 0),(0,s.Cg)([(0,l.MZ)({type:w.A})],N.prototype,"rasterFunction",null),(0,s.Cg)([(0,l.MZ)()],N.prototype,"serviceRasterInfo",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0,type:p.A,json:{read:!1}})],N.prototype,"spatialReference",void 0),(0,s.Cg)([(0,l.MZ)({type:b.A})],N.prototype,"tileInfo",void 0),(0,s.Cg)([(0,l.MZ)(g.OZ)],N.prototype,"url",null),(0,s.Cg)([(0,l.MZ)()],N.prototype,"renderer",null),(0,s.Cg)([(0,l.MZ)({types:z.uy,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:z.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],N.prototype,"internalRenderer",null),(0,s.Cg)([(0,u.w)("internalRenderer")],N.prototype,"readRenderer",null),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"symbolizer",void 0),N=(0,s.Cg)([(0,h.$)("esri.layers.mixins.ImageryTileMixin")],N),N}},91806:(e,t,i)=>{i.d(t,{A:()=>c});var s,n=i(31635),r=i(25482),o=i(10107),l=i(56507),a=(i(44208),i(87811),i(64108));let c=class extends r.o{static{s=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,n.Cg)([(0,o.MZ)({type:l.jz,json:{write:!0}})],c.prototype,"level",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=s=(0,n.Cg)([(0,a.$)("esri.layers.support.LOD")],c)}}]);
|