@arcgis/core 5.0.0-next.39 → 5.0.0-next.40

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.
Files changed (174) hide show
  1. package/Basemap.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/02d1c48e874dfd985bc4.js +1 -0
  4. package/assets/esri/core/workers/chunks/0429ca6ba562ae29897e.js +1 -0
  5. package/assets/esri/core/workers/chunks/{a6324f5f560ffadc6e5d.js → 061def9163a09c804b5c.js} +1 -1
  6. package/assets/esri/core/workers/chunks/0e4d0213d568f50c231f.js +1 -0
  7. package/assets/esri/core/workers/chunks/{1de216d9850c39c1735d.js → 1357cc637524cd254974.js} +1 -1
  8. package/assets/esri/core/workers/chunks/13839d220e5c62404923.js +1 -0
  9. package/assets/esri/core/workers/chunks/1c0fb4795a52204882a8.js +1 -0
  10. package/assets/esri/core/workers/chunks/1e286fb7bb833f00dd88.js +1 -0
  11. package/assets/esri/core/workers/chunks/{52ecbaa2d32692d6d8df.js → 1f6ead46b723630db897.js} +1 -1
  12. package/assets/esri/core/workers/chunks/218b2b767b40d85fb713.js +1 -0
  13. package/assets/esri/core/workers/chunks/2c9865e34f32fb5683e5.js +1 -0
  14. package/assets/esri/core/workers/chunks/{48d1a443b324753921de.js → 2db7a7607657f1d669f7.js} +1 -1
  15. package/assets/esri/core/workers/chunks/2f8cf7d9ff1f4de19a4c.js +1 -0
  16. package/assets/esri/core/workers/chunks/{6330d8767ba1d5329daa.js → 31b074ae2162a3508d2a.js} +1 -1
  17. package/assets/esri/core/workers/chunks/338570424337be05cef5.js +1 -0
  18. package/assets/esri/core/workers/chunks/{a59433c78ed01febca6d.js → 3767617c0dfc7d801441.js} +1 -1
  19. package/assets/esri/core/workers/chunks/3a16347e17312556e02c.js +1 -0
  20. package/assets/esri/core/workers/chunks/3ac8de121a07c70bae0f.js +1 -0
  21. package/assets/esri/core/workers/chunks/3f33708eb39c7169a226.js +1 -0
  22. package/assets/esri/core/workers/chunks/4278b35fb6fd578c403e.js +1 -0
  23. package/assets/esri/core/workers/chunks/{3f8849c49f0e3ce7eb6b.js → 44f036cc21e3a2308f69.js} +1 -1
  24. package/assets/esri/core/workers/chunks/46daa1ff5b412a97edc9.js +1 -0
  25. package/assets/esri/core/workers/chunks/{a5d25c71aa4dfaa878cf.js → 4c4a55be41ba105c091c.js} +1 -1
  26. package/assets/esri/core/workers/chunks/537de53ef1e9101468f5.js +1 -0
  27. package/assets/esri/core/workers/chunks/679088064420a906aa7f.js +1 -0
  28. package/assets/esri/core/workers/chunks/6e8c20ff1d28ef2fe72c.js +1 -0
  29. package/assets/esri/core/workers/chunks/75643711d9585ee26a15.js +1 -0
  30. package/assets/esri/core/workers/chunks/7ba13b52fce1060fbb2a.js +1 -0
  31. package/assets/esri/core/workers/chunks/800c91302eaad7f00877.js +1 -0
  32. package/assets/esri/core/workers/chunks/804958f3f4ff47a4eff5.js +1 -0
  33. package/assets/esri/core/workers/chunks/816227de5bd42b437df4.js +1 -0
  34. package/assets/esri/core/workers/chunks/926c2a0e21b7aa1a86e4.js +1 -0
  35. package/assets/esri/core/workers/chunks/933dce4d4ff8b90219c8.js +1 -0
  36. package/assets/esri/core/workers/chunks/93d11075f65a5b6625ea.js +1 -0
  37. package/assets/esri/core/workers/chunks/9c0efd06c9000ccbd62d.js +1 -0
  38. package/assets/esri/core/workers/chunks/9f1d3c0b53bef07e39bf.js +1 -0
  39. package/assets/esri/core/workers/chunks/9f2a8445a5848502c7e7.js +1 -0
  40. package/assets/esri/core/workers/chunks/9f6c63a580b28ab715bd.js +1 -0
  41. package/assets/esri/core/workers/chunks/a96742e678a506c461ab.js +1 -0
  42. package/assets/esri/core/workers/chunks/b7bcff9a64f41a0a0b6a.js +1 -0
  43. package/assets/esri/core/workers/chunks/c0b15510a8cab98df77f.js +1 -0
  44. package/assets/esri/core/workers/chunks/c367c7e553be3682f2db.js +1 -0
  45. package/assets/esri/core/workers/chunks/cfd2839e218610a222e5.js +1 -0
  46. package/assets/esri/core/workers/chunks/{014dbe6fa93a277b08f7.js → d0014b4a8c013f59b113.js} +1 -1
  47. package/assets/esri/core/workers/chunks/d08ee45c501102deea20.js +1 -0
  48. package/assets/esri/core/workers/chunks/d42273394f575e71dd55.js +1 -0
  49. package/assets/esri/core/workers/chunks/d723619579cc8f5ef2cd.js +1 -0
  50. package/assets/esri/core/workers/chunks/da1e61f355fb943085dc.js +1 -0
  51. package/assets/esri/core/workers/chunks/dddb6cb44cbe4dc1af97.js +1 -0
  52. package/assets/esri/core/workers/chunks/efc293c8bbc12156096d.js +1 -0
  53. package/assets/esri/core/workers/chunks/f65f1798f398bc549463.js +1 -0
  54. package/assets/esri/core/workers/chunks/f93f0586ce10cb5d98b3.js +1 -0
  55. package/assets/esri/core/workers/chunks/{06462b267ff8d5984882.js → fb9643b74cf35221ff98.js} +1 -1
  56. package/chunks/Envelope.js +1 -1
  57. package/chunks/GaussianSplat.glsl.js +2 -2
  58. package/chunks/MultiPathImpl.js +1 -1
  59. package/chunks/Point2D.js +1 -1
  60. package/chunks/UnitFactory.js +1 -1
  61. package/config.js +1 -1
  62. package/core/has.js +1 -1
  63. package/form/FormTemplate.js +1 -1
  64. package/form/elements/GroupElement.js +1 -1
  65. package/form/elements/inputs/attachments/AttachmentInput.js +1 -1
  66. package/geometry/FlatGeometry.js +5 -0
  67. package/geometry/operators/gx/operatorShapePreservingProject.js +1 -1
  68. package/geometry/operators/support/jsonConverter.js +1 -1
  69. package/geometry/support/aaBoundingBox.js +1 -1
  70. package/geometry/support/aaBoundingRect.js +1 -1
  71. package/geometry/support/boundsUtils.js +1 -1
  72. package/interfaces.d.ts +259 -7
  73. package/kernel.js +1 -1
  74. package/layers/BaseElevationLayer.js +1 -1
  75. package/layers/BaseTileLayer.js +1 -1
  76. package/layers/CSVLayer.js +1 -1
  77. package/layers/FeatureLayer.js +1 -1
  78. package/layers/GeoJSONLayer.js +1 -1
  79. package/layers/GroupLayer.js +1 -1
  80. package/layers/MapImageLayer.js +1 -1
  81. package/layers/MediaLayer.js +1 -1
  82. package/layers/OrientedImageryLayer.js +1 -1
  83. package/layers/ParquetLayer.js +1 -1
  84. package/layers/VectorTileLayer.js +1 -1
  85. package/layers/VideoLayer.js +1 -1
  86. package/layers/WMSLayer.js +1 -1
  87. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  88. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  89. package/layers/mixins/ArcGISImageService.js +1 -1
  90. package/layers/mixins/ImageryTileMixin.js +1 -1
  91. package/layers/mixins/PortalLayer.js +1 -1
  92. package/layers/mixins/TemporalLayer.js +1 -1
  93. package/layers/mixins/operationalLayerModuleMap.js +1 -1
  94. package/layers/mixins/operationalLayers.js +1 -1
  95. package/layers/support/LocalMediaElementSource.js +1 -1
  96. package/layers/support/ParquetEncodingBase.js +1 -1
  97. package/layers/support/ParquetEncodingLocation.js +1 -1
  98. package/layers/support/ParquetEncodingWkb.js +1 -1
  99. package/layers/support/Sublayer.js +1 -1
  100. package/layers/support/WMSSublayer.js +1 -1
  101. package/layers/support/layersCreator.js +1 -1
  102. package/layers/support/lazyLayerLoader.js +1 -1
  103. package/layers/support/parquetUtils.js +1 -1
  104. package/libs/parquet/parquet.js +1 -1
  105. package/package.json +2 -2
  106. package/renderers/FlowRenderer.js +1 -1
  107. package/renderers/VectorFieldRenderer.js +1 -1
  108. package/renderers/visualVariables/support/ColorSizeStop.js +1 -1
  109. package/renderers/visualVariables/support/SizeStop.js +1 -1
  110. package/support/LayersMixin.js +1 -1
  111. package/support/TablesMixin.js +1 -1
  112. package/support/revision.js +1 -1
  113. package/symbols/edges/Edges3D.js +1 -1
  114. package/versionManagement/VersionManager.d.ts +4 -0
  115. package/versionManagement/VersionManager.js +5 -0
  116. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  117. package/views/2d/layers/LayerView2D.js +1 -1
  118. package/views/3d/GroundView3D.js +1 -1
  119. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  120. package/views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js +1 -1
  121. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
  122. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  123. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  124. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +1 -1
  125. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  126. package/views/input/gamepad/GamepadInputDevice.js +1 -1
  127. package/views/layers/support/{Geometry.js → GeometryClipArea.js} +1 -1
  128. package/views/webgl/capabilities/Capabilities.js +1 -1
  129. package/views/webgl/capabilities/load.js +1 -1
  130. package/webdoc/support/writeUtils.js +1 -1
  131. package/widgets/FeatureTable/FieldColumn.js +1 -1
  132. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  133. package/assets/esri/core/workers/chunks/09ac2bbc7327e6e6b5a2.js +0 -1
  134. package/assets/esri/core/workers/chunks/1432e789aa4cba627337.js +0 -1
  135. package/assets/esri/core/workers/chunks/1a9ed3c59a9a8bafb251.js +0 -1
  136. package/assets/esri/core/workers/chunks/1c857191e5898aba50fe.js +0 -1
  137. package/assets/esri/core/workers/chunks/234ffd08c2be03a0b9fe.js +0 -1
  138. package/assets/esri/core/workers/chunks/2d0d8243ed0c21f8a498.js +0 -1
  139. package/assets/esri/core/workers/chunks/31675811cacdb6fd96cf.js +0 -1
  140. package/assets/esri/core/workers/chunks/39d2b540738431adec98.js +0 -1
  141. package/assets/esri/core/workers/chunks/48820e12d94eb49c0a65.js +0 -1
  142. package/assets/esri/core/workers/chunks/4c278fb2d51ca6226050.js +0 -1
  143. package/assets/esri/core/workers/chunks/4d6706d6dbe578653c28.js +0 -1
  144. package/assets/esri/core/workers/chunks/4ff40eea70d19c934504.js +0 -1
  145. package/assets/esri/core/workers/chunks/59ce992d3a5e7c32b9fb.js +0 -1
  146. package/assets/esri/core/workers/chunks/5e30acfda04f7fc2b676.js +0 -1
  147. package/assets/esri/core/workers/chunks/6052eccb9395c8efb295.js +0 -1
  148. package/assets/esri/core/workers/chunks/61369838aa337d0156c5.js +0 -1
  149. package/assets/esri/core/workers/chunks/690a40d2eef52bfc149f.js +0 -1
  150. package/assets/esri/core/workers/chunks/6b820f14c110d9da118e.js +0 -1
  151. package/assets/esri/core/workers/chunks/7fd2366ee1fc81fa8c56.js +0 -1
  152. package/assets/esri/core/workers/chunks/8d9e622cec13f5cea726.js +0 -1
  153. package/assets/esri/core/workers/chunks/9110287f272141f60c35.js +0 -1
  154. package/assets/esri/core/workers/chunks/98997841ec3955287ba2.js +0 -1
  155. package/assets/esri/core/workers/chunks/a716b8fdeda4e16f03ab.js +0 -1
  156. package/assets/esri/core/workers/chunks/a9577a700b6a7b69d6aa.js +0 -1
  157. package/assets/esri/core/workers/chunks/ad4fcb73cfe9a1e4b710.js +0 -1
  158. package/assets/esri/core/workers/chunks/aead7c9830fa310e5b53.js +0 -1
  159. package/assets/esri/core/workers/chunks/b48aceaeefa07214e430.js +0 -1
  160. package/assets/esri/core/workers/chunks/bcfa98b6866a96c194cb.js +0 -1
  161. package/assets/esri/core/workers/chunks/c052fb8c952cda0b5d13.js +0 -1
  162. package/assets/esri/core/workers/chunks/c0d6f8e55349f4f5cd58.js +0 -1
  163. package/assets/esri/core/workers/chunks/c1a4d1ec0125617374b4.js +0 -1
  164. package/assets/esri/core/workers/chunks/c582fb447c89d732cfff.js +0 -1
  165. package/assets/esri/core/workers/chunks/cb500d673ca7ec1ef945.js +0 -1
  166. package/assets/esri/core/workers/chunks/ce99abfdcd71ff9e4e36.js +0 -1
  167. package/assets/esri/core/workers/chunks/cf0e2c91b330b1d0ef77.js +0 -1
  168. package/assets/esri/core/workers/chunks/d764b6273974f4bca31b.js +0 -1
  169. package/assets/esri/core/workers/chunks/d87dc2eeffabd3507143.js +0 -1
  170. package/assets/esri/core/workers/chunks/dca6a61fd239cf1ff90c.js +0 -1
  171. package/assets/esri/core/workers/chunks/edc3d98f33d7bf959154.js +0 -1
  172. package/assets/esri/core/workers/chunks/f1381c5a2a1de1ef9139.js +0 -1
  173. package/assets/esri/core/workers/chunks/f6148611d883a59f8fb8.js +0 -1
  174. package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +0 -5
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7677],{563:(e,t,i)=>{i.d(t,{QueueProcessor:()=>c,SharedConcurrency:()=>h});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.process=e.process,this.concurrency=e.concurrency,this.sharedConcurrency=e.sharedConcurrency??d,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.full}get full(){return this._processingItems.size>=this.concurrency||this.sharedConcurrency.full}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.sharedConcurrency.current.value-=this._processingItems.size,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.sharedConcurrency.current.value-=this._processingItems.size,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.has(e)&&(this._processingItems.delete(e),this.sharedConcurrency.current.value-=1)}_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.sharedConcurrency.full;)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),this.sharedConcurrency.current.value+=1;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}}class h{constructor(e){this.limit=e,this.current=(0,a.v)(0)}get full(){return this.current.value>=this.limit}}const d=new h(1/0)},4916:(e,t,i)=>{i.d(t,{A:()=>D});var s=i(31635),n=i(11254),r=i(49186),o=i(25482),l=i(53966),a=i(74887),c=i(563),u=i(91429),h=i(56507),d=i(5443),p=i(86738),f=i(16930),m=i(60694),g=i(10873),y=i(45617),x=i(91806),_=i(20223),b=i(87045),w=i(76353),v=i(77301),I=i(70834);const R=new Map,S=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 C(e,t,i){const s=R.get(e);if(!s)return null==t?S.decreaseRefCount(e,i):0;if(null==t||null==s[t])return S.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 k(e,t,i){const s=R.get(e);if(!s)return null==t?S.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 S.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 M(e,t,i,s,n=null){const r=R.get(e);if(!r)return void(null==t&&S.putBlock(e,i,s,n));if(null==t||null==r[t])return void S.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 T(e,t,i){const s=R.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):S.deleteBlock(e,i):null==t&&S.deleteBlock(e,i)}var A=i(16019),z=i(77649),P=i(28435),F=i(14636);let B=0,D=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,I.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,w.qg)(this)&&this.primaryRasters?.rasters?.forEach(t=>t.rasterJobHandler=e)}get rasterId(){return this.url||"rasterId-"+B++}set url(e){this._set("url",(0,m.Jf)(e,l.A.getLogger(this)))}async open(e){return this._openPromise??=(0,I.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)(p.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,v.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:f}=t;let m=(0,I._I)(e,c,f);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,w.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 d.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:p}=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!=p&&(x=!p.mask||p.mask[f]?p.pixels.map(e=>e[f]):void 0),{location:m,value:g,processedValue:x,pyramidLevel:0}}if(!y)if(t.srcResolution)g=(0,I.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:b,rowOffset:R,colOffset:S,blockWidth:C}=x,k=await this._fetchRawTile(g,_,b,t);if(!k?.pixels?.length)return{location:m,value:null};const M=R*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,I.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:n}=this;if(s.requestRawData&&n)return this._fetchPixels(e,t,i,s);const r=(0,I.FT)(e.spatialReference),o=(0,I.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 p=0;const f=[];for(let n=0;n<=o;n++){const m=new d.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-p:u;p+=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,I._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 d.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:p,mosaicSize:f}=n;if(1===p.length&&null!=p[0]&&p[0].width===i.width&&p[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:p,srcMosaicSize:f,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,P.z7)(p,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,I._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,z.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,v.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 x.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 p.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 p.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 _.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,I._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 d.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=f.A.WebMercator;e.spatialReference=n,e.extent=e.nativeExtent=new d.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:n}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new p.A({x:1,y:1,spatialReference:n});const{extent:r,storageInfo:o}=e;if(o){o.origin=new p.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,I.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,f=d.transform,m="gcs-shift"===f?.type,g=null!=(0,I.FT)(e.spatialReference);!m&&g||(n=(0,I.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,b=o>0?x.pyramidBlockHeight:x.blockHeight;let{x:w,y:v}=d.pixelSize;if(o>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=x;if(null!=e&&e[o-1])({x:w,y:v}=e[o-1]);else{const e=t**o;w*=e,v*=e}}const R=d.spatialReference,S=new p.A({x:w,y:v,spatialReference:R}),C=_===c&&b===u&&h.x%_===0&&h.y%b===0,k=new p.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),M=!e.spatialReference.equals(R),T=R.isGeographic?1e-9:1e-4,{datumTransformation:A}=s;if(!M&&C&&1===y.pixelBlocks.length&&_===t&&b===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,I.FT)(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,B=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");B&&!this.rasterJobHandler&&await(0,I.Hh)();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k.toJSON(),datumTransformation:A,rasterTransform:f,hasWrapAround:n>0||z,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:B},s):(0,I.l0)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k,datumTransformation:A,rasterTransform:f,hasWrapAround:n>0||z,isAdaptive:!1,includeGCSGrid:B});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:Z}=y;let q=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:B,gcsGrid:B?D.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:H,blockWidths:null},s);({pixelBlock:N,localNorthDirections:q}=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,B&&D.gcsGrid&&(q=(0,P.QF)({width:t,height:i},D.gcsGrid),N=(0,F.Y2)(N,this.rasterInfo.dataType,q))}return s.requestRawData||B?{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N,transformGrid:D,localNorthDirections:q,isPartiallyFilled:Z}:{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:p}=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;p&&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),b=Math.floor((a+u+m-1)/o),w=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===p&&(w<I||b<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<=w;t++)for(let i=x;i<=b;i++){let n=i;if(!s.disableWrapAround&&p&&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:(w-_+1)*l,width:(b-x+1)*o},{spatialReference:P}=this.rasterInfo,F=this.getPyramidPixelSize(e),{x:B,y:D}=F;return{extent:new d.A({xmin:n.x+x*o*B,xmax:n.x+(b+1)*o*B,ymin:n.y-(w+1)*l*D,ymax:n.y-_*l*D,spatialReference:P}),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=k(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 a)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});M(c,s.registryId,u,h,r),h.catch(()=>T(c,s.registryId,u))}return s.signal&&(0,a.u7)(s,()=>{C(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,F.Lu)([n[e],r[e]]);o.push(t),l.push(i)}return[o,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,I.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 p.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=(0,I.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,I.t$)(n,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,I._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,w.$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,v.QW)(l,h.transposedVariableName);if(u){const e=(0,v.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,A.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 y.A({...e,isSlice:!0}))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i}),pyramidLevel:n}}};(0,s.Cg)([(0,u.MZ)()],D.prototype,"_rasterTileAlignmentInfo",void 0),(0,s.Cg)([(0,u.MZ)()],D.prototype,"_tileFetchQueue",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],D.prototype,"_isGlobalWrappableSource",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],D.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s.Cg)([(0,u.MZ)()],D.prototype,"_openPromise",void 0),(0,s.Cg)([(0,u.MZ)()],D.prototype,"rasterJobHandler",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],D.prototype,"rasterId",null),(0,s.Cg)([(0,u.MZ)(g.OZ)],D.prototype,"url",null),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],D.prototype,"datasetName",void 0),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],D.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,u.MZ)()],D.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s.Cg)([(0,u.MZ)()],D.prototype,"rasterInfo",void 0),(0,s.Cg)([(0,u.MZ)()],D.prototype,"ioConfig",void 0),(0,s.Cg)([(0,u.MZ)()],D.prototype,"sourceJSON",void 0),D=(0,s.Cg)([(0,u.$K)("esri.layers.support.rasterDatasets.BaseRaster")],D)},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._notifyPending=!1,this._batchDepth=0,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}batch(e){try{this._batchDepth++,e()}finally{this._batchDepth--,this._notifyPending&&0===this._batchDepth&&(this._notifyPending=!1,this._notify())}}clear(){this._map.size>0&&(this._map.clear(),this._notify())}delete(e){const t=this._map.delete(e);return t&&this._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._notify(),this}transformValues(e,t=this._map.keys()){this.batch(()=>{for(const i of t){if(!this._map.has(i))continue;const t=this._map.get(i),s=e(t,i);s!==t&&this.set(i,s)}})}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]}_notify(){this._batchDepth>0?this._notifyPending=!0:this._observable.notify()}}},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:()=>d});var s=i(31635),n=i(49186),r=i(91429),o=i(39829),l=i(4916),a=i(77359),c=i(28435),u=i(70834),h=i(22671);let d=class extends l.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,u=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&u&&(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,a.$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,c.$i)(g,{width:t,height:i},y.coefficients,x,l);const b=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||null==_||null==b||(_=await(0,a.$Q)(_,e,b)),{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,u.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=h.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(o.A.fromExtent(e),2*(e.width+e.height)/40);r=(0,u.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}})],d.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,r.MZ)()],d.prototype,"tileType",void 0),(0,s.Cg)([(0,r.MZ)()],d.prototype,"rasterFunction",void 0),(0,s.Cg)([(0,r.MZ)()],d.prototype,"primaryRasters",void 0),d=(0,s.Cg)([(0,r.$K)("esri.layers.support.rasterDatasets.FunctionRaster")],d)},87045:(e,t,i)=>{i.d(t,{A:()=>_});var s,n=i(31635),r=i(66552),o=i(25482),l=i(86211),a=i(91429),c=i(56507),u=i(86738),h=i(16930),d=i(21325),p=i(28735),f=i(91806),m=i(72802),g=i(36005),y=i(43937);const x=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 _=class extends o.o{static{s=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:n=256,spatialReference:r=h.A.WebMercator,numLODs:o=24}=e;if(!(0,d.fn)(r)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new f.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new f.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new u.A(0,0,r),size:[n,n],spatialReference:r})}const a=(0,d.Vp)(r),c=e.origin?new u.A({x:e.origin.x,y:e.origin.y,spatialReference:r}):new u.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),p=1/(39.37*(0,l.GA)(r)*96),m=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*p;m.push(new f.A({level:e,scale:t,resolution:s}))}else{let e=(0,d.EA)(r)?512/n*591657527.5917094:256/n*591657527.591555;const i=Math.ceil(o/t);m.push(new f.A({level:0,scale:e,resolution:e*p}));for(let s=1;s<i;s++){const i=e/2**t,n=i*p;m.push(new f.A({level:s,scale:i,resolution:n})),e=i}}return new s({dpi:96,lods:m,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,d.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return u.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,d.aI)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,s=i;else{const e=(0,p.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 m.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 f.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}})],_.prototype,"compressionQuality",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_.prototype,"dpi",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{read:x.read,write:x.write,origins:{"web-scene":{read:!1,write:!1}}}})],_.prototype,"format",void 0),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],_.prototype,"isWrappable",null),(0,n.Cg)([(0,a.MZ)({type:u.A,json:{write:!0}})],_.prototype,"origin",void 0),(0,n.Cg)([(0,g.w)("origin")],_.prototype,"readOrigin",null),(0,n.Cg)([(0,a.MZ)({type:[f.A],value:null,json:{write:!0}})],_.prototype,"lods",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],_.prototype,"scales",void 0),(0,n.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],_.prototype,"size",void 0),(0,n.Cg)([(0,g.w)("size",["rows","cols"])],_.prototype,"readSize",null),(0,n.Cg)([(0,y.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],_.prototype,"writeSize",null),(0,n.Cg)([(0,a.MZ)({type:h.A,json:{write:!0}})],_.prototype,"spatialReference",void 0),_=s=(0,n.Cg)([(0,a.$K)("esri.layers.support.TileInfo")],_)},89015:(e,t,i)=>{i.d(t,{o:()=>D});var s=i(31635),n=i(11254),r=i(49186),o=i(53966),l=i(91429),a=i(56507),c=i(86738),u=i(16930),h=i(21325),d=i(60694),p=i(10873),f=i(45617),m=i(43577),g=i(13868),y=i(22796),x=i(87045),_=i(76353),b=i(84169),w=i(77301),v=i(77359),I=i(6049),R=i(70834),S=i(6952),C=i(12711),k=i(85676),M=i(94359),T=i(22048),A=i(49410),z=i(34606),P=i(51508),F=i(93223),B=i(36005);const D=e=>{const t=e;let D=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,_.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,d.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,M.LF)(s,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,a.PZ)(T.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,R.Hh)();const e="extent"===s.type?(0,R._l)(s,o):(0,R.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 c.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:u,width:h,height:d}=(0,v.b7)(i,n,l),p=await this.fetchPixels(u,h,d,{...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,v.$Q)(p.pixelBlock,u,n),m=this._rasterJobHandler;return m?m.computeStatisticsHistograms({pixelBlock:f},t):(0,S.eH)(f)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,w.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,w.ct)(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),r=n?.name,o=(0,C.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,_.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,h.Vp)(e);return x.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(N(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)(z.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 P.A({samples:o})}async identify(e,t={}){await this.load(),e=(0,a.PZ)(c.A,e).clone().normalize();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&(!s.hasMultidimensionalTranspose||!(0,w.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,_.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,w.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,w.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,w.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,_.qg)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;N(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,(0,_.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 c.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,23346))).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 c.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),u=l.height/a,h=l.width/a,{xmin:d,ymax:p}=l,f=[];for(let e=0;e<u;e++)for(let i=0;i<h;i++){const n=new c.A({x:d+(i+.5)*a,y:p-(e+.5)*a,spatialReference:s});(o||t.contains(n))&&f.push(n)}return f}_configDefaultInterpolation(){if(null==this.interpolation){N(this);const{raster:e}=this,t=(0,C.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){N(this);const{rasterInfo:t}=this.raster,i=(0,w.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=(0,C.I8)({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??(0,C.ci)(t)),!this.renderer||"override"===e){const e=(0,C.Mm)(this.raster),i=n?.renderer??(0,C.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,C.$P)({...this.renderer.toJSON(),variableName:s}),l=(0,C.m7)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=r,this.symbolizer.rasterInfo=l):this.symbolizer=new k.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,C.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,_.qg)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",y.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,_.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,I.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),r=new b.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 A.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 A.A({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:n,attributes:l});r.push(a)}),r}};function N(e){if(!e.raster||!e.serviceRasterInfo)throw new r.A("imagery-tile","no raster")}return(0,s.Cg)([(0,l.MZ)({clonable:!1})],D.prototype,"_cachedRasterFunctionJson",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],D.prototype,"_compatibleFullExtent",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],D.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],D.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(",")}}}}})],D.prototype,"bandIds",void 0),(0,s.Cg)([(0,l.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],D.prototype,"copyright",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!1}})],D.prototype,"fullExtent",null),(0,s.Cg)([(0,l.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,F.e)(g.SZ)],D.prototype,"interpolation",void 0),(0,s.Cg)([(0,l.MZ)()],D.prototype,"ioConfig",void 0),(0,s.Cg)([(0,l.MZ)({type:[f.A],json:{write:!0}})],D.prototype,"multidimensionalDefinition",null),(0,s.Cg)([(0,l.MZ)({type:m.A,json:{write:!0}})],D.prototype,"multidimensionalSubset",void 0),(0,s.Cg)([(0,l.MZ)()],D.prototype,"raster",void 0),(0,s.Cg)([(0,l.MZ)({type:y.A})],D.prototype,"rasterFunction",null),(0,s.Cg)([(0,l.MZ)()],D.prototype,"serviceRasterInfo",void 0),(0,s.Cg)([(0,l.MZ)()],D.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0,type:u.A,json:{read:!1}})],D.prototype,"spatialReference",void 0),(0,s.Cg)([(0,l.MZ)({type:x.A})],D.prototype,"tileInfo",void 0),(0,s.Cg)([(0,l.MZ)(p.OZ)],D.prototype,"url",null),(0,s.Cg)([(0,l.MZ)()],D.prototype,"renderer",null),(0,s.Cg)([(0,l.MZ)({types:M.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:M.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],D.prototype,"internalRenderer",null),(0,s.Cg)([(0,B.w)("internalRenderer")],D.prototype,"readRenderer",null),(0,s.Cg)([(0,l.MZ)({clonable:!1})],D.prototype,"symbolizer",void 0),D=(0,s.Cg)([(0,l.$K)("esri.layers.mixins.ImageryTileMixin")],D),D}},91806:(e,t,i)=>{i.d(t,{A:()=>a});var s,n=i(31635),r=i(25482),o=i(91429),l=i(56507);let a=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}}}})],a.prototype,"cols",void 0),(0,n.Cg)([(0,o.MZ)({type:l.jz,json:{write:!0}})],a.prototype,"level",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],a.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}}}})],a.prototype,"origin",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],a.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}}}})],a.prototype,"rows",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],a.prototype,"scale",void 0),a=s=(0,n.Cg)([(0,o.$K)("esri.layers.support.LOD")],a)}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7677],{563:(e,t,i)=>{i.d(t,{QueueProcessor:()=>c,SharedConcurrency:()=>h});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.process=e.process,this.concurrency=e.concurrency,this.sharedConcurrency=e.sharedConcurrency??d,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.full}get full(){return this._processingItems.size>=this.concurrency||this.sharedConcurrency.full}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.sharedConcurrency.current.value-=this._processingItems.size,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.sharedConcurrency.current.value-=this._processingItems.size,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.has(e)&&(this._processingItems.delete(e),this.sharedConcurrency.current.value-=1)}_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.sharedConcurrency.full;)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),this.sharedConcurrency.current.value+=1;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}}class h{constructor(e){this.limit=e,this.current=(0,a.v)(0)}get full(){return this.current.value>=this.limit}}const d=new h(1/0)},4916:(e,t,i)=>{i.d(t,{A:()=>D});var s=i(31635),n=i(11254),r=i(49186),o=i(25482),l=i(53966),a=i(74887),c=i(563),u=i(91429),h=i(56507),d=i(5443),p=i(86738),f=i(16930),m=i(60694),g=i(10873),y=i(45617),x=i(91806),_=i(20223),b=i(87045),w=i(76353),v=i(77301),I=i(70834);const R=new Map,S=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 C(e,t,i){const s=R.get(e);if(!s)return null==t?S.decreaseRefCount(e,i):0;if(null==t||null==s[t])return S.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 k(e,t,i){const s=R.get(e);if(!s)return null==t?S.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 S.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 M(e,t,i,s,n=null){const r=R.get(e);if(!r)return void(null==t&&S.putBlock(e,i,s,n));if(null==t||null==r[t])return void S.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 T(e,t,i){const s=R.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):S.deleteBlock(e,i):null==t&&S.deleteBlock(e,i)}var A=i(16019),z=i(77649),P=i(28435),F=i(14636);let B=0,D=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,I.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,w.qg)(this)&&this.primaryRasters?.rasters?.forEach(t=>t.rasterJobHandler=e)}get rasterId(){return this.url||"rasterId-"+B++}set url(e){this._set("url",(0,m.Jf)(e,l.A.getLogger(this)))}async open(e){return this._openPromise??=(0,I.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)(p.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,v.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:f}=t;let m=(0,I._I)(e,c,f);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,w.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 d.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:p}=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!=p&&(x=!p.mask||p.mask[f]?p.pixels.map(e=>e[f]):void 0),{location:m,value:g,processedValue:x,pyramidLevel:0}}if(!y)if(t.srcResolution)g=(0,I.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:b,rowOffset:R,colOffset:S,blockWidth:C}=x,k=await this._fetchRawTile(g,_,b,t);if(!k?.pixels?.length)return{location:m,value:null};const M=R*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,I.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:n}=this;if(s.requestRawData&&n)return this._fetchPixels(e,t,i,s);const r=(0,I.FT)(e.spatialReference),o=(0,I.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 p=0;const f=[];for(let n=0;n<=o;n++){const m=new d.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-p:u;p+=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,I._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 d.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:p,mosaicSize:f}=n;if(1===p.length&&null!=p[0]&&p[0].width===i.width&&p[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:p,srcMosaicSize:f,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,P.z7)(p,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,I._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,z.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,v.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 x.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 p.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 p.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 _.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,I._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 d.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=f.A.WebMercator;e.spatialReference=n,e.extent=e.nativeExtent=new d.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:n}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new p.A({x:1,y:1,spatialReference:n});const{extent:r,storageInfo:o}=e;if(o){o.origin=new p.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,I.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,f=d.transform,m="gcs-shift"===f?.type,g=null!=(0,I.FT)(e.spatialReference);!m&&g||(n=(0,I.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,b=o>0?x.pyramidBlockHeight:x.blockHeight;let{x:w,y:v}=d.pixelSize;if(o>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=x;if(null!=e&&e[o-1])({x:w,y:v}=e[o-1]);else{const e=t**o;w*=e,v*=e}}const R=d.spatialReference,S=new p.A({x:w,y:v,spatialReference:R}),C=_===c&&b===u&&h.x%_===0&&h.y%b===0,k=new p.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),M=!e.spatialReference.equals(R),T=R.isGeographic?1e-9:1e-4,{datumTransformation:A}=s;if(!M&&C&&1===y.pixelBlocks.length&&_===t&&b===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,I.FT)(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,B=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");B&&!this.rasterJobHandler&&await(0,I.Hh)();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k.toJSON(),datumTransformation:A,rasterTransform:f,hasWrapAround:n>0||z,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:B},s):(0,I.l0)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k,datumTransformation:A,rasterTransform:f,hasWrapAround:n>0||z,isAdaptive:!1,includeGCSGrid:B});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:Z}=y;let q=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:B,gcsGrid:B?D.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:H,blockWidths:null},s);({pixelBlock:N,localNorthDirections:q}=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,B&&D.gcsGrid&&(q=(0,P.QF)({width:t,height:i},D.gcsGrid),N=(0,F.Y2)(N,this.rasterInfo.dataType,q))}return s.requestRawData||B?{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N,transformGrid:D,localNorthDirections:q,isPartiallyFilled:Z}:{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:p}=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;p&&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),b=Math.floor((a+u+m-1)/o),w=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===p&&(w<I||b<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<=w;t++)for(let i=x;i<=b;i++){let n=i;if(!s.disableWrapAround&&p&&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:(w-_+1)*l,width:(b-x+1)*o},{spatialReference:P}=this.rasterInfo,F=this.getPyramidPixelSize(e),{x:B,y:D}=F;return{extent:new d.A({xmin:n.x+x*o*B,xmax:n.x+(b+1)*o*B,ymin:n.y-(w+1)*l*D,ymax:n.y-_*l*D,spatialReference:P}),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=k(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 a)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});M(c,s.registryId,u,h,r),h.catch(()=>T(c,s.registryId,u))}return s.signal&&(0,a.u7)(s,()=>{C(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,F.Lu)([n[e],r[e]]);o.push(t),l.push(i)}return[o,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,I.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 p.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=(0,I.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,I.t$)(n,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,I._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,w.$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,v.QW)(l,h.transposedVariableName);if(u){const e=(0,v.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,A.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 y.A({...e,isSlice:!0}))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i}),pyramidLevel:n}}};(0,s.Cg)([(0,u.MZ)()],D.prototype,"_rasterTileAlignmentInfo",void 0),(0,s.Cg)([(0,u.MZ)()],D.prototype,"_tileFetchQueue",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],D.prototype,"_isGlobalWrappableSource",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],D.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s.Cg)([(0,u.MZ)()],D.prototype,"_openPromise",void 0),(0,s.Cg)([(0,u.MZ)()],D.prototype,"rasterJobHandler",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],D.prototype,"rasterId",null),(0,s.Cg)([(0,u.MZ)(g.OZ)],D.prototype,"url",null),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],D.prototype,"datasetName",void 0),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],D.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,u.MZ)()],D.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s.Cg)([(0,u.MZ)()],D.prototype,"rasterInfo",void 0),(0,s.Cg)([(0,u.MZ)()],D.prototype,"ioConfig",void 0),(0,s.Cg)([(0,u.MZ)()],D.prototype,"sourceJSON",void 0),D=(0,s.Cg)([(0,u.$K)("esri.layers.support.rasterDatasets.BaseRaster")],D)},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._notifyPending=!1,this._batchDepth=0,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}batch(e){try{this._batchDepth++,e()}finally{this._batchDepth--,this._notifyPending&&0===this._batchDepth&&(this._notifyPending=!1,this._notify())}}clear(){this._map.size>0&&(this._map.clear(),this._notify())}delete(e){const t=this._map.delete(e);return t&&this._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._notify(),this}transformValues(e,t=this._map.keys()){this.batch(()=>{for(const i of t){if(!this._map.has(i))continue;const t=this._map.get(i),s=e(t,i);s!==t&&this.set(i,s)}})}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]}_notify(){this._batchDepth>0?this._notifyPending=!0:this._observable.notify()}}},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:()=>d});var s=i(31635),n=i(49186),r=i(91429),o=i(39829),l=i(4916),a=i(77359),c=i(28435),u=i(70834),h=i(22671);let d=class extends l.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,u=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&u&&(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,a.$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,c.$i)(g,{width:t,height:i},y.coefficients,x,l);const b=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||null==_||null==b||(_=await(0,a.$Q)(_,e,b)),{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,u.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=h.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(o.A.fromExtent(e),2*(e.width+e.height)/40);r=(0,u.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}})],d.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,r.MZ)()],d.prototype,"tileType",void 0),(0,s.Cg)([(0,r.MZ)()],d.prototype,"rasterFunction",void 0),(0,s.Cg)([(0,r.MZ)()],d.prototype,"primaryRasters",void 0),d=(0,s.Cg)([(0,r.$K)("esri.layers.support.rasterDatasets.FunctionRaster")],d)},87045:(e,t,i)=>{i.d(t,{A:()=>_});var s,n=i(31635),r=i(66552),o=i(25482),l=i(86211),a=i(91429),c=i(56507),u=i(86738),h=i(16930),d=i(21325),p=i(28735),f=i(91806),m=i(72802),g=i(36005),y=i(43937);const x=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 _=class extends o.o{static{s=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:n=256,spatialReference:r=h.A.WebMercator,numLODs:o=24}=e;if(!(0,d.fn)(r)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new f.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new f.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new u.A(0,0,r),size:[n,n],spatialReference:r})}const a=(0,d.Vp)(r),c=e.origin?new u.A({x:e.origin.x,y:e.origin.y,spatialReference:r}):new u.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),p=1/(39.37*(0,l.GA)(r)*96),m=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*p;m.push(new f.A({level:e,scale:t,resolution:s}))}else{let e=(0,d.EA)(r)?512/n*591657527.5917094:256/n*591657527.591555;const i=Math.ceil(o/t);m.push(new f.A({level:0,scale:e,resolution:e*p}));for(let s=1;s<i;s++){const i=e/2**t,n=i*p;m.push(new f.A({level:s,scale:i,resolution:n})),e=i}}return new s({dpi:96,lods:m,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,d.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return u.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,d.aI)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,s=i;else{const e=(0,p.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 m.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 f.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}})],_.prototype,"compressionQuality",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],_.prototype,"dpi",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{read:x.read,write:x.write,origins:{"web-scene":{read:!1,write:!1}}}})],_.prototype,"format",void 0),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],_.prototype,"isWrappable",null),(0,n.Cg)([(0,a.MZ)({type:u.A,json:{write:!0}})],_.prototype,"origin",void 0),(0,n.Cg)([(0,g.w)("origin")],_.prototype,"readOrigin",null),(0,n.Cg)([(0,a.MZ)({type:[f.A],value:null,json:{write:!0}})],_.prototype,"lods",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],_.prototype,"scales",void 0),(0,n.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],_.prototype,"size",void 0),(0,n.Cg)([(0,g.w)("size",["rows","cols"])],_.prototype,"readSize",null),(0,n.Cg)([(0,y.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],_.prototype,"writeSize",null),(0,n.Cg)([(0,a.MZ)({type:h.A,json:{write:!0}})],_.prototype,"spatialReference",void 0),_=s=(0,n.Cg)([(0,a.$K)("esri.layers.support.TileInfo")],_)},89015:(e,t,i)=>{i.d(t,{o:()=>D});var s=i(31635),n=i(11254),r=i(49186),o=i(53966),l=i(91429),a=i(56507),c=i(86738),u=i(16930),h=i(21325),d=i(60694),p=i(10873),f=i(45617),m=i(43577),g=i(13868),y=i(22796),x=i(87045),_=i(76353),b=i(84169),w=i(77301),v=i(77359),I=i(6049),R=i(70834),S=i(6952),C=i(12711),k=i(85676),M=i(94359),T=i(22048),A=i(49410),z=i(34606),P=i(51508),F=i(93223),B=i(36005);const D=e=>{const t=e;let D=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,_.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,d.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,M.LF)(s,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,a.PZ)(T.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,R.Hh)();const e="extent"===s.type?(0,R._l)(s,o):(0,R.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 c.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:u,width:h,height:d}=(0,v.b7)(i,n,l),p=await this.fetchPixels(u,h,d,{...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,v.$Q)(p.pixelBlock,u,n),m=this._rasterJobHandler;return m?m.computeStatisticsHistograms({pixelBlock:f},t):(0,S.eH)(f)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,w.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,w.ct)(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),r=n?.name,o=(0,C.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,_.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,h.Vp)(e);return x.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(N(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)(z.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 P.A({samples:o})}async identify(e,t={}){await this.load(),e=(0,a.PZ)(c.A,e).clone().normalize();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&(!s.hasMultidimensionalTranspose||!(0,w.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,_.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,w.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,w.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,w.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,_.qg)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;N(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,(0,_.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 c.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,23346))).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 c.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),u=l.height/a,h=l.width/a,{xmin:d,ymax:p}=l,f=[];for(let e=0;e<u;e++)for(let i=0;i<h;i++){const n=new c.A({x:d+(i+.5)*a,y:p-(e+.5)*a,spatialReference:s});(o||t.contains(n))&&f.push(n)}return f}_configDefaultInterpolation(){if(null==this.interpolation){N(this);const{raster:e}=this,t=(0,C.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){N(this);const{rasterInfo:t}=this.raster,i=(0,w.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=(0,C.I8)({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??(0,C.ci)(t)),!this.renderer||"override"===e){const e=(0,C.Mm)(this.raster),i=n?.renderer??(0,C.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,C.$P)({...this.renderer.toJSON(),variableName:s}),l=(0,C.m7)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=r,this.symbolizer.rasterInfo=l):this.symbolizer=new k.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,C.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,_.qg)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",y.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,_.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,I.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),r=new b.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 A.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 A.A({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:n,attributes:l});r.push(a)}),r}};function N(e){if(!e.raster||!e.serviceRasterInfo)throw new r.A("imagery-tile","no raster")}return(0,s.Cg)([(0,l.MZ)({clonable:!1})],D.prototype,"_cachedRasterFunctionJson",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],D.prototype,"_compatibleFullExtent",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],D.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],D.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(",")}}}}})],D.prototype,"bandIds",void 0),(0,s.Cg)([(0,l.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],D.prototype,"copyright",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!1}})],D.prototype,"fullExtent",null),(0,s.Cg)([(0,l.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,F.e)(g.SZ)],D.prototype,"interpolation",void 0),(0,s.Cg)([(0,l.MZ)()],D.prototype,"ioConfig",void 0),(0,s.Cg)([(0,l.MZ)({type:[f.A],json:{write:!0}})],D.prototype,"multidimensionalDefinition",null),(0,s.Cg)([(0,l.MZ)({type:m.A,json:{write:!0}})],D.prototype,"multidimensionalSubset",void 0),(0,s.Cg)([(0,l.MZ)()],D.prototype,"raster",void 0),(0,s.Cg)([(0,l.MZ)({type:y.A})],D.prototype,"rasterFunction",null),(0,s.Cg)([(0,l.MZ)()],D.prototype,"serviceRasterInfo",void 0),(0,s.Cg)([(0,l.MZ)()],D.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0,type:u.A,json:{read:!1}})],D.prototype,"spatialReference",void 0),(0,s.Cg)([(0,l.MZ)({type:x.A})],D.prototype,"tileInfo",void 0),(0,s.Cg)([(0,l.MZ)(p.OZ)],D.prototype,"url",null),(0,s.Cg)([(0,l.MZ)({types:M.uy})],D.prototype,"renderer",null),(0,s.Cg)([(0,l.MZ)({types:M.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:M.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],D.prototype,"internalRenderer",null),(0,s.Cg)([(0,B.w)("internalRenderer")],D.prototype,"readRenderer",null),(0,s.Cg)([(0,l.MZ)({clonable:!1})],D.prototype,"symbolizer",void 0),D=(0,s.Cg)([(0,l.$K)("esri.layers.mixins.ImageryTileMixin")],D),D}},91806:(e,t,i)=>{i.d(t,{A:()=>a});var s,n=i(31635),r=i(25482),o=i(91429),l=i(56507);let a=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}}}})],a.prototype,"cols",void 0),(0,n.Cg)([(0,o.MZ)({type:l.jz,json:{write:!0}})],a.prototype,"level",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],a.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}}}})],a.prototype,"origin",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],a.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}}}})],a.prototype,"rows",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],a.prototype,"scale",void 0),a=s=(0,n.Cg)([(0,o.$K)("esri.layers.support.LOD")],a)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8692],{8303:(e,t,i)=>{i.d(t,{A:()=>T});var a=i(31635),s=i(92602),r=i(70333),n=i(11254),o=i(60999),l=i(49186),d=i(53966),h=i(97768),p=i(74887),u=i(84952),y=i(91429),c=i(77548),g=i(20655),f=i(80812),m=i(41318),w=i(10407),M=i(36005),b=i(43937);const T=e=>{const t=e;let T=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,h.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new f.default({id:t.itemId,portal:i?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:a}=await i.e(1204).then(i.bind(i,41204));return(0,p.Te)(t),await a({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,p.zf)(e)||d.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,p.QP)(e),!0)))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:i,fullEdit:a},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",i),this._set("userHasFullEditingPrivileges",a),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let i=this.portalItem;if(!e||!i||!i.loaded||i.sourceUrl)return this._fetchFallbackUserPrivileges(t);const a=!r.id?.findCredential(this.url),s=e===i.id;if(s&&i.portal.user)return this._getUserPrivileges(i,a);let n,o;if(s)n=i.portal.url;else try{n=await(0,c.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!n||!(0,u.b8)(n,i.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(r.id?.getCredential(`${n}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const l=!0,d=!1,h=!1;if(!o)return{features:{edit:l,fullEdit:d},content:{updateItem:h}};try{if(s?await i.reload():(i=new f.default({id:e,portal:{url:n}}),await i.load(t)),i.portal.user)return this._getUserPrivileges(i,a)}catch(e){(0,p.QP)(e)}return{features:{edit:l,fullEdit:d},content:{updateItem:h}}}_getUserPrivileges(e,t){const i=(0,w.It)(e);return t&&(i.features.edit=!0),i}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?r.id?.findCredential(this.url):null;if(!t)return!0;const i=_.credential===t?_.user:await this._fetchEditingUser(e);return _.credential=t,_.user=i,null==i?.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=r.id?.findServerInfo(this.url??"");if(!i?.owningSystemUrl)return null;const a=`${i.owningSystemUrl}/sharing/rest`,s=g.A.getDefault();if(s&&s.loaded&&(0,u.S8)(s.restUrl)===(0,u.S8)(a))return s.user;const l=`${a}/community/self`,d=null!=e?e.signal:null,h=await(0,o.Ke)((0,n.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:d}));return h.ok?m.A.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t?.portal,a=this.portalItem?.id&&(this.portalItem.portal||g.A.getDefault());return i&&a&&!(0,u.ut)(a.restUrl,i.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,a.Cg)([(0,y.MZ)({type:f.default})],T.prototype,"portalItem",null),(0,a.Cg)([(0,M.w)("web-document","portalItem",["itemId"])],T.prototype,"readPortalItem",null),(0,a.Cg)([(0,b.K)("web-document","portalItem",{itemId:{type:String}})],T.prototype,"writePortalItem",null),(0,a.Cg)([(0,y.MZ)({clonable:!1})],T.prototype,"resourceReferences",void 0),(0,a.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],T.prototype,"userHasEditingPrivileges",void 0),(0,a.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],T.prototype,"userHasFullEditingPrivileges",void 0),(0,a.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],T.prototype,"userHasUpdateItemPrivileges",void 0),T=(0,a.Cg)([(0,y.$K)("esri.layers.mixins.PortalLayer")],T),T},_={credential:null,user:null}},10407:(e,t,i)=>{i.d(t,{It:()=>y,LG:()=>n,OM:()=>d,Sm:()=>h,Y:()=>o,bK:()=>l,mm:()=>u,sQ:()=>p});var a=i(91218),s=i(16930),r=i(28735);function n(e,t){if(!o(e,t)){const i=e.typeKeywords;i?i.push(t):e.typeKeywords=[t]}}function o(e,t){return!!e.typeKeywords?.includes(t)}function l(e){return o(e,u.HOSTED_SERVICE)}function d(e,t){const i=e.typeKeywords;if(i){const e=i.indexOf(t);e>-1&&i.splice(e,1)}}function h(e,t,i){i?n(e,t):d(e,t)}async function p(e){const t=e.clone().normalize();let i;if(t.length>1)for(const e of t)i?e.width>i.width&&(i=e):i=e;else i=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,r.ci)(e);const i=s.A.WGS84;return await(0,a.initializeProjection)(t,i),(0,a.project)(e,i)}(i)}const u={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function y(e){const{portal:t,isOrgItem:i,itemControl:a}=e,s=t.user?.privileges;let r=!s||s.includes("features:user:edit"),n=!!i&&!!s?.includes("features:user:fullEdit");const o="update"===a||"admin"===a;return o?n=r=!0:n&&(r=!0),{features:{edit:r,fullEdit:n},content:{updateItem:o}}}},18768:(e,t,i)=>{i.d(t,{b:()=>o});var a=i(31635),s=i(53966),r=i(91429),n=i(60694);const o=e=>{const t=e;let i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,n.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,n.Jf)(e,s.A.getLogger(this)))}};return(0,a.Cg)([(0,r.MZ)()],i.prototype,"title",null),(0,a.Cg)([(0,r.MZ)({type:String})],i.prototype,"url",null),i=(0,a.Cg)([(0,r.$K)("esri.layers.mixins.ArcGISService")],i),i}},28692:(e,t,i)=>{i.r(t),i.d(t,{default:()=>G});var a=i(31635),s=i(67996),r=i(7762),n=i(49186),o=i(53966),l=i(91869),d=i(25728),h=i(74887),p=i(36708),u=i(84952),y=i(13069),c=i(91429),g=i(35666),f=i(4146),m=i(24137),w=i(62796),M=i(54898),b=i(18768),T=i(63074),_=i(69208),v=i(16131),A=i(8303),I=i(54310),D=i(25036),S=i(10873),C=i(48441),L=i(97159),E=i(36005),P=i(43937);let k=class extends((0,T.dM)((0,D.j)((0,I.J)((0,b.b)((0,v.q)((0,A.A)((0,d.P)((0,_.d)(f.A))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(r.A.ofType(w.A)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(r.A.ofType(w.A)),this.type="knowledge-graph",this.url=null,this.addHandles((0,p.wB)(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),p.OH))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(e){(0,h.QP)(e)}await this._fetchMetadata(),await this._initializeLayerProperties(e),this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await(0,M.qN)(this)}async _fetchMetadata(){if(!this.url)throw new n.A("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await(0,C.fetchKnowledgeGraph)(this.url);this.knowledgeGraph=e,this._forEachGraphType(e=>{e.name&&this._graphTypeLookup.set(e.name,e)})}async _initializeLayerProperties(e){7===this.originIdOf("inclusionModeDefinition")?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(e),this._setMemberTypes(),this.dataManager=new m.P({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(e){const t=this.definitionSetMap?await(0,s.cZ)(this.definitionSetMap,!0,e?.signal?{signal:e.signal}:void 0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(e=>{const i=this._graphTypeLookup.get(e.graphTypeName);i&&!t.namedTypeDefinitions.has(i.name)&&t.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",t,(0,g.OL)(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:t}=e;if(t?.size>0)t.forEach((e,i)=>{const a=this._graphTypeLookup.get(i);if(!a)return o.A.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void t.delete(i);"relationship"!==a.type&&"entity"!==a.type&&(o.A.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't properly modeled and will be removed`),t.delete(i))});else if(!e.generateAllSublayers)throw new n.A("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],t=[];const{inclusionModeDefinition:i}=this,a=i?.namedTypeDefinitions;!i||i.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],t=this.knowledgeGraph.dataModel?.relationshipTypes??[]):a&&a.size>0&&a.forEach((i,a)=>{const s=this._graphTypeLookup.get(a);switch(s?.type){case"relationship":t.push(s);break;case"entity":e.push(s)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=t}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(t=>{e(t)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const t=new Set,i=[];for(const a of e)this._graphTypeLookup.has(a.typeName)&&(!1===this.layers.concat(this.tables).some(e=>e.objectType.name===a.typeName)&&(this.dataManager.sublayerCaches.set(a.typeName,new Map),t.add(a.typeName)),(0,l.tE)(this.sublayerIdsCache,a.typeName,()=>new Set).add(a.id),i.push(a));this.dataManager.addToLayer(i);for(const e of t){const t=this._graphTypeLookup.get(e);t&&(this._addSublayer(t),"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e))}await(0,M.qN)(this,Array.from(t)),this._refreshNamedTypes()}_createSublayers(e,t,i){e.forEach(e=>{const a=this._createSublayer(e);i(a)&&t.push(a),this._updateSublayerCaches(e)})}_addSublayer(e){const t=this._createSublayer(e);return t.geometryType?this.layers.push(t):this.tables.push(t),t}_createSublayer(e){return new w.A({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,t){t.forEach(t=>{t.parentCompositeLayer=this;const i=e.find(e=>e.type===t.graphType&&e.name===t.graphTypeName);i&&(t.objectType=i,this._updateSublayerCaches(i))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_saveUrlAsNewResource(e,t,i,a){e[t]="<pending>",i.pendingOperations.push(async function(e){const t=await(0,s.fe)(e);return new Blob([t],{type:"application/x-protobuf"})}(this.inclusionModeDefinition).then(s=>{const r=function(e){const t=`definitionSetMap-${(0,y.lk)()}.dat`,i=(0,u.fj)("knowledgeGraphLayer",t);return e.resourceFromPath(i)}(a);e[t]=r.itemRelativeUrl,i.toAdd.push({resource:r,content:{type:"blob",blob:s},compress:!1,finish:e=>{this.definitionSetMap=e.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:t}]of e.namedTypeDefinitions)if(!t)return!1;return!0}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}readDefinitionSetMap(e,t,i){return(0,L.f)(e,i)}writeDefinitionSetMap(e,t,i,a){const s=a?.portalItem,r=a?.resources,n=(0,g.aB)(a?.origin);if(!s||!r||null==n)return void(e&&(t[i]=(0,L.t)(e,a)));const{inclusionModeDefinition:o}=this;if(!o||this._displaysAllRecords(o))return void(this.definitionSetMap=null);const l=this.originIdOf("inclusionModeDefinition");if(7===l||this._namedTypesModified||n<l)this._saveUrlAsNewResource(t,i,r,s);else if(n===l&&e){const n=(0,L.t)(e,a);(0,u.oP)(n)?this._saveUrlAsNewResource(t,i,r,s):t[i]=n}}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):o.A.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}get sublayerCapabilities(){return(0,M.hZ)(this.knowledgeGraph)}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new r.A,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new r.A,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const i=(0,l.tE)(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(e=>{i.add(e.id)})})}async addRecords(e){await this.load(),await this._handleNewRecords(e)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new n.A("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(this.dataManager.sublayerCaches.has(e))throw new n.A("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),(0,l.tE)(this.sublayerIdsCache,e,()=>new Set);const i=this._addSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),await(0,M.qN)(this,[e]),this._refreshNamedTypes(),i}convertSublayerToDynamicData(e){if(!this.dataManager.inclusionModeDefinition)throw new n.A("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new n.A("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(!this.dataManager.sublayerCaches.has(e))throw new n.A("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");const t=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);t?.useAllData?o.A.getLogger(this).warn("This Knowledge Graph Layer already uses dynamic membership for the sublayer - no conversion was made"):(this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),this.sublayerIdsCache.delete(e),this._refreshNamedTypes())}convertSublayerToExplicitMembership(e){if(!this.dataManager.inclusionModeDefinition)throw new n.A("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new n.A("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");const t=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);if(!t||t.useAllData){if(!this.dataManager.sublayerCaches.has(e))throw new n.A("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");this.sublayerIdsCache.set(e,new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),this._refreshNamedTypes()}else o.A.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership for the sublayer - no conversion was made")}convertToFullyDynamicData(){this.dataManager.inclusionModeDefinition||o.A.getLogger(this).warn("This Knowledge Graph Layer already uses fully dynamic membership - no conversion was made"),this.sublayerIdsCache.clear(),this.dataManager.inclusionModeDefinition=null,this._refreshNamedTypes()}convertToExplicitMembership(){this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.size>0&&o.A.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership - no conversion was made"),this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map};for(const e of this.dataManager.sublayerCaches.keys())(0,l.tE)(this.sublayerIdsCache,e,()=>new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map});this._refreshNamedTypes()}async removeRecords(e){await this.load();const t=[];for(const i of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.members?.has(i.id)&&t.push(i);this.dataManager.removeFromLayer(t);for(const e of t)this.sublayerIdsCache.get(e.typeName)?.delete(e.id);return this._refreshNamedTypes(),t}};(0,a.Cg)([(0,c.MZ)()],k.prototype,"dataManager",void 0),(0,a.Cg)([(0,c.MZ)({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],k.prototype,"definitionSetMap",void 0),(0,a.Cg)([(0,E.w)("definitionSetMap")],k.prototype,"readDefinitionSetMap",null),(0,a.Cg)([(0,P.K)("definitionSetMap")],k.prototype,"writeDefinitionSetMap",null),(0,a.Cg)([(0,c.MZ)()],k.prototype,"inclusionModeDefinition",null),(0,a.Cg)([(0,c.MZ)()],k.prototype,"knowledgeGraph",void 0),(0,a.Cg)([(0,c.MZ)({type:r.A.ofType(w.A),json:{write:{ignoreOrigin:!0}}})],k.prototype,"layers",void 0),(0,a.Cg)([(0,c.MZ)()],k.prototype,"memberEntityTypes",void 0),(0,a.Cg)([(0,c.MZ)()],k.prototype,"memberRelationshipTypes",void 0),(0,a.Cg)([(0,c.MZ)({type:["KnowledgeGraphLayer"]})],k.prototype,"operationalLayerType",void 0),(0,a.Cg)([(0,c.MZ)()],k.prototype,"sublayerCapabilities",null),(0,a.Cg)([(0,c.MZ)()],k.prototype,"sublayerIdsCache",void 0),(0,a.Cg)([(0,c.MZ)({type:r.A.ofType(w.A),json:{write:{ignoreOrigin:!0}}})],k.prototype,"tables",void 0),(0,a.Cg)([(0,c.MZ)({json:{read:!1}})],k.prototype,"type",void 0),(0,a.Cg)([(0,c.MZ)(S.OZ)],k.prototype,"url",void 0),k=(0,a.Cg)([(0,c.$K)("esri.layers.KnowledgeGraphLayer")],k);const G=k},69208:(e,t,i)=>{i.d(t,{d:()=>r});var a=i(31635),s=i(91429);const r=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,a.Cg)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],i.prototype,"customParameters",void 0),i=(0,a.Cg)([(0,s.$K)("esri.layers.mixins.CustomParametersMixin")],i),i}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1863],{159:(e,t,r)=>{r.d(t,{A:()=>a});var n,i=r(31635),s=r(69622),o=r(91429),l=r(99157);let a=n=class extends s.A{constructor(e){super(e),this.steps=[]}getInverse(){const e=new n;for(let t=this.steps.length-1;t>=0;t--){const r=this.steps[t];e.steps.push(r.getInverse())}return e}};(0,i.Cg)([(0,o.MZ)({type:[l.A],nonNullable:!0})],a.prototype,"steps",void 0),a=n=(0,i.Cg)([(0,o.$K)("esri.geometry.operators.support.GeographicTransformation")],a)},162:(e,t,r)=>{r.r(t),r.d(t,{default:()=>V});var n=r(31635),i=r(7762),s=r(38961),o=r(25728),l=r(74887),a=r(36708),u=r(84952),c=r(91429),p=r(5443),f=r(16930),d=r(4146),h=r(63074),y=r(16131),m=r(8303),g=r(54310),b=r(25036),v=r(10873),w=r(65529),M=r(25482),_=r(92474),S=r(799),x=r(56507),I=r(89808),T=r(99959);const A=Symbol("isKMLGraphicOrigin");var F;class R extends T.A{get[(F=A,I.Q)](){return this.layer}constructor(e,t){super(),this[F]=!0,this.type="kml",this.layer=e,this.sublayer=t}get id(){return`${this.layer.id}:__${this.sublayer.id}__`}}var C=r(92602),P=r(70333),O=(r(37838),r(11254)),E=r(4718),Z=r(70328),j=r(6606);r(65494),r(22671);const L={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function G(e){const t=e.folders||[],r=t.slice(),n=new Map,i=new Map,s=new Map,o=new Map,l=new Map,a={esriGeometryPoint:i,esriGeometryPolyline:s,esriGeometryPolygon:o};(e.featureCollection?.layers||[]).forEach(e=>{const t=(0,E.o8)(e);t.featureSet.features=[];const r=e.featureSet.geometryType;n.set(r,t);const l=e.layerDefinition.objectIdField;"esriGeometryPoint"===r?q(i,l,e.featureSet.features):"esriGeometryPolyline"===r?q(s,l,e.featureSet.features):"esriGeometryPolygon"===r&&q(o,l,e.featureSet.features)}),e.groundOverlays&&e.groundOverlays.forEach(e=>{l.set(e.id,e)}),t.forEach(t=>{t.networkLinkIds.forEach(n=>{const i=function(e,t,r){const n=function(e,t){let r;return t.some(t=>t.id===e&&(r=t,!0)),r}(e,r);return n&&(n.parentFolderId=t,n.networkLink=n),n}(n,t.id,e.networkLinks);i&&r.push(i)})}),r.forEach(e=>{if(e.featureInfos){e.points=(0,E.o8)(n.get("esriGeometryPoint")),e.polylines=(0,E.o8)(n.get("esriGeometryPolyline")),e.polygons=(0,E.o8)(n.get("esriGeometryPolygon")),e.mapImages=[];for(const t of e.featureInfos)switch(t.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const r=a[t.type].get(t.id);r&&e[L[t.type]]?.featureSet.features.push(r);break}case"GroundOverlay":{const r=l.get(t.id);r&&e.mapImages.push(r);break}}e.fullExtent=$([e])}});const u=$(r);return{folders:t,sublayers:r,extent:u}}function N(e,t,r,n){const i=P.id?.findCredential(e);e=(0,u.a6)(e,{token:i?.token});const s=C.A.kmlServiceUrl;return(0,O.A)(s,{query:{url:e,model:"simple",folders:"",refresh:0!==r||void 0,outSR:JSON.stringify(t)},responseType:"json",signal:n})}function k(e,t,r=null,n=[]){const i=[],s={},o=t.sublayers,l=new Set(t.folders.map(e=>e.id));return o.forEach(t=>{const o=new e;if(r?o.read(t,r):o.read(t),n.length&&l.has(o.id)&&(o.visible=n.includes(o.id)),s[t.id]=o,null!=t.parentFolderId&&-1!==t.parentFolderId){const e=s[t.parentFolderId];e.sublayers||(e.sublayers=[]),e.sublayers?.unshift(o)}else i.unshift(o)}),i}function q(e,t,r){r.forEach(r=>{e.set(r.attributes[t],r)})}function $(e){const t=(0,Z.vt)(Z.qv),r=(0,Z.vt)(Z.qv);for(const n of e){if(n.polygons?.featureSet?.features)for(const e of n.polygons.featureSet.features)(0,j.LJ)(t,e.geometry),(0,Z.RF)(r,t);if(n.polylines?.featureSet?.features)for(const e of n.polylines.featureSet.features)(0,j.LJ)(t,e.geometry),(0,Z.RF)(r,t);if(n.points?.featureSet?.features)for(const e of n.points.featureSet.features)(0,j.LJ)(t,e.geometry),(0,Z.RF)(r,t);if(n.mapImages)for(const e of n.mapImages)(0,j.LJ)(t,e.extent),(0,Z.RF)(r,t)}return(0,Z.aI)(r,Z.qv)?void 0:{xmin:r[0],ymin:r[1],zmin:r[2],xmax:r[3],ymax:r[4],zmax:r[5],spatialReference:f.A.WGS84}}var z,D=r(36005);let J=z=class extends((0,w.Zt)((0,M.T)(_.x_))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([(0,a.on)(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},a.OH),(0,a.on)(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},a.OH),(0,a.wB)(()=>this.sublayers,(e,t)=>{if(t)for(const e of t)e.layer=e.parent=null;if(e)for(const t of e)t.parent=this,t.layer=this.layer},a.OH),(0,a.wB)(()=>this.layer,e=>{if(this.sublayers)for(const t of this.sublayers)t.layer=e},a.OH)])}initialize(){(0,a.C_)(()=>this.networkLink).then(()=>(0,a.C_)(()=>!0===this.visible)).then(()=>this.load())}load(e){if(!this.networkLink)return;if(this.networkLink.viewFormat)return;const t=null!=e?e.signal:null,r=this._fetchService(this._get("networkLink")?.href??"",t).then(e=>{const t=$(e.sublayers);this.fullExtent=p.A.fromJSON(t),this.sourceJSON=e;const r=(0,x.dp)(i.A.ofType(z),k(z,e));this.sublayers?this.sublayers.addMany(r):this.sublayers=r,this.layer?.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(r),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}get origin(){return this.layer?new R(this.layer,this):null}_fetchService(e,t){return N(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then(e=>G(e.data))}};(0,n.Cg)([(0,c.MZ)()],J.prototype,"description",void 0),(0,n.Cg)([(0,c.MZ)({type:p.A})],J.prototype,"fullExtent",void 0),(0,n.Cg)([(0,c.MZ)()],J.prototype,"id",void 0),(0,n.Cg)([(0,c.MZ)({readOnly:!0,value:null})],J.prototype,"networkLink",void 0),(0,n.Cg)([(0,c.MZ)({json:{write:{allowNull:!0}}})],J.prototype,"parent",void 0),(0,n.Cg)([(0,c.MZ)({type:i.A.ofType(J),json:{write:{allowNull:!0}}})],J.prototype,"sublayers",void 0),(0,n.Cg)([(0,c.MZ)({value:null,json:{read:{source:"name",reader:e=>(0,S._e)(e)}}})],J.prototype,"title",void 0),(0,n.Cg)([(0,c.MZ)({value:!0})],J.prototype,"visible",null),(0,n.Cg)([(0,D.w)("visible",["visibility"])],J.prototype,"readVisible",null),(0,n.Cg)([(0,c.MZ)()],J.prototype,"sourceJSON",void 0),(0,n.Cg)([(0,c.MZ)()],J.prototype,"layer",void 0),(0,n.Cg)([(0,c.MZ)()],J.prototype,"origin",null),J=z=(0,n.Cg)([(0,c.$K)("esri.layers.support.KMLSublayer")],J);var U=r(43937);const H=["kml","xml"];let B=class extends((0,h.dM)((0,g.J)((0,b.j)((0,y.q)((0,m.A)((0,o.P)(d.A))))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new s.A({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=f.A.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([(0,a.wB)(()=>this.sublayers,(e,t)=>{t&&t.forEach(e=>{e.parent=null,e.layer=null}),e&&e.forEach(e=>{e.parent=this,e.layer=this})},a.OH),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}get sublayerById(){const e=new Map;for(const t of this.allSublayers)e.set(t.id,t);return e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,r){return k(J,t,r,this._visibleFolders)}writeSublayers(e,t){const r=[],n=e.toArray();for(;n.length;){const e=n[0];e.networkLink||(e.visible&&r.push(e.id),e.sublayers&&n.push(...e.sublayers.toArray())),n.shift()}t.visibleFolders=r}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,u.e7)(this.url,H)||"KML":e}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],r=e=>{e.visible&&(t.push(e),e.sublayers&&e.sublayers.forEach(r))};return e?.forEach(r),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},e).catch(l.QP).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=G((await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:N(this.url??"",this.outSpatialReference,this.refreshInterval,e))).data);t&&this.read(t,{origin:"service"})}_recomputeFullExtent(){let e=null;null!=this.extent&&(e=this.extent.clone());const t=r=>{if(r.sublayers)for(const n of r.sublayers.items)t(n),n.visible&&n.fullExtent&&(null!=e?e.union(n.fullExtent):e=n.fullExtent.clone())};return t(this),e}};(0,n.Cg)([(0,c.MZ)({readOnly:!0})],B.prototype,"allSublayers",void 0),(0,n.Cg)([(0,c.MZ)({readOnly:!0})],B.prototype,"sublayerById",null),(0,n.Cg)([(0,c.MZ)({type:f.A})],B.prototype,"outSpatialReference",void 0),(0,n.Cg)([(0,c.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],B.prototype,"path",void 0),(0,n.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1,write:!1}})],B.prototype,"legendEnabled",void 0),(0,n.Cg)([(0,c.MZ)({type:["show","hide","hide-children"]})],B.prototype,"listMode",void 0),(0,n.Cg)([(0,c.MZ)({type:["KML"]})],B.prototype,"operationalLayerType",void 0),(0,n.Cg)([(0,c.MZ)({})],B.prototype,"resourceInfo",void 0),(0,n.Cg)([(0,c.MZ)({type:i.A.ofType(J),json:{write:{ignoreOrigin:!0}}})],B.prototype,"sublayers",void 0),(0,n.Cg)([(0,D.w)(["web-map","portal-item"],"sublayers",["visibleFolders"])],B.prototype,"readSublayersFromItemOrWebMap",null),(0,n.Cg)([(0,D.w)("service","sublayers",["sublayers"])],B.prototype,"readSublayers",null),(0,n.Cg)([(0,U.K)("sublayers")],B.prototype,"writeSublayers",null),(0,n.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),(0,n.Cg)([(0,c.MZ)({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],B.prototype,"title",null),(0,n.Cg)([(0,c.MZ)(v.OZ)],B.prototype,"url",void 0),(0,n.Cg)([(0,c.MZ)({readOnly:!0})],B.prototype,"visibleSublayers",null),(0,n.Cg)([(0,c.MZ)({type:p.A})],B.prototype,"extent",void 0),(0,n.Cg)([(0,c.MZ)()],B.prototype,"fullExtent",null),B=(0,n.Cg)([(0,c.$K)("esri.layers.KMLLayer")],B);const V=B},4197:(e,t,r)=>{r.d(t,{Vj:()=>u,cj:()=>a,jh:()=>s,l5:()=>l,xm:()=>o});var n=r(34275),i=r(9093);function s(e){return e<=n.y9?new Array(e).fill(0):new Float64Array(e)}function o(e){return((0,n.iu)(e)?e.byteLength/8:e.length)<=n.y9?Array.from(e):new Float64Array(e)}function l(e,t,r){return Array.isArray(e)?e.slice(t,t+r):e.subarray(t,t+r)}function a(e){return[...e]}function u(e){const t=(0,i.vt)();for(let r=0;r<16;++r)t[r]=e[r];return t}},6797:(e,t,r)=>{r.d(t,{Ui:()=>f});var n=r(69622),i=r(7762),s=r(88620);const o=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function l(e){return e instanceof n.A}function a(e){return e instanceof i.A?Object.keys(e.items):l(e)?(0,s.oY)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof i.A?e.items[t]:e[t]}function c(e){return e?e.declaredClass:null}function p(e,t){const r=e.diff;if(r&&"function"==typeof r)return r(e,t);const n=a(e),i=a(t);if(0===n.length&&0===i.length)return;if(!n.length||!i.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const s=i.filter(e=>!n.includes(e)),f=n.filter(e=>!i.includes(e)),d=n.filter(r=>i.includes(r)&&u(e,r)!==u(t,r)).concat(s,f).sort(),h=c(e);if(h&&o.has(h)&&d.length)return{type:"complete",oldValue:e,newValue:t};let y;const m=l(e)&&l(t);for(const n of d){const i=u(e,n),s=u(t,n);let o;if((m||"function"!=typeof i&&"function"!=typeof s)&&i!==s&&(null!=i||null!=s)){if(r&&r[n]&&"function"==typeof r[n])o=r[n]?.(i,s);else if(i instanceof Date&&s instanceof Date){if(i.getTime()===s.getTime())continue;o={type:"complete",oldValue:i,newValue:s}}else o="object"==typeof i&&"object"==typeof s&&c(i)===c(s)?p(i,s):{type:"complete",oldValue:i,newValue:s};null!=o&&(null!=y?y.diff[n]=o:y={type:"partial",diff:{[n]:o}})}}return y}function f(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&c(e)!==c(t)?{type:"complete",oldValue:e,newValue:t}:p(e,t)}},8303:(e,t,r)=>{r.d(t,{A:()=>M});var n=r(31635),i=r(92602),s=r(70333),o=r(11254),l=r(60999),a=r(49186),u=r(53966),c=r(97768),p=r(74887),f=r(84952),d=r(91429),h=r(77548),y=r(20655),m=r(80812),g=r(41318),b=r(10407),v=r(36005),w=r(43937);const M=e=>{const t=e;let M=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new m.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:n}=await r.e(1204).then(r.bind(r,41204));return(0,p.Te)(t),await n({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,p.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,p.QP)(e),!0)))}async setUserPrivileges(e,t){if(!i.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:n},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",n),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const n=!s.id?.findCredential(this.url),i=e===r.id;if(i&&r.portal.user)return this._getUserPrivileges(r,n);let o,l;if(i)o=r.portal.url;else try{o=await(0,h.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!o||!(0,f.b8)(o,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;l=await(s.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const a=!0,u=!1,c=!1;if(!l)return{features:{edit:a,fullEdit:u},content:{updateItem:c}};try{if(i?await r.reload():(r=new m.default({id:e,portal:{url:o}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,n)}catch(e){(0,p.QP)(e)}return{features:{edit:a,fullEdit:u},content:{updateItem:c}}}_getUserPrivileges(e,t){const r=(0,b.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const r=_.credential===t?_.user:await this._fetchEditingUser(e);return _.credential=t,_.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=s.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const n=`${r.owningSystemUrl}/sharing/rest`,i=y.A.getDefault();if(i&&i.loaded&&(0,f.S8)(i.restUrl)===(0,f.S8)(n))return i.user;const a=`${n}/community/self`,u=null!=e?e.signal:null,c=await(0,l.Ke)((0,o.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?g.A.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,n=this.portalItem?.id&&(this.portalItem.portal||y.A.getDefault());return r&&n&&!(0,f.ut)(n.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,n.Cg)([(0,d.MZ)({type:m.default})],M.prototype,"portalItem",null),(0,n.Cg)([(0,v.w)("web-document","portalItem",["itemId"])],M.prototype,"readPortalItem",null),(0,n.Cg)([(0,w.K)("web-document","portalItem",{itemId:{type:String}})],M.prototype,"writePortalItem",null),(0,n.Cg)([(0,d.MZ)({clonable:!1})],M.prototype,"resourceReferences",void 0),(0,n.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],M.prototype,"userHasEditingPrivileges",void 0),(0,n.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],M.prototype,"userHasFullEditingPrivileges",void 0),(0,n.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],M.prototype,"userHasUpdateItemPrivileges",void 0),M=(0,n.Cg)([(0,d.$K)("esri.layers.mixins.PortalLayer")],M),M},_={credential:null,user:null}},9093:(e,t,r)=>{function n(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function i(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}r.d(t,{o8:()=>i,vt:()=>n,zK:()=>s});const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:s,clone:i,create:n,fromValues:function(e,t,r,n,i,s,o,l,a,u,c,p,f,d,h,y){return[e,t,r,n,i,s,o,l,a,u,c,p,f,d,h,y]}},Symbol.toStringTag,{value:"Module"}))},9762:(e,t,r)=>{r.r(t),r.d(t,{projectBuffer:()=>i});var n=r(37539);function i(e,t,r,i,s,o,l=Math.floor(e.length/3)){const a=(0,n.jd)(t,s);if(null==a)return!1;if(a===n.pO){if(e===i&&r===o)return!0;const t=r+3*l;for(let n=r,s=o;n<t;n++,s++)i[s]=e[n]??0;return!0}const u=r+3*l;for(let t=r,n=o;t<u;t+=3,n+=3)a(e,t,i,n);return!0}},10407:(e,t,r)=>{r.d(t,{It:()=>d,LG:()=>o,OM:()=>u,Sm:()=>c,Y:()=>l,bK:()=>a,mm:()=>f,sQ:()=>p});var n=r(91218),i=r(16930),s=r(28735);function o(e,t){if(!l(e,t)){const r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function l(e,t){return!!e.typeKeywords?.includes(t)}function a(e){return l(e,f.HOSTED_SERVICE)}function u(e,t){const r=e.typeKeywords;if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}function c(e,t,r){r?o(e,t):u(e,t)}async function p(e){const t=e.clone().normalize();let r;if(t.length>1)for(const e of t)r?e.width>r.width&&(r=e):r=e;else r=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,s.ci)(e);const r=i.A.WGS84;return await(0,n.initializeProjection)(t,r),(0,n.project)(e,r)}(r)}const f={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function d(e){const{portal:t,isOrgItem:r,itemControl:n}=e,i=t.user?.privileges;let s=!i||i.includes("features:user:edit"),o=!!r&&!!i?.includes("features:user:fullEdit");const l="update"===n||"admin"===n;return l?o=s=!0:o&&(s=!0),{features:{edit:s,fullEdit:o},content:{updateItem:l}}}},22671:(e,t,r)=>{r.d(t,{A:()=>g});var n,i=r(31635),s=r(52106),o=r(66552),l=r(25482),a=r(4718),u=r(91429),c=r(16930),p=r(65864),f=r(50498),d=r(20437),h=r(36005),y=r(43937);const m=new o.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let g=n=class extends l.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,s.A)}writeGeometryType(e,t,r,n){if(e)return void m.write(e,t,r,n);const{features:i}=this;if(i)for(const e of i)if(null!=e?.geometry)return void m.write(e.geometry.type,t,r,n)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,n=(0,p.rS)(e);return n&&!r&&t.spatialReference&&(n.spatialReference=c.A.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,a.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const n=t.features[r];if(n.geometry){const t=e?.[r];n.geometry=t?.toJSON()||n.geometry}}return t}quantize(e){const{scale:[t,r],translate:[n,i]}=e,s=this.features,o=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-n)/t),e=>Math.round((i-e)/r));for(let e=0,t=s.length;e<t;e++)o?.(s[e].geometry)||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[n,i],scale:[s,o]}=r;let l=null,a=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;l=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;a=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,e=>e*s+n,e=>i-e*o,l,a);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const n=c.A.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const s=e[t],o=r.fromJSON(s),l=s.geometry?.spatialReference;null==o.geometry||l||(o.geometry.spatialReference=n);const a=s.aggregateGeometries,u=o.aggregateGeometries;if(a&&null!=u)for(const e in u){const t=u[e],r=a[e],i=r?.spatialReference;null==t||i||(t.spatialReference=n)}i.push(o)}return i}_quantizePoints(e,t,r){let n,i;const s=[];for(let o=0,l=e.length;o<l;o++){const l=e[o];if(o>0){const e=t(l[0]),o=r(l[1]);e===n&&o===i||(s.push([e-n,o-i]),n=e,i=o)}else n=t(l[0]),i=r(l[1]),s.push([n,i])}return s.length>0?s:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const n=(0,p.Bi)(e)?e.rings:e.paths,i=[];for(let e=0,s=n.length;e<s;e++){const s=n[e],o=this._quantizePoints(s,t,r);o&&i.push(o)}return i.length>0?((0,p.Bi)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const n=this._quantizePoints(e.points,t,r);return n&&n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,n,i){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),n&&(e.z=n(e.z))}:"polyline"===e||"polygon"===e?e=>{const s=(0,p.Bi)(e)?e.rings:e.paths;let o,l;for(let e=0,n=s.length;e<n;e++){const n=s[e];for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(o+=i[0],l+=i[1]):(o=i[0],l=i[1]),i[0]=t(o),i[1]=r(l)}}if(n&&i)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2]),r[3]=i(r[3])}}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2])}}else if(i)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),n&&null!=e.zmax&&null!=e.zmin&&(e.zmax=n(e.zmax),e.zmin=n(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{const s=e.points;let o,l;for(let e=0,n=s.length;e<n;e++){const n=s[e];e>0?(o+=n[0],l+=n[1]):(o=n[0],l=n[1]),n[0]=t(o),n[1]=r(l)}if(n&&i)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=n(t[2]),t[3]=i(t[3])}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=n(t[2])}else if(i)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=i(t[2])}}:null}};(0,i.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],g.prototype,"displayFieldName",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"exceededTransferLimit",void 0),(0,i.Cg)([(0,u.MZ)({type:[s.A],json:{write:!0}})],g.prototype,"features",void 0),(0,i.Cg)([(0,h.w)("features")],g.prototype,"readFeatures",null),(0,i.Cg)([(0,u.MZ)({type:[d.A],json:{write:!0}})],g.prototype,"fields",void 0),(0,i.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:m.read}}})],g.prototype,"geometryType",void 0),(0,i.Cg)([(0,y.K)("geometryType")],g.prototype,"writeGeometryType",null),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasM",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasZ",void 0),(0,i.Cg)([(0,u.MZ)({types:f.yR,json:{write:!0}})],g.prototype,"queryGeometry",void 0),(0,i.Cg)([(0,h.w)("queryGeometry")],g.prototype,"readQueryGeometry",null),(0,i.Cg)([(0,u.MZ)({type:c.A,json:{write:!0}})],g.prototype,"spatialReference",void 0),(0,i.Cg)([(0,y.K)("spatialReference")],g.prototype,"writeSpatialReference",null),(0,i.Cg)([(0,u.MZ)({json:{write:!0}})],g.prototype,"transform",void 0),g=n=(0,i.Cg)([(0,u.$K)("esri.rest.support.FeatureSet")],g),g.prototype.toJSON.isDefaultToJSON=!0},37539:(e,t,r)=>{r.d(t,{pO:()=>y,jd:()=>f,Tp:()=>d,w5:()=>p});var n=r(34727),i=r(86211),s=r(73941),o=r(79258);Math.PI;const l=o.$O.radius,a=o.$O.eccentricitySquared,u={a1:l*a,a2:l*a*l*a,a3:l*a*a/2,a4:l*a*l*a*2.5,a5:l*a+l*a*a/2,a6:1-a};o.$O.radius,o.$O.flattening,o.Sw.radius,o.Sw.flattening,o.sH.radius,o.sH.flattening,o.sH.radius;var c=r(21325);const p={2:{5:y,7:null,9:null,10:y,1:S,6:null,8:null,0:null,3:g,11:b,2:y,4:F},5:{5:y,7:null,9:null,10:y,1:S,6:null,8:null,0:null,3:g,11:b,2:y,4:F},7:{5:null,7:y,9:null,10:y,1:null,6:_,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:y,10:y,1:null,6:null,8:M,0:null,3:null,11:null,2:null,4:null},3:{5:m,7:null,9:null,10:m,1:function(e,t,r,n){const i=e[t]/Z,s=E-2*Math.atan(Math.exp(-e[t+1]/Z)),o=Z+(e[t+2]??0),l=Math.cos(s)*o;r[n]=Math.cos(i)*l,r[n+1]=Math.sin(i)*l,r[n+2]=Math.sin(s)*o},6:null,8:null,0:null,3:y,11:function(e,t,r,n){m(e,t,r,n),b(r,n,r,n)},2:m,4:function(e,t,r,n){m(e,t,r,n),F(r,n,r,n)}},4:{5:R,7:null,9:null,10:R,1:function(e,t,r,n){R(e,t,r,n),S(r,n,r,n)},6:null,8:null,0:null,3:function(e,t,r,n){R(e,t,r,n),g(r,n,r,n)},11:function(e,t,r,n){R(e,t,r,n),b(r,n,r,n)},2:R,4:y},1:{5:A,7:null,9:null,10:A,1:y,6:null,8:null,0:null,3:function(e,t,r,n){A(e,t,r,n),g(r,n,r,n)},11:function(e,t,r,n){A(e,t,r,n),b(r,n,r,n)},2:A,4:function(e,t,r,n){A(e,t,r,n),F(r,n,r,n)}},6:{5:null,7:T,9:null,10:T,1:null,6:y,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:I,10:I,1:null,6:null,8:y,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:y,3:null,11:null,2:null,4:null},10:{5:y,7:y,9:y,10:y,1:S,6:_,8:M,0:null,3:g,11:b,2:y,4:F},11:{5:v,7:null,9:null,10:v,1:function(e,t,r,n){v(e,t,r,n),S(r,n,r,n)},6:null,8:null,0:null,3:function(e,t,r,n){v(e,t,r,n),g(r,n,r,n)},11:y,2:v,4:function(e,t,r,n){v(e,t,r,n),F(r,n,r,n)}}};function f(e,t){return d(e,t)?.projector}function d(e,t){if(null==e||null==t)return null;if(C.source.spatialReference===e&&C.dest.spatialReference===t)return C;const r=h(e,C.source),n=h(t,C.dest);return 0===r&&0===n?(0,c.aI)(e,t)?C.projector=y:C.projector=null:C.projector=p[r][n],C}function h(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,i.GA)(e,1)),(0,s.jA)(e)?t.spatialReferenceId=1:(0,c.oT)(e)?t.spatialReferenceId=2:(0,c.K8)(e)?t.spatialReferenceId=3:(0,c.r1)(e)?t.spatialReferenceId=11:e.wkt===s.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===s.FY.wkt?t.spatialReferenceId=6:e.wkt===s.LJ.wkt?t.spatialReferenceId=8:(0,c.q8)(e)?t.spatialReferenceId=7:(0,c.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function y(e,t,r,n){e!==r&&(r[n++]=e[t++],r[n++]=e[t++],r[n]=e[t]??0)}function m(e,t,r,n){r[n]=O*(e[t]/Z),r[n+1]=O*(E-2*Math.atan(Math.exp(-e[t+1]/Z))),r[n+2]=e[t+2]??0}function g(e,t,r,i){!function(e,t,r,i,s){const o=.4999999*Math.PI,l=(0,n.qE)(P*e[t+1],-o,o),a=Math.sin(l);r[i++]=P*e[t]*s.radius,r[i++]=s.halfSemiMajorAxis*Math.log((1+a)/(1-a)),r[i]=e[t+2]??0}(e,t,r,i,o.$O)}function b(e,t,r,n){r[n]=e[t]*j,r[n+1]=e[t+1]*j,r[n+2]=e[t+2]??0}function v(e,t,r,n){r[n]=e[t]*L,r[n+1]=e[t+1]*L,r[n+2]=e[t+2]??0}function w(e,t,r,n,i){const s=i+(e[t+2]??0),o=P*e[t],l=P*e[t+1],a=Math.cos(l)*s;r[n]=Math.cos(o)*a,r[n+1]=Math.sin(o)*a,r[n+2]=Math.sin(l)*s}function M(e,t,r,n){w(e,t,r,n,o.Sw.radius)}function _(e,t,r,n){w(e,t,r,n,o.sH.radius)}function S(e,t,r,n){w(e,t,r,n,o.$O.radius)}function x(e,t,r,i,s){const o=e[t],l=e[t+1],a=e[t+2]??0,u=Math.sqrt(o*o+l*l+a*a),c=(0,n.YN)(a/(0===u?1:u)),p=Math.atan2(l,o);r[i++]=O*p,r[i++]=O*c,r[i]=u-s}function I(e,t,r,n){x(e,t,r,n,o.Sw.radius)}function T(e,t,r,n){x(e,t,r,n,o.sH.radius)}function A(e,t,r,n){x(e,t,r,n,o.$O.radius)}function F(e,t,r,n){!function(e,t,r,n,i){const s=P*e[t],o=P*e[t+1],l=e[t+2]??0,a=Math.sin(o),u=Math.cos(o),c=i.radius/Math.sqrt(1-i.eccentricitySquared*a*a);r[n++]=(c+l)*u*Math.cos(s),r[n++]=(c+l)*u*Math.sin(s),r[n++]=(c*(1-i.eccentricitySquared)+l)*a}(e,t,r,n,o.$O)}function R(e,t,r,n){const i=u,s=e[t],l=e[t+1],a=e[t+2]??0;let c,p,f,d,h,y,m,g,b,v,w,M,_,S,x,I,T,A,F,R,C;c=Math.abs(a),p=s*s+l*l,f=Math.sqrt(p),d=p+a*a,h=Math.sqrt(d),R=Math.atan2(l,s),y=a*a/d,m=p/d,S=i.a2/h,x=i.a3-i.a4/h,m>.3?(g=c/h*(1+m*(i.a1+S+y*x)/h),F=Math.asin(g),v=g*g,b=Math.sqrt(1-v)):(b=f/h*(1-y*(i.a5-S-m*x)/h),F=Math.acos(b),v=1-b*b,g=Math.sqrt(v)),w=1-o.$O.eccentricitySquared*v,M=o.$O.radius/Math.sqrt(w),_=i.a6*M,S=f-M*b,x=c-_*g,T=b*S+g*x,I=b*x-g*S,A=I/(_/w+T),F+=A,C=T+I*A/2,a<0&&(F=-F),r[n++]=O*R,r[n++]=O*F,r[n]=C}const C={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:y},P=(0,n.kU)(1),O=(0,n.KJ)(1),E=.5*Math.PI,Z=o.$O.radius,j=Z*Math.PI/180,L=180/(Z*Math.PI)},38961:(e,t,r)=>{r.d(t,{A:()=>c});var n=r(31635),i=r(7762),s=r(36708),o=r(10107),l=r(64108),a=r(80559);let u=class extends i.A{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles((0,a.fm)(()=>this._refresh(),s.OH))}destroy(){this.getCollections=null}_refresh(){const e=this.getCollections?.();if(null==e)return void this.removeAll();let t=0;for(const r of e)null!=r&&(t=this._processCollection(t,r));this.splice(t)}_createNewInstance(e){return new i.A(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction??(e=>!!e);for(const n of t)if(n){if(r(n)){const t=this.indexOf(n,e);t>=0?t!==e&&this.reorder(n,e):this.add(n,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(n);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,n.Cg)([(0,o.MZ)()],u.prototype,"getCollections",void 0),(0,n.Cg)([(0,o.MZ)()],u.prototype,"getChildrenFunction",void 0),(0,n.Cg)([(0,o.MZ)()],u.prototype,"itemFilterFunction",void 0),u=(0,n.Cg)([(0,l.$)("esri.core.CollectionFlattener")],u);const c=u},46140:(e,t,r)=>{r.d(t,{R:()=>i});var n=r(49186);let i=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new n.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[i,s]=t.split("."),o=/^\s*\d+\s*$/;if(!i?.match||!o.test(i))throw new n.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!s?.match||!o.test(s))throw new n.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const l=parseInt(i,10),a=parseInt(s,10);return new e(l,a,r)}}},50498:(e,t,r)=>{r.d(t,{Ye:()=>p,gy:()=>c,yR:()=>f});var n=r(66552),i=r(5443),s=r(91075),o=r(48526),l=r(86738),a=r(39829),u=r(82799);const c=(0,n.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),p=(0,n.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),f={base:s.A,key:"type",typeMap:{extent:i.A,multipoint:o.A,point:l.A,polyline:u.A,polygon:a.A}}},52106:(e,t,r)=>{r.d(t,{A:()=>M});var n,i=r(31635),s=r(37838),o=r(69540),l=r(51447),a=r(25482),u=r(53966),c=r(36708),p=r(24326),f=r(91429),d=r(12195),h=r(65864),y=r(50498),m=r(55156),g=r(60950),b=r(54339),v=r(33910);function w(e){if(null==e)return null;const t={};for(const r in e){const n=e[r];n&&(t[r]=n.toJSON())}return 0!==Object.keys(t).length?t:null}let M=class extends((0,o.OU)(a.o)){static{n=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,p.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,l.eF)(u.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new n({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=(0,g.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;const r=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[r,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=(0,m.I)(this.origin);if(e)return(0,b.r)(this,e);const t=this.sourceLayer??this.layer;return t?(0,b.r)(this,t):null}getGlobalId(){const e=(0,m.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);const t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){return{aggregateGeometries:w(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,d.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,n){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const i={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(i.action=n),"attributes"===e&&(i.attributeName=n),this.layer.graphicChanged(i)}_watchMeshGeometryChanges(){this.addHandles([(0,c.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,c.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,i.Cg)([(0,f.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const n=(0,h.rS)(e[r]);n&&(t[r]=n)}return 0!==Object.keys(t).length?t:null}}})],M.prototype,"aggregateGeometries",null),(0,i.Cg)([(0,f.MZ)({value:null})],M.prototype,"attributes",null),(0,i.Cg)([(0,f.MZ)({value:null,types:y.yR,json:{read:h.rS}})],M.prototype,"geometry",null),(0,i.Cg)([(0,f.MZ)({type:Boolean})],M.prototype,"isAggregate",void 0),(0,i.Cg)([(0,f.MZ)({clonable:!1})],M.prototype,"layer",void 0),(0,i.Cg)([(0,f.MZ)({clonable:"reference"})],M.prototype,"origin",void 0),(0,i.Cg)([(0,f.MZ)({type:s.A,value:null})],M.prototype,"popupTemplate",null),(0,i.Cg)([(0,f.MZ)({clonable:"reference"})],M.prototype,"sourceLayer",void 0),(0,i.Cg)([(0,f.MZ)({value:null,types:v.Es})],M.prototype,"symbol",null),(0,i.Cg)([(0,f.MZ)({clonable:!1,json:{read:!1,write:!1}})],M.prototype,"_version",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,value:!0})],M.prototype,"visible",null),M=n=(0,i.Cg)([(0,f.$K)("esri.Graphic")],M)},54339:(e,t,r)=>{function n(e,t){switch(t.type){case"object-id":case"unique-id-simple":return e.attributes[t.fieldName];case"unique-id-composite":{const r=[];for(const n of t.fieldNames)r.push(e.attributes[n]??null);return JSON.stringify(r)}}}function i(e,t){if("uniqueIdFields"in t&&t.uniqueIdFields?.length){if(1===t.uniqueIdFields.length)return e.attributes?.[t.uniqueIdFields[0]];const r=t.uniqueIdFields.map(t=>e.attributes?.[t]);return JSON.stringify(r)}return"objectIdField"in t&&t.objectIdField?e.attributes?.[t.objectIdField]:null}r.d(t,{W:()=>n,r:()=>i})},55156:(e,t,r)=>{r.d(t,{I:()=>i,e:()=>n});const n=Symbol("idFieldsProviderSymbol");function i(e){return(t=e)&&n in t?e[n]:void 0;var t}},55674:(e,t,r)=>{r.d(t,{Ad:()=>d,Gj:()=>m,QY:()=>f,lL:()=>g,xR:()=>h});var n=r(66131),i=r(49186),s=(r(44208),r(44729)),o=r(15032),l=r(65864),a=r(95466),u=r(43668),c=r(98623);const p=["geometry","scale","timeProperties"];function f(e,t){if(null!=t)for(const r of p)t.hasArcadeDependency(r)&&e.add(r);return e}function d(e,t){return y.create(e,t,null,["$feature","$view"])}function h(e,t,r){return y.create(e,t,r,["$feature","$view","$config"])}class y{static async create(e,t,r,n){const{arcade:s,Dictionary:o}=await(0,u.l)();let l;try{l=s.parseScript(e)}catch(t){throw new i.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const a=s.scriptUsesGeometryEngine(l);a&&await s.enableGeometrySupport(),await s.loadDependentModules(new Set,l,null,!1,a);const c={vars:n.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},p=s.compileScript(l,c);let f=null;null!=r&&(f=new o(r),f.immutable=!0);const d=new o;return d.immutable=!1,d.setField("scale",0),new y(e,s,l,p,t,d,f,o)}constructor(e,t,r,n,i,s,o,l){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=n,this._spatialReference=i,this._viewDict=s,this._configDict=o,this._dictionaryCtor=l,this._dependencies=new Map,this._featureReader=new m,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const r=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:i,currentEnd:s}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=i?null!=r?n.lY.epochToArcadeDate(i,r):n.lY.unknownEpochToArcadeDate(i):void 0,currentEnd:null!=s?null!=r?n.lY.epochToArcadeDate(s,r):n.lY.unknownEpochToArcadeDate(s):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:r})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class m{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,r){const n=t??new a.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=n.fields,this._boundSchema.fieldsIndex=n,this._boundSchema.spatialReference=r}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,l.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}_hasGeometry(){return null!=this._boundTarget.geometry}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===c.L5}field(e,t=!0){const r=this._getField(e);if(r){const t=this._boundTarget.attributes[r.name];if(null==t)return null;switch(r.type){case"date-only":case"esriFieldTypeDateOnly":return s.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return o.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return n.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?n.lY.unknownEpochToArcadeDate(t):n.lY.epochToArcadeDate(t,this.contextTimeZone??c.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}isEmpty(){return this._boundSchema.fields.length<=0&&!this._hasGeometry()}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const r in e)t.push({name:r,alias:r,type:"string"==typeof e[r]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},62815:(e,t,r)=>{r.d(t,{N:()=>o});var n=r(86211),i=r(73941),s=r(21325);function o(e,t,r){if(null==t||null==r||r.vcsWkid||(0,s.aI)(t,r)||(0,i.xP)(t)||(0,i.xP)(r))return null;const o=(0,n.G9)(t)/(0,n.G9)(r);if(1===o)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,o);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const r of e.paths)for(const e of r)e.length>2&&(e[2]*=t)}(e,o);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const r of e.rings)for(const e of r)e.length>2&&(e[2]*=t)}(e,o);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const r of e.points)r.length>2&&(r[2]*=t)}(e,o);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,o);default:return null}}},65494:(e,t,r)=>{r.d(t,{L:()=>a,r:()=>o});var n=r(67076),i=r(90360),s=r(41214);function o(e,t){return a(e,null,t)}const l=(0,i.C)({types:s.Hg});function a(e,t,r){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(r?.messages&&r.messages.push(new n.A("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):l(e,t,r):null}},70328:(e,t,r)=>{r.d(t,{BI:()=>v,DC:()=>p,Ej:()=>d,Ie:()=>g,Jt:()=>b,Ne:()=>h,RF:()=>c,aI:()=>M,fA:()=>o,gE:()=>a,hZ:()=>m,iT:()=>f,is:()=>w,qv:()=>_,vI:()=>y,vY:()=>l,v_:()=>S,vt:()=>s,w1:()=>u});var n=r(5443),i=(r(19419),r(4197));function s(e=S){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function o(e,t,r,n,i,o,l=s()){return l[0]=e,l[1]=t,l[2]=r,l[3]=n,l[4]=i,l[5]=o,l}function l(e,t=s()){return function(e,t,r,n=s()){return m(n,_),function(e,t,r=0,n=t.length/3){let i=e[0],s=e[1],o=e[2],l=e[3],a=e[4],u=e[5];for(let e=0;e<n;e++)i=Math.min(i,t[r+3*e]),s=Math.min(s,t[r+3*e+1]),o=Math.min(o,t[r+3*e+2]),l=Math.max(l,t[r+3*e]),a=Math.max(a,t[r+3*e+1]),u=Math.max(u,t[r+3*e+2]);e[0]=i,e[1]=s,e[2]=o,e[3]=l,e[4]=a,e[5]=u}(n,e,t,r),n}(e,0,e.length/3,t)}function a(e,t=(0,i.jh)(24)){const[r,n,s,o,l,a]=e;return t[0]=r,t[1]=n,t[2]=s,t[3]=r,t[4]=n,t[5]=a,t[6]=r,t[7]=l,t[8]=s,t[9]=r,t[10]=l,t[11]=a,t[12]=o,t[13]=n,t[14]=s,t[15]=o,t[16]=n,t[17]=a,t[18]=o,t[19]=l,t[20]=s,t[21]=o,t[22]=l,t[23]=a,t}function u(e,t){const r=isFinite(e[2])||isFinite(e[5]);return new n.A(r?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function c(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function p(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[3]=Math.max(e[3],t[2]),e[4]=Math.max(e[4],t[3])}function f(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function d(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function h(e,t,r=e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==e&&(r[3]=e[3],r[4]=e[4],r[5]=e[5]),r}function y(e,t,r=e){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==e&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),e}function m(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function g(e){return e?m(e,_):s(_)}function b(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function v(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=Number.NEGATIVE_INFINITY,e[3]=n,e[4]=i,e[5]=Number.POSITIVE_INFINITY,e}function w(e){return 6===e.length}function M(e,t,r){if(null==e||null==t)return e===t;if(!w(e)||!w(t))return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}const _=[1/0,1/0,1/0,-1/0,-1/0,-1/0],S=[0,0,0,0,0,0];s()},73681:(e,t,r)=>{r.d(t,{n:()=>a});var n=r(49186),i=r(53966),s=r(46140),o=r(95466),l=r(55674);class a{static async from(e,t,r){const o=e.dictionary_version?s.R.parse(e.dictionary_version):null,c=new Set(e.itemsNames),p={};if(t)for(const e in t)p[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)p.hasOwnProperty(t.name)||(p[t.name]=t.value);const f=new Set(e.authoringInfo.symbol);for(const e of Object.keys(r))f.delete(e);f.size&&i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:f});const d=await(0,l.xR)(e.expression,null,p);if(!d)throw new n.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const h=!o||!o.greaterEqual(4,0);h&&i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:o});const y=new u(r,h);return new a(h,c,d,y)}constructor(e,t,r,n){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=r,this._reader=n}get itemNames(){return this._itemNames}evaluate(e,t,r,n){try{return this._reader.bind(e,r,n),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){i.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new o.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new o.A(t)}}class u extends l.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},89808:(e,t,r)=>{r.d(t,{Q:()=>n});const n=Symbol("getSliceableSymbol")},91218:(e,t,r)=>{r.r(t),r.d(t,{canProjectWithoutEngine:()=>J,initializeProjection:()=>H,isEqualBaseGCS:()=>U,isLoaded:()=>C,isLoadedOrLoad:()=>P,isLoadedOrLoadFor:()=>O,load:()=>Z,project:()=>j,projectExtent:()=>re,projectMany:()=>L,projectMultipoint:()=>Y,projectOrLoad:()=>G,projectOrLoadMany:()=>N,projectPoint:()=>V,projectPolygon:()=>ee,projectPolyline:()=>Q,projectWithZConversion:()=>D,projectWithoutEngine:()=>B,requiresLoad:()=>E,test:()=>$,tryProjectWithZConversion:()=>z,unload:()=>q});var n=r(49186),i=r(74887),s=r(62788),o=r(95488),l=r(51850),a=r(21276),u=r(73941),c=r(5443),p=r(91075),f=r(48526),d=r(86738),h=r(39829),y=r(82799),m=r(16930),g=r(159),b=r(9762),v=r(37539);function w(e,t,r,n,i,s){return M[0]=e,M[1]=t,M[2]=r,(0,b.projectBuffer)(M,n,0,i,s,0)}const M=(0,l.vt)();var _=r(21325),S=r(62815);let x=null,I=null,T=null,A=null,F={};const R=new o.I;function C(){return!!(I?.isLoaded()&&T?.isLoaded()&&A?.isLoaded())}function P(){return!!C()||((0,s.gc)(R),Z(),!1)}function O(e,t){return!e||!t||J(e,t)||P()}function E(e,t){return!J(e,t)&&!C()}async function Z(e){null==x&&(x=Promise.all([r.e(3276).then(r.bind(r,83276)).then(e=>(I=e,I.load())),r.e(8377).then(r.bind(r,8377)).then(e=>(T=e,T.load())),r.e(2158).then(r.bind(r,12158)).then(e=>(A=e,A.load()))])),await x,(0,i.Te)(e),R.notify()}function j(e,t,r){return Array.isArray(e)?0===e.length?[]:((0,a.H)(e),L(e,e[0].spatialReference,t,r)):((0,a.f)(e),L([e],e.spatialReference,t,r)[0])}function L(e,t,r,n){if(null==t||null==r)return e;if(J(t,r,n))return e.map(e=>B(e,t,r));if(null==n?.geographicTransformation&&(0,u.jA)(t))return e.map(e=>B(e,t,m.A.WGS84)).map(e=>z(e,r));if(null==n?.geographicTransformation&&(0,u.jA)(r))return e.map(e=>z(e,m.A.WGS84)).map(e=>B(e,m.A.WGS84,r));if(!C())throw new k;if(!n?.geographicTransformation)if(n?.extendedParams)n={...n,geographicTransformation:A.getTransformation(t,r,n.areaOfInterestExtent)||new g.A};else if(!n?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,r);let i=F[e];i||(i=A.getTransformation(t,r)||new g.A,F[e]=i),n={geographicTransformation:i}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof p.A?I.executeMany(e,r,n):T.executeMany(e,r,n)}function G(e,t){const r=N([e],t);return null!=r.pending?{pending:r.pending,geometry:null}:null!=r.geometries?{pending:null,geometry:r.geometries[0]}:{pending:null,geometry:null}}function N(e,t){if(!C())for(const r of e)if(null!=r&&!(0,_.aI)(r.spatialReference,t)&&(0,_.fn)(r.spatialReference)&&(0,_.fn)(t)&&!J(r.spatialReference,t))return(0,s.gc)(R),{pending:Z(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,_.aI)(e.spatialReference,t)?e:(0,_.fn)(e.spatialReference)&&(0,_.fn)(t)?z(e,t):null)}}class k extends n.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function q(){x=null,I=null,T=null,A=null,F={}}const $={get loadPromise(){return x}};function z(e,t){try{const r=j(e,t);if(null==r)return null;"xmin"in e&&"xmin"in r&&(r.zmin=e.zmin,r.zmax=e.zmax);const n=(0,S.N)(r.type,e.spatialReference,t);return null!=n&&n(r),r}catch(e){if(!(e instanceof k))throw e;return null}}async function D(e,t,r){const n=e.spatialReference;return null!=n&&null!=t&&await H(n,t,null,r),z(e,t)}function J(e,t,r){return!(r?.areaOfInterestExtent||r?.extendedParams||r?.geographicTransformation)&&(!!(0,_.aI)(e,t)||(0,_.fn)(e)&&(0,_.fn)(t)&&!!(0,v.jd)(e,t))}function U(e,t){if((0,_.aI)(e,t))return!0;if(!(0,_.fn)(e)||!(0,_.fn)(t))return!1;const r=(0,_.oT)(e)||(0,_.K8)(e)||(0,_.x1)(e),n=(0,_.oT)(t)||(0,_.K8)(t)||(0,_.x1)(t);return r&&n}async function H(e,t,r,n){if(C())return(0,i.NO)(n);if(Array.isArray(e)){for(const{source:t,dest:r,options:i}of e)if(t&&r&&!J(t,r,i))return Z(n)}else if(e&&t&&!J(e,t,r))return Z(n);return(0,i.NO)(n)}function B(e,t,r){return e?"x"in e?K(e,t,new d.A,r,0):"xmin"in e?ne(e,t,new c.A,r,0):"rings"in e?te(e,t,new h.A,r,0):"paths"in e?X(e,t,new y.A,r,0):"points"in e?W(e,t,new f.A,r,0):null:null}function V(e,t,r=t.spatialReference,n=0){return null!=r&&null!=e.spatialReference&&null!=K(e,e.spatialReference,t,r,n)}function K(e,t,r,n,i){se[0]=e.x,se[1]=e.y;const s=e.z;return se[2]=void 0!==s?s:i,(0,b.projectBuffer)(se,t,0,se,n,0)?(r.x=se[0],r.y=se[1],r.spatialReference=n,void 0!==s||(0,u.xP)(n)?(r.z=se[2],r.hasZ=!0):(r.z=void 0,r.hasZ=!1),void 0===e.m?(r.m=void 0,r.hasM=!1):(r.m=e.m,r.hasM=!0),r):null}function Y(e,t,r=t.spatialReference,n=0){return null!=e.spatialReference&&null!=r&&null!=W(e,e.spatialReference,t,r,n)}function W(e,t,r,n,i){const{points:s,hasZ:o,hasM:l}=e,a=[],c=s.length,p=[];for(const e of s)p.push(e[0],e[1],o?e[2]:i);if(!(0,b.projectBuffer)(p,t,0,p,n,0,c))return null;const f=o||(0,u.xP)(n);for(let e=0;e<c;++e){const t=3*e,r=p[t],n=p[t+1];f&&l?a.push([r,n,p[t+2],s[e][3]]):f?a.push([r,n,p[t+2]]):l?a.push([r,n,s[e][2]]):a.push([r,n])}return r.points=a,r.spatialReference=n,r.hasZ=o,r.hasM=l,r}function Q(e,t,r=t.spatialReference,n=0){return null!=e.spatialReference&&null!=r&&null!=X(e,e.spatialReference,t,r,n)}function X(e,t,r,n,i){const{paths:s,hasZ:o,hasM:l}=e,a=[];if(!ie(s,o??!1,l??!1,t,a,n,i))return null;const c=o||(0,u.xP)(n);return r.paths=a,r.spatialReference=n,r.hasZ=c,r.hasM=l,r}function ee(e,t,r=t.spatialReference,n=0){return null!=e.spatialReference&&null!=r&&null!=te(e,e.spatialReference,t,r,n)}function te(e,t,r,n,i){const{rings:s,hasZ:o,hasM:l}=e,a=[];if(!ie(s,o??!1,l??!1,t,a,n,i))return null;const c=o||(0,u.xP)(n);return r.rings=a,r.spatialReference=n,r.hasZ=c,r.hasM=l,r}function re(e,t,r=t.spatialReference,n=0){return null!=e.spatialReference&&null!=r&&null!=ne(e,e.spatialReference,t,r,n)}function ne(e,t,r,n,i){const{xmin:s,ymin:o,xmax:l,ymax:a,hasZ:c,hasM:p}=e;if(!w(s,o,c?e.zmin:i,t,se,n))return null;const f=c||(0,u.xP)(n);return r.xmin=se[0],r.ymin=se[1],f&&(r.zmin=se[2]),w(l,a,c?e.zmax:i,t,se,n)?(r.xmax=se[0],r.ymax=se[1],f&&(r.zmax=se[2]),p&&(r.mmin=e.mmin,r.mmax=e.mmax),r.spatialReference=n,r):null}function ie(e,t,r,n,i,s,o=0){const l=new Array;for(const r of e)for(const e of r)l.push(e[0],e[1],t?e[2]:o);if(!(0,b.projectBuffer)(l,n,0,l,s,0))return!1;let a=0;i.length=0;const c=t||(0,u.xP)(s);for(const t of e){const e=new Array;for(const n of t)c&&r?e.push([l[a++],l[a++],l[a++],n[3]]):c?e.push([l[a++],l[a++],l[a++]]):r?(e.push([l[a++],l[a++],n[2]]),a++):(e.push([l[a++],l[a++]]),a++);i.push(e)}return!0}const se=(0,l.vt)()},95466:(e,t,r)=>{r.d(t,{A:()=>d});var n=r(49186),i=r(53966),s=r(91869),o=r(3330),l=r(12195),a=r(30524),u=r(98623),c=r(56400),p=r(28097);const f=new Map;class d{static fromJSON(e){return new d(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new d(e.fields??[],g(e))}static fromLayerJSON(e){return new d(e.fields??[],g(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const r=[];for(const e of this.fields){const t=e?.name,n=y(t);if(t&&n){const i=h(t);this._fieldsMap.set(t,e),this._fieldsMap.set(i,e),this._normalizedFieldsMap.set(n,e),r.push(`${i}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,a.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,a.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,a.te)(e)||(0,a.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}r.sort(),this.uid=r.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,a.te)(e)||(0,a.Xz)(e)||e.nullable||void 0!==(0,a.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(h(e))??this._normalizedFieldsMap.get(y(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(i.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new n.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):m.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?o.GB.instance:t===u.n$?p.mQ.utcInstance:(0,s.tE)(f,t,()=>p.oh.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,a.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>(0,l.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function h(e){return e.trim().toLowerCase()}function y(e){return(0,a.rS)(e)?.toLowerCase()??""}const m=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function g(e){const t=new Map;if(!e.fields)return t;const r=!0===e.datesInUnknownTimezone,{timeInfo:n,editFieldsInfo:i}=e,s=(n?"startField"in n?n.startField:n.startTimeField:"")??"",o=(n?"endField"in n?n.endField:n.endTimeField:"")??"",l=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,c.ZS)(e.dateFieldsTimeReference):null,a=i?function(e){return"timeZone"in e}(i)?i.timeZone??l:i.dateFieldsTimeReference?(0,c.ZS)(i.dateFieldsTimeReference):l??u.n$:null,p=n?function(e){return"timeZone"in e}(n)?n.timeZone??l:n.timeReference?(0,c.ZS)(n.timeReference):l:null,f=new Map([[h(i?.creationDateField??""),a],[h(i?.editDateField??""),a],[h(s),p],[h(o),p]]);for(const{name:n,type:i}of e.fields)if(m.has(i))t.set(n,u.L5);else if("date"!==i&&"esriFieldTypeDate"!==i)t.set(n,null);else if(r)t.set(n,u.L5);else{const e=f.get(h(n??""))??l;t.set(n,e)}return t}},96576:(e,t,r)=>{r.d(t,{A:()=>p});var n,i=r(31635),s=r(4718),o=r(91429),l=r(92438),a=r(63988),u=r(49849),c=r(93223);let p=n=class extends((0,a.h)(l.A)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.symbols.map(r=>r.collectRequiredFields(e,t)))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}get symbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,t)=>e+t.getAttributeHash(),"")??""}getMeshHash(){return this.symbols.reduce((e,t)=>e+JSON.stringify(t),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new n({description:this.description,label:this.label,symbol:(0,s.o8)(this.symbol),visualVariables:(0,s.o8)(this.visualVariables),authoringInfo:(0,s.o8)(this.authoringInfo)})}};(0,i.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],p.prototype,"description",void 0),(0,i.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],p.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)(u.Wp)],p.prototype,"symbol",void 0),(0,i.Cg)([(0,c.e)({simple:"simple"})],p.prototype,"type",void 0),p=n=(0,i.Cg)([(0,o.$K)("esri.renderers.SimpleRenderer")],p)},99157:(e,t,r)=>{r.d(t,{A:()=>l});var n,i=r(31635),s=r(69622),o=r(91429);let l=n=class extends s.A{constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new n({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,i.Cg)([(0,o.MZ)()],l.prototype,"isInverse",void 0),(0,i.Cg)([(0,o.MZ)()],l.prototype,"wkt",void 0),(0,i.Cg)([(0,o.MZ)()],l.prototype,"wkid",void 0),l=n=(0,i.Cg)([(0,o.$K)("esri.geometry.operators.support.GeographicTransformationStep")],l)},99959:(e,t,r)=>{r.d(t,{A:()=>s});var n=r(31635),i=r(91429);let s=class{};s=(0,n.Cg)([(0,i.$K)("esri.graphic.GraphicOrigin")],s)}}]);