@arcgis/core 4.28.0-next.20230911 → 4.28.0-next.20230913

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 (136) hide show
  1. package/arcade/Feature.js +1 -1
  2. package/arcade/arcadeTimeUtils.js +1 -1
  3. package/arcade/executionError.js +1 -1
  4. package/arcade/featureSetUtils.js +1 -1
  5. package/arcade/featureset/actions/Adapted.js +1 -1
  6. package/arcade/featureset/actions/GroupBy.js +1 -1
  7. package/arcade/featureset/support/FeatureSet.js +1 -1
  8. package/arcade/featureset/support/errorsupport.js +1 -1
  9. package/arcade/functions/featuresetbase.js +1 -1
  10. package/arcade/functions/featuresetstats.js +1 -1
  11. package/arcade/functions/string.js +1 -1
  12. package/arcade.js +1 -1
  13. package/assets/esri/core/workers/RemoteClient.js +1 -1
  14. package/assets/esri/core/workers/chunks/0920312e3c7b63c2e253.js +1 -0
  15. package/assets/esri/core/workers/chunks/0cb007ab5db0a2a598ec.js +1 -0
  16. package/assets/esri/core/workers/chunks/0cc61f1b2c0473ded5c2.js +1 -0
  17. package/assets/esri/core/workers/chunks/0f804e3f888cb4998f46.js +1 -0
  18. package/assets/esri/core/workers/chunks/189dd81cf95bd8417ee3.js +1 -0
  19. package/assets/esri/core/workers/chunks/1a723bb4a341f645e5fe.js +1 -0
  20. package/assets/esri/core/workers/chunks/24c717492ea1b35310d8.js +1 -0
  21. package/assets/esri/core/workers/chunks/{3ce73dd4113dbc7d11de.js → 2eb58dc339b2bb03d9e3.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{38c07a8574352a7f2f6d.js → 2ff0dbd5eb7ca57bb7fc.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{768f3db2705fa9e57641.js → 49dfdc0463450491df9d.js} +1 -1
  24. package/assets/esri/core/workers/chunks/650a317b6dc245a7060f.js +1 -0
  25. package/assets/esri/core/workers/chunks/{56ed099745360888604e.js → 67f01c71280fa0759742.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{f62842807744bdfaced7.js → 67fab13f56b340076763.js} +1 -1
  27. package/assets/esri/core/workers/chunks/6d94b358e8d1cf79bba3.js +1 -0
  28. package/assets/esri/core/workers/chunks/718607d7a3b33fc33b0a.js +1 -0
  29. package/assets/esri/core/workers/chunks/{4c63d6b9460aa6ae9843.js → 860417f4138f53d315ba.js} +2 -2
  30. package/assets/esri/core/workers/chunks/8aa7e994b74f66522c37.js +1 -0
  31. package/assets/esri/core/workers/chunks/9fa485b04b997b0a5509.js +1 -0
  32. package/assets/esri/core/workers/chunks/a047fcf3c7307a69b63c.js +1 -0
  33. package/assets/esri/core/workers/chunks/a753d9874801cd448946.js +1 -0
  34. package/assets/esri/core/workers/chunks/c51233ad51823cb98c35.js +1 -0
  35. package/assets/esri/core/workers/chunks/c61f20d91a5c432b07dc.js +1 -0
  36. package/assets/esri/core/workers/chunks/d3d11242e5af57ba77f4.js +1 -0
  37. package/assets/esri/core/workers/chunks/dbf343d1fb746f99bb6e.js +1 -0
  38. package/assets/esri/core/workers/chunks/{271ec1d1666bf6dc3dda.js → dc74b4ec85e8e3de5b27.js} +1 -1
  39. package/assets/esri/core/workers/chunks/e8a8791d765ab6c450dd.js +1 -0
  40. package/assets/esri/core/workers/chunks/{5fe7b5665710ec6d3046.js → eb0d1c5c96f735c162d3.js} +1 -1
  41. package/assets/esri/themes/base/widgets/_Sketch.scss +0 -5
  42. package/assets/esri/themes/base/widgets/_SketchTooltipControls.scss +0 -5
  43. package/assets/esri/themes/dark/main.css +1 -1
  44. package/assets/esri/themes/light/main.css +1 -1
  45. package/assets/esri/themes/light/view.css +1 -1
  46. package/chunks/HUDMaterial.glsl.js +38 -45
  47. package/chunks/languageUtils.js +1 -1
  48. package/core/promiseUtils.js +1 -1
  49. package/core/sql/AggregateFunctions.js +1 -1
  50. package/core/sql/DateOnly.js +1 -1
  51. package/core/sql/SqlTimestampOffset.js +1 -1
  52. package/core/sql/TimeOnly.js +1 -1
  53. package/core/sql/WhereClause.js +1 -1
  54. package/core/sql/WhereGrammar.js +1 -1
  55. package/core/sql/sqlCompareUtils.js +1 -1
  56. package/geometry/GeometryCursor.js +1 -1
  57. package/geometry/Mesh.js +1 -1
  58. package/geometry/support/labelPoint.js +1 -1
  59. package/geometry/support/meshUtils/bounds.js +1 -1
  60. package/geometry/support/meshUtils/georeference.js +1 -1
  61. package/interfaces.d.ts +190 -144
  62. package/layers/ImageryLayer.js +1 -1
  63. package/layers/SceneLayer.js +1 -1
  64. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  65. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  66. package/layers/graphics/sources/csv/csv.js +1 -1
  67. package/layers/support/FetchAssociatedFeatureLayer.js +1 -1
  68. package/layers/support/TilemapCache.js +1 -1
  69. package/layers/support/fieldUtils.js +1 -1
  70. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  71. package/layers/support/wmsUtils.js +1 -1
  72. package/layers/video/VideoController.js +1 -1
  73. package/package.json +3 -3
  74. package/smartMapping/heuristics/sizeRange.js +1 -1
  75. package/smartMapping/labels/bins.js +1 -1
  76. package/smartMapping/labels/clusters.js +1 -1
  77. package/smartMapping/labels/support/utils.js +1 -1
  78. package/smartMapping/popup/support/clusterUtils.js +1 -1
  79. package/smartMapping/support/clusterUtils.js +1 -1
  80. package/support/revision.js +1 -1
  81. package/views/2d/engine/webgl/DisplayId.js +1 -1
  82. package/views/2d/engine/webgl/Utils.js +1 -1
  83. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  84. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  85. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  86. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  87. package/views/3d/analysis/Dimension/LengthDimensionVisualization.js +1 -1
  88. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  89. package/views/3d/analysis/Dimension/settings.js +1 -1
  90. package/views/3d/interactive/Manipulator3D.js +1 -1
  91. package/views/3d/interactive/editingTools/originGraphicVisualElementUtils.js +1 -1
  92. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  93. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  94. package/views/3d/layers/I3SMeshView3D.js +1 -1
  95. package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
  96. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  97. package/views/3d/layers/SceneLayerWorker.js +1 -1
  98. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  99. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  100. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  101. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  102. package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
  103. package/views/ToolViewManager.js +1 -1
  104. package/views/View.js +1 -1
  105. package/views/animation/easing.js +1 -1
  106. package/views/webgl/FramebufferObject.js +1 -1
  107. package/views/webgl/RenderingContext.js +1 -1
  108. package/views/webgl/enums.js +1 -1
  109. package/views/webgl/renderState.js +1 -1
  110. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  111. package/widgets/Feature/FeatureMedia.js +1 -1
  112. package/widgets/FeatureForm.js +1 -1
  113. package/widgets/Features.js +1 -1
  114. package/widgets/Search/SearchViewModel.js +1 -1
  115. package/widgets/support/SketchTooltipControls/SketchTooltipControlsViewModel.js +1 -1
  116. package/widgets/support/SketchTooltipControls.js +1 -1
  117. package/widgets/support/SnappingControls.js +1 -1
  118. package/assets/esri/core/workers/chunks/055575ed2ab78be0bdb2.js +0 -1
  119. package/assets/esri/core/workers/chunks/0ee90a0b4d09a56c0d48.js +0 -1
  120. package/assets/esri/core/workers/chunks/15056f91d87f11b00bcc.js +0 -1
  121. package/assets/esri/core/workers/chunks/344e40934c98d6fe66ae.js +0 -1
  122. package/assets/esri/core/workers/chunks/558049fcac3a82a093fc.js +0 -1
  123. package/assets/esri/core/workers/chunks/5c41eb67d19b8710118a.js +0 -1
  124. package/assets/esri/core/workers/chunks/5d183ac1a8b68ba9c656.js +0 -1
  125. package/assets/esri/core/workers/chunks/610d4a5d2511fa81460e.js +0 -1
  126. package/assets/esri/core/workers/chunks/6755bb1f2a6575a8e082.js +0 -1
  127. package/assets/esri/core/workers/chunks/84173936b309712ba9b3.js +0 -1
  128. package/assets/esri/core/workers/chunks/877302d6e39a0d530aab.js +0 -1
  129. package/assets/esri/core/workers/chunks/a07dc782e69111e2eeaf.js +0 -1
  130. package/assets/esri/core/workers/chunks/b825019841247d173072.js +0 -1
  131. package/assets/esri/core/workers/chunks/bed1bc13b168fae46404.js +0 -1
  132. package/assets/esri/core/workers/chunks/c8dd21a332559c99815c.js +0 -1
  133. package/assets/esri/core/workers/chunks/ccc3564e76c0ec5c0228.js +0 -1
  134. package/assets/esri/core/workers/chunks/d0a81c7ec8a84eeadd31.js +0 -1
  135. package/assets/esri/core/workers/chunks/e7a852b319c1d89eddc5.js +0 -1
  136. package/assets/esri/core/workers/chunks/ebde11fdccb437954ce7.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5245,661,5234,9880],{53073:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(75148),a=n(59987),s=n(91136),i=n(90961),o=n(90658),l=n(8667);class u extends s.Z{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._parent._getFilteredSet("esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new i.Z(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===o.dj.NotInFeatureSet?t:(t=this._idstates[e],void 0===t?o.dj.Unknown:t)}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,r){return this._parent._getFeatures(e,t,n,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){if(null===e.geometry)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":return(0,l.kK)((0,o.SV)(this._relationGeom),(0,o.SV)(e.geometry));case"esriSpatialRelIntersects":return(0,l.kK)(this._relationGeom,e.geometry);case"esriSpatialRelContains":return(0,l.r3)(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return(0,l.Nm)(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return(0,l.uh)(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return(0,l.W4)(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return(0,l.jU)(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return(0,l.LV)(this._relationGeom,e.geometry,this._relationString??"")}}async _fetchAndRefineFeatures(e,t,n){const r=new i.Z([],e,!1,null),a=Math.min(t,e.length);await(this._parent?._getFeatures(r,-1,a,n)),this._checkCancelled(n);const s=[];for(let t=0;t<a;t++){const n=this._parent._featureFromCache(e[t]);s.push(await this.executeSpatialRelationTest(n))}for(let n=0;n<t;n++)!0===s[n]?this._idstates[e[n]]=o.dj.InFeatureSet:this._idstates[e[n]]=o.dj.NotInFeatureSet;return"success"}async _getFilteredSet(e,t,n,r,a){await this._ensureLoaded();const s=await this._parent._getFilteredSet("esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,n,r,a);let o;return this._checkCancelled(a),o=null!==t?new i.Z(s._candidates.slice(0).concat(s._known.slice(0)),[],s._ordered,this._clonePageDefinition(s.pagesDefinition)):new i.Z(s._candidates.slice(0),s._known.slice(0),s._ordered,this._clonePageDefinition(s.pagesDefinition)),o}async _stat(e,t,n,r,a,s,i){if(""!==n)return{calculated:!1};const o=await this._parent._stat(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,a,s,i);return!1===o.calculated?null===a&&""===n&&null===r?this._manualStat(e,t,s,i):{calculated:!1}:o}async _canDoAggregates(e,t,n,r,a){return""===n&&null===r&&null!==this._parent&&this._parent._canDoAggregates(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,a)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,s,i,o){if(null===this._parent)throw new a.EN(a.H9.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,"esriSpatialRelRelation"!==this._relation?this._relation:this._relation+":"+this._relationString,this._relationGeom,s,i,o)}static registerAction(){s.Z._featuresetFunctions.intersects=function(e){return null==e?new r.Z({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelIntersects",relationGeom:e})},s.Z._featuresetFunctions.envelopeIntersects=function(e){return null==e?new r.Z({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelEnvelopeIntersects",relationGeom:e})},s.Z._featuresetFunctions.contains=function(e){return null==e?new r.Z({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelContains",relationGeom:e})},s.Z._featuresetFunctions.overlaps=function(e){return null==e?new r.Z({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelOverlaps",relationGeom:e})},s.Z._featuresetFunctions.within=function(e){return null==e?new r.Z({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelWithin",relationGeom:e})},s.Z._featuresetFunctions.touches=function(e){return null==e?new r.Z({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelTouches",relationGeom:e})},s.Z._featuresetFunctions.crosses=function(e){return null==e?new r.Z({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelCrosses",relationGeom:e})},s.Z._featuresetFunctions.relate=function(e,t){return null==e?new r.Z({parentfeatureset:this}):new u({parentfeatureset:this,relation:"esriSpatialRelRelation",relationGeom:e,relationString:t})}}}},75148:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(59987),a=n(91136),s=n(90961),i=n(90658);class o extends a.Z{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new s.Z([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=i.Bj.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return i.dj.NotInFeatureSet}async _getFeature(){throw new r.EN(r.H9.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new r.EN(r.H9.NeverReach)}async _getFilteredSet(){return new s.Z([],[],!1,null)}_stat(e,t,n,r,a,s,i){return this._manualStat(e,t,s,i)}async _canDoAggregates(){return!1}}},91136:(e,t,n)=>{n.d(t,{Z:()=>_});var r=n(85839),a=n(48039),s=n(59987);class i{constructor(e,t){this._lastId=-1,this._progress=t,this._parent=e}reset(){this._lastId=-1}nextBatch(e){if(null!==this._parent._mainSetInUse)return this._parent._mainSetInUse.then((t=>this.nextBatch(e)),(t=>this.nextBatch(e)));const t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise(((r,a)=>{this._parent._getSet(this._progress).then((s=>{const i=s._known;let o=i.length-1;if("GETPAGES"===i[i.length-1]&&(o-=1),this._lastId+e>o&&i.length>0&&"GETPAGES"===i[i.length-1])return void this._parent._expandPagedSet(s,this._parent._maxQueryRate(),0,0,this._progress).then((n=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,a(e)}));const l=s._candidates;if(o>=this._lastId+e||0===l.length){for(let t=0;t<e;t++){const e=t+this._lastId+1;if(e>=i.length)break;n[t]=i[e]}return this._lastId+=n.length,0===n.length&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(n,this._progress).then((e=>{t.hasset=!0,this._parent._mainSetInUse=null,r(e)}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,a(e)}))}this._parent._refineSetBlock(s,this._parent._maxProcessingRate(),this._progress).then((()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,a(e)}))}),(e=>{t.hasset=!0,this._parent._mainSetInUse=null,a(e)}))})),!1===t.hasset&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(null!==this._parent._mainSetInUse)return this._parent._mainSetInUse.then((e=>this.next()),(e=>this.next()));const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise(((t,n)=>{this._parent._getSet(this._progress).then((r=>{const a=r._known;this._lastId<a.length-1?"GETPAGES"===a[this._lastId+1]?this._parent._expandPagedSet(r,this._parent._maxQueryRate(),0,0,this._progress).then((t=>(e.hasset=!0,this._parent._mainSetInUse=null,this.next()))).then(t,n):(this._lastId+=1,this._parent._getFeature(r,a[this._lastId],this._progress).then((n=>{e.hasset=!0,this._parent._mainSetInUse=null,t(n)}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)}))):r._candidates.length>0?this._parent._refineSetBlock(r,this._parent._maxProcessingRate(),this._progress).then((()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)})):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))}),(t=>{e.hasset=!0,this._parent._mainSetInUse=null,n(t)}))})),!1===e.hasset&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(-1!==this._parent._totalCount)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&"GETPAGES"===e._known[e._known.length-1])return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if("GETPAGES"===e._known[e._candidates.length-1])return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}var o=n(90961),l=n(90658),u=n(95002),c=n(95330),h=n(8968),d=n(8667),f=n(82971),p=n(99514);class _{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=l.Bj.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=[],this.typeIdField=null,this.types=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,this._dateFieldIndex=null,e&&e.lrucache&&(this.recentlyUsedQueries=e.lrucache),e&&e.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return void 0===t?this[e]:(void 0!==this[e]&&(this[e]=t),this)}end(){return null!==this._parent&&!0===this._parent._transparent?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return null===this._loadPromise&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){return!0===this._parent?.loaded?(this._initialiseFeatureSet(),this):(await(this._parent?.load()),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new f.Z({wkid:4326}),this.geometryType=l.Qk.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some((t=>(t&&t.name.toLowerCase()===e&&(n=t),!!n)))),n}getFieldsIndex(){return null===this._fieldsIndex&&(this._fieldsIndex=new p.Z(this.fields)),this._fieldsIndex}_maxProcessingRate(){return null!==this._parent?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return null!==this._parent?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(null!=e&&e.aborted)throw new s.EN(s.H9.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,r,a){return null!==this._parent&&this._parent._canDoAggregates(e,t,n,r,a)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,o){if(null===this._parent)throw new s.EN(s.H9.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,o)}async _getAgregagtePhysicalPage(e,t,n){if(null===this._parent)throw new s.EN(s.H9.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===l.Bj.NotEvaluated){if(null!==a.Z.applicationCache){const e=a.Z.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(null!==e)return e}if(null!==this._databaseTypeProbed)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),null!==a.Z.applicationCache&&a.Z.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw null!==a.Z.applicationCache&&a.Z.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:l.Bj.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:l.Bj.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:l.Bj.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(!0===await this._runDatabaseProbe(t.testwhere))return t.thetype;return l.Bj.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(null!==this._parent)return this._parent._runDatabaseProbe(e);throw new s.EN(s.H9.NotImplemented)}isTable(){return this._parent?.isTable()??!1}_featureFromCache(e){if(void 0!==this._featureCache[e])return this._featureCache[e]}_isInFeatureSet(e){return l.dj.Unknown}_getSet(e){throw new s.EN(s.H9.NotImplemented)}async _getFeature(e,t,n){if(this._checkCancelled(n),void 0!==this._featureFromCache(t))return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),void 0!==this._featureFromCache(t))return this._featureFromCache(t);throw new s.EN(s.H9.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new o.Z([],e,!1,null),r=[];await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t);for(const t of e)void 0!==this._featureFromCache(t)&&r.push(this._featureFromCache(t));return r}async _getFeatures(e,t,n,r){return"success"}_getFilteredSet(e,t,n,r,a){throw new s.EN(s.H9.NotImplemented)}async _refineSetBlock(e,t,n){if(!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate()))return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);const r=e._candidates.length;this._refineKnowns(e,t);let a=r-e._candidates.length;if(0===e._candidates.length)return e;if(a>=t)return e;if(await this._refineIfParentKnown(e,t-a,n),this._checkCancelled(n),this._refineKnowns(e,t-a),a=r-e._candidates.length,a<t&&e._candidates.length>0){const r=t-a,s=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(s,s.length>r?r:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-a),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){const t=[];for(let n=0;n<e.length;n++)this._isPhysicalFeature(e[n])&&t.push(e[n]);return t}_isPhysicalFeature(e){return null===this._parent||this._parent._isPhysicalFeature(e)}_refineKnowns(e,t){let n=0,r=null;const a=[];t=this._maxQueryRate();for(let s=0;s<e._candidates.length&&"GETPAGES"!==e._candidates[s];s++){let i=!1;const o=this._candidateIdTransform(e._candidates[s]);o!==e._candidates[s]&&(i=!0);const u=this._isInFeatureSet(o);if(u===l.dj.InFeatureSet)!0===i?e._known.includes(o)||(e._known.push(o),n+=1):(e._known.push(e._candidates[s]),n+=1),null===r?r={start:s,end:s}:r.end===s-1?r.end=s:(a.push(r),r={start:s,end:s});else if(u===l.dj.NotInFeatureSet)null===r?r={start:s,end:s}:r.end===s-1?r.end=s:(a.push(r),r={start:s,end:s}),n+=1;else if(u===l.dj.Unknown&&(n+=1,!0===e._ordered))break;if(n>=t)break}null!==r&&a.push(r);for(let t=a.length-1;t>=0;t--)e._candidates.splice(a[t].start,a[t].end-a[t].start+1)}_refineIfParentKnown(e,t,n){const r=new o.Z([],[],e._ordered,null);return r._candidates=e._candidates.slice(0),this._parent._refineSetBlock(r,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(null===e.pagesDefinition)return!1;let n=0;for(let r=e._lastFetchedIndex;r<e._known.length;r++){if("GETPAGES"===e._known[r])return!0;if(void 0===this._featureCache[e._known[r]]&&(n+=1,n>=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(null===e.pagesDefinition)return!1;let n=0;for(let r=0;r<e._candidates.length;r++){if("GETPAGES"===e._candidates[r])return!0;if(n+=1,n>=t)break}return!1}async _expandPagedSet(e,t,n,r,a){if(null===this._parent)throw new s.EN(s.H9.NotImplemented);return this._parent._expandPagedSet(e,t,n,r,a)}async _expandPagedSetFeatureSet(e,t,n,r,a){if(e._known.length>0&&"GETPAGES"===e._known[e._known.length-1]&&(r=1),0===r&&e._candidates.length>0&&"GETPAGES"===e._candidates[e._candidates.length-1]&&(r=2),0===r)return"finished";const s=await this._getPage(e,r,a);return n+s<t?this._expandPagedSet(e,t,n+s,0,a):"success"}async _getPage(e,t,n){const r=1===t?e._known:e._candidates;if(e.pagesDefinition.internal.set.length>e.pagesDefinition.resultOffset||!0===e.pagesDefinition.internal.fullyResolved){r.length=r.length-1;let t=0;for(let n=0;n<e.pagesDefinition.resultRecordCount&&!(e.pagesDefinition.resultOffset+n>=e.pagesDefinition.internal.set.length);n++)r[r.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+n],t++;e.pagesDefinition.resultOffset+=t;let n=!1;return!0===e.pagesDefinition.internal.fullyResolved&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(n=!0),!1===n&&r.push("GETPAGES"),t}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return null===this._parent?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,r){await this._ensureLoaded();let a=await this._stat(e,t,"",null,null,n,r);return!1===a.calculated&&(a=await this._manualStat(e,t,n,r)),a.result}async _manualStat(e,t,n,r){let a=null;switch(e.toLowerCase()){case"count":return a=await(0,u.QX)(this,r),{calculated:!0,result:a};case"distinct":return a=await(0,u.EB)(this,t,n,r),{calculated:!0,result:a};case"avg":case"mean":return a=await(0,u.J6)(this,t,r),{calculated:!0,result:a};case"stdev":return a=await(0,u.m)(this,t,r),{calculated:!0,result:a};case"variance":return a=await(0,u.CA)(this,t,r),{calculated:!0,result:a};case"sum":return a=await(0,u.Sm)(this,t,r),{calculated:!0,result:a};case"min":return a=await(0,u.VV)(this,t,r),{calculated:!0,result:a};case"max":return a=await(0,u.Fp)(this,t,r),{calculated:!0,result:a};default:return{calculated:!0,result:0}}}async _stat(e,t,n,r,a,s,i){const o=await this._parent._stat(e,t,n,r,a,s,i);return!1===o.calculated?null===a&&""===n&&null===r?this._manualStat(e,t,s,i):{calculated:!1}:o}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),n=[];return new Promise(((e,r)=>{this._unionShapeInBatches(n,t,e,r)}))}_unionAllGeom(e){return new Promise(((t,n)=>{const r=this.iterator(this._defaultTracker(e));this._unionShapeInBatches([],r,t,n)}))}_unionShapeInBatches(e,t,n,r){t.next().then((a=>{try{null!==a&&null!==a.geometry&&e.push(a.geometry),e.length>30||null===a&&e.length>1?(0,d.G0)(e).then((s=>{try{null===a?n(s):(e=[s],this._unionShapeInBatches(e,t,n,r))}catch(e){r(e)}}),r):null===a?1===e.length?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,r)}catch(e){r(e)}}),r)}iterator(e){return new i(this,e)}intersection(e,t=!1){return _._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return _._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return _._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",r=null){return _._featuresetFunctions.morphShape.bind(this)(e,t,n,r)}morphShapeAndAttributes(e,t,n="unknown"){return _._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return _._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return _._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return _._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return _._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return _._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return _._featuresetFunctions.relate.bind(this)(e,t)}within(e){return _._featuresetFunctions.within.bind(this)(e)}touches(e){return _._featuresetFunctions.touches.bind(this)(e)}top(e){return _._featuresetFunctions.top.bind(this)(e)}crosses(e){return _._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,r=!0){return _._featuresetFunctions.buffer.bind(this)(e,t,n,r)}filter(e,t=null){return _._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return _._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return _._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return _._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise(((r,a)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,r,a,0)}))}_reduceImpl(e,t,n,r,a,s,i){try{if(++i>1e3)return void setTimeout((()=>{i=0,this._reduceImpl(e,t,n,r,a,s,i)}));e.next().then((o=>{try{if(null===o)a(n);else{const l=t(n,o,r,this);(0,c.y8)(l)?l.then((n=>{this._reduceImpl(e,t,n,r+1,a,s,i)}),s):this._reduceImpl(e,t,l,r+1,a,s,i)}}catch(e){s(e)}}),s)}catch(e){s(e)}}removeField(e){return _._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return _._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const r=(0,l.EI)(e);return this.reduce(((e,n)=>null===n.geometry?0:t?(0,d.Y4)(n.geometry,r).then((t=>e+t)):(0,d.CJ)(n.geometry,r).then((t=>e+t))),0,n)}sumLength(e,t=!1,n){const r=(0,l.Lz)(e);return this.reduce(((e,n)=>null===n.geometry?0:t?(0,d.kQ)(n.geometry,r).then((t=>e+t)):(0,d.sz)(n.geometry,r).then((t=>e+t))),0,n)}_substituteVars(e,t){if(null!==t){const n={};for(const e in t)n[e.toLowerCase()]=t[e];e.parameters=n}}async distinct(e,t=1e3,n=null,r){await this.load();const a=h.WhereClause.create(e,this.getFieldsIndex(),{timeZone:this.dateTimeReferenceFieldIndex.layerTimeInfoTimeZoneDefaultUTC});return this._substituteVars(a,n),this.calculateStatistic("distinct",a,t,this._defaultTracker(r))}async min(e,t=null,n){await this.load();const r=h.WhereClause.create(e,this.getFieldsIndex(),{timeZone:this.dateTimeReferenceFieldIndex.layerTimeInfoTimeZoneDefaultUTC});return this._substituteVars(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const r=h.WhereClause.create(e,this.getFieldsIndex(),{timeZone:this.dateTimeReferenceFieldIndex.layerTimeInfoTimeZoneDefaultUTC});return this._substituteVars(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const r=h.WhereClause.create(e,this.getFieldsIndex(),{timeZone:this.dateTimeReferenceFieldIndex.layerTimeInfoTimeZoneDefaultUTC});return this._substituteVars(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const r=h.WhereClause.create(e,this.getFieldsIndex(),{timeZone:this.dateTimeReferenceFieldIndex.layerTimeInfoTimeZoneDefaultUTC});return this._substituteVars(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const r=h.WhereClause.create(e,this.getFieldsIndex(),{timeZone:this.dateTimeReferenceFieldIndex.layerTimeInfoTimeZoneDefaultUTC});return this._substituteVars(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const r=h.WhereClause.create(e,this.getFieldsIndex(),{timeZone:this.dateTimeReferenceFieldIndex.layerTimeInfoTimeZoneDefaultUTC});return this._substituteVars(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",h.WhereClause.create("1",this.getFieldsIndex(),{timeZone:this.dateTimeReferenceFieldIndex.layerTimeInfoTimeZoneDefaultUTC}),-1,this._defaultTracker(e))}_defaultTracker(e){return e??{aborted:!1}}forEach(e,t){return new Promise(((n,r)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,r,0)}))}_forEachImpl(e,t,n,r,a,s){try{if(++s>1e3)return void setTimeout((()=>{s=0,this._forEachImpl(e,t,n,r,a,s)}),0);e.next().then((i=>{try{if(null===i)r(n);else{const o=t(i);null==o?this._forEachImpl(e,t,n,r,a,s):(0,c.y8)(o)?o.then((()=>{try{this._forEachImpl(e,t,n,r,a,s)}catch(e){a(e)}}),a):this._forEachImpl(e,t,n,r,a,s)}}catch(e){a(e)}}),a)}catch(e){a(e)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let e=0;e<this.fields.length;e++)t.layerDefinition.fields.push((0,l.Sh)(this.fields[e]));return this.reduce(((e,n)=>{const r={geometry:n.geometry&&n.geometry.toJSON(),attributes:{}};for(const e in n.attributes)r.attributes[e]=n.attributes[e];return t.featureSet.features.push(r),1}),0,e).then((()=>t))}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,n,r,a){return this._parent.queryAttachments(e,t,n,r,a)}serviceUrl(){return this._parent.serviceUrl()}subtypes(){return this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map((e=>({name:e.name,code:e.id}))):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push((0,l.Sh)(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:void 0===l.q2[this.geometryType]?"esriGeometryNull":l.q2[this.geometryType],fields:e}}async convertToText(e,t){if("schema"===e)return await this._ensureLoaded(),JSON.stringify(this.schema());if("featureset"===e){await this._ensureLoaded();const e=[];await this.reduce(((t,n)=>{const r={geometry:n.geometry?n.geometry.toJSON():null,attributes:n.attributes};return null!==r.geometry&&r.geometry.spatialReference&&delete r.geometry.spatialReference,e.push(r),1}),0,t);const n=this.schema();return n.features=e,n.spatialReference=this.spatialReference.toJSON(),JSON.stringify(n)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return null!==this._parent?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return null!==this._parent?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return"keeptype"===e?.featureset?this:"none"===e?.featureset?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){if("keeptype"===t?.featureset)return this;if("schema"===t?.featureset)return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if("none"===t?.featureset)return null;await this._ensureLoaded();const n=[];await this.reduce(((e,r)=>{const a={geometry:r.geometry?!0===t?.keepGeometryType?r.geometry:r.geometry.toJSON():null,attributes:r.attributes};return null!==a.geometry&&a.geometry.spatialReference&&!0!==t?.keepGeometryType&&delete a.geometry.spatialReference,n.push(a),1}),0,e);const r=this.schema();return r.features=n,r.spatialReference=!0===t?.keepGeometryType?this.spatialReference:this.spatialReference?.toJSON(),r}get dateTimeReferenceFieldIndex(){return null===this._dateFieldIndex&&(this._dateFieldIndex=r.nu.create(this.getFieldsIndex(),this)),this._dateFieldIndex}fieldTimeZone(e){return this.dateTimeReferenceFieldIndex.fieldTimeZone(e)}get preferredTimeReference(){return this._parent?.preferredTimeReference??null}get dateFieldsTimeReference(){return this._parent?.dateFieldsTimeReference??null}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){return this._parent?.editFieldsInfo??null}get timeInfo(){return this._parent?.timeInfo??null}}_._featuresetFunctions={}},90961:(e,t,n)=>{n.d(t,{Z:()=>r});class r{constructor(e,t,n,r){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=r}}},48039:(e,t,n)=>{n.d(t,{Z:()=>r});class r{constructor(){this._databaseTypeMetaData={},this._layerInfo={}}clearDatabaseType(e){void 0===this._databaseTypeMetaData[e]&&delete this._databaseTypeMetaData[e]}getDatabaseType(e){return"MUSTBESET"===e||void 0===this._databaseTypeMetaData[e]?null:this._databaseTypeMetaData[e]}setDatabaseType(e,t){this._databaseTypeMetaData[e]=t}getLayerInfo(e){return void 0===this._layerInfo[e]?null:this._layerInfo[e]}setLayerInfo(e,t){this._layerInfo[e]=t}clearLayerInfo(e){void 0!==this._layerInfo[e]&&delete this._layerInfo[e]}}r.applicationCache=null},36515:(e,t,n)=>{n.d(t,{$e:()=>d,DT:()=>w,TE:()=>L,XF:()=>c,bB:()=>h,fz:()=>p,hq:()=>b,mA:()=>_,oX:()=>y,vR:()=>S,y5:()=>E,zR:()=>u});var r=n(48853),a=n(59987),s=n(90658),i=n(53970),o=n(8968),l=n(17126);function u(e,t){return f(e?.parseTree,t,e?.parameters)}function c(e,t,n){return f(e,t,n)}function h(e,t,n,r){return o.WhereClause.create(f(e.parseTree,s.Bj.Standardised,e.parameters,t,n),r,{timeZone:e.timeReferenceZone})}function d(e,t,n="AND"){return o.WhereClause.create("(("+u(e,s.Bj.Standardised)+")"+n+"("+u(t,s.Bj.Standardised)+"))",e.fieldsIndex,{timeZone:e.timeReferenceZone})}function f(e,t,n,r=null,i=null,o=null){let u,c,h,d;switch(e.type){case"interval":return L(f(e.value,t,n,r,i,o),e.qualifier,e.op);case"case-expression":{let a=" CASE ";"simple"===e.format&&(a+=f(e.operand,t,n,r,i,o));for(let s=0;s<e.clauses.length;s++)a+=" WHEN "+f(e.clauses[s].operand,t,n,r,i,o)+" THEN "+f(e.clauses[s].value,t,n,r,i,o);return null!==e.else&&(a+=" ELSE "+f(e.else,t,n,r,i,o)),a+=" END ",a}case"parameter":{const r=n[e.value.toLowerCase()];if("string"==typeof r)return"'"+n[e.value.toLowerCase()].toString().replaceAll("'","''")+"'";if((0,s.J_)(r))return y(r,t,o);if((0,s._U)(r))return g(r,t);if((0,s.NP)(r))return _(r,t,o);if((0,s.$A)(r))return m(r,t);if(r instanceof Array){const e=[];for(let n=0;n<r.length;n++)"string"==typeof r[n]?e.push("'"+r[n].toString().replaceAll("'","''")+"'"):(0,s.J_)(r[n])?e.push(y(r[n],t,o)):(0,s._U)(r[n])?e.push(g(r[n],t)):(0,s.NP)(r[n])?e.push(_(r[n],t,o)):(0,s.$A)(r[n])?e.push(m(r[n],t)):e.push(r[n].toString());return e}return r.toString()}case"expression-list":c=[];for(const a of e.value)c.push(f(a,t,n,r,i,o));return c;case"unary-expression":return" ( NOT "+f(e.expr,t,n,r,i,o)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+f(e.left,t,n,r,i,o)+" AND "+f(e.right,t,n,r,i,o)+") ";case"OR":return" ("+f(e.left,t,n,r,i,o)+" OR "+f(e.right,t,n,r,i,o)+") ";case"IS":if("null"!==e.right.type)throw new a.eS(a.f.UnsupportedIsRhs);return" ("+f(e.left,t,n,r,i,o)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new a.eS(a.f.UnsupportedIsRhs);return" ("+f(e.left,t,n,r,i,o)+" IS NOT NULL )";case"IN":return u=[],"expression-list"===e.right.type?(u=f(e.right,t,n,r,i)," ("+f(e.left,t,n,r,i,o)+" IN ("+u.join(",")+")) "):(d=f(e.right,t,n,r,i,o),d instanceof Array?" ("+f(e.left,t,n,r,i,o)+" IN ("+d.join(",")+")) ":" ("+f(e.left,t,n,r,i,o)+" IN ("+d+")) ");case"NOT IN":return u=[],"expression-list"===e.right.type?(u=f(e.right,t,n,r,i)," ("+f(e.left,t,n,r,i,o)+" NOT IN ("+u.join(",")+")) "):(d=f(e.right,t,n,r,i,o),d instanceof Array?" ("+f(e.left,t,n,r,i,o)+" NOT IN ("+d.join(",")+")) ":" ("+f(e.left,t,n,r,i,o)+" NOT IN ("+d+")) ");case"BETWEEN":return h=f(e.right,t,n,r,i,o)," ("+f(e.left,t,n,r,i,o)+" BETWEEN "+h[0]+" AND "+h[1]+" ) ";case"NOTBETWEEN":return h=f(e.right,t,n,r,i,o)," ("+f(e.left,t,n,r,i,o)+" NOT BETWEEN "+h[0]+" AND "+h[1]+" ) ";case"LIKE":return""!==e.escape?" ("+f(e.left,t,n,r,i,o)+" LIKE "+f(e.right,t,n,r,i,o)+" ESCAPE '"+e.escape+"') ":" ("+f(e.left,t,n,r,i,o)+" LIKE "+f(e.right,t,n,r,i,o)+") ";case"NOT LIKE":return""!==e.escape?" ("+f(e.left,t,n,r,i,o)+" NOT LIKE "+f(e.right,t,n,r,i,o)+" ESCAPE '"+e.escape+"') ":" ("+f(e.left,t,n,r,i,o)+" NOT LIKE "+f(e.right,t,n,r,i,o)+") ";case"<>":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+f(e.left,t,n,r,i,o)+" "+e.operator+" "+f(e.right,t,n,r,i,o)+") ";case"||":return" ("+f(e.left,t,n,r,i,o)+" "+(t===s.Bj.SqlServer?"+":e.operator)+" "+f(e.right,t,n,r,i,o)+") "}throw new a.eS(a.f.UnsupportedOperator,{operator:e.operator});case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return function(e,t,n,r){let a=(0,s.J_)(e)?l.ou.fromJSDate(e):l.ou.fromSQL(e);const i=0===a.hour&&0===a.minute&&0===a.second&&0===a.millisecond;switch(n?.inputTimeReference&&(a=l.ou.fromObject({day:a.day,year:a.year,month:a.month,hour:a.hour,minute:a.minute,second:a.second,millisecond:a.millisecond},{zone:n.inputTimeReference})),n?.outputTimeReference&&(a=a.setZone(n.outputTimeReference)),t){case s.Bj.FILEGDB:case s.Bj.Standardised:case s.Bj.StandardisedNoInterval:return i?`date '${a.toFormat("yyyy-LL-dd")}'`:`date '${a.toFormat("yyyy-LL-dd HH:mm:ss")}'`;case s.Bj.Oracle:return i?`TO_DATE('${a.toFormat("yyyy-LL-dd")}','YYYY-MM-DD')`:`TO_DATE('${a.toFormat("yyyy-LL-dd HH:mm:ss")}','YYYY-MM-DD HH24:MI:SS')`;case s.Bj.SqlServer:return`'${a.toFormat(i?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;case s.Bj.PGDB:return`#${a.toFormat(i?"LL-dd-yyyy":"LL-dd-yyyy HH:mm:ss")}#`;case s.Bj.Postgres:return`TIMESTAMP '${a.toFormat(i?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;default:return`date '${a.toFormat("yyyy-LL-dd HH:mm:ss")}'`}}(e.value,t,o,e.withtimezone);case"date":return y(e.value,t,o);case"time":return g(e.value,t);case"number":return e.value.toString();case"current-time":return S("date"===e.mode,t);case"column-reference":return r?r.toLowerCase()===e.column.toLowerCase()?"("+i+")":!0===e.delimited?`"${e.column.split('"').join('""')}"`:e.column:e.column;case"data-type":return e.value;case"function":{const a=f(e.args,t,n,r,i,o);return p(e.name,a,t)}}throw new a.eS(a.f.UnsupportedSyntax,{node:e.type})}function p(e,t,n){switch(e.toLowerCase().trim()){case"cos":case"sin":case"tan":case"cosh":case"tanh":case"sinh":case"acos":case"asin":case"atan":case"floor":case"log10":case"log":case"abs":if(1!==t.length)throw new a.eS(a.f.InvalidFunctionParameters,{function:e.toLowerCase().trim()});return`${e.toUpperCase().trim()}(${t[0]})`;case"ceiling":case"ceil":if(1!==t.length)throw new a.eS(a.f.InvalidFunctionParameters,{function:"ceiling"});switch(n){case s.Bj.Standardised:case s.Bj.StandardisedNoInterval:}return"CEILING("+t[0]+")";case"mod":case"power":case"nullif":if(2!==t.length)throw new a.eS(a.f.InvalidFunctionParameters,{function:e.toLowerCase().trim()});return`${e.toUpperCase().trim()}(${t[0]},${t[1]})`;case"round":if(2===t.length)return"ROUND("+t[0]+","+t[1]+")";if(1===t.length)return"ROUND("+t[0]+")";throw new a.eS(a.f.InvalidFunctionParameters,{function:"round"});case"truncate":if(t.length<1||t.length>2)throw new a.eS(a.f.InvalidFunctionParameters,{function:"truncate"});return n===s.Bj.SqlServer?"ROUND("+t[0]+(1===t.length?"0":","+t[1])+",1)":"TRUNCATE("+t[0]+(1===t.length?")":","+t[1]+")");case"char_length":case"len":if(1!==t.length)throw new a.eS(a.f.InvalidFunctionParameters,{function:"char_length"});switch(n){case s.Bj.SqlServer:return"LEN("+t[0]+")";case s.Bj.Oracle:return"LENGTH("+t[0]+")";default:return"CHAR_LENGTH("+t[0]+")"}case"coalesce":case"concat":{if(t.length<1)throw new a.eS(a.f.InvalidFunctionParameters,{function:e.toLowerCase()});let n=e.toUpperCase().trim()+"(";for(let e=0;e<t.length;e++)0!==e&&(n+=","),n+=t[e];return n+=")",n}case"lower":case"lcase":if(1!==t.length)throw new a.eS(a.f.InvalidFunctionParameters,{function:"lower"});return"LOWER("+t[0]+")";case"upper":case"ucase":if(1!==t.length)throw new a.eS(a.f.InvalidFunctionParameters,{function:"upper"});return"UPPER("+t[0]+")";case"substring":{let e="";switch(n){case s.Bj.Oracle:return e="SUBSTR("+t[0]+","+t[1],3===t.length&&(e+=","+t[2]),e+=")",e;case s.Bj.SqlServer:return e=3===t.length?"SUBSTRING("+t[0]+","+t[1]+","+t[2]+")":"SUBSTRING("+t[0]+", "+t[1]+", LEN("+t[0]+") - "+t[1]+")",e;default:return e="SUBSTRING("+t[0]+" FROM "+t[1],3===t.length&&(e+=" FOR "+t[2]),e+=")",e}}case"extract":return"EXTRACT("+t[0].replaceAll("'","")+" FROM "+t[1]+")";case"cast":{let e="";switch(n){case s.Bj.Oracle:switch(t[1].type){case"date":e="DATE";break;case"float":e="DOUBLE";break;case"integer":e="INTEGER";break;case"real":e="REAL";break;case"smallint":e="SMALLINT";break;case"timestamp":e="TIMESTAMP";break;case"varchar":e="VARCHAR("+t[1].size.toString()+")"}return`CAST(${t[0]} AS ${e})`;case s.Bj.Postgres:switch(t[1].type){case"date":e="DATE";break;case"float":e="DOUBLE PRECISION";break;case"integer":e="INT";break;case"real":e="REAL";break;case"smallint":e="SMALLINT";break;case"timestamp":e="TIMESTAMP";break;case"varchar":e="VARCHAR("+t[1].size.toString()+")"}return`CAST(${t[0]} AS ${e})`;case s.Bj.SqlServer:switch(t[1].type){case"date":e="DATE";break;case"float":e="FLOAT";break;case"integer":e="INT";break;case"real":e="REAL";break;case"smallint":e="SMALLINT";break;case"timestamp":e="DATETIME";break;case"varchar":e="VARCHAR("+t[1].size.toString()+")"}return`CAST(${t[0]} AS ${e})`;default:switch(t[1].type){case"date":e="DATE";break;case"float":e="FLOAT";break;case"integer":e="INTEGER";break;case"real":e="REAL";break;case"smallint":e="SMALLINT";break;case"timestamp":e="TIMESTAMP";break;case"varchar":e="VARCHAR("+t[1].size.toString()+")"}return`CAST(${t[0]} AS ${e})`}}}throw new a.eS(a.f.InvalidFunctionParameters,{function:e})}function _(e,t,n,a){n?.outputTimeReference&&(e=r.iG.arcadeDateAndZoneToArcadeDate(e,n?.outputTimeReference));const i=e.toDateTime(),o=0===i.hour&&0===i.minute&&0===i.second&&0===i.millisecond;switch(t){case s.Bj.FILEGDB:case s.Bj.Standardised:case s.Bj.StandardisedNoInterval:return o?`date '${i.toFormat("yyyy-LL-dd")}'`:`date '${i.toFormat("yyyy-LL-dd HH:mm:ss")}'`;case s.Bj.Oracle:return o?`TO_DATE('${i.toFormat("yyyy-LL-dd")}','YYYY-MM-DD')`:`TO_DATE('${i.toFormat("yyyy-LL-dd HH:mm:ss")}','YYYY-MM-DD HH24:MI:SS')`;case s.Bj.SqlServer:return`'${i.toFormat(o?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;case s.Bj.PGDB:return`#${i.toFormat(o?"LL-dd-yyyy":"LL-dd-yyyy HH:mm:ss")}#`;case s.Bj.Postgres:return`TIMESTAMP '${i.toFormat(o?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;default:return`date '${i.toFormat("yyyy-LL-dd HH:mm:ss")}'`}}function m(e,t,n){switch(t){case s.Bj.FILEGDB:case s.Bj.Standardised:case s.Bj.StandardisedNoInterval:return e.toSQLWithKeyword();case s.Bj.Oracle:return`TO_DATE('${e.toFormat("Y-MM-DD")}'`;case s.Bj.SqlServer:return`'${e.toFormat("Y-MM-DD")}'`;case s.Bj.PGDB:return`#${e.toFormat("Y-MM-DD")}#`;case s.Bj.Postgres:return`TIMESTAMP '${e.toFormat("Y-MM-DD")}'`;default:return e.toSQLWithKeyword()}}function g(e,t){switch(e instanceof i.n&&(e=e.toStorageString()),t){case s.Bj.Oracle:return`TO_DATE('${e}', 'HH24:MI:SS')`;case s.Bj.SqlServer:return`'${e}'`;case s.Bj.FILEGDB:case s.Bj.Standardised:case s.Bj.StandardisedNoInterval:case s.Bj.Postgres:default:return`time '${e}'`}}function y(e,t,n,r){let a=(0,s.J_)(e)?l.ou.fromJSDate(e):l.ou.fromSQL(e);const i=0===a.hour&&0===a.minute&&0===a.second&&0===a.millisecond;switch(n?.inputTimeReference&&(a=l.ou.fromObject({day:a.day,year:a.year,month:a.month,hour:a.hour,minute:a.minute,second:a.second,millisecond:a.millisecond},{zone:n.inputTimeReference})),n?.outputTimeReference&&(a=a.setZone(n.outputTimeReference)),t){case s.Bj.FILEGDB:case s.Bj.Standardised:case s.Bj.StandardisedNoInterval:return i?`date '${a.toFormat("yyyy-LL-dd")}'`:`date '${a.toFormat("yyyy-LL-dd HH:mm:ss")}'`;case s.Bj.Oracle:return i?`TO_DATE('${a.toFormat("yyyy-LL-dd")}','YYYY-MM-DD')`:`TO_DATE('${a.toFormat("yyyy-LL-dd HH:mm:ss")}','YYYY-MM-DD HH24:MI:SS')`;case s.Bj.SqlServer:return`'${a.toFormat(i?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;case s.Bj.PGDB:return`#${a.toFormat(i?"LL-dd-yyyy":"LL-dd-yyyy HH:mm:ss")}#`;case s.Bj.Postgres:return`TIMESTAMP '${a.toFormat(i?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;default:return`date '${a.toFormat("yyyy-LL-dd HH:mm:ss")}'`}}function S(e,t){switch(t){case s.Bj.FILEGDB:case s.Bj.Standardised:case s.Bj.StandardisedNoInterval:case s.Bj.Oracle:return e?"CURRENT_DATE":"CURRENT_TIMESTAMP";case s.Bj.SqlServer:return e?"CAST(GETDATE() AS DATE)":"GETDATE()";case s.Bj.PGDB:case s.Bj.Postgres:default:return e?"CURRENT_DATE":"CURRENT_TIMESTAMP"}}function w(e,t,n={}){const r={},a={},s={esriFieldTypeSmallInteger:"integer",esriFieldTypeInteger:"integer",esriFieldTypeBigInteger:"integer",esriFieldTypeSingle:"double",esriFieldTypeDouble:"double",esriFieldTypeString:"string",esriFieldTypeTimeOnly:"time-only",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimestampOffset:"timestamp-offset",esriFieldTypeDate:"date",esriFieldTypeOID:"integer",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"guid",oid:"integer",long:"integer","small-integer":"integer",integer:"integer","big-integer":"integer",single:"double","time-only":"time-only","date-only":"date-only","timestamp-offset":"timestemp-offset",double:"double",date:"date",guid:"guid",globalid:"guid",string:"string"};for(const e of t){const t=e.type?s[e.type]:void 0;r[e.name.toLowerCase()]=void 0===t?"":t}for(const e in n){const t=s[n[e]];a[e.toLowerCase()]=void 0===t?"":t}switch(T(r,e.parseTree,e.parameters,a)){case"double":return"double";case"integer":return"integer";case"date":return"date";case"date-only":return"date-only";case"time-only":return"time-only";case"timestamp-offset":return"timestamp-offset";case"string":return"string";case"global-id":case"guid":return"guid"}return""}function T(e,t,n,r){let i;switch(t.type){case"interval":return"integer";case"case-expression":{const a=[];if("simple"===t.format){for(let s=0;s<t.clauses.length;s++)a.push(T(e,t.clauses[s].value,n,r));null!==t.else&&a.push(T(e,t.else,n,r))}else{for(let s=0;s<t.clauses.length;s++)a.push(T(e,t.else,n,r));null!==t.else&&a.push(T(e,t.else,n,r))}return F(a)}case"parameter":{const e=r[t.value.toLowerCase()];if(void 0===e&&n){const e=n[t.value.toLowerCase()];if(void 0===e)return"";if(null===e)return"";if("string"==typeof e||e instanceof String)return"string";if("boolean"==typeof e)return"boolean";if((0,s.J_)(e))return"date";if((0,s.NP)(e))return"date";if((0,s.$A)(e))return"date-only";if((0,s._U)(e))return"time-only";if("number"==typeof e)return e%1==0?"integer":"double"}return void 0===e?"":e}case"expression-list":{const a=[];for(const s of t.value)a.push(T(e,s,n,r));return a}case"unary-expression":return"boolean";case"binary-expression":switch(t.operator){case"AND":case"OR":case"IN":case"NOT IN":case"BETWEEN":case"NOTBETWEEN":case"LIKE":case"NOT LIKE":case"<>":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if("null"!==t.right.type)throw new a.eS(a.f.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return F([T(e,t.left,n,r),T(e,t.right,n,r)]);case"||":return"string";default:throw new a.eS(a.f.UnsupportedOperator,{operator:t.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return null===t.value?"":t.value%1==0?"integer":"double";case"date":return"date";case"timestamp":return t.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"current-time":return"date";case"column-reference":{const n=e[t.column.toLowerCase()];return void 0===n?"":n}case"function":switch(t.name.toLowerCase()){case"cast":switch(t.args?.value[1]?.value.type??""){case"integer":case"smallint":return"integer";case"real":case"float":return"double";case"date":case"timestamp":return!0===t.args?.value[1]?.value?.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"varchar":return"string";default:return""}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":if(i=T(e,t.args,n,r),i instanceof Array){if(i.length<=0)return"double";i=i[0]}return i;case"sign":return"integer";case"ceiling":case"floor":case"abs":return i=T(e,t.args,n,r),i instanceof Array&&(i=F(i)),"integer"===i||"double"===i?i:"double";case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"nullif":case"coalesce":return i=T(e,t.args,n,r),i instanceof Array?i.length>0?i[0]:"":i}return""}throw new a.eS(a.f.UnsupportedSyntax,{node:t.type})}const I={boolean:1,string:2,integer:3,double:4,date:5};function F(e){if(e){let t="";for(const n of e)""!==n&&(t=""===t||I[t]<I[n]?n:t);return t}return""}function b(e,t){return D(e.parseTree,t)}function E(e){return"column-reference"===e?.parseTree.type}function D(e,t){if(null==e)return!1;switch(e.type){case"when-clause":return D(e.operand,t)||D(e.value,t);case"case-expression":for(const n of e.clauses)if(D(n,t))return!0;return!("simple"!==e.format||!D(e.operand,t))||!(null===e.else||!D(e.else,t));case"parameter":case"null":case"boolean":case"date":case"timestamp":case"time":case"string":case"number":return!1;case"expression-list":for(const n of e.value)if(D(n,t))return!0;return!1;case"unary-expression":return D(e.expr,t);case"binary-expression":return D(e.left,t)||D(e.right,t);case"column-reference":return t.toLowerCase()===e.column.toLowerCase();case"function":return D(e.args,t)}return!1}function v(e){let t="";return t+=e.period.toUpperCase(),t}function L(e,t,n){let r="";return r="interval-period"===t.type?v(t):v(t.start)+" TO "+v(t.end),"INTERVAL "+n+" "+e+" "+r}},95002:(e,t,n)=>{n.d(t,{CA:()=>y,EB:()=>F,Fp:()=>m,J6:()=>g,QX:()=>T,Sm:()=>w,VV:()=>_,g3:()=>f,m:()=>S,tj:()=>p});var r=n(59987),a=n(90658),s=n(36515),i=n(22641),o=n(41555),l=n(53970);function u(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}function c(e){const t=u(e);let n=0;for(let r=0;r<e.length;r++)n+=(t-e[r])**2;return n/e.length}function h(e){const t=u(e);let n=0;for(let r=0;r<e.length;r++)n+=(t-e[r])**2;return n/(e.length-1)}function d(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}function f(e){switch(e.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function p(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return function(e,t){const n=[],r={},s=[];for(let i=0;i<e.length;i++){if(void 0!==e[i]&&null!==e[i]){const t=e[i];if((0,a.hj)(t)||(0,a.HD)(t))void 0===r[t]&&(n.push(t),r[t]=1);else{let e=!1;for(let n=0;n<s.length;n++)!0===(0,a.tt)(s[n],t)&&(e=!0);!1===e&&(s.push(t),n.push(t))}}if(n.length>=t&&-1!==t)return n}return n}(t,n);case"avg":case"mean":return u(t);case"min":return Math.min.apply(Math,t);case"sum":return d(t);case"max":return Math.max.apply(Math,t);case"stdev":case"stddev":return Math.sqrt(c(t));case"var":case"variance":return c(t);case"count":return t.length}return 0}async function _(e,t,n){const r=await I(e,t,n,!0);return 0===r.length?null:Math.min.apply(Math,r)}async function m(e,t,n){const r=await I(e,t,n,!0);return 0===r.length?null:Math.max.apply(Math,r)}async function g(e,t,n){let r="";t&&!(0,s.y5)(t)&&(r=(0,s.DT)(t,e.fields));const a=await I(e,t,n,!0);if(0===a.length)return null;const i=u(a);return null===i?i:"integer"===r?function(e){return e=+e,isFinite(e)?e-e%1||(e<0?-0:0===e?e:0):e}(i):i}async function y(e,t,n){const r=await I(e,t,n,!0);return 0===r.length?null:h(r)}async function S(e,t,n){const r=await I(e,t,n,!0);return 0===r.length?null:Math.sqrt(h(r))}async function w(e,t,n){const r=await I(e,t,n,!0);return 0===r.length?null:d(r)}async function T(e,t){return e.iterator(t).count()}async function I(e,t,n,a=!1){const s=e.iterator(n),u=[],c={ticker:0};let h=await s.next();for(;null!==h;){if(c.ticker++,n.aborted)throw new r.EN(r.H9.Cancelled);c.ticker%100==0&&(c.ticker=0,await new Promise((e=>{setTimeout(e,0)})));const e=t?.calculateValue(h);null===e?!1===a&&(u[u.length]=e):u[u.length]=e instanceof i.u||e instanceof l.n?e.toNumber():e instanceof o.H?e.toMilliseconds():e,h=await s.next()}return u}async function F(e,t,n=1e3,a=null){const s=e.iterator(a),u=[],c={},h={ticker:0};let d=await s.next();for(;null!==d;){if(h.ticker++,a&&a.aborted)throw new r.EN(r.H9.Cancelled);h.ticker%100==0&&(h.ticker=0,await new Promise((e=>{setTimeout(e,0)})));const e=t?.calculateValue(d);let f=e;if(e instanceof i.u?f="!!DATEONLY!!-"+e.toString():e instanceof o.H?f="!!TSOFFSETONLY!!-"+e.toString():e instanceof l.n?f="!!TIMEONLY!!-"+e.toString():e instanceof Date&&(f="!!DATE!!-"+e.toString()),null!=e&&void 0===c[f]&&(u.push(e),c[f]=1),u.length>=n&&-1!==n)return u;d=await s.next()}return u}},99880:(e,t,n)=>{n.d(t,{V:()=>l});var r=n(68773),a=(n(3172),n(20102)),s=n(92604),i=n(17452);const o=s.Z.getLogger("esri.assets");function l(e){if(!r.default.assetsPath)throw o.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new a.Z("assets:path-not-set","config.assetsPath is not set");return(0,i.v_)(r.default.assetsPath,e)}},10661:(e,t,n)=>{n.d(t,{s:()=>a});var r=n(42100);class a extends r.s{notify(){const e=this._observers;if(e&&e.length>0){const t=e.slice();for(const e of t)e.onInvalidated(),e.onCommitted()}}}},8667:(e,t,n)=>{n.d(t,{CJ:()=>M,Cz:()=>O,D$:()=>B,ED:()=>w,FH:()=>x,G0:()=>A,Gg:()=>F,JI:()=>E,LV:()=>I,Nm:()=>T,Sp:()=>v,TE:()=>_,U1:()=>k,W4:()=>y,Y4:()=>G,_L:()=>P,cv:()=>R,e5:()=>D,f3:()=>N,fS:()=>m,j2:()=>j,jU:()=>p,kK:()=>g,kQ:()=>Z,og:()=>b,oq:()=>h,r3:()=>f,rd:()=>C,sz:()=>U,uh:()=>S,wf:()=>L,z7:()=>d}),n(66577);var r=n(56569),a=n(94139),s=n(33955);function i(e){return Array.isArray(e)?e[0]?.spatialReference:e?.spatialReference}function o(e){return e?Array.isArray(e)?e.map(o):e.toJSON?e.toJSON():e:e}function l(e){return Array.isArray(e)?e.map((e=>(0,s.im)(e))):(0,s.im)(e)}let u;async function c(e,t){return(await async function(){return u||(u=(0,r.bA)("geometryEngineWorker",{strategy:"distributed"})),u}()).invoke("executeGEOperation",{operation:e,parameters:o(t)})}async function h(e,t){return l(await c("clip",[i(e),e,t]))}async function d(e,t){return l(await c("cut",[i(e),e,t]))}function f(e,t){return c("contains",[i(e),e,t])}function p(e,t){return c("crosses",[i(e),e,t])}function _(e,t,n){return c("distance",[i(e),e,t,n])}function m(e,t){return c("equals",[i(e),e,t])}function g(e,t){return c("intersects",[i(e),e,t])}function y(e,t){return c("touches",[i(e),e,t])}function S(e,t){return c("within",[i(e),e,t])}function w(e,t){return c("disjoint",[i(e),e,t])}function T(e,t){return c("overlaps",[i(e),e,t])}function I(e,t,n){return c("relate",[i(e),e,t,n])}function F(e){return c("isSimple",[i(e),e])}async function b(e){return l(await c("simplify",[i(e),e]))}async function E(e,t=!1){return l(await c("convexHull",[i(e),e,t]))}async function D(e,t){return l(await c("difference",[i(e),e,t]))}async function v(e,t){return l(await c("symmetricDifference",[i(e),e,t]))}async function L(e,t){return l(await c("intersect",[i(e),e,t]))}async function A(e,t=null){const n=function(e,t){let n;return Array.isArray(e)?n=e:(n=[],n.push(e),null!=t&&n.push(t)),n}(e,t);return l(await c("union",[i(n),n]))}async function R(e,t,n,r,a,s){return l(await c("offset",[i(e),e,t,n,r,a,s]))}async function N(e,t,n,r=!1){const a=[i(e),e,t,n,r];return l(await c("buffer",a))}async function C(e,t,n,r,a,s){const o=[i(e),e,t,n,r,a,s];return l(await c("geodesicBuffer",o))}async function x(e,t,n=!0){const r=await c("nearestCoordinate",[i(e),e,t,n]);return{...r,coordinate:a.Z.fromJSON(r.coordinate)}}async function P(e,t){const n=await c("nearestVertex",[i(e),e,t]);return{...n,coordinate:a.Z.fromJSON(n.coordinate)}}async function k(e,t,n){if(null==e)throw new H;const r=e.spatialReference;if(null==(n=n??function(e){return"xmin"in e?e.center:"x"in e?e:e.extent?.center}(e)))throw new H;const a=e.constructor.fromJSON(await c("rotate",[r,e,t,n]));return a.spatialReference=r,a}async function B(e,t,n,r){return l(await c("generalize",[i(e),e,t,n,r]))}async function O(e,t,n){return l(await c("densify",[i(e),e,t,n]))}async function j(e,t,n,r=0){return l(await c("geodesicDensify",[i(e),e,t,n,r]))}function M(e,t){return c("planarArea",[i(e),e,t])}function U(e,t){return c("planarLength",[i(e),e,t])}function G(e,t,n){return c("geodesicArea",[i(e),e,t,n])}function Z(e,t,n){return c("geodesicLength",[i(e),e,t,n])}class H extends Error{constructor(){super("Illegal Argument Exception")}}},94443:(e,t,n)=>{n.d(t,{ME:()=>p,Su:()=>_,tz:()=>f});var r=n(20102),a=n(50758),s=n(95330),i=n(70171);const o=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,l={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function u(e){return e in l}Object.keys(l);const c=[],h=new Map;function d(e){for(const t of h.keys())m(e.pattern,t)&&h.delete(t)}function f(e){return c.includes(e)||(d(e),c.unshift(e)),(0,a.kB)((()=>{const t=c.indexOf(e);t>-1&&(c.splice(t,1),d(e))}))}async function p(e){const t=(0,i.Kd)();h.has(e)||h.set(e,async function(e,t){const n=[];for(const r of c)if(m(r.pattern,e))try{return await r.fetchMessageBundle(e,t)}catch(e){n.push(e)}if(n.length)throw new r.Z("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:n});throw new r.Z("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}(e,t));const n=h.get(e);return n&&await g.add(n),n}function _(e){if(!o.test(e))return null;const t=o.exec(e);if(null===t)return null;const[,n,r]=t,a=n+(r?"-"+r.toUpperCase():"");return u(a)?a:u(n)?n:null}function m(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,i.Ze)((()=>{h.clear()}));const g=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=(0,s.hh)())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6459],{21787:(t,n,r)=>{r.d(n,{a:()=>u,d:()=>s,f:()=>o,i:()=>h,m:()=>c,n:()=>l,s:()=>a,t:()=>i});var e=r(46851);function o(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t}function a(t,n,r,e,o,a,i,s,u,c){return t[0]=n,t[1]=r,t[2]=e,t[3]=o,t[4]=a,t[5]=i,t[6]=s,t[7]=u,t[8]=c,t}function i(t,n){if(t===n){const r=n[1],e=n[2],o=n[5];t[1]=n[3],t[2]=n[6],t[3]=r,t[5]=n[7],t[6]=e,t[7]=o}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t}function s(t,n){const r=n[0],e=n[1],o=n[2],a=n[3],i=n[4],s=n[5],u=n[6],c=n[7],l=n[8],f=l*i-s*c,h=-l*a+s*u,p=c*a-i*u;let M=r*f+e*h+o*p;return M?(M=1/M,t[0]=f*M,t[1]=(-l*e+o*c)*M,t[2]=(s*e-o*i)*M,t[3]=h*M,t[4]=(l*r-o*u)*M,t[5]=(-s*r+o*a)*M,t[6]=p*M,t[7]=(-c*r+e*u)*M,t[8]=(i*r-e*a)*M,t):null}function u(t,n){const r=n[0],e=n[1],o=n[2],a=n[3],i=n[4],s=n[5],u=n[6],c=n[7],l=n[8];return t[0]=i*l-s*c,t[1]=o*c-e*l,t[2]=e*s-o*i,t[3]=s*u-a*l,t[4]=r*l-o*u,t[5]=o*a-r*s,t[6]=a*c-i*u,t[7]=e*u-r*c,t[8]=r*i-e*a,t}function c(t,n,r){const e=n[0],o=n[1],a=n[2],i=n[3],s=n[4],u=n[5],c=n[6],l=n[7],f=n[8],h=r[0],p=r[1],M=r[2],g=r[3],m=r[4],y=r[5],b=r[6],A=r[7],P=r[8];return t[0]=h*e+p*i+M*c,t[1]=h*o+p*s+M*l,t[2]=h*a+p*u+M*f,t[3]=g*e+m*i+y*c,t[4]=g*o+m*s+y*l,t[5]=g*a+m*u+y*f,t[6]=b*e+A*i+P*c,t[7]=b*o+A*s+P*l,t[8]=b*a+A*u+P*f,t}function l(t,n){const r=n[0],e=n[1],o=n[2],a=n[3],i=n[4],s=n[5],u=n[6],c=n[7],l=n[8],f=n[9],h=n[10],p=n[11],M=n[12],g=n[13],m=n[14],y=n[15],b=r*s-e*i,A=r*u-o*i,P=r*c-a*i,d=e*u-o*s,E=e*c-a*s,C=o*c-a*u,T=l*g-f*M,_=l*m-h*M,F=l*y-p*M,x=f*m-h*g,R=f*y-p*g,v=h*y-p*m;let j=b*v-A*R+P*x+d*F-E*_+C*T;return j?(j=1/j,t[0]=(s*v-u*R+c*x)*j,t[1]=(u*F-i*v-c*_)*j,t[2]=(i*R-s*F+c*T)*j,t[3]=(o*R-e*v-a*x)*j,t[4]=(r*v-o*F+a*_)*j,t[5]=(e*F-r*R-a*T)*j,t[6]=(g*C-m*E+y*d)*j,t[7]=(m*P-M*C-y*A)*j,t[8]=(M*E-g*P+y*b)*j,t):null}function f(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t[2]=n[2]-r[2],t[3]=n[3]-r[3],t[4]=n[4]-r[4],t[5]=n[5]-r[5],t[6]=n[6]-r[6],t[7]=n[7]-r[7],t[8]=n[8]-r[8],t}function h(t){const n=(0,e.g)(),r=t[0],o=t[1],a=t[2],i=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8];return Math.abs(1-(r*r+i*i+c*c))<=n&&Math.abs(1-(o*o+s*s+l*l))<=n&&Math.abs(1-(a*a+u*u+f*f))<=n}const p=c,M=f;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t[2]=n[2]+r[2],t[3]=n[3]+r[3],t[4]=n[4]+r[4],t[5]=n[5]+r[5],t[6]=n[6]+r[6],t[7]=n[7]+r[7],t[8]=n[8]+r[8],t},adjoint:u,copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},determinant:function(t){const n=t[0],r=t[1],e=t[2],o=t[3],a=t[4],i=t[5],s=t[6],u=t[7],c=t[8];return n*(c*a-i*u)+r*(-c*o+i*s)+e*(u*o-a*s)},equals:function(t,n){const r=t[0],o=t[1],a=t[2],i=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],h=n[0],p=n[1],M=n[2],g=n[3],m=n[4],y=n[5],b=n[6],A=n[7],P=n[8],d=(0,e.g)();return Math.abs(r-h)<=d*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(o-p)<=d*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-M)<=d*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(i-g)<=d*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(s-m)<=d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(u-y)<=d*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-b)<=d*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(l-A)<=d*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(f-P)<=d*Math.max(1,Math.abs(f),Math.abs(P))},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t},fromMat4:o,fromQuat:function(t,n){const r=n[0],e=n[1],o=n[2],a=n[3],i=r+r,s=e+e,u=o+o,c=r*i,l=e*i,f=e*s,h=o*i,p=o*s,M=o*u,g=a*i,m=a*s,y=a*u;return t[0]=1-f-M,t[3]=l-y,t[6]=h+m,t[1]=l+y,t[4]=1-c-M,t[7]=p-g,t[2]=h-m,t[5]=p+g,t[8]=1-c-f,t},fromRotation:function(t,n){const r=Math.sin(n),e=Math.cos(n);return t[0]=e,t[1]=r,t[2]=0,t[3]=-r,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:s,isOrthoNormal:h,mul:p,multiply:c,multiplyScalar:function(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=n[7]*r,t[8]=n[8]*r,t},multiplyScalarAndAdd:function(t,n,r,e){return t[0]=n[0]+r[0]*e,t[1]=n[1]+r[1]*e,t[2]=n[2]+r[2]*e,t[3]=n[3]+r[3]*e,t[4]=n[4]+r[4]*e,t[5]=n[5]+r[5]*e,t[6]=n[6]+r[6]*e,t[7]=n[7]+r[7]*e,t[8]=n[8]+r[8]*e,t},normalFromMat4:l,normalFromMat4Legacy:function(t,n){const r=n[0],e=n[1],o=n[2],a=n[4],i=n[5],s=n[6],u=n[8],c=n[9],l=n[10],f=l*i-s*c,h=-l*a+s*u,p=c*a-i*u,M=r*f+e*h+o*p;if(!M)return null;const g=1/M;return t[0]=f*g,t[1]=(-l*e+o*c)*g,t[2]=(s*e-o*i)*g,t[3]=h*g,t[4]=(l*r-o*u)*g,t[5]=(-s*r+o*a)*g,t[6]=p*g,t[7]=(-c*r+e*u)*g,t[8]=(i*r-e*a)*g,t},projection:function(t,n,r){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,n,r){const e=n[0],o=n[1],a=n[2],i=n[3],s=n[4],u=n[5],c=n[6],l=n[7],f=n[8],h=Math.sin(r),p=Math.cos(r);return t[0]=p*e+h*i,t[1]=p*o+h*s,t[2]=p*a+h*u,t[3]=p*i-h*e,t[4]=p*s-h*o,t[5]=p*u-h*a,t[6]=c,t[7]=l,t[8]=f,t},scale:function(t,n,r){const e=r[0],o=r[1],a=r[2];return t[0]=e*n[0],t[1]=e*n[1],t[2]=e*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t[6]=a*n[6],t[7]=a*n[7],t[8]=a*n[8],t},scaleByVec2:function(t,n,r){const e=r[0],o=r[1];return t[0]=e*n[0],t[1]=e*n[1],t[2]=e*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t},set:a,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:M,subtract:f,translate:function(t,n,r){const e=n[0],o=n[1],a=n[2],i=n[3],s=n[4],u=n[5],c=n[6],l=n[7],f=n[8],h=r[0],p=r[1];return t[0]=e,t[1]=o,t[2]=a,t[3]=i,t[4]=s,t[5]=u,t[6]=h*e+p*i+c,t[7]=h*o+p*s+l,t[8]=h*a+p*u+f,t},transpose:i},Symbol.toStringTag,{value:"Module"}))},51305:(t,n,r)=>{r.d(n,{a:()=>p,c:()=>m,g:()=>l,j:()=>R,k:()=>g,m:()=>f,s:()=>c});var e=r(46521),o=r(94961),a=r(65617),i=r(46851),s=r(17896),u=r(98766);function c(t,n,r){r*=.5;const e=Math.sin(r);return t[0]=e*n[0],t[1]=e*n[1],t[2]=e*n[2],t[3]=Math.cos(r),t}function l(t,n){const r=2*Math.acos(n[3]),e=Math.sin(r/2);return e>(0,i.g)()?(t[0]=n[0]/e,t[1]=n[1]/e,t[2]=n[2]/e):(t[0]=1,t[1]=0,t[2]=0),r}function f(t,n,r){const e=n[0],o=n[1],a=n[2],i=n[3],s=r[0],u=r[1],c=r[2],l=r[3];return t[0]=e*l+i*s+o*c-a*u,t[1]=o*l+i*u+a*s-e*c,t[2]=a*l+i*c+e*u-o*s,t[3]=i*l-e*s-o*u-a*c,t}function h(t,n,r,e){const o=n[0],a=n[1],s=n[2],u=n[3];let c,l,f,h,p,M=r[0],g=r[1],m=r[2],y=r[3];return l=o*M+a*g+s*m+u*y,l<0&&(l=-l,M=-M,g=-g,m=-m,y=-y),1-l>(0,i.g)()?(c=Math.acos(l),f=Math.sin(c),h=Math.sin((1-e)*c)/f,p=Math.sin(e*c)/f):(h=1-e,p=e),t[0]=h*o+p*M,t[1]=h*a+p*g,t[2]=h*s+p*m,t[3]=h*u+p*y,t}function p(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function M(t,n){const r=n[0]+n[4]+n[8];let e;if(r>0)e=Math.sqrt(r+1),t[3]=.5*e,e=.5/e,t[0]=(n[5]-n[7])*e,t[1]=(n[6]-n[2])*e,t[2]=(n[1]-n[3])*e;else{let r=0;n[4]>n[0]&&(r=1),n[8]>n[3*r+r]&&(r=2);const o=(r+1)%3,a=(r+2)%3;e=Math.sqrt(n[3*r+r]-n[3*o+o]-n[3*a+a]+1),t[r]=.5*e,e=.5/e,t[3]=(n[3*o+a]-n[3*a+o])*e,t[o]=(n[3*o+r]+n[3*r+o])*e,t[a]=(n[3*a+r]+n[3*r+a])*e}return t}function g(t,n,r,e){const o=.5*Math.PI/180;n*=o,r*=o,e*=o;const a=Math.sin(n),i=Math.cos(n),s=Math.sin(r),u=Math.cos(r),c=Math.sin(e),l=Math.cos(e);return t[0]=a*u*l-i*s*c,t[1]=i*s*l+a*u*c,t[2]=i*u*c-a*s*l,t[3]=i*u*l+a*s*c,t}const m=u.c,y=u.s,b=u.a,A=f,P=u.b,d=u.d,E=u.l,C=u.f,T=C,_=u.g,F=_,x=u.n,R=u.h,v=u.e,j=(0,a.c)(),w=(0,a.f)(1,0,0),S=(0,a.f)(0,1,0),O=(0,o.a)(),L=(0,o.a)(),Z=(0,e.a)();Object.freeze(Object.defineProperty({__proto__:null,add:b,calculateW:function(t,n){const r=n[0],e=n[1],o=n[2];return t[0]=r,t[1]=e,t[2]=o,t[3]=Math.sqrt(Math.abs(1-r*r-e*e-o*o)),t},conjugate:p,copy:m,dot:d,equals:v,exactEquals:R,fromEuler:g,fromMat3:M,getAxisAngle:l,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},invert:function(t,n){const r=n[0],e=n[1],o=n[2],a=n[3],i=r*r+e*e+o*o+a*a,s=i?1/i:0;return t[0]=-r*s,t[1]=-e*s,t[2]=-o*s,t[3]=a*s,t},len:T,length:C,lerp:E,mul:A,multiply:f,normalize:x,random:function(t){const n=i.R,r=n(),e=n(),o=n(),a=Math.sqrt(1-r),s=Math.sqrt(r);return t[0]=a*Math.sin(2*Math.PI*e),t[1]=a*Math.cos(2*Math.PI*e),t[2]=s*Math.sin(2*Math.PI*o),t[3]=s*Math.cos(2*Math.PI*o),t},rotateX:function(t,n,r){r*=.5;const e=n[0],o=n[1],a=n[2],i=n[3],s=Math.sin(r),u=Math.cos(r);return t[0]=e*u+i*s,t[1]=o*u+a*s,t[2]=a*u-o*s,t[3]=i*u-e*s,t},rotateY:function(t,n,r){r*=.5;const e=n[0],o=n[1],a=n[2],i=n[3],s=Math.sin(r),u=Math.cos(r);return t[0]=e*u-a*s,t[1]=o*u+i*s,t[2]=a*u+e*s,t[3]=i*u-o*s,t},rotateZ:function(t,n,r){r*=.5;const e=n[0],o=n[1],a=n[2],i=n[3],s=Math.sin(r),u=Math.cos(r);return t[0]=e*u+o*s,t[1]=o*u-e*s,t[2]=a*u+i*s,t[3]=i*u-a*s,t},rotationTo:function(t,n,r){const e=(0,s.j)(n,r);return e<-.999999?((0,s.b)(j,w,n),(0,s.k)(j)<1e-6&&(0,s.b)(j,S,n),(0,s.n)(j,j),c(t,j,Math.PI),t):e>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):((0,s.b)(j,n,r),t[0]=j[0],t[1]=j[1],t[2]=j[2],t[3]=1+e,x(t,t))},scale:P,set:y,setAxes:function(t,n,r,e){const o=Z;return o[0]=r[0],o[3]=r[1],o[6]=r[2],o[1]=e[0],o[4]=e[1],o[7]=e[2],o[2]=-n[0],o[5]=-n[1],o[8]=-n[2],x(t,M(t,o))},setAxisAngle:c,slerp:h,sqlerp:function(t,n,r,e,o,a){return h(O,n,o,a),h(L,r,e,a),h(t,O,L,2*a*(1-a)),t},sqrLen:F,squaredLength:_,str:function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}},Symbol.toStringTag,{value:"Module"}))},83932:(t,n,r)=>{r.d(n,{B:()=>c});var e=r(22021),o=r(52138),a=r(65617);function i(t,n,r){const e=Math.sin(t),o=Math.cos(t),a=Math.sin(n),i=Math.cos(n),s=r;return s[0]=-e,s[4]=-a*o,s[8]=i*o,s[12]=0,s[1]=o,s[5]=-a*e,s[9]=i*e,s[13]=0,s[2]=0,s[6]=i,s[10]=a,s[14]=0,s[3]=0,s[7]=0,s[11]=0,s[15]=1,s}var s=r(29166),u=r(8744);function c(t,n,r,e){if(null==t||null==e)return!1;const a=(0,s.eT)(t,s.Jz),c=(0,s.eT)(e,s.sp);if(a===c&&!l(c)&&(a!==s.Ej.UNKNOWN||(0,u.fS)(t,e)))return(0,o.d)(r,n),!0;if(l(c)){const t=s.rf[a][s.Ej.LON_LAT],e=s.rf[s.Ej.LON_LAT][c];return null!=t&&null!=e&&(t(n,0,h,0),e(h,0,p,0),i(f*h[0],f*h[1],r),r[12]=p[0],r[13]=p[1],r[14]=p[2],!0)}if((c===s.Ej.WEB_MERCATOR||c===s.Ej.PLATE_CARREE)&&(a===s.Ej.WGS84||a===s.Ej.CGCS2000&&c===s.Ej.PLATE_CARREE||a===s.Ej.SPHERICAL_ECEF||a===s.Ej.WEB_MERCATOR)){const t=s.rf[a][s.Ej.LON_LAT],e=s.rf[s.Ej.LON_LAT][c];return null!=t&&null!=e&&(t(n,0,h,0),e(h,0,p,0),a===s.Ej.SPHERICAL_ECEF?function(t,n,r){i(t,n,r),(0,o.t)(r,r)}(f*h[0],f*h[1],r):(0,o.g)(r),r[12]=p[0],r[13]=p[1],r[14]=p[2],!0)}return!1}function l(t){return t===s.Ej.SPHERICAL_ECEF||t===s.Ej.SPHERICAL_MARS_PCPF||t===s.Ej.SPHERICAL_MOON_PCPF}const f=(0,e.Vl)(1),h=(0,a.c)(),p=(0,a.c)()},58995:(t,n,r)=>{r.d(n,{rS:()=>c});var e=r(2109),o=r(82971),a=r(8744);const i=new o.Z(e.kU),s=new o.Z(e.JL),u=new o.Z(e.mM);function c(t){return t&&((0,a.BZ)(t)||(0,a.fS)(t,s))?s:t&&((0,a.V2)(t)||(0,a.fS)(t,u))?u:i}new o.Z(e.pn)},2674:(t,n,r)=>{r.d(n,{Z:()=>y});var e,o=r(43697),a=r(96674),i=r(5600),s=(r(75215),r(67676),r(80442),r(52011)),u=r(52138),c=r(13598),l=r(51305),f=r(94961),h=r(17896),p=r(65617),M=r(3709);let g=e=class extends a.wq{constructor(t){super(t),this.translation=(0,p.c)(),this.rotationAxis=(0,p.e)(M.up),this.rotationAngle=0,this.scale=(0,p.f)(1,1,1)}get rotation(){return(0,M.uT)(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=(0,p.g)((0,M.ZZ)(t)),this.rotationAngle=(0,M.EU)(t)}get localMatrix(){const t=(0,c.a)();return(0,l.s)(m,(0,M.ZZ)(this.rotation),(0,M.WH)(this.rotation)),(0,u.f)(t,m,this.translation,this.scale),t}get localMatrixInverse(){return(0,u.i)((0,c.a)(),this.localMatrix)}applyLocal(t,n){return(0,h.e)(n,t,this.localMatrix)}applyLocalInverse(t,n){return(0,h.e)(n,t,this.localMatrixInverse)}equals(t){return this===t||null!=t&&(0,u.e)(this.localMatrix,t.localMatrix)}clone(){const t={translation:(0,p.g)(this.translation),rotationAxis:(0,p.g)(this.rotationAxis),rotationAngle:this.rotationAngle,scale:(0,p.g)(this.scale)};return new e(t)}};(0,o._)([(0,i.Cb)({type:[Number],nonNullable:!0,json:{write:!0}})],g.prototype,"translation",void 0),(0,o._)([(0,i.Cb)({type:[Number],nonNullable:!0,json:{write:!0}})],g.prototype,"rotationAxis",void 0),(0,o._)([(0,i.Cb)({type:Number,nonNullable:!0,json:{write:!0}})],g.prototype,"rotationAngle",void 0),(0,o._)([(0,i.Cb)({type:[Number],nonNullable:!0,json:{write:!0}})],g.prototype,"scale",void 0),(0,o._)([(0,i.Cb)()],g.prototype,"rotation",null),(0,o._)([(0,i.Cb)()],g.prototype,"localMatrix",null),(0,o._)([(0,i.Cb)()],g.prototype,"localMatrixInverse",null),g=e=(0,o._)([(0,s.j)("esri.geometry.support.MeshTransform")],g);const m=(0,f.a)(),y=g},3709:(t,n,r)=>{r.d(n,{EU:()=>p,Ue:()=>u,WH:()=>M,ZZ:()=>h,qC:()=>l,qw:()=>f,uT:()=>c,up:()=>g});var e=r(22021),o=r(51305),a=r(94961),i=r(17896),s=r(65617);function u(t=g){return[t[0],t[1],t[2],t[3]]}function c(t,n,r=u()){return(0,i.c)(r,t),r[3]=n,r}function l(t,n,r=u()){return(0,o.s)(m,t,M(t)),(0,o.s)(y,n,M(n)),(0,o.m)(m,y,m),function(t,n){return t[3]=n,t}(r,(0,e.BV)((0,o.g)(r,m)))}function f(t,n,r,e=u()){return c(s.U,t,b),c(s.b,n,A),c(s.d,r,P),l(b,A,b),l(b,P,e),e}function h(t){return t}function p(t){return t[3]}function M(t){return(0,e.Vl)(t[3])}const g=[0,0,1,0],m=(0,a.a)(),y=(0,a.a)(),b=(u(),u()),A=u(),P=u()},13442:(t,n,r)=>{r.d(n,{A:()=>a,h:()=>o});var e=r(92604);function o(t,n){return t.isGeographic||t.isWebMercator&&(n?.geographic??!0)}function a(t,n,r){const o=!t.isGeoreferenced;null!=r?.geographic&&r.geographic!==o&&e.Z.getLogger(n).warnOnce(`Specifying the 'geographic' parameter (${r.geographic}) for a Mesh vertex space of type "${t.type}" is not supported. This parameter will be ignored.`)}},66459:(t,n,r)=>{r.d(n,{FF:()=>F,I5:()=>T,Ne:()=>C,Yq:()=>x,iv:()=>E,project:()=>R,w1:()=>_});var e=r(67900),o=r(46521),a=r(52138),i=r(13598),s=r(17896),u=r(65617),c=r(21787),l=r(73615),f=r(58995),h=r(83932),p=r(87360),M=r(83025),g=r(85872),m=r(50567),y=r(84555),b=r(2674),A=r(20773),P=r(13442),d=r(56493);function E(t,n,r){return(0,P.h)(n.spatialReference,r)?function(t,n,r){const e=n.spatialReference,o=S(n,r,I),a=new Float64Array(t.position.length),i=function(t,n,r,e){(0,A.t)(e,t,n);const o=new Float64Array(t.length);return(0,d.To)(e,o,r)}(t.position,o,e,a),s=(0,c.n)(N,o);return{position:i,normal:v(i,a,t.normal,s,e),tangent:j(i,a,t.tangent,s,e)}}(t,n,r):function(t,n,r){const e=new Float64Array(t.position.length),o=t.position,a=n.x,i=n.y,s=n.z??0,u=Z(r?r.unit:null,n.spatialReference);for(let t=0;t<o.length;t+=3)e[t]=o[t]*u+a,e[t+1]=o[t+1]*u+i,e[t+2]=o[t+2]*u+s;return{position:e,normal:t.normal,tangent:t.tangent}}(t,n,r)}function C(t,n=i.I){const{position:r,normal:e,tangent:o}=t;return{position:(0,A.t)(new Float64Array(r.length),r,n),normal:null!=e?(0,d.w9)(e,new Float32Array(e.length),n):null,tangent:null!=o?(0,d.VS)(o,new Float32Array(o.length),n):null}}function T(t,n,r,e){const{position:o,normal:a,tangent:i}=t;return n.isRelative?E(C(t,r?.localMatrix),n.getOriginPoint(e),{geographic:!n.isGeoreferenced}):{position:o,normal:a,tangent:i}}function _(t,n,r){if(r?.useTransform){const{position:e,normal:o,tangent:a}=t,{x:i,y:s,z:c}=n,l=(0,u.f)(i,s,c??0);return{vertexAttributes:{position:e,normal:o,tangent:a},vertexSpace:r.geographic??1?new y.Z({origin:l}):new g.Z({origin:l}),transform:new b.Z}}return{vertexAttributes:E(t,n,r),vertexSpace:new m.Z,transform:null}}function F(t,n,r){return(0,P.h)(n.spatialReference,r)?function(t,n,r){const e=n.spatialReference;S(n,r,I);const o=(0,a.i)(q,I),i=new Float64Array(t.position.length),s=function(t,n,r,e){const o=(0,d.XO)(t,n,e),a=new Float64Array(o.length);return(0,A.t)(a,o,r),a}(t.position,e,o,i),u=(0,c.n)(N,o);return{position:s,normal:O(t.normal,t.position,i,e,u),tangent:L(t.tangent,t.position,i,e,u)}}(t,n,r):w(t,n,r)}function x(t,n,r,e,o){if(!n.isRelative)return F(t,e,o);const{spatialReference:a}=e,i=T(t,n,r,a);return e.equals(n.getOriginPoint(a))?w(i,e,o):F(i,e,o)}function R({positions:t,transform:n,vertexSpace:r,inSpatialReference:e,outSpatialReference:o,outPositions:c,local:g}){const m=r.isRelative?r.origin:u.Z,y=r.isRelative?n?.localMatrix??i.I:i.I;if(r.isGeoreferenced){const n=c??(0,M.bg)(t.length);if((0,a.a)(y,i.I)?(0,M.JK)(n,t):(0,A.t)(n,t,y),!(0,s.h)(m,u.Z)){const[t,r,e]=m;for(let o=0;o<n.length;o+=3)n[o]+=t,n[o+1]+=r,n[o+2]+=e}return(0,p.projectBuffer)(n,e,0,n,o,0,n.length/3),n}const b=(0,f.rS)(e),P=!g&&(0,l.canProjectWithoutEngine)(e,b)?b:e;(0,h.B)(e,m,I,P),(0,a.m)(I,I,y);const d=c??(0,M.bg)(t.length);return(0,A.t)(d,t,I),(0,p.projectBuffer)(d,P,0,d,o,0,d.length/3),d}function v(t,n,r,e,o){if(null==r)return null;const a=new Float32Array(r.length);return(0,A.a)(a,r,e),(0,d.Yk)(a,t,n,o,a),a}function j(t,n,r,e,o){if(null==r)return null;const a=new Float32Array(r.length);(0,A.a)(a,r,e,4);for(let t=3;t<a.length;t+=4)a[t]=r[t];return(0,d.M2)(a,t,n,o,a),a}function w(t,n,r){const e=new Float64Array(t.position.length),o=t.position,a=n.x,i=n.y,s=n.z??0,u=Z(r?r.unit:null,n.spatialReference);for(let t=0;t<o.length;t+=3)e[t]=(o[t]-a)/u,e[t+1]=(o[t+1]-i)/u,e[t+2]=(o[t+2]-s)/u;return{position:e,normal:t.normal,tangent:t.tangent}}function S(t,n,r){(0,h.B)(t.spatialReference,[t.x,t.y,t.z??0],r,(0,f.rS)(t.spatialReference));const e=Z(n?n.unit:null,t.spatialReference);return(0,a.b)(r,r,[e,e,e]),r}function O(t,n,r,e,o){if(null==t)return null;const a=(0,d.Iz)(t,n,r,e,new Float32Array(t.length));return(0,A.a)(a,a,o),a}function L(t,n,r,e,o){if(null==t)return null;const a=(0,d.wi)(t,n,r,e,new Float32Array(t.length));return(0,A.a)(a,a,o,4),a}function Z(t,n){if(null==t)return 1;const r=(0,e.r6)(n);return 1/(0,e.En)(r,"meters",t)}const I=(0,i.a)(),q=(0,i.a)(),N=(0,o.a)()},56493:(t,n,r)=>{r.d(n,{Iz:()=>y,M2:()=>T,To:()=>P,VS:()=>E,XO:()=>A,Yk:()=>b,w9:()=>d,wi:()=>C});var e=r(92604),o=r(21787),a=r(46521),i=r(13598),s=r(17896),u=r(65617),c=r(58995),l=r(83932),f=r(87360),h=r(8744),p=r(40488),M=r(56481),g=r(20773);const m=e.Z.getLogger("esri.geometry.support.meshUtils.normalProjection");function y(t,n,r,e,o){return F(e)?(_(R.TO_PCPF,M.ct.fromTypedArray(t),M.fP.fromTypedArray(n),M.fP.fromTypedArray(r),e,M.ct.fromTypedArray(o)),o):(m.error("Cannot convert spatial reference to PCPF"),o)}function b(t,n,r,e,o){return F(e)?(_(R.FROM_PCPF,M.ct.fromTypedArray(t),M.fP.fromTypedArray(n),M.fP.fromTypedArray(r),e,M.ct.fromTypedArray(o)),o):(m.error("Cannot convert to spatial reference from PCPF"),o)}function A(t,n,r){return(0,f.projectBuffer)(t,n,0,r,(0,c.rS)(n),0,t.length/3),r}function P(t,n,r){return(0,f.projectBuffer)(t,(0,c.rS)(r),0,n,r,0,t.length/3),n}function d(t,n,r){return(0,o.n)(O,r),(0,g.a)(n,t,O),(0,o.i)(O)||(0,g.n)(n,n),n}function E(t,n,r){if((0,o.n)(O,r),(0,g.a)(n,t,O,4),(0,o.i)(O)||(0,g.n)(n,n,4),t!==n)for(let r=3;r<t.length;r+=4)n[r]=t[r];return n}function C(t,n,r,e,o){if(!F(e))return m.error("Cannot convert spatial reference to PCPF"),o;_(R.TO_PCPF,M.ct.fromTypedArray(t,4*Float32Array.BYTES_PER_ELEMENT),M.fP.fromTypedArray(n),M.fP.fromTypedArray(r),e,M.ct.fromTypedArray(o,4*Float32Array.BYTES_PER_ELEMENT));for(let n=3;n<t.length;n+=4)o[n]=t[n];return o}function T(t,n,r,e,o){if(!F(e))return m.error("Cannot convert to spatial reference from PCPF"),o;_(R.FROM_PCPF,M.ct.fromTypedArray(t,16),M.fP.fromTypedArray(n),M.fP.fromTypedArray(r),e,M.ct.fromTypedArray(o,16));for(let n=3;n<t.length;n+=4)o[n]=t[n];return o}function _(t,n,r,e,a,i){if(!n)return;const u=r.count,f=(0,c.rS)(a);if(x(a))for(let r=0;r<u;r++)e.getVec(r,j),n.getVec(r,w),(0,l.B)(f,j,S,f),(0,o.f)(O,S),t===R.FROM_PCPF&&(0,o.t)(O,O),(0,s.t)(w,w,O),i.setVec(r,w);else for(let a=0;a<u;a++){e.getVec(a,j),n.getVec(a,w),(0,l.B)(f,j,S,f),(0,o.f)(O,S);const u=(0,p.mZ)(r.get(a,1));let c=Math.cos(u);t===R.TO_PCPF&&(c=1/c),O[0]*=c,O[1]*=c,O[2]*=c,O[3]*=c,O[4]*=c,O[5]*=c,t===R.FROM_PCPF&&(0,o.t)(O,O),(0,s.t)(w,w,O),(0,s.n)(w,w),i.setVec(a,w)}return i}function F(t){return x(t)||function(t){return t.isWebMercator}(t)}function x(t){return t.isWGS84||(0,h.yW)(t)||(0,h.BZ)(t)||(0,h.V2)(t)}var R,v;(v=R||(R={}))[v.TO_PCPF=0]="TO_PCPF",v[v.FROM_PCPF=1]="FROM_PCPF";const j=(0,u.c)(),w=(0,u.c)(),S=(0,i.a)(),O=(0,a.a)()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5913],{16306:(e,t,i)=>{i.d(t,{aX:()=>S});var n=i(68773),s=i(20102),r=i(92604),a=i(38913),o=i(58901),l=i(73913),c=i(8744),u=i(40488),h=(i(66577),i(3172)),f=i(33955),d=i(11282),p=i(17452);async function m(e,t,i){const n="string"==typeof e?(0,p.mN)(e):e,s=t[0].spatialReference,r=(0,f.Ji)(t[0]),a={...i,query:{...n.query,f:"json",sr:s.wkid??JSON.stringify(s),geometries:JSON.stringify((l=t,{geometryType:(0,f.Ji)(l[0]),geometries:l.map((e=>e.toJSON()))}))}},{data:o}=await(0,h.Z)(n.path+"/simplify",a);var l;return function(e,t,i){const n=(0,f.q9)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=i,t}))}(o.geometries,r,s)}const y=r.Z.getLogger("esri.geometry.support.normalizeUtils");function g(e){return"polygon"===e[0].type}function x(e){return"polyline"===e[0].type}function w(e,t,i){if(t){const t=function(e,t){if(!(e instanceof o.Z||e instanceof a.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw y.error(e),new s.Z(e)}const i=(0,l.x3)(e),n=[];for(const e of i){const i=[];n.push(i),i.push([e[0][0],e[0][1]]);for(let n=0;n<e.length-1;n++){const s=e[n][0],r=e[n][1],a=e[n+1][0],o=e[n+1][1],l=Math.sqrt((a-s)*(a-s)+(o-r)*(o-r)),c=(o-r)/l,u=(a-s)/l,h=l/t;if(h>1){for(let e=1;e<=h-1;e++){const n=e*t,a=u*n+s,o=c*n+r;i.push([a,o])}const e=(l+Math.floor(h-1)*t)/2,n=u*e+s,a=c*e+r;i.push([n,a])}i.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new a.Z({rings:n,spatialReference:e.spatialReference}):new o.Z({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,u.Sx)(t,!0)}return i&&(e=(0,l.Sy)(e,i)),e}function b(e,t,i){if(Array.isArray(e)){const n=e[0];if(n>t){const i=(0,l.XZ)(n,t);e[0]=n+i*(-2*t)}else if(n<i){const t=(0,l.XZ)(n,i);e[0]=n+t*(-2*i)}}else{const n=e.x;if(n>t){const i=(0,l.XZ)(n,t);e=e.clone().offset(i*(-2*t),0)}else if(n<i){const t=(0,l.XZ)(n,i);e=e.clone().offset(t*(-2*i),0)}}return e}function I(e,t){let i=-1;for(let n=0;n<t.cutIndexes.length;n++){const s=t.cutIndexes[n],r=t.geometries[n],a=(0,l.x3)(r);for(let e=0;e<a.length;e++){const t=a[e];t.some((i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const n=t[e][0];i=n>i?n:i}i=Number(i.toFixed(9));const n=-360*(0,l.XZ)(i,180);for(let i=0;i<t.length;i++){const t=r.getPoint(e,i);r.setPoint(e,i,t.clone().offset(n,0))}return!0}}))}if(s===i){if(g(e))for(const t of(0,l.x3)(r))e[s]=e[s].addRing(t);else if(x(e))for(const t of(0,l.x3)(r))e[s]=e[s].addPath(t)}else i=s,e[s]=r}return e}async function S(e,t,i){if(!Array.isArray(e))return S([e],t);t&&"string"!=typeof t&&y.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const s="string"==typeof t?t:t?.url??n.default.geometryServiceUrl;let r,p,g,x,_,R,v,T,C=0;const k=[],F=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,p=(0,c.C5)(r),g=r.isWebMercator,R=g?102100:4326,x=l.UZ[R].maxX,_=l.UZ[R].minX,v=l.UZ[R].plus180Line,T=l.UZ[R].minus180Line),p)if("mesh"===t.type)F.push(t);else if("point"===t.type)F.push(b(t.clone(),x,_));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>b(e,x,_))),F.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,p);F.push(e.rings?new a.Z(e):e)}else if(t.extent){const e=t.extent,i=(0,l.XZ)(e.xmin,_)*(2*x);let n=0===i?t.clone():(0,l.Sy)(t.clone(),i);e.offset(i,0),e.intersects(v)&&e.xmax!==x?(C=e.xmax>C?e.xmax:C,n=w(n,g),k.push(n),F.push("cut")):e.intersects(T)&&e.xmin!==_?(C=e.xmax*(2*x)>C?e.xmax*(2*x):C,n=w(n,g,360),k.push(n),F.push("cut")):F.push(n)}else F.push(t.clone());else F.push(t);else F.push(t);let M=(0,l.XZ)(C,x),P=-90;const O=M,Z=new o.Z;for(;M>0;){const e=360*M-180;Z.addPath([[e,P],[e,-1*P]]),P*=-1,M--}if(k.length>0&&O>0){const t=I(k,await async function(e,t,i,n){const s=(0,d.en)(e),r=t[0].spatialReference,a={...n,query:{...s.query,f:"json",sr:JSON.stringify(r),target:JSON.stringify({geometryType:(0,f.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await(0,h.Z)(s.path+"/cut",a),{cutIndexes:l,geometries:c=[]}=o.data;return{cutIndexes:l,geometries:c.map((e=>{const t=(0,f.im)(e);return t.spatialReference=r,t}))}}(s,k,Z,i)),n=[],r=[];for(let i=0;i<F.length;i++){const s=F[i];if("cut"!==s)r.push(s);else{const s=t.shift(),a=e[i];null!=a&&"polygon"===a.type&&a.rings&&a.rings.length>1&&s.rings.length>=a.rings.length?(n.push(s),r.push("simplify")):r.push(g?(0,u.$)(s):s)}}if(!n.length)return r;const a=await m(s,n,i),o=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?o.push(t):o.push(g?(0,u.$)(a.shift()):a.shift())}return o}const D=[];for(let e=0;e<F.length;e++){const t=F[e];if("cut"!==t)D.push(t);else{const e=k.shift();D.push(!0===g?(0,u.$)(e):e)}}return D}},73913:(e,t,i)=>{i.d(t,{Sy:()=>l,UZ:()=>a,XZ:()=>o,x3:()=>c});var n=i(58901),s=i(82971),r=i(33955);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:s.Z.WebMercator}),minus180Line:new n.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:s.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.Z({paths:[[[180,-180],[180,180]]],spatialReference:s.Z.WGS84}),minus180Line:new n.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:s.Z.WGS84})}};function o(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const i=c(e);for(const e of i)for(const i of e)i[0]+=t;return e}function c(e){return(0,r.oU)(e)?e.rings:e.paths}},74878:(e,t,i)=>{i.r(t),i.d(t,{default:()=>ft});var n=i(43697),s=i(51773),r=i(2368),a=i(20102),o=i(92604),l=i(16453),c=i(95330),u=i(17445),h=i(5600),f=i(75215),d=i(67676),p=i(80442),m=i(36030),y=i(52011),g=i(87085),x=i(17287),w=i(71612),b=i(17017),I=(i(66577),i(30030)),S=i(3172),_=i(71715),R=i(8744),v=i(66677),T=i(21506),C=i(35956),k=i(29876),F=i(45663),M=i(88281),P=i(11145),O=i(96674),Z=i(609),D=i(39450),B=i(36679),J=i(99815),N=i(73506),z=i(94139);const A=new Map,E=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,n=this._cachedBlocks;if(n.has(i)){const e=n.get(i);return e.refCount--,e.refCount<=0&&(n.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,n=this._cachedBlocks;if(n.has(i)){const e=n.get(i);return e.ts=Date.now(),e.refCount++,n.delete(i),n.set(i,e),e.block}return null}putBlock(e,t,i,n){const s=this._cachedBlocks,r=e+"/"+t;if(s.has(r)){const e=s.get(r);e.ts=Date.now(),e.refCount++}else s.set(r,{block:i,ts:Date.now(),refCount:1,controller:n});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,n=e+"/"+t;i.has(n)&&i.delete(n)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),i=Date.now();for(let n=0;n<t.length&&t[n][1].ts<=i-this._duration;n++)e.delete(t[n][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function H(e,t){return null==t?e:`${e}?sliceId=${t}`}function L(e,t,i){const n=A.get(e);if(!n)return null==t?E.decreaseRefCount(e,i):0;if(null==t||null==n[t])return E.decreaseRefCount(e,i);const s=n[t]?.cache,r=s?.get(i);if(s&&r){if(r.refCount--,0===r.refCount){s.delete(i);for(let e=0;e<n.length;e++)n[e]?.cache.delete(i);r.controller&&r.controller.abort()}return r.refCount}return 0}function W(e,t,i){const n=A.get(e);if(!n)return null==t?E.getBlock(e,i):null;if(null==t||null==n[t]){for(let e=0;e<n.length;e++){const t=n[e]?.cache.get(i);if(t)return t.refCount++,t.block}return E.getBlock(e,i)}const s=n[t]?.cache.get(i);if(s)return s.refCount++,s.block;for(let e=0;e<n.length;e++){if(e===t||!n[e])continue;const s=n[e]?.cache,r=s?.get(i);if(s&&r)return r.refCount++,s.set(i,r),r.block}return null}function q(e,t,i,n,s=null){const r=A.get(e);if(!r)return void(null==t&&E.putBlock(e,i,n,s));if(null==t||null==r[t])return void E.putBlock(e,i,n,s);const a={refCount:1,block:n,isResolved:!1,isRejected:!1,controller:s};n.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),r[t]?.cache.set(i,a)}function j(e,t,i){const n=A.get(e);n?null!=t&&null!=n[t]?n[t]?.cache.delete(i):E.deleteBlock(e,i):null==t&&E.deleteBlock(e,i)}var G=i(81578),U=i(75993),V=i(55914),$=i(80676),X=i(6570);let Y=class extends((0,Z.v)(O.wq)){constructor(){super(...arguments),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=(0,N.zD)();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:P.Z.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,N.ut)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),"Function"===this.datasetFormat&&this.primaryRasters?.rasters?.forEach((t=>t.rasterJobHandler=e))}set url(e){this._set("url",(0,v.Nm)(e,o.Z.getLogger(this)))}async open(e){throw new a.Z("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,i,n={}){const s=n.tileInfo||this.rasterInfo.storageInfo.tileInfo,r=this.getTileExtentFromTileInfo(e,t,i,s);return this.fetchPixels(r,s.size[0],s.size[1],n)}async identify(e,t={}){e=(0,f.TJ)(z.Z,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:n}=t,{rasterInfo:s}=this,{hasMultidimensionalTranspose:r,multidimensionalInfo:a}=s;let{transposedVariableName:o}=t;const l=null!=a&&r&&(null!=n||(0,J.WU)(i));l&&!o&&(o=null!=i&&i.length>0?i[0].variableName??void 0:a.variables[0].name,t={...t,transposedVariableName:o}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=s,{datumTransformation:h}=t;let d=(0,N.nF)(e,c,h);if(!u.intersects(d))return{location:d,value:null};if(null!=s.transform){const e=s.transform.inverseTransform(d);if(!s.nativeExtent.intersects(e))return{location:e,value:null};d=e}let p=0;const m=null!=o&&null!=a&&s.hasMultidimensionalTranspose;if("Function"===this.datasetFormat){const e=this.primaryRasters.rasters[0];if(m)return e.identify(d,t);const{pixelSize:i}=s,n=3,r=i.x*n/2,a=i.y*n/2,o=new X.Z({xmin:d.x-r,xmax:d.x+r,ymin:d.y-a,ymax:d.y+a,spatialReference:c}),l={interpolation:"nearest"},{pixelBlock:u}=await e.fetchPixels(o,n,n,l),{pixelBlock:h}=await this.fetchPixels(o,n,n,l);if(null==u)return{location:d,value:null};const f=Math.floor(n*n*.5),p=!u.mask||u.mask[f]?u.pixels.map((e=>e[f])):null;let y;return null!=h&&(y=!h.mask||h.mask[f]?h.pixels.map((e=>e[f])):void 0),{location:d,value:p,processedValue:y,pyramidLevel:0}}if(!m)if(t.srcResolution)p=(0,N.kr)(t.srcResolution,s,this.ioConfig.sampling).pyramidLevel;else if(p=await this.computeBestPyramidLevelForLocation(e,t),null==p)return{location:d,value:null};const y=this.identifyPixelLocation(d,p,null,m);if(null===y)return{location:d,value:null};const{row:g,col:x,rowOffset:w,colOffset:b,blockWidth:I}=y,S=o??t.sliceId,_=H(this.url,S),R=`${p}/${g}/${x}`;let v=W(_,null,R);null==v&&(v=this.fetchRawTile(p,g,x,t),q(_,null,R,v));const T=await v;if(null==T||!T.pixels?.length)return{location:d,value:null};const C=w*I+b;return this._processIdentifyResult(T,{srcLocation:d,position:C,pyramidLevel:p,useTransposedTile:!!m,requestSomeSlices:l,identifyOptions:t})}async fetchPixels(e,t,i,n={}){e=(0,N.Fi)(e),n=this._getRequestOptionsWithSliceId(n);const{_hasNoneOrGCSShiftTransform:s}=this;if(n.requestRawData&&s)return this._fetchPixels(e,t,i,n);const r=(0,N.ut)(e.spatialReference),a=(0,N.Hq)(e);if(null==r||0===a||1===a&&this._isGlobalWrappableSource&&s)return this._fetchPixels(e,t,i,n);if(a>=3)return{extent:e,pixelBlock:null};const o=[],{xmin:l,xmax:c}=e,u=Math.round(r/(c-l)*t),h=u-Math.round((r/2-l)/(c-l)*t);let f=0;const d=[];for(let s=0;s<=a;s++){const p=new X.Z({xmin:0===s?l:-r/2,xmax:s===a?c-r*s:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),m=0===s?u-h:s===a?t-f:u;f+=m,d.push(m);const y=n.disableWrapAround&&s>0?null:this._fetchPixels(p,m,i,n);o.push(y)}const p=(await Promise.all(o)).map((e=>e?.pixelBlock));let m=null;const y={width:t,height:i};return m=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:d},n)).pixelBlock:(0,V.us)(p,y,{blockWidths:d}),{extent:e,srcExtent:(0,N.tB)(e,this.rasterInfo.spatialReference,n.datumTransformation),pixelBlock:m}}async fetchRawPixels(e,t,i,n={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const s=await this._fetchRawTiles(e,t,i,n),{nativeExtent:r,nativePixelSize:a,storageInfo:o}=this.rasterInfo,l=2**e,c=a.x*l,u=a.y*l,h=new X.Z({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(!s)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:f,mosaicSize:d}=s;if(1===f.length&&null!=f[0]&&f[0].width===i.width&&f[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:s.pixelBlocks[0]};const p=e>0?o.pyramidBlockWidth:o.blockWidth,m=e>0?o.pyramidBlockHeight:o.blockHeight,y={x:t.x%p,y:t.y%m};let g;return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:f,srcMosaicSize:d,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:n.interpolation,alignmentInfo:null,blockWidths:null},n)).pixelBlock:(0,V.us)(f,d,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:g}}fetchRawTile(e,t,i,n){throw new a.Z("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,N.tB)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,U.J)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:n}=this.ioConfig,{range:s,query:r,headers:a}=t;i=i??t.retryCount??this.ioConfig.retryCount;const o=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await(0,S.Z)(e,{...t,query:{...r,...n},headers:{...a,...o}})}catch(n){if(i>0)return i--,this.request(e,t,i);throw n}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,J.gk)(e,t)}getTileExtentFromTileInfo(e,t,i,n){const s=n.lodAt(e);return this.getTileExtent({x:s.resolution,y:s.resolution},t,i,n.origin,n.spatialReference,n.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:n}=this.rasterInfo;if(!e.tileInfo){const s=[],r=e.maximumPyramidLevel||0;let a=Math.max(n.x,n.y),o=1/.0254*96*a;for(let e=0;e<=r;e++)s.push(new D.Z({level:r-e,resolution:a,scale:o})),a*=2,o*=2;const l=new z.Z({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new P.Z({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:s}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,n){const{width:s,height:r,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new z.Z({x:a.xmin,y:a.ymax,spatialReference:l});null==n&&(n=Math.max(0,Math.round(Math.log(Math.max(s,r))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],n);e.storageInfo=new B.Z({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:n,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,n,s,r=0,a=2){if(1===s.length&&r>0){s=[...s];let{x:e,y:t}=s[0];for(let i=0;i<r;i++)e*=a,t*=a,s.push({x:e,y:t})}const o=[],{x:l,y:c}=n;for(let n=0;n<s.length;n++){const{x:r,y:a}=s[n];o.push({minCol:Math.floor((e.xmin-l+.1*r)/t/r),maxCol:Math.floor((e.xmax-l-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*a)/i/a),maxRow:Math.floor((c-e.ymin-.1*a)/i/a)})}return o}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:n}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const s=n**e;return{x:t.x*s,y:t.y*s}}identifyPixelLocation(e,t,i,n){const{spatialReference:s,nativeExtent:r,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:o,origin:l,transposeInfo:c}=a,u=n&&null!=c?c.tileSize[0]:a.blockWidth,h=n&&null!=c?c.tileSize[1]:a.blockHeight,f=(0,N.nF)(e,s,i);if(!r.intersects(f))return null;if(t<0||t>o)return null;const d=this.getPyramidPixelSize(t),{x:p,y:m}=d,y=(l.y-f.y)/m/h,g=(f.x-l.x)/p/u,x=Math.min(h-1,Math.floor((y-Math.floor(y))*h)),w=Math.min(u-1,Math.floor((g-Math.floor(g))*u));return{pyramidLevel:t,row:Math.floor(y),col:Math.floor(g),rowOffset:x,colOffset:w,blockWidth:u,srcLocation:f}}getTileExtent(e,t,i,n,s,r){const[a,o]=r,l=n.x+i*a*e.x,c=l+a*e.x,u=n.y-t*o*e.y,h=u-o*e.y;return new X.Z({xmin:l,xmax:c,ymin:h,ymax:u,spatialReference:s})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const n=this.rasterInfo.storageInfo.blockBoundary[e];return!n||n.maxRow<t||n.maxCol<i||n.minRow>t||n.minCol>i}async _fetchPixels(e,t,i,n={}){let s=(0,N.Hq)(e);if(s>=2)return{extent:e,pixelBlock:null};const r=this._getSourceDataInfo(e,t,i,n),{pyramidLevel:a,srcResolution:o,srcExtent:l,srcWidth:c,srcHeight:u,ul:h}=r;if(0===c||0===u)return{extent:e,srcExtent:l,pixelBlock:null};const{rasterInfo:f}=this,d=f.transform,p="gcs-shift"===d?.type,m=null!=(0,N.ut)(e.spatialReference);!p&&m||(s=(0,N.Hq)(r.srcExtent,p));const y=await this._fetchRawTiles(a,h,{width:c,height:u,wrapCount:s},n);if(!y)return{extent:e,srcExtent:l,pixelBlock:null};const g=f.storageInfo,x=a>0?g.pyramidBlockWidth:g.blockWidth,w=a>0?g.pyramidBlockHeight:g.blockHeight;let{x:b,y:I}=f.pixelSize;if(a>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=g;if(null!=e&&e[a-1])({x:b,y:I}=e[a-1]);else{const e=t**a;b*=e,I*=e}}const S=f.spatialReference,_=new z.Z({x:b,y:I,spatialReference:S}),R=x===c&&w===u&&h.x%x==0&&h.y%w==0,v=new z.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),T=!e.spatialReference.equals(S),C=S.isGeographic?1e-9:1e-4,{datumTransformation:k}=n;if(!T&&R&&1===y.pixelBlocks.length&&x===t&&w===i&&this._isSameResolution(o,v,C))return{extent:e,srcExtent:l,srcTilePixelSize:_,pixelBlock:y.pixelBlocks[0]};const F=m&&null!=(0,N.ut)(l.spatialReference)&&this._hasNoneOrGCSShiftTransform,M=n.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");M&&!this.rasterJobHandler&&await(0,N.zD)();const P=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:v.toJSON(),datumTransformation:k,rasterTransform:d,hasWrapAround:s>0||F,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:M},n):(0,N.Qp)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:v,datumTransformation:k,rasterTransform:d,hasWrapAround:s>0||F,isAdaptive:!1,includeGCSGrid:M});let O;const Z=!n.requestRawData,D={rows:P.spacing[0],cols:P.spacing[1]},B=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(a,y.extent.xmin):void 0,{pixelBlocks:J,mosaicSize:A,isPartiallyFilled:E}=y;let H=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:J,srcMosaicSize:A,destDimension:Z?{width:t,height:i}:null,coefs:Z?P.coefficients:null,sampleSpacing:Z?D:null,projectDirections:M,gcsGrid:M?P.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:n.interpolation,alignmentInfo:B,blockWidths:null},n);({pixelBlock:O,localNorthDirections:H}=e)}else{const e=(0,V.us)(J,A,{alignmentInfo:B});O=Z?(0,V.Uk)(e,{width:t,height:i},P.coefficients,D,n.interpolation):e,M&&P.gcsGrid&&(H=(0,V.Qh)({width:t,height:i},P.gcsGrid),O=(0,$.xQ)(O,this.rasterInfo.dataType,H))}return n.requestRawData||M?{extent:e,srcExtent:l,srcTilePixelSize:_,pixelBlock:O,transformGrid:P,localNorthDirections:H,isPartiallyFilled:E}:{extent:e,srcExtent:l,srcTilePixelSize:_,pixelBlock:O}}async _fetchRawTiles(e,t,i,n){const{origin:s,blockBoundary:r}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:o}=this.getBlockWidthHeight(e);let{x:l,y:c}=t,{width:u,height:h,wrapCount:f}=i;const d=this._getRasterTileAlignmentInfo(e,0);n.buffer&&(l-=n.buffer.cols,c-=n.buffer.rows,u+=2*n.buffer.cols,h+=2*n.buffer.rows);let p=0,m=0,y=0;f&&null!=d&&(({worldColumnCountFromOrigin:m,originColumnOffset:y,rightPadding:p}=d),m*d.blockWidth-p>=l+u&&(p=0));const g=Math.floor(l/a),x=Math.floor(c/o),w=Math.floor((l+u+p-1)/a),b=Math.floor((c+h+p-1)/o),I=r[e];if(!I)return null;const{minRow:S,minCol:_,maxCol:R,maxRow:v}=I;if(0===f&&(b<S||w<_||x>v||g>R))return null;const T=new Array;let C=!1;const k=null==this.ioConfig.allowPartialFill?n.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=x;t<=b;t++)for(let i=g;i<=w;i++){let s=i;if(!n.disableWrapAround&&f&&null!=d&&m<=i&&(s=i-m-y),t>=S&&s>=_&&v>=t&&R>=s){const i=this._fetchRawTile(e,t,s,n);k?T.push(new Promise((e=>{i.then((t=>e(t))).catch((()=>{C=!0,e(null)}))}))):T.push(i)}else T.push(Promise.resolve(null))}if(0===T.length)return null;const F=await Promise.all(T),M={height:(b-x+1)*o,width:(w-g+1)*a},{spatialReference:P}=this.rasterInfo,O=this.getPyramidPixelSize(e),{x:Z,y:D}=O;return{extent:new X.Z({xmin:s.x+g*a*Z,xmax:s.x+(w+1)*a*Z,ymin:s.y-(b+1)*o*D,ymax:s.y-x*o*D,spatialReference:P}),pixelBlocks:F,mosaicSize:M,isPartiallyFilled:C}}_isSameResolution(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}_fetchRawTile(e,t,i,n){const s=this.rasterInfo.storageInfo.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:r,minCol:a,maxCol:o,maxRow:l}=s;if(t<r||i<a||t>l||i>o)return Promise.resolve(null);const u=H(this.url,n.sliceId),h=`${e}/${t}/${i}`;let f=W(u,n.registryId,h);if(null==f){const s=new AbortController;f=this.fetchRawTile(e,t,i,{...n,signal:s.signal}),q(u,n.registryId,h,f,s),f.catch((()=>j(u,n.registryId,h)))}return n.signal&&(0,c.fu)(n,(()=>{L(u,n.registryId,h)})),f}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const n=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[s,r]=e,a=[],o=[];for(let e=0;e<n;e++){const[t,i]=(0,$.Tg)([s[e],r[e]]);a.push(t),o.push(i)}return[a,o]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=(0,N.P_)(this.rasterInfo)),null==this._rasterTileAlighmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,n={}){const s={datumTransformation:n.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};n.srcResolution&&(s.srcResolution=n.srcResolution,this._updateSourceDataInfo(e,s));const r=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=s,c=a/t,u=o/i,h=l<r&&c*u>=16,f=l===r&&this._requireTooManySrcTiles(a,o,t,i);if(h||f||0===a||0===o){const a=new z.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let o=(0,N.VO)(a,this.rasterInfo.spatialReference,e,s.datumTransformation);const f=!o||n.srcResolution&&o.x+o.y<n.srcResolution.x+n.srcResolution.y;if(h&&n.srcResolution&&f){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(r-l+3>=e){const t=2**e;o={x:n.srcResolution.x*t,y:n.srcResolution.y*t}}}o&&(s.srcResolution=o,this._updateSourceDataInfo(e,s))}return this._requireTooManySrcTiles(s.srcWidth,s.srcHeight,t,i)&&(s.srcWidth=0,s.srcHeight=0),s}_requireTooManySrcTiles(e,t,i,n){const{tileInfo:s}=this.rasterInfo.storageInfo;return Math.ceil(e/s.size[0])*Math.ceil(t/s.size[1])>=256||e/i>8||t/n>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,n=i.spatialReference,{srcResolution:s,datumTransformation:r}=t,{pyramidLevel:a,pyramidResolution:o,excessiveReading:l}=(0,N.kr)(s,i,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,N.tB)(e,n,r);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{x:h,y:f}=i.storageInfo.origin,d=Math.floor((c.xmin-h)/o.x+.1),p=Math.floor((f-c.ymax)/o.y+.1),m=Math.floor((c.xmax-h)/o.x-.1),y=Math.floor((f-c.ymin)/o.y-.1),g=c.width<.1*o.x?0:m-d+1,x=c.height<.1*o.y?0:y-p+1;t.pyramidLevel=a,t.pyramidResolution=o,t.srcWidth=g,t.srcHeight=x,t.ul={x:d,y:p}}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:n,pyramidLevel:s,useTransposedTile:r}=t,a=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[n])return{location:i,value:null};const{multidimensionalInfo:o}=this.rasterInfo;if(null==o||!r){const t=e.pixels.map((e=>e[n])),r={location:i,value:t,pyramidLevel:s},a=this._computeMagDirValues(t.map((e=>[e])));return a?.length&&(r.magdirValue=a.map((e=>e[0]))),r}let l=e.pixels.map((e=>e.slice(n*a,n*a+a))),c=this._computeMagDirValues(l);const{requestSomeSlices:u,identifyOptions:h}=t;let f=(0,J.MO)(o,h.transposedVariableName);if(u){const e=(0,J.Ur)(f,h.multidimensionalDefinition,h.timeExtent);l=l.map((t=>e.map((e=>t[e])))),c=c?.map((t=>e.map((e=>t[e])))),f=e.map((e=>f[e]))}const d=e.noDataValues||this.rasterInfo.noDataValue,p={pixels:l,pixelType:e.pixelType};let m;return null!=d&&((0,G.A)(p,d),m=p.mask),{location:i,value:null,dataSeries:f.map(((e,t)=>{const i={value:0===m?.[t]?null:l.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new C.Z({...e,isSlice:!0})))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i})),pyramidLevel:s}}};(0,n._)([(0,h.Cb)()],Y.prototype,"_rasterTileAlighmentInfo",void 0),(0,n._)([(0,h.Cb)({readOnly:!0})],Y.prototype,"_isGlobalWrappableSource",null),(0,n._)([(0,h.Cb)({readOnly:!0})],Y.prototype,"_hasNoneOrGCSShiftTransform",null),(0,n._)([(0,h.Cb)()],Y.prototype,"rasterJobHandler",null),(0,n._)([(0,h.Cb)(T.HQ)],Y.prototype,"url",null),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Y.prototype,"datasetName",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Y.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],Y.prototype,"hasUniqueSourceStorageInfo",void 0),(0,n._)([(0,h.Cb)()],Y.prototype,"rasterInfo",void 0),(0,n._)([(0,h.Cb)()],Y.prototype,"ioConfig",void 0),(0,n._)([(0,h.Cb)()],Y.prototype,"sourceJSON",void 0),Y=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.BaseRaster")],Y);const K=Y;var Q=i(74889);let ee=class extends K{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null}async open(e){await this.init();const{rasterFunction:t}=this;this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((e=>e.rasterJobHandler=this.rasterJobHandler)));const{rasters:i,rasterIds:n}=this.primaryRasters,s=i.map((t=>t.rasterInfo?void 0:t.open(e)));await Promise.all(s);const r=i.map((({rasterInfo:e})=>e)),o=t.bind({rasterInfos:r,rasterIds:n});if(!o.success||0===r.length)throw new a.Z("raster-function:open",`cannot bind the function: ${o.error??""}`);const l="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===l?.functionName&&(t.rasterInfo.attributeTable=Q.Z.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=r[0];this.hasUniqueSourceStorageInfo=1===r.length||r.slice(1).every((e=>this._hasSameStorageInfo(e,c))),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo)}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async fetchPixels(e,t,i,n={}){const{rasters:s,rasterIds:r}=this.primaryRasters;let a=!1;const{interpolation:o}=n,l=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!n.requestRawData&&"bilinear"!==o&&l&&(a=1===s.length&&!n.skipRasterFunction,n={...n,interpolation:"bilinear",requestRawData:a});const c=s.map((s=>s.fetchPixels(e,t,i,n))),u=await Promise.all(c),h=u.map((e=>e.pixelBlock)),f=a||n.requestRawData?u.map((e=>e.srcTilePixelSize)):null;if(n.skipRasterFunction||h.every((e=>null==e)))return u[0];const d=u.find((e=>null!=e.pixelBlock))?.extent??e,p=this.rasterJobHandler?await this.rasterJobHandler.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:r}),{transformGrid:m}=u[0];if(!a||null==p||null==m)return{...u[0],pixelBlock:p};const y={rows:m.spacing[0],cols:m.spacing[1]};let g;return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[p],srcMosaicSize:{width:p.width,height:p.height},destDimension:{width:t,height:i},coefs:m.coefficients,sampleSpacing:y,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:o,alignmentInfo:void 0,blockWidths:null},n)).pixelBlock:(0,V.Uk)(p,{width:t,height:i},m.coefficients,y,o),{extent:e,srcExtent:u[0].srcExtent,pixelBlock:g}}_hasSameStorageInfo(e,t){const{storageInfo:i,pixelSize:n,spatialReference:s,extent:r}=e,{storageInfo:a,pixelSize:o,spatialReference:l,extent:c}=t;return n.x===o.x&&n.y===o.y&&s.equals(l)&&r.equals(c)&&i.blockHeight===a.blockHeight&&i.blockWidth===a.blockWidth&&i.maximumPyramidLevel===a.maximumPyramidLevel}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],ee.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],ee.prototype,"tileType",void 0),(0,n._)([(0,h.Cb)()],ee.prototype,"rasterFunction",void 0),(0,n._)([(0,h.Cb)()],ee.prototype,"primaryRasters",void 0),ee=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.FunctionRaster")],ee);const te=ee;var ie=i(67900),ne=i(5847);var se=i(5154),re=i(15612),ae=i(67058),oe=i(72758),le=i(79681),ce=i(23808),ue=i(82971);const he=o.Z.getLogger("esri.layers.mixins.ImageryTileMixin"),fe=e=>{let t=class extends e{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalSubset=null,this.raster=null,this.rasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster="Function"===e[0]?.raster?.datasetFormat}get fullExtent(){return this.rasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,v.Nm)(e,he))}set renderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("renderer",e),this.updateRenderer())}readRenderer(e,t,i){const n=t?.layerDefinition?.drawingInfo?.renderer;return(0,I.ij)(n,i)||void 0}async convertVectorFieldData(e,t){if(null==e||!this.rasterInfo)return null;const i=this._rasterJobHandler.instance,n=this.rasterInfo.dataType;return i?i.convertVectorFieldData({pixelBlock:e,dataType:n},t):(0,$.KC)(e,n)}async computeStatisticsHistograms(e,t){e=(0,f.TJ)(le.Z,e).clone();const{rasterInfo:n}=this,{geometry:s}=e;if(null==s)throw new a.Z("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let r=s;const{spatialReference:o}=n;s.spatialReference.equals(o)||(await(0,N.zD)(),r="extent"===s.type?(0,N.tB)(s,o):(0,N.Wt)(s,o));const l=e.pixelSize??new z.Z({x:n.pixelSize.x,y:n.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=function(e,t,i,n=!0){const{spatialReference:s}=e,{x:r,y:a}=function(e,t){if(e.spatialReference.equals(t))return e;const i=(0,ie.c9)(e.spatialReference),n=(0,ie.c9)(t);if(i===n)return e;const s=i/n;return{x:e.x*s,y:e.y*s}}(i,s);let o,l,c;const u="extent"===t.type?t:t.extent;let{xmin:h,xmax:f,ymax:d,ymin:p}=u;const{xmin:m,ymax:y}=e.extent;return n?(h=m+(h>m?r*Math.round((h-m)/r):0),d=y-(d<y?a*Math.round((y-d)/a):0),f=m+(f>m?r*Math.round((f-m)/r):0),p=y-(p<y?a*Math.round((y-p)/a):0),o=new X.Z({xmin:h,ymax:d,xmax:f,ymin:p,spatialReference:s}),l=Math.round(o.width/r),c=Math.round(o.height/a)):(l=Math.floor((f-h)/r+.8),c=Math.floor((d-p)/a+.8),h=m+(h>m?r*Math.floor((h-m)/r+.1):0),d=y-(d<y?a*Math.floor((y-d)/a+.1):0),f=h+l*r,p=d-c*a,o=new X.Z({xmin:h,ymax:d,xmax:f,ymin:p,spatialReference:s})),{extent:o,width:l,height:c}}(n,r,l),d=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new a.Z("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const p=await async function(e,t,n){if("extent"===n.type)return function(e,t,i){const{width:n,height:s}=e,r=new Uint8Array(n*s),a=t.width/n,o=t.height/s;if(i.width/a<.5||i.height/o<.5)return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]});const{xmin:l,xmax:c,ymin:u,ymax:h}=t,{xmin:f,xmax:d,ymin:p,ymax:m}=i,y=Math.max(l,f),g=Math.min(c,d),x=Math.max(u,p),w=Math.min(h,m),b=.5*a,I=.5*o;if(g-y<b||w-x<I||g<l+b||y>c-b||x>h-I||w<u+I)return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]});const S=Math.max(0,(y-l)/a),_=Math.min(n,Math.max(0,(g-l)/a)),R=Math.max(0,(h-w)/o),v=Math.min(s,Math.max(0,(h-x)/o)),T=Math.round(S),C=Math.round(_)-1,k=Math.round(R),F=Math.round(v)-1;if(T===C&&S%1>.5&&_%1<.5||k===F&&R%1>.5&&v%1<.5)return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]});if(0===T&&0===k&&C===n&&F===s)return e;const M=e.mask;for(let e=k;e<=F;e++)for(let t=T;t<=C;t++){const i=e*n+t;r[i]=M?M[i]:255}return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]})}(e,t,n);const{width:s,height:r}=e,a=new Uint8Array(s*r),{contains:o,intersects:l}=await Promise.all([i.e(5837),i.e(1433)]).then(i.bind(i,61433));return l(t,n)?"polyline"===n.type?function(e,t,i){const{width:n,height:s}=e,r=new Uint8Array(n*s),a=t.width/n,o=t.height/s,{xmin:l,ymax:c}=t,{paths:u}=i,h=e.mask;for(let e=0;e<u.length;e++){const t=u[e];for(let e=0;e<t.length-1;e++){const[i,u]=t[e],[f,d]=t[e+1];let p=Math.floor((c-u)/o),m=Math.floor((c-d)/o);if(m<p){const e=p;p=m,m=e}p=Math.max(0,p),m=Math.min(s-1,m);const y=(f-i)/(d-u);for(let e=p;e<=m;e++){const t=e===p?Math.max(u,d):(s+1-e)*o,c=e===m?Math.min(u,d):t-o;let g=d===u?Math.floor((i-l)/a):Math.floor((y*(t-u)+i-l)/a),x=d===u?Math.floor((f-l)/a):Math.floor((y*(c-u)+i-l)/a);if(x<g){const e=g;g=x,x=e}const w=e*n;g=Math.max(0,g),x=Math.min(n-1,x);for(let e=w+g;e<=w+x;e++)r[e]=h?h[e]:255}}}return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]})}(e,t,n):o(n,t)?e:function(e,t,i){if(!e)return e;const{width:n,height:s}=e,r=t.width/n,a=t.height/s,{xmin:o,ymax:l}=t;let c;if("extent"===i.type){const e=(i.xmin-o)/r,t=(i.xmax-o)/r,n=(l-i.ymax)/a,s=(l-i.ymin)/a;c=[[[e,n],[e,s],[t,s],[t,n],[e,n]]]}else c=i.rings.map((e=>e.map((([e,t])=>[(e-o)/r,(l-t)/a]))));const u=document.createElement("canvas");u.width=n,u.height=s;const h=u.getContext("2d");h.fillStyle="#f00",c.forEach((e=>{h.beginPath(),h.moveTo(e[0][0],e[0][1]);for(let t=0;t<e.length;t++)h.lineTo(e[t][0],e[t][1]);h.closePath(),h.fill()}));const f=h.getImageData(0,0,n,s).data,d=e.mask,p=n*s,m=new Uint8Array(p);for(let e=0;e<p;e++)d&&!d[e]||(m[e]=f[4*e+3]>127?255:0);return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:m,maskIsAlpha:!1,pixels:[...e.pixels]})}(e,t,n):new ne.Z({pixelType:e.pixelType,width:s,height:r,mask:a,maskIsAlpha:!1,pixels:[...e.pixels]})}(d.pixelBlock,c,r),m=this._rasterJobHandler.instance;return m?m.computeStatisticsHistograms({pixelBlock:p},t):(0,re.js)(p)}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,ce.GE)(e.meshType,e.simulationSettings,e.flowData,null!=t.signal?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo??{};if(null==t)return e;let i=e.multidimensionalDefinition||this.multidimensionalDefinition;null!=i&&i.length||(i=(0,J.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const n=e.timeExtent||this.timeExtent;if(null!=i&&null!=n&&(null!=n.start||null!=n.end)){i=i.map((e=>e.clone()));const s=t.variables.find((({name:e})=>e===i[0].variableName))?.dimensions?.find((({name:e})=>"StdTime"===e)),r=i.find((({dimensionName:e})=>"StdTime"===e));if(!s||!r)return{...e,multidimensionalDefinition:null};const{start:a,end:o}=n,l=null==a?null:a.getTime(),c=null==o?null:o.getTime(),u=l??c,h=c??l;if(null!=s.values){const e=s.values.filter((e=>{if(Array.isArray(e)){if(u===h)return e[0]<=u&&e[1]>=u;const t=e[0]<=u&&e[1]>u||e[0]<h&&e[1]>=h,i=e[0]>=u&&e[1]<=h||e[0]<u&&e[1]>h;return t||i}return u===h?e===u:e>=u&&e<=h}));if(e.length){const t=e.sort(((e,t)=>{const i=Array.isArray(e)?e[0]:e,n=Array.isArray(e)?e[1]:e,s=Array.isArray(t)?t[0]:t,r=Array.isArray(t)?t[1]:t;return u===h?i-s:Math.abs(n-h)-Math.abs(r-h)}))[0];r.values=[t]}else i=null}else if(s.hasRegularIntervals&&s.extent){const[e,t]=s.extent;u>t||h<e?i=null:r.values=u===h?[u]:[Math.max(e,u),Math.min(t,h)]}}return null!=i&&(0,J.nb)(i,this.multidimensionalSubset)?{...e,multidimensionalDefinition:null}:{...e,multidimensionalDefinition:i}}async updateRasterFunction(){if(!this.loaded||"imagery-tile"!==this.type||!this.rasterFunction&&!this._cachedRasterFunctionJson||JSON.stringify(this.rasterFunction)===JSON.stringify(this._cachedRasterFunctionJson))return;if(this._isConstructedFromFunctionRaster&&"Function"===this.raster.datasetFormat){const e=this.raster.rasterFunction.toJSON();return!this.rasterFunction&&e&&this._set("rasterFunction",F.Z.fromJSON(e)),void(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON())}let e,t=this.raster,i=!1;"Function"===t.datasetFormat?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:n}=this;if(n){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const s=(0,se.Ue)(n.functionDefinition?.toJSON()??n.toJSON(),i),r=new te({rasterFunction:s});r.rasterJobHandler=this._rasterJobHandler.instance,await r.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=r}else this.raster=t,this._cachedRasterFunctionJson=null,await t.when();if(this._cachedRendererJson=null,!i&&!n)return;const{bandIds:s}=this,{bandCount:r}=this.raster.rasterInfo,a=s?.length?s.some((e=>e>=r)):r>=3;s&&(a||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:e,symbolizer:t}=this;if(!e||!t||!this.renderer)return;const{rasterInfo:i}=this.raster,n=(0,J.WY)(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=n?.name,r=(0,ae.ol)({...this.renderer.toJSON(),variableName:s});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(r))return;const a=this._rasterJobHandler.instance;a&&(t.rasterInfo=(0,ae.FI)(i,s),t.rendererJSON=r,t.bind(),await a.updateSymbolizer(t),this._cachedRendererJson=r)}async applyRenderer(e,t){const i=e&&e.pixelBlock;if(!(null!=i&&i.pixels&&i.pixels.length>0))return null;let n;await this.updateRenderer();const s=this._rasterJobHandler.instance,r=this.bandIds??[];return n=s?await s.symbolize({...e,simpleStretchParams:t,bandIds:r}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:r}),n}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const n=(0,R.C5)(e);return P.Z.create({size:256,spatialReference:e,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,n={}){if(s(this),n.requestAsImageElement){const s=this.getTileUrl(e,t,i);return(0,S.Z)(s,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then((e=>e.data))}const{rasterInfo:r}=this;if(null!=r.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition){const s=n.tileInfo||r.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,i,s),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,n)}async fetchPixels(e,t,i,n={}){return null!=this.rasterInfo.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,n))}async identify(e,t={}){const{raster:i,rasterInfo:n}=this;if(null!=n.multidimensionalInfo&&!(n.hasMultidimensionalTranspose&&((0,J.WU)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||null!=(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition))return{location:e,value:null};const s=this.multidimensionalSubset?.areaOfInterest;if(s&&!s.contains(e))throw new a.Z("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return i.identify(e,t)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.rasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.rasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(e){const t=e??this.rasterInfo?.multidimensionalInfo;return(0,J.jj)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,J.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&"Function"===this.raster.datasetFormat&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new M.Z;return this._rasterJobHandler.connectionPromise=e.initialize().then((async()=>{s(this),this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,"Function"===this.raster.datasetFormat&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{})),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(null==this.interpolation){s(this);const{raster:e}=this,t=(0,ae.In)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){s(this);const{rasterInfo:t}=this.raster;!this.bandIds&&t.bandCount>1&&(this.bandIds=(0,ae.YD)(t));const i=(0,J.WY)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=i?.name;if(!this.renderer||"override"===e){const e=(0,ae.Ob)(t,{bandIds:this.bandIds,variableName:n}),i=t.statistics,s=i&&i.length>0?i[0]:null,r=s?.max??0,a=s?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===e.type&&(r>1e24||a<-1e24)&&(e.dynamicRangeAdjustment=!0,e.statistics=null,"none"===e.stretchType&&(e.stretchType="min-max")),this.renderer=e}const r=(0,ae.ol)({...this.renderer.toJSON(),variableName:n}),a=(0,ae.FI)(t,n);this.symbolizer?(this.symbolizer.rendererJSON=r,this.symbolizer.rasterInfo=a):this.symbolizer=new oe.Z({rendererJSON:r,rasterInfo:a});const o=this.symbolizer.bind();if(o.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,ae.Ob)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.statistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else he.warn("imagery-tile-mixin",o.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}};function s(e){if(!e.raster||!e.rasterInfo)throw new a.Z("imagery-tile","no raster")}return(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_cachedRendererJson",void 0),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_cachedRasterFunctionJson",void 0),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_compatibleFullExtent",void 0),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_isConstructedFromFunctionRaster",void 0),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_rasterJobHandler",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"bandIds",void 0),(0,n._)([(0,h.Cb)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,n._)([(0,h.Cb)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,n._)([(0,h.Cb)()],t.prototype,"interpolation",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"ioConfig",void 0),(0,n._)([(0,h.Cb)({type:[C.Z],json:{write:!0}})],t.prototype,"multidimensionalDefinition",null),(0,n._)([(0,h.Cb)({type:k.Z,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"raster",void 0),(0,n._)([(0,h.Cb)({type:F.Z,json:{name:"renderingRule",write:!0}})],t.prototype,"rasterFunction",null),(0,n._)([(0,h.Cb)()],t.prototype,"rasterInfo",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"sourceJSON",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,type:ue.Z,json:{read:!1}})],t.prototype,"spatialReference",void 0),(0,n._)([(0,h.Cb)({type:P.Z})],t.prototype,"tileInfo",void 0),(0,n._)([(0,h.Cb)(T.HQ)],t.prototype,"url",null),(0,n._)([(0,h.Cb)({types:I.dr,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:I.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"renderer",null),(0,n._)([(0,_.r)("renderer")],t.prototype,"readRenderer",null),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"symbolizer",void 0),t=(0,n._)([(0,y.j)("esri.layers.ImageryTileMixin")],t),t};var de=i(38009),pe=i(16859),me=i(34760),ye=i(72965),ge=i(28294),xe=i(1231),we=i(69608),be=i(25972),Ie=i(20095);function Se(e){const t=e.fields,i=e.records,n=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",s=[{name:n,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),r=s.map((e=>e.name)),a=[];let o=0,l=0;return i.forEach((e=>{const t={};for(t[n]=o++,l=1;l<r.length;l++)t[r[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:s,features:a}}class _e{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const n=t.getUint32(4,!0),s=t.getUint16(8,!0),r=t.getUint16(10,!0),a={version:i,recordCount:n,headerByteCount:s,recordByteCount:r};let o=32;const l=[],c=[];let u;if(3===i){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,Ie.f)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<n&&e.byteLength-o>r;){const i=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)i.push((0,Ie.f)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const n=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();i.push(new Date(parseInt(n.substring(0,4),10),parseInt(n.substring(4,6),10)-1,parseInt(n.substring(6,8),10)))}o+=t.length})),c.push(i)):o+=r}}return{header:a,fields:l,records:c,recordSet:Se({fields:l,records:c})}}}var Re=i(87521);const ve=new Map;ve.set("int16","esriFieldTypeSmallInteger"),ve.set("int32","esriFieldTypeInteger"),ve.set("int64","esriFieldTypeInteger"),ve.set("float32","esriFieldTypeSingle"),ve.set("float64","esriFieldTypeDouble"),ve.set("text","esriFieldTypeString");let Te=class extends K{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:e?.signal});if(!this._validateHeader(t))throw new a.Z("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:i,rasterInfo:n}=this._parseHeader(t);if("thematic"===n.dataType){const e=await this._fetchAuxiliaryInformation();n.attributeTable=e}this._set("storageInfo",i),this._set("rasterInfo",n),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,i,n={}){const{transposeInfo:s}=this.rasterInfo.storageInfo,{transposedVariableName:r}=n,a=!(!s||!r),o=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(o<0)return null;const l=this._buildCacheFilePath(o,t,i,n.multidimensionalDefinition,r),c=this._getIndexRecordFromBundle(t,i,a),u=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:n.signal});if(!u)return null;const h=new Uint8Array(u.data),f=this._getTileEndAndContentType(h,c);if(0===f.recordSize)return null;const d=await this.request(l,{range:{from:f.position,to:f.position+f.recordSize},responseType:"array-buffer",signal:n.signal});if(!d)return null;const[p,m]=this._getTileSize(a);return this.decodePixelBlock(d.data,{width:p,height:m,planes:null,pixelType:null,returnInterleaved:a})}_validateHeader(e){return e&&"RasterInfo"===e.type&&!["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"].some((t=>!e[t]))}_parseHeader(e){const t=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:i,colormap:n,blockWidth:s,blockHeight:r,firstPyramidLevel:a,maximumPyramidLevel:o}=e,l=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),c=e.histograms?.[0]?.counts?.length?e.histograms:null,u=e.extent.spatialReference,h=e.geodataXform?.spatialReference,f=new ue.Z(u?.wkid||u?.wkt?u:h);let d=new X.Z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const p=new z.Z({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:f}),m=Math.round((d.xmax-d.xmin)/p.x),y=Math.round((d.ymax-d.ymin)/p.y),g=this._parseTransform(e.geodataXform),x=g?d:null;g&&(d=g.forwardTransform(d),p.x=(d.xmax-d.xmin)/m,p.y=(d.ymax-d.ymin)/y);const w=e.properties??{},b=e.format.toLowerCase().replace("cache/",""),I=new z.Z(e.origin.x,e.origin.y,f);let S,_,R,v;if(n&&n.colors)for(S=[],_=0;_<n.colors.length;_++)R=n.colors[_],v=n.values?n.values[_]:_,S.push([v,255&R,R<<16>>>24,R<<8>>>24,R>>>24]);const T=e.LODInfos,C=[];for(_=0;_<T.levels.length;_++)C.push(new D.Z({level:T.levels[_],resolution:T.resolutions[_],scale:96/.0254*T.resolutions[_]}));const k=new P.Z({dpi:96,lods:C,format:b,origin:I,size:[s,r],spatialReference:f}),F={recordSize:8,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*8+64},M=[{maxCol:Math.ceil(m/s)-1,maxRow:Math.ceil(y/r)-1,minCol:0,minRow:0}];let O=2;if(o>0)for(_=0;_<o;_++)M.push({maxCol:Math.ceil(m/O/s)-1,maxRow:Math.ceil(y/O/r)-1,minCol:0,minRow:0}),O*=2;const Z=e.mdInfo;let J=null;if(Z&&w._yxs){const e=w._yxs;J={packetSize:e.PacketSize,tileSize:[e.TileXSize,e.TileYSize]}}return{storageInfo:F,rasterInfo:new be.Z({width:m,height:y,pixelType:t,bandCount:i,extent:d,nativeExtent:x,transform:g,spatialReference:f,pixelSize:p,keyProperties:w,statistics:l,histograms:c,multidimensionalInfo:Z,colormap:S,storageInfo:new B.Z({blockWidth:s,blockHeight:r,pyramidBlockWidth:s,pyramidBlockHeight:r,origin:I,tileInfo:k,transposeInfo:J,firstPyramidLevel:a,maximumPyramidLevel:o,blockBoundary:M})})}}_parseTransform(e){if(!(0,Re.j)(e))throw new a.Z("cloudraster:open","the data contains unsupported geodata transform types");const t=(0,Re.c)(e);if("identity"===t.type)return null;if("polynomial"!==t.type||!t.forwardCoefficients?.length||!t.inverseCoefficients?.length)throw new a.Z("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return t}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),i=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),n=await Promise.all([t,i]);let s;if(n[0]){let e=n[0].fields;const t=n[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":ve.get(e.type),name:e.name,alias:e.alias||e.name})));const i=t.map((e=>({attributes:e})));e&&t&&(s={fields:e,features:i})}}return!s&&n[1]&&(s=_e.parse(n[1]).recordSet),Q.Z.fromJSON(s)}_buildCacheFilePath(e,t,i,n,s){const r=this._getPackageSize(!!s),a=Math.floor(t/r)*r,o=Math.floor(i/r)*r,l="R"+this._toHexString4(a)+"C"+this._toHexString4(o);let c="L";c+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:u}=this.rasterInfo,h=n?.[0];if(null==u||!h)return`${this.url}/_alllayers/${c}/${l}.bundle`;let f="_yxs";if(!s){f=u.variables.find((e=>e.name===h.variableName)).dimensions[0].values.indexOf(h.values[0]).toString(16);const e=4-f.length;for(let t=0;t<e;t++)f="0"+f;f="S"+f}const d=this._getVariableFolderName(s||h.variableName);return`${this.url}/_alllayers/${d}/${f}/${c}/${l}.bundle`}_getPackageSize(e=!1){const{transposeInfo:t}=this.rasterInfo.storageInfo;return e&&null!=t?t.packetSize??0:this.storageInfo.packetSize}_getTileSize(e=!1){const{storageInfo:t}=this.rasterInfo,{transposeInfo:i}=t;return e&&null!=i?i.tileSize:t.tileInfo.size}_getVariableFolderName(e){return""===(e=e.trim())?"_v":e.replaceAll(/[\{|\}\-]/g,"_").replace("\\*","_v")}_getIndexRecordFromBundle(e,t,i=!1){const n=this._getPackageSize(i),s=n*(e%n)+t%n;if(s<0)throw new Error("Invalid level / row / col");return 20+s*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const i=e.subarray(t,t+8);let n,s=0;for(n=0;n<5;n++)s|=(255&i[n])<<8*n;const r=0xffffffffff&s;for(s=0,n=5;n<8;n++)s|=(255&i[n])<<8*(n-5);return{position:r,recordSize:0xffffffffff&s}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};(0,n._)([(0,h.Cb)({readOnly:!0})],Te.prototype,"storageInfo",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Te.prototype,"datasetFormat",void 0),Te=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.CloudRaster")],Te);const Ce=Te;let ke=class extends K{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.data=null}async open(e){await this.init();const t=this.data,{pixelBlock:i,statistics:n,histograms:s,name:r,keyProperties:a,nativeExtent:o,transform:l}=this.data,{width:c,height:u,pixelType:h}=i,f=t.extent??new X.Z({xmin:-.5,ymin:.5,xmax:c-.5,ymax:u-.5,spatialReference:new ue.Z({wkid:3857})}),d=t.isPseudoSpatialReference??!t.extent,p={x:f.width/c,y:f.height/u},m=new be.Z({width:c,height:u,pixelType:h,extent:f,nativeExtent:o,transform:l,pixelSize:p,spatialReference:f.spatialReference,bandCount:i.pixels.length,keyProperties:a||{},statistics:n,isPseudoSpatialReference:d,histograms:s});this.createRemoteDatasetStorageInfo(m,512,512),this._set("rasterInfo",m),this.updateTileInfo(),await this._buildInMemoryRaster(i,{width:512,height:512},e),this.datasetName=r,this.url="/InMemory/"+r}fetchRawTile(e,t,i,n={}){const s=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(s)}async _buildInMemoryRaster(e,t,i){const n=this.rasterInfo.storageInfo.maximumPyramidLevel,s=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:n},i):Promise.resolve((0,V.Vl)(e,t,n)),r=null!=this.rasterInfo.statistics,o=null!=this.rasterInfo.histograms,l=r?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,re.Hv)(e)),u=await(0,c.as)([s,l]);if(!u[0].value&&u[1].value)throw new a.Z("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,r||(this.rasterInfo.statistics=u[1].value?.statistics),o||(this.rasterInfo.histograms=u[1].value?.histograms)}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],ke.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],ke.prototype,"data",void 0),ke=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.InMemoryRaster")],ke);const Fe=ke;function Me(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=[];if(t){const s=Me(e,i);for(let e=0;e<s.length;e++)Me(s[e],t).forEach((e=>n.push(e)));return n}const s=e.getElementsByTagNameNS("*",i);if(!s||0===s.length)return[];for(let e=0;e<s.length;e++)n.push(s[e]||s.item(e));return n}function Pe(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=Me(e,i);return n.length>0?t?Pe(n[0],t):n[0]:null}function Oe(e,t=null){const i=t?Pe(e,t):e;let n;return i?(n=i.textContent||i.nodeValue,n?n.trim():null):null}function Ze(e,t){return function(e,t){const i=Me(e,t),n=[];let s;for(let e=0;e<i.length;e++)s=i[e].textContent||i[e].nodeValue,s&&(s=s.trim(),""!==s&&n.push(s));return n}(e,t).map((e=>Number(e)))}function De(e,t){const i=Oe(e,t);return Number(i)}function Be(e,t){const i=e?.nodeName?.toLowerCase(),n=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===n}var Je=i(87390);function Ne(e,t){if(!e||!t)return null;const i=[];for(let n=0;n<e.length;n++)i.push(e[n]),i.push(t[n]);return i}function ze(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new ue.Z({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const i=e.indexOf("VERTCS"),n=e.indexOf("PROJCS"),s=n>-1?n:e.indexOf("GEOGCS");if(-1===s)return null;const r=e.slice(s,e.lastIndexOf("]",i)+1).trim(),a=e.slice(i,e.lastIndexOf("]")).trim();t=Ae(r);const o=new ue.Z(t?{wkid:t}:{wkt:r}),l=Ae(a);return l&&(o.vcsWkid=l),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=Ae(e),new ue.Z(0!==t?{wkid:t}:{wkt:e})):null}function Ae(e){const t=e.replaceAll("]","[").replaceAll('"',"").split("[").map((e=>e.trim())).filter((e=>""!==e)),i=t[t.length-1].split(","),n=i[0]?.toLowerCase();if(("epsg"===n||"esri"===n)&&e.endsWith('"]]')){const e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Ee(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(Be(e,"SRS")){if(!t.spatialReference){const i=Oe(e);t.spatialReference=ze(i)}}else if(Be(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:i,transform:n}=function(e){const t=Pe(e,"GeodataXform"),i=ze(De(t,"SpatialReference/WKID")||Oe(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};const n=De(t,"PolynomialOrder")??1,s=Ze(t,"CoeffX/Double"),r=Ze(t,"CoeffY/Double"),a=Ze(t,"InverseCoeffX/Double"),o=Ze(t,"InverseCoeffY/Double"),l=Ne(s,r),c=Ne(a,o);return{spatialReference:i,transform:l&&c&&l.length&&c.length?new Je.Z({spatialReference:i,polynomialOrder:n,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=n,t.spatialReference||(t.spatialReference=i)}else Me(e,"MDI").forEach((e=>t.metadata[e.getAttribute("key")]=Oe(e)));else if(Be(e,"PAMRasterBand")){const i=function(e){const t=De(e,"NoDataValue"),i=Pe(e,"Histograms/HistItem"),n=De(i,"HistMin"),s=De(i,"HistMax"),r=De(i,"BucketCount"),a=Oe(i,"HistCounts")?.split("|").map((e=>Number(e)));let o,l,c,u;Me(e,"Metadata/MDI").forEach((e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}}));const h=De(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:a?.length&&null!=n&&null!=s?{min:n,max:s,size:r||a.length,counts:a}:null,sourceBandIndex:h,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}}));const i=t.rasterBands;if(i.length){const e=!!i[0].statistics;t.statistics=e?i.map((e=>e.statistics)).filter(d.pC):null;const n=!!i[0].histogram;t.histograms=n?i.map((e=>e.histogram)).filter(d.pC):null}return t}let He=class extends K{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:i,statistics:n,histograms:s,transform:r}=await this._fetchAuxiliaryData(e);const a=!i;a&&(i=new ue.Z({wkid:3857})),s?.length&&null==n&&(n=(0,re.Oh)(s));const{width:o,height:l}=t;let c=new X.Z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:i});const u=r?r.forwardTransform(c):c;let h=!0;if(r){const e=r.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(r=null,c=u)}const f=new Fe({data:{extent:u,nativeExtent:c,transform:r,pixelBlock:t,statistics:n,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await f.open(),f.data=null,this._set("rasterInfo",f.rasterInfo),this._inMemoryRaster=f}fetchRawTile(e,t,i,n={}){return this._inMemoryRaster.fetchRawTile(e,t,i,n)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,U.y)(t).toUpperCase();if("JPG"!==i&&"PNG"!==i&&"GIF"!==i&&"BMP"!==i)throw new a.Z("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",i);const n=i.toLowerCase(),s="gif"===n||"bmp"===n||!(0,p.Z)("ios"),r=await this.decodePixelBlock(t,{format:n,useCanvas:s,hasNoZlibMask:!0});if(null==r)throw new a.Z("image-aux-raster:open","the data cannot be decoded");return r}async _fetchAuxiliaryData(e){const t=e?.signal,i=this.ioConfig.skipExtensions??[],n=i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),s=this.datasetFormat,r="JPG"===s?"jgw":"PNG"===s?"pgw":"BMP"===s?"bpw":null,a=r&&i.includes(r)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+r,{responseType:"text",signal:t}),o=await(0,c.as)([n,a]);if(t?.aborted)throw(0,c.zE)();const l=Ee(o[0].value?.data);if(!l.transform){const e=o[1].value?o[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;l.transform=6===e?.length?new Je.Z({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return l}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],He.prototype,"datasetFormat",void 0),He=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.ImageAuxRaster")],He);const Le=He;var We=i(70586),qe=i(17452),je=i(28589),Ge=i(29680),Ue=i(26059);let Ve=class extends K{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async open(e){await this.init();const t=e&&e.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const n=i.data;if(this.sourceJSON=n,!n)throw new a.Z("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!n.tileInfo)throw new a.Z("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=n.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(n.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===n.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=n.name?.slice(n.name.indexOf("/")+1)??"";const s=await this._fetchRasterInfo({signal:t});if(null==s)throw new a.Z("image-server-raster:open","cannot initialize image service");(0,Ue.n$)(s,n);const r="Map"===this.tileType?function(e,t){if(!e)return null;const{minScale:i,maxScale:n,minLOD:s,maxLOD:r}=t;if(null!=s&&null!=r)return P.Z.fromJSON({...e,lods:e.lods.filter((({level:e})=>null!=e&&e>=s&&e<=r))});if(0!==i&&0!==n){const t=e=>Math.round(1e4*e)/1e4,s=i?t(i):1/0,r=n?t(n):-1/0;return P.Z.fromJSON({...e,lods:e.lods.filter((e=>{const i=t(e.scale);return i<=s&&i>=r}))})}return P.Z.fromJSON(e)}(n.tileInfo,n):P.Z.fromJSON(n.tileInfo);(0,We.O3)(r);const[o,l]=this._computeMinMaxLOD(s,r),{extent:c,pixelSize:u}=s,h=.5/s.width*u.x,f=Math.max(u.x,u.y),{lods:d}=r;("Map"!==this.tileType&&0!==n.maxScale||Math.abs(u.x-u.y)>h||!d.some((e=>Math.abs(e.resolution-f)<h)))&&(u.x=u.y=o.resolution,s.width=Math.ceil((c.xmax-c.xmin)/u.x-.1),s.height=Math.ceil((c.ymax-c.ymin)/u.y-.1));const p=o.level-l.level,[m,y]=r.size,g=[],x=[];d.forEach(((e,t)=>{e.level>=l.level&&e.level<=o.level&&g.push({x:e.resolution,y:e.resolution}),t<d.length-1&&x.push(Math.round(10*e.resolution/d[t+1].resolution)/10)})),g.sort(((e,t)=>e.x-t.x));const w=this.computeBlockBoundary(c,m,y,r.origin,g,p),b=g.length>1?g.slice(1):null;let I;n.transposeInfo&&(I={tileSize:[n.transposeInfo.rows,n.transposeInfo.cols],packetSize:s.keyProperties?._yxs.PacketSize??0});const S=x.length<=1||x.length>=3&&x.slice(0,-1).every((e=>e===x[0]))?x[0]??2:Math.round(10/(l.resolution/o.resolution)**(-1/p))/10;if(s.storageInfo=new B.Z({blockWidth:r.size[0],blockHeight:r.size[1],pyramidBlockWidth:r.size[0],pyramidBlockHeight:r.size[1],pyramidResolutions:b,pyramidScalingFactor:S,compression:r.format,origin:r.origin,firstPyramidLevel:1,maximumPyramidLevel:p,tileInfo:r,transposeInfo:I,blockBoundary:w}),this._fixGCSShift(s),this._set("rasterInfo",s),n.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:s.storageInfo.tileInfo,parsedUrl:(0,qe.mN)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new je.y({layer:e})}}async fetchRawTile(e,t,i,n={}){const{storageInfo:s,extent:r}=this.rasterInfo,{transposeInfo:a}=s,o=null!=a&&!!n.transposedVariableName;if(this._slices&&!o&&null==n.sliceId)return null;const l=o?0:s.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${l}/${t}/${i}`,u=this._slices?o?{variable:n.transposedVariableName}:{sliceId:n.sliceId||0}:null,{data:h}=await this.request(c,{query:u,responseType:"array-buffer",signal:n.signal});if(!h)return null;const f=o?a.tileSize:s.tileInfo.size,d=await this.decodePixelBlock(h,{width:f[0],height:f[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==d)return null;const p=s.blockBoundary[e];if("jpg"!==s.compression||i>p.minCol&&i<p.maxCol&&t>p.minRow&&t<p.maxRow)return d;const{origin:m,blockWidth:y,blockHeight:g}=s,{x,y:w}=this.getPyramidPixelSize(e),b=Math.round((r.xmin-m.x)/x)%y,I=Math.round((r.xmax-m.x)/x)%y||y,S=Math.round((m.y-r.ymax)/w)%g,_=Math.round((m.y-r.ymin)/w)%g||g,R=i===p.minCol?b:0,v=t===p.minRow?S:0,T=i===p.maxCol?I:y,C=t===p.maxRow?_:g;return(0,V.pW)(d,{x:R,y:v},{width:T-R,height:C-v}),d}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some((e=>{const i=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])})))return e}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.statistics)),n=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),s=await Promise.all([i,n]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),s[1]?.[0]?.counts?.length||(s[1]=null),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let n=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let r=s-n+this._levelOffset;const a=i.srcLocation;for(;r>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(r,i.row,i.col,t))break}catch{}if(r--,n++,i=this.identifyPixelLocation(a,n,t.datumTransformation),null===i)return null}return-1===r||null==i?null:n}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),n=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),s=ue.Z.fromJSON(t.spatialReference||e.spatialReference),r=new z.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:s});return new be.Z({width:i,height:n,bandCount:3,extent:X.Z.fromJSON(e),spatialReference:s,pixelSize:r,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,n=(0,Ue.gh)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),s=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then((e=>e.data&&e.data.slices)).catch((()=>null)):null,r=await Promise.all([n,s]);return this._slices=r[1],r[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Ge.Z,e.extent=e.transform.forwardTransform(t))}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,n=.5/e.width*i.x,{lods:s}=t,r=t.lodAt(Math.max.apply(null,s.map((e=>e.level)))),a=t.lodAt(Math.min.apply(null,s.map((e=>e.level)))),{tileType:o}=this;if("Map"===o)return this._levelOffset=s[0].level,[r,a];if("Raster"===o)return[s.find((e=>e.resolution===i.x))??r,a];const{minScale:l,maxScale:c}=this.sourceJSON;let u=r;c>0&&(u=s.find((e=>Math.abs(e.scale-c)<n)),u||(u=s.filter((e=>e.scale>c)).sort(((e,t)=>e.scale>t.scale?1:-1))[0]??r));let h=a;return l>0&&(h=s.find((e=>Math.abs(e.scale-l)<n))??a,this._levelOffset=h.level-a.level),[u,h]}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Ve.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],Ve.prototype,"tileType",void 0),Ve=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.ImageServerRaster")],Ve);const $e=Ve;var Xe=i(48279);const Ye=new Map;Ye.set("Int8","s8"),Ye.set("UInt8","u8"),Ye.set("Int16","s16"),Ye.set("UInt16","u16"),Ye.set("Int32","s32"),Ye.set("UInt32","u32"),Ye.set("Float32","f32"),Ye.set("Float64","f32"),Ye.set("Double64","f32");const Ke=new Map;Ke.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Ke.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Ke.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Ke.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let Qe=class extends K{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(e){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:n,files:s}=this._parseHeader(i.data);if(-1===this.ioConfig.skipExtensions?.indexOf("aux.xml")){const t=await this._fetchAuxiliaryData(e);null!=t&&(n.statistics=t.statistics??n.statistics,n.histograms=t.histograms,t.histograms&&null==n.statistics&&(n.statistics=(0,re.Oh)(t.histograms)))}this._set("rasterInfo",n),this._files=s;const r=await this.request(s.index,{responseType:"array-buffer",signal:t});this._storageIndex=this._parseIndex(r.data);const{blockWidth:a,blockHeight:o}=this.rasterInfo.storageInfo,l=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:c,height:u}=this.rasterInfo,h=[],f=this._getBandSegmentCount();let d=0,p=-1;for(;d<this._storageIndex.length;){p++;const e=Math.ceil(c/a/l**p)-1,t=Math.ceil(u/o/l**p)-1;d+=(e+1)*(t+1)*f*4,h.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=h,p>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=p),this.updateTileInfo()}async fetchRawTile(e,t,i,n={}){const{blockWidth:s,blockHeight:r,blockBoundary:a}=this.rasterInfo.storageInfo,o=a[e];if(!o||o.maxRow<t||o.maxCol<i||o.minRow>t||o.minCol>i)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:h,actualTileHeight:f}=this._getTileLocation(e,t,i);if(!u||0===u.length)return null;if(0===u[0].from&&0===u[0].to){const e=new Uint8Array(s*r);return new ne.Z({width:s,height:r,pixels:null,mask:e,validPixelCount:0})}const{bandIds:d}=this.ioConfig,p=this._getBandSegmentCount(),m=[];let y=0;for(y=0;y<p;y++)d&&!d.includes(y)||m.push(this.request(this._files.data,{range:{from:u[y].from,to:u[y].to},responseType:"array-buffer",signal:n.signal}));const g=await Promise.all(m),x=g.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),w=new Uint8Array(x);let b=0;for(y=0;y<p;y++)w.set(new Uint8Array(g[y].data),b),b+=g[y].data.byteLength;const I=Ke.get(this.rasterInfo.storageInfo.compression).decoderFormat,S=await this.decodePixelBlock(w.buffer,{width:s,height:r,format:I,planes:d?.length||l,pixelType:c});if(null==S)return null;let{noDataValue:_}=this.rasterInfo;if(null!=_&&"lerc"!==I&&!S.mask&&(_=_[0],null!=_)){const e=S.width*S.height,t=new Uint8Array(e);if(Math.abs(_)>1e24)for(y=0;y<e;y++)Math.abs((S.pixels[0][y]-_)/_)>1e-6&&(t[y]=1);else for(y=0;y<e;y++)S.pixels[0][y]!==_&&(t[y]=1);S.mask=t}let R=0,v=0;if(h!==s||f!==r){let e=S.mask;if(e)for(y=0;y<r;y++)if(v=y*s,y<f)for(R=h;R<s;R++)e[v+R]=0;else for(R=0;R<s;R++)e[v+R]=0;else for(e=new Uint8Array(s*r),S.mask=e,y=0;y<f;y++)for(v=y*s,R=0;R<h;R++)e[v+R]=1}return S}_parseIndex(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,i,n,s,r,a;if(Xe.f){for(i=new Uint8Array(e),s=new ArrayBuffer(e.byteLength),n=new Uint8Array(s),r=0;r<e.byteLength/4;r++)for(a=0;a<4;a++)n[4*r+a]=i[4*r+3-a];t=new Uint32Array(s)}else t=new Uint32Array(e);return t}_getBandSegmentCount(){return Ke.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){const{blockWidth:n,blockHeight:s,pyramidScalingFactor:r}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,h,f=0,d=0;for(h=0;h<e;h++)d=r**h,c=Math.ceil(a/n/d),u=Math.ceil(o/s/d),f+=c*u;d=r**e,c=Math.ceil(a/n/d),u=Math.ceil(o/s/d),f+=t*c+i,f*=4*l;const p=this._storageIndex.subarray(f,f+4*l);let m=0,y=0;const g=[];for(let e=0;e<l;e++)m=p[4*e]*2**32+p[4*e+1],y=m+p[4*e+2]*2**32+p[4*e+3],g.push({from:m,to:y});return{ranges:g,actualTileWidth:i<c-1?n:Math.ceil(a/d)-n*(c-1),actualTileHeight:t<u-1?s:Math.ceil(o/d)-s*(u-1)}}_parseHeader(e){const t=Pe(e,"MRF_META/Raster");if(!t)throw new a.Z("mrf:open","not a valid MRF format");const i=Pe(t,"Size"),n=parseInt(i.getAttribute("x"),10),s=parseInt(i.getAttribute("y"),10),r=parseInt(i.getAttribute("c"),10),o=(Oe(t,"Compression")||"none").toLowerCase();if(!Ke.has(o))throw new a.Z("mrf:open","currently does not support compression "+o);const l=Oe(t,"DataType")||"UInt8",c=Ye.get(l);if(null==c)throw new a.Z("mrf:open","currently does not support pixel type "+l);const u=Pe(t,"PageSize"),h=parseInt(u.getAttribute("x"),10),f=parseInt(u.getAttribute("y"),10),d=Pe(t,"DataValues");let p,m;if(d&&(m=d.getAttribute("NoData"),null!=m&&(p=m.trim().split(" ").map((e=>parseFloat(e))))),Pe(e,"MRF_META/CachedSource"))throw new a.Z("mrf:open","currently does not support MRF referencing other data files");const y=Pe(e,"MRF_META/GeoTags"),g=Pe(y,"BoundingBox");let x,w=!1;if(null!=g){const e=parseFloat(g.getAttribute("minx")),t=parseFloat(g.getAttribute("miny")),i=parseFloat(g.getAttribute("maxx")),n=parseFloat(g.getAttribute("maxy")),s=Oe(y,"Projection")||"";let r=ue.Z.WGS84;if("LOCAL_CS[]"!==s)if(s.toLowerCase().startsWith("epsg:")){const e=Number(s.slice(5));isNaN(e)||0===e||(r=new ue.Z({wkid:e}))}else r=ze(s)??ue.Z.WGS84;else w=!0,r=new ue.Z({wkid:3857});x=new X.Z(e,t,i,n),x.spatialReference=r}else w=!0,x=new X.Z({xmin:-.5,ymin:.5-s,xmax:n-.5,ymax:.5,spatialReference:new ue.Z({wkid:3857})});const b=Pe(e,"MRF_META/Rsets"),I=parseInt(b&&b.getAttribute("scale")||"2",10),S=x.spatialReference,_=new B.Z({origin:new z.Z({x:x.xmin,y:x.ymax,spatialReference:S}),blockWidth:h,blockHeight:f,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:o,pyramidScalingFactor:I}),R=new z.Z({x:x.width/n,y:x.height/s,spatialReference:S}),v=new be.Z({width:n,height:s,extent:x,isPseudoSpatialReference:w,spatialReference:S,bandCount:r,pixelType:c,pixelSize:R,noDataValue:p,storageInfo:_}),T=Oe(e,"datafile"),C=Oe(e,"IndexFile");return{rasterInfo:v,files:{mrf:this.url,index:C||this.url.replace(".mrf",".idx"),data:T||this.url.replace(".mrf",Ke.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Ee(t)}catch{return null}}};(0,n._)([(0,h.Cb)()],Qe.prototype,"_files",void 0),(0,n._)([(0,h.Cb)()],Qe.prototype,"_storageIndex",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Qe.prototype,"datasetFormat",void 0),Qe=(0,n._)([(0,y.j)("esri.layers.support.rasterIO.MRFRaster")],Qe);const et=Qe;var tt=i(94793),it=i(9832);const nt=(e,t)=>e.get(t)?.values,st=(e,t)=>e.get(t)?.values?.[0];let rt=class extends K{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){await this.init();const t=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!i)throw new a.Z("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:n,firstIFDPos:s,isBigTiff:r}=(0,tt.cK)(i),l=[];await this._readIFDs(l,i,n,s,0,r?8:4,t);const{imageInfo:c,rasterInfo:u}=this._parseIFDs(l),h=(0,tt.ee)(l),f=(0,tt.I7)(l);if(this._headerInfo={littleEndian:n,isBigTiff:r,ifds:l,pyramidIFDs:h,maskIFDs:f,...c},this._set("rasterInfo",u),!c.isSupported)throw new a.Z("tiffraster:open","this tiff is not supported: "+c.message);if(!c.tileWidth)throw new a.Z("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");u.isPseudoSpatialReference&&o.Z.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const d=l[0].get("PREDICTOR")?.values?.[0],p=l[0].get("SAMPLEFORMAT")?.values?.[0];if(3===p&&2===d)throw new a.Z("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floatting point data");const{skipExtensions:m=[]}=this.ioConfig;if(!m.includes("aux.xml")){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&this._processPAMInfo(t,u)}m.includes("vat.dbf")||1!==u.bandCount||"u8"!==u.pixelType||(u.attributeTable=await this._fetchAuxiliaryTable(e),null!=u.attributeTable&&(u.keyProperties.DataType="thematic")),this.updateTileInfo()}async fetchRawTile(e,t,i,n={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const s=await this._fetchRawTiffTile(e,t,i,!1,n);if(null!=s&&this._headerInfo.hasMaskBand){const r=await this._fetchRawTiffTile(e,t,i,!0,n);null!=r&&r.pixels[0]instanceof Uint8Array&&(s.mask=r.pixels[0])}return s}_parseIFDs(e){const t=(0,tt.FI)(e),{width:i,height:n,tileWidth:s,tileHeight:r,planes:a,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:h,pyramidBlockHeight:f,tileBoundary:d,affine:p,metadata:m}=t;let y=ze(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),g=!!t.isPseudoGeographic;null==y&&(g=!0,y=new ue.Z({wkid:3857}));const x=new X.Z({...t.extent,spatialReference:y}),w=new z.Z(x?{x:x.xmin,y:x.ymax,spatialReference:y}:{x:0,y:0}),b=new B.Z({blockWidth:s,blockHeight:r,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:l,origin:w,firstPyramidLevel:c,maximumPyramidLevel:u,blockBoundary:d}),I=new z.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/n,spatialReference:y}),S=m?{BandProperties:m.bandProperties,DataType:m.dataType}:{};let _=null;const R=st(e[0],"PHOTOMETRICINTERPRETATION"),v=nt(e[0],"COLORMAP");if(R<=3&&v?.length>3&&v.length%3==0){_=[];const e=v.length/3;for(let t=0;t<e;t++)_.push([t,v[t]>>>8,v[t+e]>>>8,v[t+2*e]>>>8])}const T=new be.Z({width:i,height:n,bandCount:a,pixelType:o,pixelSize:I,storageInfo:b,spatialReference:y,isPseudoSpatialReference:g,keyProperties:S,extent:x,colormap:_,statistics:m?m.statistics:null});return p?.length&&(T.nativeExtent=new X.Z({xmin:-.5,ymin:.5-n,xmax:i-.5,ymax:.5,spatialReference:y}),T.transform=new Je.Z({polynomialOrder:1,forwardCoefficients:[p[2]+p[0]/2,p[5]-p[3]/2,p[0],p[3],-p[1],-p[4]]}),T.extent=T.transform.forwardTransform(T.nativeExtent),T.pixelSize=new z.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/n,spatialReference:y}),b.origin.x=-.5,b.origin.y=.5),{imageInfo:t,rasterInfo:T}}_processPAMInfo(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,re.Oh)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new z.Z({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}async _readIFDs(e,t,i,n,s,r=4,a){if(!n)return null;(n>=t.byteLength||n<0)&&(t=(await this.request(this.url,{range:{from:n+s,to:n+s+this._bufferSize},responseType:"array-buffer",signal:a})).data,s=n+s,n=0);const o=await this._readIFD(t,i,n,s,it.Z.tiffTags,r,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,i,o.nextIFD-s,s,r,a)}async _readIFD(e,t,i,n,s=it.Z.tiffTags,r=4,a){if(!e)return null;const o=(0,tt.vr)(e,t,i,n,s,r);if(o.success){const i=[];if(o.ifd?.forEach((e=>{e.values||i.push(e)})),i.length>0){const s=i.map((e=>e.offlineOffsetSize)).filter(d.pC),r=Math.min.apply(null,s.map((e=>e[0])));if(Math.min.apply(null,s.map((e=>e[0]+e[1])))-r<=this._bufferSize){const{data:s}=await this.request(this.url,{range:{from:r,to:r+this._bufferSize},responseType:"array-buffer",signal:a});e=s,n=r,i.forEach((i=>(0,tt.Dq)(e,t,i,n)))}}if(o.ifd?.has("GEOKEYDIRECTORY")){const i=o.ifd.get("GEOKEYDIRECTORY"),s=i?.values;if(s&&s.length>4){const r=s[0]+"."+s[1]+"."+s[2],o=await this._readIFD(e,t,i.valueOffset+6-n,n,it.Z.geoKeys,2,a);i.data=o.ifd,i.data&&i.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[r]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const i=await this.request(this.url,{range:{from:n,to:n+o.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=i.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,n,it.Z.tiffTags,4,a)}}async _fetchRawTiffTile(e,t,i,n,s={}){const r=this._getTileLocation(e,t,i,n);if(!r)return null;const{ranges:a,actualTileWidth:o,actualTileHeight:l,ifd:c}=r,u=a.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:s.signal}))),h=await Promise.all(u),f=h.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),d=1===h.length?h[0].data:new ArrayBuffer(f),p=[0],m=[0];if(h.length>1){const e=new Uint8Array(d);for(let t=0,i=0;t<h.length;t++){const n=h[t].data;e.set(new Uint8Array(n),i),p[t]=i,i+=n.byteLength,m[t]=n.byteLength}}const{blockWidth:y,blockHeight:g}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(d,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:p,sizes:m},width:y,height:g,planes:null,pixelType:null});if(null==x)return null;let w,b,I;if(o!==y||l!==g){let e=x.mask;if(e)for(w=0;w<g;w++)if(I=w*y,w<l)for(b=o;b<y;b++)e[I+b]=0;else for(b=0;b<y;b++)e[I+b]=0;else for(e=new Uint8Array(y*g),x.mask=e,w=0;w<l;w++)for(I=w*y,b=0;b<o;b++)e[I+b]=1}return x}_getTileLocation(e,t,i,n=!1){const{firstPyramidLevel:s,blockBoundary:r}=this.rasterInfo.storageInfo,a=0===e?0:e-(s-1),{_headerInfo:o}=this;if(!o)return null;const l=n?o.maskIFDs[a]:0===a?o?.ifds[0]:o?.pyramidIFDs[a-1];if(!l)return null;const c=(0,tt.If)(l,o),u=nt(l,"TILEOFFSETS");if(void 0===u)return null;const h=nt(l,"TILEBYTECOUNTS"),{minRow:f,minCol:d,maxRow:p,maxCol:m}=r[a];if(t>p||i>m||t<f||i<d)return null;const y=st(l,"IMAGEWIDTH"),g=st(l,"IMAGELENGTH"),x=st(l,"TILEWIDTH"),w=st(l,"TILELENGTH"),b=[];if(c){const{bandCount:e}=this.rasterInfo;for(let n=0;n<e;n++){const e=n*(p+1)*(m+1)+t*(m+1)+i;b[n]={from:u[e],to:u[e]+h[e]-1}}}else{const e=t*(m+1)+i;b.push({from:u[e],to:u[e]+h[e]-1})}for(let e=0;e<b.length;e++)if(null==b[e].from||!b[e].to||b[e].to<0)return null;return{ranges:b,ifd:l,actualTileWidth:i===m&&y%x||x,actualTileHeight:t===p&&g%w||w}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Ee(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=_e.parse(t);return i?.recordSet?Q.Z.fromJSON(i.recordSet):null}catch{return null}}};(0,n._)([(0,h.Cb)()],rt.prototype,"_files",void 0),(0,n._)([(0,h.Cb)()],rt.prototype,"_headerInfo",void 0),(0,n._)([(0,h.Cb)()],rt.prototype,"_bufferSize",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],rt.prototype,"datasetFormat",void 0),rt=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.TIFFRaster")],rt);const at=rt,ot=new Map;ot.set("CRF",{desc:"Cloud Raster Format",constructor:Ce}),ot.set("MRF",{desc:"Meta Raster Format",constructor:et}),ot.set("TIFF",{desc:"GeoTIFF",constructor:at}),ot.set("RasterTileServer",{desc:"Raster Tile Server",constructor:$e}),ot.set("JPG",{desc:"JPG Raster Format",constructor:Le}),ot.set("PNG",{desc:"PNG Raster Format",constructor:Le}),ot.set("GIF",{desc:"GIF Raster Format",constructor:Le}),ot.set("BMP",{desc:"BMP Raster Format",constructor:Le});class lt{static get supportedFormats(){const e=new Set;return ot.forEach(((t,i)=>e.add(i))),e}static async open(e){const{url:t,ioConfig:i,sourceJSON:n}=e;let s=e.datasetFormat;null==s&&t.lastIndexOf(".")&&(s=t.slice(t.lastIndexOf(".")+1).toUpperCase()),"OVR"===s||"TIF"===s?s="TIFF":"JPG"!==s&&"JPEG"!==s&&"JFIF"!==s||(s="JPG"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(s="RasterTileServer");const r={url:t,sourceJSON:n,datasetFormat:s,ioConfig:i??{bandIds:null,sampling:null}};let o,l;if(s&&this.supportedFormats.has(s)){if("CRF"===s&&!i?.enableCRF)throw new a.Z("rasterfactory:open",`cannot open raster: ${t}`);return o=ot.get(s).constructor,l=new o(r),await l.open({signal:e.signal}),l}if(s)throw new a.Z("rasterfactory:open","not a supported format "+s);const c=Array.from(ot.keys());let u=0;const h=()=>(s=c[u++],s&&("CRF"!==s||i?.enableCRF)?(o=ot.get(s).constructor,l=new o(r),l.open({signal:e.signal}).then((()=>l)).catch((()=>h()))):null);return h()}static register(e,t,i){ot.has(e.toUpperCase())||ot.set(e.toUpperCase(),{desc:t,constructor:i})}}var ct=i(32163),ut=i(12259);let ht=class extends((0,w.h)((0,ye.M)((0,de.q)((0,pe.I)((0,b.N)(fe((0,ge.n)((0,x.Y)((0,me.Q)((0,l.R)((0,r.J)(g.Z)))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=(0,c.Ds)((async(e,t,n)=>{const{save:s,saveAs:r}=await i.e(4697).then(i.bind(i,64697));switch(e){case ut.x.SAVE:return s(this,t);case ut.x.SAVE_AS:return r(this,n,t)}}))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(c.r9).then((()=>this._openRaster(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[new xe.Z({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new xe.Z({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],{rasterInfo:t}=this,i=t?.attributeTable,n=null!=i?i.fields:null;if(n){const t=n.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));e.push(...t)}const s=t?.dataType,r=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=r){const t=r.variables[0].unit?.trim(),i="Magnitude"+(t?` (${t})`:"");e.push(new xe.Z({name:"Raster.Magnitude",alias:i,domain:null,editable:!1,type:"double"})),e.push(new xe.Z({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return e}createPopupTemplate(e){const{rasterFields:t}=this,i=new Set(t.map((({name:e})=>e)).filter((e=>"raster.servicepixelvalue.raw"!==e.toLowerCase())));return(0,ct.eZ)({fields:t,title:this.title},{...e,visibleFieldNames:i})}async generateRasterInfo(e,t){if(!(e=(0,f.TJ)(F.Z,e)))return this.rasterInfo;try{const i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((e=>i[e.url]=e));const n=(0,se.Ue)(e.functionDefinition?.toJSON()??e.toJSON(),i),s=new te({rasterFunction:n});return await s.open(t),s.rasterInfo}catch(e){if(e instanceof a.Z)throw e;throw new a.Z("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(ut.x.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ut.x.SAVE_AS,t,e)}write(e,t){const i=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===i.datasetFormat&&("Raster"===i.tileType||"Map"===i.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t&&t.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new a.Z("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)this.raster.rasterInfo||await this.raster.open(),"Function"===this.raster.datasetFormat?(t=!0,this._primaryRasters=this.raster.primaryRasters.rasters):this._primaryRasters=[this.raster],this.url=this.raster.url;else{const{rasterFunction:t}=this,i=[this.url];t&&(0,se.G8)(t.toJSON(),i);const n=await Promise.all(i.map((t=>lt.open({url:t,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e})))),s=n.findIndex((e=>null==e));if(s>-1)throw new a.Z("imagery-tile-layer:open",`cannot open raster: ${i[s]}`);if(this._primaryRasters=n,t){const e={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((t=>e[t.url]=t));const i=(0,se.Ue)(t.functionDefinition?.toJSON()??t.toJSON(),e),s=new te({rasterFunction:i});try{await s.open(),this.raster=s}catch(e){const t=o.Z.getLogger(this);e instanceof a.Z&&t.error("imagery-tile-layer:open",e.message),t.warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=n[0]}}else this.raster=n[0]}const i=this.raster.rasterInfo;if(!i)throw new a.Z("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("rasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.rasterInfo.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,u.YP)((()=>this.customParameters),(e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)})))}};(0,n._)([(0,h.Cb)({clonable:!1})],ht.prototype,"_primaryRasters",void 0),(0,n._)([(0,h.Cb)({type:[f.z8],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],ht.prototype,"bandIds",void 0),(0,n._)([(0,h.Cb)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,m.J)(we.cl)],ht.prototype,"interpolation",void 0),(0,n._)([(0,h.Cb)(T.rn)],ht.prototype,"legendEnabled",void 0),(0,n._)([(0,h.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ht.prototype,"isReference",void 0),(0,n._)([(0,h.Cb)({type:["show","hide"]})],ht.prototype,"listMode",void 0),(0,n._)([(0,h.Cb)({json:{read:!0,write:!0}})],ht.prototype,"blendMode",void 0),(0,n._)([(0,h.Cb)()],ht.prototype,"sourceJSON",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],ht.prototype,"version",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],ht.prototype,"type",void 0),(0,n._)([(0,h.Cb)({type:["ArcGISTiledImageServiceLayer"]})],ht.prototype,"operationalLayerType",void 0),(0,n._)([(0,h.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],ht.prototype,"popupEnabled",void 0),(0,n._)([(0,h.Cb)({type:s.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],ht.prototype,"popupTemplate",void 0),(0,n._)([(0,h.Cb)({readOnly:!0})],ht.prototype,"defaultPopupTemplate",null),(0,n._)([(0,h.Cb)({readOnly:!0,type:[xe.Z]})],ht.prototype,"fields",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,type:[xe.Z]})],ht.prototype,"rasterFields",null),ht=(0,n._)([(0,y.j)("esri.layers.ImageryTileLayer")],ht);const ft=ht},11282:(e,t,i)=>{i.d(t,{cv:()=>o,en:()=>a,lA:()=>r}),i(68773),i(40330);var n=i(22974),s=i(17452);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function a(e){return"string"==typeof e?(0,s.mN)(e):(0,n.d9)(e)}function o(e,t,i){const n={};for(const s in e){if("declaredClass"===s)continue;const r=e[s];if(null!=r&&"function"!=typeof r)if(Array.isArray(r)){n[s]=[];for(let e=0;e<r.length;e++)n[s][e]=o(r[e])}else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(i&&i[s]);n[s]=t?e:JSON.stringify(e)}else n[s]=t?r:JSON.stringify(r);else n[s]=r}return n}i(71058)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1105,5732,2596,661,5234,9880],{99880:(t,e,r)=>{r.d(e,{V:()=>l});var n=r(68773),s=(r(3172),r(20102)),o=r(92604),i=r(17452);const a=o.Z.getLogger("esri.assets");function l(t){if(!n.default.assetsPath)throw a.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new s.Z("assets:path-not-set","config.assetsPath is not set");return(0,i.v_)(n.default.assetsPath,t)}},5732:(t,e,r)=>{r.d(e,{c:()=>n,g:()=>s});var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}},46521:(t,e,r)=>{function n(){return[1,0,0,0,1,0,0,0,1]}function s(t,e,r,n,s,o,i,a,l){return[t,e,r,n,s,o,i,a,l]}function o(t,e){return new Float64Array(t,e,9)}r.d(e,{a:()=>n,c:()=>o,f:()=>s}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},create:n,createView:o,fromValues:s},Symbol.toStringTag,{value:"Module"}))},52138:(t,e,r)=>{r.d(e,{A:()=>m,a:()=>w,b:()=>h,c:()=>p,d:()=>f,e:()=>x,f:()=>b,g:()=>i,i:()=>l,k:()=>d,m:()=>c,s:()=>o,t:()=>a,w:()=>u,y:()=>v,z:()=>_});var n=r(65617),s=r(46851);function o(t,e,r,n,s,o,i,a,l,c,u,h,d,f,p,m,y){return t[0]=e,t[1]=r,t[2]=n,t[3]=s,t[4]=o,t[5]=i,t[6]=a,t[7]=l,t[8]=c,t[9]=u,t[10]=h,t[11]=d,t[12]=f,t[13]=p,t[14]=m,t[15]=y,t}function i(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function a(t,e){if(t===e){const r=e[1],n=e[2],s=e[3],o=e[6],i=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=s,t[13]=i,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function l(t,e){const r=e[0],n=e[1],s=e[2],o=e[3],i=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],y=e[14],g=e[15],b=r*a-n*i,M=r*l-s*i,x=r*c-o*i,w=n*l-s*a,_=n*c-o*a,v=s*c-o*l,S=u*m-h*p,q=u*y-d*p,O=u*g-f*p,R=h*y-d*m,T=h*g-f*m,C=d*g-f*y;let B=b*C-M*T+x*R+w*O-_*q+v*S;return B?(B=1/B,t[0]=(a*C-l*T+c*R)*B,t[1]=(s*T-n*C-o*R)*B,t[2]=(m*v-y*_+g*w)*B,t[3]=(d*_-h*v-f*w)*B,t[4]=(l*O-i*C-c*q)*B,t[5]=(r*C-s*O+o*q)*B,t[6]=(y*x-p*v-g*M)*B,t[7]=(u*v-d*x+f*M)*B,t[8]=(i*T-a*O+c*S)*B,t[9]=(n*O-r*T-o*S)*B,t[10]=(p*_-m*x+g*b)*B,t[11]=(h*x-u*_-f*b)*B,t[12]=(a*q-i*R-l*S)*B,t[13]=(r*R-n*q+s*S)*B,t[14]=(m*M-p*w-y*b)*B,t[15]=(u*w-h*M+d*b)*B,t):null}function c(t,e,r){const n=e[0],s=e[1],o=e[2],i=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],p=e[11],m=e[12],y=e[13],g=e[14],b=e[15];let M=r[0],x=r[1],w=r[2],_=r[3];return t[0]=M*n+x*a+w*h+_*m,t[1]=M*s+x*l+w*d+_*y,t[2]=M*o+x*c+w*f+_*g,t[3]=M*i+x*u+w*p+_*b,M=r[4],x=r[5],w=r[6],_=r[7],t[4]=M*n+x*a+w*h+_*m,t[5]=M*s+x*l+w*d+_*y,t[6]=M*o+x*c+w*f+_*g,t[7]=M*i+x*u+w*p+_*b,M=r[8],x=r[9],w=r[10],_=r[11],t[8]=M*n+x*a+w*h+_*m,t[9]=M*s+x*l+w*d+_*y,t[10]=M*o+x*c+w*f+_*g,t[11]=M*i+x*u+w*p+_*b,M=r[12],x=r[13],w=r[14],_=r[15],t[12]=M*n+x*a+w*h+_*m,t[13]=M*s+x*l+w*d+_*y,t[14]=M*o+x*c+w*f+_*g,t[15]=M*i+x*u+w*p+_*b,t}function u(t,e,r){const n=r[0],s=r[1],o=r[2];if(e===t)t[12]=e[0]*n+e[4]*s+e[8]*o+e[12],t[13]=e[1]*n+e[5]*s+e[9]*o+e[13],t[14]=e[2]*n+e[6]*s+e[10]*o+e[14],t[15]=e[3]*n+e[7]*s+e[11]*o+e[15];else{const r=e[0],i=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7],f=e[8],p=e[9],m=e[10],y=e[11];t[0]=r,t[1]=i,t[2]=a,t[3]=l,t[4]=c,t[5]=u,t[6]=h,t[7]=d,t[8]=f,t[9]=p,t[10]=m,t[11]=y,t[12]=r*n+c*s+f*o+e[12],t[13]=i*n+u*s+p*o+e[13],t[14]=a*n+h*s+m*o+e[14],t[15]=l*n+d*s+y*o+e[15]}return t}function h(t,e,r){const n=r[0],s=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function d(t,e,r,n){let o,i,a,l,c,u,h,d,f,p,m,y,g,b,M,x,w,_,v,S,q,O,R,T,C=n[0],B=n[1],P=n[2],j=Math.sqrt(C*C+B*B+P*P);return j<(0,s.g)()?null:(j=1/j,C*=j,B*=j,P*=j,o=Math.sin(r),i=Math.cos(r),a=1-i,l=e[0],c=e[1],u=e[2],h=e[3],d=e[4],f=e[5],p=e[6],m=e[7],y=e[8],g=e[9],b=e[10],M=e[11],x=C*C*a+i,w=B*C*a+P*o,_=P*C*a-B*o,v=C*B*a-P*o,S=B*B*a+i,q=P*B*a+C*o,O=C*P*a+B*o,R=B*P*a-C*o,T=P*P*a+i,t[0]=l*x+d*w+y*_,t[1]=c*x+f*w+g*_,t[2]=u*x+p*w+b*_,t[3]=h*x+m*w+M*_,t[4]=l*v+d*S+y*q,t[5]=c*v+f*S+g*q,t[6]=u*v+p*S+b*q,t[7]=h*v+m*S+M*q,t[8]=l*O+d*R+y*T,t[9]=c*O+f*R+g*T,t[10]=u*O+p*R+b*T,t[11]=h*O+m*R+M*T,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function f(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function p(t,e,r){if(0===e)return i(t);let n,o,a,l=r[0],c=r[1],u=r[2],h=Math.sqrt(l*l+c*c+u*u);return h<(0,s.g)()?null:(h=1/h,l*=h,c*=h,u*=h,n=Math.sin(e),o=Math.cos(e),a=1-o,t[0]=l*l*a+o,t[1]=c*l*a+u*n,t[2]=u*l*a-c*n,t[3]=0,t[4]=l*c*a-u*n,t[5]=c*c*a+o,t[6]=u*c*a+l*n,t[7]=0,t[8]=l*u*a+c*n,t[9]=c*u*a-l*n,t[10]=u*u*a+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function m(t,e){const r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function y(t,e,r){const n=e[0],s=e[1],o=e[2],i=e[3],a=n+n,l=s+s,c=o+o,u=n*a,h=n*l,d=n*c,f=s*l,p=s*c,m=o*c,y=i*a,g=i*l,b=i*c;return t[0]=1-(f+m),t[1]=h+b,t[2]=d-g,t[3]=0,t[4]=h-b,t[5]=1-(u+m),t[6]=p+y,t[7]=0,t[8]=d+g,t[9]=p-y,t[10]=1-(u+f),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}const g=(0,n.c)();function b(t,e,r,n){const s=e[0],o=e[1],i=e[2],a=e[3],l=s+s,c=o+o,u=i+i,h=s*l,d=s*c,f=s*u,p=o*c,m=o*u,y=i*u,g=a*l,b=a*c,M=a*u,x=n[0],w=n[1],_=n[2];return t[0]=(1-(p+y))*x,t[1]=(d+M)*x,t[2]=(f-b)*x,t[3]=0,t[4]=(d-M)*w,t[5]=(1-(h+y))*w,t[6]=(m+g)*w,t[7]=0,t[8]=(f+b)*_,t[9]=(m-g)*_,t[10]=(1-(h+p))*_,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function M(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function x(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function w(t,e){if(t===e)return!0;const r=t[0],n=t[1],o=t[2],i=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],m=t[12],y=t[13],g=t[14],b=t[15],M=e[0],x=e[1],w=e[2],_=e[3],v=e[4],S=e[5],q=e[6],O=e[7],R=e[8],T=e[9],C=e[10],B=e[11],P=e[12],j=e[13],A=e[14],E=e[15],Z=(0,s.g)();return Math.abs(r-M)<=Z*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(n-x)<=Z*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(o-w)<=Z*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(i-_)<=Z*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(a-v)<=Z*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(l-S)<=Z*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-q)<=Z*Math.max(1,Math.abs(c),Math.abs(q))&&Math.abs(u-O)<=Z*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(h-R)<=Z*Math.max(1,Math.abs(h),Math.abs(R))&&Math.abs(d-T)<=Z*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(f-C)<=Z*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(p-B)<=Z*Math.max(1,Math.abs(p),Math.abs(B))&&Math.abs(m-P)<=Z*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(y-j)<=Z*Math.max(1,Math.abs(y),Math.abs(j))&&Math.abs(g-A)<=Z*Math.max(1,Math.abs(g),Math.abs(A))&&Math.abs(b-E)<=Z*Math.max(1,Math.abs(b),Math.abs(E))}function _(t){const e=(0,s.g)(),r=t[0],n=t[1],o=t[2],i=t[4],a=t[5],l=t[6],c=t[8],u=t[9],h=t[10];return Math.abs(1-(r*r+i*i+c*c))<=e&&Math.abs(1-(n*n+a*a+u*u))<=e&&Math.abs(1-(o*o+l*l+h*h))<=e}function v(t){return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[8]&&0===t[9]&&1===t[10]}const S=c,q=M;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t},adjoint:function(t,e){const r=e[0],n=e[1],s=e[2],o=e[3],i=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],m=e[13],y=e[14],g=e[15];return t[0]=a*(d*g-f*y)-h*(l*g-c*y)+m*(l*f-c*d),t[1]=-(n*(d*g-f*y)-h*(s*g-o*y)+m*(s*f-o*d)),t[2]=n*(l*g-c*y)-a*(s*g-o*y)+m*(s*c-o*l),t[3]=-(n*(l*f-c*d)-a*(s*f-o*d)+h*(s*c-o*l)),t[4]=-(i*(d*g-f*y)-u*(l*g-c*y)+p*(l*f-c*d)),t[5]=r*(d*g-f*y)-u*(s*g-o*y)+p*(s*f-o*d),t[6]=-(r*(l*g-c*y)-i*(s*g-o*y)+p*(s*c-o*l)),t[7]=r*(l*f-c*d)-i*(s*f-o*d)+u*(s*c-o*l),t[8]=i*(h*g-f*m)-u*(a*g-c*m)+p*(a*f-c*h),t[9]=-(r*(h*g-f*m)-u*(n*g-o*m)+p*(n*f-o*h)),t[10]=r*(a*g-c*m)-i*(n*g-o*m)+p*(n*c-o*a),t[11]=-(r*(a*f-c*h)-i*(n*f-o*h)+u*(n*c-o*a)),t[12]=-(i*(h*y-d*m)-u*(a*y-l*m)+p*(a*d-l*h)),t[13]=r*(h*y-d*m)-u*(n*y-s*m)+p*(n*d-s*h),t[14]=-(r*(a*y-l*m)-i*(n*y-s*m)+p*(n*l-s*a)),t[15]=r*(a*d-l*h)-i*(n*d-s*h)+u*(n*l-s*a),t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},determinant:function(t){const e=t[0],r=t[1],n=t[2],s=t[3],o=t[4],i=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],f=t[12],p=t[13],m=t[14],y=t[15];return(e*i-r*o)*(h*y-d*m)-(e*a-n*o)*(u*y-d*p)+(e*l-s*o)*(u*m-h*p)+(r*a-n*i)*(c*y-d*f)-(r*l-s*i)*(c*m-h*f)+(n*l-s*a)*(c*p-u*f)},equals:w,exactEquals:x,frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2+t[9]**2+t[10]**2+t[11]**2+t[12]**2+t[13]**2+t[14]**2+t[15]**2)},fromQuat:function(t,e){const r=e[0],n=e[1],s=e[2],o=e[3],i=r+r,a=n+n,l=s+s,c=r*i,u=n*i,h=n*a,d=s*i,f=s*a,p=s*l,m=o*i,y=o*a,g=o*l;return t[0]=1-h-p,t[1]=u+g,t[2]=d-y,t[3]=0,t[4]=u-g,t[5]=1-c-p,t[6]=f+m,t[7]=0,t[8]=d+y,t[9]=f-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromQuat2:function(t,e){const r=g,n=-e[0],s=-e[1],o=-e[2],i=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=n*n+s*s+o*o+i*i;return h>0?(r[0]=2*(a*i+u*n+l*o-c*s)/h,r[1]=2*(l*i+u*s+c*n-a*o)/h,r[2]=2*(c*i+u*o+a*s-l*n)/h):(r[0]=2*(a*i+u*n+l*o-c*s),r[1]=2*(l*i+u*s+c*n-a*o),r[2]=2*(c*i+u*o+a*s-l*n)),y(t,e,r),t},fromRotation:p,fromRotationTranslation:y,fromRotationTranslationScale:b,fromRotationTranslationScaleOrigin:function(t,e,r,n,s){const o=e[0],i=e[1],a=e[2],l=e[3],c=o+o,u=i+i,h=a+a,d=o*c,f=o*u,p=o*h,m=i*u,y=i*h,g=a*h,b=l*c,M=l*u,x=l*h,w=n[0],_=n[1],v=n[2],S=s[0],q=s[1],O=s[2],R=(1-(m+g))*w,T=(f+x)*w,C=(p-M)*w,B=(f-x)*_,P=(1-(d+g))*_,j=(y+b)*_,A=(p+M)*v,E=(y-b)*v,Z=(1-(d+m))*v;return t[0]=R,t[1]=T,t[2]=C,t[3]=0,t[4]=B,t[5]=P,t[6]=j,t[7]=0,t[8]=A,t[9]=E,t[10]=Z,t[11]=0,t[12]=r[0]+S-(R*S+B*q+A*O),t[13]=r[1]+q-(T*S+P*q+E*O),t[14]=r[2]+O-(C*S+j*q+Z*O),t[15]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromTranslation:f,fromXRotation:m,fromYRotation:function(t,e){const r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){const r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},frustum:function(t,e,r,n,s,o,i){const a=1/(r-e),l=1/(s-n),c=1/(o-i);return t[0]=2*o*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(s+n)*l,t[10]=(i+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*o*2*c,t[15]=0,t},getRotation:function(t,e){const r=e[0]+e[5]+e[10];let n=0;return r>0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},getScaling:function(t,e){const r=e[0],n=e[1],s=e[2],o=e[4],i=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return t[0]=Math.sqrt(r*r+n*n+s*s),t[1]=Math.sqrt(o*o+i*i+a*a),t[2]=Math.sqrt(l*l+c*c+u*u),t},getTranslation:function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},hasIdentityRotation:v,identity:i,invert:l,invertOrIdentity:function(t,e){return l(t,e)||i(t),t},isOrthoNormal:_,lookAt:function(t,e,r,n){const o=e[0],a=e[1],l=e[2];let c=o-r[0],u=a-r[1],h=l-r[2];const d=(0,s.g)();if(Math.abs(c)<d&&Math.abs(u)<d&&Math.abs(h)<d)return void i(t);let f=1/Math.sqrt(c*c+u*u+h*h);c*=f,u*=f,h*=f;const p=n[0],m=n[1],y=n[2];let g=m*h-y*u,b=y*c-p*h,M=p*u-m*c;f=Math.sqrt(g*g+b*b+M*M),f?(f=1/f,g*=f,b*=f,M*=f):(g=0,b=0,M=0);let x=u*M-h*b,w=h*g-c*M,_=c*b-u*g;f=Math.sqrt(x*x+w*w+_*_),f?(f=1/f,x*=f,w*=f,_*=f):(x=0,w=0,_=0),t[0]=g,t[1]=x,t[2]=c,t[3]=0,t[4]=b,t[5]=w,t[6]=u,t[7]=0,t[8]=M,t[9]=_,t[10]=h,t[11]=0,t[12]=-(g*o+b*a+M*l),t[13]=-(x*o+w*a+_*l),t[14]=-(c*o+u*a+h*l),t[15]=1},mul:S,multiply:c,multiplyScalar:function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t},multiplyScalarAndAdd:function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t},ortho:function(t,e,r,n,s,o,i){const a=1/(e-r),l=1/(n-s),c=1/(o-i);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*a,t[13]=(s+n)*l,t[14]=(i+o)*c,t[15]=1,t},perspective:function(t,e,r,n,s){const o=1/Math.tan(e/2);let i;return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=s&&s!==1/0?(i=1/(n-s),t[10]=(s+n)*i,t[14]=2*s*n*i):(t[10]=-1,t[14]=-2*n),t},perspectiveFromFieldOfView:function(t,e,r,n){const s=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),i=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),l=2/(i+a),c=2/(s+o);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(i-a)*l*.5,t[9]=(s-o)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},rotate:d,rotateX:function(t,e,r){const n=Math.sin(r),s=Math.cos(r),o=e[4],i=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*s+c*n,t[5]=i*s+u*n,t[6]=a*s+h*n,t[7]=l*s+d*n,t[8]=c*s-o*n,t[9]=u*s-i*n,t[10]=h*s-a*n,t[11]=d*s-l*n,t},rotateY:function(t,e,r){const n=Math.sin(r),s=Math.cos(r),o=e[0],i=e[1],a=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*s-c*n,t[1]=i*s-u*n,t[2]=a*s-h*n,t[3]=l*s-d*n,t[8]=o*n+c*s,t[9]=i*n+u*s,t[10]=a*n+h*s,t[11]=l*n+d*s,t},rotateZ:function(t,e,r){const n=Math.sin(r),s=Math.cos(r),o=e[0],i=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*s+c*n,t[1]=i*s+u*n,t[2]=a*s+h*n,t[3]=l*s+d*n,t[4]=c*s-o*n,t[5]=u*s-i*n,t[6]=h*s-a*n,t[7]=d*s-l*n,t},scale:h,set:o,str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},sub:q,subtract:M,targetTo:function(t,e,r,n){const s=e[0],o=e[1],i=e[2],a=n[0],l=n[1],c=n[2];let u=s-r[0],h=o-r[1],d=i-r[2],f=u*u+h*h+d*d;f>0&&(f=1/Math.sqrt(f),u*=f,h*=f,d*=f);let p=l*d-c*h,m=c*u-a*d,y=a*h-l*u;return f=p*p+m*m+y*y,f>0&&(f=1/Math.sqrt(f),p*=f,m*=f,y*=f),t[0]=p,t[1]=m,t[2]=y,t[3]=0,t[4]=h*y-d*m,t[5]=d*p-u*y,t[6]=u*m-h*p,t[7]=0,t[8]=u,t[9]=h,t[10]=d,t[11]=0,t[12]=s,t[13]=o,t[14]=i,t[15]=1,t},translate:u,transpose:a},Symbol.toStringTag,{value:"Module"}))},13598:(t,e,r)=>{function n(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}function o(t,e){return new Float64Array(t,e,16)}r.d(e,{I:()=>i,a:()=>n,b:()=>s,c:()=>o});const i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:i,clone:s,create:n,createView:o,fromValues:function(t,e,r,n,s,o,i,a,l,c,u,h,d,f,p,m){return[t,e,r,n,s,o,i,a,l,c,u,h,d,f,p,m]}},Symbol.toStringTag,{value:"Module"}))},94961:(t,e,r)=>{function n(){return[0,0,0,1]}function s(t){return[t[0],t[1],t[2],t[3]]}function o(t,e){return new Float64Array(t,e,4)}r.d(e,{I:()=>i,a:()=>n,b:()=>s,c:()=>o});const i=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:i,clone:s,create:n,createView:o,fromValues:function(t,e,r,n){return[t,e,r,n]}},Symbol.toStringTag,{value:"Module"}))},88764:(t,e,r)=>{r.d(e,{q:()=>l});var n,s,o,i=r(5732),a={exports:{}};n=a,s=function(){function t(r,n,s,o,i){for(;o>s;){if(o-s>600){var a=o-s+1,l=n-s+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);t(r,n,Math.max(s,Math.floor(n-l*u/a+h)),Math.min(o,Math.floor(n+(a-l)*u/a+h)),i)}var d=r[n],f=s,p=o;for(e(r,s,n),i(r[o],d)>0&&e(r,s,o);f<p;){for(e(r,f,p),f++,p--;i(r[f],d)<0;)f++;for(;i(r[p],d)>0;)p--}0===i(r[s],d)?e(r,s,p):e(r,++p,o),p<=n&&(s=p+1),n<=p&&(o=p-1)}}function e(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function r(t,e){return t<e?-1:t>e?1:0}return function(e,n,s,o,i){t(e,n,s||0,o||e.length-1,i||r)}},void 0!==(o=s())&&(n.exports=o);const l=(0,i.g)(a.exports)},20773:(t,e,r)=>{r.d(e,{a:()=>a,b:()=>i,c:()=>s,d:()=>u,e:()=>l,n:()=>h,s:()=>c,t:()=>o});var n=r(72220);function s(t,e,r){o(t.typedBuffer,e.typedBuffer,r,t.typedBufferStride,e.typedBufferStride)}function o(t,e,r,s=3,o=s){if(t.length/s!==Math.ceil(e.length/o))return n.c.error("source and destination buffers need to have the same number of elements"),t;const i=t.length/s,a=r[0],l=r[1],c=r[2],u=r[4],h=r[5],d=r[6],f=r[8],p=r[9],m=r[10],y=r[12],g=r[13],b=r[14];let M=0,x=0;for(let r=0;r<i;r++){const r=e[M],n=e[M+1],i=e[M+2];t[x]=a*r+u*n+f*i+y,t[x+1]=l*r+h*n+p*i+g,t[x+2]=c*r+d*n+m*i+b,M+=o,x+=s}return t}function i(t,e,r){a(t.typedBuffer,e.typedBuffer,r,t.typedBufferStride,e.typedBufferStride)}function a(t,e,r,s=3,o=s){if(t.length/s!==Math.ceil(e.length/o))return void n.c.error("source and destination buffers need to have the same number of elements");const i=t.length/s,a=r[0],l=r[1],c=r[2],u=r[3],h=r[4],d=r[5],f=r[6],p=r[7],m=r[8];let y=0,g=0;for(let r=0;r<i;r++){const r=e[y],n=e[y+1],i=e[y+2];t[g]=a*r+u*n+f*i,t[g+1]=l*r+h*n+p*i,t[g+2]=c*r+d*n+m*i,y+=o,g+=s}}function l(t,e,r){c(t.typedBuffer,e,r,t.typedBufferStride)}function c(t,e,r,n=3){const s=Math.min(t.length/n,e.count),o=e.typedBuffer,i=e.typedBufferStride;let a=0,l=0;for(let e=0;e<s;e++)t[l]=r*o[a],t[l+1]=r*o[a+1],t[l+2]=r*o[a+2],a+=i,l+=n}function u(t,e){h(t.typedBuffer,e.typedBuffer,t.typedBufferStride,e.typedBufferStride)}function h(t,e,r=3,n=r){const s=Math.min(t.length/r,e.length/n);let o=0,i=0;for(let a=0;a<s;a++){const s=e[o],a=e[o+1],l=e[o+2],c=s*s+a*a+l*l;if(c>0){const e=1/Math.sqrt(c);t[i]=e*s,t[i+1]=e*a,t[i+2]=e*l}o+=n,i+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:h,normalizeView:u,scale:c,scaleView:l,shiftRight:function(t,e,r){const n=Math.min(t.count,e.count),s=t.typedBuffer,o=t.typedBufferStride,i=e.typedBuffer,a=e.typedBufferStride;let l=0,c=0;for(let t=0;t<n;t++)s[c]=i[l]>>r,s[c+1]=i[l+1]>>r,s[c+2]=i[l+2]>>r,l+=a,c+=o},transformMat3:a,transformMat3View:i,transformMat4:o,transformMat4View:s},Symbol.toStringTag,{value:"Module"}))},2368:(t,e,r)=>{r.d(e,{J:()=>u,j:()=>h});var n=r(43697),s=r(92036),o=(r(80442),r(22974)),i=(r(92604),r(70586)),a=r(31263),l=r(1153),c=r(52011);const u=t=>{let e=class extends t{clone(){const t=(0,l.vw)(this);(0,i.O3)(t,"unable to clone instance of non-accessor class");const e=t.metadatas,r=t.store,n={},s=new Map;for(const t in e){const i=e[t],l=r?.originOf(t),c=i.clonable;if(i.readOnly||!1===c||l!==a.s3.USER&&l!==a.s3.DEFAULTS&&l!==a.s3.WEB_MAP&&l!==a.s3.WEB_SCENE)continue;const u=this[t];let h=null;h="function"==typeof c?c(u):"reference"===c?u:(0,o.Vo)(u),null!=u&&null==h||(l===a.s3.DEFAULTS?s.set(t,h):n[t]=h)}const c=new(0,Object.getPrototypeOf(this).constructor)(n);if(s.size){const t=(0,l.vw)(c)?.store;if(t)for(const[e,r]of s)t.set(e,r,a.s3.DEFAULTS)}return c}};return e=(0,n._)([(0,c.j)("esri.core.Clonable")],e),e};let h=class extends(u(s.Z)){};h=(0,n._)([(0,c.j)("esri.core.Clonable")],h)},90578:(t,e,r)=>{r.d(e,{p:()=>l});var n=r(75215),s=r(7628);const o=Object.prototype.toString;function i(t){const e="__accessorMetadata__"in t?(0,n.se)(t):t;return function(...t){if(t.push(e),"number"==typeof t[2])throw new Error("Using @cast has parameter decorator is not supported since 4.16");return a.apply(this,t)}}function a(t,e,r,n){(0,s.Oe)(t,e).cast=n}function l(...t){if(3!==t.length||"string"!=typeof t[1])return 1===t.length&&"[object Function]"===o.call(t[0])?i(t[0]):1===t.length&&"string"==typeof t[0]?function(t){return(e,r)=>{(0,s.Oe)(e,t).cast=e[r]}}(t[0]):void 0}},71715:(t,e,r)=>{r.d(e,{r:()=>s});var n=r(5600);function s(t,e,r){let s,o;return void 0===e||Array.isArray(e)?(o=t,r=e,s=[void 0]):(o=e,s=Array.isArray(t)?t:[t]),(t,e)=>{const i=t.constructor.prototype;s.forEach((s=>{const a=(0,n.CJ)(t,s,o);a.read&&"object"==typeof a.read||(a.read={}),a.read.reader=i[e],r&&(a.read.source=(a.read.source||[]).concat(r))}))}}},10661:(t,e,r)=>{r.d(e,{s:()=>s});var n=r(42100);class s extends n.s{notify(){const t=this._observers;if(t&&t.length>0){const e=t.slice();for(const t of e)t.onInvalidated(),t.onCommitted()}}}},24133:(t,e,r)=>{r.d(e,{Q:()=>i});var n=r(67676),s=r(44553),o=r(88764);class i{constructor(t=9,e){this._compareMinX=u,this._compareMinY=h,this._toBBox=t=>t,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&("function"==typeof e?this._toBBox=e:this._initFormat(e)),this.clear()}destroy(){this.clear(),M.prune(),x.prune(),w.prune(),_.prune()}all(t){this._all(this._data,t)}search(t,e){let r=this._data;const n=this._toBBox;if(g(t,r))for(M.clear();r;){for(let s=0,o=r.children.length;s<o;s++){const o=r.children[s],i=r.leaf?n(o):o;g(t,i)&&(r.leaf?e(o):y(t,i)?this._all(o,e):M.push(o))}r=M.pop()}}collides(t){let e=this._data;const r=this._toBBox;if(!g(t,e))return!1;for(M.clear();e;){for(let n=0,s=e.children.length;n<s;n++){const s=e.children[n],o=e.leaf?r(s):s;if(g(t,o)){if(e.leaf||y(t,o))return!0;M.push(s)}}e=M.pop()}return!1}load(t){if(!t.length)return this;if(t.length<this._minEntries){for(let e=0,r=t.length;e<r;e++)this.insert(t[e]);return this}let e=this._build(t.slice(0,t.length),0,t.length-1,0);if(this._data.children.length)if(this._data.height===e.height)this._splitRoot(this._data,e);else{if(this._data.height<e.height){const t=this._data;this._data=e,e=t}this._insert(e,this._data.height-e.height-1,!0)}else this._data=e;return this}insert(t){return t&&this._insert(t,this._data.height-1),this}clear(){return this._data=new q([]),this}remove(t){if(!t)return this;let e,r=this._data,s=null,o=0,i=!1;const a=this._toBBox(t);for(w.clear(),_.clear();r||w.length>0;){if(r||(r=w.pop(),s=w.data[w.length-1],o=_.pop()??0,i=!0),r.leaf&&(e=(0,n.cq)(r.children,t,r.children.length,r.indexHint),-1!==e))return r.children.splice(e,1),w.push(r),this._condense(w),this;i||r.leaf||!y(r,a)?s?(o++,r=s.children[o],i=!1):r=null:(w.push(r),_.push(o),o=0,s=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_all(t,e){let r=t;for(x.clear();r;){if(!0===r.leaf)for(const t of r.children)e(t);else x.pushArray(r.children);r=x.pop()??null}}_build(t,e,r,n){const s=r-e+1;let o=this._maxEntries;if(s<=o){const n=new q(t.slice(e,r+1));return a(n,this._toBBox),n}n||(n=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/o**(n-1)));const i=new O([]);i.height=n;const l=Math.ceil(s/o),c=l*Math.ceil(Math.sqrt(o));b(t,e,r,c,this._compareMinX);for(let s=e;s<=r;s+=c){const e=Math.min(s+c-1,r);b(t,s,e,l,this._compareMinY);for(let r=s;r<=e;r+=l){const s=Math.min(r+l-1,e);i.children.push(this._build(t,r,s,n-1))}}return a(i,this._toBBox),i}_chooseSubtree(t,e,r,n){for(;n.push(e),!0!==e.leaf&&n.length-1!==r;){let r,n=1/0,s=1/0;for(let o=0,i=e.children.length;o<i;o++){const i=e.children[o],a=d(i),l=p(t,i)-a;l<s?(s=l,n=a<n?a:n,r=i):l===s&&a<n&&(n=a,r=i)}e=r||e.children[0]}return e}_insert(t,e,r){const n=this._toBBox,s=r?t:n(t);w.clear();const o=this._chooseSubtree(s,this._data,e,w);for(o.children.push(t),c(o,s);e>=0&&w.data[e].children.length>this._maxEntries;)this._split(w,e),e--;this._adjustParentBBoxes(s,w,e)}_split(t,e){const r=t.data[e],n=r.children.length,s=this._minEntries;this._chooseSplitAxis(r,s,n);const o=this._chooseSplitIndex(r,s,n);if(!o)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const i=r.children.splice(o,r.children.length-o),l=r.leaf?new q(i):new O(i);l.height=r.height,a(r,this._toBBox),a(l,this._toBBox),e?t.data[e-1].children.push(l):this._splitRoot(r,l)}_splitRoot(t,e){this._data=new O([t,e]),this._data.height=t.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(t,e,r){let n,s,o;n=s=1/0;for(let i=e;i<=r-e;i++){const e=l(t,0,i,this._toBBox),a=l(t,i,r,this._toBBox),c=m(e,a),u=d(e)+d(a);c<n?(n=c,o=i,s=u<s?u:s):c===n&&u<s&&(s=u,o=i)}return o}_chooseSplitAxis(t,e,r){const n=t.leaf?this._compareMinX:u,s=t.leaf?this._compareMinY:h;this._allDistMargin(t,e,r,n)<this._allDistMargin(t,e,r,s)&&t.children.sort(n)}_allDistMargin(t,e,r,n){t.children.sort(n);const s=this._toBBox,o=l(t,0,e,s),i=l(t,r-e,r,s);let a=f(o)+f(i);for(let n=e;n<r-e;n++){const e=t.children[n];c(o,t.leaf?s(e):e),a+=f(o)}for(let n=r-e-1;n>=e;n--){const e=t.children[n];c(i,t.leaf?s(e):e),a+=f(i)}return a}_adjustParentBBoxes(t,e,r){for(let n=r;n>=0;n--)c(e.data[n],t)}_condense(t){for(let e=t.length-1;e>=0;e--){const r=t.data[e];if(0===r.children.length)if(e>0){const s=t.data[e-1],o=s.children;o.splice((0,n.cq)(o,r,o.length,s.indexHint),1)}else this.clear();else a(r,this._toBBox)}}_initFormat(t){const e=["return a"," - b",";"];this._compareMinX=new Function("a","b",e.join(t[0])),this._compareMinY=new Function("a","b",e.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function a(t,e){l(t,0,t.children.length,e,t)}function l(t,e,r,n,s){s||(s=new q([])),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let o,i=e;i<r;i++)o=t.children[i],c(s,t.leaf?n(o):o);return s}function c(t,e){t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY)}function u(t,e){return t.minX-e.minX}function h(t,e){return t.minY-e.minY}function d(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function m(t,e){const r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),s=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,s-r)*Math.max(0,o-n)}function y(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function g(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function b(t,e,r,n,s){const i=[e,r];for(;i.length;){const e=i.pop(),r=i.pop();if(e-r<=n)continue;const a=r+Math.ceil((e-r)/n/2)*n;(0,o.q)(t,a,r,e,s),i.push(r,a,a,e)}}const M=new s.Z,x=new s.Z,w=new s.Z,_=new s.Z({deallocator:void 0});class v{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class S extends v{constructor(){super(...arguments),this.height=1,this.indexHint=new n.SO}}class q extends S{constructor(t){super(),this.children=t,this.leaf=!0}}class O extends S{constructor(t){super(),this.children=t,this.leaf=!1}}},9361:(t,e,r)=>{r.d(e,{Z:()=>u});var n=r(43697),s=r(96674),o=r(5600),i=(r(75215),r(67676),r(80442),r(71715)),a=r(52011),l=r(82971);let c=class extends s.wq{constructor(...t){super(...t),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=l.Z.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(t,e){if(t instanceof l.Z)return t;if(null!=t){const r=new l.Z;return r.read(t,e),r}return t}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}clearCache(){this.notifyChange("cache")}getCacheValue(t){return this.cache[t]}setCacheValue(t,e){this.cache[t]=e}};(0,n._)([(0,o.Cb)()],c.prototype,"type",void 0),(0,n._)([(0,o.Cb)({readOnly:!0})],c.prototype,"cache",null),(0,n._)([(0,o.Cb)({readOnly:!0})],c.prototype,"extent",null),(0,n._)([(0,o.Cb)({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],c.prototype,"hasM",void 0),(0,n._)([(0,o.Cb)({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],c.prototype,"hasZ",void 0),(0,n._)([(0,o.Cb)({type:l.Z,json:{write:!0},value:l.Z.WGS84})],c.prototype,"spatialReference",void 0),(0,n._)([(0,i.r)("spatialReference")],c.prototype,"readSpatialReference",null),c=(0,n._)([(0,a.j)("esri.geometry.Geometry")],c);const u=c},94139:(t,e,r)=>{r.d(e,{Z:()=>M});var n,s=r(43697),o=r(92604),i=r(5600),a=r(90578),l=(r(67676),r(80442),r(71715)),c=r(52011),u=r(30556),h=r(75215),d=r(9361),f=r(82971),p=r(8744),m=r(40488);const y=[0,0];function g(t){return t&&("esri.geometry.SpatialReference"===t.declaredClass||null!=t.wkid)}let b=n=class extends d.Z{static copy(t,e){e._set("x",t._get("x")),e._set("y",t._get("y")),e._set("z",t._get("z")),e._set("m",t._get("m"));const r=t._get("spatialReference");e._set("spatialReference",Object.isFrozen(r)?r:r.clone())}constructor(...t){super(...t),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}normalizeCtorArgs(t,e,r,n,s){let i;if(Array.isArray(t))i=t,s=e,t=i[0],e=i[1],r=i[2],n=i[3];else if(t&&"object"==typeof t){if(i=t,t=null!=i.x?i.x:i.longitude,e=null!=i.y?i.y:i.latitude,r=i.z,n=i.m,(s=i.spatialReference)&&"esri.geometry.SpatialReference"!==s.declaredClass&&(s=new f.Z(s)),null!=i.longitude||null!=i.latitude)if(null==i.longitude)o.Z.getLogger(this).warn(".longitude=","Latitude was defined without longitude");else if(null==i.latitude)o.Z.getLogger(this).warn(".latitude=","Longitude was defined without latitude");else if(!i.declaredClass&&s&&s.isWebMercator){const r=(0,m.hG)(i.longitude,i.latitude,y);t=r[0],e=r[1]}}else g(r)?(s=r,r=null):g(n)&&(s=n,n=null);const a={x:t,y:e};return null==a.x&&null!=a.y?o.Z.getLogger(this).warn(".y=","Y coordinate was defined without an X coordinate"):null==a.y&&null!=a.x&&o.Z.getLogger(this).warn(".x=","X coordinate was defined without a Y coordinate"),null!=s&&(a.spatialReference=s),null!=r&&(a.z=r),null!=n&&(a.m=n),a}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return void 0!==this.m}set hasM(t){t!==(void 0!==this._get("m"))&&(this._set("m",t?0:void 0),this._set("hasM",t))}get hasZ(){return void 0!==this.z}set hasZ(t){t!==(void 0!==this._get("z"))&&(this._set("z",t?0:void 0),this._set("hasZ",t))}get latitude(){const{spatialReference:t,x:e,y:r}=this;if(t){if(t.isWebMercator)return(0,m.R6)(e,r,y)[1];if(t.isGeographic)return r}return null}set latitude(t){const{spatialReference:e,x:r}=this;null!=t&&e&&(e.isWebMercator?this._set("y",(0,m.hG)(r,t,y)[1]):e.isGeographic&&this._set("y",t),this._set("latitude",t))}get longitude(){const{x:t,y:e,spatialReference:r}=this;if(r){if(r.isWebMercator)return(0,m.R6)(t,e,y)[0];if(r.isGeographic)return t}return null}set longitude(t){const{y:e,spatialReference:r}=this;null!=t&&r&&(r.isWebMercator?this._set("x",(0,m.hG)(t,e,y)[0]):r.isGeographic&&this._set("x",t),this._set("longitude",t))}writeX(t,e,r){e[r]=isNaN(t)?"NaN":t}readX(t){return"string"==typeof t?NaN:t}clone(){const t=new n;return t.x=this.x,t.y=this.y,t.z=this.z,t.m=this.m,t.spatialReference=this.spatialReference,t}copy(t){return n.copy(t,this),this}equals(t){if(null==t)return!1;const{x:e,y:r,z:n,m:s,spatialReference:o}=this,{z:i,m:a}=t;let{x:l,y:c,spatialReference:u}=t;if(!o.equals(u))if(o.isWebMercator&&u.isWGS84)[l,c]=(0,m.hG)(l,c),u=o;else{if(!o.isWGS84||!u.isWebMercator)return!1;[l,c]=(0,m.R6)(l,c),u=o}return e===l&&r===c&&n===i&&s===a&&o.wkid===u.wkid}offset(t,e,r){return this.x+=t,this.y+=e,null!=r&&(this.z=(this.z??0)+r),this}normalize(){if(!this.spatialReference)return this;const t=(0,p.C5)(this.spatialReference);if(!t)return this;let e=this.x;const[r,n]=t.valid,s=2*n;let o;return e>n?(o=Math.ceil(Math.abs(e-n)/s),e-=o*s):e<r&&(o=Math.ceil(Math.abs(e-r)/s),e+=o*s),this._set("x",e),this}distance(t){return function(t,e){const r=t.x-e.x,n=t.y-e.y,s=t.hasZ&&e.hasZ?t.z-e.z:0;return Math.sqrt(r*r+n*n+s*s)}(this,t)}toArray(){const t=this.hasZ,e=this.hasM;return t&&e?[this.x,this.y,this.z,this.m]:t?[this.x,this.y,this.z]:e?[this.x,this.y,this.m]:[this.x,this.y]}toJSON(t){return this.write({},t)}};(0,s._)([(0,i.Cb)({readOnly:!0})],b.prototype,"cache",null),(0,s._)([(0,i.Cb)({type:Boolean,json:{read:!1,write:{enabled:!1,overridePolicy:null}}})],b.prototype,"hasM",null),(0,s._)([(0,i.Cb)({type:Boolean,json:{read:!1,write:{enabled:!1,overridePolicy:null}}})],b.prototype,"hasZ",null),(0,s._)([(0,i.Cb)({type:Number})],b.prototype,"latitude",null),(0,s._)([(0,i.Cb)({type:Number})],b.prototype,"longitude",null),(0,s._)([(0,i.Cb)({type:Number,json:{type:[Number,String],write:{isRequired:!0,allowNull:!0}}}),(0,a.p)((t=>isNaN(t)?t:(0,h.q9)(t)))],b.prototype,"x",void 0),(0,s._)([(0,u.c)("x")],b.prototype,"writeX",null),(0,s._)([(0,l.r)("x")],b.prototype,"readX",null),(0,s._)([(0,i.Cb)({type:Number,json:{write:!0}})],b.prototype,"y",void 0),(0,s._)([(0,i.Cb)({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],b.prototype,"z",void 0),(0,s._)([(0,i.Cb)({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],b.prototype,"m",void 0),b=n=(0,s._)([(0,c.j)("esri.geometry.Point")],b),b.prototype.toJSON.isDefaultToJSON=!0;const M=b},62155:(t,e,r)=>{var n;r.d(e,{R:()=>n}),function(t){t[t.X=0]="X",t[t.Y=1]="Y",t[t.Z=2]="Z"}(n||(n={}))},83025:(t,e,r)=>{r.d(e,{JK:()=>a,QZ:()=>o,Rq:()=>i,bg:()=>s,mB:()=>l});var n=r(1533);function s(t,e=!1){return t<=n.c8?e?new Array(t).fill(0):new Array(t):new Float64Array(t)}function o(t){return((0,n.kJ)(t)?t.length:t.byteLength/8)<=n.c8?Array.from(t):new Float64Array(t)}function i(t,e,r){return Array.isArray(t)?t.slice(e,e+r):t.subarray(e,e+r)}function a(t,e){for(let r=0;r<e.length;++r)t[r]=e[r];return t}function l(t){return Array.isArray(t)?new Float64Array(t):t}},85872:(t,e,r)=>{r.d(e,{Z:()=>d});var n=r(43697),s=r(2368),o=r(96674),i=r(5600),a=(r(75215),r(67676),r(80442),r(36030)),l=r(52011),c=r(65617),u=r(94139);let h=class extends((0,s.J)(o.wq)){constructor(t){super(t),this.type="georeferenced-relative",this.isRelative=!0,this.isGeoreferenced=!0,this.origin=(0,c.c)()}getOriginPoint(t){const[e,r,n]=this.origin;return new u.Z({x:e,y:r,z:n,spatialReference:t})}setOriginFromPoint({x:t,y:e,z:r}){this.origin=(0,c.f)(t,e,r??0)}};(0,n._)([(0,a.J)({georeferencedRelative:"georeferenced-relative"},{readOnly:!0})],h.prototype,"type",void 0),(0,n._)([(0,i.Cb)({type:[Number],nonNullable:!0,json:{write:!0}})],h.prototype,"origin",void 0),h=(0,n._)([(0,l.j)("esri.geometry.support.MeshGeoreferencedRelativeVertexSpace")],h);const d=h},50567:(t,e,r)=>{r.d(e,{Z:()=>c});var n=r(43697),s=r(2368),o=r(96674),i=(r(92604),r(75215),r(67676),r(80442),r(20102),r(36030)),a=r(52011);let l=class extends((0,s.J)(o.wq)){constructor(){super({}),this.type="georeferenced",this.isRelative=!1,this.isGeoreferenced=!0}};(0,n._)([(0,i.J)({georeferenced:"georeferenced"},{readOnly:!0})],l.prototype,"type",void 0),l=(0,n._)([(0,a.j)("esri.geometry.support.MeshGeoreferencedVertexSpace")],l);const c=l},84555:(t,e,r)=>{r.d(e,{Z:()=>d});var n=r(43697),s=r(2368),o=r(96674),i=r(5600),a=(r(75215),r(67676),r(80442),r(36030)),l=r(52011),c=r(65617),u=r(94139);let h=class extends((0,s.J)(o.wq)){constructor(t){super(t),this.type="local",this.isRelative=!0,this.isGeoreferenced=!1,this.origin=(0,c.c)()}getOriginPoint(t){const[e,r,n]=this.origin;return new u.Z({x:e,y:r,z:n,spatialReference:t})}setOriginFromPoint({x:t,y:e,z:r}){this.origin=(0,c.f)(t,e,r??0)}};(0,n._)([(0,a.J)({local:"local"},{readOnly:!0})],h.prototype,"type",void 0),(0,n._)([(0,i.Cb)({type:[Number],nonNullable:!0,json:{write:!0}})],h.prototype,"origin",void 0),h=(0,n._)([(0,l.j)("esri.geometry.support.MeshLocalVertexSpace")],h);const d=h},72220:(t,e,r)=>{r.d(e,{c:()=>n});const n=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},61787:(t,e,r)=>{r.r(e),r.d(e,{default:()=>i});var n=r(80442),s=r(24133),o=r(66459);class i{async createIndex(t,e){const r=new Array;if(!t.vertexAttributes||!t.vertexAttributes.position)return new s.Q;const n=this._createMeshData(t),o=null!=e?await e.invoke("createIndexThread",n,{transferList:r}):this.createIndexThread(n).result;return this._createPooledRBush().fromJSON(o)}createIndexThread(t){const e=new Float64Array(t.position),r=this._createPooledRBush();return t.components?this._createIndexComponentsThread(r,e,t.components.map((t=>new Uint32Array(t)))):this._createIndexAllThread(r,e)}_createIndexAllThread(t,e){const r=new Array(e.length/9);let n=0;for(let t=0;t<e.length;t+=9)r[n++]=a(e,t,t+3,t+6);return t.load(r),{result:t.toJSON()}}_createIndexComponentsThread(t,e,r){let n=0;for(const t of r)n+=t.length/3;const s=new Array(n);let o=0;for(const t of r)for(let r=0;r<t.length;r+=3)s[o++]=a(e,3*t[r],3*t[r+1],3*t[r+2]);return t.load(s),{result:t.toJSON()}}_createMeshData(t){const e=(t.vertexSpace.isRelative?(0,o.I5)({position:t.vertexAttributes.position,normal:null,tangent:null},t.vertexSpace,t.transform,t.spatialReference).position:t.vertexAttributes.position).buffer;return!t.components||t.components.some((t=>!t.faces))?{position:e}:{position:e,components:t.components.map((t=>t.faces))}}_createPooledRBush(){return new s.Q(9,(0,n.Z)("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}}function a(t,e,r,n){return{minX:Math.min(t[e],t[r],t[n]),maxX:Math.max(t[e],t[r],t[n]),minY:Math.min(t[e+1],t[r+1],t[n+1]),maxY:Math.max(t[e+1],t[r+1],t[n+1]),p0:[t[e],t[e+1],t[e+2]],p1:[t[r],t[r+1],t[r+2]],p2:[t[n],t[n+1],t[n+2]]}}},40488:(t,e,r)=>{r.d(e,{$:()=>M,Q8:()=>m,R6:()=>b,Sx:()=>x,hG:()=>g,iV:()=>y,mZ:()=>h});var n=r(22974),s=r(82971),o=r(68441),i=r(8744);const a=57.29577951308232,l=.017453292519943;function c(t){return t*a}function u(t){return t*l}function h(t){return Math.PI/2-2*Math.atan(Math.exp(-t/o.sv.radius))}function d(t){return null!=t.wkid||null!=t.wkt}const f=[0,0];function p(t,e,r,n,s){const o=t,i=s;if(i.spatialReference=r,"x"in o&&"x"in i)[i.x,i.y]=e(o.x,o.y,f,n);else if("xmin"in o&&"xmin"in i)[i.xmin,i.ymin]=e(o.xmin,o.ymin,f,n),[i.xmax,i.ymax]=e(o.xmax,o.ymax,f,n);else if("paths"in o&&"paths"in i||"rings"in o&&"rings"in i){const t="paths"in o?o.paths:o.rings,r=[];let s;for(let o=0;o<t.length;o++){const i=t[o];s=[],r.push(s);for(let t=0;t<i.length;t++)s.push(e(i[t][0],i[t][1],[0,0],n)),i[t].length>2&&s[t].push(i[t][2]),i[t].length>3&&s[t].push(i[t][3])}"paths"in i?i.paths=r:i.rings=r}else if("points"in o&&"points"in i){const t=o.points,r=[];for(let s=0;s<t.length;s++)r[s]=e(t[s][0],t[s][1],[0,0],n),t[s].length>2&&r[s].push(t[s][2]),t[s].length>3&&r[s].push(t[s][3]);i.points=r}return s}function m(t,e){const r=t&&(d(t)?t:t.spatialReference),n=e&&(d(e)?e:e.spatialReference);return!(t&&"type"in t&&"mesh"===t.type||e&&"type"in e&&"mesh"===e.type||!r||!n)&&(!!(0,i.fS)(n,r)||(0,i.sS)(n)&&(0,i.oR)(r)||(0,i.sS)(r)&&(0,i.oR)(n))}function y(t,e){if(null==t)return null;const r=t.spatialReference,o=e&&(d(e)?e:e.spatialReference);return m(r,o)?(0,i.fS)(r,o)?(0,n.d9)(t):(0,i.sS)(o)?p(t,g,s.Z.WebMercator,!1,(0,n.d9)(t)):(0,i.oR)(o)?p(t,b,s.Z.WGS84,!1,(0,n.d9)(t)):null:null}function g(t,e,r=[0,0]){e>89.99999?e=89.99999:e<-89.99999&&(e=-89.99999);const n=u(e);return r[0]=u(t)*o.sv.radius,r[1]=o.sv.halfSemiMajorAxis*Math.log((1+Math.sin(n))/(1-Math.sin(n))),r}function b(t,e,r=[0,0],n=!1){const s=c(t/o.sv.radius);return r[0]=n?s:s-360*Math.floor((s+180)/360),r[1]=c(Math.PI/2-2*Math.atan(Math.exp(-e/o.sv.radius))),r}function M(t,e=!1,r=(0,n.d9)(t)){return p(t,g,s.Z.WebMercator,e,r)}function x(t,e=!1,r=(0,n.d9)(t)){return p(t,b,s.Z.WGS84,e,r)}},3172:(t,e,r)=>{r.d(e,{Z:()=>f});var n=r(68773),s=r(40330),o=r(20102),i=r(80442),a=r(22974),l=r(95330),c=r(17452),u=r(19745),h=r(71058),d=r(85958);async function f(t,e){t instanceof URL&&(t=t.toString()),e?.query instanceof URLSearchParams&&(e.query=(0,c.u0)(e.query.toString().replaceAll("+"," ")));const a=(0,c.HK)(t),u=(0,c.jc)(t);u||a||(t=(0,c.Fv)(t));const g={url:t,requestOptions:{...e}};let b=(0,c.oh)(t);if(b){const t=await async function(t,e){if(null!=t.responseData)return t.responseData;if(t.headers&&(e.requestOptions.headers={...e.requestOptions.headers,...t.headers}),t.query&&(e.requestOptions.query={...e.requestOptions.query,...t.query}),t.before){let r,n;try{n=await t.before(e)}catch(t){r=v("request:interceptor",t,e)}if((n instanceof Error||n instanceof o.Z)&&(r=v("request:interceptor",n,e)),r)throw t.error&&t.error(r),r;return n}}(b,g);if(null!=t)return{data:t,getHeader:x,httpStatus:200,requestOptions:g.requestOptions,url:g.url};b.after||b.error||(b=null)}if(t=g.url,"image"===(e=g.requestOptions).responseType&&((0,i.Z)("host-webworker")||(0,i.Z)("host-node")))throw v("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),g);if("head"===e.method){if(e.body)throw v("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),g);if(a||u)throw v("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),g)}if(await async function(){(0,i.Z)("host-webworker")?p||(p=await r.e(9884).then(r.bind(r,29884))):f._abortableFetch||(f._abortableFetch=globalThis.fetch.bind(globalThis))}(),p)return p.execute(t,e);const M=new AbortController;(0,l.fu)(e,(()=>M.abort()));const w={controller:M,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:b,params:g,redoRequest:!1,useIdentity:m.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},_=await async function(t){let e,r;await async function(t){const e=t.params.url,r=t.params.requestOptions,o=t.controller.signal,i=r.body;let a=null,c=null;if(y&&"HTMLFormElement"in globalThis&&(i instanceof FormData?a=i:i instanceof HTMLFormElement&&(a=new FormData(i))),"string"==typeof i&&(c=i),t.fetchOptions={cache:r.cacheBust&&!("polyfill"in f._abortableFetch)?"no-cache":"default",credentials:"same-origin",headers:r.headers||{},method:"head"===r.method?"HEAD":"GET",mode:"cors",priority:m.priority,redirect:"follow",signal:o},(a||c)&&(t.fetchOptions.body=a||c),"anonymous"===r.authMode&&(t.useIdentity=!1),t.hasToken=!!(/token=/i.test(e)||r.query?.token||a?.get("token")),!t.hasToken&&n.default.apiKey&&(0,h.r)(e)&&(r.query||(r.query={}),r.query.token=n.default.apiKey,t.hasToken=!0),t.useIdentity&&!t.hasToken&&!t.credentialToken&&!q(e)&&!(0,l.Hc)(o)){let n;"immediate"===r.authMode?(await S(),n=await s.id.getCredential(e,{signal:o}),t.credential=n):"no-prompt"===r.authMode?(await S(),n=await s.id.getCredential(e,{prompt:!1,signal:o}).catch((()=>{})),t.credential=n):s.id&&(n=s.id.findCredential(e)),n&&(t.credentialToken=n.token,t.useSSL=!!n.ssl)}}(t);try{do{[e,r]=await O(t)}while(!await T(t,e,r))}catch(r){const n=v("request:server",r,t.params,e);throw n.details.ssl=t.useSSL,t.interceptor?.error&&t.interceptor.error(n),n}const o=t.params.url;if(r&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(o)){if(!t.hasToken&&!t.credentialToken&&r.user?.username&&!(0,c.kl)(o)){const t=(0,c.P$)(o,!0);t&&m.trustedServers.push(t)}Array.isArray(r.authorizedCrossOriginNoCorsDomains)&&(0,d.Hu)(r.authorizedCrossOriginNoCorsDomains)}const i=t.credential;if(i&&s.id){const t=s.id.findServerInfo(i.server);let e=t?.owningSystemUrl;if(e){e=e.replace(/\/?$/,"/sharing");const t=s.id.findCredential(e,i.userId);t&&-1===s.id._getIdenticalSvcIdx(e,t)&&t.resources.unshift(e)}}return{data:r,getHeader:e?t=>e?.headers.get(t):x,httpStatus:e?.status??200,requestOptions:t.params.requestOptions,ssl:t.useSSL,url:t.params.url}}(w);return b?.after?.(_),_}let p;const m=n.default.request,y="FormData"in globalThis,g=[499,498,403,401],b=["COM_0056","COM_0057","SB_0008"],M=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],x=()=>null,w=Symbol();function _(t){const e=(0,c.P$)(t);return!e||e.endsWith(".arcgis.com")||f._corsServers.includes(e)||(0,c.kl)(e)}function v(t,e,r,n){let s="Error";const i={url:r.url,requestOptions:r.requestOptions,getHeader:x,ssl:!1};if(e instanceof o.Z)return e.details?(e.details=(0,a.d9)(e.details),e.details.url=r.url,e.details.requestOptions=r.requestOptions):e.details=i,e;if(e){const t=n&&(t=>n.headers.get(t)),r=n?.status,o=e.message;o&&(s=o),t&&(i.getHeader=t),i.httpStatus=(null!=e.httpCode?e.httpCode:e.code)||r||0,i.subCode=e.subcode,i.messageCode=e.messageCode,"string"==typeof e.details?i.messages=[e.details]:i.messages=e.details,i.raw=w in e?e[w]:e}return(0,l.D_)(e)?(0,l.zE)():new o.Z(t,s,i)}async function S(){s.id||await Promise.all([r.e(7126),r.e(6261),r.e(450)]).then(r.bind(r,73660))}function q(t){return M.some((e=>e.test(t)))}async function O(t){let e=t.params.url;const r=t.params.requestOptions,n=t.fetchOptions??{},o=(0,c.jc)(e)||(0,c.HK)(e),a=r.responseType||"json",h=o?0:null!=r.timeout?r.timeout:m.timeout;let p=!1;if(!o){t.useSSL&&(e=(0,c.hO)(e)),r.cacheBust&&"default"===n.cache&&(e=(0,c.ZN)(e,"request.preventCache",Date.now()));let o={...r.query};t.credentialToken&&(o.token=t.credentialToken);let a=(0,c.B7)(o);(0,i.Z)("esri-url-encodes-apostrophe")&&(a=a.replaceAll("'","%27"));const l=e.length+1+a.length;let h;p="delete"===r.method||"post"===r.method||"put"===r.method||!!r.body||l>m.maxUrlLength;const f=r.useProxy||!!(0,c.ed)(e);if(f){const t=(0,c.b7)(e);h=t.path,!p&&h.length+1+l>m.maxUrlLength&&(p=!0),t.query&&(o={...t.query,...o})}if("HEAD"===n.method&&(p||f)){if(p){if(l>m.maxUrlLength)throw v("request:invalid-parameters",new Error("URL exceeds maximum length"),t.params);throw v("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),t.params)}if(f)throw v("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),t.params)}if(p?(n.method="delete"===r.method?"DELETE":"put"===r.method?"PUT":"POST",r.body?e=(0,c.fl)(e,o):(n.body=(0,c.B7)(o),n.headers||(n.headers={}),n.headers["Content-Type"]="application/x-www-form-urlencoded")):e=(0,c.fl)(e,o),f&&(t.useProxy=!0,e=`${h}?${e}`),o.token&&y&&n.body instanceof FormData&&!(0,u.P)(e)&&n.body.set("token",o.token),r.hasOwnProperty("withCredentials"))t.withCredentials=r.withCredentials;else if(!(0,c.D6)(e,(0,c.TI)()))if((0,c.kl)(e))t.withCredentials=!0;else if(s.id){const r=s.id.findServerInfo(e);r?.webTierAuth&&(t.withCredentials=!0)}t.withCredentials&&(n.credentials="include",(0,d.jH)(e)&&await(0,d.jz)(p?(0,c.fl)(e,o):e))}let g,b,M=0,x=!1;h>0&&(M=setTimeout((()=>{x=!0,t.controller.abort()}),h));try{if("native-request-init"===r.responseType)b=n,b.url=e;else if("image"!==r.responseType||"default"!==n.cache||"GET"!==n.method||p||function(t){if(t)for(const e of Object.getOwnPropertyNames(t))if(t[e])return!0;return!1}(r.headers)||!o&&!t.useProxy&&m.proxyUrl&&!_(e)){if(g=await f._abortableFetch(e,n),t.useProxy||function(t){const e=(0,c.P$)(t);e&&!f._corsServers.includes(e)&&f._corsServers.push(e)}(e),"native"===r.responseType)b=g;else if("HEAD"!==n.method)if(g.ok){switch(a){case"array-buffer":b=await g.arrayBuffer();break;case"blob":case"image":b=await g.blob();break;default:b=await g.text()}if(M&&(clearTimeout(M),M=0),"json"===a||"xml"===a||"document"===a)if(b)switch(a){case"json":b=JSON.parse(b);break;case"xml":b=R(b,"application/xml");break;case"document":b=R(b,"text/html")}else b=null;if(b){if("array-buffer"===a||"blob"===a){const t=g.headers.get("Content-Type");if(t&&/application\/json|text\/plain/i.test(t)&&b["blob"===a?"size":"byteLength"]<=750)try{const t=await new Response(b).json();t.error&&(b=t)}catch{}}"image"===a&&b instanceof Blob&&(b=await C(URL.createObjectURL(b),t,!0))}}else{b=await g.text();try{b=JSON.parse(b)}catch{}}}else b=await C(e,t)}catch(n){if("AbortError"===n.name){if(x)throw(0,d.Tf)();throw(0,l.zE)("Request canceled")}if(!(!g&&n instanceof TypeError&&m.proxyUrl)||r.body||"delete"===r.method||"head"===r.method||"post"===r.method||"put"===r.method||t.useProxy||_(e))throw n;t.redoRequest=!0,(0,c.tD)({proxyUrl:m.proxyUrl,urlPrefix:(0,c.P$)(e)??""})}finally{M&&clearTimeout(M)}return[g,b]}function R(t,e){let r;try{r=(new DOMParser).parseFromString(t,e)}catch{}if(!r||r.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return r}async function T(t,e,r){if(t.redoRequest)return t.redoRequest=!1,!1;const n=t.params.requestOptions;if(!e||"native"===n.responseType||"native-request-init"===n.responseType)return!0;let o,i;if(r&&(r.error?o=r.error:"error"===r.status&&Array.isArray(r.messages)&&(o={...r},o[w]=r,o.details=r.messages)),!o&&!e.ok)throw o=new Error(`Unable to load ${e.url} status: ${e.status}`),o[w]=r,o;let a,l=null;o&&(i=Number(o.code),l=o.hasOwnProperty("subcode")?Number(o.subcode):null,a=o.messageCode,a=a?.toUpperCase());const c=n.authMode;if(403===i&&(4===l||o.message?.toLowerCase().includes("ssl")&&!o.message.toLowerCase().includes("permission"))){if(!t.useSSL)return t.useSSL=!0,!1}else if(!t.hasToken&&t.useIdentity&&("no-prompt"!==c||498===i)&&void 0!==i&&g.includes(i)&&!q(t.params.url)&&(403!==i||a&&!b.includes(a)&&(null==l||2===l&&t.credentialToken))){await S();try{const e=await s.id.getCredential(t.params.url,{error:v("request:server",o,t.params),prompt:"no-prompt"!==c,signal:t.controller.signal,token:t.credentialToken});return t.credential=e,t.credentialToken=e.token,t.useSSL=t.useSSL||e.ssl,!1}catch(e){if("no-prompt"===c)return t.credential=void 0,t.credentialToken=void 0,!1;o=e}}if(o)throw o;return!0}function C(t,e,r=!1){const n=e.controller.signal,s=new Image;return e.withCredentials?s.crossOrigin="use-credentials":s.crossOrigin="anonymous",s.alt="",s.fetchPriority=m.priority,s.src=t,(0,d.fY)(s,t,r,n)}f._abortableFetch=null,f._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"]},71058:(t,e,r)=>{r.d(e,{r:()=>o});var n=r(17452);const s=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function o(t){const e=(0,n.P$)(t,!0);return!!e&&e.endsWith(".arcgis.com")&&!s.includes(e)&&!t.endsWith("/sharing/rest/generateToken")}},85958:(t,e,r)=>{r.d(e,{Hu:()=>h,Tf:()=>u,fY:()=>a,jH:()=>d,jz:()=>f});var n=r(68773),s=r(80442),o=r(95330),i=r(17452);function a(t,e,r=!1,n){return new Promise(((i,a)=>{if((0,o.Hc)(n))return void a(l());let c=()=>{d(),a(new Error(`Unable to load ${e}`))},u=()=>{const e=t;d(),i(e)},h=()=>{if(!t)return;const e=t;d(),e.src="",a(l())};const d=()=>{(0,s.Z)("esri-image-decode")||(t.removeEventListener("error",c),t.removeEventListener("load",u)),c=null,u=null,t=null,null!=n&&n.removeEventListener("abort",h),h=null,r&&URL.revokeObjectURL(e)};null!=n&&n.addEventListener("abort",h),(0,s.Z)("esri-image-decode")?t.decode().then(u,c):(t.addEventListener("error",c),t.addEventListener("load",u))}))}function l(){try{return new DOMException("Aborted","AbortError")}catch{const t=new Error;return t.name="AbortError",t}}const c="Timeout exceeded";function u(){return new Error(c)}function h(t){n.default.request.crossOriginNoCorsDomains||(n.default.request.crossOriginNoCorsDomains={});const e=n.default.request.crossOriginNoCorsDomains;for(let r of t)r=r.toLowerCase(),/^https?:\/\//.test(r)?e[(0,i.P$)(r)??""]=0:(e[(0,i.P$)("http://"+r)??""]=0,e[(0,i.P$)("https://"+r)??""]=0)}function d(t){const e=n.default.request.crossOriginNoCorsDomains;if(e){let r=(0,i.P$)(t);if(r)return r=r.toLowerCase(),!(0,i.D6)(r,(0,i.TI)())&&e[r]<Date.now()-36e5}return!1}async function f(t){const e=n.default.request.crossOriginNoCorsDomains,r=(0,i.P$)(t);e&&r&&(e[r.toLowerCase()]=Date.now());const s=(0,i.mN)(t);t=s.path,"json"===s.query?.f&&(t+="?f=json");try{await fetch(t,{mode:"no-cors",credentials:"include"})}catch{}}}}]);