@arcgis/core 5.0.0-next.43 → 5.0.0-next.45

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 (329) hide show
  1. package/applications/Components/imageryUtils.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{f97a7cb367634353177d.js → 001a7a4cf6fe74432ed6.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{324d66962aeec17d3e28.js → 1e0e7cef7ef947894bbe.js} +1 -1
  5. package/assets/esri/core/workers/chunks/20ad34f9d45c64392022.js +1 -0
  6. package/assets/esri/core/workers/chunks/23396a6318edf9264c1f.js +1 -0
  7. package/assets/esri/core/workers/chunks/{ad891ac388fa6c1c9b94.js → 2b34a010f76e5f289868.js} +1 -1
  8. package/assets/esri/core/workers/chunks/2ef4c0092c59a98a5532.js +1 -0
  9. package/assets/esri/core/workers/chunks/35272810c2ed04eb403d.js +1 -0
  10. package/assets/esri/core/workers/chunks/{d1f4152b2b8d47cbf586.js → 72fbee59d5d909615408.js} +1 -1
  11. package/assets/esri/core/workers/chunks/75c66e38bdc1c786c599.js +1 -0
  12. package/assets/esri/core/workers/chunks/7d3c2a063598bdd015e2.js +1 -0
  13. package/assets/esri/core/workers/chunks/897ce6fc9cefb1e14a64.js +1 -0
  14. package/assets/esri/core/workers/chunks/992e9bbdf9d3787ddb0e.js +1 -0
  15. package/assets/esri/core/workers/chunks/a2442549c5daf3653eb4.js +1 -0
  16. package/assets/esri/core/workers/chunks/a7cd795042ebb8585906.js +1 -0
  17. package/assets/esri/core/workers/chunks/bf5f9da0837ed09729c6.js +316 -0
  18. package/assets/esri/core/workers/chunks/{385cfd3087f00dbd1146.js → ca1c65eb7f5900c60170.js} +1 -1
  19. package/assets/esri/core/workers/chunks/cddce67919e13e2f365e.js +1 -0
  20. package/assets/esri/core/workers/chunks/{7c08c0824ad354177787.js → d7878fba02814adaf19f.js} +1 -1
  21. package/assets/esri/core/workers/chunks/e6784251bbb8b71ead93.js +1 -0
  22. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  23. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  24. package/chunks/GaussianSplat.glsl.js +2 -2
  25. package/config.js +1 -1
  26. package/core/urlUtils.d.ts +1 -0
  27. package/core/workers/workerFactory.js +1 -1
  28. package/interfaces.d.ts +104 -9
  29. package/kernel.js +1 -1
  30. package/layers/ImageryTileLayer.js +1 -1
  31. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  32. package/layers/WCSLayer.js +1 -1
  33. package/layers/mixins/ArcGISImageService.js +1 -1
  34. package/layers/mixins/ImageryTileMixin.js +1 -1
  35. package/layers/mixins/RasterJobHandlerMixin.js +1 -1
  36. package/layers/ogc/wcsUtils.js +1 -1
  37. package/layers/raster/datasets/BaseRaster.js +5 -0
  38. package/layers/raster/datasets/CovJSONRaster.js +5 -0
  39. package/layers/raster/datasets/FunctionRaster.js +5 -0
  40. package/layers/raster/datasets/ImageAuxRaster.js +5 -0
  41. package/layers/raster/datasets/ImageServerRaster.js +5 -0
  42. package/layers/raster/datasets/InMemoryRaster.js +5 -0
  43. package/layers/raster/datasets/MRFRaster.js +5 -0
  44. package/layers/raster/datasets/RawBlockCache.js +5 -0
  45. package/layers/raster/datasets/TIFFRaster.js +5 -0
  46. package/layers/raster/datasets/WCSRaster.js +5 -0
  47. package/layers/raster/datasets/covJSONParser.js +5 -0
  48. package/layers/raster/datasets/multidimensionalUtils.js +5 -0
  49. package/layers/raster/datasets/pamParser.js +5 -0
  50. package/layers/raster/datasets/pixelReader.js +5 -0
  51. package/layers/raster/datasets/wcsCoverageParser.js +5 -0
  52. package/layers/raster/formats/Lerc.js +5 -0
  53. package/layers/raster/formats/Qb3.js +5 -0
  54. package/layers/raster/formats/RasterCodec.js +5 -0
  55. package/layers/raster/formats/TiffDecoder.js +5 -0
  56. package/layers/raster/functions/ArithmeticFunction.js +5 -0
  57. package/layers/{support/rasterFunctions → raster/functions}/ArithmeticFunctionArguments.js +1 -1
  58. package/layers/{support/rasterFunctions → raster/functions}/AspectFunction.js +1 -1
  59. package/layers/{support/rasterFunctions → raster/functions}/AspectFunctionArguments.js +1 -1
  60. package/layers/raster/functions/BandArithmeticFunction.js +5 -0
  61. package/layers/{support/rasterFunctions → raster/functions}/BandArithmeticFunctionArguments.js +1 -1
  62. package/layers/{support/rasterFunctions → raster/functions}/BaseFunctionArguments.js +1 -1
  63. package/layers/raster/functions/BaseRasterFunction.js +5 -0
  64. package/layers/{support/rasterFunctions → raster/functions}/ClipFunction.js +1 -1
  65. package/layers/{support/rasterFunctions → raster/functions}/ClipFunctionArguments.js +1 -1
  66. package/layers/raster/functions/ColormapFunction.js +5 -0
  67. package/layers/{support/rasterFunctions → raster/functions}/ColormapFunctionArguments.js +1 -1
  68. package/layers/raster/functions/ColormapToRGBFunction.js +5 -0
  69. package/layers/{support/rasterFunctions → raster/functions}/ColormapToRGBFunctionArguments.js +1 -1
  70. package/layers/raster/functions/CompositeBandFunction.js +5 -0
  71. package/layers/raster/functions/CompositeBandFunctionArguments.js +5 -0
  72. package/layers/raster/functions/ComputeChangeFunction.js +5 -0
  73. package/layers/{support/rasterFunctions → raster/functions}/ComputeChangeFunctionArguments.js +1 -1
  74. package/layers/{support/rasterFunctions → raster/functions}/ContrastBrightnessFunction.js +1 -1
  75. package/layers/{support/rasterFunctions → raster/functions}/ContrastBrightnessFunctionArguments.js +1 -1
  76. package/layers/raster/functions/ConvolutionFunction.js +5 -0
  77. package/layers/raster/functions/ConvolutionFunctionArguments.js +5 -0
  78. package/layers/{support/rasterFunctions → raster/functions}/CurvatureFunction.js +1 -1
  79. package/layers/{support/rasterFunctions → raster/functions}/CurvatureFunctionArguments.js +1 -1
  80. package/layers/{support/rasterFunctions → raster/functions}/ExtractBandFunction.js +1 -1
  81. package/layers/{support/rasterFunctions → raster/functions}/ExtractBandFunctionArguments.js +1 -1
  82. package/layers/{support/rasterFunctions → raster/functions}/GrayscaleFunction.js +1 -1
  83. package/layers/{support/rasterFunctions → raster/functions}/GrayscaleFunctionArguments.js +1 -1
  84. package/layers/raster/functions/HillshadeFunction.js +5 -0
  85. package/layers/{support/rasterFunctions → raster/functions}/HillshadeFunctionArguments.js +1 -1
  86. package/layers/raster/functions/LocalFunction.js +5 -0
  87. package/layers/{support/rasterFunctions → raster/functions}/LocalFunctionArguments.js +1 -1
  88. package/layers/{support/rasterFunctions → raster/functions}/MaskFunction.js +1 -1
  89. package/layers/{support/rasterFunctions → raster/functions}/MaskFunctionArguments.js +1 -1
  90. package/layers/{support/rasterFunctions → raster/functions}/NDVIFunction.js +1 -1
  91. package/layers/{support/rasterFunctions → raster/functions}/NDVIFunctionArguments.js +1 -1
  92. package/layers/raster/functions/RemapFunction.js +5 -0
  93. package/layers/{support/rasterFunctions → raster/functions}/RemapFunctionArguments.js +1 -1
  94. package/layers/raster/functions/ShadedReliefFunction.js +5 -0
  95. package/layers/{support/rasterFunctions → raster/functions}/ShadedReliefFunctionArguments.js +1 -1
  96. package/layers/raster/functions/SlopeFunction.js +5 -0
  97. package/layers/{support/rasterFunctions → raster/functions}/SlopeFunctionArguments.js +1 -1
  98. package/layers/raster/functions/StatisticsFunction.js +5 -0
  99. package/layers/{support/rasterFunctions → raster/functions}/StatisticsFunctionArguments.js +1 -1
  100. package/layers/{support/rasterFunctions → raster/functions}/StatisticsHistogramFunction.js +1 -1
  101. package/layers/{support/rasterFunctions → raster/functions}/StatisticsHistogramFunctionArguments.js +1 -1
  102. package/layers/raster/functions/StretchFunction.js +5 -0
  103. package/layers/{support/rasterFunctions → raster/functions}/StretchFunctionArguments.js +1 -1
  104. package/layers/{support/rasterFunctions → raster/functions}/TableFunction.js +1 -1
  105. package/layers/{support/rasterFunctions → raster/functions}/TableFunctionArguments.js +1 -1
  106. package/layers/raster/functions/bandIndexUtils.js +5 -0
  107. package/layers/raster/functions/changeDetectionUtils.js +5 -0
  108. package/layers/raster/functions/clipUtils.js +5 -0
  109. package/layers/raster/functions/conversionUtils.js +5 -0
  110. package/layers/raster/functions/convolutionUtils.js +5 -0
  111. package/layers/raster/functions/creators/createDataManagementFunctions.js +5 -0
  112. package/layers/raster/functions/creators/utils.js +5 -0
  113. package/layers/raster/functions/focalStatUtils.js +5 -0
  114. package/layers/raster/functions/localUtils.js +5 -0
  115. package/layers/raster/functions/pixelTransformUtils.js +5 -0
  116. package/layers/raster/functions/pixelUtils.js +5 -0
  117. package/layers/raster/functions/stretchUtils.js +5 -0
  118. package/layers/raster/functions/surfaceUtils.js +5 -0
  119. package/layers/raster/functions/vectorFieldUtils.js +5 -0
  120. package/layers/raster/transforms/BaseRasterTransform.js +5 -0
  121. package/layers/{support/rasterTransforms → raster/transforms}/GCSShiftTransform.js +1 -1
  122. package/layers/{support/rasterTransforms → raster/transforms}/IdentityTransform.js +1 -1
  123. package/layers/{support/rasterTransforms → raster/transforms}/PolynomialTransform.js +1 -1
  124. package/layers/save/imageryUtils.js +1 -1
  125. package/layers/support/PixelBlock.js +1 -1
  126. package/layers/support/RasterWorker.js +1 -1
  127. package/layers/support/imageryRendererUtils.js +1 -1
  128. package/layers/support/rasterFunctionUtils.js +1 -1
  129. package/package.json +2 -2
  130. package/renderers/VectorFieldRenderer.js +1 -1
  131. package/renderers/support/RasterSymbolizer.js +1 -1
  132. package/renderers/support/rasterRendererHelper.js +1 -1
  133. package/rest/locator/addressToLocations.js +1 -1
  134. package/rest/locator/addressesToLocations.js +1 -1
  135. package/rest/locator/suggestLocations.js +1 -1
  136. package/rest/networks/support/Association.js +1 -1
  137. package/rest/print.js +1 -1
  138. package/rest/support/LegendLayer.js +1 -1
  139. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  140. package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
  141. package/support/revision.js +1 -1
  142. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterRangeHighlightShader.js +1 -1
  144. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
  146. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  147. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  148. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  149. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  150. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  151. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  152. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  153. package/views/2d/layers/imagery/VectorFieldView2D.js +1 -1
  154. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  155. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  156. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  157. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  158. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  159. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
  160. package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +1 -1
  161. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  162. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  163. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  164. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
  165. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +1 -1
  166. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  167. package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
  168. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  169. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  170. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  171. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  172. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  173. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  174. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  175. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  176. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  177. package/views/3d/webgl-engine/materials/renderers/Instance.js +1 -1
  178. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  179. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  180. package/views/3d/webgl-engine/materials/renderers/PerOriginData.js +1 -1
  181. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  182. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  183. package/views/3d/webgl-engine/shaders/GaussianSplatColorTechnique.js +5 -0
  184. package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +5 -0
  185. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  186. package/views/DOMContainer.js +1 -1
  187. package/views/GroundView.js +1 -1
  188. package/views/layers/ImageryLayerViewMixin.js +1 -1
  189. package/views/layers/ImageryTileLayerViewMixin.js +1 -1
  190. package/views/support/imageReprojection.js +1 -1
  191. package/widgets/BatchAttributeForm.js +1 -1
  192. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  193. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  194. package/widgets/CoordinateConversion.js +1 -1
  195. package/widgets/DirectLineMeasurement3D.js +1 -1
  196. package/widgets/DistanceMeasurement2D.js +1 -1
  197. package/widgets/Editor/EditorViewModel.js +1 -1
  198. package/widgets/Editor.js +1 -1
  199. package/widgets/ElevationProfile.js +1 -1
  200. package/widgets/Feature.js +1 -1
  201. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  202. package/widgets/FeatureForm.js +1 -1
  203. package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
  204. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  205. package/widgets/FeatureTable/Grid/Column.js +1 -1
  206. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  207. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  208. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  209. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  210. package/widgets/FeatureTable/support/GroupColumnTemplate.js +1 -1
  211. package/widgets/FeatureTable/support/TableTemplate.js +1 -1
  212. package/widgets/FeatureTable.js +1 -1
  213. package/widgets/FeatureTemplates.js +1 -1
  214. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  215. package/widgets/Legend.js +1 -1
  216. package/widgets/LineOfSight.js +1 -1
  217. package/widgets/Locate.js +1 -1
  218. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  219. package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
  220. package/widgets/PanoramicViewer/support/importUtils.js +1 -1
  221. package/widgets/Print/CustomTemplate.js +1 -1
  222. package/widgets/Print/PrintViewModel.js +1 -1
  223. package/widgets/Print/TemplateOptions.js +1 -1
  224. package/widgets/Print.js +1 -1
  225. package/widgets/ScaleBar.js +1 -1
  226. package/widgets/ScaleRangeSlider.js +1 -1
  227. package/widgets/Search/SearchResultRenderer.js +1 -1
  228. package/widgets/Search/SearchViewModel.js +1 -1
  229. package/widgets/Search/types.js +1 -1
  230. package/widgets/Search.js +1 -1
  231. package/widgets/ShadowCast.js +1 -1
  232. package/widgets/Sketch/SketchViewModel.js +1 -1
  233. package/widgets/Sketch.js +1 -1
  234. package/assets/esri/core/workers/chunks/1f6ead46b723630db897.js +0 -1
  235. package/assets/esri/core/workers/chunks/3a16347e17312556e02c.js +0 -1
  236. package/assets/esri/core/workers/chunks/478def691ae6763686f3.js +0 -1
  237. package/assets/esri/core/workers/chunks/4c4a55be41ba105c091c.js +0 -1
  238. package/assets/esri/core/workers/chunks/4cbf5a97b2b3c6553f6f.js +0 -1
  239. package/assets/esri/core/workers/chunks/646f58b69d2354f1ef27.js +0 -1
  240. package/assets/esri/core/workers/chunks/93d11075f65a5b6625ea.js +0 -1
  241. package/assets/esri/core/workers/chunks/96f798ee286b59396131.js +0 -316
  242. package/assets/esri/core/workers/chunks/9f2a8445a5848502c7e7.js +0 -1
  243. package/assets/esri/core/workers/chunks/a1b08aab73747f4e7e25.js +0 -1
  244. package/assets/esri/core/workers/chunks/ba59568e748f0ba53b78.js +0 -1
  245. package/assets/esri/core/workers/chunks/f21cb5b34d4d1e3af1a9.js +0 -1
  246. package/assets/esri/core/workers/chunks/f93f0586ce10cb5d98b3.js +0 -1
  247. package/layers/support/rasterDatasets/BaseRaster.js +0 -5
  248. package/layers/support/rasterDatasets/CovJSONRaster.js +0 -5
  249. package/layers/support/rasterDatasets/FunctionRaster.js +0 -5
  250. package/layers/support/rasterDatasets/ImageAuxRaster.js +0 -5
  251. package/layers/support/rasterDatasets/ImageServerRaster.js +0 -5
  252. package/layers/support/rasterDatasets/InMemoryRaster.js +0 -5
  253. package/layers/support/rasterDatasets/MRFRaster.js +0 -5
  254. package/layers/support/rasterDatasets/RawBlockCache.js +0 -5
  255. package/layers/support/rasterDatasets/TIFFRaster.js +0 -5
  256. package/layers/support/rasterDatasets/WCSRaster.js +0 -5
  257. package/layers/support/rasterDatasets/covJSONParser.js +0 -5
  258. package/layers/support/rasterDatasets/multidimensionalUtils.js +0 -5
  259. package/layers/support/rasterDatasets/pamParser.js +0 -5
  260. package/layers/support/rasterDatasets/pixelReader.js +0 -5
  261. package/layers/support/rasterDatasets/wcsCoverageParser.js +0 -5
  262. package/layers/support/rasterFormats/Lerc.js +0 -5
  263. package/layers/support/rasterFormats/Qb3.js +0 -5
  264. package/layers/support/rasterFormats/RasterCodec.js +0 -5
  265. package/layers/support/rasterFormats/TiffDecoder.js +0 -5
  266. package/layers/support/rasterFunctions/ArithmeticFunction.js +0 -5
  267. package/layers/support/rasterFunctions/BandArithmeticFunction.js +0 -5
  268. package/layers/support/rasterFunctions/BaseRasterFunction.js +0 -5
  269. package/layers/support/rasterFunctions/ColormapFunction.js +0 -5
  270. package/layers/support/rasterFunctions/ColormapToRGBFunction.js +0 -5
  271. package/layers/support/rasterFunctions/CompositeBandFunction.js +0 -5
  272. package/layers/support/rasterFunctions/CompositeBandFunctionArguments.js +0 -5
  273. package/layers/support/rasterFunctions/ComputeChangeFunction.js +0 -5
  274. package/layers/support/rasterFunctions/ConvolutionFunction.js +0 -5
  275. package/layers/support/rasterFunctions/ConvolutionFunctionArguments.js +0 -5
  276. package/layers/support/rasterFunctions/HillshadeFunction.js +0 -5
  277. package/layers/support/rasterFunctions/LocalFunction.js +0 -5
  278. package/layers/support/rasterFunctions/RemapFunction.js +0 -5
  279. package/layers/support/rasterFunctions/ShadedReliefFunction.js +0 -5
  280. package/layers/support/rasterFunctions/SlopeFunction.js +0 -5
  281. package/layers/support/rasterFunctions/StatisticsFunction.js +0 -5
  282. package/layers/support/rasterFunctions/StretchFunction.js +0 -5
  283. package/layers/support/rasterFunctions/bandIndexUtils.js +0 -5
  284. package/layers/support/rasterFunctions/changeDetectionUtils.js +0 -5
  285. package/layers/support/rasterFunctions/clipUtils.js +0 -5
  286. package/layers/support/rasterFunctions/conversionUtils.js +0 -5
  287. package/layers/support/rasterFunctions/convolutionUtils.js +0 -5
  288. package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +0 -5
  289. package/layers/support/rasterFunctions/creators/utils.js +0 -5
  290. package/layers/support/rasterFunctions/focalStatUtils.js +0 -5
  291. package/layers/support/rasterFunctions/localUtils.js +0 -5
  292. package/layers/support/rasterFunctions/pixelTransformUtils.js +0 -5
  293. package/layers/support/rasterFunctions/pixelUtils.js +0 -5
  294. package/layers/support/rasterFunctions/stretchUtils.js +0 -5
  295. package/layers/support/rasterFunctions/surfaceUtils.js +0 -5
  296. package/layers/support/rasterFunctions/vectorFieldUtils.js +0 -5
  297. package/layers/support/rasterTransforms/BaseRasterTransform.js +0 -5
  298. /package/assets/esri/layers/{support/rasterFormats → raster/formats}/lerc-wasm.wasm +0 -0
  299. /package/assets/esri/layers/{support/rasterFormats → raster/formats}/qb3-wasm.wasm +0 -0
  300. /package/layers/{support/rasterDatasets → raster/datasets}/DBFParser.js +0 -0
  301. /package/layers/{support/rasterDatasets → raster/datasets}/EphemeralBlockCache.js +0 -0
  302. /package/layers/{support/rasterDatasets → raster/datasets}/RasterFactory.js +0 -0
  303. /package/layers/{support/rasterDatasets → raster/datasets}/byteStreamUtils.js +0 -0
  304. /package/layers/{support/rasterDatasets → raster/datasets}/datasetUtils.js +0 -0
  305. /package/layers/{support/rasterDatasets → raster/datasets}/multipartParser.js +0 -0
  306. /package/layers/{support/rasterDatasets → raster/datasets}/wcsCapabilitiesParser.js +0 -0
  307. /package/layers/{support/rasterDatasets → raster/datasets}/xmlUtilities.js +0 -0
  308. /package/layers/{support/rasterFormats → raster/formats}/ImageCanvasDecoder.js +0 -0
  309. /package/layers/{support/rasterFormats → raster/formats}/JpgPlus.js +0 -0
  310. /package/layers/{support/rasterFormats → raster/formats}/Lzw.js +0 -0
  311. /package/layers/{support/rasterFormats → raster/formats}/Raw.js +0 -0
  312. /package/layers/{support/rasterFormats → raster/formats}/pixelRangeUtils.js +0 -0
  313. /package/layers/{support/rasterFormats → raster/formats}/tiffTag.js +0 -0
  314. /package/layers/{support/rasterFormats → raster/formats}/utils.js +0 -0
  315. /package/layers/{support/rasterFunctions → raster/functions}/colormaps.js +0 -0
  316. /package/layers/{support/rasterFunctions → raster/functions}/creators/createAppearenceFunctions.js +0 -0
  317. /package/layers/{support/rasterFunctions → raster/functions}/creators/createBandIndexFunctions.js +0 -0
  318. /package/layers/{support/rasterFunctions → raster/functions}/creators/createChangeFunctions.js +0 -0
  319. /package/layers/{support/rasterFunctions → raster/functions}/creators/createConversionFunctions.js +0 -0
  320. /package/layers/{support/rasterFunctions → raster/functions}/creators/createLocalFunctions.js +0 -0
  321. /package/layers/{support/rasterFunctions → raster/functions}/creators/createMultiRasterAnalysisFunctions.js +0 -0
  322. /package/layers/{support/rasterFunctions → raster/functions}/creators/createStatisticsFunctions.js +0 -0
  323. /package/layers/{support/rasterFunctions → raster/functions}/creators/createSurfaceFunctions.js +0 -0
  324. /package/layers/{support/rasterFunctions → raster/functions}/customBandIndexUtils.js +0 -0
  325. /package/layers/{support/rasterFunctions → raster/functions}/mirror.js +0 -0
  326. /package/layers/{support/rasterFunctions → raster/functions}/rasterFunctionHelper.js +0 -0
  327. /package/layers/{support/rasterFunctions → raster/functions}/rasterFunctionSchema.js +0 -0
  328. /package/layers/{support/rasterFunctions → raster/functions}/rasterProjectionHelper.js +0 -0
  329. /package/layers/{support/rasterTransforms → raster/transforms}/utils.js +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4314],{4151:(t,e,s)=>{s.d(e,{z:()=>i});class i{constructor(t=null,e=null,s=null){this.minValue=t,this.maxValue=e,this.noDataValue=s}}},14140:(t,e,s)=>{s.d(e,{A:()=>f});var i,n=s(31635),r=s(49186),o=s(25482),l=s(4718),a=s(53966),h=s(91429),u=s(4151),c=s(16019);let f=class extends o.o{static{i=this}static createEmptyBand(t,e){return new(i.getPixelArrayConstructor(t))(e)}static combineBandMasks(t){if(t.length<2)return t[0];const e=t[0].length,s=new Uint8Array(e).fill(255);for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<e;t++)n[t]||(s[t]=0)}return s}static getPixelArrayConstructor(t){let e;switch(t){case"u1":case"u2":case"u4":case"u8":e=Uint8Array;break;case"u16":e=Uint16Array;break;case"u32":e=Uint32Array;break;case"s8":e=Int8Array;break;case"s16":e=Int16Array;break;case"s32":e=Int32Array;break;case"f32":case"c64":case"c128":case"unknown":e=Float32Array;break;case"f64":e=Float64Array}return e}constructor(t){super(t),this.width=null,this.height=null,this.pixelType="f32",this.validPixelCount=null,this.mask=null,this.maskIsAlpha=!1,this.premultiplyAlpha=!1,this.statistics=null,this.depthCount=1}castPixelType(t){if(!t)return"f32";let e=t.toLowerCase();return["u1","u2","u4"].includes(e)?e="u8":["unknown","u8","s8","u16","s16","u32","s32","f32","f64"].includes(e)||(e="f32"),e}getPlaneCount(){return this.pixels?.length}addData(t){if(!t.pixels||t.pixels.length!==this.width*this.height)throw new r.A("pixelblock:invalid-or-missing-pixels","add data requires valid pixels array that has same length defined by pixel block width * height");this.pixels||(this.pixels=[]),this.statistics||(this.statistics=[]),this.pixels.push(t.pixels),this.statistics.push(t.statistics??new u.z)}getAsRGBA(){const t=new ArrayBuffer(this.width*this.height*4);switch(this.pixelType){case"s8":case"s16":case"u16":case"s32":case"u32":case"f32":case"f64":this._fillFromNon8Bit(t);break;default:this._fillFrom8Bit(t)}return new Uint8ClampedArray(t)}getAsRGBAFloat(){const t=new Float32Array(this.width*this.height*4);return this._fillFrom32Bit(t),t}updateStatistics(){if(!this.pixels)return;this.statistics=this.pixels.map(t=>function(t,e){let s=1/0,i=-1/0;const n=t.length;let r,o=0;if(null!=e)for(r=0;r<n;r++)e[r]&&(o=t[r],s=o<s?o:s,i=o>i?o:i);else for(r=0;r<n;r++)o=t[r],s=o<s?o:s,i=o>i?o:i;return new u.z(s,i)}(t,this.mask));const t=this.mask;let e=0;if(null!=t)for(let s=0;s<t.length;s++)t[s]&&e++;else e=this.width*this.height;this.validPixelCount=e}clamp(t){if(!t||"f64"===t||"f32"===t||!this.pixels)return;const[e,s]=(0,c.hP)(t),n=this.pixels,r=this.width*this.height,o=n.length;let l,a,h;const u=[];for(let c=0;c<o;c++){h=i.createEmptyBand(t,r),l=n[c];for(let t=0;t<r;t++)a=l[t],h[t]=a>s?s:a<e?e:a;u.push(h)}this.pixels=u,this.pixelType=t}extractBands(t){const{pixels:e,statistics:s}=this;if(null==t||0===t.length||!e||0===e.length)return this;const n=e.length,r=t.some(t=>t>=e.length),o=n===t.length&&!t.some((t,e)=>t!==e);if(r||o)return this;const l=this.bandMasks?.length===n?t.map(t=>this.bandMasks[t]):void 0;let{mask:a,validPixelCount:h}=this;const{width:u,height:c}=this;return l?.length&&(a=i.combineBandMasks(l),h=a.filter(t=>!!t).length),new i({pixelType:this.pixelType,width:u,height:c,mask:a,bandMasks:l,validPixelCount:h,maskIsAlpha:this.maskIsAlpha,pixels:t.map(t=>e[t]),statistics:s&&t.map(t=>s[t])})}clone(){const t=new i({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount,premultiplyAlpha:this.premultiplyAlpha,depthCount:this.depthCount});let e;null!=this.mask&&(t.mask=new Uint8Array(this.mask)),this.noDataValues&&(t.noDataValues=[...this.noDataValues]),this.bandMasks&&(t.bandMasks=this.bandMasks.map(t=>new Uint8Array(t)));const s=i.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const i=!!this.pixels[0].slice;for(e=0;e<this.pixels.length;e++)t.pixels[e]=i?this.pixels[e].slice():new s(this.pixels[e])}if(this.statistics)for(t.statistics=[],e=0;e<this.statistics.length;e++)t.statistics[e]=(0,l.o8)(this.statistics[e]);return t}getTransferableObject(){const{pixels:t,bandMasks:e,mask:s}=this;this.pixels=[],this.bandMasks=void 0,this.mask=void 0;const i=this.toJSON();this.pixels=t,this.bandMasks=e,this.mask=s,i.pixels=t?[...t]:t,i.bandMasks=e?[...e]:e,i.mask=s;const n=[];return[...t??[],s,...e??[]].filter(t=>null!=t&&ArrayBuffer.isView(t)).forEach(t=>{t&&!n.includes(t.buffer)&&n.push(t.buffer)}),{pixelBlock:i,transferList:n}}_fillFrom8Bit(t){const{mask:e,maskIsAlpha:s,premultiplyAlpha:i,pixels:n}=this;if(!t||!n?.length)return void a.A.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.");let r,o,l,h;r=o=l=n[0],n.length>=3?(o=n[1],l=n[2]):2===n.length&&(o=n[1]);const u=new Uint32Array(t),c=this.width*this.height;if(r.length===c)if(null!=e&&e.length===c)if(s)for(h=0;h<c;h++){const t=e[h];if(t){const e=t/255;u[h]=i?t<<24|l[h]*e<<16|o[h]*e<<8|r[h]*e:t<<24|l[h]<<16|o[h]<<8|r[h]}}else for(h=0;h<c;h++)e[h]&&(u[h]=255<<24|l[h]<<16|o[h]<<8|r[h]);else for(h=0;h<c;h++)u[h]=255<<24|l[h]<<16|o[h]<<8|r[h];else a.A.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.")}_fillFromNon8Bit(t){const{pixels:e,mask:s,statistics:i}=this;if(!t||!e?.length)return void a.A.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.");const n=this.pixelType;let r=1,o=0,l=1;if(i&&i.length>0){for(const t of i)if(null!=t.minValue&&(o=Math.min(o,t.minValue)),null!=t.maxValue&&null!=t.minValue){const e=t.maxValue-t.minValue;l=Math.max(l,e)}r=255/l}else{let t=255;"s8"===n?(o=-128,t=127):"u16"===n?t=65535:"s16"===n?(o=-32768,t=32767):"u32"===n?t=4294967295:"s32"===n?(o=-2147483648,t=2147483647):"f32"===n?(o=-34e38,t=34e38):"f64"===n&&(o=-Number.MAX_VALUE,t=Number.MAX_VALUE),r=255/(t-o)}const h=new Uint32Array(t),u=this.width*this.height;let c,f,p,g,d;if(c=f=p=e[0],c.length!==u)return a.A.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(f=e[1],e.length>=3&&(p=e[2]),null!=s&&s.length===u)for(g=0;g<u;g++)s[g]&&(h[g]=255<<24|(p[g]-o)*r<<16|(f[g]-o)*r<<8|(c[g]-o)*r);else for(g=0;g<u;g++)h[g]=255<<24|(p[g]-o)*r<<16|(f[g]-o)*r<<8|(c[g]-o)*r;else if(null!=s&&s.length===u)for(g=0;g<u;g++)d=(c[g]-o)*r,s[g]&&(h[g]=255<<24|d<<16|d<<8|d);else for(g=0;g<u;g++)d=(c[g]-o)*r,h[g]=255<<24|d<<16|d<<8|d}_fillFrom32Bit(t){const{pixels:e,mask:s}=this;if(!t||!e?.length)return a.A.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The input pixel block is empty.");let i,n,r,o;i=n=r=e[0],e.length>=3?(n=e[1],r=e[2]):2===e.length&&(n=e[1]);const l=this.width*this.height;if(i.length!==l)return a.A.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let h=0;if(null!=s&&s.length===l)for(o=0;o<l;o++)t[h++]=i[o],t[h++]=n[o],t[h++]=r[o],t[h++]=1&s[o];else for(o=0;o<l;o++)t[h++]=i[o],t[h++]=n[o],t[h++]=r[o],t[h++]=1}};(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"width",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"height",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"pixelType",void 0),(0,n.Cg)([(0,h.wg)("pixelType")],f.prototype,"castPixelType",null),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"validPixelCount",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"mask",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"maskIsAlpha",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"pixels",void 0),(0,n.Cg)([(0,h.MZ)()],f.prototype,"premultiplyAlpha",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"statistics",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"depthCount",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"noDataValues",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"bandMasks",void 0),f=i=(0,n.Cg)([(0,h.$K)("esri.layers.support.PixelBlock")],f)},16019:(t,e,s)=>{s.d(e,{$p:()=>u,Sp:()=>c,X1:()=>l,hP:()=>o,yM:()=>h,zw:()=>a});const i=9999999e31,n=2e-7,r={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function o(t){return r[t]??[-34028234663852886e22,34028234663852886e22]}function l(t,e){return null==t||null==e?"s32":t<0?t>=-128&&e<128?"s8":t>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function a(t){return(t?.startsWith("s")||t?.startsWith("u"))??!1}function h(t,e,s,i){let[n,r]=o(s);const l=a(s);return l&&(n-=1e-5,r+=1e-5),l?s.startsWith("u")?function(t,e,s,i){const[n,r]=i;for(let i=0;i<e.length;i++)if(e[i]){const o=t[i];o<n||o>r?e[i]=0:s[i]=o+.5|0}}(t,e,i,[n,r]):function(t,e,s,i){const[n,r]=i;for(let i=0;i<e.length;i++)if(e[i]){const o=t[i];o<n||o>r?e[i]=0:s[i]=o+(o>0?.5:-.5)|0}}(t,e,i,[n,r]):function(t,e,s,i){const[n,r]=i;for(let i=0;i<e.length;i++)if(e[i]){const o=t[i];o<n||o>r?e[i]=0:s[i]=o}}(t,e,i,[n,r])}function u(t,e){for(let s=0;s<e.length;s++)e[s]&&isNaN(t[s])&&(e[s]=0,t[s]=0)}function c(t,e,s){if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:l,pixelType:a}=t,h=r[0].length,u=t.bandMasks??[],c=t.mask??new Uint8Array(h).fill(255),f="f32"===a||"f64"===a,p=o(a);let g=!1;for(let t=0;t<r.length;t++){const o="number"==typeof e?e:e[t];if(null==o)continue;const h=l?.[t]?.minValue??p[0],d=l?.[t]?.maxValue??p[1];if(h>o+Number.EPSILON||d<o-Number.EPSILON)continue;const m=u[t]||c.slice(),y=r[t],b=s?.customFloatTolerance;if(f&&0!==b){let t=b;t||(t=Math.abs(o)>=i?n*Math.abs(o):"f32"===a?2**-23:Number.EPSILON);for(let e=0;e<y.length;e++)m[e]&&Math.abs(y[e]-o)<t&&(y[e]=0,m[e]=0,c[e]=0,g=!0)}else for(let t=0;t<y.length;t++)m[t]&&y[t]===o&&(y[t]=0,m[t]=0,c[t]=0,g=!0);u[t]=m}if(g){const e=t.bandMasks||t.pixels.length>1?u:null;s?.matchAllNoData?t.mask=e&&e.length>1?function(t){if(t.length<2)return t[0];const e=t[0].length,s=new Uint8Array(e).fill(0);for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<e;t++)n[t]&&(s[t]=255)}return s}(e):c:(t.bandMasks=e,t.mask=c)}g&&"updateStatistics"in t&&t.updateStatistics()}},31635:(t,e,s)=>{function i(t,e,s,i){var n,r=arguments.length,o=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,s,o):n(e,s))||o);return r>3&&o&&Object.defineProperty(e,s,o),o}function n(t,e,s){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,n;if(s){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],s&&(n=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");n&&(i=function(){try{n.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:s})}else s&&t.stack.push({async:!0});return e}s.d(e,{Cg:()=>i,hk:()=>o,mS:()=>n}),Object.create,Object.create;var r="function"==typeof SuppressedError?SuppressedError:function(t,e,s){var i=new Error(s);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};function o(t){function e(e){t.error=t.hasError?new r(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}var s,i=0;return function n(){for(;s=t.stack.pop();)try{if(!s.async&&1===i)return i=0,t.stack.push(s),Promise.resolve().then(n);if(s.dispose){var r=s.dispose.call(s.value);if(s.async)return i|=2,Promise.resolve(r).then(n,function(t){return e(t),n()})}else i|=1}catch(t){e(t)}if(1===i)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}},34727:(t,e,s)=>{s.d(e,{$8:()=>M,Cc:()=>o,Hx:()=>d,Io:()=>x,KJ:()=>h,OS:()=>B,Sp:()=>f,XM:()=>u,YN:()=>c,ZH:()=>g,b6:()=>k,cU:()=>n,gg:()=>p,hs:()=>l,kU:()=>a,or:()=>C,pF:()=>F,pq:()=>P,qE:()=>r});const i=new Float32Array(1);function n(t){--t;for(let e=1;e<32;e<<=1)t|=t>>e;return t+1}function r(t,e,s){return Math.min(Math.max(t,e),s)}function o(t,e,s){return t+(e-t)*s}function l(t,e,s,i,n){return o(i,n,(t-e)/(s-e))}function a(t){return t*Math.PI/180}function h(t){return 180*t/Math.PI}function u(t){return Math.acos(r(t,-1,1))}function c(t){return Math.asin(r(t,-1,1))}function f(t,e,s=1e-6){return t===e||!(!Number.isFinite(t)||!Number.isFinite(e))&&(t>e?t-e:e-t)<=s}function p(t,e,s=1e-6){return!f(t,e,s)&&t>e}function g(t,e,s=1e-6){return!f(t,e,s)&&t<e}function d(t,e,s=1e-6){return f(t,e,s)||t>e}const m=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function y(t){return m.setFloat64(0,t),m.getBigInt64(0)}const b=1000000n,A=w(1);function w(t){const e=y(t=Math.abs(t)),s=function(t){return m.setBigInt64(0,t),m.getFloat64(0)}(e<=b?b:e-b);return Math.abs(t-s)}function x(t,e,s=A){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;if(null!=s&&w(Math.min(Math.abs(t),Math.abs(e)))<s)return Math.abs(t-e)<=s;const i=y(t),n=y(e);return i<0==n<0&&!((i<n?n-i:i-n)>b)}function k(t,e,s=1e-6){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;const i=Math.abs(t-e),n=Math.abs(t),r=Math.abs(e);if(0===t||0===e||n<1e-12&&r<1e-12){if(i>.01*s)return!1}else if(i/(n+r)>s)return!1;return!0}function M(t){return v(Math.max(-P,Math.min(t,P)))}function v(t){return i[0]=t,i[0]}function C(t){const e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],i=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(f(e,1)&&f(s,1)&&f(i,1))}function B(t,e){return(t%e+e)%e}const P=v(34028234663852886e22);function F(t,e,s){if(void 0===s||0===+s)return Math[t](e);if(e=+e,s=+s,isNaN(e)||"number"!=typeof s||s%1!=0)return NaN;let i=e.toString().split("e");return i=(e=Math[t](+(i[0]+"e"+(i[1]?+i[1]-s:-s)))).toString().split("e"),+(i[0]+"e"+(i[1]?+i[1]+s:s))}},91869:(t,e,s)=>{function i(t,e){for(const s of t.values())if(e(s))return!0;return!1}function n(t,e,s){const i=t.get(e);if(void 0!==i)return i;const n=s();return t.set(e,n),n}function r(t){const e=new Map;return s=>(e.has(s)||e.set(s,t(s)),e.get(s))}s.d(e,{Bj:()=>r,Bs:()=>i,tE:()=>n})},96982:(t,e,s)=>{s.r(e),s.d(e,{convertPixelBlockToImageData:()=>o,getFacesWithVertexAttributes:()=>r,recomputePositions:()=>l});var i=s(34727),n=s(14140);function r({distance:t,yaw:e,horizontalFieldOfView:s,pitch:n,verticalFieldOfView:r,origin:o=[0,0,0],positionLength:l=25}){const a=l-1,h=l*l,u=new Float32Array(2*h),c=new Float64Array(3*h),f=new Float32Array(3*h).fill(0),p=new Uint32Array(a**2*6);for(let g=0,d=0;g<h;g++){const h=Math.floor(g/l),m=g%l,y=1-m/a,b=h/a,A=2*g,w=3*g;u[A]=y,u[A+1]=b;const x=n+r/2-b*r,k=(0,i.kU)(e-s/2+y*s),M=(0,i.kU)(x),v=Math.sin(M),C=Math.cos(M),B=[v*Math.sin(k),Math.cos(k)*v,-C];c[w]=o[0]+t*B[0],c[w+1]=o[1]+t*B[1],c[w+2]=o[2]+t*B[2],f[w]=-B[0],f[w+1]=-B[1],f[w+2]=-B[2],h!==a&&m!==a&&(p[d++]=g,p[d++]=g+l,p[d++]=g+l+1,p[d++]=g,p[d++]=g+l+1,p[d++]=g+1)}return{result:{position:c,uv:u,normal:f,faces:p},transferList:[c.buffer,u.buffer,f.buffer,p?.buffer]}}function o(t){const e=n.A.fromJSON(t);e.premultiplyAlpha=!0;const s=e.getAsRGBA(),i=e.width,r=e.height,o=new ImageData(s,i,r);return{result:o,transferList:[o.data.buffer]}}function l({oldDistance:t,newDistance:e,position:s,origin:i=[0,0,0]}){const n=s.length/3;for(let r=0;r<n;r+=3){const n=3*r;s[n]=i[0]+(s[n]-i[0])*(e/t),s[n+1]=i[1]+(s[n+1]-i[1])*(e/t),s[n+2]=i[2]+(s[n+2]-i[2])*(e/t)}return{result:s,transferList:[s.buffer]}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4314],{4151:(t,e,s)=>{s.d(e,{z:()=>i});class i{constructor(t=null,e=null,s=null){this.minValue=t,this.maxValue=e,this.noDataValue=s}}},14140:(t,e,s)=>{s.d(e,{A:()=>f});var i,n=s(31635),r=s(49186),o=s(25482),l=s(4718),a=s(53966),h=s(91429),u=s(94778),c=s(4151);let f=class extends o.o{static{i=this}static createEmptyBand(t,e){return new(i.getPixelArrayConstructor(t))(e)}static combineBandMasks(t){if(t.length<2)return t[0];const e=t[0].length,s=new Uint8Array(e).fill(255);for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<e;t++)n[t]||(s[t]=0)}return s}static getPixelArrayConstructor(t){let e;switch(t){case"u1":case"u2":case"u4":case"u8":e=Uint8Array;break;case"u16":e=Uint16Array;break;case"u32":e=Uint32Array;break;case"s8":e=Int8Array;break;case"s16":e=Int16Array;break;case"s32":e=Int32Array;break;case"f32":case"c64":case"c128":case"unknown":e=Float32Array;break;case"f64":e=Float64Array}return e}constructor(t){super(t),this.width=null,this.height=null,this.pixelType="f32",this.validPixelCount=null,this.mask=null,this.maskIsAlpha=!1,this.premultiplyAlpha=!1,this.statistics=null,this.depthCount=1}castPixelType(t){if(!t)return"f32";let e=t.toLowerCase();return["u1","u2","u4"].includes(e)?e="u8":["unknown","u8","s8","u16","s16","u32","s32","f32","f64"].includes(e)||(e="f32"),e}getPlaneCount(){return this.pixels?.length}addData(t){if(!t.pixels||t.pixels.length!==this.width*this.height)throw new r.A("pixelblock:invalid-or-missing-pixels","add data requires valid pixels array that has same length defined by pixel block width * height");this.pixels||(this.pixels=[]),this.statistics||(this.statistics=[]),this.pixels.push(t.pixels),this.statistics.push(t.statistics??new c.z)}getAsRGBA(){const t=new ArrayBuffer(this.width*this.height*4);switch(this.pixelType){case"s8":case"s16":case"u16":case"s32":case"u32":case"f32":case"f64":this._fillFromNon8Bit(t);break;default:this._fillFrom8Bit(t)}return new Uint8ClampedArray(t)}getAsRGBAFloat(){const t=new Float32Array(this.width*this.height*4);return this._fillFrom32Bit(t),t}updateStatistics(){if(!this.pixels)return;this.statistics=this.pixels.map(t=>function(t,e){let s=1/0,i=-1/0;const n=t.length;let r,o=0;if(null!=e)for(r=0;r<n;r++)e[r]&&(o=t[r],s=o<s?o:s,i=o>i?o:i);else for(r=0;r<n;r++)o=t[r],s=o<s?o:s,i=o>i?o:i;return new c.z(s,i)}(t,this.mask));const t=this.mask;let e=0;if(null!=t)for(let s=0;s<t.length;s++)t[s]&&e++;else e=this.width*this.height;this.validPixelCount=e}clamp(t){if(!t||"f64"===t||"f32"===t||!this.pixels)return;const[e,s]=(0,u.hP)(t),n=this.pixels,r=this.width*this.height,o=n.length;let l,a,h;const c=[];for(let u=0;u<o;u++){h=i.createEmptyBand(t,r),l=n[u];for(let t=0;t<r;t++)a=l[t],h[t]=a>s?s:a<e?e:a;c.push(h)}this.pixels=c,this.pixelType=t}extractBands(t){const{pixels:e,statistics:s}=this;if(null==t||0===t.length||!e||0===e.length)return this;const n=e.length,r=t.some(t=>t>=e.length),o=n===t.length&&!t.some((t,e)=>t!==e);if(r||o)return this;const l=this.bandMasks?.length===n?t.map(t=>this.bandMasks[t]):void 0;let{mask:a,validPixelCount:h}=this;const{width:u,height:c}=this;return l?.length&&(a=i.combineBandMasks(l),h=a.filter(t=>!!t).length),new i({pixelType:this.pixelType,width:u,height:c,mask:a,bandMasks:l,validPixelCount:h,maskIsAlpha:this.maskIsAlpha,pixels:t.map(t=>e[t]),statistics:s&&t.map(t=>s[t])})}clone(){const t=new i({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount,premultiplyAlpha:this.premultiplyAlpha,depthCount:this.depthCount});let e;null!=this.mask&&(t.mask=new Uint8Array(this.mask)),this.noDataValues&&(t.noDataValues=[...this.noDataValues]),this.bandMasks&&(t.bandMasks=this.bandMasks.map(t=>new Uint8Array(t)));const s=i.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const i=!!this.pixels[0].slice;for(e=0;e<this.pixels.length;e++)t.pixels[e]=i?this.pixels[e].slice():new s(this.pixels[e])}if(this.statistics)for(t.statistics=[],e=0;e<this.statistics.length;e++)t.statistics[e]=(0,l.o8)(this.statistics[e]);return t}getTransferableObject(){const{pixels:t,bandMasks:e,mask:s}=this;this.pixels=[],this.bandMasks=void 0,this.mask=void 0;const i=this.toJSON();this.pixels=t,this.bandMasks=e,this.mask=s,i.pixels=t?[...t]:t,i.bandMasks=e?[...e]:e,i.mask=s;const n=[];return[...t??[],s,...e??[]].filter(t=>null!=t&&ArrayBuffer.isView(t)).forEach(t=>{t&&!n.includes(t.buffer)&&n.push(t.buffer)}),{pixelBlock:i,transferList:n}}_fillFrom8Bit(t){const{mask:e,maskIsAlpha:s,premultiplyAlpha:i,pixels:n}=this;if(!t||!n?.length)return void a.A.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.");let r,o,l,h;r=o=l=n[0],n.length>=3?(o=n[1],l=n[2]):2===n.length&&(o=n[1]);const u=new Uint32Array(t),c=this.width*this.height;if(r.length===c)if(null!=e&&e.length===c)if(s)for(h=0;h<c;h++){const t=e[h];if(t){const e=t/255;u[h]=i?t<<24|l[h]*e<<16|o[h]*e<<8|r[h]*e:t<<24|l[h]<<16|o[h]<<8|r[h]}}else for(h=0;h<c;h++)e[h]&&(u[h]=255<<24|l[h]<<16|o[h]<<8|r[h]);else for(h=0;h<c;h++)u[h]=255<<24|l[h]<<16|o[h]<<8|r[h];else a.A.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.")}_fillFromNon8Bit(t){const{pixels:e,mask:s,statistics:i}=this;if(!t||!e?.length)return void a.A.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.");const n=this.pixelType;let r=1,o=0,l=1;if(i&&i.length>0){for(const t of i)if(null!=t.minValue&&(o=Math.min(o,t.minValue)),null!=t.maxValue&&null!=t.minValue){const e=t.maxValue-t.minValue;l=Math.max(l,e)}r=255/l}else{let t=255;"s8"===n?(o=-128,t=127):"u16"===n?t=65535:"s16"===n?(o=-32768,t=32767):"u32"===n?t=4294967295:"s32"===n?(o=-2147483648,t=2147483647):"f32"===n?(o=-34e38,t=34e38):"f64"===n&&(o=-Number.MAX_VALUE,t=Number.MAX_VALUE),r=255/(t-o)}const h=new Uint32Array(t),u=this.width*this.height;let c,f,p,g,d;if(c=f=p=e[0],c.length!==u)return a.A.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(f=e[1],e.length>=3&&(p=e[2]),null!=s&&s.length===u)for(g=0;g<u;g++)s[g]&&(h[g]=255<<24|(p[g]-o)*r<<16|(f[g]-o)*r<<8|(c[g]-o)*r);else for(g=0;g<u;g++)h[g]=255<<24|(p[g]-o)*r<<16|(f[g]-o)*r<<8|(c[g]-o)*r;else if(null!=s&&s.length===u)for(g=0;g<u;g++)d=(c[g]-o)*r,s[g]&&(h[g]=255<<24|d<<16|d<<8|d);else for(g=0;g<u;g++)d=(c[g]-o)*r,h[g]=255<<24|d<<16|d<<8|d}_fillFrom32Bit(t){const{pixels:e,mask:s}=this;if(!t||!e?.length)return a.A.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The input pixel block is empty.");let i,n,r,o;i=n=r=e[0],e.length>=3?(n=e[1],r=e[2]):2===e.length&&(n=e[1]);const l=this.width*this.height;if(i.length!==l)return a.A.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let h=0;if(null!=s&&s.length===l)for(o=0;o<l;o++)t[h++]=i[o],t[h++]=n[o],t[h++]=r[o],t[h++]=1&s[o];else for(o=0;o<l;o++)t[h++]=i[o],t[h++]=n[o],t[h++]=r[o],t[h++]=1}};(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"width",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"height",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"pixelType",void 0),(0,n.Cg)([(0,h.wg)("pixelType")],f.prototype,"castPixelType",null),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"validPixelCount",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"mask",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"maskIsAlpha",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"pixels",void 0),(0,n.Cg)([(0,h.MZ)()],f.prototype,"premultiplyAlpha",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"statistics",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"depthCount",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"noDataValues",void 0),(0,n.Cg)([(0,h.MZ)({json:{write:!0}})],f.prototype,"bandMasks",void 0),f=i=(0,n.Cg)([(0,h.$K)("esri.layers.support.PixelBlock")],f)},31635:(t,e,s)=>{function i(t,e,s,i){var n,r=arguments.length,o=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,s,o):n(e,s))||o);return r>3&&o&&Object.defineProperty(e,s,o),o}function n(t,e,s){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var i,n;if(s){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],s&&(n=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");n&&(i=function(){try{n.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:i,async:s})}else s&&t.stack.push({async:!0});return e}s.d(e,{Cg:()=>i,hk:()=>o,mS:()=>n}),Object.create,Object.create;var r="function"==typeof SuppressedError?SuppressedError:function(t,e,s){var i=new Error(s);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};function o(t){function e(e){t.error=t.hasError?new r(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}var s,i=0;return function n(){for(;s=t.stack.pop();)try{if(!s.async&&1===i)return i=0,t.stack.push(s),Promise.resolve().then(n);if(s.dispose){var r=s.dispose.call(s.value);if(s.async)return i|=2,Promise.resolve(r).then(n,function(t){return e(t),n()})}else i|=1}catch(t){e(t)}if(1===i)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}},34727:(t,e,s)=>{s.d(e,{$8:()=>M,Cc:()=>o,Hx:()=>d,Io:()=>x,KJ:()=>h,OS:()=>B,Sp:()=>f,XM:()=>u,YN:()=>c,ZH:()=>g,b6:()=>k,cU:()=>n,gg:()=>p,hs:()=>l,kU:()=>a,or:()=>C,pF:()=>F,pq:()=>P,qE:()=>r});const i=new Float32Array(1);function n(t){--t;for(let e=1;e<32;e<<=1)t|=t>>e;return t+1}function r(t,e,s){return Math.min(Math.max(t,e),s)}function o(t,e,s){return t+(e-t)*s}function l(t,e,s,i,n){return o(i,n,(t-e)/(s-e))}function a(t){return t*Math.PI/180}function h(t){return 180*t/Math.PI}function u(t){return Math.acos(r(t,-1,1))}function c(t){return Math.asin(r(t,-1,1))}function f(t,e,s=1e-6){return t===e||!(!Number.isFinite(t)||!Number.isFinite(e))&&(t>e?t-e:e-t)<=s}function p(t,e,s=1e-6){return!f(t,e,s)&&t>e}function g(t,e,s=1e-6){return!f(t,e,s)&&t<e}function d(t,e,s=1e-6){return f(t,e,s)||t>e}const m=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function y(t){return m.setFloat64(0,t),m.getBigInt64(0)}const b=1000000n,A=w(1);function w(t){const e=y(t=Math.abs(t)),s=function(t){return m.setBigInt64(0,t),m.getFloat64(0)}(e<=b?b:e-b);return Math.abs(t-s)}function x(t,e,s=A){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;if(null!=s&&w(Math.min(Math.abs(t),Math.abs(e)))<s)return Math.abs(t-e)<=s;const i=y(t),n=y(e);return i<0==n<0&&!((i<n?n-i:i-n)>b)}function k(t,e,s=1e-6){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;const i=Math.abs(t-e),n=Math.abs(t),r=Math.abs(e);if(0===t||0===e||n<1e-12&&r<1e-12){if(i>.01*s)return!1}else if(i/(n+r)>s)return!1;return!0}function M(t){return v(Math.max(-P,Math.min(t,P)))}function v(t){return i[0]=t,i[0]}function C(t){const e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],i=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(f(e,1)&&f(s,1)&&f(i,1))}function B(t,e){return(t%e+e)%e}const P=v(34028234663852886e22);function F(t,e,s){if(void 0===s||0===+s)return Math[t](e);if(e=+e,s=+s,isNaN(e)||"number"!=typeof s||s%1!=0)return NaN;let i=e.toString().split("e");return i=(e=Math[t](+(i[0]+"e"+(i[1]?+i[1]-s:-s)))).toString().split("e"),+(i[0]+"e"+(i[1]?+i[1]+s:s))}},91869:(t,e,s)=>{function i(t,e){for(const s of t.values())if(e(s))return!0;return!1}function n(t,e,s){const i=t.get(e);if(void 0!==i)return i;const n=s();return t.set(e,n),n}function r(t){const e=new Map;return s=>(e.has(s)||e.set(s,t(s)),e.get(s))}s.d(e,{Bj:()=>r,Bs:()=>i,tE:()=>n})},94778:(t,e,s)=>{s.d(e,{$p:()=>u,Sp:()=>c,X1:()=>l,hP:()=>o,yM:()=>h,zw:()=>a});const i=9999999e31,n=2e-7,r={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function o(t){return r[t]??[-34028234663852886e22,34028234663852886e22]}function l(t,e){return null==t||null==e?"s32":t<0?t>=-128&&e<128?"s8":t>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function a(t){return(t?.startsWith("s")||t?.startsWith("u"))??!1}function h(t,e,s,i){let[n,r]=o(s);const l=a(s);return l&&(n-=1e-5,r+=1e-5),l?s.startsWith("u")?function(t,e,s,i){const[n,r]=i;for(let i=0;i<e.length;i++)if(e[i]){const o=t[i];o<n||o>r?e[i]=0:s[i]=o+.5|0}}(t,e,i,[n,r]):function(t,e,s,i){const[n,r]=i;for(let i=0;i<e.length;i++)if(e[i]){const o=t[i];o<n||o>r?e[i]=0:s[i]=o+(o>0?.5:-.5)|0}}(t,e,i,[n,r]):function(t,e,s,i){const[n,r]=i;for(let i=0;i<e.length;i++)if(e[i]){const o=t[i];o<n||o>r?e[i]=0:s[i]=o}}(t,e,i,[n,r])}function u(t,e){for(let s=0;s<e.length;s++)e[s]&&isNaN(t[s])&&(e[s]=0,t[s]=0)}function c(t,e,s){if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:l,pixelType:a}=t,h=r[0].length,u=t.bandMasks??[],c=t.mask??new Uint8Array(h).fill(255),f="f32"===a||"f64"===a,p=o(a);let g=!1;for(let t=0;t<r.length;t++){const o="number"==typeof e?e:e[t];if(null==o)continue;const h=l?.[t]?.minValue??p[0],d=l?.[t]?.maxValue??p[1];if(h>o+Number.EPSILON||d<o-Number.EPSILON)continue;const m=u[t]||c.slice(),y=r[t],b=s?.customFloatTolerance;if(f&&0!==b){let t=b;t||(t=Math.abs(o)>=i?n*Math.abs(o):"f32"===a?2**-23:Number.EPSILON);for(let e=0;e<y.length;e++)m[e]&&Math.abs(y[e]-o)<t&&(y[e]=0,m[e]=0,c[e]=0,g=!0)}else for(let t=0;t<y.length;t++)m[t]&&y[t]===o&&(y[t]=0,m[t]=0,c[t]=0,g=!0);u[t]=m}if(g){const e=t.bandMasks||t.pixels.length>1?u:null;s?.matchAllNoData?t.mask=e&&e.length>1?function(t){if(t.length<2)return t[0];const e=t[0].length,s=new Uint8Array(e).fill(0);for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<e;t++)n[t]&&(s[t]=255)}return s}(e):c:(t.bandMasks=e,t.mask=c)}g&&"updateStatistics"in t&&t.updateStatistics()}},96982:(t,e,s)=>{s.r(e),s.d(e,{convertPixelBlockToImageData:()=>o,getFacesWithVertexAttributes:()=>r,recomputePositions:()=>l});var i=s(34727),n=s(14140);function r({distance:t,yaw:e,horizontalFieldOfView:s,pitch:n,verticalFieldOfView:r,origin:o=[0,0,0],positionLength:l=25}){const a=l-1,h=l*l,u=new Float32Array(2*h),c=new Float64Array(3*h),f=new Float32Array(3*h).fill(0),p=new Uint32Array(a**2*6);for(let g=0,d=0;g<h;g++){const h=Math.floor(g/l),m=g%l,y=1-m/a,b=h/a,A=2*g,w=3*g;u[A]=y,u[A+1]=b;const x=n+r/2-b*r,k=(0,i.kU)(e-s/2+y*s),M=(0,i.kU)(x),v=Math.sin(M),C=Math.cos(M),B=[v*Math.sin(k),Math.cos(k)*v,-C];c[w]=o[0]+t*B[0],c[w+1]=o[1]+t*B[1],c[w+2]=o[2]+t*B[2],f[w]=-B[0],f[w+1]=-B[1],f[w+2]=-B[2],h!==a&&m!==a&&(p[d++]=g,p[d++]=g+l,p[d++]=g+l+1,p[d++]=g,p[d++]=g+l+1,p[d++]=g+1)}return{result:{position:c,uv:u,normal:f,faces:p},transferList:[c.buffer,u.buffer,f.buffer,p?.buffer]}}function o(t){const e=n.A.fromJSON(t);e.premultiplyAlpha=!0;const s=e.getAsRGBA(),i=e.width,r=e.height,o=new ImageData(s,i,r);return{result:o,transferList:[o.data.buffer]}}function l({oldDistance:t,newDistance:e,position:s,origin:i=[0,0,0]}){const n=s.length/3;for(let r=0;r<n;r+=3){const n=3*r;s[n]=i[0]+(s[n]-i[0])*(e/t),s[n+1]=i[1]+(s[n+1]-i[1])*(e/t),s[n+2]=i[2]+(s[n+2]-i[2])*(e/t)}return{result:s,transferList:[s.buffer]}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5710,9933],{4513:(e,a,r)=>{r.d(a,{S:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(3508),r.e(6554),r.e(9036)]).then(r.bind(r,17029))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(7330),r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(1017),r.e(957),r.e(9708),r.e(8654),r.e(6647),r.e(6673),r.e(7005),r.e(8570),r.e(6011),r.e(8993),r.e(1437)]).then(r.bind(r,82411))).default,CSVLayer:async()=>(await Promise.all([r.e(7330),r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(1017),r.e(957),r.e(9708),r.e(8654),r.e(6647),r.e(1197)]).then(r.bind(r,68695))).default,CatalogLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(1956),r.e(8399),r.e(708),r.e(957),r.e(9708),r.e(6647),r.e(893),r.e(8628),r.e(2593),r.e(9279),r.e(1874)]).then(r.bind(r,83508))).default,DimensionLayer:async()=>(await Promise.all([r.e(3508),r.e(3813)]).then(r.bind(r,71493))).default,ElevationLayer:async()=>(await Promise.all([r.e(3508),r.e(9953),r.e(4802),r.e(8207)]).then(r.bind(r,68611))).default,FeatureLayer:async()=>(await Promise.all([r.e(7330),r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(1017),r.e(957),r.e(9708),r.e(8654),r.e(6647),r.e(9247)]).then(r.bind(r,68654))).default,GaussianSplatLayer:async()=>(await Promise.all([r.e(3508),r.e(6673),r.e(6730)]).then(r.bind(r,36475))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(1017),r.e(8766)]).then(r.bind(r,15481))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(3508),r.e(6554),r.e(5890)]).then(r.bind(r,85582))).default,GroupLayer:async()=>(await Promise.all([r.e(3508),r.e(5613),r.e(3562)]).then(r.bind(r,85989))).default,ImageryLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(9953),r.e(1956),r.e(893),r.e(6673),r.e(5068),r.e(5142),r.e(8824)]).then(r.bind(r,87772))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(9953),r.e(6673),r.e(5068),r.e(8144),r.e(5142),r.e(2168),r.e(9478)]).then(r.bind(r,9478))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([r.e(3508),r.e(6673),r.e(5942),r.e(1312)]).then(r.bind(r,61528))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(3508),r.e(6673),r.e(6011),r.e(5942),r.e(7464)]).then(r.bind(r,74660))).default,KMLLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(1863)]).then(r.bind(r,162))).default,KnowledgeGraphLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(708),r.e(1017),r.e(9708),r.e(8368),r.e(4649),r.e(217),r.e(8441),r.e(3463),r.e(8948),r.e(8692)]).then(r.bind(r,28692))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(3508),r.e(6673),r.e(1224),r.e(9695)]).then(r.bind(r,49695))).default,LinkChartLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(708),r.e(1017),r.e(9708),r.e(8368),r.e(4649),r.e(217),r.e(8441),r.e(3463),r.e(8948),r.e(1728)]).then(r.bind(r,71728))).default,MapImageLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(1956),r.e(8399),r.e(708),r.e(957),r.e(893),r.e(7048),r.e(7656),r.e(8999)]).then(r.bind(r,7656))).default,MapNotesLayer:async()=>(await Promise.all([r.e(7330),r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(1017),r.e(957),r.e(9708),r.e(8654),r.e(6647),r.e(3463),r.e(744)]).then(r.bind(r,96299))).default,MediaLayer:async()=>(await Promise.all([r.e(7330),r.e(3508),r.e(3444),r.e(9203)]).then(r.bind(r,29203))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(1956),r.e(8399),r.e(708),r.e(1017),r.e(8570),r.e(5977)]).then(r.bind(r,65977))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(3508),r.e(6554),r.e(9573),r.e(2712)]).then(r.bind(r,40349))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(7330),r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(1017),r.e(957),r.e(9708),r.e(8654),r.e(6647),r.e(9361),r.e(9644)]).then(r.bind(r,9352))).default,ParquetLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(1017),r.e(581),r.e(940)]).then(r.bind(r,99680))).default,PointCloudLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6673),r.e(7885)]).then(r.bind(r,77885))).default,RouteLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(217),r.e(9785)]).then(r.bind(r,34507))).default,SceneLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(1956),r.e(8399),r.e(6673),r.e(7005),r.e(8570),r.e(6011),r.e(8993),r.e(1713)]).then(r.bind(r,36969))).default,StreamLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(1956),r.e(8399),r.e(1017),r.e(73)]).then(r.bind(r,79457))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(7330),r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1956),r.e(8399),r.e(957),r.e(9708),r.e(6647),r.e(9645)]).then(r.bind(r,97483))).default,TileLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(1956),r.e(8399),r.e(708),r.e(957),r.e(893),r.e(4802),r.e(7048),r.e(573)]).then(r.bind(r,71756))).default,UnknownLayer:async()=>(await r.e(146).then(r.bind(r,146))).default,UnsupportedLayer:async()=>(await r.e(5165).then(r.bind(r,45165))).default,VectorTileLayer:async()=>(await Promise.all([r.e(3508),r.e(6554),r.e(4802),r.e(5897),r.e(1776)]).then(r.bind(r,48757))).default,VideoLayer:async()=>(await Promise.all([r.e(3508),r.e(3910),r.e(5323),r.e(8303),r.e(957),r.e(3444),r.e(2274)]).then(r.bind(r,86875))).default,ViewshedLayer:async()=>(await Promise.all([r.e(3508),r.e(1224),r.e(6650)]).then(r.bind(r,96650))).default,VoxelLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(1005)]).then(r.bind(r,21005))).default,WCSLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(9953),r.e(5068),r.e(8144),r.e(5142),r.e(2168),r.e(5694)]).then(r.bind(r,20521))).default,WFSLayer:async()=>(await Promise.all([r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(708),r.e(1017),r.e(9110)]).then(r.bind(r,21901))).default,WMSLayer:async()=>(await Promise.all([r.e(7330),r.e(3508),r.e(2869),r.e(6554),r.e(3910),r.e(5323),r.e(5181)]).then(r.bind(r,51904))).default,WMTSLayer:async()=>(await Promise.all([r.e(3508),r.e(6554),r.e(4802),r.e(9573),r.e(309)]).then(r.bind(r,20309))).default,WebTileLayer:async()=>(await Promise.all([r.e(3508),r.e(6554),r.e(9573),r.e(2848)]).then(r.bind(r,47314))).default}},7861:(e,a,r)=>{r.d(a,{L:()=>n});var t=r(11254);async function n(e,a){return(await(0,t.A)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}})).data}},8947:(e,a,r)=>{r.d(a,{L:()=>y});var t=r(60999),n=r(74887),i=r(67076);async function y(e,a,r){const y=e&&e.getAtOrigin&&e.getAtOrigin("renderer",a.origin);if(y&&"unique-value"===y.type&&y.styleOrigin){const l=await(0,t.Ke)(y.populateFromStyle());if((0,n.Te)(r),!1===l.ok){const r=l.error;a?.messages&&a.messages.push(new i.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:a})),e.clear("renderer",a?.origin)}}}},23154:(e,a,r)=>{r.d(a,{K:()=>d,Q:()=>y});var t=r(77548),n=r(7861);const i=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function y(e,a){const{loadContext:r,...i}=a||{},y=r?await r.fetchServiceMetadata(e,i):await(0,n.L)(e,i),l=(0,t.G$)();L(y),o(y);const s={serviceJSON:y,preferredHost:l};if((y.currentVersion??0)<10.5)return s;const c=`${(0,t.$x)()??e}/layers`,u=r?await r.fetchServiceMetadata(c,i):await(0,n.L)(c,i);return L(u),o(u),s.layersJSON={layers:u.layers,tables:u.tables},s}function l(e){const{type:a}=e;return!!a&&i.has(a)}function s(e){return"Table"===e.type}function o(e){e.layers=e.layers?.filter(l),e.tables=e.tables?.filter(s)}function c(e){e.type||="Feature Layer"}function u(e){e.type||="Table"}function L(e){e.layers?.forEach(c),e.tables?.forEach(u)}function d(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}},75356:(e,a,r)=>{r.d(a,{N:()=>A,populateOperationalLayers:()=>u});var t=r(7762),n=r(44208),i=r(22429),y=r(4513),l=r(80812);function s(e,a){return!(!e.layerType||"ArcGISFeatureLayer"!==e.layerType)&&e.featureCollectionType===a}var o=r(45613),c=r(8947);async function u(e,a,r){if(!a)return;const t=a.map(e=>async function(e,a){return async function(e,a,r){const t=new e;return t.read(a,r.context),"group"===t.type&&("GroupLayer"===a.layerType?await A(t,a,r):G(a)?function(e,a,r){a.itemId&&(e.portalItem=new l.default({id:a.itemId,portal:r?.portal}),e.when(()=>{const t=t=>{const n=t.layerId;P(t,e,a,n,r);const i=a.featureCollection?.layers?.[n];i&&t.read(i,r)};e.layers?.forEach(t),e.tables?.forEach(t)}))}(t,a,r.context):v(a)&&await async function(e,a,r){const t=y.S.FeatureLayer,n=await t(),i=a.featureCollection,l=i?.showLegend,s=i?.layers?.map((t,i)=>{const y=new n;y.read(t,r);const s={...r,ignoreDefaults:!0};return P(y,e,a,i,s),null!=l&&y.read({showLegend:l},s),y});e.layers.addMany(s??[])}(t,a,r.context)),await(0,c.L)(t,r.context),t}(await T(e,a),e,a)}(e,r)),n=await Promise.allSettled(t);for(const a of n)"rejected"===a.status||a.value&&e.add(a.value)}const L={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GaussianSplatLayer:"GaussianSplatLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",Object3DTilesLayer:"UnsupportedLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},d={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},f={ArcGISFeatureLayer:"FeatureLayer"},p={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"UnsupportedLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},S={IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer"},m={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",ArcGISVideoLayer:"VideoLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",get ParquetLayer(){return(0,n.A)("parquetlayer-persistence-enabled")?"ParquetLayer":"UnsupportedLayer"},SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},w={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"SubtypeGroupLayer"},h={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},g={...m,LinkChartLayer:"LinkChartLayer"},I={...w},b={...h};async function T(e,a){const r=a.context,t=M(r);let n=e.layerType||e.type;!n&&a?.defaultLayerType&&(n=a.defaultLayerType);const c=t[n];let u=c?y.S[c]:y.S.UnknownLayer;if(G(e)){const a=r?.portal;if(e.itemId){const r=new l.default({id:e.itemId,portal:a});await r.load();const t=(await(0,o.n)(r,new i.v)).className||"UnknownLayer";u=y.S[t]}}else"ArcGISFeatureLayer"===n?function(e){return s(e,"notes")}(e)||function(e){return s(e,"markup")}(e)?u=y.S.MapNotesLayer:function(e){return s(e,"route")}(e)?u=y.S.RouteLayer:v(e)&&(u=y.S.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?u=y.S.WMTSLayer:"WFS"===n&&"2.0.0"!==e.wfsInfo?.version&&(u=y.S.UnsupportedLayer);return u()}function v(e){return"ArcGISFeatureLayer"===e.layerType&&!G(e)&&(e.featureCollection?.layers?.length??0)>1}function G(e){return"Feature Collection"===e.type}function M(e){let a;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap-base-layers":a=p;break;case"basemap-ground-layers":a=S;break;case"ground":a=d;break;case"tables":a=f;break;default:a=L}break;case"link-chart":switch(e.layerContainerType){case"basemap-base-layers":a=b;break;case"tables":a=I;break;default:a=g}break;default:switch(e.layerContainerType){case"basemap-base-layers":a=h;break;case"tables":a=w;break;default:a=m}}return a}async function A(e,a,r){const n=new t.A,i=u(n,Array.isArray(a.layers)?a.layers:[],r);try{try{if(await i,"group"===e.type)return e.layers.addMany(n),e}catch(a){e.destroy();for(const e of n)e.destroy();throw a}}catch(e){throw e}}function P(e,a,r,t,n){e.read({id:`${a.id}-sublayer-${t}`,visibility:r.visibleLayers?.includes(t)??!0},n)}},92009:(e,a,r)=>{r.d(a,{L:()=>c});var t=r(70333),n=r(11254),i=r(49186),y=r(74887),l=r(60694),s=r(20655),o=r(80812);async function c(e,a){const r=(0,l.qg)(e);if(!r)throw new i.A("invalid-url","Invalid scene service url");const c={...a,sceneServerUrl:r.url.path,layerId:r.sublayer??void 0};if(c.sceneLayerItem??=await async function(e){const a=(await u(e)).serviceItemId;if(!a)return null;const r=new o.default({id:a,apiKey:e.apiKey}),i=await async function(e){const a=t.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const r=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.A)(r,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,y.QP)(e)}return null}(e);null!=i&&(r.portal=new s.A({url:i}));try{return await r.load({signal:e.signal})}catch(e){return(0,y.QP)(e),null}}(c),null==c.sceneLayerItem)return L(c.sceneServerUrl.replace("/SceneServer","/FeatureServer"),c);const d=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const r=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find(e=>"Feature Service"===e.type)||null;if(!r)return null;const t=new o.default({portal:r.portal,id:r.id});return await t.load(),t}catch(e){return(0,y.QP)(e),null}}(c);if(!d?.url)throw new i.A("related-service-not-found","Could not find feature service through portal item relationship");c.featureServiceItem=d;const f=await L(d.url,c);return f.portalItem=d,f}async function u(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const r=await(0,n.A)(e.sceneServerUrl,a);e.rootDocument=r.data}catch{e.rootDocument={}}return e.rootDocument}async function L(e,a){const r=(0,l.qg)(e);if(!r)throw new i.A("invalid-feature-service-url","Invalid feature service url");const t=r.url.path,y=a.layerId;if(null==y)return{serverUrl:t};const s=u(a),o=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,c=(o?.layers?.[0]||o?.tables?.[0])?.customParameters,L=e=>{const r={query:{f:"json",...c},responseType:"json",authMode:e,signal:a.signal};return(0,n.A)(t,r)},d=L("anonymous").catch(()=>L("no-prompt")),[f,p]=await Promise.all([d,s]),S=p?.layers,m=f.data&&f.data.layers;if(!Array.isArray(m))throw new Error("expected layers array");if(Array.isArray(S)){for(let e=0;e<Math.min(S.length,m.length);e++)if(S[e].id===y)return{serverUrl:t,layerId:m[e].id}}else if(null!=y&&y<m.length)return{serverUrl:t,layerId:m[y].id};throw new Error("could not find matching associated sublayer")}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8144],{8144:(t,e,n)=>{n.d(e,{vt:()=>Gs,UD:()=>Zs});var s=n(85334),r=n(49186),o=n(4718),i=n(31635),a=n(91429),u=n(94778),l=n(25482);let c=class extends l.o{constructor(){super(...arguments),this.raster=void 0}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],c.prototype,"raster",void 0),c=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.BaseFunctionArguments")],c);const p=c;var h;let m=h=class extends p{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new h({raster:this.raster,raster2:this.raster2,operation:this.operation})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],m.prototype,"operation",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],m.prototype,"raster2",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],m.prototype,"rasters",null),m=h=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ArithmeticFunctionArguments")],m);const f=m;var g=n(14140),d=n(87186);const y=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let x=class extends l.o{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this.isRoot=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:n}=t;let s=n.rasters||n.raster&&[n.raster];for(;s?.length;){e.unshift(...s);const t=[];for(let e=0;e<s.length;e++){const{parameters:n}=s[e],r=n.rasters||n.raster&&[n.raster];r?.length&&t.push(...r)}s=t}for(let t=e.length-1;t>=0;t--)e[t].isNoopProcess&&e.splice(t,1);let r=!1;for(let t=0;t<e.length;t++){const n=e[t];n.id=e.length-t-1;const{rasters:s}=n.parameters;r=r||null!=s&&s.length>1}const o=e.some(({name:t})=>y.has(t.toLowerCase())),{rawSourceRasterInfos:i}=this;return{functions:e,hasBranches:r,hasFocalFunction:o,isSourceSingleBand:1===i?.[0]?.bandCount}}bind(t,e=!1,n=-1){this.id=n+1;const s=this._getRasterValues();let r=!0;for(let n=0;n<s.length;n++){const o=s[n];if(null!=o&&this._isRasterFunctionValue(o)){const s=o.bind(t,e,this.id+n);if(!s.success)return this._bindingResult=s,s;r=r&&s.supportsGPU}}return!this.rasterInfo||e?(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),r&&=this._bindingResult.supportsGPU,this._bindingResult.success&&(this._patchRasterInfo(),r&&this.isRoot)&&(this.processInputBandIds(),this.swizzleInputBandIds(this.rawInputBandIds)||(r=this.rawInputBandIds.length<=3)),this._bindingResult.supportsGPU=r,this._bindingResult):(this._bindingResult={success:!0,supportsGPU:!0},this._bindingResult)}process(t){const e=this._getRasterValues(),n=0===e.length?t.pixelBlocks??t.primaryPixelBlocks:e.map(e=>this._readRasterValue(e,t));return this._processPixels({...t,pixelBlocks:n})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);if(t.length>1){const e=t.map(t=>t.processInputBandIds());return this.rawInputBandIds=[...new Set(e.flat())],this.rawInputBandIds}const e=t[0];if(e)return this.rawInputBandIds=e.processInputBandIds(),this.rawInputBandIds;const{bandCount:n}=this.sourceRasterInfos[0],s=Array.from({length:n},(t,e)=>e);return this.rawInputBandIds=this._getInputBandIds(s),this.rawInputBandIds}swizzleInputBandIds(t){const e=this._getRasterValues().filter(this._isRasterFunctionValue);let n=!0;for(const s of e)n=s.swizzleInputBandIds(t)&&n;return!!n&&this._swizzleBandIds(t)}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:n}=this.functionArguments;return n&&Array.isArray(n)&&n.length?(t.rasters=n.map(t=>this._isRasterFunctionValue(t)?t.getWebGLProcessorDefinition():"number"==typeof t?{name:"Constant",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(t=>null!=t)||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];"Clip"===this.functionName&&t.push(this.functionArguments);const{raster:e,rasters:n}=this.functionArguments;if(n&&Array.isArray(n)&&n.length)n.forEach(e=>{if(this._isRasterFunctionValue(e)){const n=e.getClippingGeometries();t.push(...n)}});else if(this._isRasterFunctionValue(e)){const n=e.getClippingGeometries();t.push(...n)}return t}_getOutputPixelType(t){return"unknown"===this.outputPixelType?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_swizzleBandIds(t){return!0}_isInputRasterPrimaryOrConstant(){return!this._getRasterValues().some(t=>t&&"object"==typeof t&&"rasterFunction"in t&&t.rasterFunction)}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.multidimensionalInfo?.variables.forEach(t=>{t.statistics=void 0,t.histograms=void 0})}_getRasterValues(){const{rasterArgumentNames:t}=this;return"rasters"===t[0]?this.functionArguments.rasters??[]:t.flatMap(t=>this.functionArguments[t])}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:n,rasterIds:s}=t;if(0===e.length)return n;const r=e.map(t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&s.includes(t)?n[s.indexOf(t)]:"number"!=typeof t?n[0]:void 0),o=r.find(t=>t)??n[0];return r.forEach((t,e)=>{void 0===t&&(r[e]=o)}),r}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,e=[],n=[]){for(let s=0;s<t.sourceRasters.length;s++){const r=t.sourceRasters[s];if("number"!=typeof r)if("bind"in r)this._getPrimaryRasters(r,e,n);else{const t=r,s=this._getPrimaryRasterId(t);if(null==s)continue;n.includes(s)||(this.mainPrimaryRasterId===s?(e.unshift(t),n.unshift(s)):(e.push(t),n.push(s)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,e){const{primaryPixelBlocks:n}=e;if(null==t||"$$"===t){const t=n[0];return null==t?null:t.clone()}if("string"==typeof t){const s=e.primaryRasterIds.indexOf(t);return-1===s?null:n[s]}if("number"==typeof t){const e=n[0];if(null==e)return null;const{width:s,height:r,pixelType:o}=e,i=new Float32Array(s*r);i.fill(t);const a=this.sourceRasterInfos[0].bandCount,u=new Array(a).fill(i);return new g.A({width:s,height:r,pixelType:o,pixels:u})}return t.process(e)}_patchRasterInfo(){const{rasterInfo:t}=this;if(!t?.keyProperties)return;const{bandCount:e,keyProperties:n,statistics:s,histograms:r}=t,o=n.BandProperties;o&&o.length!==e&&(t.keyProperties={...n,BandProperties:void 0}),s&&s.length!==e&&(t.statistics=s.length>e?s.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),n.BAND_COUNT&&Number(n.BAND_COUNT)!==e&&(t.keyProperties={...n,BAND_COUNT:"string"==typeof n.BAND_COUNT?String(e):e})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}}),(0,a.wg)(t=>t?.toLowerCase())],x.prototype,"outputPixelType",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"mainPrimaryRasterId",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"sourceRasters",void 0),(0,i.Cg)([(0,a.MZ)({type:[d.A],json:{write:!0}})],x.prototype,"sourceRasterInfos",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"rasterInfo",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"readingBufferSize",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"id",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"isNoopProcess",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"supportsGPU",null),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"rawInputBandIds",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"rawSourceRasterInfos",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"isInputBandIdsSwizzled",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],x.prototype,"swizzledBandSelection",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"isBranch",void 0),(0,i.Cg)([(0,a.MZ)()],x.prototype,"isRoot",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],x.prototype,"flatWebGLFunctionChain",null),(0,i.Cg)([(0,a.MZ)()],x.prototype,"_bindingResult",void 0),x=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.BaseRasterFunction")],x);const w=x,A={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},v={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},b={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},C={setNull:50,conditional:78},M={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65,...v,...b,majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75,...C},P=new Map([[b.acos,{domain:[0,Math.PI],isInteger:!1}],[b.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[b.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[b.cos,{domain:[-1,1],isInteger:!1}],[b.sin,{domain:[-1,1],isInteger:!1}],[v.booleanAnd,{domain:[0,1],isInteger:!0}],[v.booleanNot,{domain:[0,1],isInteger:!0}],[v.booleanOr,{domain:[0,1],isInteger:!0}],[v.booleanXOr,{domain:[0,1],isInteger:!0}],[v.equalTo,{domain:[0,1],isInteger:!0}],[v.notEqual,{domain:[0,1],isInteger:!0}],[v.greaterThan,{domain:[0,1],isInteger:!0}],[v.greaterThanEqual,{domain:[0,1],isInteger:!0}],[v.lessThan,{domain:[0,1],isInteger:!0}],[v.lessThanEqual,{domain:[0,1],isInteger:!0}],[v.isNull,{domain:[0,1],isInteger:!0}]]);function T(t){return P.get(t)}const R=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function N(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]+r[t]);return i}function k(t,e,n){const[s]=t,r=s.length,o=g.A.createEmptyBand("f32",r);return o.set(s),o}function I(t,e,n){const[s]=t,r=s.length,o=g.A.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=s[t]*s[t]);return o}function S(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]-r[t]);return i}function _(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]*r[t]);return i}function F(t,e,n){const[s]=t,r=s.length,o=g.A.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=Math.sign(s[t])*Math.floor(Math.abs(s[t])));return o}function B(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]/r[t]);return i}function j(t,e,n){return B(t,e,"f32")}function Z(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=Math.floor(s[t]/r[t]));return i}function G(t,e,n,s){const r=t[0],o=r.length,i=g.A.createEmptyBand(n,o);if(s===b.atanh){for(let t=0;t<o;t++)if(e[t]){const n=r[t];Math.abs(n)>=1?e[t]=0:i[t]=Math.atanh(n)}return i}const a=s===b.asin?Math.asin:Math.acos;for(let t=0;t<o;t++)if(e[t]){const n=r[t];Math.abs(n)>1?e[t]=0:i[t]=a(n)}return i}function z(t,e,n,s){const[r]=t,o=r.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s(r[t]));return i}function O(t,e,n,s){const[r,o]=t,i=r.length,a=g.A.createEmptyBand(n,i);for(let t=0;t<i;t++)e&&!e[t]||(a[t]=s(r[t],o[t]));return a}function E(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]&r[t]);return i}function D(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<<r[t]);return i}function V(t,e,n){const[s]=t,r=s.length,o=g.A.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=~s[t]);return o}function U(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]|r[t]);return i}function L(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>>r[t]);return i}function W(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]^r[t]);return i}function $(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]&&r[t]?1:0);return i}function K(t,e,n){const[s]=t,r=s.length,o=g.A.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=s[t]?0:1);return o}function H(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]||r[t]?1:0);return i}function q(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=(s[t]?1:0)^(r[t]?1:0));return i}function J(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]===r[t]?1:0);return i}function X(t,e,n,s){const[r]=t,o=r.length,i=g.A.createEmptyBand(n,o),a=s===Math.E;for(let t=0;t<o;t++)e&&!e[t]||(i[t]=a?Math.exp(r[t]):s**r[t]);return i}function Y(t,e,n){return X(t,e,n,10)}function Q(t,e,n){return X(t,e,n,2)}function tt(t,e,n){return X(t,e,n,Math.E)}function et(t,e,n,s){const[r]=t,o=r.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(r[t]<=0?e[t]=0:i[t]=s(r[t]));return i}function nt(t,e,n){return et(t,e,n,Math.log10)}function st(t,e,n){return et(t,e,n,Math.log2)}function rt(t,e,n){return et(t,e,n,Math.log)}function ot(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>r[t]?1:0);return i}function it(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>=r[t]?1:0);return i}function at(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<r[t]?1:0);return i}function ut(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<=r[t]?1:0);return i}function lt(t,e,n){const[s]=t,r=s.length,o=g.A.createEmptyBand(n,r);if(!e)return o;for(let t=0;t<r;t++)o[t]=e[t]?0:1;return o}function ct(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]%r[t]);return i}function pt(t,e,n){const[s]=t,r=s.length,o=g.A.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=-s[t]);return o}function ht(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]===r[t]?0:1);return i}function mt(t,e,n){const[s,r]=t,o=s.length,i=g.A.createEmptyBand(n,o),a=new Uint8Array(o);for(let t=0;t<o;t++)null!=e&&!e[t]||0!==s[t]||(i[t]=r[t],a[t]=255);return{band:i,mask:a}}function ft(t,e,n){const[s,r,o]=t,i=s.length,a=g.A.createEmptyBand(n,i);for(let t=0;t<i;t++)e&&!e[t]||(a[t]=s[t]?r[t]:o[t]);return a}function gt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=r[n];for(let r=1;r<s;r++){const s=t[r][n];e<s&&(e=s)}i[n]=e}return i}function dt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=r[n];for(let r=1;r<s;r++){const s=t[r][n];e>s&&(e=s)}i[n]=e}return i}function yt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=r[n],o=e;for(let r=1;r<s;r++){const s=t[r][n];o<s?o=s:e>s&&(e=s)}i[n]=o-e}return i}function xt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=0;for(let r=0;r<s;r++)e+=t[r][n];i[n]=e/s}return i}function wt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n])for(let e=0;e<s;e++){const s=t[e];i[n]+=s[n]}return i}function At(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){const e=new Float32Array(s);let r=0;for(let o=0;o<s;o++){const s=t[o];r+=s[n],e[o]=s[n]}r/=s;let o=0;for(let t=0;t<s;t++)o+=(e[t]-r)**2;i[n]=Math.sqrt(o/s)}return i}function vt(t,e,n){const s=t.length;if(s<2)return t[0];const r=Math.floor(s/2),[o]=t,i=o.length,a=g.A.createEmptyBand(n,i),u=new Float32Array(s),l=s%2==1;for(let n=0;n<i;n++)if(!e||e[n]){for(let e=0;e<s;e++)u[e]=t[e][n];u.sort(),a[n]=l?u[r]:(u[r]+u[r-1])/2}return a}function bt(t,e,n){const[s,r]=t;if(null==r)return s;const o=s.length,i=g.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<r[t]?s[t]:r[t]);return i}function Ct(t,e,n){const s=t.length;if(s<=2)return bt(t,e,n);const r=t[0].length,o=g.A.createEmptyBand(n,r),i=new Map;for(let n=0;n<r;n++)if(!e||e[n]){i.clear();for(let e=0;e<s;e++){const s=t[e][n];i.set(s,i.has(s)?i.get(s)+1:1)}let e=0,r=0;const a=[];for(const t of i.keys())e=i.get(t),e>r?(r=e,a.length=0,a.push(t)):e===r&&a.push(t);a.length>1&&a.sort((t,e)=>t-e),o[n]=a[0]}return o}function Mt(t,e,n){const s=t.length;if(s<=2)return bt(t,e,n);const r=t[0].length,o=g.A.createEmptyBand(n,r),i=new Map;for(let n=0;n<r;n++)if(!e||e[n]){i.clear();for(let e=0;e<s;e++){const s=t[e][n];i.set(s,i.has(s)?i.get(s)+1:1)}let e=0,r=t.length;const a=[];for(const t of i.keys())e=i.get(t),e<r?(r=e,a.length=0,a.push(t)):e===r&&a.push(t);a.length>1&&a.sort((t,e)=>t-e),o[n]=a[0]}return o}function Pt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=g.A.createEmptyBand(n,o),a=new Set;for(let n=0;n<o;n++)if(!e||e[n]){let e;a.clear();for(let r=0;r<s;r++)e=t[r][n],a.add(e);i[n]=a.size}return i}const Tt=new Map,Rt=new Map,Nt=new Map,kt=new Map;function It(){Tt.size||(Tt.set(4,Math.sqrt),Tt.set(6,Math.acos),Tt.set(7,Math.asin),Tt.set(8,Math.atan),Tt.set(9,Math.atanh),Tt.set(10,Math.abs),Tt.set(21,Math.cos),Tt.set(22,Math.cosh),Tt.set(48,Math.floor),Tt.set(49,Math.ceil),Tt.set(51,Math.sin),Tt.set(52,Math.sinh),Tt.set(56,Math.tan),Tt.set(57,Math.tanh),Tt.set(59,Math.acosh),Tt.set(60,Math.asinh),Tt.set(65,Math.floor),Rt.set(5,Math.pow),Rt.set(61,Math.atan2),Nt.set(1,N),Nt.set(2,S),Nt.set(3,_),Nt.set(11,E),Nt.set(12,D),Nt.set(13,V),Nt.set(14,U),Nt.set(15,L),Nt.set(16,W),Nt.set(17,$),Nt.set(18,K),Nt.set(19,H),Nt.set(20,q),Nt.set(23,B),Nt.set(24,J),Nt.set(25,tt),Nt.set(26,Y),Nt.set(27,Q),Nt.set(28,ot),Nt.set(29,it),Nt.set(30,F),Nt.set(31,lt),Nt.set(32,k),Nt.set(33,at),Nt.set(34,ut),Nt.set(35,rt),Nt.set(36,nt),Nt.set(37,st),Nt.set(44,ct),Nt.set(45,pt),Nt.set(46,ht),Nt.set(53,I),Nt.set(64,j),Nt.set(65,Z),Nt.set(76,ft),Nt.set(78,ft),kt.set(38,Ct),kt.set(39,gt),kt.set(40,xt),kt.set(41,vt),kt.set(42,dt),kt.set(43,Mt),kt.set(47,yt),kt.set(54,At),kt.set(55,wt),kt.set(58,Pt),kt.set(66,Ct),kt.set(67,gt),kt.set(68,xt),kt.set(69,vt),kt.set(70,dt),kt.set(71,Mt),kt.set(72,yt),kt.set(73,At),kt.set(74,wt),kt.set(75,Pt))}function St(t,e,n={}){It();let s=function(t,e=!1){const n=t.map(t=>t.mask),s=n.filter(t=>null!=t),r=t[0].pixels[0].length;if(0===s.length||e&&s.length!==n.length)return new Uint8Array(r).fill(255);const o=s[0],i=new Uint8Array(o);if(1===s.length)return i;if(!e){for(let t=1;t<s.length;t++){const e=s[t];for(let t=0;t<i.length;t++)i[t]&&(i[t]=e[t]?255:0)}return i}for(let t=1;t<s.length;t++){const e=s[t];for(let t=0;t<i.length;t++)0===i[t]&&(i[t]=e[t]?255:0)}return i}(t,e>=66&&e<=75);const{outputPixelType:r="f32"}=n,o=!kt.has(e)||n.processAsMultiband,i=o?t[0].pixels.length:1,a=[];for(let n=0;n<i;n++){const i=kt.has(e)&&!o?t.flatMap(t=>t.pixels):t.map(t=>t.pixels[n]);let l,c=!0;if(e===C.setNull){const t=mt(i,s,r);l=t.band,s=t.mask,c=!1}else Nt.has(e)?l=Nt.get(e)(i,s,"f64"):Tt.has(e)?l=e===b.asin||e===b.acos||e===b.atanh?G(i,s,"f64",e):z(i,s,"f64",Tt.get(e)):Rt.has(e)?l=O(i,s,"f64",Rt.get(e)):kt.has(e)?l=kt.get(e)(i,s,"f64"):(l=i[0],c=!1);if(c&&e!==v.isNull&&!P.has(e)){const t=g.A.createEmptyBand(r,l.length);s||(s=new Uint8Array(l.length).fill(255)),(0,u.$p)(l,s),(0,u.yM)(l,s,r,t),l=t}a.push(l)}const l=t[0];return new g.A({width:l.width,height:l.height,pixelType:r,mask:e===v.isNull?null:s,pixels:a})}let _t=class extends w{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return null==e?.[0]||null==e?.[1]?null:function(t,e,n){return St(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],n=this.outputPixelType??"f32";let[s,r]=(0,u.hP)(n);const o=(0,u.zw)(n);return o&&(s-=1e-4,r+=1e-4),{imageCount:2,operationName:e,domainRange:[s,r],isOutputRounded:o}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],_t.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:f,json:{write:!0,name:"rasterFunctionArguments"}})],_t.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],_t.prototype,"rasterArgumentNames",void 0),_t=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ArithmeticFunction")],_t);const Ft=_t;var Bt;let jt=Bt=class extends p{clone(){return new Bt({raster:this.raster})}};jt=Bt=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.AspectFunctionArguments")],jt);const Zt=jt;var Gt=n(51181);let zt=class extends w{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],o=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1});return(0,Gt.di)(e,{resolution:o})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],zt.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Zt,json:{write:!0,name:"rasterFunctionArguments"}})],zt.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],zt.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],zt.prototype,"isGCS",void 0),zt=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.AspectFunction")],zt);const Ot=zt;var Et=n(66552);n(44208);const Dt=new Set(["+","-","*","/","(",")"]);function Vt(t,e){return t.toLowerCase().startsWith("b")?e[parseInt(t.slice(1),10)-1]:parseFloat(t)}function Ut(t,e,n,s){if("number"==typeof n&&"number"==typeof s)return n+s;let r,o,i;"number"==typeof n?(i=s,r=i.length,o=new Float32Array(r),o.fill(n)):(r=n.length,o=n,s.constructor===Number?(i=new Float32Array(r),i.fill(s)):i=s);const a=new Float32Array(r);switch(e){case"+":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]+i[e]);break;case"-":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]-i[e]);break;case"*":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]*i[e]);break;case"/":for(let e=0;e<r;e++)(null==t||t[e])&&i[e]&&(a[e]=o[e]/i[e]);break;case"(":case")":throw new Error("encountered error with custom band index equation")}return a}function Lt(t,e){t.splice(e,1);let n=0,s=0;do{n=0,s=0;for(let e=0;e<t.length;e++)if("("===t[e])n=e;else if(")"===t[e]){s=e;break}s===n+1&&t.splice(n,2)}while(s===n+1);return t}function Wt(t){if(1===t.length)return{opIndex:0,numIndex:0};let e=0,n=0;for(let s=0;s<t.length;s++)if("("===t[s])e=s;else if(")"===t[s]){n=s;break}const s=0===n?t:t.slice(e+1,n);let r=-1;for(let t=0;t<s.length;t++)if("*"===s[t]||"/"===s[t]){r=t;break}if(r>-1)n>0&&(r+=e+1);else{for(let t=0;t<s.length;t++)if("+"===s[t]||"-"===s[t]){r=t;break}n>0&&(r+=e+1)}let o=0;for(let e=0;e<r;e++)"("===t[e]&&o++;return{opIndex:r,numIndex:r-o}}var $t=n(47520);const Kt=new Et.J({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function Ht(t,e){if(!(0,$t.AB)(t))return t;const{equation:n,method:s}=e,r=e.bandIndexes.map(t=>t-1),{pixels:o,mask:i}=t;let a;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":a=Jt(i,o[r[0]],o[r[1]]);break;case"ndwi":a=Jt(i,o[r[1]],o[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o];s&&(r[o]=t/s)}return[r]}(i,o[r[0]],o[r[1]]);break;case"ci-g":case"ci-re":a=function(t,e,n){const s=e.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o];s&&(r[o]=t/s-1)}return[r]}(i,o[r[0]],o[r[1]]);break;case"savi":a=function(t,e,n,s){const r=n.length,o=new Float32Array(r);for(let i=0;i<r;i++)if(null==t||t[i]){const t=n[i],r=e[i],a=r+t+s;a&&(o[i]=(r-t)/a*(1+s))}return[o]}(i,o[r[0]],o[r[1]],r[2]+1);break;case"tsavi":a=function(t,e,n,s,r,o){const i=n.length,a=new Float32Array(i),u=-r*s+o*(1+s*s);for(let o=0;o<i;o++)if(null==t||t[o]){const t=n[o],i=e[o],l=r*i+t+u;l&&(a[o]=s*(i-s*t-r)/l)}return[a]}(i,o[r[0]],o[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=n[o],s=e[o],i=2*s+1;r[o]=.5*(i-Math.sqrt(i*i-8*(s-t)))}return[r]}(i,o[r[0]],o[r[1]]);break;case"gemi":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=n[o],s=e[o];if(1!==t&&s+t+.5!==0){const e=(2*(s*s-t*t)+1.5*s+.5*t)/(s+t+.5);r[o]=e*(1-.25*e)-(t-.125)/(1-t)}}return[r]}(i,o[r[0]],o[r[1]]);break;case"pvi":a=function(t,e,n,s,r){const o=n.length,i=new Float32Array(o),a=1/Math.sqrt(1+s*s);for(let u=0;u<o;u++)if(null==t||t[u]){const t=n[u],o=e[u];i[u]=(o-s*t-r)*a}return[i]}(i,o[r[0]],o[r[1]],r[2]+1,r[3]+1);break;case"gvitm":a=function(t,e){const[n,s,r,o,i,a]=e,u=n.length,l=new Float32Array(u);for(let e=0;e<u;e++)(null==t||t[e])&&(l[e]=-.2848*n[e]-.2435*s[e]-.5436*r[e]+.7243*o[e]+.084*i[e]-.18*a[e]);return[l]}(i,[o[r[0]],o[r[1]],o[r[2]],o[r[3]],o[r[4]],o[r[5]]]);break;case"sultan":a=function(t,e){const[n,s,r,o,i]=e,a=n.length,u=new Float32Array(a),l=new Float32Array(a),c=new Float32Array(a);for(let e=0;e<a;e++)(null==t||t[e])&&(u[e]=i[e]?o[e]/i[e]*100:0,l[e]=n[e]?o[e]/n[e]*100:0,c[e]=r[e]?s[e]/r[e]*(o[e]/r[e])*100:0);return[u,l,c]}(i,[o[r[0]],o[r[1]],o[r[2]],o[r[3]],o[r[4]]]);break;case"vari":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=o+t-r[e];a&&(i[e]=(o-t)/a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"mtvi2":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=r[e],u=Math.sqrt((2*t+1)**2-(6*t-5*Math.sqrt(o))-.5);if(u){const n=1.5*(1.2*(t-a)-2.5*(o-a));i[e]=n/u}}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"rtvi-core":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=r[e];i[e]=100*(t-o)-10*(t-a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"evi":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=t+6*o-7.5*r[e]+1;a&&(i[e]=2.5*(t-o)/a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"wndwi":a=function(t,e,n=.5){const[s,r,o]=e,i=r.length,a=new Float32Array(i);for(let e=0;e<i;e++)if(null==t||t[e])for(e=0;e<i;e++){const t=s[e],i=r[e],u=o[e],l=t+n*i+(1-n)*u;l&&(a[e]=(t-n*i-(1-n)*u)/l)}return[a]}(i,[o[r[0]],o[r[1]],o[r[2]]],r[3]?r[3]+1:.5);break;case"bai":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o])for(o=0;o<s;o++){const t=(.1-e[o])**2+(.06-n[o])**2;t&&(r[o]=1/t)}return[r]}(i,o[r[0]],o[r[1]]);break;case"custom":a=function(t,e,n){let s,{ops:r,nums:o}=function(t,e){(t=t.replaceAll(" ","")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1));const n=t.split(""),s=[],r=[];let o="";for(let t=0;t<n.length;t++){const i=n[t];Dt.has(i)?(o.length&&r.push(Vt(o,e)),s.push(i),o=""):o=o.concat(i)}return o.length&&r.push(Vt(o,e)),{ops:s,nums:r}}(n,e);if(0===r.length){const t=1===o.length?o[0]:e[0];if(t instanceof Float32Array)return[t];const n=new Float32Array(e[0].length);return"number"==typeof t?n.fill(t):n.set(t),[n]}for(;r.length>0;){const{numIndex:e,opIndex:n}=Wt(r);if(s=Ut(t,r[n],o[e],o[e+1]),1===r.length)break;r=Lt(r,n),o.splice(e,2,s)}return[s]}(i,o,n);break;default:return t}const{outputPixelType:l="f32"}=e,c=null!=l&&(0,u.zw)(l);let p;i?(p=new Uint8Array(t.width*t.height),p.set(i)):c&&(p=new Uint8Array(t.width*t.height).fill(255)),c&&(a=a.map(t=>{const e=g.A.createEmptyBand(l,t.length);return(0,u.yM)(t,p,l,e),e}));const h=new g.A({width:t.width,height:t.height,pixelType:l,pixels:a,mask:p});return h.updateStatistics(),h}function qt(t){const e=new Float32Array(9);return e[3*t[0]]=1,e[3*t[1]+1]=1,e[3*t[2]+2]=1,e}function Jt(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o],i=t+s;i&&(r[o]=(t-s)/i)}return[r]}var Xt,Yt=n(93223);let Qt=Xt=class extends p{constructor(){super(...arguments),this.method="custom"}clone(){return new Xt({method:this.method,bandIndexes:this.bandIndexes,raster:(0,o.o8)(this.raster)})}};(0,i.Cg)([(0,a.MZ)({json:{type:String,write:!0}})],Qt.prototype,"bandIndexes",void 0),(0,i.Cg)([(0,Yt.e)(Kt)],Qt.prototype,"method",void 0),Qt=Xt=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.BandArithmeticFunctionArguments")],Qt);const te=Qt,ee=new Set(["vari","mtvi2","rtvi-core","evi"]);let ne=class extends w{constructor(){super(...arguments),this.functionName="BandArithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0];if(t.bandCount<2)return{success:!1,supportsGPU:!1,error:"band-arithmetic-function: source raster has insufficient amount of raster bands"};const e=t.clone();return e.pixelType=this.outputPixelType,e.bandCount="sultan"===this.functionArguments.method?3:1,this._removeStatsHistColormapVAT(e),e.keyProperties={...e.keyProperties,BandProperties:void 0},this.rasterInfo=e,{success:!0,supportsGPU:!["custom","gvitm","sultan"].includes(this.functionArguments.method)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{method:n,bandIndexes:s}=this.functionArguments,r=s.split(" ").map(t=>parseFloat(t));if(this.rasterInfo.storageInfo.isBsqTile){const{rawInputBandIds:t}=this,e=ee.has(this.functionArguments.method)?3:2,n=r.slice(0,e).map(e=>t.indexOf(e-1));r.splice(0,e,...n)}return Ht(e,{method:n,bandIndexes:r,equation:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map(t=>parseFloat(t)-1);2===t.length&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let n,s;const r=new Float32Array(3),{method:o}=this.functionArguments;switch(o){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=qt([e[0],e[1],0]),s="ndxi";break;case"ndwi":n=qt([e[1],e[0],0]),s="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=qt([e[0],e[1],0]),s="sr";break;case"ci-g":case"ci-re":n=qt([e[0],e[1],0]),s="ci";break;case"savi":n=qt([e[0],e[1],0]),s="savi",r[0]=t[2]+1;break;case"tsavi":n=qt([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":n=qt([e[0],e[1],0]),s="msavi";break;case"gemi":n=qt([e[0],e[1],0]),s="gemi";break;case"pvi":n=qt([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=qt([e[0],e[1],e[2]]),s="vari";break;case"mtvi2":n=qt([e[0],e[1],e[2]]),s="mtvi";break;case"rtvi-core":n=qt([e[0],e[1],e[2]]),s="rtvicore";break;case"evi":n=qt([e[0],e[1],e[2]]),s="evi";break;case"wndwi":n=qt([e[0],e[1],0]),s="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=qt([e[1],e[0],0]),s="bai";break;default:n=qt([0,1,2]),s="custom"}return{bandIndexMat3:n,indexType:s,adjustments:r,isOutputRounded:(0,u.zw)(this.outputPixelType)}}_getInputBandIds(t){if("custom"===this.functionArguments.method)return t;const e=this.functionArguments.bandIndexes.split(" ").map(t=>parseFloat(t)-1),n=t.length,s=e.map(t=>t>=n?n-1:t),r=ee.has(this.functionArguments.method)?3:2,o=s.slice(0,r).map(e=>t[e]);return 2===o.length&&o.push(0),o}_swizzleBandIds(t){const e=this.functionArguments.bandIndexes.split(" ").map(t=>parseFloat(t)-1);2===e.length&&e.push(0);const{method:n}=this.functionArguments,s=(["vari","mtvi2","rtvi-core","evi"].includes(n)?e.slice(0,3):"bai"===n||"ndwi"===n?[e[1],e[0]]:e.slice(0,2)).map(e=>t.indexOf(e));return s[2]??=s[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=s,!1}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ne.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:te,json:{write:!0,name:"rasterFunctionArguments"}})],ne.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],ne.prototype,"rasterArgumentNames",void 0),ne=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.BandArithmeticFunction")],ne);const se=ne;var re,oe=n(65864),ie=n(50498);const ae=new Et.J({1:"outside",2:"inside"},{useNumericKeys:!0});let ue=re=class extends p{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new re({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};(0,i.Cg)([(0,a.MZ)({types:ie.yR,json:{read:oe.rS,write:!0}})],ue.prototype,"clippingGeometry",void 0),(0,i.Cg)([(0,a.MZ)({json:{read:ae.read,write:ae.write}})],ue.prototype,"clippingType",void 0),ue=re=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ClipFunctionArguments")],ue);const le=ue;var ce=n(34930),pe=n(37373);let he=class extends w{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{functionArguments:e}=this,{clippingGeometry:n,clippingType:s}=e;if(!n)return{success:!1,supportsGPU:!1,error:"missing clipping geometry"};if("outside"===s)try{const{spatialReference:e}=t,s="extent"===n.type?(0,pe._l)(n,e):(0,pe.uk)(n,e).extent;s&&(0,ce.Sd)(t,s)}catch{}return{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}_getWebGLParameters(){const{clippingGeometry:t,clippingType:e}=this.functionArguments;return{clippingGeometry:t.toJSON(),clippingType:e}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],he.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:le,json:{write:!0,name:"rasterFunctionArguments"}})],he.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],he.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)()],he.prototype,"isNoopProcess",void 0),he=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ClipFunction")],he);const me=he;var fe,ge=n(67369),de=n(95349),ye=n(36005);let xe=fe=class extends p{castColormapName(t){if(!t)return null;const e=t.toLowerCase();return ge.L7.includes(e)?e:null}readColorRamp(t){return(0,de.r)(t)}readColorRampName(t,e){if(!t)return null;const n=ge.kH.jsonValues.find(e=>e.toLowerCase()===t.toLowerCase());return n?ge.kH.fromJSON(n):null}clone(){return new fe({colormap:(0,o.o8)(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};(0,i.Cg)([(0,a.MZ)({type:[[Number]],json:{write:!0}})],xe.prototype,"colormap",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],xe.prototype,"colormapName",void 0),(0,i.Cg)([(0,a.wg)("colormapName")],xe.prototype,"castColormapName",null),(0,i.Cg)([(0,a.MZ)({types:de.g,json:{write:!0}})],xe.prototype,"colorRamp",void 0),(0,i.Cg)([(0,ye.w)("colorRamp")],xe.prototype,"readColorRamp",null),(0,i.Cg)([(0,a.MZ)({type:ge.kH.apiValues,json:{type:ge.kH.jsonValues,write:ge.kH.write}})],xe.prototype,"colorRampName",void 0),(0,i.Cg)([(0,ye.w)("colorRampName")],xe.prototype,"readColorRampName",null),xe=fe=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapFunctionArguments")],xe);const we=xe,Ae=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],ve=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function be(t,e){const n=[],s=[];for(let e=0;e<t.length-1;e++)n.push({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:t[e].slice(1),toColor:t[e+1].slice(1)}),s.push(t[e+1][0]-t[e][0]);const r=t[t.length-1][0];return(0,ge.iv)({type:"multipart",colorRamps:n},{numColors:r,weights:e=e??s})}let Ce=class extends w{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:n,colorRamp:s,colorRampName:r}=this.functionArguments;if(!e?.length)if(s)this.colorRamp=s,e=(0,ge.R8)(s,{interpolateAlpha:!0});else if(r){const t=(0,ge.M5)(r);t&&(e=(0,ge.R8)(t),this.colorRamp=(0,de.r)(t))}else n&&(e=function(t){let e;switch(t){case"elevation":e=be([[0,0,191,191],[51,0,0,255],[102,255,0,255],[153,255,0,127],[204,191,63,127],[256,20,20,20]]);break;case"gray":e=(0,ge.iv)({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:[0,0,0],toColor:[255,255,255]});break;case"hillshade":e=be([[0,38,41,54],[69,79,82,90],[131,156,156,156],[256,253,253,241]],[.268,.238,.495]);break;case"ndvi":e=Ae;break;case"ndvi2":e=function(){const t=be([[0,255,255,255],[70,0,255,0],[80,205,173,193],[100,150,150,150],[110,120,51,100],[130,120,100,200],[140,28,3,144],[160,6,0,55],[180,10,25,30],[201,6,7,27]]);for(let e=t.length;e<256;e++)t.push([6,27,7]);return t}();break;case"ndvi3":e=ve;break;case"random":e=function(){const t=[];for(let e=0;e<256;e++){const e=[];for(let t=0;t<3;t++)e.push(Math.round(255*Math.random()));t.push(e)}return t}()}return e?(e=e.map((t,e)=>[e,...t]),e):null}(n));if(!e?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const o=this._getOutputPixelType(t.pixelType);this.outputPixelType=o.startsWith("f")?"s32":o;const i=t.clone();return i.pixelType=this.outputPixelType,i.colormap=e,i.bandCount=1,this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(t){let e=t.pixelBlocks?.[0];return!e||(0,u.zw)(e.pixelType)||(e=e.clone(),e.clamp(this.outputPixelType)),e}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ce.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:we,json:{write:!0,name:"rasterFunctionArguments"}})],Ce.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Ce.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)()],Ce.prototype,"isNoopProcess",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Ce.prototype,"indexedColormap",void 0),(0,i.Cg)([(0,a.MZ)()],Ce.prototype,"colorRamp",void 0),Ce=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapFunction")],Ce);const Me=Ce;var Pe;let Te=Pe=class extends p{clone(){return new Pe({raster:this.raster})}};Te=Pe=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapToRGBFunctionArguments")],Te);const Re=Te;var Ne=n(4151),ke=n(88178);let Ie=class extends w{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||!t.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};const e=t.clone();e.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(e),e.bandCount=3,e.statistics=[{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20}],this.rasterInfo=e;const n=[...t.colormap].sort((t,e)=>t[0]-e[0]),{indexedColormap:s,offset:r}=(0,$t.zg)({colormap:n});return s?(this.lookup={indexedColormap:s,offset:r},{success:!0,supportsGPU:(0,ke.WN)(s)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(t){let e=t.pixelBlocks?.[0];if(!e||!this.lookup)return e;e=e.clone();const n=e.pixels[0],s=e.mask??new Uint8Array(n.length).fill(255),r=new Uint8Array(n.length),o=new Uint8Array(n.length),i=new Uint8Array(n.length),{indexedColormap:a,offset:u}=this.lookup,l=a.length;for(let t=0;t<n.length;t++)if(s[t]){let e=4*(n[t]-u);e<0||e>l-4?s[t]=0:(r[t]=a[e++],o[t]=a[e++],i[t]=a[e++])}return e.pixels=[r,o,i],e.statistics=[new Ne.z(0,255),new Ne.z(0,255),new Ne.z(0,255)],e.pixelType=this.outputPixelType,e}_getWebGLParameters(){return this.lookup}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ie.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Re,json:{write:!0,name:"rasterFunctionArguments"}})],Ie.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Ie.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Ie.prototype,"lookup",void 0),Ie=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ColormapToRGBFunction")],Ie);const Se=Ie;var _e,Fe=n(43937);let Be=_e=class extends p{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map(t=>"number"==typeof t||"string"==typeof t?t:t.toJSON())}clone(){return new _e({rasters:(0,o.o8)(this.rasters)})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Be.prototype,"rasters",void 0),(0,i.Cg)([(0,Fe.K)("rasters")],Be.prototype,"writeRasters",null),Be=_e=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.CompositeBandFunctionArguments")],Be);const je=Be;let Ze=class extends w{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();if(n.attributeTable=null,n.colormap=null,n.pixelType=this.outputPixelType,n.bandCount=t.map(({bandCount:t})=>t).reduce((t,e)=>t+e),t.every(({statistics:t})=>null!=t&&t.length)){const e=[];t.forEach(({statistics:t})=>null!=t&&e.push(...t)),n.statistics=e}if(t.every(({histograms:t})=>null!=t&&t.length)){const e=[];t.forEach(({histograms:t})=>null!=t&&e.push(...t)),n.histograms=e}n.multidimensionalInfo&&n.multidimensionalInfo.variables.forEach(e=>{const n=t.map(t=>t.multidimensionalInfo?.variables.find(({name:t})=>t===e.name)),s=n.map(t=>t?.statistics?.length?t.statistics:null),r=n.map(t=>t?.histograms?.length?t.histograms:null);e.statistics=s.every(t=>null!=t)?s.flat():null,e.histograms=r.every(t=>null!=t)?r.flat():null}),n.bandCount>1&&(n.colormap=null,n.attributeTable=null);const s=t.every(t=>t.keyProperties.BandProperties?.length)?t.flatMap(t=>t.keyProperties.BandProperties):void 0;return n.keyProperties={...n.keyProperties,BandProperties:s},this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;if(!e)return null;const n=e?.[0];return null==n?null:(0,$t.Wy)(e)}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ze.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:je,json:{write:!0,name:"rasterFunctionArguments"}})],Ze.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Ze.prototype,"rasterArgumentNames",void 0),Ze=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.CompositeBandFunction")],Ze);const Ge=Ze,ze=new Et.J({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),Oe=new Et.J({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});var Ee;let De=Ee=class extends p{constructor(){super(...arguments),this.method="difference",this.keepMethod="all",this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new Ee({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};(0,i.Cg)([(0,Yt.e)(ze)],De.prototype,"method",void 0),(0,i.Cg)([(0,Yt.e)(Oe)],De.prototype,"keepMethod",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],De.prototype,"raster2",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],De.prototype,"rasters",null),De=Ee=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ComputeChangeFunctionArguments")],De);const Ve=De;var Ue=n(20437);let Le=class extends w{constructor(){super(...arguments),this.functionName="ComputeChange",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{method:t}=this.functionArguments,e=this.sourceRasterInfos[0].clone();if(this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),"categorical"===t){const t=this.sourceRasterInfos.map(t=>t.attributeTable),n=this._getFieldNames(t,"value"),s=t.map(t=>this._getClassFieldName(t));if(null==n[0]||null==n[1]||null==s[0]||null==s[1])return{success:!1,supportsGPU:!1,error:"both inputs must have proper attribute table with value and class fields"};this._updateAttributeTable(e,n,s)}return e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:"difference"===t||"relative-difference"===t}}_processPixels(t){const{pixelBlocks:e}=t;if(null==e?.[0]||null==e?.[1])return null;const{method:n}=this.functionArguments;return function(t,e,n,s){const[r,o]=t,i=(0,u.zw)(n)&&!(0,u.zw)(r.pixelType)&&!(0,u.zw)(o.pixelType),a=[r.mask,o.mask].filter(t=>t),l=g.A.combineBandMasks(a),c=t.map(t=>t.pixels[0]),{width:p,height:h}=r,m=g.A.createEmptyBand(n,p*h);switch(e){case"difference":case"relative-difference":!function(t){const{bands:[e,n],mask:s,isRelative:r,isRoundingNeeded:o,outBand:i}=t,a=e.length;for(let t=0;t<a;t++)if(!s||s[t]){let s=e[t]-n[t];if(r){const r=Math.max(Math.abs(e[t])-Math.abs(n[t]));s=r>0?s/r:0}i[t]=o?Math.round(s):s}}({bands:c,mask:l,outBand:m,isRoundingNeeded:i,isRelative:"relative-difference"===e});break;case"categorical":!function(t){const{bands:[e,n],categoryIndexLookups:[s,r],classNames:[o,i],mask:a,keepMethod:u,outBand:l}=t,c=e.length,p=o.length,h=i.length,m=p*h,f=m+1,g=m+2;for(let t=0;t<c;t++)if(!a||a[t]){const a=e[t],c=n[t],p=s[a],d=r[c],y=o[p],x=i[d];l[t]=null==p||null==d?m:"changed"===u&&y===x?f:"unchanged"===u&&y!==x?g:p*h+d}}({bands:c,mask:l,outBand:m,...s});break;case"euclidean-distance":!function(t){const{pixels:[e,n],mask:s,outBand:r}=t,o=e[0].length,i=e.length;for(let t=0;t<o;t++)if(!s||s[t]){let s=0;for(let r=0;r<i;r++){const o=e[r][t]-n[r][t];s+=o*o}r[t]=Math.sqrt(s)}}({pixels:t.map(t=>t.pixels),mask:l,outBand:m});break;case"angle-difference":!function(t){const{pixels:[e,n],mask:s,outBand:r}=t,o=e[0].length,i=e.length;for(let t=0;t<o;t++)if(!s||s[t]){let s=0,o=0,a=0;for(let r=0;r<i;r++){const i=e[r][t],u=n[r][t];s+=i*u,o+=i*i,a+=u*u}const u=Math.sqrt(o*a);r[t]=u?Math.acos(s/u):1.5707963267948966}}({pixels:t.map(t=>t.pixels),mask:l,outBand:m});break;case"band-with-most-change":!function(t){const{pixels:[e,n],mask:s,outBand:r}=t,o=e[0].length,i=e.length;for(let t=0;t<o;t++)if(!s||s[t]){let s=0,o=0;for(let r=0;r<i;r++){const i=Math.abs(e[r][t]-n[r][t]);i>s&&(s=i,o=r)}r[t]=o}}({pixels:t.map(t=>t.pixels),mask:l,outBand:m})}const f=new g.A({width:p,height:h,pixels:[m],pixelType:n,mask:l});return f.updateStatistics(),f}(e,n,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){const t=this.outputPixelType??"f32";let[e,n]=(0,u.hP)(t);const s=(0,u.zw)(t);return s&&(e-=1e-4,n+=1e-4),{method:this.functionArguments.method,domainRange:[e,n],isOutputRounded:s}}_updateAttributeTable(t,e,n){const s=this.sourceRasterInfos.map(t=>t.attributeTable),r=s.map((t,n)=>t.features.map(t=>t.attributes[e[n]])),o=s.map((t,e)=>t.features.map(t=>t.attributes[n[e]])),i=r.map(t=>{const e=[];return t.forEach((t,n)=>e[t]=n),e}),{keepMethod:a}=this.functionArguments;this._categoryConfig={categoryIndexLookups:i,classNames:o,keepMethod:a};const u=s[0].clone();u.fields=[new Ue.A({name:"OID",type:"oid"}),new Ue.A({name:"Value",type:"integer"}),new Ue.A({name:"ClassName",type:"string"}),new Ue.A({name:"Class_From",type:"string"}),new Ue.A({name:"Class_To",type:"string"})];const l=this._getFieldNames(s,"red"),c=this._getFieldNames(s,"green"),p=this._getFieldNames(s,"blue"),h=[],m=2===l.length&&2===c.length&&2===p.length;m&&(h.push(...s.map((t,e)=>t.features.map(t=>[t.attributes[l[e]],t.attributes[c[e]],t.attributes[p[e]]]))),u.fields.push(new Ue.A({name:"Red",type:"integer"}),new Ue.A({name:"Green",type:"integer"}),new Ue.A({name:"Blue",type:"integer"})));const f=u.features[0].clone();f.geometry=null;const g=[],[d,y]=r.map(t=>t.length);let x=1;for(let t=0;t<d;t++){const e=o[0][t];for(let n=0;n<y;n++){const s=o[1][n];if("changed"===a&&e===s||"unchanged"===a&&e!==s)continue;const r=f.clone();r.attributes={OID:x++,Value:t*y+n,ClassName:e===s?e:`${e} -> ${s}`,Class_From:e,Class_To:s},m&&(r.attributes.Red=h[0][t][0]+h[1][n][0]>>1,r.attributes.Green=h[0][t][1]+h[1][n][1]>>1,r.attributes.Blue=h[0][t][2]+h[1][n][2]>>1),g.push(r)}}if("changed"===a){const t=f.clone();t.attributes={OID:x++,Value:d*y+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},g.push(t)}else if("unchanged"===a){const t=f.clone();t.attributes={OID:x++,Value:d*y+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},g.push(t)}u.features=g,t.attributeTable=u}_getFieldNames(t,e){return t.map(({fields:t})=>t.find(t=>t.name.toLowerCase()===e)?.name).filter(t=>t)}_getClassFieldName(t){const e=t.fields.find(t=>"string"===t.type&&t.name.toLowerCase().startsWith("class"))??t.fields.find(t=>"string"===t.type&&t.name.toLowerCase().includes("class")||t.name.toLowerCase().includes("type")||t.name.toLowerCase().includes("name"))??t.fields.find(t=>"string"===t.type);return e?.name}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Le.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Ve,json:{write:!0,name:"rasterFunctionArguments"}})],Le.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Le.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Le.prototype,"_categoryConfig",void 0),Le=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ComputeChangeFunction")],Le);const We=Le;var $e;let Ke=$e=class extends p{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new $e({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Ke.prototype,"contrastOffset",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Ke.prototype,"brightnessOffset",void 0),Ke=$e=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ContrastBrightnessFunctionArguments")],Ke);const He=Ke;var qe=n(51927);let Je=class extends w{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if("u8"!==e.pixelType)return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const n=e.clone();this._removeStatsHistColormapVAT(n),this.rasterInfo=n;const{contrastOffset:s,brightnessOffset:r}=this.functionArguments;return this.lookup=(0,qe.zj)(s,r),{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:(0,$t.eH)(e,{lut:e.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Je.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:He,json:{write:!0,name:"rasterFunctionArguments"}})],Je.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Je.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Je.prototype,"lookup",void 0),Je=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ContrastBrightnessFunction")],Je);const Xe=Je;function Ye(t,e,n,s,r){const o=Math.floor(s/2);for(let s=0;s<o;s++)for(let o=0;o<e;o++)t[s*e+o]=t[(r-1-s)*e+o],t[(n-1-s)*e+o]=t[(n-r+s)*e+o];const i=Math.floor(r/2);for(let s=0;s<n;s++){const n=s*e;for(let s=0;s<i;s++)t[n+s]=t[n+r-1-s],t[n+e-s-1]=t[n+e+s-r]}}const Qe=new Map;function tn(t,e,n,s,r,o,i){const a=new Float32Array(e*n),u=o.length,l=i?0:s,c=i?s:0,p=i?1:e;for(let i=l;i<n-l;i++){const n=i*e;for(let i=c;i<e-c;i++){if(r&&!r[n+i])continue;let e=0;for(let r=0;r<u;r++)e+=t[n+i+(r-s)*p]*o[r];a[n+i]=e}}return a}function en(t,e,n,s,r,o,i){const a=new Float32Array(e*n),u=Math.floor(s/2),l=Math.floor(r/2);for(let c=u;c<n-u;c++){const n=c*e;for(let c=l;c<e-l;c++){if(o&&!o[n+c])continue;let p=0;for(let o=0;o<s;o++)for(let s=0;s<r;s++)p+=t[n+c+(o-u)*e+s-l]*i[o*r+s];a[n+c]=p}}return a}var nn;Qe.set(A.none,[0,0,0,0,1,0,0,0,0]),Qe.set(A.lineDetectionHorizontal,[-1,-1,-1,2,2,2,-1,-1,-1]),Qe.set(A.lineDetectionVertical,[-1,2,-1,-1,2,-1,-1,2,-1]),Qe.set(A.lineDetectionLeftDiagonal,[2,-1,-1,-1,2,-1,-1,-1,2]),Qe.set(A.lineDetectionRightDiagonal,[-1,-1,2,-1,2,-1,2,-1,-1]),Qe.set(A.gradientNorth,[-1,-2,-1,0,0,0,1,2,1]),Qe.set(A.gradientWest,[-1,0,1,-2,0,2,-1,0,1]),Qe.set(A.gradientEast,[1,0,-1,2,0,-2,1,0,-1]),Qe.set(A.gradientSouth,[1,2,1,0,0,0,-1,-2,-1]),Qe.set(A.gradientNorthEast,[0,-1,-2,1,0,-1,2,1,0]),Qe.set(A.gradientNorthWest,[-2,-1,0,-1,0,1,0,1,2]),Qe.set(A.smoothArithmeticMean,[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111]),Qe.set(A.smoothing3x3,[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625]),Qe.set(A.smoothing5x5,[1,1,1,1,1,1,4,4,4,1,1,4,12,4,1,1,4,4,4,1,1,1,1,1,1]),Qe.set(A.sharpening3x3,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Qe.set(A.sharpening5x5,[-1,-3,-4,-3,-1,-3,0,6,0,-3,-4,6,21,6,-4,-3,0,6,0,-3,-1,-3,-4,-3,-1]),Qe.set(A.laplacian3x3,[0,-1,0,-1,4,-1,0,-1,0]),Qe.set(A.laplacian5x5,[0,0,-1,0,0,0,-1,-2,-1,0,-1,-2,17,-2,-1,0,-1,-2,-1,0,0,0,-1,0,0]),Qe.set(A.sobelHorizontal,[-1,-2,-1,0,0,0,1,2,1]),Qe.set(A.sobelVertical,[-1,0,1,-2,0,2,-1,0,1]),Qe.set(A.sharpen,[0,-.25,0,-.25,2,-.25,0,-.25,0]),Qe.set(A.sharpen2,[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25]),Qe.set(A.pointSpread,[-.627,.352,-.627,.352,2.923,.352,-.627,.352,-.627]);let sn=nn=class extends p{constructor(){super(...arguments),this.rows=3,this.cols=3,this.kernel=[0,0,0,0,1,0,0,0,0]}set convolutionType(t){this._set("convolutionType",t);const e=Qe.get(t);if(!e||t===A.userDefined||t===A.none)return;const n=Math.sqrt(e.length);this._set("kernel",e),this._set("cols",n),this._set("rows",n)}clone(){return new nn({cols:this.cols,rows:this.rows,kernel:[...this.kernel],convolutionType:this.convolutionType,raster:(0,o.o8)(this.raster)})}};(0,i.Cg)([(0,a.MZ)({json:{type:Number,write:!0}})],sn.prototype,"rows",void 0),(0,i.Cg)([(0,a.MZ)({json:{type:Number,write:!0}})],sn.prototype,"cols",void 0),(0,i.Cg)([(0,a.MZ)({json:{name:"type",type:Number,write:!0}})],sn.prototype,"convolutionType",null),(0,i.Cg)([(0,a.MZ)({json:{type:[Number],write:!0}})],sn.prototype,"kernel",void 0),sn=nn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ConvolutionFunctionArguments")],sn);const rn=sn;let on=class extends w{constructor(){super(...arguments),this.functionName="Convolution",this.rasterArgumentNames=["raster"]}get _normalizedKernel(){const{kernel:t,convolutionType:e}=this.functionArguments,n=t.reduce((t,e)=>t+e);return-1===e||0===n||1===n?t:t.map(t=>t/n)}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:n,kernel:s}=this.functionArguments;if(!Object.values(A).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==A.none&&e*n!==s.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const o=r.clone();o.pixelType=this.outputPixelType;const i=[A.none,A.sharpen,A.sharpen2,A.sharpening3x3,A.sharpening5x5];return(-1===t||"u8"!==this.outputPixelType&&!i.includes(t))&&(o.statistics=null,o.histograms=null),o.colormap=null,o.attributeTable=null,this.rasterInfo=o,{success:!0,supportsGPU:s.length<=25}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e||this.functionArguments.convolutionType===A.none)return e;const{rows:n,cols:s}=this.functionArguments,{_normalizedKernel:r}=this;return function(t,e){const n=function(t){const e=Math.sqrt(t.length),n=t.slice(0,e),s=[1];for(let n=1;n<e;n++){let r=null;for(let s=0;s<e;s++){const o=t[s+n*e],i=t[s];if(null==r)if(0===i){if(o)return{separable:!1,row:null,col:null}}else r=o/i;else if(o/i!==r)return{separable:!1,row:null,col:null}}if(null==r)return{separable:!1,row:null,col:null};s.push(r)}return{separable:!0,row:n,col:s}}(e.kernel),s=!1!==e.mirrorEdges,r=n.separable?function(t,e,n,s=!0){const{pixels:r,width:o,height:i,pixelType:a,mask:u}=t,l=r.length,c=[],p=e.length,h=n.length,m=Math.floor(p/2),f=Math.floor(h/2);for(let t=0;t<l;t++){let a=tn(r[t],o,i,m,u,e,!0);a=tn(a,o,i,f,u,n,!1),s&&Ye(a,o,i,p,h),c.push(a)}return new g.A({width:o,height:i,pixelType:a,pixels:c,mask:u})}(t,n.row,n.col,s):function(t,e,n=!0){const{pixels:s,width:r,height:o,pixelType:i,mask:a}=t,u=s.length,l=[],{kernel:c,rows:p,cols:h}=e;for(let t=0;t<u;t++){const e=en(s[t],r,o,p,h,a,c);n&&Ye(e,r,o,p,h),l.push(e)}return new g.A({width:r,height:o,pixelType:i,pixels:l,mask:a})}(t,e,s),{outputPixelType:o}=e;return o&&r.clamp(o),r}(e,{kernel:r,rows:n,cols:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=new Float32Array(25),{rows:e,cols:n}=this.functionArguments,{_normalizedKernel:s}=this;for(let r=0;r<e;r++)for(let e=0;e<n;e++)t[5*r+e]=s[r*n+e];return{kernelRows:e,kernelCols:n,kernel:t,clampRange:(0,u.hP)(this.outputPixelType)}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],on.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:rn,json:{write:!0,name:"rasterFunctionArguments"}})],on.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],on.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)()],on.prototype,"_normalizedKernel",null),on=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ConvolutionFunction")],on);const an=on;var un;const ln=new Et.J({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let cn=un=class extends p{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(t,e){return ln.fromJSON(e.type??e.curvatureType??0)}clone(){return new un({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};(0,i.Cg)([(0,a.MZ)({json:{write:{target:"type"}}}),(0,Yt.e)(ln)],cn.prototype,"curvatureType",void 0),(0,i.Cg)([(0,ye.w)("curvatureType",["type","curvatureType"])],cn.prototype,"readCurvatureType",null),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],cn.prototype,"zFactor",void 0),cn=un=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.CurvatureFunctionArguments")],cn);const pn=cn;let hn=class extends w{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{zFactor:n,curvatureType:s}=this.functionArguments,{extent:r,primaryPixelSizes:o}=t,i=o?.[0],a=i??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),u=this.isGCS&&n>=1?n*Gt.rk:n;return(0,Gt.E0)(e,{zFactor:u,curvatureType:s,resolution:a})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Gt.rk:t}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],hn.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:pn,json:{write:!0,name:"rasterFunctionArguments"}})],hn.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],hn.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],hn.prototype,"isGCS",void 0),hn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.CurvatureFunction")],hn);const mn=hn;var fn;let gn=fn=class extends p{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=0}clone(){return new fn({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],gn.prototype,"bandIds",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],gn.prototype,"bandNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],gn.prototype,"bandWavelengths",void 0),(0,i.Cg)([(0,Yt.e)({0:"name",1:"wavelength",2:"id"})],gn.prototype,"method",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],gn.prototype,"missingBandAction",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],gn.prototype,"wavelengthMatchTolerance",void 0),gn=fn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ExtractBandFunctionArguments")],gn);const dn=gn;let yn=class extends w{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:e}=this,n=e[0],{method:s,bandNames:r,bandWavelengths:o,bandIds:i,missingBandAction:a}=t,u=r?.length&&("name"===s||"id"!==s&&!i?.length),l=o?.length&&("wavelength"===s||"id"!==s&&!i?.length),c=1===a,p=u?function(t,e){const n=t.bandInfos.map(({name:t})=>t.toLowerCase()),s=[];for(let t=0;t<e.length;t++){const r=e[t].toLowerCase();let o=n.indexOf(r);if(-1===o&&"nearinfrared"===r&&(o=n.findIndex(t=>t.startsWith("nearinfrared_1")),-1===o&&(o=n.findIndex(t=>t.startsWith("nearinfrared")))),-1===o)return null;s.push(o)}return s}(n,r):l?function(t,e,{wavelengthMatchTolerance:n},s){const{bandInfos:r}=t,o=[];for(let t=0;t<r.length;t++){const{minWavelength:e,maxWavelength:n}=r[t];if(!e||!n)return null;o.push({minWavelength:e,maxWavelength:n})}const i=[];for(let t=0;t<e.length;t++){const r=e[t];let a=!1,u=-1,l=Number.MAX_VALUE;for(let t=0;t<o.length;t++){const e=o[t],n=r>=e.minWavelength&&r<=e.maxWavelength,s=Math.abs(r-(e.minWavelength+e.maxWavelength)/2);n?s<l&&(a=!0,u=t,l=s):!a&&s<l&&(u=t,l=s)}if(!a&&n&&l<n&&(a=!0),!a&&s)return null;i.push(u)}return i}(n,o,this.functionArguments,c):function(t,e,n){const{bandCount:s}=t;return!e?.length||n&&e.some(t=>t<0||t>=s)?null:e}(n,i,c);if(null==p)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${u?"band names":l?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const h=n.clone();h.pixelType=this.outputPixelType,h.bandCount=p.length;const{statistics:m,histograms:f}=h;null!=m&&m.length&&(h.statistics=p.map(t=>m[t]||m[m.length-1])),null!=f&&f.length&&(h.histograms=p.map(t=>f[t]||f[f.length-1])),h.multidimensionalInfo&&h.multidimensionalInfo.variables.forEach(t=>{const{statistics:e,histograms:n}=t;null!=e&&e.length&&(t.statistics=p.map(t=>e[t]||e[e.length-1])),null!=n&&n.length&&(t.histograms=p.map(t=>n[t]||n[n.length-1]))});let g=h.keyProperties?.BandProperties;return g?.length&&(g=p.map(t=>t>=g.length?g[g.length-1]:g[t]),h.keyProperties={...h.keyProperties,BandProperties:g}),this.rasterInfo=h,{success:!0,supportsGPU:h.bandCount<=3}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;let{bandIds:n}=this.functionArguments;if(this.rasterInfo.storageInfo.isBsqTile){const{rawInputBandIds:t}=this;n=n.map(e=>t.indexOf(e))}else{const t=e.pixels.length;n=n.map(e=>e>=t?t-1:e)}return e.extractBands(n)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],0===t.length?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:qt(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map(t=>t>=e?e-1:t).map(e=>t[e])}_swizzleBandIds(t){const e=this.functionArguments.bandIds.map(e=>t.indexOf(e));return this.isInputBandIdsSwizzled=!0,e[1]??=e[0],e[2]??=e[1],this.swizzledBandSelection=e,!1}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],yn.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:dn,json:{write:!0,name:"rasterFunctionArguments"}})],yn.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],yn.prototype,"rasterArgumentNames",void 0),yn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ExtractBandFunction")],yn);const xn=yn;var wn;let An=wn=class extends p{clone(){return new wn({conversionParameters:[...this.conversionParameters],raster:this.raster})}};(0,i.Cg)([(0,a.MZ)({type:[Number],json:{write:!0}})],An.prototype,"conversionParameters",void 0),An=wn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.GrayscaleFunctionArguments")],An);const vn=An;let bn=class extends w{constructor(){super(...arguments),this.functionName="Grayscale",this.functionArguments=null,this.rasterArgumentNames=["raster"]}get _normalizedWeights(){const{conversionParameters:t}=this.functionArguments,e=t.reduce((t,e)=>t+e);return t.map(t=>t/e)}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!t?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const n=3===t.length||3===e.bandCount&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:n}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:function(t,e,n){const{pixels:s,width:r,height:o,mask:i,bandMasks:a}=t,l=r*o,c=a?.length?g.A.combineBandMasks(a):i,p=Math.min(e.length,s.length),h=n.startsWith("f"),m=!h&&n!==t.pixelType,[f,d]=(0,u.hP)(n),y=g.A.createEmptyBand(n,l);for(let t=0;t<o;t++){let n=t*r;for(let t=0;t<r;t++,n++)if(!c||c[n]){let t=0;for(let r=0;r<p;r++)t+=e[r]*s[r][n];h||(t=Math.round(t),m&&(t=t>d?d:t<f?f:t)),y[n]=t}}const x=new g.A({width:r,height:o,pixels:[y],pixelType:n,mask:c});return x.updateStatistics(),x}(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],bn.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:vn,json:{write:!0,name:"rasterFunctionArguments"}})],bn.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],bn.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)()],bn.prototype,"_normalizedWeights",null),bn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.GrayscaleFunction")],bn);const Cn=bn;var Mn;const Pn=new Et.J({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),Tn=new Et.J({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let Rn=Mn=class extends p{constructor(){super(...arguments),this.altitude=45,this.azimuth=315,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.slopeType="degree",this.zFactor=1,this.removeEdgeEffect=!1}clone(){return new Mn({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Rn.prototype,"altitude",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Rn.prototype,"azimuth",void 0),(0,i.Cg)([(0,a.MZ)(),(0,Yt.e)(Pn)],Rn.prototype,"hillshadeType",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0,name:"psPower"}})],Rn.prototype,"pixelSizePower",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0,name:"psZFactor"}})],Rn.prototype,"pixelSizeFactor",void 0),(0,i.Cg)([(0,a.MZ)(),(0,Yt.e)(Tn)],Rn.prototype,"slopeType",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Rn.prototype,"zFactor",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],Rn.prototype,"removeEdgeEffect",void 0),Rn=Mn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.HillshadeFunctionArguments")],Rn);const Nn=Rn;let kn=class extends w{constructor(){super(...arguments),this.functionName="Hillshade",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"hillshade-function: source data must be single band"};this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone();return this._removeStatsHistColormapVAT(e),e.pixelType=this.outputPixelType,e.bandCount=1,e.statistics=[{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],o=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1}),i=(0,Gt.PP)(this.functionArguments,o,this.isGCS),a=(0,Gt.fw)(e,i);return a.pixelType=this.outputPixelType,a}_getWebGLParameters(){const t=(0,Gt.PP)(this.functionArguments,{x:1,y:1},this.isGCS),e=(0,Gt.ng)(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:o}=this.functionArguments,i="scaled"===n,a=(0,u.zw)(this.outputPixelType);return{...e,zFactor:s,gcsFactor:this.isGCS?Gt.rk:1,pixelSizeFactor:i?r:0,pixelSizePower:i?o:0,isOutputRounded:a}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],kn.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Nn,json:{write:!0,name:"rasterFunctionArguments"}})],kn.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],kn.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],kn.prototype,"isGCS",void 0),kn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.HillshadeFunction")],kn);const In=kn;var Sn;let _n=Sn=class extends p{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map(t=>"number"==typeof t||"string"==typeof t?t:t.toJSON())}clone(){return new Sn({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:(0,o.o8)(this.rasters)})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],_n.prototype,"operation",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],_n.prototype,"rasters",void 0),(0,i.Cg)([(0,Fe.K)("rasters")],_n.prototype,"writeRasters",null),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],_n.prototype,"processAsMultiband",void 0),_n=Sn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.LocalFunctionArguments")],_n);const Fn=_n;let Bn=class extends w{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{processAsMultiband:s}=this.functionArguments;if(t.some(t=>t.bandCount!==n))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:o}=this.functionArguments,i=R[r];if(!(999===i||o.length===i||o.length<=1&&1===i))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${i}`};const a=e.clone();return a.bandCount=999!==i||s?n:1,this._removeStatsHistColormapVAT(a),this._updateStatistics(a),this._updatePixelType(a),this.rasterInfo=a,{success:!0,supportsGPU:1===a.bandCount&&i<=3}}_processPixels(t){const{pixelBlocks:e}=t;return null==e||e.some(t=>null==t)?null:St(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=R[t],n=Object.keys(M).find(e=>M[e]===t)?.toLowerCase()??"undefined",s=this.outputPixelType??"f32";let[r,o]=(0,u.hP)(s);const i=(0,u.zw)(s);return i&&(r-=1e-4,o+=1e-4),{imageCount:e,operationName:n,domainRange:[r,o],isOutputRounded:i}}_updateStatistics(t){const e=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,s=T(n)?.domain;if(s){t.statistics=[];for(let e=0;e<t.bandCount;e++)t.statistics[e]={min:s[0],max:s[1],avg:(s[0]+s[1])/2,stddev:(s[0]+s[1])/10}}else 45===n&&e.statistics?.length&&(t.statistics=e.statistics.map(t=>({min:-t.max,max:-t.min,avg:null!=t.avg?-t.avg:void 0,stddev:null!=t.stddev?-t.stddev:void 0})))}_updatePixelType(t){const{statistics:e,pixelType:n}=this.sourceRasterInfos[0],{operation:s}=this.functionArguments,{domain:r,isInteger:o}=T(s)??{domain:null,isInteger:!1};let i="f32";if(r&&o)i=(0,u.X1)(r[0],r[1]);else if(30===s){const t=e?.[0];i=t?(0,u.X1)(t.min,t.max):(0,u.zw)(n)?n:"s32"}else if(45===s&&(0,u.zw)(n)){const t=e?.map(({max:t})=>-t),s=e?.map(({min:t})=>-t),r=t?.length?Math.min(...t):null,o=s?.length?Math.min(...s):null;i=null!=r&&null!=o?(0,u.X1)(r,o):n.startsWith("s")?n.replace("s","u"):"u1"===n||"u2"===n||"u4"===n?"s8":"u8"===n?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(i)}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Bn.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Fn,json:{write:!0,name:"rasterFunctionArguments"}})],Bn.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Bn.prototype,"rasterArgumentNames",void 0),Bn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.LocalFunction")],Bn);const jn=Bn;var Zn,Gn=n(34727);let zn=Zn=class extends p{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=0}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const n=t.map(t=>{if("number"==typeof t)return e=!0,[t];if("string"==typeof t){const n=t.trim().split(" ").filter(t=>""!==t.trim()).map(t=>Number(t));return e=e||n.length>0,0===n.length?null:n}return null});return e?n:null}clone(){return new Zn({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],zn.prototype,"includedRanges",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],zn.prototype,"noDataValues",void 0),(0,i.Cg)([(0,a.MZ)()],zn.prototype,"normalizedNoDataValues",null),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],zn.prototype,"noDataInterpretation",void 0),zn=Zn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.MaskFunctionArguments")],zn);const On=zn;let En=class extends w{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:n,normalizedNoDataValues:s}=this.functionArguments;if(!n?.length&&!s?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let o=0;o<t.bandCount;o++){const t=(0,$t.Wt)(e,n?.slice(2*o,2*o+2),s?.[o]);if(null==t){r=null;break}r.push(t)}this.lookups=r;const o=null!=s&&s.every(t=>t?.length===s[0]?.length);return{success:!0,supportsGPU:(!n||n.length<=2*$t.et)&&(!s||o&&s[0].length<=$t.et)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{outputPixelType:n,lookups:s}=this,{includedRanges:r,noDataInterpretation:o,normalizedNoDataValues:i}=this.functionArguments;return(0,$t.dK)(e,{includedRanges:r,noDataValues:i,outputPixelType:n,matchAll:1===o,lookups:s})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,n=new Float32Array($t.et);n.fill(Gn.pq),e?.[0]?.length&&n.set(e[0]);const s=new Float32Array(6);for(let e=0;e<s.length;e+=2)s[e]=t?.[e]??-Gn.pq,s[e+1]=t?.[e+1]??Gn.pq;return t?.length&&s.set(t),{bandCount:this.sourceRasterInfos[0].bandCount,noDataValues:n,includedRanges:s}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],En.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:On,json:{write:!0,name:"rasterFunctionArguments"}})],En.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],En.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],En.prototype,"lookups",void 0),En=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.MaskFunction")],En);const Dn=En;var Vn;let Un=Vn=class extends p{constructor(){super(...arguments),this.visibleBandID=0,this.infraredBandID=1,this.scientificOutput=!1}clone(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this;return new Vn({visibleBandID:t,infraredBandID:e,scientificOutput:n})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Un.prototype,"visibleBandID",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Un.prototype,"infraredBandID",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Un.prototype,"scientificOutput",void 0),Un=Vn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.NDVIFunctionArguments")],Un);const Ln=Un;let Wn=class extends w{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{scientificOutput:t,visibleBandID:e,infraredBandID:n}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(t?"f32":"u8");const s=this.sourceRasterInfos[0],r=Math.max(e,n);if(s.bandCount<2||r>=s.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};if(e<0||n<0)return{success:!1,supportsGPU:!1,error:"ndvi-function: invalid visible or infrared band id"};const o=s.clone();o.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(o),o.bandCount=1,o.keyProperties={...o.keyProperties,BandProperties:void 0};const[i,a,u,l]=t?[-1,1,0,.1]:[0,200,100,10];return o.statistics=[{min:i,max:a,avg:u,stddev:l}],this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;let{visibleBandID:n,infraredBandID:s,scientificOutput:r}=this.functionArguments;if(this.rasterInfo.storageInfo.isBsqTile){const{rawInputBandIds:t}=this;s=t.indexOf(s),n=t.indexOf(n)}return function(t,e,n,s){const{mask:r,pixels:o,width:i,height:a}=t,u=o[n],l=o[e],c=l.length,p=s?new Uint8Array(c):new Float32Array(c),h=s?100:1,m=s?100.5:0;for(let t=0;t<c;t++)if(null==r||r[t]){const e=u[t],n=l[t],s=e+n;s&&(p[t]=(e-n)/s*h+m)}const f=new g.A({width:i,height:a,mask:r,pixelType:s?"u8":"f32",pixels:[p]});return f.updateStatistics(),f}(e,n,s,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this.functionArguments;return{bandIndexMat3:qt(this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0]),scaled:!n}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments;return[n,e,0].map(e=>t[e])}_swizzleBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments,s=[e,n].map(e=>t.indexOf(e));return s[2]=s[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=s,!1}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Wn.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Ln,json:{write:!0,name:"rasterFunctionArguments"}})],Wn.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Wn.prototype,"rasterArgumentNames",void 0),Wn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.NDVIFunction")],Wn);const $n=Wn;var Kn;let Hn=Kn=class extends p{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new Kn({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Hn.prototype,"inputRanges",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Hn.prototype,"outputValues",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Hn.prototype,"noDataRanges",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Hn.prototype,"allowUnmatched",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Hn.prototype,"replacementValue",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Hn.prototype,"isLastInputRangeInclusive",void 0),Hn=Kn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.RemapFunctionArguments")],Hn);const qn=Hn;let Jn=class extends w{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;t.bandCount=1;const{statistics:n}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:s,replacementValue:r,outputValues:o,inputRanges:i,noDataRanges:a,isLastInputRangeInclusive:l}=this.functionArguments,c="unknown"===this.outputPixelType||null==this.outputPixelType;if(this.outputPixelType=this._getOutputPixelType(e),o?.length){const i=n?.[0];if(s&&null==r){let e=i?.min??o[0],n=i?.max??o[0];e=Math.min.apply(null,[...o,e]),n=Math.max.apply(null,[...o,n]),t.statistics=[{min:e,max:n,avg:i?.avg??0,stddev:i?.stddev??-1}]}else{let e=o[0],n=e;for(let t=0;t<o.length;t++)e=e>o[t]?o[t]:e,n=n>o[t]?n:o[t];s&&null!=r&&(e=Math.min(e,r),n=Math.max(n,r)),t.statistics=[{min:e,max:n,avg:i?.avg??0,stddev:i?.stddev??-1}]}if(c){const{min:n,max:i}=t.statistics[0],a=["u8","s8","u16","s16","u32","s32","f32"],l=a.find(t=>{const[e,s]=(0,u.hP)(t);return n>=e&&i<=s})??"f64";o.some(t=>Math.floor(t)!==t)?this.outputPixelType="f64"===l?"f64":"f32":this.outputPixelType=s&&null==r&&a.indexOf(e)>a.indexOf(l)?e:l}}return t.pixelType=this.outputPixelType,this.rasterInfo=t,this.lookup=s?null:(0,$t.XU)({srcPixelType:e,inputRanges:i,outputValues:o,noDataRanges:a,allowUnmatched:s,isLastInputRangeInclusive:l,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!o||o.length<=$t.et)&&(!a||a.length<=$t.et)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{lookup:n,outputPixelType:s}=this;if(n){const t=(0,$t.eH)(e,{lut:[n.lut],offset:n.offset,outputPixelType:s});return null!=t&&n.mask&&(t.mask=(0,$t.UK)(e.pixels[0],e.mask,n.mask,n.offset,"u8")),t}const{inputRanges:r,outputValues:o,noDataRanges:i,allowUnmatched:a,isLastInputRangeInclusive:u,replacementValue:l}=this.functionArguments;return(0,$t.Ew)(e,{inputRanges:r,outputValues:o,noDataRanges:i,outputPixelType:s,allowUnmatched:a,isLastInputRangeInclusive:u,replacementValue:l})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:n}=this.functionArguments,s=this.functionArguments.inputRanges??[],r=this.functionArguments.outputValues??[],o=(0,$t.bL)(s,r,n),i=new Float32Array(2*$t.et);return i.fill(Gn.pq),e?.length&&i.set(e),{allowUnmatched:t,rangeMaps:o,noDataRanges:i,clampRange:(0,u.hP)(this.outputPixelType),replacementValue:this.functionArguments.replacementValue}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Jn.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:qn,json:{write:!0,name:"rasterFunctionArguments"}})],Jn.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Jn.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Jn.prototype,"lookup",void 0),Jn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.RemapFunction")],Jn);const Xn=Jn;var Yn;let Qn=Yn=class extends Nn{readColorRamp(t){if("string"==typeof t){const e=ge.kH.jsonValues.find(e=>e.toLowerCase()===t.toLowerCase());return e?(0,ge.M5)(ge.kH.fromJSON(e)):null}return"toJSON"in t?t.toJSON():t}clone(){return new Yn({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,colorRamp:this.colorRamp,colormap:this.colormap,raster:this.raster})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Qn.prototype,"colorRamp",void 0),(0,i.Cg)([(0,ye.w)("colorRamp")],Qn.prototype,"readColorRamp",null),(0,i.Cg)([(0,a.MZ)({type:[[Number]],json:{write:!0}})],Qn.prototype,"colormap",void 0),Qn=Yn=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ShadedReliefFunctionArguments")],Qn);const ts=Qn;let es=class extends w{constructor(){super(...arguments),this.functionName="ShadedRelief",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: source data must be single band"};let{colorRamp:e,colormap:n}=this.functionArguments;if(!e&&!n?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a color ramp argument must be specified"};this.outputPixelType=this._getOutputPixelType("u8");const s=t.clone();this._removeStatsHistColormapVAT(s),s.pixelType=this.outputPixelType,s.bandCount=3,s.statistics=[{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=s,this.isGCS=s.spatialReference?.isGeographic??!1,n?.length||(n=(0,ge.R8)(e,{interpolateAlpha:!0}));const{indexedColormap:r,offset:o}=(0,$t.zg)({colormap:n});if(!r?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};const i=(0,ge.S2)(r);return this.lookup={indexedColormap:r,offset:o,hsvMap:i},{success:!0,supportsGPU:(0,ke.WN)(r)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e||!this.lookup)return null;let n=t.primaryPixelSizes?.[0];if(null==n){const{extent:s}=t;n=s?{x:s.width/e.width,y:s.height/e.height}:{x:1,y:1}}const s=(0,Gt.PP)(this.functionArguments,n,this.isGCS),r=(0,Gt.fw)(e,s),o=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return(0,Gt.SC)(r,e,this.lookup.hsvMap,o),r.pixelType=this.outputPixelType,r}_getWebGLParameters(){const t=(0,Gt.PP)(this.functionArguments,{x:1,y:1},this.isGCS),e=(0,Gt.ng)(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:o}=this.functionArguments,i="scaled"===n,{indexedColormap:a,offset:l}=this.lookup,c=this.sourceRasterInfos[0].statistics?.[0],p=(0,u.zw)(this.outputPixelType);return{...e,indexedColormap:a,offset:l,zFactor:s,gcsFactor:this.isGCS?Gt.rk:1,pixelSizeFactor:i?r:0,pixelSizePower:i?o:0,minValue:c?.min??0,maxValue:c?.max??8e3,isOutputRounded:p}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],es.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:ts,json:{write:!0,name:"rasterFunctionArguments"}})],es.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],es.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],es.prototype,"isGCS",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],es.prototype,"lookup",void 0),es=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.ShadedReliefFunction")],es);const ns=es;var ss;const rs=new Et.J({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let os=ss=class extends p{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new ss({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};(0,i.Cg)([(0,Yt.e)(rs)],os.prototype,"slopeType",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],os.prototype,"zFactor",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{name:"psPower",write:!0}})],os.prototype,"pixelSizePower",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{name:"psZFactor",write:!0}})],os.prototype,"pixelSizeFactor",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],os.prototype,"removeEdgeEffect",void 0),os=ss=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.SlopeFunctionArguments")],os);const is=os;let as=class extends w{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),t.statistics="percent-rise"!==this.functionArguments.slopeType?[{min:0,max:90,avg:1,stddev:1}]:null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:o}=this.functionArguments,{isGCS:i}=this,{extent:a,primaryPixelSizes:u}=t,l=u?.[0],c=l??(a?{x:a.width/e.width,y:a.height/e.height}:{x:1,y:1});return(0,Gt.yy)(e,{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:o,isGCS:i,resolution:c})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:n,pixelSizePower:s}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?t*Gt.rk:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:s??0,isOutputRounded:(0,u.zw)(this.outputPixelType)}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],as.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:is,json:{write:!0,name:"rasterFunctionArguments"}})],as.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],as.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],as.prototype,"isGCS",void 0),as=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.SlopeFunction")],as);const us=as,ls=new Et.J({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function cs(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:o,mask:i,outBand:a}=t;if(n&&!i)return void a.set(s);const{statisticsType:u,kernelRows:l,kernelCols:c}=e,p="stddev"===u,h=r*o,m=new Float64Array(h),f=new Float64Array(h),g=new Uint32Array(h);for(let t=0;t<o;t++){const e=t*r;let n=0,o=0,a=0;for(let t=0;t<c;t++)i&&!i[e+t]||(n+=s[e+t],p&&(o+=s[e+t]**2),a++);m[e]=n,f[e]=o,g[e]=a;for(let t=1;t<=r-c;t++){const r=e+t-1,u=r+c;i?(i[r]&&(a--,n-=s[r],p&&(o-=s[r]**2)),i[u]&&(a++,n+=s[u],p&&(o+=s[u]**2))):(n-=s[r],n+=s[u],p&&(o-=s[r]**2,o+=s[u]**2)),m[e+t]=n,g[e+t]=a,p&&(f[e+t]=o)}}const d=new Float64Array(h),y=new Float64Array(h),x=new Uint32Array(h),w=l*r;for(let t=0;t<=r-c;t++){let e=0,n=0,s=0;for(let o=0;o<l;o++){const i=o*r+t;e+=m[i],s+=g[i],p&&(n+=f[i])}d[t]=e,y[t]=n,x[t]=s;for(let i=1;i<=o-l;i++){const o=(i-1)*r+t,a=o+w;e-=m[o],e+=m[a],s-=g[o],s+=g[a],p&&(n-=f[o],n+=f[a]),d[i*r+t]=e,y[i*r+t]=n,x[i*r+t]=s}}const A=Math.floor(l/2),v=Math.floor(c/2);for(let t=A;t<o-A;t++){const e=t*r;for(let s=v;s<r-v;s++){const o=(t-A)*r+s-v,u=x[o];if(0===u||n&&(!i||i[e+s]))continue;const l=d[o]/u,c=p?Math.sqrt((y[o]-d[o]*l)/u):l;a[e+s]=c,i&&(i[e+s]=255)}}}function ps(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:o,mask:i,outBand:a}=t;if(n&&!i)return void a.set(s);const{kernelRows:u,kernelCols:l,statisticsType:c}=e,p=Math.floor(u/2),h=Math.floor(l/2),m="min"===c,f=a.slice(),g=new Uint32Array(r*o);for(let t=p;t<o-p;t++){const e=t*r;for(let t=h;t<r-h;t++){let n=m?Number.MAX_VALUE:-Number.MAX_VALUE,o=0;for(let a=0;a<u;a++)for(let u=0;u<l;u++){const l=e+t+(a-p)*r+u-h;i&&!i[l]||(n=m?Math.min(n,s[l]):Math.max(n,s[l]),o++)}i?(f[e+t]=0===o?0:n,g[e+t]=o):a[e+t]=0===o?0:n}}if(i)for(let t=p;t<o-p;t++){const e=t*r;for(let t=h;t<r-h;t++)if(g[e+t]){if(n&&i[e+t])continue;a[e+t]=f[e+t],i[e+t]=255}}}function hs(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:o,mask:i,outBand:a}=t;if(n&&!i)return void a.set(s);const{kernelRows:u,kernelCols:l}=e,c=Math.floor(u/2),p=Math.floor(l/2),h=a.slice(),m=new Uint32Array(r*o);for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++){if(n&&i?.[e+t])continue;const o=[];for(let n=0;n<u;n++)for(let a=0;a<l;a++){const u=e+t+(n-c)*r+a-p;i&&!i[u]||o.push(s[u])}o.length&&(o.sort((t,e)=>t-e),i?(h[e+t]=o[Math.floor((o.length-1)/2)],m[e+t]=o.length):a[e+t]=o[Math.floor((o.length-1)/2)])}}if(i)for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++)if(m[e+t]){if(n&&i[e+t])continue;a[e+t]=h[e+t],i[e+t]=255}}}function ms(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:o,mask:i,outBand:a}=t;if(n&&!i)return void a.set(s);const{kernelRows:u,kernelCols:l}=e,c=Math.floor(u/2),p=Math.floor(l/2),h="majority"===e.statisticsType,m=u*l,f=a.slice(),g=new Uint32Array(r*o);for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++){if(n&&i?.[e+t])continue;const o=new Map;for(let n=0;n<u;n++)for(let a=0;a<l;a++){const u=e+t+(n-c)*r+a-p;if(i&&!i[u])continue;const l=s[u];o.set(l,o.has(l)?o.get(l)+1:1)}if(0===o.size)continue;let d=0,y=0,x=h?0:m+1;for(const t of o.keys())y=o.get(t),h===y>x&&(x=y,d=t);i?(f[e+t]=d,g[e+t]=o.size):a[e+t]=d}}if(i)for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++)if(g[e+t]){if(n&&i[e+t])continue;a[e+t]=f[e+t],i[e+t]=255}}}var fs;let gs=fs=class extends p{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new fs({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:(0,o.o8)(this.raster)})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,read:{source:["kernelRows","rows"],reader:(t,e)=>Number(t??e?.kernelRows??3)}}})],gs.prototype,"rows",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,e)=>Number(t??e?.kernelCols??3)}}})],gs.prototype,"cols",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],gs.prototype,"fillNoDataOnly",void 0),(0,i.Cg)([(0,a.MZ)({json:{read:{source:["statisticsType","type"],reader:(t,e)=>ls.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),(0,Yt.e)(ls)],gs.prototype,"statisticsType",void 0),gs=fs=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsFunctionArguments")],gs);const ds=gs;let ys=class extends w{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();n.pixelType=this.outputPixelType;const{statisticsType:s}=this.functionArguments;return"stddev"===s&&this._removeStatsHistColormapVAT(n),this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3&&t<5}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{statisticsType:n,rows:s,cols:r,fillNoDataOnly:o}=this.functionArguments;return function(t,e){const{mask:n}=t,{fillNoDataOnly:s}=e;if(s&&!n)return t;const{pixels:r,width:o,height:i,bandMasks:a,pixelType:u}=t,l=r.length,c=o*i,p=[],{kernelRows:h,kernelCols:m,statisticsType:f,mirrorEdges:d}=e;if(s&&!n)return t;const y=e.outputPixelType??u,x=[];for(let t=0;t<l;t++){const u=r[t],l=g.A.createEmptyBand(y,c);s&&l.set(u);const w=a?.[t]??n,A=w?.slice()??null,v={band:u,width:o,height:i,mask:A,outBand:l};switch(f){case"min":case"max":ps(v,e);break;case"mean":case"stddev":cs(v,e);break;case"median":hs(v,e);break;case"majority":case"minority":ms(v,e)}d&&!s&&Ye(l,o,i,h,m),p.push(l),A&&x.push(A)}let w=x[0]??n;x.length!==l&&(x.length=0),l>1&&a?.length&&(w=g.A.combineBandMasks(a));const A=new g.A({pixelType:y,width:o,height:i,pixels:p,bandMasks:a&&x.length?x:null,mask:w});return A.updateStatistics(),A}(e,{kernelRows:s,kernelCols:r,fillNoDataOnly:o,outputPixelType:this.outputPixelType,statisticsType:n,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:n,fillNoDataOnly:s}=this.functionArguments;return{fillNoDataOnly:s,kernelRows:t,kernelCols:e,statisticsType:n,clampRange:(0,u.hP)(this.outputPixelType)}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ys.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:ds,json:{write:!0,name:"rasterFunctionArguments"}})],ys.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],ys.prototype,"rasterArgumentNames",void 0),ys=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsFunction")],ys);const xs=ys;var ws;let As=ws=class extends p{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const n=[];return t.forEach(t=>{const e={min:t.min,max:t.max,avg:t.avg??t.mean,stddev:t.stddev??t.standardDeviation};n.push(e)}),n}writeStatistics(t,e,n){if(!t?.length)return;const s=[];t.forEach(t=>{const e={...t,mean:t.avg,standardDeviation:t.stddev};delete e.avg,delete e.stddev,s.push(e)}),e[n]=s}clone(){return new ws({statistics:(0,o.o8)(this.statistics),histograms:(0,o.o8)(this.histograms)})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],As.prototype,"statistics",void 0),(0,i.Cg)([(0,ye.w)("statistics")],As.prototype,"readStatistics",null),(0,i.Cg)([(0,Fe.K)("statistics")],As.prototype,"writeStatistics",null),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],As.prototype,"histograms",void 0),As=ws=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsHistogramFunctionArguments")],As);const vs=As;let bs=class extends w{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:n,histograms:s}=this.functionArguments;return s&&(e.histograms=s),n&&(e.statistics=n),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],bs.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:vs,json:{write:!0,name:"rasterFunctionArguments"}})],bs.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],bs.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],bs.prototype,"indexedColormap",void 0),(0,i.Cg)([(0,a.MZ)()],bs.prototype,"isNoopProcess",void 0),bs=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.StatisticsHistogramFunction")],bs);const Cs=bs;var Ms;const Ps=new Et.J({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let Ts=Ms=class extends p{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,n){t?.length&&(Array.isArray(t[0])||(t=t.map(t=>[t.min,t.max,t.avg,t.stddev])),e[n]=t)}clone(){return new Ms({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:(0,o.o8)(this.statistics),gamma:(0,o.o8)(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:(0,o.o8)(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],Ts.prototype,"computeGamma",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{name:"dra",write:!0}})],Ts.prototype,"dynamicRangeAdjustment",void 0),(0,i.Cg)([(0,a.MZ)({type:[Number],json:{write:!0}})],Ts.prototype,"gamma",void 0),(0,i.Cg)([(0,a.MZ)()],Ts.prototype,"histograms",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Ts.prototype,"maxPercent",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Ts.prototype,"minPercent",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Ts.prototype,"numberOfStandardDeviations",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{name:"max",write:!0}})],Ts.prototype,"outputMax",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{name:"min",write:!0}})],Ts.prototype,"outputMin",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],Ts.prototype,"sigmoidStrengthLevel",void 0),(0,i.Cg)([(0,a.MZ)({json:{type:[[Number]],write:!0}})],Ts.prototype,"statistics",void 0),(0,i.Cg)([(0,Fe.K)("statistics")],Ts.prototype,"writeStatistics",null),(0,i.Cg)([(0,Yt.e)(Ps)],Ts.prototype,"stretchType",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],Ts.prototype,"useGamma",void 0),Ts=Ms=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.StretchFunctionArguments")],Ts);const Rs=Ts;let Ns=class extends w{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:n}=this,{dynamicRangeAdjustment:s,gamma:r,useGamma:o}=n;if(!s&&["u8","u16","s8","s16"].includes(e)){const s=(0,qe.DP)(n.toJSON(),{rasterInfo:t}),i=(0,u.zw)(this.outputPixelType)?"round":"float";this.lookup=(0,qe.RP)({pixelType:e,...s,gamma:o?r:null,rounding:i}),this.cutOffs=s}else s||(this.cutOffs=(0,qe.DP)(n.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const i=t.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),"u8"===this.outputPixelType&&(i.keyProperties.DataType="processed");const{outputMin:a=0,outputMax:l=255}=this.functionArguments;i.statistics=[];for(let t=0;t<i.bandCount;t++)i.statistics[t]={min:a,max:l};return this.rasterInfo=i,{success:!0,supportsGPU:!s}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{lookup:n}=this;if(n)return(0,$t.eH)(e,{...n,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:s}=this,r=this.cutOffs||(0,qe.DP)(s.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:e}),o=s.useGamma?s.gamma:null;return(0,qe._N)(e,{...r,gamma:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:e=255,gamma:n,useGamma:s}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,o=s&&n?.length?(0,qe.Nh)(r,n):[1,1,1],{minCutOff:i,maxCutOff:a}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};1===i.length&&(i[1]=i[2]=i[0],a[1]=a[2]=a[0]);const l=a.map((n,s)=>(e-t)/(a[s]-i[s])),c=(0,u.zw)(this.outputPixelType),p=s&&n?[n[0],n[1]??n[0],n[2]??n[0]]:[1,1,1],h=s?[o[0],o[1]??o[0],o[2]??o[0]]:[1,1,1];return{bandCount:r,minOutput:t,maxOutput:e,minCutOff:i,maxCutOff:a,factor:l,useGamma:s,gamma:p,gammaCorrection:h,stretchType:this.functionArguments.stretchType,isOutputRounded:c,type:"stretch"}}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ns.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:Rs,json:{write:!0,name:"rasterFunctionArguments"}})],Ns.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Ns.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Ns.prototype,"lookup",void 0),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Ns.prototype,"cutOffs",void 0),Ns=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.StretchFunction")],Ns);const ks=Ns;var Is;let Ss=Is=class extends p{constructor(){super(...arguments),this.attributeTableAsRecordSet=null}clone(){return new Is({attributeTableAsRecordSet:(0,o.o8)(this.attributeTableAsRecordSet)})}};(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],Ss.prototype,"attributeTableAsRecordSet",void 0),Ss=Is=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.TableFunctionArguments")],Ss);const _s=Ss;let Fs=class extends w{constructor(){super(...arguments),this.functionName="Table",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const n=t.clone();return n.pixelType=this.outputPixelType,n.bandCount=1,"thematic"!==n.dataType&&(n.keyProperties=n.keyProperties?{...n.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,i.Cg)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Fs.prototype,"functionName",void 0),(0,i.Cg)([(0,a.MZ)({type:_s,json:{write:!0,name:"rasterFunctionArguments"}})],Fs.prototype,"functionArguments",void 0),(0,i.Cg)([(0,a.MZ)()],Fs.prototype,"rasterArgumentNames",void 0),(0,i.Cg)([(0,a.MZ)()],Fs.prototype,"isNoopProcess",void 0),Fs=(0,i.Cg)([(0,a.$K)("esri.layers.raster.functions.TableFunction")],Fs);const Bs=Fs,js=new Map;function Zs(t,e){const{rasterFunctionArguments:n}=t;n&&(n.rasters||[n.raster,n.raster2]).forEach(t=>{t&&"number"!=typeof t&&("string"==typeof t?t.startsWith("http")&&(e.includes(t)||e.push(t)):"rasterFunctionArguments"in t&&Zs(t,e))})}function Gs(t,e){e=e??{};try{if("function"in(t=(0,o.o8)(t))&&"arguments"in t&&t.arguments){const n=Ls(t,new Map,e);if($s(n),!n.renderingRule)throw new r.A("raster-function-helper","Unsupported raster function json.");t=n.renderingRule}if("rasterFunction"in t){const n=Es(t=Os(t),e);return n.isRoot=!0,n}}catch{}throw new r.A("raster-function-helper","unsupported raster function json.")}function zs(t){return!!(t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments)}function Os(t){const{rasterFunction:e,rasterFunctionArguments:n}=t,s={};for(const t in n){let e=n[t];const r=t.toLowerCase();if("rasters"===r&&Array.isArray(e))s.rasters=e.map(t=>zs(t)?Os(t):t);else switch(zs(e)&&(e=Os(e)),r){case"dra":s.dra=e;break;case"pspower":s.psPower=e;break;case"pszfactor":s.psZFactor=e;break;case"bandids":s.bandIds=e;break;default:s[t[0].toLowerCase()+t.slice(1)]=e}}return"Local"!==e||s.rasters?.length||(s.rasters=["$$"]),{...t,rasterFunctionArguments:s}}function Es(t,e){const{rasterFunction:n,rasterFunctionArguments:s}=t,o=t.outputPixelType?.toLowerCase();if(null==n||!js.has(n))throw new r.A("raster-function-helper",`unsupported raster function: ${n}`);const i=js.get(n),a=("function"==typeof i.ctor?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:o}),{rasterArgumentNames:u}=a,l=[],c=function(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map(e=>t[e])}(s,u),p="rasters"===u[0]||u.length>1,h=[];for(let t=0;t<c.length;t++){const n=c[t];let s;null==n||"string"==typeof n&&n.startsWith("$")?l.push(e?.raster):"string"==typeof n?e[n]&&l.push(e[n]):"number"!=typeof n&&"rasterFunction"in n&&(s=Es(n,e),p||(a.functionArguments[u[t]]=s),l.push(s)),p&&h.push(s??n)}if(p&&("rasters"===u[0]?a.functionArguments.rasters=h:u.forEach((t,e)=>{a.functionArguments[t]=h[e]})),e){a.sourceRasters=l;const t=e.raster?.url;t&&(a.mainPrimaryRasterId=t)}return a}function Ds(t,e){if(t&&e)for(const n in t){const s=t[n];s&&"object"==typeof s&&"type"in s&&("RasterFunctionTemplate"===s.type?Ds(s.arguments,e):"RasterFunctionVariable"===s.type&&null!=e[s.name]&&(s.value=e[s.name]))}}function Vs(t,e){if(!t||"object"!=typeof t)return t;const{value:n}=t;if(!n||"object"!=typeof n)return t.isDataset?"$$":n;if(Array.isArray(n))return 0===n.length?[]:n.map(t=>t&&"object"==typeof t&&"RasterFunctionVariable"===t.type?Vs(t,e):t);if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&"Scalar"!==n.type)return"$$";if(!("type"in n))return n;let s=n;switch(n.type){case"Scalar":s=n.value;break;case"AlgorithmicColorRamp":s=Us(n);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(Us)};break;case"ArgumentArray":if(n.elements?.length&&"RasterStatistics"!==n.elements[0].type){const t=[];for(let s=0;s<n.elements.length;s++){const o=n.elements[s],{type:i}=o;if(i)if("RasterFunctionTemplate"===i){const{renderingRule:n}=Ls(o,e);t.push(n),null!=o._object_id&&e.set(o._object_id,n)}else{if("RasterFunctionVariable"!==i)throw new r.A("raster-function-helper","unsupported raster function json.");{const n=Vs(o,e);t.push(n),null!=o._object_id&&e.set(o._object_id,n)}}else t.push(o)}s=t}else s=n.elements}return null!=n._object_id&&e.set(n._object_id,s),s}function Us(t){const e=t.algorithm??"esriHSVAlgorithm";let{FromColor:n,ToColor:r}=t;if(!Array.isArray(n)){const{r:t,g:e,b:r}=(0,s.$)({h:n.Hue,s:n.Saturation,v:n.Value});n=[t,e,r,n.AlphaValue]}if(!Array.isArray(r)){const{r:t,g:e,b:n}=(0,s.$)({h:r.Hue,s:r.Saturation,v:r.Value});r=[t,e,n,r.AlphaValue]}return{type:"algorithmic",algorithm:e,fromColor:n,toColor:r}}function Ls(t,e,n){n&&Ds(t,n);const s={renderingRule:{},templates:e};return Ws(t,s),s}function Ws(t,e){if(!t||!e.renderingRule)return;const{renderingRule:n,templates:s}=e,{function:r,arguments:o,_object_id:i}=t;if(!r||!o)return;null!=i&&s.set(i,n),n.rasterFunction=r.type.replace("Function",""),n.outputPixelType=r.pixelType;const a={};n.rasterFunctionArguments=a;for(const t in o){if("type"===t||"object_id"===t||"_object_ref_id"===t)continue;const e=o[t];e&&"object"==typeof e&&"type"in e&&("RasterFunctionTemplate"===e.type||"RasterFunctionVariable"===e.type)?("RasterFunctionVariable"===e.type?a[t]=Vs(e,s):(n.rasterFunctionArguments[t]={},Ws(e,{renderingRule:n.rasterFunctionArguments[t],templates:s})),null!=e._object_id&&s.set(e._object_id,a[t])):a[t]=e}switch(a.DEM&&!a.Raster&&(a.Raster=a.DEM,delete a.DEM),n.rasterFunction){case"Stretch":!function(t){t.Statistics?.length&&"object"==typeof t.Statistics&&(t.Statistics=t.Statistics.map(t=>[t.min,t.max,t.mean,t.standardDeviation])),null!=t.NumberOfStandardDeviation&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}(a);break;case"Colormap":!function(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}(a);break;case"Convolution":!function(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}(a);break;case"Mask":!function(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter(t=>""!==t).map(t=>Number(t)))}(a)}}function $s(t){const{renderingRule:e,templates:n}=t;if("object"!=typeof e||!e?.rasterFunctionArguments||!n.size)return;const{rasterFunctionArguments:s}=e;for(const t in s){const e=s[t],o="_object_ref_id"===t?e:e&&"object"==typeof e&&"_object_ref_id"in e?e._object_ref_id:null;if(null!=o){if(!n.has(o))throw new r.A("raster-function-helper",`unsupported raster function json. _object_ref_id: ${o} does not exist`);const e=n.get(o);"_object_ref_id"!==t?s[t]=e:e&&"object"==typeof e&&Object.assign(s,e);continue}e&&"object"==typeof e&&(e.rasterFunctionArguments&&$s({renderingRule:e,templates:n}),Array.isArray(e)&&e.forEach((t,s)=>{if(t&&"object"==typeof t)if(null!=t._object_ref_id){if(!n.has(t._object_ref_id))throw new r.A("raster-function-helper",`unsupported raster function json. _object_ref_id: ${e} does not exist`);const i=n.get(o);i&&"object"==typeof i?Object.assign(t,i):e[s]=i}else $s({renderingRule:t,templates:n})}))}}js.set("Arithmetic",{desc:"Arithmetic Function",ctor:Ft,rasterArgumentNames:["rasters"]}),js.set("Aspect",{desc:"Aspect Function",ctor:Ot,rasterArgumentNames:["raster"]}),js.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:se,rasterArgumentNames:["raster"]}),js.set("Colormap",{desc:"Colormap Function",ctor:Me,rasterArgumentNames:["raster"]}),js.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:Se,rasterArgumentNames:["raster"]}),js.set("CompositeBand",{desc:"CompositeBand Function",ctor:Ge,rasterArgumentNames:["rasters"]}),js.set("ComputeChange",{desc:"ComputeChange Function",ctor:We,rasterArgumentNames:["rasters"]}),js.set("Convolution",{desc:"Convolution Function",ctor:an,rasterArgumentNames:["raster"]}),js.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:Xe,rasterArgumentNames:["raster"]}),js.set("ExtractBand",{desc:"ExtractBand Function",ctor:xn,rasterArgumentNames:["raster"]}),js.set("Curvature",{desc:"Curvature Function",ctor:mn,rasterArgumentNames:["raster"]}),js.set("Hillshade",{desc:"Hillshade Function",ctor:In,rasterArgumentNames:["raster"]}),js.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:ns,rasterArgumentNames:["raster"]}),js.set("Grayscale",{desc:"Grayscale Function",ctor:Cn,rasterArgumentNames:["raster"]}),js.set("Clip",{desc:"Clip Function",ctor:me,rasterArgumentNames:["raster"]}),js.set("Local",{desc:"Local Function",ctor:jn,rasterArgumentNames:["rasters"]}),js.set("Mask",{desc:"Mask Function",ctor:Dn,rasterArgumentNames:["raster"]}),js.set("NDVI",{desc:"NDVI Function",ctor:$n,rasterArgumentNames:["raster"]}),js.set("Remap",{desc:"Remap Function",ctor:Xn,rasterArgumentNames:["raster"]}),js.set("Slope",{desc:"Slope Function",ctor:us,rasterArgumentNames:["raster"]}),js.set("Statistics",{desc:"Focal Statistics Function",ctor:xs,rasterArgumentNames:["raster"]}),js.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:Cs,rasterArgumentNames:["raster"]}),js.set("Stretch",{desc:"Stretch Function",ctor:ks,rasterArgumentNames:["raster"]}),js.set("Table",{desc:"Attribute Table Function",ctor:Bs,rasterArgumentNames:["raster"]})},34930:(t,e,n)=>{n.d(e,{$Q:()=>a,Sd:()=>u,b7:()=>l});var s=n(86211),r=n(5443),o=n(86738),i=n(14140);async function a(t,e,s){if("extent"===s.type)return function(t,e,n){const{width:s,height:r}=t,o=new Uint8Array(s*r),a=e.width/s,u=e.height/r;if(n.width/a<.5||n.height/u<.5)return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]});const{xmin:l,xmax:c,ymin:p,ymax:h}=e,{xmin:m,xmax:f,ymin:g,ymax:d}=n,y=Math.max(l,m),x=Math.min(c,f),w=Math.max(p,g),A=Math.min(h,d),v=.5*a,b=.5*u;if(x-y<v||A-w<b||x<l+v||y>c-v||w>h-b||A<p+b)return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]});const C=Math.max(0,(y-l)/a),M=Math.min(s,Math.max(0,(x-l)/a)),P=Math.max(0,(h-A)/u),T=Math.min(r,Math.max(0,(h-w)/u)),R=Math.round(C),N=Math.round(M)-1,k=Math.round(P),I=Math.round(T)-1;if(R===N&&C%1>.5&&M%1<.5||k===I&&P%1>.5&&T%1<.5)return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]});if(0===R&&0===k&&N===s&&I===r)return t;const S=t.mask;for(let t=k;t<=I;t++)for(let e=R;e<=N;e++){const n=t*s+e;o[n]=S?S[n]:255}return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]})}(t,e,s);const{width:r,height:o}=t,a=new Uint8Array(r*o);return(await Promise.all([n.e(3661),n.e(1878),n.e(9117),n.e(3299),n.e(807)]).then(n.bind(n,25275))).execute(e,s)?"polyline"===s.type?function(t,e,n){const{width:s,height:r}=t,o=new Uint8Array(s*r),a=e.width/s,u=e.height/r,{xmin:l,ymax:c}=e,{paths:p}=n,h=t.mask;for(let t=0;t<p.length;t++){const e=p[t];for(let t=0;t<e.length-1;t++){const[n,i]=e[t],[p,m]=e[t+1],f=Math.min(i,m),g=Math.max(i,m),d=Math.max(0,Math.floor((c-g)/u)),y=Math.min(r-1,Math.floor((c-f)/u));if(!(y<d))if(d===y){const t=Math.min(n,p),e=Math.max(n,p),r=Math.max(0,Math.floor((t-l)/a)),i=Math.min(s-1,Math.floor((e-l)/a));if(i<r)continue;const u=d*s;for(let t=u+r;t<=u+i;t++)o[t]=h?h[t]:255}else{const t=(n-l)/a,e=(p-n)/(m-i)/a,r=u*e;for(let n=d;n<=y;n++){const a=e*(c-n*u-i)+t,l=Math.max(0,Math.floor(r>0?a-r:a)),p=Math.min(s-1,Math.floor(r>0?a:a-r));if(p<l)continue;const m=n*s;for(let t=m+l;t<=m+p;t++)o[t]=h?h[t]:255}}}}return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]})}(t,e,s):(await Promise.all([n.e(3661),n.e(1878),n.e(9117),n.e(3299),n.e(5924)]).then(n.bind(n,30912))).execute(s,e)?t:function(t,e,n){if(!t)return t;const{width:s,height:r}=t,o=function(t){const{geometry:e,size:n,srcExtent:s,srcMask:r}=t,[o,i]=n;let a;const u=s.width/o,l=s.height/i,{xmin:c,ymax:p}=s;if("extent"===e.type){const t=(e.xmin-c)/u,n=(e.xmax-c)/u,s=(p-e.ymax)/l,r=(p-e.ymin)/l;a=[[[t,s],[t,r],[n,r],[n,s],[t,s]]]}else a=e.rings.map(t=>t.map(([t,e])=>[(t-c)/u,(p-e)/l]));return function(t,e,n){const[s,r]=e,o=new OffscreenCanvas(s,r).getContext("2d");o.fillStyle="#f00",o.beginPath(),t.forEach(t=>{o.moveTo(t[0][0],t[0][1]);for(let e=0;e<t.length;e++)o.lineTo(t[e][0],t[e][1]);o.closePath()}),o.fill();const i=o.getImageData(0,0,s,r).data,a=s*r,u=new Uint8Array(a);let l=!1;for(let t=0;t<a;t++)n&&!n[t]||(i[4*t+3]>127?u[t]=255:l=!0);return l||n?u:void 0}(a,n,r)}({geometry:n,size:[s,r],srcExtent:e,srcMask:t.mask});return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,maskIsAlpha:!1,pixels:[...t.pixels]})}(t,e,s):new i.A({pixelType:t.pixelType,width:r,height:o,mask:a,maskIsAlpha:!1,pixels:[...t.pixels]})}function u(t,e){const{extent:n}=l(t,e,new o.A({x:t.pixelSize.x,y:t.pixelSize.y,spatialReference:t.spatialReference})),{extent:s}=t.extent;if(n.xmax=Math.min(n.xmax,s.xmax),n.ymax=Math.min(n.ymax,s.ymax),n.xmin<n.xmax&&n.ymin<n.ymax){const{x:e,y:s}=t.pixelSize,r=Math.round(n.width/e),o=Math.round(n.height/s);t.extent=n,t.width=r,t.height=o}}function l(t,e,n,o=!0){const{spatialReference:i}=t,{x:a,y:u}=function(t,e){if(t.spatialReference.equals(e))return t;const n=(0,s.GA)(t.spatialReference),r=(0,s.GA)(e);if(n===r)return t;const o=n/r;return{x:t.x*o,y:t.y*o}}(n,i);let l,c,p;const h="extent"===e.type?e:e.extent;let{xmin:m,xmax:f,ymax:g,ymin:d}=h;const{xmin:y,ymax:x}=t.extent;return o?(m=y+(m>y?a*Math.round((m-y)/a):0),g=x-(g<x?u*Math.round((x-g)/u):0),f=y+(f>y?a*Math.round((f-y)/a):0),d=x-(d<x?u*Math.round((x-d)/u):0),l=new r.A({xmin:m,ymax:g,xmax:f,ymin:d,spatialReference:i}),c=Math.round(l.width/a),p=Math.round(l.height/u)):(c=Math.floor((f-m)/a+.8),p=Math.floor((g-d)/u+.8),m=y+(m>y?a*Math.floor((m-y)/a+.1):0),g=x-(g<x?u*Math.floor((x-g)/u+.1):0),f=m+c*a,d=g-p*u,l=new r.A({xmin:m,ymax:g,xmax:f,ymin:d,spatialReference:i})),{extent:l,width:c,height:p}}},37373:(t,e,n)=>{n.d(e,{DO:()=>L,FT:()=>E,Hh:()=>R,OM:()=>U,Ps:()=>H,Wo:()=>N,_I:()=>I,_l:()=>G,l0:()=>W,t$:()=>q,uk:()=>z});var s=n(4576),r=n(49186),o=n(74887),i=n(86211),a=n(5443),u=n(83290),l=n(86738),c=n(39829),p=n(91218),h=n(16930),m=n(21325);function f(){if(!T)throw new r.A("rasterprojectionhelper-project","projection operator is not loaded")}const g=(t,e,n,s=0)=>{if(1===n[0])return[0,0];let r=1,o=-1,i=1,a=-1;for(let e=0;e<t.length;e+=2)isNaN(t[e])||(r=r>t[e]?t[e]:r,o=o>t[e]?o:t[e],i=i>t[e+1]?t[e+1]:i,a=a>t[e+1]?a:t[e+1]);const{cols:u,rows:l}=e,c=(o-r)/u/n[0],p=(a-i)/l/n[1],h=2*s;let m=0,f=!1,g=[0,0];for(let e=0;e<u-3;e++){for(let n=0;n<l-3;n++){const s=e*l*2+2*n,r=(t[s]+t[s+4]+t[s+4*l]+t[s+4*l+4])/4,o=(t[s+1]+t[s+5]+t[s+4*l+1]+t[s+4*l+5])/4,i=Math.abs((r-t[s+2*l+2])/c),a=Math.abs((o-t[s+2*l+3])/p);if(i+a>m&&(m=i+a,g=[i,a]),h&&m>h){f=!0;break}}if(f)break}return g},d={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},y=32,x=4,w=x,A=new Map,v=new Map,b=500;let C,M,P,T=!1;async function R(){return C||(C=(0,o.Tw)(),M=await n.e(3276).then(n.bind(n,83276)),P=await n.e(2158).then(n.bind(n,12158)),M.isLoaded()||await M.load(),P.isLoaded()||await P.load(),T=!0,C.resolve()),C.promise}function N(t,e,n,s){const r=t.spatialReference;if(!r||!e||r.equals(e))return t;f();const o=n.center,u=new a.A({xmin:o.x-t.x/2,xmax:o.x+t.x/2,ymin:o.y-t.y/2,ymax:o.y+t.y/2,spatialReference:r}),l=M.execute(u,e,{geographicTransformation:s}),c=E(e);return null==l||null!=c&&l.width>=c?function(t,e,n){const s=(0,i.GA)(e)/(0,i.GA)(n);return{x:t.x*s,y:t.y*s}}(t,r,e):{x:l.width,y:l.height}}function k(t,e=.01){return(0,i.GA)(t)?e/(0,i.GA)(t):0}function I(t,e,n,s=!0){const r=t.spatialReference;if(r.equals(e))return t;f();const o=M.execute(t,e,{geographicTransformation:n});return s&&o?(S([t],[o],r,e),o):o}function S(t,e,n,s){const r=D(n,!0),o=D(s,!0),i=k(n,b),a=k(s,b);if(i&&null!=r&&null!=o)for(let n=0;n<t.length;n++){const s=e[n];if(!s)continue;const{x:u}=t[n],{x:l}=s;l>=o[1]-a&&Math.abs(u-r[0])<i?s.x-=o[1]-o[0]:l<=o[0]+a&&Math.abs(u-r[1])<i&&(s.x+=o[1]-o[0])}}function _(t){const{inSR:e,outSR:n,preferPE:s}=t;if(e.equals(n)){const{points:e}=Z(t,null);return e}if(e.isWebMercator&&n.isWGS84||e.isWGS84&&n.isWebMercator)return function(t){const{cols:e,rows:n,xres:s,yres:r,usePixelCenter:o,inSR:i,outSR:a}=t;let{xmin:u,ymax:c}=t;o&&(u+=s/2,c-=r/2);const h=[],m=[],f=Math.max(e,n);for(let t=0;t<f;t++){const o=u+s*Math.min(e,t),f=c-r*Math.min(n,t),g=(0,p.projectWithoutEngine)(new l.A({x:o,y:f,spatialReference:i}),i,a);t<=e&&h.push(g.x),t<=n&&m.push(g.y)}const g=[];for(let t=0;t<e;t++)for(let e=0;e<n;e++)g.push([h[t],m[e]]);return g}(t);if(s){if(e.isGeographic)return F(t);if(null!=B(e))return F(t)}return function(t){const{points:e}=Z(t,null),{inSR:n,outSR:s,datumTransformation:r}=t,o=e.map(t=>new l.A(t[0],t[1],n)),i=M.executeMany(o,s,{geographicTransformation:r});return r&&S(o,i,n,s),i.map(t=>t?[t.x,t.y]:[NaN,NaN])}(t)}function F(t){const{inSR:e,outSR:n,datumTransformation:s}=t,r=B(e),{points:o,mask:i}=Z(t,r);if(!e.isGeographic){const t=e.wkid?u.P.coordsys(e.wkid):u.P.fromString(e.isGeographic?u.a.PE_TYPE_GEOGCS:u.a.PE_TYPE_PROJCS,e.wkt2||e.wkt);u.h.projToGeog(t,o.length,o)}if(null!=s&&s.steps.length){let t;const e=179.9955;if(n.isGeographic&&(t=o.map(([t])=>t>e?1:t<-e?-1:0)),s.steps.forEach(t=>{const e=t.wkid?u.P.geogtran(t.wkid):u.P.fromString(u.a.PE_TYPE_GEOGTRAN,t.wkt);u.j.geogToGeog(e,o.length,o,null,t.isInverse?u.a.PE_TRANSFORM_2_TO_1:u.a.PE_TRANSFORM_1_TO_2)}),t)for(let n=0;n<o.length;n++){const s=t[n],r=o[n][0],i=r>e?1:r<-e?-1:0;s&&i&&s!==i&&(o[n][0]=s>0?r+360:r-360)}}if(!n.isGeographic){const t=B(n,!0),e=null!=t&&t.isEnvelope?[t.bbox[1],t.bbox[3]]:[-90,90];!function(t,e){const[n,s]=e;for(let e=0;e<t.length;e++){const r=t[e][1];(r<n||r>s)&&(t[e]=[NaN,NaN])}}(o,e);const s=n.wkid?u.P.coordsys(n.wkid):u.P.fromString(n.isGeographic?u.a.PE_TYPE_GEOGCS:u.a.PE_TYPE_PROJCS,n.wkt2||n.wkt);u.h.geogToProj(s,o.length,o)}let a=o;if(i&&o.length!==i.length){a=[];for(let t=0,e=0;t<i.length;t++)i[t]?a.push(o[e++]):a.push([NaN,NaN])}return a}function B(t,e=!1){let n=t.wkid||t.wkt2||t.wkt;if(!n||t.isGeographic)return null;if(n=String(n),A.has(n)){const t=A.get(n);return e?t?.gcs:t?.pcs}const s=t.wkid?u.P.coordsys(t.wkid):u.P.fromString(t.isGeographic?u.a.PE_TYPE_GEOGCS:u.a.PE_TYPE_PROJCS,t.wkt2||t.wkt),r=j(s,k(t,1e-4)),o=j(s,0,!0);return A.set(n,{pcs:r,gcs:o}),e?o:r}function j(t,e=0,n=!1){const s=u.g.generate(t),r=n?t.horizonGcsGenerate():t.horizonPcsGenerate();if(!s||!r?.length)return null;let o=!1,i=r.find(t=>1===t.getInclusive()&&1===t.getKind());if(!i){if(i=r.find(t=>1===t.getInclusive()&&0===t.getKind()),!i)return null;o=!0}const a=n?0:(2===s.getNorthPoleLocation()?1:0)|(2===s.getSouthPoleLocation()?2:0),l=s.isPannableRectangle(),c=i.getCoord();if(o)return{isEnvelope:o,isPannable:l,vertices:c,coef:null,bbox:[c[0][0]-e,c[0][1]-e,c[1][0]+e,c[1][1]+e],poleLocation:a};let p=0;const h=[];let[m,f]=c[0],[g,d]=c[0];for(let t=0,e=c.length;t<e;t++){p++,p===e&&(p=0);const[n,s]=c[t],[r,o]=c[p];if(o===s)h.push([n,r,s,o,2]);else{const t=(r-n)/(o-s||1e-4),e=n-t*s;s<o?h.push([t,e,s,o,0]):h.push([t,e,o,s,1])}m=m<n?m:n,f=f<s?f:s,g=g>n?g:n,d=d>s?d:s}return{isEnvelope:!1,isPannable:l,vertices:c,coef:h,bbox:[m,f,g,d],poleLocation:a}}function Z(t,e){const n=[],{cols:s,rows:r,xres:o,yres:i,usePixelCenter:a}=t;let{xmin:u,ymax:l}=t;if(a&&(u+=o/2,l-=i/2),null==e){for(let t=0;t<s;t++)for(let e=0;e<r;e++)n.push([u+o*t,l-i*e]);return{points:n}}const c=new Uint8Array(s*r);if(e.isEnvelope){const{bbox:[t,a,p,h]}=e;for(let m=0,f=0;m<s;m++){const s=u+o*m,g=e.isPannable||s>=t&&s<=p;for(let t=0;t<r;t++,f++){const e=l-i*t;g&&e>=a&&e<=h&&(n.push([s,e]),c[f]=1)}}return{points:n,mask:c}}const p=e.coef,h=[];for(let t=0;t<r;t++){const e=l-i*t,n=[],s=[];for(let t=0;t<p.length;t++){const[r,o,i,a,u]=p[t];if(e===i&&i===a)n.push(r),n.push(o),s.push(2),s.push(2);else if(e>=i&&e<=a){const t=r*e+o;n.push(t),s.push(u)}}let r=n;if(n.length>2){let t=2===s[0]?0:s[0],e=n[0];r=[];for(let o=1;o<s.length;o++)2===s[o]&&o!==s.length-1||(s[o]!==t&&(r.push(0===t?Math.min(e,n[o-1]):Math.max(e,n[o-1])),t=s[o],e=n[o]),o===s.length-1&&r.push(0===s[o]?Math.min(e,n[o]):Math.max(e,n[o])));r.sort((t,e)=>t-e)}else n[0]>n[1]&&(r=[n[1],n[0]]);h.push(r)}for(let t=0,e=0;t<s;t++){const s=u+o*t;for(let t=0;t<r;t++,e++){const r=l-i*t,o=h[t];if(2===o.length)s>=o[0]&&s<=o[1]&&(n.push([s,r]),c[e]=1);else if(o.length>2){let t=!1;for(let e=0;e<o.length;e+=2)if(s>=o[e]&&s<=o[e+1]){t=!0;break}t&&(n.push([s,r]),c[e]=1)}}}return{points:n,mask:c}}function G(t,e,n=null,r=!0){const o=t.spatialReference;if(o.equals(e)||!e)return t;const i=U(t),u=E(o,!0),l=E(e);if(0===i||null==u||null==l){const s=O(t,e,n,r);if(s&&null==u&&null!=l&&Math.abs(s.width-l)<k(e)&&M.isLoaded()){const n=B(o);if(null!=n&&0===n.poleLocation&&t.width<(n.bbox[2]-n.bbox[0])/2)return function(t,e){const n=E(e);if(null==n)return null;let{xmin:s,ymin:r,xmax:o,ymax:i}=t;const u=t.spatialReference,l=new c.A({spatialReference:u,rings:[[[s,r],[o,r],[o,i],[s,i],[s,r]]]}),p=M.execute(l,e);if(2!==p.rings.length||!p.rings[0].length||!p.rings[1].length)return null;const{rings:h}=p,m=k(u),f=new a.A({spatialReference:e});for(let t=0;t<2;t++){s=o=h[t][0][0],r=i=h[t][0][1];for(let e=0;e<h[t].length;e++)s=s>h[t][e][0]?h[t][e][0]:s,o=o<h[t][e][0]?h[t][e][0]:o,r=r>h[t][e][1]?h[t][e][1]:r,i=i<h[t][e][1]?h[t][e][1]:i;if(0===t)f.ymin=r,f.ymax=i,f.xmin=s,f.xmax=o;else if(f.ymin=Math.min(f.ymin,r),f.ymax=Math.max(f.ymax,i),Math.abs(o-n/2)<m)f.xmin=s,f.xmax=f.xmax+n;else{if(!(Math.abs(s+n/2)<m))return null;f.xmax=o+n}}return f}(t,e)||s}return s}const p=t.clone().normalize();if(1===p.length&&t.xmax<u&&t.xmax-u/2>k(o)){const{xmin:e,xmax:n}=t;for(let s=0;s<=i;s++){const r=0===s?e:-u/2,l=s===i?n-u*s:u/2;p[s]=new a.A({xmin:r,xmax:l,ymin:t.ymin,ymax:t.ymax,spatialReference:o})}}const h=p.map(t=>O(t,e,n,r)).filter(s.Ru);return 0===h.length?null:function(t,e){const n=E(t[0].spatialReference);if(t.length<2||null==n)return t[0];if(e=e??k(t[0].spatialReference),1===(t=t.filter(t=>t.width>e)).length)return t[0];let{xmin:s,xmax:r,ymin:o,ymax:i}=t[0];for(let e=1;e<t.length;e++){const s=t[e];r=s.xmax+n*e,o=Math.min(o,s.ymin),i=Math.max(i,s.ymax)}return new a.A({xmin:s,xmax:r,ymin:o,ymax:i,spatialReference:t[0].spatialReference})}(h)}function z(t,e,n){if("extent"===t.type){const{xmin:e,ymin:n,xmax:s,ymax:r,spatialReference:o}=t;t=new c.A({rings:[[[e,r],[s,r],[s,n],[e,n],[e,r]]],spatialReference:o})}return t.spatialReference.equals(e)?t:(f(),M.execute(t,e,{geographicTransformation:n}))}function O(t,e,n,s=!0,r=!0){const o=t.spatialReference;if(o.equals(e)||!e)return t;f();const i=M.execute(t,e,{geographicTransformation:n});if(r&&e.isWebMercator&&i&&(i.ymax=Math.min(20037508.342787,i.ymax),i.ymin=Math.max(-20037508.342787,i.ymin),i.ymin>=i.ymax))return null;if(!s||!i)return i;const a=D(o,!0),u=D(e,!0);if(null==a||null==u)return i;const c=k(o,.001),p=k(o,b),h=k(e,.001);if(Math.abs(i.xmin-u[0])<h&&Math.abs(i.xmax-u[1])<h){const s=Math.abs(t.xmin-a[0]),r=Math.abs(a[1]-t.xmax);if(s<c&&r>p){i.xmin=u[0];const s=[];s.push(new l.A(t.xmax,t.ymin,o)),s.push(new l.A(t.xmax,(t.ymin+t.ymax)/2,o)),s.push(new l.A(t.xmax,t.ymax,o));const r=s.map(t=>I(t,e,n)).filter(t=>!isNaN(t?.x)).map(t=>t.x);i.xmax=Math.max.apply(null,r)}if(r<c&&s>p){i.xmax=u[1];const s=[];s.push(new l.A(t.xmin,t.ymin,o)),s.push(new l.A(t.xmin,(t.ymin+t.ymax)/2,o)),s.push(new l.A(t.xmin,t.ymax,o));const r=s.map(t=>I(t,e,n)).filter(t=>!isNaN(t?.x)).map(t=>t.x);i.xmin=Math.min.apply(null,r)}}else{const t=k(e,.001);Math.abs(i.xmin-u[0])<t&&(i.xmin=u[0]),Math.abs(i.xmax-u[1])<t&&(i.xmax=u[1])}return i}function E(t,e=!1){if(!t)return null;const n=e?20037508.342787:20037508.342788905;return t.isWebMercator?2*n:t.wkid&&t.isGeographic?360:2*d[t.wkid]||null}function D(t,e=!1){if(t.isGeographic)return[-180,180];const n=E(t,e);return null!=n?[-n/2,n/2]:null}function V(t,e,n,s){let r=(t-e)/n;return r-Math.floor(r)!==0?r=Math.floor(r):s&&(r-=1),r}function U(t,e=!1){const n=E(t.spatialReference);if(null==n)return 0;const s=e?0:-n/2,r=k(t.spatialReference),o=!e&&Math.abs(t.xmax-n/2)<r?n/2:t.xmax,i=!e&&Math.abs(t.xmin+n/2)<r?-n/2:t.xmin;return V(o,s,n,!0)-V(i,s,n,!1)}function L(t){const e=t.storageInfo.origin.x,n=E(t.spatialReference,!0);if(null==n)return{originX:e,halfWorldWidth:null,pyramidsInfo:null};const s=n/2,{nativePixelSize:r,storageInfo:o,extent:i}=t,{maximumPyramidLevel:a,blockWidth:u,pyramidScalingFactor:l}=o;let c=r.x;const p=[],h=null!=t.transform&&"gcs-shift"===t.transform.type,m=e+(h?0:s),f=h?n-e:s-e;for(let t=0;t<=a;t++){const t=(i.xmax-e)/c/u,n=t-Math.floor(t)===0?t:Math.ceil(t),s=f/c/u,r=s-Math.floor(s)===0?s:Math.ceil(s),o=Math.floor(m/c/u),a=Math.round(m/c)%u,h=(u-Math.round(f/c)%u)%u;p.push({resolutionX:c,blockWidth:u,datasetColumnCount:n,worldColumnCountFromOrigin:r,leftMargin:a,rightPadding:h,originColumnOffset:o}),c*=l}return{originX:e,halfWorldWidth:s,pyramidsInfo:p,hasGCSSShiftTransform:h}}function W(t){const e=t.isAdaptive&&null==t.spacing;let n=t.spacing||[y,y],s=$(t),r={cols:s.size[0]+1,rows:s.size[1]+1};const o=s.outofBoundPointCount>0&&s.outofBoundPointCount<s.offsets.length/2;let i=s.outofBoundPointCount===s.offsets.length/2||e&&o?[0,0]:g(s.offsets,r,n,w);const a=(i[0]+i[1])/2,l=t.projectedExtent.spatialReference,c=t.srcBufferExtent.spatialReference;if(e&&(o||a>w)&&(l.isGeographic||B(l),n=[x,x],s=$({...t,spacing:n}),r={cols:s.size[0]+1,rows:s.size[1]+1},i=g(s.offsets,r,n,w)),s.error=i,n[0]>1&&(s.coefficients=K(s.offsets,r,o)),t.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)s.gcsGrid={offsets:s.offsets,coefficients:s.coefficients,spacing:n};else{const e=B(l);if(null!=e&&!e.isEnvelope){const e=function(t){if(!t||t.isGeographic)return t;const e=String(t.wkid||t.wkt2||t.wkt);let n;return v.has(e)?n=v.get(e):(n=(t.wkid?u.P.coordsys(t.wkid):u.P.fromString(u.a.PE_TYPE_PROJCS,t.wkt2||t.wkt)).getGeogcs().getCode(),v.set(e,n)),new h.A({wkid:n})}(l),i=G(t.projectedExtent,e),{offsets:a}=$({...t,srcBufferExtent:i,spacing:n}),c=K(a,r,o);s.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return s}function $(t){const{projectedExtent:e,srcBufferExtent:n,pixelSize:s,datumTransformation:r,rasterTransform:o}=t,i=e.spatialReference,a=n.spatialReference;f();const{xmin:u,ymin:c,xmax:p,ymax:h}=e,m=E(a),g=null!=m&&(t.hasWrapAround||"gcs-shift"===o?.type),d=t.spacing||[y,y],w=d[0]*s.x,A=d[1]*s.y,v=1===d[0],C=Math.ceil((p-u)/w-.1/d[0])+(v?0:1),M=Math.ceil((h-c)/A-.1/d[1])+(v?0:1),P=_({cols:C,rows:M,xmin:u,ymax:h,xres:w,yres:A,inSR:i,outSR:a,datumTransformation:r,preferPE:d[0]<=x,usePixelCenter:v}),T=[];let R,N=0;const I=v?-1:NaN,{xmin:S,xmax:F,ymax:j,width:Z,height:G}=n,z=k(a,b),O=null!=m&&S>0&&F>m/2,D=B(i),V=null!=D&&D.poleLocation>0;for(let t=0;t<C;t++){const e=[];for(let n=0;n<M;n++){let s=P[t*M+n];if(g&&s[0]>F&&s[0]>m/2-z?s[0]-=m:g&&0===t&&s[0]<0&&O&&!o&&(s[0]+=m),!s||isNaN(s[0])||isNaN(s[1]))T.push(I),T.push(I),e.push(null),N++;else{if(o){const t=o.inverseTransform(new l.A({x:s[0],y:s[1],spatialReference:a}));s=[t.x,t.y]}e.push(s),t>0&&g&&R[n]&&s[0]<R[n][0]&&(s[0]+=m,V&&s[0]>F&&s[0]>m&&(s[0]-=m)),T.push((s[0]-S)/Z),T.push((j-s[1])/G)}}R=e}return{offsets:T,error:null,coefficients:null,outofBoundPointCount:N,spacing:d,size:v?[C,M]:[C-1,M-1]}}function K(t,e,n){const{cols:s,rows:r}=e,o=new Float32Array((s-1)*(r-1)*2*6),i=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let e=0;e<s-1;e++){for(let n=0;n<r-1;n++){let u=e*r*2+2*n;const l=t[u],c=t[u+1],p=t[u+2],h=t[u+3];u+=2*r;const m=t[u],f=t[u+1],g=t[u+2],d=t[u+3];let y=0,x=12*(n*(s-1)+e);for(let t=0;t<3;t++)o[x++]=i[y++]*l+i[y++]*p+i[y++]*g;y=0;for(let t=0;t<3;t++)o[x++]=i[y++]*c+i[y++]*h+i[y++]*d;y=0;for(let t=0;t<3;t++)o[x++]=a[y++]*l+a[y++]*m+a[y++]*g;y=0;for(let t=0;t<3;t++)o[x++]=a[y++]*c+a[y++]*f+a[y++]*d}if(n)for(let t=0;t<o.length;t++)isNaN(o[t])&&(o[t]=-1)}return o}function H(t){const{spatialReference:e}=t,n=(0,m.Vp)(e);if(!n)return t;const[s,r]=n.valid,o=r-s;let i=0;if(t.xmin<s){const e=s-t.xmin;i=Math.ceil(e/o)}else if(t.xmin>r){const e=t.xmin-r;i=-Math.ceil(e/o)}return new a.A({spatialReference:t.spatialReference,xmin:t.xmin+i*o,ymin:t.ymin,xmax:t.xmax+i*o,ymax:t.ymax})}function q(t,e,n){const{storageInfo:s,pixelSize:r}=e;let o=0,a=!1;const{pyramidResolutions:u}=s,c="mixed"===s.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,s.tileInfo.dpi/96)):1,p=(t.x+t.y)/2/c;if(null!=u&&u.length){const t=u[u.length-1],s=(t.x+t.y)/2,c=(r.x+r.y)/2;if(p<=c)o=0;else if(p>=s)o=u.length,a=p/s>8;else{let t,e=c;for(let s=1;s<=u.length;s++){if(t=(u[s-1].x+u[s-1].y)/2,p<=t){p===t?o=s:"down"===n?(o=s-1,a=p/e>8):o="up"===n||p-e>t-p||p/e>2?s:s-1;break}e=t}}const h=0===o?r:u[o-1];return a&&Math.min(h.x,h.y)*(0,i.GA)(e.spatialReference)>19567&&(a=!1),{pyramidLevel:o,pyramidResolution:new l.A({x:h.x,y:h.y,spatialReference:e.spatialReference}),excessiveReading:a}}const h=Math.log(t.x/r.x)/Math.LN2,m=Math.log(t.y/r.y)/Math.LN2,f=e.storageInfo.maximumPyramidLevel||0;o="down"===n?Math.floor(Math.min(h,m)):"up"===n?Math.ceil(Math.max(h,m)):Math.round((h+m)/2),o<0?o=0:o>f&&(a=o>f+3,o=f);const g=2**o;return{pyramidLevel:o,pyramidResolution:new l.A({x:g*e.nativePixelSize.x,y:g*e.nativePixelSize.y,spatialReference:e.spatialReference}),excessiveReading:a}}}}]);
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8993],{5682:(e,t,n)=>{n.d(t,{s1:()=>l});var r=n(11254),o=(n(4576),n(49186),n(44208),n(58083),n(9093)),i=(n(38954),n(51850)),s=(n(91218),n(16930),n(27993),n(19419));n(30524),n(61956);var u=n(59418);n(73941),n(48353),n(68197);var a=n(91829);(0,a.fA)(0,0,0,.2);(0,a.fA)(0,0,0,.2),n(34727);var c=n(57005);async function l(e,t,n,o,i,s,a,c){const l=[];for(const r of t)if(r&&i.includes(r.name)){const t=`${e}/nodes/${n}/attributes/${r.key}/0`;l.push({url:t,storageInfo:r})}const d=await Promise.allSettled(l.map(e=>(0,r.A)(e.url,{responseType:"array-buffer",query:{...a,token:s},signal:c?.signal}).then(t=>(0,u.m0)(e.storageInfo,t.data)))),f=[];for(const e of o){const t={};for(let n=0;n<d.length;n++){const r=d[n];if("fulfilled"===r.status){const o=r.value;t[l[n].storageInfo.name]=(0,u.E5)(o,e)}}f.push(t)}return f}n(63201),(0,s.vt)(),(0,i.vt)(),(0,i.vt)(),(0,i.vt)(),(0,i.vt)(),(0,i.vt)(),(0,i.vt)(),(0,i.vt)(),(0,i.vt)(),(0,s.vt)(),(0,s.vt)(),new c.ab,(0,i.vt)(),new Array(72),(0,o.vt)()},15976:(e,t,n)=>{n.d(t,{o:()=>o});var r=n(74333);class o extends r.n{constructor(e,t){super(e,"sampler2D",2,(n,r,o)=>n.bindTexture(e,t(r,o)))}}},20304:(e,t,n)=>{n.d(t,{m:()=>o});var r=n(74333);class o extends r.n{constructor(e,t,n){super(e,"float",1,(r,o,i)=>r.setUniform1f(e,t(o,i),n))}}},25634:(e,t,n)=>{n.d(t,{m8:()=>u,NV:()=>c});var r=n(97768),o=n(74887);class i{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return 2}}var s=n(65786);class u extends i{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,e=>this._textureNormal=e),this._acquire(e.emissiveTextureId,e=>this._textureEmissive=e),this._acquire(e.occlusionTextureId,e=>this._textureOcclusion=e),this._acquire(e.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){super.dispose(),this._texture=(0,r.Gz)(this._texture),this._textureNormal=(0,r.Gz)(this._textureNormal),this._textureEmissive=(0,r.Gz)(this._textureEmissive),this._textureOcclusion=(0,r.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,r.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new c(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,r.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const n=this._textures.acquire(e);if((0,o.$X)(n))return++this._numLoading,void n.then(e=>{if(this._disposed)return(0,r.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(n)}}class a extends s.Y{constructor(e=null){super(),this.textureEmissive=e}}class c extends a{constructor(e,t,n,r,o,i,s){super(n),this.texture=e,this.textureNormal=t,this.textureOcclusion=r,this.textureMetallicRoughness=o,this.scale=i,this.normalTextureTransformMatrix=s}}},27993:(e,t,n)=>{n.d(t,{F:()=>u});var r=n(91218),o=n(16930),i=n(9762),s=n(65806);function u(e,t,n,o){return!(null==t||null==o||e.length<2)&&((0,r.canProjectWithoutEngine)(t,o)?(0,i.projectBuffer)(e,t,0,n,o,0,1):(a.x=e[0],a.y=e[1],a.z=e[2],a.spatialReference=t,(0,s.g)(a,n,o)))}const a={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:o.A.WGS84,type:"point"}},28421:(e,t,n)=>{n.d(t,{J:()=>o});var r=n(74333);class o extends r.n{constructor(e,t,n){super(e,"float",2,(r,o,i)=>r.setUniform1f(e,t(o,i),n))}}},31821:(e,t,n)=>{n.d(t,{H:()=>r,If:()=>o});const r=(e,...t)=>{let n="";for(let r=0;r<t.length;r++)n+=e[r]+t[r];return n+=e[e.length-1],n};function o(e,t,n=""){return e?t:n}r.int=e=>Math.round(e).toString(),r.float=e=>e.toPrecision(8)},33079:(e,t,n)=>{n.d(t,{t:()=>o});var r=n(74333);class o extends r.n{constructor(e,t,n){super(e,"vec3",1,(r,o,i)=>r.setUniform3fv(e,t(o,i),n))}}},37203:(e,t,n)=>{n.d(t,{Ax:()=>g,Me:()=>c,mb:()=>v});var r=n(49186);const o=!0,i={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function s(e,t,n){return{identifier:String.fromCharCode.apply(null,new Uint8Array(e,n+i.identifierOffset,i.identifierLength)),version:t.getUint16(n+i.versionOffset,o),checksum:t.getUint32(n+i.checksumOffset,o)}}const u={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function a(e,t){return{sizeLo:e.getUint32(t+u.sizeLo,o),sizeHi:e.getUint32(t+u.sizeHi,o),minX:e.getFloat64(t+u.minX,o),minY:e.getFloat64(t+u.minY,o),minZ:e.getFloat64(t+u.minZ,o),maxX:e.getFloat64(t+u.maxX,o),maxY:e.getFloat64(t+u.maxY,o),maxZ:e.getFloat64(t+u.maxZ,o),errorX:e.getFloat64(t+u.errorX,o),errorY:e.getFloat64(t+u.errorY,o),errorZ:e.getFloat64(t+u.errorZ,o),count:e.getUint32(t+u.count,o),reserved:e.getUint32(t+u.reserved,o)}}function c(e){const t=new DataView(e,0);let n=0;const{identifier:o,version:c}=s(e,t,n);if(n+=i.byteCount,"LEPCC "!==o)throw new r.A("lepcc-decode-error","Bad identifier");if(c>1)throw new r.A("lepcc-decode-error","Unknown version");const d=a(t,n);if(n+=u.byteCount,d.sizeHi*2**32+d.sizeLo!==e.byteLength)throw new r.A("lepcc-decode-error","Bad size");const f=new Float64Array(3*d.count),h=[],v=[],m=[],p=[];if(n=l(e,n,h),n=l(e,n,v),n=l(e,n,m),n=l(e,n,p),n!==e.byteLength)throw new r.A("lepcc-decode-error","Bad length");let g=0,y=0;for(let e=0;e<h.length;e++){y+=h[e];let t=0;for(let n=0;n<v[e];n++){t+=m[g];const e=p[g];f[3*g]=Math.min(d.maxX,d.minX+2*d.errorX*t),f[3*g+1]=Math.min(d.maxY,d.minY+2*d.errorY*y),f[3*g+2]=Math.min(d.maxZ,d.minZ+2*d.errorZ*e),g++}}return{errorX:d.errorX,errorY:d.errorY,errorZ:d.errorZ,result:f}}function l(e,t,n){const r=[];t=d(e,t,r);const o=[];for(let i=0;i<r.length;i++){o.length=0,t=d(e,t,o);for(let e=0;e<o.length;e++)n.push(o[e]+r[i])}return t}function d(e,t,n){const i=new DataView(e,t),s=i.getUint8(0),u=31&s,a=!!(32&s),c=(192&s)>>6;let l=0;if(0===c)l=i.getUint32(1,o),t+=5;else if(1===c)l=i.getUint16(1,o),t+=3;else{if(2!==c)throw new r.A("lepcc-decode-error","Bad count type");l=i.getUint8(1),t+=2}if(a)throw new r.A("lepcc-decode-error","LUT not implemented");const d=Math.ceil(l*u/8),f=new Uint8Array(e,t,d);let h=0,v=0,m=0;const p=-1>>>32-u;for(let e=0;e<l;e++){for(;v<u;)h|=f[m]<<v,v+=8,m+=1;n[e]=h&p,h>>>=u,v-=u,v+u>32&&(h|=f[m-1]>>8-v)}return t+m}const f={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function h(e,t){return{sizeLo:e.getUint32(t+f.sizeLo,o),sizeHi:e.getUint32(t+f.sizeHi,o),count:e.getUint32(t+f.count,o),colorMapCount:e.getUint16(t+f.colorMapCount,o),lookupMethod:e.getUint8(t+f.lookupMethod),compressionMethod:e.getUint8(t+f.compressionMethod)}}function v(e){const t=new DataView(e,0);let n=0;const{identifier:o,version:u}=s(e,t,n);if(n+=i.byteCount,"ClusterRGB"!==o)throw new r.A("lepcc-decode-error","Bad identifier");if(u>1)throw new r.A("lepcc-decode-error","Unknown version");const a=h(t,n);if(n+=f.byteCount,a.sizeHi*2**32+a.sizeLo!==e.byteLength)throw new r.A("lepcc-decode-error","Bad size");if((2===a.lookupMethod||1===a.lookupMethod)&&0===a.compressionMethod){if(3*a.colorMapCount+a.count+n!==e.byteLength||a.colorMapCount>256)throw new r.A("lepcc-decode-error","Bad count");const t=new Uint8Array(e,n,3*a.colorMapCount),o=new Uint8Array(e,n+3*a.colorMapCount,a.count),i=new Uint8Array(3*a.count);for(let e=0;e<a.count;e++){const n=o[e];i[3*e]=t[3*n],i[3*e+1]=t[3*n+1],i[3*e+2]=t[3*n+2]}return i}if(0===a.lookupMethod&&0===a.compressionMethod){if(3*a.count+n!==e.byteLength||0!==a.colorMapCount)throw new r.A("lepcc-decode-error","Bad count");return new Uint8Array(e,n).slice()}if(a.lookupMethod<=2&&1===a.compressionMethod){if(n+3!==e.byteLength||1!==a.colorMapCount)throw new r.A("lepcc-decode-error","Bad count");const o=t.getUint8(n),i=t.getUint8(n+1),s=t.getUint8(n+2),u=new Uint8Array(3*a.count);for(let e=0;e<a.count;e++)u[3*e]=o,u[3*e+1]=i,u[3*e+2]=s;return u}throw new r.A("lepcc-decode-error","Bad method "+a.lookupMethod+","+a.compressionMethod)}const m={sizeLo:0,sizeHi:4,count:8,scaleFactor:12,bitsPerPoint:14,reserved:15,byteCount:16};function p(e,t){return{sizeLo:e.getUint32(t+m.sizeLo,o),sizeHi:e.getUint32(t+m.sizeHi,o),count:e.getUint32(t+m.count,o),scaleFactor:e.getUint16(t+m.scaleFactor,o),bitsPerPoint:e.getUint8(t+m.bitsPerPoint),reserved:e.getUint8(t+m.reserved)}}function g(e){const t=new DataView(e,0);let n=0;const{identifier:o,version:u}=s(e,t,n);if(n+=i.byteCount,"Intensity "!==o)throw new r.A("lepcc-decode-error","Bad identifier");if(u>1)throw new r.A("lepcc-decode-error","Unknown version");const a=p(t,n);if(n+=m.byteCount,a.sizeHi*2**32+a.sizeLo!==e.byteLength)throw new r.A("lepcc-decode-error","Bad size");const c=new Uint16Array(a.count);if(8===a.bitsPerPoint){if(a.count+n!==e.byteLength)throw new r.A("lepcc-decode-error","Bad size");const t=new Uint8Array(e,n,a.count);for(let e=0;e<a.count;e++)c[e]=t[e]*a.scaleFactor}else if(16===a.bitsPerPoint){if(2*a.count+n!==e.byteLength)throw new r.A("lepcc-decode-error","Bad size");const t=new Uint16Array(e,n,a.count);for(let e=0;e<a.count;e++)c[e]=t[e]*a.scaleFactor}else{const t=[];if(d(e,n,t)!==e.byteLength)throw new r.A("lepcc-decode-error","Bad size");for(let e=0;e<a.count;e++)c[e]=t[e]*a.scaleFactor}return c}},37352:(e,t,n)=>{n.d(t,{A:()=>a});var r,o=n(31635),i=n(7762),s=n(25482),u=n(91429);let a=r=class extends s.o{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new i.A}clone(){return new r({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,o.Cg)([(0,u.MZ)({type:String,json:{write:{isRequired:!0}}})],a.prototype,"floorField",void 0),(0,o.Cg)([(0,u.MZ)({json:{read:!1,write:!1}})],a.prototype,"viewAllMode",void 0),(0,o.Cg)([(0,u.MZ)({json:{read:!1,write:!1}})],a.prototype,"viewAllLevelIds",void 0),a=r=(0,o.Cg)([(0,u.$K)("esri.layers.support.LayerFloorInfo")],a)},40710:(e,t,n)=>{n.d(t,{W:()=>o});var r=n(74333);class o extends r.n{constructor(e,t,n){super(e,"vec3",2,(r,o,i,s)=>r.setUniform3fv(e,t(o,i,s),n))}}},45671:(e,t,n)=>{n.d(t,{D8:()=>i,TO:()=>o});var r=n(30524);async function o(e,t=e.popupTemplate){if(null==t)return[];const n=await t.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:o}=t,{objectIdField:i,typeIdField:s,globalIdField:u,relationships:a}=e;if(n.includes("*"))return["*"];const c=o?(0,r.eX)(e):[],l=(0,r.DB)(e.fieldsIndex,[...n,...c]);return s&&l.push(s),l&&i&&e.fieldsIndex?.has(i)&&!l.includes(i)&&l.push(i),l&&u&&e.fieldsIndex?.has(u)&&!l.includes(u)&&l.push(u),a?.forEach(t=>{const{keyField:n}=t;l&&n&&e.fieldsIndex?.has(n)&&!l.includes(n)&&l.push(n)}),l}function i(e,t){return e&&"object"==typeof e?t?.checkPopupEnabled&&"popupEnabled"in e&&!e.popupEnabled?null:"popupTemplate"in e&&e.popupTemplate?e.popupTemplate:null!=t&&t.defaultPopupTemplateEnabled&&"defaultPopupTemplate"in e&&e.defaultPopupTemplate?e.defaultPopupTemplate:null:null}},49255:(e,t,n)=>{function r(e){return 3===e||4===e||5===e||6===e||7===e}function o(e){return function(e){return s(e)||u(e)}(e)||2===e}function i(e){return 0===e}function s(e){return i(e)||function(e){return 8===e||9===e}(e)}function u(e){return 1===e}function a(e){return u(e)||r(e)}n.d(t,{Bf:()=>r,Dz:()=>a,_o:()=>i,dX:()=>s,iq:()=>o})},53466:(e,t,n)=>{n.d(t,{U:()=>i});var r=n(21818),o=n(31821);function i(e,t){switch(t.textureCoordinateType){case 1:return e.attributes.add("uv0","vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case 2:return e.attributes.add("uv0","vec2"),e.attributes.add("uvRegion","vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() {
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8993],{5682:(e,t,n)=>{n.d(t,{s1:()=>l});var r=n(11254),o=(n(4576),n(49186),n(44208),n(58083),n(9093)),i=(n(38954),n(51850)),s=(n(91218),n(16930),n(27993),n(19419));n(30524),n(61956);var u=n(59418);n(73941),n(48353),n(68197);var a=n(91829);(0,a.fA)(0,0,0,.2);(0,a.fA)(0,0,0,.2),n(34727);var c=n(57005);async function l(e,t,n,o,i,s,a,c){const l=[];for(const r of t)if(r&&i.includes(r.name)){const t=`${e}/nodes/${n}/attributes/${r.key}/0`;l.push({url:t,storageInfo:r})}const d=await Promise.allSettled(l.map(e=>(0,r.A)(e.url,{responseType:"array-buffer",query:{...a,token:s},signal:c?.signal}).then(t=>(0,u.m0)(e.storageInfo,t.data)))),f=[];for(const e of o){const t={};for(let n=0;n<d.length;n++){const r=d[n];if("fulfilled"===r.status){const o=r.value;t[l[n].storageInfo.name]=(0,u.E5)(o,e)}}f.push(t)}return f}n(63201),(0,s.vt)(),(0,i.vt)(),(0,i.vt)(),(0,i.vt)(),(0,i.vt)(),(0,i.vt)(),(0,i.vt)(),(0,i.vt)(),(0,i.vt)(),(0,s.vt)(),(0,s.vt)(),new c.ab,(0,i.vt)(),new Array(72),(0,o.vt)()},15976:(e,t,n)=>{n.d(t,{o:()=>o});var r=n(74333);class o extends r.n{constructor(e,t){super(e,"sampler2D",2,(n,r,o)=>n.bindTexture(e,t(r,o)))}}},20304:(e,t,n)=>{n.d(t,{m:()=>o});var r=n(74333);class o extends r.n{constructor(e,t,n){super(e,"float",1,(r,o,i)=>r.setUniform1f(e,t(o,i),n))}}},25634:(e,t,n)=>{n.d(t,{m8:()=>u,NV:()=>c});var r=n(97768),o=n(74887);class i{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return 2}}var s=n(65786);class u extends i{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,e=>this._textureNormal=e),this._acquire(e.emissiveTextureId,e=>this._textureEmissive=e),this._acquire(e.occlusionTextureId,e=>this._textureOcclusion=e),this._acquire(e.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){super.dispose(),this._texture=(0,r.Gz)(this._texture),this._textureNormal=(0,r.Gz)(this._textureNormal),this._textureEmissive=(0,r.Gz)(this._textureEmissive),this._textureOcclusion=(0,r.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,r.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new c(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,r.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const n=this._textures.acquire(e);if((0,o.$X)(n))return++this._numLoading,void n.then(e=>{if(this._disposed)return(0,r.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(n)}}class a extends s.Y{constructor(e=null){super(),this.textureEmissive=e}}class c extends a{constructor(e,t,n,r,o,i,s){super(n),this.texture=e,this.textureNormal=t,this.textureOcclusion=r,this.textureMetallicRoughness=o,this.scale=i,this.normalTextureTransformMatrix=s}}},27993:(e,t,n)=>{n.d(t,{F:()=>u});var r=n(91218),o=n(16930),i=n(9762),s=n(65806);function u(e,t,n,o){return!(null==t||null==o||e.length<2)&&((0,r.canProjectWithoutEngine)(t,o)?(0,i.projectBuffer)(e,t,0,n,o,0,1):(a.x=e[0],a.y=e[1],a.z=e[2],a.spatialReference=t,(0,s.g)(a,n,o)))}const a={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:o.A.WGS84,type:"point"}},28421:(e,t,n)=>{n.d(t,{J:()=>o});var r=n(74333);class o extends r.n{constructor(e,t,n){super(e,"float",2,(r,o,i)=>r.setUniform1f(e,t(o,i),n))}}},31821:(e,t,n)=>{n.d(t,{H:()=>r,If:()=>o});const r=(e,...t)=>{let n="";for(let r=0;r<t.length;r++)n+=e[r]+t[r];return n+=e[e.length-1],n};function o(e,t,n=""){return e?t:n}r.int=e=>Math.round(e).toString(),r.float=e=>e.toPrecision(8)},33079:(e,t,n)=>{n.d(t,{t:()=>o});var r=n(74333);class o extends r.n{constructor(e,t,n){super(e,"vec3",1,(r,o,i)=>r.setUniform3fv(e,t(o,i),n))}}},37203:(e,t,n)=>{n.d(t,{Ax:()=>g,Me:()=>c,mb:()=>v});var r=n(49186);const o=!0,i={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function s(e,t,n){return{identifier:String.fromCharCode.apply(null,new Uint8Array(e,n+i.identifierOffset,i.identifierLength)),version:t.getUint16(n+i.versionOffset,o),checksum:t.getUint32(n+i.checksumOffset,o)}}const u={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function a(e,t){return{sizeLo:e.getUint32(t+u.sizeLo,o),sizeHi:e.getUint32(t+u.sizeHi,o),minX:e.getFloat64(t+u.minX,o),minY:e.getFloat64(t+u.minY,o),minZ:e.getFloat64(t+u.minZ,o),maxX:e.getFloat64(t+u.maxX,o),maxY:e.getFloat64(t+u.maxY,o),maxZ:e.getFloat64(t+u.maxZ,o),errorX:e.getFloat64(t+u.errorX,o),errorY:e.getFloat64(t+u.errorY,o),errorZ:e.getFloat64(t+u.errorZ,o),count:e.getUint32(t+u.count,o),reserved:e.getUint32(t+u.reserved,o)}}function c(e){const t=new DataView(e,0);let n=0;const{identifier:o,version:c}=s(e,t,n);if(n+=i.byteCount,"LEPCC "!==o)throw new r.A("lepcc-decode-error","Bad identifier");if(c>1)throw new r.A("lepcc-decode-error","Unknown version");const d=a(t,n);if(n+=u.byteCount,d.sizeHi*2**32+d.sizeLo!==e.byteLength)throw new r.A("lepcc-decode-error","Bad size");const f=new Float64Array(3*d.count),h=[],v=[],m=[],p=[];if(n=l(e,n,h),n=l(e,n,v),n=l(e,n,m),n=l(e,n,p),n!==e.byteLength)throw new r.A("lepcc-decode-error","Bad length");let g=0,y=0;for(let e=0;e<h.length;e++){y+=h[e];let t=0;for(let n=0;n<v[e];n++){t+=m[g];const e=p[g];f[3*g]=Math.min(d.maxX,d.minX+2*d.errorX*t),f[3*g+1]=Math.min(d.maxY,d.minY+2*d.errorY*y),f[3*g+2]=Math.min(d.maxZ,d.minZ+2*d.errorZ*e),g++}}return{errorX:d.errorX,errorY:d.errorY,errorZ:d.errorZ,result:f}}function l(e,t,n){const r=[];t=d(e,t,r);const o=[];for(let i=0;i<r.length;i++){o.length=0,t=d(e,t,o);for(let e=0;e<o.length;e++)n.push(o[e]+r[i])}return t}function d(e,t,n){const i=new DataView(e,t),s=i.getUint8(0),u=31&s,a=!!(32&s),c=(192&s)>>6;let l=0;if(0===c)l=i.getUint32(1,o),t+=5;else if(1===c)l=i.getUint16(1,o),t+=3;else{if(2!==c)throw new r.A("lepcc-decode-error","Bad count type");l=i.getUint8(1),t+=2}if(a)throw new r.A("lepcc-decode-error","LUT not implemented");const d=Math.ceil(l*u/8),f=new Uint8Array(e,t,d);let h=0,v=0,m=0;const p=-1>>>32-u;for(let e=0;e<l;e++){for(;v<u;)h|=f[m]<<v,v+=8,m+=1;n[e]=h&p,h>>>=u,v-=u,v+u>32&&(h|=f[m-1]>>8-v)}return t+m}const f={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function h(e,t){return{sizeLo:e.getUint32(t+f.sizeLo,o),sizeHi:e.getUint32(t+f.sizeHi,o),count:e.getUint32(t+f.count,o),colorMapCount:e.getUint16(t+f.colorMapCount,o),lookupMethod:e.getUint8(t+f.lookupMethod),compressionMethod:e.getUint8(t+f.compressionMethod)}}function v(e){const t=new DataView(e,0);let n=0;const{identifier:o,version:u}=s(e,t,n);if(n+=i.byteCount,"ClusterRGB"!==o)throw new r.A("lepcc-decode-error","Bad identifier");if(u>1)throw new r.A("lepcc-decode-error","Unknown version");const a=h(t,n);if(n+=f.byteCount,a.sizeHi*2**32+a.sizeLo!==e.byteLength)throw new r.A("lepcc-decode-error","Bad size");if((2===a.lookupMethod||1===a.lookupMethod)&&0===a.compressionMethod){if(3*a.colorMapCount+a.count+n!==e.byteLength||a.colorMapCount>256)throw new r.A("lepcc-decode-error","Bad count");const t=new Uint8Array(e,n,3*a.colorMapCount),o=new Uint8Array(e,n+3*a.colorMapCount,a.count),i=new Uint8Array(3*a.count);for(let e=0;e<a.count;e++){const n=o[e];i[3*e]=t[3*n],i[3*e+1]=t[3*n+1],i[3*e+2]=t[3*n+2]}return i}if(0===a.lookupMethod&&0===a.compressionMethod){if(3*a.count+n!==e.byteLength||0!==a.colorMapCount)throw new r.A("lepcc-decode-error","Bad count");return new Uint8Array(e,n).slice()}if(a.lookupMethod<=2&&1===a.compressionMethod){if(n+3!==e.byteLength||1!==a.colorMapCount)throw new r.A("lepcc-decode-error","Bad count");const o=t.getUint8(n),i=t.getUint8(n+1),s=t.getUint8(n+2),u=new Uint8Array(3*a.count);for(let e=0;e<a.count;e++)u[3*e]=o,u[3*e+1]=i,u[3*e+2]=s;return u}throw new r.A("lepcc-decode-error","Bad method "+a.lookupMethod+","+a.compressionMethod)}const m={sizeLo:0,sizeHi:4,count:8,scaleFactor:12,bitsPerPoint:14,reserved:15,byteCount:16};function p(e,t){return{sizeLo:e.getUint32(t+m.sizeLo,o),sizeHi:e.getUint32(t+m.sizeHi,o),count:e.getUint32(t+m.count,o),scaleFactor:e.getUint16(t+m.scaleFactor,o),bitsPerPoint:e.getUint8(t+m.bitsPerPoint),reserved:e.getUint8(t+m.reserved)}}function g(e){const t=new DataView(e,0);let n=0;const{identifier:o,version:u}=s(e,t,n);if(n+=i.byteCount,"Intensity "!==o)throw new r.A("lepcc-decode-error","Bad identifier");if(u>1)throw new r.A("lepcc-decode-error","Unknown version");const a=p(t,n);if(n+=m.byteCount,a.sizeHi*2**32+a.sizeLo!==e.byteLength)throw new r.A("lepcc-decode-error","Bad size");const c=new Uint16Array(a.count);if(8===a.bitsPerPoint){if(a.count+n!==e.byteLength)throw new r.A("lepcc-decode-error","Bad size");const t=new Uint8Array(e,n,a.count);for(let e=0;e<a.count;e++)c[e]=t[e]*a.scaleFactor}else if(16===a.bitsPerPoint){if(2*a.count+n!==e.byteLength)throw new r.A("lepcc-decode-error","Bad size");const t=new Uint16Array(e,n,a.count);for(let e=0;e<a.count;e++)c[e]=t[e]*a.scaleFactor}else{const t=[];if(d(e,n,t)!==e.byteLength)throw new r.A("lepcc-decode-error","Bad size");for(let e=0;e<a.count;e++)c[e]=t[e]*a.scaleFactor}return c}},37352:(e,t,n)=>{n.d(t,{A:()=>a});var r,o=n(31635),i=n(7762),s=n(25482),u=n(91429);let a=r=class extends s.o{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new i.A}clone(){return new r({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,o.Cg)([(0,u.MZ)({type:String,json:{write:{isRequired:!0}}})],a.prototype,"floorField",void 0),(0,o.Cg)([(0,u.MZ)({json:{read:!1,write:!1}})],a.prototype,"viewAllMode",void 0),(0,o.Cg)([(0,u.MZ)({json:{read:!1,write:!1}})],a.prototype,"viewAllLevelIds",void 0),a=r=(0,o.Cg)([(0,u.$K)("esri.layers.support.LayerFloorInfo")],a)},40710:(e,t,n)=>{n.d(t,{W:()=>o});var r=n(74333);class o extends r.n{constructor(e,t,n){super(e,"vec3",2,(r,o,i,s)=>r.setUniform3fv(e,t(o,i,s),n))}}},45671:(e,t,n)=>{n.d(t,{D8:()=>i,TO:()=>o});var r=n(30524);async function o(e,t=e.popupTemplate){if(null==t)return[];const n=await t.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:o}=t,{objectIdField:i,typeIdField:s,globalIdField:u,relationships:a}=e;if(n.includes("*"))return["*"];const c=o?(0,r.eX)(e):[],l=(0,r.DB)(e.fieldsIndex,[...n,...c]);return s&&l.push(s),l&&i&&e.fieldsIndex?.has(i)&&!l.includes(i)&&l.push(i),l&&u&&e.fieldsIndex?.has(u)&&!l.includes(u)&&l.push(u),a?.forEach(t=>{const{keyField:n}=t;l&&n&&e.fieldsIndex?.has(n)&&!l.includes(n)&&l.push(n)}),l}function i(e,t){return e&&"object"==typeof e?t?.checkPopupEnabled&&"popupEnabled"in e&&!e.popupEnabled?null:"popupTemplate"in e&&e.popupTemplate?e.popupTemplate:null!=t&&t.defaultPopupTemplateEnabled&&"defaultPopupTemplate"in e&&e.defaultPopupTemplate?e.defaultPopupTemplate:null:null}},49255:(e,t,n)=>{function r(e){return 3===e||4===e||5===e||6===e||7===e}function o(e){return function(e){return s(e)||u(e)}(e)||2===e}function i(e){return 0===e}function s(e){return i(e)||function(e){return 8===e||9===e}(e)}function u(e){return 1===e}function a(e){return u(e)||r(e)}n.d(t,{Bf:()=>r,Dz:()=>a,Lc:()=>s,_o:()=>i,iq:()=>o})},53466:(e,t,n)=>{n.d(t,{U:()=>i});var r=n(21818),o=n(31821);function i(e,t){switch(t.textureCoordinateType){case 1:return e.attributes.add("uv0","vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case 2:return e.attributes.add("uv0","vec2"),e.attributes.add("uvRegion","vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() {
2
2
  vuv0 = uv0;
3
3
  vuvRegion = uvRegion;
4
4
  }`);default:(0,r.Xb)(t.textureCoordinateType);case 0:return void e.vertex.code.add(o.H`void forwardTextureCoordinates() {}`);case 3:return}}},59418:(e,t,n)=>{n.d(t,{wH:()=>m,MA:()=>f,E5:()=>h,m0:()=>g});var r=n(49186),o=n(4718),i=n(53966),s=n(34275),u=n(37203);const a=()=>i.A.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function c(e,t,n){let o="",i=0;for(;i<n;){const s=e[t+i];if(s<128)o+=String.fromCharCode(s),i++;else if(s>=192&&s<224){if(i+1>=n)throw new r.A("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const u=(31&s)<<6|63&e[t+i+1];o+=String.fromCharCode(u),i+=2}else if(s>=224&&s<240){if(i+2>=n)throw new r.A("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const u=(15&s)<<12|(63&e[t+i+1])<<6|63&e[t+i+2];o+=String.fromCharCode(u),i+=3}else{if(!(s>=240&&s<248))throw new r.A("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(i+3>=n)throw new r.A("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const u=(7&s)<<18|(63&e[t+i+1])<<12|(63&e[t+i+2])<<6|63&e[t+i+3];if(u>=65536){const e=55296+(u-65536>>10),t=56320+(1023&u);o+=String.fromCharCode(e,t)}else o+=String.fromCharCode(u);i+=4}}}return o}function l(e,t){const n={byteOffset:0,byteCount:0,fields:Object.create(null)};let r=0;for(let o=0;o<t.length;o++){const i=t[o],s=i.valueType||i.type,u=w[s];n.fields[i.property]=u(e,r),r+=y[s].BYTES_PER_ELEMENT}return n.byteCount=r,n}function d(e,t,n){const o=[];let i,s,u=0;for(s=0;s<e;s+=1){if(i=t[s],i>0){if(o.push(c(n,u,i-1)),0!==n[u+i-1])throw new r.A("string-array-error","Invalid string array: missing null termination.")}else o.push(null);u+=i}return o}function f(e,t){return new(0,y[t.valueType])(e,t.byteOffset,t.count*t.valuesPerElement)}function h(e,t){if(!e)return null;const n=e[t];return(0,s.IY)(e)?n===s.PI?null:n:(0,s._G)(e)?n===s.h2?null:n:n!=n?null:n}function v(e,t,n){if(t!==e&&a().error(`Invalid ${n} buffer size\n expected: ${e}, actual: ${t})`),t<e)throw new r.A("buffer-too-small","Binary buffer is too small",{expectedSize:e,actualSize:t})}function m(e,t){const n=l(e,t&&t.header);let r=n.byteCount;const o={isDraco:!1,header:n,byteOffset:n.byteCount,byteCount:0,vertexAttributes:{}},i=n.fields,s=null!=i.vertexCount?i.vertexCount:i.count;for(const e of t.ordering){if(!t.vertexAttributes[e])continue;const n={...t.vertexAttributes[e],byteOffset:r,count:s},i=p[e]||"_"+e;o.vertexAttributes[i]=n,r+=b(n.valueType)*n.valuesPerElement*s}const u=i.faceCount;if(t.faces&&u){o.faces={};for(const e of t.ordering){if(!t.faces[e])continue;const n={...t.faces[e],byteOffset:r,count:u};o.faces[e]=n,r+=b(n.valueType)*n.valuesPerElement*u}}const a=i.featureCount;if(t.featureAttributes&&t.featureAttributeOrder&&a){o.featureAttributes={};for(const e of t.featureAttributeOrder){if(!t.featureAttributes[e])continue;const n={...t.featureAttributes[e],byteOffset:r,count:a};o.featureAttributes[e]=n,r+=("UInt64"===n.valueType?8:b(n.valueType))*n.valuesPerElement*a}}return v(r,e.byteLength,"geometry"),o.byteCount=r-o.byteOffset,o}const p={position:"position",normal:"normal",color:"color",uv0:"uv0",region:"uvRegion"};function g(e,t,n,i=!1){if("lepcc-rgb"===e.encoding)return i?(0,u.mb)(t):function(e){return Array.isArray(e)?e.length<s.y9?e:new Uint8Array(e):e.length<s.y9?Array.from(e):e}((0,u.mb)(t));if("lepcc-intensity"===e.encoding)return i?(0,u.Ax)(t):function(e){return Array.isArray(e)?e.length<s.y9?e:new Uint16Array(e):e.length<s.y9?Array.from(e):e}((0,u.Ax)(t));if(null!=e.encoding&&""!==e.encoding)throw new r.A("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");e["attributeByteCounts "]&&!e.attributeByteCounts&&(a().warn("Warning: Trailing space in 'attributeByteCounts '."),e.attributeByteCounts=e["attributeByteCounts "]),"ObjectIds"===e.ordering[0]&&e.hasOwnProperty("objectIds")&&(a().warn("Warning: Case error in objectIds"),e.ordering[0]="objectIds");const c=function(e,t,n){const i=null!=t.header?l(e,t.header):{byteOffset:0,byteCount:0,fields:{count:n}},s={header:i,byteOffset:i.byteCount,byteCount:0,entries:Object.create(null)};let u=i.byteCount;for(let e=0;e<t.ordering.length;e++){const n=t.ordering[e],a=(0,o.o8)(t[n]);if(a.count=i.fields.count??0,"String"===a.valueType){if(a.byteOffset=u,a.byteCount=i.fields[n+"ByteCount"],"UTF-8"!==a.encoding)throw new r.A("unsupported-encoding","Unsupported String encoding.",{encoding:a.encoding});if(a.timeEncoding&&"ECMA_ISO8601"!==a.timeEncoding)throw new r.A("unsupported-time-encoding","Unsupported time encoding.",{timeEncoding:a.timeEncoding})}else{if(!x(a.valueType))throw new r.A("unsupported-value-type","Unsupported binary valueType",{valueType:a.valueType});{const e=b(a.valueType);u+=u%e!==0?e-u%e:0,a.byteOffset=u,a.byteCount=e*a.valuesPerElement*a.count}}u+=a.byteCount??0,s.entries[n]=a}return s.byteCount=u-s.byteOffset,s}(t,e,n);v(c.byteOffset+c.byteCount,t.byteLength,"attribute");const m=c.entries.attributeValues||c.entries.objectIds;if(m){if("String"===m.valueType){const e=c.entries.attributeByteCounts,n=f(t,e),r=function(e,t){return new Uint8Array(e,t.byteOffset,t.byteCount)}(t,m);return m.timeEncoding?function(e,t,n){return d(e,t,n).map(e=>{const t=e?Date.parse(e):null;return null==t||Number.isNaN(t)?null:t})}(e.count,n,r):d(e.count,n,r)}return i?f(t,m):function(e,t){const n=f(e,t);if(n.length>=s.y9)return n;const r=new Array;return n.forEach((e,t)=>r.push(h(n,t))),r}(t,m)}throw new r.A("bad-attribute-storage-info","Bad attributeStorageInfo specification.")}const y={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array},w={Float32:(e,t)=>new DataView(e,0).getFloat32(t,!0),Float64:(e,t)=>new DataView(e,0).getFloat64(t,!0),UInt8:(e,t)=>new DataView(e,0).getUint8(t),Int8:(e,t)=>new DataView(e,0).getInt8(t),UInt16:(e,t)=>new DataView(e,0).getUint16(t,!0),Int16:(e,t)=>new DataView(e,0).getInt16(t,!0),UInt32:(e,t)=>new DataView(e,0).getUint32(t,!0),Int32:(e,t)=>new DataView(e,0).getInt32(t,!0)};function x(e){return y.hasOwnProperty(e)}function b(e){return x(e)?y[e].BYTES_PER_ELEMENT:0}},63201:(e,t,n)=>{n.d(t,{NL:()=>m});var r=n(49255),o=n(99208),i=n(40876),s=n(31821);function u(e){e.code.add(s.H`