@arcgis/core 4.33.0-next.20250422 → 4.33.0-next.20250424

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/Graphic.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/analysis/Analysis.d.ts +4 -0
  4. package/analysis/Analysis.js +1 -1
  5. package/analysis/SliceAnalysis.js +1 -1
  6. package/analysis/SlicePlane.js +1 -1
  7. package/analysis/support/AnalysisOriginWebScene.d.ts +4 -0
  8. package/analysis/support/AnalysisOriginWebScene.js +5 -0
  9. package/analysis/support/SliceAnalysisExcludedLayer.js +5 -0
  10. package/arcade/geometry/constructors.js +1 -1
  11. package/assets/components/assets/icon/mosaicMethodBlend16.json +1 -0
  12. package/assets/components/assets/icon/mosaicMethodBlend24.json +1 -0
  13. package/assets/components/assets/icon/mosaicMethodBlend32.json +1 -0
  14. package/assets/components/assets/icon/mosaicMethodByAttribute16.json +1 -0
  15. package/assets/components/assets/icon/mosaicMethodByAttribute24.json +1 -0
  16. package/assets/components/assets/icon/mosaicMethodByAttribute32.json +1 -0
  17. package/assets/components/assets/icon/mosaicMethodClosestToCenter16.json +1 -0
  18. package/assets/components/assets/icon/mosaicMethodClosestToCenter24.json +1 -0
  19. package/assets/components/assets/icon/mosaicMethodClosestToCenter32.json +1 -0
  20. package/assets/components/assets/icon/mosaicMethodClosestToNadir16.json +1 -0
  21. package/assets/components/assets/icon/mosaicMethodClosestToNadir24.json +1 -0
  22. package/assets/components/assets/icon/mosaicMethodClosestToNadir32.json +1 -0
  23. package/assets/components/assets/icon/mosaicMethodFirst16.json +1 -0
  24. package/assets/components/assets/icon/mosaicMethodFirst24.json +1 -0
  25. package/assets/components/assets/icon/mosaicMethodFirst32.json +1 -0
  26. package/assets/components/assets/icon/mosaicMethodLast16.json +1 -0
  27. package/assets/components/assets/icon/mosaicMethodLast24.json +1 -0
  28. package/assets/components/assets/icon/mosaicMethodLast32.json +1 -0
  29. package/assets/components/assets/icon/mosaicMethodLockRaster16.json +1 -0
  30. package/assets/components/assets/icon/mosaicMethodLockRaster24.json +1 -0
  31. package/assets/components/assets/icon/mosaicMethodLockRaster32.json +1 -0
  32. package/assets/components/assets/icon/mosaicMethodMaximum16.json +1 -0
  33. package/assets/components/assets/icon/mosaicMethodMaximum24.json +1 -0
  34. package/assets/components/assets/icon/mosaicMethodMaximum32.json +1 -0
  35. package/assets/components/assets/icon/mosaicMethodMean16.json +1 -0
  36. package/assets/components/assets/icon/mosaicMethodMean24.json +1 -0
  37. package/assets/components/assets/icon/mosaicMethodMean32.json +1 -0
  38. package/assets/components/assets/icon/mosaicMethodMinimum16.json +1 -0
  39. package/assets/components/assets/icon/mosaicMethodMinimum24.json +1 -0
  40. package/assets/components/assets/icon/mosaicMethodMinimum32.json +1 -0
  41. package/assets/components/assets/icon/mosaicMethodNone16.json +1 -0
  42. package/assets/components/assets/icon/mosaicMethodNone24.json +1 -0
  43. package/assets/components/assets/icon/mosaicMethodNone32.json +1 -0
  44. package/assets/components/assets/icon/mosaicMethodNorthWest16.json +1 -0
  45. package/assets/components/assets/icon/mosaicMethodNorthWest24.json +1 -0
  46. package/assets/components/assets/icon/mosaicMethodNorthWest32.json +1 -0
  47. package/assets/components/assets/icon/mosaicMethodSeamline16.json +1 -0
  48. package/assets/components/assets/icon/mosaicMethodSeamline24.json +1 -0
  49. package/assets/components/assets/icon/mosaicMethodSeamline32.json +1 -0
  50. package/assets/components/assets/icon/mosaicMethodSum16.json +1 -0
  51. package/assets/components/assets/icon/mosaicMethodSum24.json +1 -0
  52. package/assets/components/assets/icon/mosaicMethodSum32.json +1 -0
  53. package/assets/esri/core/workers/RemoteClient.js +1 -1
  54. package/assets/esri/core/workers/chunks/{b2f9f0767dadf185120c.js → 00612d6e05b1c8647668.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{d4d011eea16a89a5aad9.js → 0219c3f9408d3fa3c9a0.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{f54546c155fba2fd3a7e.js → 05d7d8ff3e4cbad32580.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{b1e275607d9754079f60.js → 079434fe765c53d304f2.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{4f8782b3b6ad414409e8.js → 0a48b9734ab4c64a6f4f.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{0eed612e82a279ac8d1e.js → 11b55e7e76e50fe11bbe.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{ccc50f28f217e50cc2c3.js → 1427e7953c3d8c87c5e8.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{184d7c8ea818bec5c462.js → 146b3699a9e8b1f2dcc2.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{8ba7d44eff348004f084.js → 1a6d2d090b643a87408a.js} +1 -1
  63. package/assets/esri/core/workers/chunks/1b8cc83aa1179245b2dc.js +1 -0
  64. package/assets/esri/core/workers/chunks/{5e5225623977e61fd0ef.js → 213adc87c843d627c5d6.js} +1 -1
  65. package/assets/esri/core/workers/chunks/235efd948ae470a6f238.js +1 -0
  66. package/assets/esri/core/workers/chunks/{60d3b329e69f3cddb7f4.js → 265f69d153b7b6f07e42.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{769b66cca8347f0f84db.js → 279bbd61b32577693a4a.js} +1 -1
  68. package/assets/esri/core/workers/chunks/290b065b377f9d2ee058.js +1 -0
  69. package/assets/esri/core/workers/chunks/29d3245261a7223124ed.js +1 -0
  70. package/assets/esri/core/workers/chunks/{0c6f2808c57ff820bfdd.js → 30551c1d3e4fa7be86c1.js} +2 -2
  71. package/assets/esri/core/workers/chunks/{0c6f2808c57ff820bfdd.js.LICENSE.txt → 30551c1d3e4fa7be86c1.js.LICENSE.txt} +1 -1
  72. package/assets/esri/core/workers/chunks/335b539893569e3d7b82.js +1 -0
  73. package/assets/esri/core/workers/chunks/{78242f2bf742b33d99fa.js → 3795793643f4db64af0e.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{38f9ede26098eb03ca2d.js → 3cf001abca8ad933bccf.js} +2 -2
  75. package/assets/esri/core/workers/chunks/{38f9ede26098eb03ca2d.js.LICENSE.txt → 3cf001abca8ad933bccf.js.LICENSE.txt} +1 -1
  76. package/assets/esri/core/workers/chunks/{dbaa4b8d37aab40d7bd1.js → 543eb46b55cacd6e1dbc.js} +2 -2
  77. package/assets/esri/core/workers/chunks/{dbaa4b8d37aab40d7bd1.js.LICENSE.txt → 543eb46b55cacd6e1dbc.js.LICENSE.txt} +1 -1
  78. package/assets/esri/core/workers/chunks/{93f792f5b94f3745b57d.js → 577f24923fa4d08360e4.js} +2 -2
  79. package/assets/esri/core/workers/chunks/{93f792f5b94f3745b57d.js.LICENSE.txt → 577f24923fa4d08360e4.js.LICENSE.txt} +1 -1
  80. package/assets/esri/core/workers/chunks/5958af341014e13475d2.js +1 -0
  81. package/assets/esri/core/workers/chunks/{f46c4a69ef2f763e905b.js → 5d63dfa5a60c88e03b28.js} +1 -1
  82. package/assets/esri/core/workers/chunks/60f7cd05e88701f43d3f.js +1 -0
  83. package/assets/esri/core/workers/chunks/{26e0a0a13060cd3e4291.js → 626ba3a7dee952308566.js} +1 -1
  84. package/assets/esri/core/workers/chunks/7bfa18dd8771d4932533.js +1 -0
  85. package/assets/esri/core/workers/chunks/7cd32b10ed0e18e44ef2.js +1 -0
  86. package/assets/esri/core/workers/chunks/7ffa68d69c138db1295d.js +1 -0
  87. package/assets/esri/core/workers/chunks/8dd26b12c625d20196ed.js +319 -0
  88. package/assets/esri/core/workers/chunks/91f8547a13f0461045ef.js +1 -0
  89. package/assets/esri/core/workers/chunks/9661ee8569ee208e6237.js +1 -0
  90. package/assets/esri/core/workers/chunks/{c2f38c66fae2cdb57445.js → 96e5d192c8d23c1e324f.js} +1 -1
  91. package/assets/esri/core/workers/chunks/974742af7beb000c4b4a.js +1 -0
  92. package/assets/esri/core/workers/chunks/{e27fa1e84f16b7f19a90.js → 9850ff14bd9c7da81c65.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{796cf1c2ca9955595836.js → 9b2ab27159500315fbc1.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{a276980c06d5d311a37e.js → 9f416cc5673665f8c37c.js} +1 -1
  95. package/assets/esri/core/workers/chunks/a0c51c4c30a5f749dfc6.js +1 -0
  96. package/assets/esri/core/workers/chunks/a79511b926a2830bb160.js +1 -0
  97. package/assets/esri/core/workers/chunks/{fdcbd28f38bc485ac5e3.js → ab6ecd8eeec5ff761b34.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{814d72abbfdd4552e4ec.js → ac9c6779771ec855da79.js} +2 -2
  99. package/assets/esri/core/workers/chunks/{814d72abbfdd4552e4ec.js.LICENSE.txt → ac9c6779771ec855da79.js.LICENSE.txt} +1 -1
  100. package/assets/esri/core/workers/chunks/{ef6e805c49e1afdf966b.js → c054198c6438cb57f188.js} +1 -1
  101. package/assets/esri/core/workers/chunks/c5d786166a5609b85276.js.LICENSE.txt +1 -1
  102. package/assets/esri/core/workers/chunks/{5bdd5ae2d2f23ef6b331.js → c87e2a63b96e0da77dfe.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{601fc99426f0213b0769.js → cbec01223d51cdb9ee79.js} +1 -1
  104. package/assets/esri/core/workers/chunks/cc4dd739c4c7e3ccea3f.js +1 -0
  105. package/assets/esri/core/workers/chunks/{90c893959145827961ac.js → cd9343c78a7c3acdbbcd.js} +1 -1
  106. package/assets/esri/core/workers/chunks/d3a74087e076a3ae76ca.js +1 -0
  107. package/assets/esri/core/workers/chunks/{26fcbe053194bd78fcc3.js → d8474dca270b25705699.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{5db336767959507c07e5.js → d8dc922f7466300b668f.js} +2 -2
  109. package/assets/esri/core/workers/chunks/{5db336767959507c07e5.js.LICENSE.txt → d8dc922f7466300b668f.js.LICENSE.txt} +1 -1
  110. package/assets/esri/core/workers/chunks/{96cddbbeef61a4f33f29.js → db5913824d5e5a2a8365.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{48a1bb1e171dd06a7c6e.js → dd94585508f49863dc15.js} +1 -1
  112. package/assets/esri/core/workers/chunks/e524462c63834fae7e01.js +2 -0
  113. package/assets/esri/core/workers/chunks/{02176f84d6d57f1bc1c8.js.LICENSE.txt → e524462c63834fae7e01.js.LICENSE.txt} +1 -1
  114. package/assets/esri/core/workers/chunks/{e7e987558cf017c62458.js → ebfa4a0334401f5e004a.js} +1 -1
  115. package/assets/esri/core/workers/chunks/{736a11e64e5f03e3936b.js → f2cef954b58c6604642c.js} +64 -64
  116. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  117. package/assets/esri/themes/dark/main.css +1 -1
  118. package/assets/esri/themes/light/main.css +1 -1
  119. package/assets/esri/themes/light/view.css +1 -1
  120. package/chunks/BloomBlur.glsl.js +7 -7
  121. package/chunks/BloomComposition.glsl.js +24 -25
  122. package/chunks/Bufferer-CicaNej1.js +1 -1
  123. package/chunks/Envelope.js +1 -1
  124. package/chunks/GeodeticDistanceCalculator-CcF1gMZX.js +1 -1
  125. package/chunks/Geometry.js +1 -1
  126. package/chunks/OperatorGeodesicBuffer.js +1 -1
  127. package/chunks/OperatorGeodeticArea.js +1 -1
  128. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  129. package/chunks/OperatorGeodeticLength.js +1 -1
  130. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  131. package/chunks/OperatorProximityGeodesic.js +1 -1
  132. package/chunks/OperatorShapePreservingLength.js +1 -1
  133. package/chunks/OperatorShapePreservingProject.js +1 -1
  134. package/chunks/OperatorSimplifyOGC.js +5 -0
  135. package/chunks/Point2D.js +1 -1
  136. package/chunks/ProjectionTransformation.js +1 -1
  137. package/chunks/QuadraticBezier.js +1 -1
  138. package/chunks/cameraUtilsSpherical.js +1 -1
  139. package/chunks/languageUtils.js +1 -1
  140. package/chunks/relateOperator.js +1 -1
  141. package/chunks/sphere.js +1 -1
  142. package/chunks/vxlLayer.js +1 -1
  143. package/core/Collection.js +1 -1
  144. package/core/JSONSupport.js +1 -1
  145. package/core/SetUtils.js +1 -1
  146. package/{views/webgl/GLObjectType.js → core/support/jsonUtils.js} +1 -1
  147. package/core/urlUtils.js +1 -1
  148. package/geometry/Mesh.js +1 -1
  149. package/geometry/operators/extendOperator.js +1 -1
  150. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  151. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  152. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  153. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  154. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  155. package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
  156. package/geometry/operators/gx/operatorSimplifyOGC.js +5 -0
  157. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  158. package/geometry/operators/reshapeOperator.js +1 -1
  159. package/geometry/operators/simplifyOGCOperator.d.ts +6 -0
  160. package/geometry/operators/simplifyOGCOperator.js +5 -0
  161. package/geometry/operators/support/jsonConverter.js +1 -1
  162. package/geometry/support/normalizeUtilsSync.js +1 -1
  163. package/geometry/support/sphere.js +1 -1
  164. package/interfaces.d.ts +442 -113
  165. package/layers/DimensionLayer.js +1 -1
  166. package/layers/RouteLayer.js +1 -1
  167. package/layers/SubtypeGroupLayer.js +1 -1
  168. package/layers/ViewshedLayer.js +1 -1
  169. package/layers/graphics/data/QueryEngine.js +1 -1
  170. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  171. package/layers/orientedImagery/transformations/utils.js +1 -1
  172. package/layers/support/FieldsIndex.js +1 -1
  173. package/layers/support/VideoElement.js +1 -1
  174. package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
  175. package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
  176. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  177. package/layers/support/rasterFormats/{TiffTags.js → tiffTag.js} +1 -1
  178. package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
  179. package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
  180. package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
  181. package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
  182. package/layers/support/rasterFunctions/RemapFunction.js +1 -1
  183. package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
  184. package/layers/support/videoUtils.js +5 -0
  185. package/package.json +2 -2
  186. package/portal/schemas/definitions.js +1 -1
  187. package/renderers/UniqueValueRenderer.js +1 -1
  188. package/renderers/support/colorRampUtils.js +1 -1
  189. package/support/revision.js +1 -1
  190. package/symbols/IconSymbol3DLayer.js +1 -1
  191. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  192. package/versionManagement/utils.js +1 -1
  193. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  194. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  195. package/views/2d/engine/webgl/textureUtils.js +1 -1
  196. package/views/2d/layers/MediaLayerView2D.js +1 -1
  197. package/views/2d/layers/TileLayerView2D.js +1 -1
  198. package/views/2d/layers/support/DebugOverlay.js +1 -1
  199. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  200. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  201. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  202. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  203. package/views/3d/analysis/Viewshed/ViewshedAnalysisVisualization.js +1 -1
  204. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  205. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  206. package/views/3d/camera/constraintUtils/distance.js +1 -1
  207. package/views/3d/camera/intersectionUtils.js +1 -1
  208. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  209. package/views/3d/environment/atmosphereUtils.js +1 -1
  210. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  211. package/views/3d/interactive/visualElements/EngineVisualElement.js +1 -1
  212. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  213. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  214. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  215. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  216. package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
  217. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  218. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  219. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  220. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  221. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  222. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  223. package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
  224. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  225. package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +1 -1
  226. package/views/3d/interactive/visualElements/VisualElement.js +1 -1
  227. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  228. package/views/3d/layers/I3SMeshView3D.js +1 -1
  229. package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
  230. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  231. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  232. package/views/3d/layers/graphics/pipeline/PipelineCommand.js +1 -1
  233. package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
  234. package/views/3d/layers/graphics/pipeline/TileActionSynchronizer.js +5 -0
  235. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  236. package/views/3d/state/ConstraintsManager.js +1 -1
  237. package/views/3d/state/NearFarHeuristic.js +1 -1
  238. package/views/3d/state/ViewState.js +1 -1
  239. package/views/3d/state/ViewStateManager.js +1 -1
  240. package/views/3d/state/utils/navigationUtils.js +1 -1
  241. package/views/3d/support/cameraUtilsSpherical.js +1 -1
  242. package/views/3d/support/geometryUtils/sphere.js +1 -1
  243. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  244. package/views/3d/webgl/ManagedDepthTexture.js +1 -1
  245. package/views/3d/webgl/ManagedFBO.js +1 -1
  246. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  247. package/views/3d/webgl-engine/core/FBOCacheFormats.js +5 -0
  248. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +12 -14
  249. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +1 -1
  250. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  251. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  252. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  253. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  254. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  255. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  256. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  257. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  258. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  259. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  260. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  261. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  262. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  263. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  264. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  265. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  266. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  267. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  268. package/views/SceneView.js +1 -1
  269. package/views/VideoView.js +1 -1
  270. package/views/interactive/Tooltip.js +1 -1
  271. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  272. package/views/layers/LineOfSightLayerView.d.ts +4 -0
  273. package/views/layers/LineOfSightLayerView.js +5 -0
  274. package/views/webgl/FBOAttachmentType.js +5 -0
  275. package/views/webgl/FramebufferObject.js +1 -1
  276. package/views/webgl/Renderbuffer.js +1 -1
  277. package/views/webgl/RenderbufferDescriptor.js +1 -1
  278. package/views/webgl/Texture.js +1 -1
  279. package/views/webgl/TextureDescriptor.js +1 -1
  280. package/webscene/InitialViewProperties.js +1 -1
  281. package/webscene/Presentation.js +1 -1
  282. package/webscene/Slide.js +1 -1
  283. package/webscene/SlideLegendInfo.js +1 -1
  284. package/webscene/background/ColorBackground.js +1 -1
  285. package/webscene/spec-certification/api.js +1 -1
  286. package/webscene/spec-certification/compare.js +1 -1
  287. package/webscene/spec-certification/index.js +1 -1
  288. package/webscene/spec-certification/spec.js +1 -1
  289. package/webscene/spec-certification/utils.js +1 -1
  290. package/webscene/support/Description.js +1 -1
  291. package/webscene/support/SlideElements.js +1 -1
  292. package/webscene/support/SlideEnvironment.js +1 -1
  293. package/webscene/support/SlideGround.js +1 -1
  294. package/webscene/support/SlideVisibleLayer.js +1 -1
  295. package/webscene/support/Title.js +1 -1
  296. package/webscene/support/analysisUtils.js +5 -0
  297. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  298. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  299. package/widgets/Editor/EditorViewModel.js +1 -1
  300. package/widgets/Editor/UpdateWorkflow.js +1 -1
  301. package/widgets/Editor/support/SketchController.js +5 -0
  302. package/widgets/Editor/workflowUtils.js +1 -1
  303. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  304. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  305. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  306. package/widgets/FeatureTable.js +1 -1
  307. package/widgets/LayerList/LayerListItem.js +1 -1
  308. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  309. package/widgets/Widget.js +1 -1
  310. package/widgets/support/SelectionList.js +1 -1
  311. package/widgets/support/SnappingControls.js +1 -1
  312. package/assets/esri/core/workers/chunks/02176f84d6d57f1bc1c8.js +0 -2
  313. package/assets/esri/core/workers/chunks/244d2196bac5ef279436.js +0 -1
  314. package/assets/esri/core/workers/chunks/32f2e0c88046b39916cc.js +0 -1
  315. package/assets/esri/core/workers/chunks/388a763da712ca71ccf4.js +0 -1
  316. package/assets/esri/core/workers/chunks/5ffc3ca6c6a4d32e1282.js +0 -1
  317. package/assets/esri/core/workers/chunks/642a595353a86f3717e3.js +0 -1
  318. package/assets/esri/core/workers/chunks/82353e59ac6d909dcf41.js +0 -1
  319. package/assets/esri/core/workers/chunks/873327fc41edd3830afa.js +0 -319
  320. package/assets/esri/core/workers/chunks/93e9dfd1ba8f393c6c47.js +0 -1
  321. package/assets/esri/core/workers/chunks/95379fdd6917c8a84c71.js +0 -1
  322. package/assets/esri/core/workers/chunks/9b21dc4659922cc577cb.js +0 -1
  323. package/assets/esri/core/workers/chunks/a197c86d42cc9ce21924.js +0 -1
  324. package/assets/esri/core/workers/chunks/d81bebbb6fe000200d35.js +0 -1
  325. package/assets/esri/core/workers/chunks/daa54c8a317c27881763.js +0 -1
  326. package/assets/esri/core/workers/chunks/dd8e72d6784a8ebc115d.js +0 -1
  327. package/assets/esri/core/workers/chunks/e15c612caadf7bac4ab9.js +0 -1
  328. package/assets/esri/core/workers/chunks/e9fba86036b8fe700a41.js +0 -1
  329. package/views/3d/webgl/formats.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../core/has.js";import{bytesToUTF8 as e}from"../rasterDatasets/byteStreamUtils.js";import{J as t}from"../../../chunks/Jpg.js";import{load as n,decode as a}from"./Lerc.js";import{decode as i}from"./Lzw.js";import{convertNoDataToMask as s}from"./pixelRangeUtils.js";import r from"./TiffTags.js";import{isPlatformLittleEndian as l}from"./utils.js";import{Z as o}from"../../../chunks/Zlib.js";const f=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],u=4294967296,c=new Set([1,5,6,7,8,34712,34887]);function h(e,t){let n="unknown";return 3===e?n=64===t?"f64":"f32":1===e?1===t?n="u1":2===t?n="u2":4===t?n="u4":t<=8?n="u8":t<=16?n="u16":t<=32&&(n="u32"):2===e&&(t<=8?n="s8":t<=16?n="s16":t<=32&&(n="s32")),n}function g(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function E(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function T(e,t){return e.get(t)?.values}function I(e,t){return e.get(t)?.values}function w(e,t){return e.get(t)?.values?.[0]}function p(e,t){return e.get(t)?.values?.[0]}function d(e,t,n,a=0,i=r.tiffTags,s=4){const l=8===s,o=l?C(new DataView(e,n,8),0,t):new DataView(e,n,2).getUint16(0,t),f=4+2*s,u=l?8:2,c=u+o*f;if(n+c>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:c};const h=8===s?8:4,g=n+c+h<=e.byteLength?v(new DataView(e,n+c,h),0,t,8===s):null,E=n+u,T=new Map;let I,w,p,d,m,y=0,A=0;for(let S=0;S<o;S++){w=new DataView(e,E+f*S,f),p=w.getUint16(0,t),m=w.getUint16(2,t),d=r.getTagName(p,i);const n=[];2===s?(y=w.getUint16(4,t),A=w.getUint16(6,t)):4===s?(y=w.getUint32(4,t),A=w.getUint32(8,t)):8===s&&(y=v(w,4,t,!0),A=v(w,12,t,!0),n.push(w.getUint32(12,t)),n.push(w.getUint32(16,t))),I={id:p,type:m,valueCount:y,valueOffset:A,valueOffsets:n,values:null},L(e,t,I,a,!1,s),T.set(d,I)}return{success:!0,ifd:T,nextIFD:g,requiredBufferSize:c}}const m=(e,t)=>a(e,{inputOffset:t}).pixels[0];function y(e,t){if(1!==t&&2!==t&&4!==t)return e;const n=new Uint8Array(e),a=8/t,i=new Uint8Array(e.byteLength*a);let s=0;const r=2**t-1;for(let l=0;l<n.length;l++){const e=n[l];for(let n=0;n<a;n++)i[s++]=e<<t*n>>>8-t&r}return i.buffer}function A(e,n,a){const i=new t;i.parse(e),i.colorTransform=6===a?-1:0;const s=i.getData(i.width,i.height,1!==n&&4!==n);return new Uint8Array(s.buffer)}function S(e){const t=new o(e).getBytes(),n=new ArrayBuffer(t.length),a=new Uint8Array(n);return a.set(t),a}async function M(e,t,a,s,r){const o=l===t,f=p(a,"BITSPERSAMPLE"),u=p(a,"SAMPLESPERPIXEL")??1,c=p(a,"PHOTOMETRICINTERPRETATION"),E=p(a,"SAMPLEFORMAT")??1,T=h(E,f),I=p(a,"COMPRESSION")??1,w=g(T);let d,M,P;if(34887===I)return await n(),m(e,s);if(1===I)d=e.slice(s,s+r),M=new Uint8Array(d);else if(8===I||32946===I)M=new Uint8Array(e,s,r),M=S(M),d=M.buffer;else if(6===I)M=new Uint8Array(e,s,r),M=A(M,u,c),d=M.buffer;else if(7===I){const t=a.get("JPEGTABLES").values,n=t.length-2;M=new Uint8Array(n+r-2);for(let e=0;e<n;e++)M[e]=t[e];const i=new Uint8Array(e,s+2,r-2);for(let e=0;e<i.length;e++)M[n+e]=i[e];M=A(M,u,c),d=M.buffer}else{if(5!==I)throw new Error("tiff-decode: unsupport compression "+I);M=i(e,s,r,t),d=M.buffer}if(d=y(d,f),"u8"===T||"s8"===T||o)P=new w(d);else{d=new ArrayBuffer(M.length);const e=new Uint8Array(d);switch(T){case"u16":case"s16":for(let t=0;t<M.length;t+=2)e[t]=M[t+1],e[t+1]=M[t];break;case"u32":case"s32":case"f32":for(let t=0;t<M.length;t+=4)e[t]=M[t+3],e[t+1]=M[t+2],e[t+2]=M[t+1],e[t+3]=M[t]}P=new w(d)}const O=p(a,"PREDICTOR")??1,b=p(a,"TILEWIDTH"),x=p(a,"TILELENGTH");if(O>1&&(5===I||8===I||32946===I)&&b&&x){const e=R(a),t=new w(P.length);t.set(P),P=W(t,x,b,3===E&&3===O,e?1:u)}return P}async function P(e,t,n){const a=I(n,"TILEOFFSETS");if(void 0===a)return null;const i=I(n,"TILEBYTECOUNTS"),{width:s,height:r,pixelType:l,tileWidth:o,tileHeight:f}=D([n]),u=R(n,t),c=p(n,"SAMPLESPERPIXEL")||t.planes,h=s*r,E=p(n,"BITSPERSAMPLE"),T=34887===(p(n,"COMPRESSION")??1),w=g(l),d=[];for(let g=0;g<c;g++)d.push(new w(h));let m,y,A,S,P,O,b,x,L,N,U,k,C;const G=Math.ceil(s/o),v=new Uint8Array(h).fill(255);let F=!1;if(E%8==0)if(T&&u&&c>1){const l=Math.round(a.length/c);for(m=0;m<l;m++){O=Math.floor(m/G)*f,b=m%G*o,x=O*s+b;for(let l=0;l<c;l++){const u=m*c+l;for(0===i[u]?(A=null,F=!0):A=await M(e,t.littleEndian,n,a[u],i[u]),N=0,L=x,k=Math.min(o,s-b),U=Math.min(f,r-O),C=d[l],S=0;S<U;S++)for(L=x+S*s,N=S*o,P=0;P<k;P++,L++,N++)A?C[L]=A[N]:v[L]=0}}}else for(m=0;m<a.length;m++)for(O=Math.floor(m/G)*f,b=m%G*o,x=O*s+b,0===i[m]?(A=null,F=!0):A=await M(e,t.littleEndian,n,a[m],i[m]),N=0,L=x,k=Math.min(o,s-b),U=Math.min(f,r-O),y=0;y<c;y++)if(C=d[y],u||T)for(S=0;S<U;S++)for(L=x+S*s,N=o*f*y+S*o,P=0;P<k;P++,L++,N++)A?C[L]=A[N]:v[L]=0;else for(S=0;S<U;S++)for(L=x+S*s,N=S*o*c+y,P=0;P<k;P++,L++,N+=c)A?C[L]=A[N]:v[L]=0;return{width:s,height:r,pixelType:l,pixels:d,mask:F?v:void 0}}const O=(e,t,n)=>{const a=l===t.littleEndian,s=I(n,"STRIPOFFSETS");if(void 0===s)return null;const{width:r,height:o,pixelType:f}=D([n]),u=p(n,"SAMPLESPERPIXEL")||t.planes,c=p(n,"PHOTOMETRICINTERPRETATION"),h=r*o,E=p(n,"BITSPERSAMPLE"),T=g(f),w=new T(h*u),d=I(n,"STRIPBYTECOUNTS"),m=p(n,"ROWSPERSTRIP"),M=p(n,"COMPRESSION")??1;let P,O,b,x,L,R,N,U,k;if(E%8==0)for(P=0;P<s.length;P++){if(L=P*(m*r)*u,"u8"===f||"s8"===f||a)8===M||32946===M?(N=new Uint8Array(e,s[P],d[P]),N=S(N),R=N.buffer):6===M?(N=new Uint8Array(e,s[P],d[P]),N=A(N,u,c),R=N.buffer):5===M?(N=i(e,s[P],d[P],t.littleEndian),R=N.buffer):R=e.slice(s[P],s[P]+d[P]),R=y(R,E),x=new T(R);else{switch(6===M||8===M||32946===M?(N=new Uint8Array(e,s[P],d[P]),U=S(N),R=U.buffer):(R=new ArrayBuffer(d[P]),N=new Uint8Array(e,s[P],d[P]),U=new Uint8Array(R)),f){case"u16":case"s16":for(b=0;b<N.length;b+=2)U[b]=N[b+1],U[b+1]=N[b];break;case"u32":case"s32":case"f32":for(b=0;b<N.length;b+=4)U[b]=N[b+3],U[b+1]=N[b+2],U[b+2]=N[b+1],U[b+3]=N[b]}R=y(R,E),x=new T(R)}w.set(x,L)}const C=[];if(1===u)C.push(w);else for(P=0;P<u;P++){for(k=new T(h),O=0;O<h;O++)k[O]=w[O*u+P];C.push(k)}return{width:r,height:o,pixelType:f,pixels:C}},b=(e,t,n)=>{if(!(e.length>0&&t&&n))return null;let a,i,s;const r=e[0].length,l=e.length,o=new Uint8Array(r);for(let f=0;f<l;f++)if(a=e[f],i=t[f],s=n[f],0===f)for(let e=0;e<r;e++)o[e]=a[e]<i||a[e]>s?0:1;else for(let e=0;e<r;e++)o[e]&&(o[e]=a[e]<i||a[e]>s?0:1);return o},x=e=>{if(!e)return null;const t=e.match(/<Item(.*?)Item>/gi);if(!t||0===t.length)return null;const n=new Map;let a,i,s,r,l;for(let w=0;w<t.length;w++)a=t[w],i=a.slice(6,a.indexOf(">")),r=a.indexOf("sample="),r>-1&&(l=a.slice(r+8,a.indexOf('"',r+8))),r=a.indexOf("name="),r>-1&&(i=a.slice(r+6,a.indexOf('"',r+6))),i&&(s=a.slice(a.indexOf(">")+1,a.indexOf("</Item>")).trim(),null!=l?n.has(i)?n.get(i)[l]=s:n.set(i,[s]):n.set(i,s)),l=null;const o=n.get("STATISTICS_MINIMUM"),f=n.get("STATISTICS_MAXIMUM"),u=n.get("STATISTICS_MEAN"),c=n.get("STATISTICS_STDDEV");let h=null;if(o&&f){h=[];for(let e=0;e<o.length;e++)h.push({min:parseFloat(o[e]),max:parseFloat(f[e]),avg:u&&parseFloat(u[e]),stddev:c&&parseFloat(c[e])})}const g=n.get("BandName"),E=n.get("WavelengthMin"),T=n.get("WavelengthMax");let I=null;if(g){I=[];for(let e=0;e<g.length;e++)I.push({BandName:g[e],WavelengthMin:E&&parseFloat(E[e]),WavelengthMax:T&&parseFloat(T[e])})}return{statistics:h,bandProperties:I,dataType:n.get("DataType"),rawMetadata:n}};function L(e,t,n,a=0,i=!1,s=4){if(n.values)return!0;const r=n.type,l=n.valueCount;let o=n.valueOffset,c=[];const h=f[r],g=8*h,E=l*h,T=l*f[r]*8;let I,w;const p=8===s?64:32,d=n.valueOffsets;if(T>p){if(E>(i?e.byteLength:e?e.byteLength-o+a:0))return n.offlineOffsetSize=[o,E],n.values=null,!1}if(T<=p){if(!t)if(p<=32)o>>>=32-T;else{const e=d?.length?d[0]:o>>>0,t=d?.length?d[1]:Math.round((o-e)/u);T<=32?(o=e>>>32-T,d[0]=o):(o=e*2**(32-T)+(t>>>32-T),d[0]=e,d[1]=t>>>32-T)}if(1===l&&g===p)c=[o];else if(64===p){const e=d?.length?d[0]:o>>>0,t=d?.length?d[1]:Math.round((o-e)/u);let n=e,a=32;for(w=1;w<=l;w++){const e=32-g*w%32;if(a<g){const i=n<<e>>>32-a,s=t<<32-a>>>32-a;n=t,c.push(i+s*2**(g-a)),a-=32-(g-a)}else c.push(n<<e>>>32-g),a-=g;0===a&&(a=32,n=t)}}else for(w=1;w<=l;w++){const e=32-g*w;c.push(o<<e>>>32-g)}}else{o-=a,i&&(o=0);for(let n=o;n<o+E;n+=h){switch(r){case 1:case 2:case 7:I=new DataView(e,n,1).getUint8(0);break;case 3:I=new DataView(e,n,2).getUint16(0,t);break;case 4:case 13:I=new DataView(e,n,4).getUint32(0,t);break;case 5:I=new DataView(e,n,4).getUint32(0,t)/new DataView(e,n+4,4).getUint32(0,t);break;case 6:I=new DataView(e,n,1).getInt8(0);break;case 8:I=new DataView(e,n,2).getInt16(0,t);break;case 9:I=new DataView(e,n,4).getInt32(0,t);break;case 10:I=new DataView(e,n,4).getInt32(0,t)/new DataView(e,n+4,4).getInt32(0,t);break;case 11:I=new DataView(e,n,4).getFloat32(0,t);break;case 12:I=new DataView(e,n,8).getFloat64(0,t);break;case 16:case 18:I=C(new DataView(e,n,8),0,t);break;case 17:I=G(new DataView(e,n,8),0,t);break;default:I=null}c.push(I)}}if(2===r){let e="";const t=c;for(c=[],w=0;w<t.length;w++)0===t[w]&&""!==e?(c.push(e),e=""):e+=String.fromCharCode(t[w]);""===e&&0!==c.length||c.push(e)}return n.values=c,!0}function D(e){const t=e[0],n=p(t,"TILEWIDTH"),a=p(t,"TILELENGTH"),i=p(t,"IMAGEWIDTH"),s=p(t,"IMAGELENGTH"),r=p(t,"BITSPERSAMPLE"),l=p(t,"SAMPLESPERPIXEL"),o=p(t,"SAMPLEFORMAT")??1,f=h(o,r),u=R(t),g=T(t,"GDAL_NODATA");let d=null;g?.length&&(d=g.map((e=>parseFloat(e))),d.some((e=>isNaN(e)))&&(d=null));const m=p(t,"COMPRESSION")??1;let y;switch(m){case 1:y="NONE";break;case 2:case 3:case 4:case 32771:y="CCITT";break;case 5:y="LZW";break;case 6:case 7:y="JPEG";break;case 32773:y="PACKBITS";break;case 8:case 32946:y="DEFLATE";break;case 34712:y="JPEG2000";break;case 34887:y="LERC";break;default:y=String(m)}let A=!0,S="";c.has(m)||(A=!1,S+="unsupported tag compression "+m),o>3&&(A=!1,S+="unsupported tag sampleFormat "+o),1!==r&&2!==r&&4!==r&&r%8!=0&&(A=!1,S+="unsupported tag bitsPerSample "+r);const M=w(t,"GEOASCIIPARAMS");let P;if(M){const e=M.split("|").find((e=>e.includes("ESRI PE String = "))),t=e?e.replace("ESRI PE String = ",""):"";P=t.startsWith("COMPD_CS")||t.startsWith("PROJCS")||t.startsWith("GEOGCS")?{wkid:null,wkt:t}:null}const O=I(t,"GEOTIEPOINTS"),b=I(t,"GEOPIXELSCALE"),L=I(t,"GEOTRANSMATRIX"),D=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let k,C,G=!1,v=!1;if(D){G=2===p(D,"GTRasterTypeGeoKey");const e=p(D,"GTModelTypeGeoKey");if(2===e){const e=p(D,"GeographicTypeGeoKey");e>=1024&&e<=32766&&(P={wkid:e}),P||32767!==e||(v=!0,P={wkid:4326})}else if(1===e){const e=p(D,"ProjectedCSTypeGeoKey");e>=1024&&e<=32766&&(P={wkid:e})}}if(b&&O&&O.length>=6?(k=[b[0],0,O[3]-O[0]*b[0],0,-Math.abs(b[1]),O[4]-O[1]*b[1]],G&&(k[2]-=.5*k[0]+.5*k[1],k[5]-=.5*k[3]+.5*k[4])):L&&16===L.length&&(k=G?[L[0],L[1],L[3]-.5*L[0],L[4],L[5],L[7]-.5*L[5]]:[L[0],L[1],L[3],L[4],L[5],L[7]]),k){const e=[{x:0,y:s},{x:0,y:0},{x:i,y:s},{x:i,y:0}];let t,n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let i=0;i<e.length;i++)t=E(e[i],k),n=t.x>n?n:t.x,r=t.x<r?r:t.x,a=t.y>a?a:t.y,l=t.y<l?l:t.y;C={xmin:n,xmax:r,ymin:a,ymax:l,spatialReference:P}}else C={xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:P};v&&(C.xmax-C.xmin>400||Math.max(Math.abs(C.xmin),Math.abs(C.xmax))>361)&&(P=null,C.spatialReference=null);const F=N(e);let B,W,H,Y,_;if(F.length>0){H=Math.round(Math.log(i/p(F[0],"IMAGEWIDTH"))/Math.LN2);const e=F[F.length-1];Y=F.length,B=p(e,"TILEWIDTH"),W=p(e,"TILELENGTH")}B=null!=Y&&Y>0?B||n:null,W=null!=Y&&Y>0?W||a:null,n&&(_=[{maxCol:Math.ceil(i/n)-1,maxRow:Math.ceil(s/a)-1,minRow:0,minCol:0}],F.forEach((e=>{_.push({maxCol:Math.ceil(p(e,"IMAGEWIDTH")/p(e,"TILEWIDTH"))-1,maxRow:Math.ceil(p(e,"IMAGELENGTH")/p(e,"TILELENGTH"))-1,minRow:0,minCol:0})})));const j=w(e[0],"GDAL_METADATA"),K=x(j);S+=" "+V({width:i,height:s,tileWidth:n,tileHeight:a,planes:l,ifds:e});const X=U(e).length===F.length+1,J=F?.length?F.map((e=>({x:i/p(e,"IMAGEWIDTH"),y:s/p(e,"IMAGELENGTH")}))):void 0;return{width:i,height:s,tileWidth:n,tileHeight:a,planes:l,isBSQ:u,pixelType:f,compression:y,noData:d,hasMaskBand:X,isSupported:A,pyramidResolutions:J,message:S,extent:C,isPseudoGeographic:v,affine:b?null:k,firstPyramidLevel:H,maximumPyramidLevel:Y,pyramidBlockWidth:B,pyramidBlockHeight:W,tileBoundary:_,metadata:K}}function R(e,t){const n=T(e,"PLANARCONFIGURATION");return n?2===n[0]:!!t&&t.isBSQ}function N(e){return e.filter((e=>1===p(e,"NEWSUBFILETYPE")))}function U(e){return e.filter((e=>{const t=!(4&~(p(e,"NEWSUBFILETYPE")??0)),n=4===p(e,"PHOTOMETRICINTERPRETATION");return t&&n}))}function k(e){const{littleEndian:t,isBigTiff:n,firstIFDPos:a}=F(e);let i=a;const s=[];do{const a=B(e,t,i,0,r.tiffTags,n?8:4);if(!a.success)break;s.push(a.ifd),i=a.nextIFD}while(i>0);return{...D(s),littleEndian:t,isBigTiff:n,ifds:s,pyramidIFDs:N(s),maskIFDs:U(s)}}function C(e,t,n){const a=e.getUint32(t,n),i=e.getUint32(t+4,n);return n?i*u+a:a*u+i}function G(e,t,n){let a=n?e.getInt32(t,n):e.getUint32(t,n),i=n?e.getUint32(t+4,n):e.getInt32(t+4,n);const s=(n?a:i)>=0?1:-1;n?a*=s:i*=s;return s*(n?i*u+a:a*u+i)}function v(e,t,n,a){return a?C(e,t,n):e.getUint32(t,n)}function F(e){const t=new DataView(e,0,16),n=t.getUint16(0,!1);let a=null;if(18761===n)a=!0;else{if(19789!==n)throw new Error("unexpected endianess byte");a=!1}const i=t.getUint16(2,a);if(42!==i&&43!==i)throw new Error("unexpected tiff identifier");let s=4;const r=43===i;if(r){const e=t.getUint16(s,a);if(s+=2,8!==e)throw new Error("unsupported bigtiff version");if(0!==t.getUint16(s,a))throw new Error("unsupported bigtiff version");s+=2}return{littleEndian:a,isBigTiff:r,firstIFDPos:v(t,s,a,r)}}function B(t,n,a,i=0,s=r.tiffTags,l=4){const o=d(t,n,a,i,s,l);let f;const u=o.ifd;if(u){if(r.ifdTags.forEach(((e,a)=>{u.has(a)&&(f=u.get(a),f.data=d(t,n,f.valueOffset-i,i,e).ifd)})),u.has("GEOKEYDIRECTORY")){f=u.get("GEOKEYDIRECTORY");const e=f.values;if(e&&e.length>4){const a=e[0]+"."+e[1]+"."+e[2];f.data=d(t,n,f.valueOffset+6-i,i,r.geoKeys,2).ifd,f.data&&f.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[a]})}}if(u.has("XMP")){f=u.get("XMP");const t=f.values;"number"==typeof t[0]&&7===f.type&&(f.values=[e(new Uint8Array(t))])}}return o}function V(e){const{width:t,height:n,tileHeight:a,tileWidth:i}=e,s=e.planes,r=i?i*a:t*n,l=p(e.ifds[0],"BITSPERSAMPLE");let o="";return r*s>2**30/(l>8?l/8:1)&&(o=i?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),o}function W(e,t,n,a,i){const s=a?4:1,r=n*s*i;a&&(e=new Uint8Array(e.buffer));for(let f=0;f<t;f++){const t=f*r;for(let n=i;n<r;n++)e[t+n]+=e[t+n-i]}if(!a)return e;const l=new Uint8Array(e.length),o=n*i;for(let f=0;f<t;f++){const t=f*r;for(let n=0;n<o;n++)for(let a=0;a<s;a++)l[t+n*s+a]=e[t+n+(s-a-1)*o]}return new Float32Array(l.buffer)}async function H(e,t){const{headerInfo:n,ifd:a,offsets:i,sizes:r}=t,l=[];for(let s=0;s<i.length;s++){r[s];const t=await M(e,n.littleEndian,a,i[s],r[s]||e.byteLength);l.push(t)}const o=R(a,n),f=p(a,"BITSPERSAMPLE"),u=h(p(a,"SAMPLEFORMAT")??1,f),c=p(a,"SAMPLESPERPIXEL")||n.planes,E=g(u),T=p(a,"TILEWIDTH"),I=p(a,"TILELENGTH"),w=p(a,"COMPRESSION")??1,d=T*I;let m;const y=[];let A=l[0];const S=34887===w;for(let s=0;s<c;s++){if(m=new E(d),l.length===c)A=l[s],A.length===d&&(m=A);else if(A.length)if(o||S)m=A.length===d?A:A.slice(d*s,d*(s+1));else for(let e=0;e<d;e++)m[e]=A[e*c+s];y.push(m)}const P=n.noData?n.noData[0]:t.noDataValue,O=n.metadata?n.metadata.statistics:null,x=O?O.map((e=>e.min)):null,L=O?O.map((e=>e.max)):null,D={pixelType:u,width:T,height:I,pixels:y,noDataValue:P};return null!=P?s(D,P,{matchAllNoData:t?.matchAllNoData}):x&&L&&t.applyMinMaxConstraint&&(D.mask=b(y,x,L)),D}async function Y(e,t={}){const n=t.pyramidLevel||0,a=t.headerInfo||k(e),{ifds:i,noData:r}=a;if(0===i.length)throw new Error("no valid image file directory");const l=V(a);if(l)throw l;let o=null;const f=-1===n?i[i.length-1]:i[n],u=r??t.noDataValue;if(o=a.tileWidth?await P(e,a,f):O(e,a,f),!o)return o;if(null!=u){s(o,u,{matchAllNoData:null==r&&t?.matchAllNoData})}return o}export{Y as decode,H as decodeTileOrStrip,D as getImageInfo,U as getMaskIFDs,N as getPyramidIFDs,R as isBSQConfig,L as parseFieldValues,k as parseHeader,B as parseIFD,F as parseSignature};
5
+ import"../../../core/has.js";import{bytesToUTF8 as e}from"../rasterDatasets/byteStreamUtils.js";import{J as t}from"../../../chunks/Jpg.js";import{load as n,decode as a}from"./Lerc.js";import{decode as i}from"./Lzw.js";import{convertNoDataToMask as r}from"./pixelRangeUtils.js";import{ifdTags as s,tiffTags as l,getTagName as o,geoKeys as f}from"./tiffTag.js";import{isPlatformLittleEndian as u}from"./utils.js";import{Z as c}from"../../../chunks/Zlib.js";const h=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],g=4294967296,E=new Set([1,5,6,7,8,34712,34887]);function I(e,t){let n="unknown";return 3===e?n=64===t?"f64":"f32":1===e?1===t?n="u1":2===t?n="u2":4===t?n="u4":t<=8?n="u8":t<=16?n="u16":t<=32&&(n="u32"):2===e&&(t<=8?n="s8":t<=16?n="s16":t<=32&&(n="s32")),n}function T(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function w(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function p(e,t){return e.get(t)?.values}function d(e,t){return e.get(t)?.values}function m(e,t){return e.get(t)?.values?.[0]}function y(e,t){return e.get(t)?.values?.[0]}function A(e,t,n,a=0,i=l,r=4){const s=8===r,f=s?F(new DataView(e,n,8),0,t):new DataView(e,n,2).getUint16(0,t),u=4+2*r,c=s?8:2,h=c+f*u;if(n+h>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:h};const g=8===r?8:4,E=n+h+g<=e.byteLength?V(new DataView(e,n+h,g),0,t,8===r):null,I=n+c,T=new Map;let w,p,d,m,y,A=0,S=0;for(let l=0;l<f;l++){p=new DataView(e,I+u*l,u),d=p.getUint16(0,t),y=p.getUint16(2,t),m=o(d,i);const n=[];2===r?(A=p.getUint16(4,t),S=p.getUint16(6,t)):4===r?(A=p.getUint32(4,t),S=p.getUint32(8,t)):8===r&&(A=V(p,4,t,!0),S=V(p,12,t,!0),n.push(p.getUint32(12,t)),n.push(p.getUint32(16,t))),w={id:d,type:y,valueCount:A,valueOffset:S,valueOffsets:n,values:null},N(e,t,w,a,!1,r),T.set(m,w)}return{success:!0,ifd:T,nextIFD:E,requiredBufferSize:h}}const S=(e,t)=>a(e,{inputOffset:t}).pixels[0];function M(e,t){if(1!==t&&2!==t&&4!==t)return e;const n=new Uint8Array(e),a=8/t,i=new Uint8Array(e.byteLength*a);let r=0;const s=2**t-1;for(let l=0;l<n.length;l++){const e=n[l];for(let n=0;n<a;n++)i[r++]=e<<t*n>>>8-t&s}return i.buffer}function P(e,n,a){const i=new t;i.parse(e),i.colorTransform=6===a?-1:0;const r=i.getData(i.width,i.height,1!==n&&4!==n);return new Uint8Array(r.buffer)}function O(e){const t=new c(e).getBytes(),n=new ArrayBuffer(t.length),a=new Uint8Array(n);return a.set(t),a}async function b(e,t,a,r,s){const l=u===t,o=y(a,"BITSPERSAMPLE"),f=y(a,"SAMPLESPERPIXEL")??1,c=y(a,"PHOTOMETRICINTERPRETATION"),h=y(a,"SAMPLEFORMAT")??1,g=I(h,o),E=y(a,"COMPRESSION")??1,w=T(g);let p,d,m;if(34887===E)return await n(),S(e,r);if(1===E)p=e.slice(r,r+s),d=new Uint8Array(p);else if(8===E||32946===E)d=new Uint8Array(e,r,s),d=O(d),p=d.buffer;else if(6===E)d=new Uint8Array(e,r,s),d=P(d,f,c),p=d.buffer;else if(7===E){const t=a.get("JPEGTABLES").values,n=t.length-2;d=new Uint8Array(n+s-2);for(let e=0;e<n;e++)d[e]=t[e];const i=new Uint8Array(e,r+2,s-2);for(let e=0;e<i.length;e++)d[n+e]=i[e];d=P(d,f,c),p=d.buffer}else{if(5!==E)throw new Error("tiff-decode: unsupport compression "+E);d=i(e,r,s,t),p=d.buffer}if(p=M(p,o),"u8"===g||"s8"===g||l)m=new w(p);else{p=new ArrayBuffer(d.length);const e=new Uint8Array(p);switch(g){case"u16":case"s16":for(let t=0;t<d.length;t+=2)e[t]=d[t+1],e[t+1]=d[t];break;case"u32":case"s32":case"f32":for(let t=0;t<d.length;t+=4)e[t]=d[t+3],e[t+1]=d[t+2],e[t+2]=d[t+1],e[t+3]=d[t]}m=new w(p)}const A=y(a,"PREDICTOR")??1,b=y(a,"TILEWIDTH"),x=y(a,"TILELENGTH");if(A>1&&(5===E||8===E||32946===E)&&b&&x){const e=k(a),t=new w(m.length);t.set(m),m=_(t,x,b,3===h&&3===A,e?1:f)}return m}async function x(e,t,n){const a=d(n,"TILEOFFSETS");if(void 0===a)return null;const i=d(n,"TILEBYTECOUNTS"),{width:r,height:s,pixelType:l,tileWidth:o,tileHeight:f}=U([n]),u=k(n,t),c=y(n,"SAMPLESPERPIXEL")||t.planes,h=r*s,g=y(n,"BITSPERSAMPLE"),E=34887===(y(n,"COMPRESSION")??1),I=T(l),w=[];for(let T=0;T<c;T++)w.push(new I(h));let p,m,A,S,M,P,O,x,L,D,R,N,C;const G=Math.ceil(r/o),v=new Uint8Array(h).fill(255);let F=!1;if(g%8==0)if(E&&u&&c>1){const l=Math.round(a.length/c);for(p=0;p<l;p++){P=Math.floor(p/G)*f,O=p%G*o,x=P*r+O;for(let l=0;l<c;l++){const u=p*c+l;for(0===i[u]?(A=null,F=!0):A=await b(e,t.littleEndian,n,a[u],i[u]),D=0,L=x,N=Math.min(o,r-O),R=Math.min(f,s-P),C=w[l],S=0;S<R;S++)for(L=x+S*r,D=S*o,M=0;M<N;M++,L++,D++)A?C[L]=A[D]:v[L]=0}}}else for(p=0;p<a.length;p++)for(P=Math.floor(p/G)*f,O=p%G*o,x=P*r+O,0===i[p]?(A=null,F=!0):A=await b(e,t.littleEndian,n,a[p],i[p]),D=0,L=x,N=Math.min(o,r-O),R=Math.min(f,s-P),m=0;m<c;m++)if(C=w[m],u||E)for(S=0;S<R;S++)for(L=x+S*r,D=o*f*m+S*o,M=0;M<N;M++,L++,D++)A?C[L]=A[D]:v[L]=0;else for(S=0;S<R;S++)for(L=x+S*r,D=S*o*c+m,M=0;M<N;M++,L++,D+=c)A?C[L]=A[D]:v[L]=0;return{width:r,height:s,pixelType:l,pixels:w,mask:F?v:void 0}}const L=(e,t,n)=>{const a=u===t.littleEndian,r=d(n,"STRIPOFFSETS");if(void 0===r)return null;const{width:s,height:l,pixelType:o}=U([n]),f=y(n,"SAMPLESPERPIXEL")||t.planes,c=y(n,"PHOTOMETRICINTERPRETATION"),h=s*l,g=y(n,"BITSPERSAMPLE"),E=T(o),I=new E(h*f),w=d(n,"STRIPBYTECOUNTS"),p=y(n,"ROWSPERSTRIP"),m=y(n,"COMPRESSION")??1;let A,S,b,x,L,D,R,N,k;if(g%8==0)for(A=0;A<r.length;A++){if(L=A*(p*s)*f,"u8"===o||"s8"===o||a)8===m||32946===m?(R=new Uint8Array(e,r[A],w[A]),R=O(R),D=R.buffer):6===m?(R=new Uint8Array(e,r[A],w[A]),R=P(R,f,c),D=R.buffer):5===m?(R=i(e,r[A],w[A],t.littleEndian),D=R.buffer):D=e.slice(r[A],r[A]+w[A]),D=M(D,g),x=new E(D);else{switch(6===m||8===m||32946===m?(R=new Uint8Array(e,r[A],w[A]),N=O(R),D=N.buffer):(D=new ArrayBuffer(w[A]),R=new Uint8Array(e,r[A],w[A]),N=new Uint8Array(D)),o){case"u16":case"s16":for(b=0;b<R.length;b+=2)N[b]=R[b+1],N[b+1]=R[b];break;case"u32":case"s32":case"f32":for(b=0;b<R.length;b+=4)N[b]=R[b+3],N[b+1]=R[b+2],N[b+2]=R[b+1],N[b+3]=R[b]}D=M(D,g),x=new E(D)}I.set(x,L)}const C=[];if(1===f)C.push(I);else for(A=0;A<f;A++){for(k=new E(h),S=0;S<h;S++)k[S]=I[S*f+A];C.push(k)}return{width:s,height:l,pixelType:o,pixels:C}},D=(e,t,n)=>{if(!(e.length>0&&t&&n))return null;let a,i,r;const s=e[0].length,l=e.length,o=new Uint8Array(s);for(let f=0;f<l;f++)if(a=e[f],i=t[f],r=n[f],0===f)for(let e=0;e<s;e++)o[e]=a[e]<i||a[e]>r?0:1;else for(let e=0;e<s;e++)o[e]&&(o[e]=a[e]<i||a[e]>r?0:1);return o},R=e=>{if(!e)return null;const t=e.match(/<Item(.*?)Item>/gi);if(!t||0===t.length)return null;const n=new Map;let a,i,r,s,l;for(let w=0;w<t.length;w++)a=t[w],i=a.slice(6,a.indexOf(">")),s=a.indexOf("sample="),s>-1&&(l=a.slice(s+8,a.indexOf('"',s+8))),s=a.indexOf("name="),s>-1&&(i=a.slice(s+6,a.indexOf('"',s+6))),i&&(r=a.slice(a.indexOf(">")+1,a.indexOf("</Item>")).trim(),null!=l?n.has(i)?n.get(i)[l]=r:n.set(i,[r]):n.set(i,r)),l=null;const o=n.get("STATISTICS_MINIMUM"),f=n.get("STATISTICS_MAXIMUM"),u=n.get("STATISTICS_MEAN"),c=n.get("STATISTICS_STDDEV");let h=null;if(o&&f){h=[];for(let e=0;e<o.length;e++)h.push({min:parseFloat(o[e]),max:parseFloat(f[e]),avg:u&&parseFloat(u[e]),stddev:c&&parseFloat(c[e])})}const g=n.get("BandName"),E=n.get("WavelengthMin"),I=n.get("WavelengthMax");let T=null;if(g){T=[];for(let e=0;e<g.length;e++)T.push({BandName:g[e],WavelengthMin:E&&parseFloat(E[e]),WavelengthMax:I&&parseFloat(I[e])})}return{statistics:h,bandProperties:T,dataType:n.get("DataType"),rawMetadata:n}};function N(e,t,n,a=0,i=!1,r=4){if(n.values)return!0;const s=n.type,l=n.valueCount;let o=n.valueOffset,f=[];const u=h[s],c=8*u,E=l*u,I=l*h[s]*8;let T,w;const p=8===r?64:32,d=n.valueOffsets;if(I>p){if(E>(i?e.byteLength:e?e.byteLength-o+a:0))return n.offlineOffsetSize=[o,E],n.values=null,!1}if(I<=p){if(!t)if(p<=32)o>>>=32-I;else{const e=d?.length?d[0]:o>>>0,t=d?.length?d[1]:Math.round((o-e)/g);I<=32?(o=e>>>32-I,d[0]=o):(o=e*2**(32-I)+(t>>>32-I),d[0]=e,d[1]=t>>>32-I)}if(1===l&&c===p)f=[o];else if(64===p){const e=d?.length?d[0]:o>>>0,t=d?.length?d[1]:Math.round((o-e)/g);let n=e,a=32;for(w=1;w<=l;w++){const e=32-c*w%32;if(a<c){const i=n<<e>>>32-a,r=t<<32-a>>>32-a;n=t,f.push(i+r*2**(c-a)),a-=32-(c-a)}else f.push(n<<e>>>32-c),a-=c;0===a&&(a=32,n=t)}}else for(w=1;w<=l;w++){const e=32-c*w;f.push(o<<e>>>32-c)}}else{o-=a,i&&(o=0);for(let n=o;n<o+E;n+=u){switch(s){case 1:case 2:case 7:T=new DataView(e,n,1).getUint8(0);break;case 3:T=new DataView(e,n,2).getUint16(0,t);break;case 4:case 13:T=new DataView(e,n,4).getUint32(0,t);break;case 5:T=new DataView(e,n,4).getUint32(0,t)/new DataView(e,n+4,4).getUint32(0,t);break;case 6:T=new DataView(e,n,1).getInt8(0);break;case 8:T=new DataView(e,n,2).getInt16(0,t);break;case 9:T=new DataView(e,n,4).getInt32(0,t);break;case 10:T=new DataView(e,n,4).getInt32(0,t)/new DataView(e,n+4,4).getInt32(0,t);break;case 11:T=new DataView(e,n,4).getFloat32(0,t);break;case 12:T=new DataView(e,n,8).getFloat64(0,t);break;case 16:case 18:T=F(new DataView(e,n,8),0,t);break;case 17:T=B(new DataView(e,n,8),0,t);break;default:T=null}f.push(T)}}if(2===s){let e="";const t=f;for(f=[],w=0;w<t.length;w++)0===t[w]&&""!==e?(f.push(e),e=""):e+=String.fromCharCode(t[w]);""===e&&0!==f.length||f.push(e)}return n.values=f,!0}function U(e){const t=e[0],n=y(t,"TILEWIDTH"),a=y(t,"TILELENGTH"),i=y(t,"IMAGEWIDTH"),r=y(t,"IMAGELENGTH"),s=y(t,"BITSPERSAMPLE"),l=y(t,"SAMPLESPERPIXEL"),o=y(t,"SAMPLEFORMAT")??1,f=I(o,s),u=k(t),c=p(t,"GDAL_NODATA");let h=null;c?.length&&(h=c.map((e=>parseFloat(e))),h.some((e=>isNaN(e)))&&(h=null));const g=y(t,"COMPRESSION")??1;let T;switch(g){case 1:T="NONE";break;case 2:case 3:case 4:case 32771:T="CCITT";break;case 5:T="LZW";break;case 6:case 7:T="JPEG";break;case 32773:T="PACKBITS";break;case 8:case 32946:T="DEFLATE";break;case 34712:T="JPEG2000";break;case 34887:T="LERC";break;default:T=String(g)}let A=!0,S="";E.has(g)||(A=!1,S+="unsupported tag compression "+g),o>3&&(A=!1,S+="unsupported tag sampleFormat "+o),1!==s&&2!==s&&4!==s&&s%8!=0&&(A=!1,S+="unsupported tag bitsPerSample "+s);const M=m(t,"GEOASCIIPARAMS");let P;if(M){const e=M.split("|").find((e=>e.includes("ESRI PE String = "))),t=e?e.replace("ESRI PE String = ",""):"";P=t.startsWith("COMPD_CS")||t.startsWith("PROJCS")||t.startsWith("GEOGCS")?{wkid:null,wkt:t}:null}const O=d(t,"GEOTIEPOINTS"),b=d(t,"GEOPIXELSCALE"),x=d(t,"GEOTRANSMATRIX"),L=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let D,N,U=!1,v=!1;if(L){U=2===y(L,"GTRasterTypeGeoKey");const e=y(L,"GTModelTypeGeoKey");if(2===e){const e=y(L,"GeographicTypeGeoKey");e>=1024&&e<=32766&&(P={wkid:e}),P||32767!==e||(v=!0,P={wkid:4326})}else if(1===e){const e=y(L,"ProjectedCSTypeGeoKey");e>=1024&&e<=32766&&(P={wkid:e})}}if(b&&O&&O.length>=6?(D=[b[0],0,O[3]-O[0]*b[0],0,-Math.abs(b[1]),O[4]-O[1]*b[1]],U&&(D[2]-=.5*D[0]+.5*D[1],D[5]-=.5*D[3]+.5*D[4])):x&&16===x.length&&(D=U?[x[0],x[1],x[3]-.5*x[0],x[4],x[5],x[7]-.5*x[5]]:[x[0],x[1],x[3],x[4],x[5],x[7]]),D){const e=[{x:0,y:r},{x:0,y:0},{x:i,y:r},{x:i,y:0}];let t,n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let i=0;i<e.length;i++)t=w(e[i],D),n=t.x>n?n:t.x,s=t.x<s?s:t.x,a=t.y>a?a:t.y,l=t.y<l?l:t.y;N={xmin:n,xmax:s,ymin:a,ymax:l,spatialReference:P}}else N={xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:P};v&&(N.xmax-N.xmin>400||Math.max(Math.abs(N.xmin),Math.abs(N.xmax))>361)&&(P=null,N.spatialReference=null);const F=C(e);let B,V,W,H,_;if(F.length>0){W=Math.round(Math.log(i/y(F[0],"IMAGEWIDTH"))/Math.LN2);const e=F[F.length-1];H=F.length,B=y(e,"TILEWIDTH"),V=y(e,"TILELENGTH")}B=null!=H&&H>0?B||n:null,V=null!=H&&H>0?V||a:null,n&&(_=[{maxCol:Math.ceil(i/n)-1,maxRow:Math.ceil(r/a)-1,minRow:0,minCol:0}],F.forEach((e=>{_.push({maxCol:Math.ceil(y(e,"IMAGEWIDTH")/y(e,"TILEWIDTH"))-1,maxRow:Math.ceil(y(e,"IMAGELENGTH")/y(e,"TILELENGTH"))-1,minRow:0,minCol:0})})));const j=m(e[0],"GDAL_METADATA"),X=R(j);S+=" "+Y({width:i,height:r,tileWidth:n,tileHeight:a,planes:l,ifds:e});const K=G(e).length===F.length+1,J=F?.length?F.map((e=>({x:i/y(e,"IMAGEWIDTH"),y:r/y(e,"IMAGELENGTH")}))):void 0;return{width:i,height:r,tileWidth:n,tileHeight:a,planes:l,isBSQ:u,pixelType:f,compression:T,noData:h,hasMaskBand:K,isSupported:A,pyramidResolutions:J,message:S,extent:N,isPseudoGeographic:v,affine:b?null:D,firstPyramidLevel:W,maximumPyramidLevel:H,pyramidBlockWidth:B,pyramidBlockHeight:V,tileBoundary:_,metadata:X}}function k(e,t){const n=p(e,"PLANARCONFIGURATION");return n?2===n[0]:!!t&&t.isBSQ}function C(e){return e.filter((e=>1===y(e,"NEWSUBFILETYPE")))}function G(e){return e.filter((e=>{const t=!(4&~(y(e,"NEWSUBFILETYPE")??0)),n=4===y(e,"PHOTOMETRICINTERPRETATION");return t&&n}))}function v(e){const{littleEndian:t,isBigTiff:n,firstIFDPos:a}=W(e);let i=a;const r=[];do{const a=H(e,t,i,0,l,n?8:4);if(!a.success)break;r.push(a.ifd),i=a.nextIFD}while(i>0);return{...U(r),littleEndian:t,isBigTiff:n,ifds:r,pyramidIFDs:C(r),maskIFDs:G(r)}}function F(e,t,n){const a=e.getUint32(t,n),i=e.getUint32(t+4,n);return n?i*g+a:a*g+i}function B(e,t,n){let a=n?e.getInt32(t,n):e.getUint32(t,n),i=n?e.getUint32(t+4,n):e.getInt32(t+4,n);const r=(n?a:i)>=0?1:-1;n?a*=r:i*=r;return r*(n?i*g+a:a*g+i)}function V(e,t,n,a){return a?F(e,t,n):e.getUint32(t,n)}function W(e){const t=new DataView(e,0,16),n=t.getUint16(0,!1);let a=null;if(18761===n)a=!0;else{if(19789!==n)throw new Error("unexpected endianess byte");a=!1}const i=t.getUint16(2,a);if(42!==i&&43!==i)throw new Error("unexpected tiff identifier");let r=4;const s=43===i;if(s){const e=t.getUint16(r,a);if(r+=2,8!==e)throw new Error("unsupported bigtiff version");if(0!==t.getUint16(r,a))throw new Error("unsupported bigtiff version");r+=2}return{littleEndian:a,isBigTiff:s,firstIFDPos:V(t,r,a,s)}}function H(t,n,a,i=0,r=l,o=4){const u=A(t,n,a,i,r,o);let c;const h=u.ifd;if(h){if(s.forEach(((e,a)=>{h.has(a)&&(c=h.get(a),c.data=A(t,n,c.valueOffset-i,i,e).ifd)})),h.has("GEOKEYDIRECTORY")){c=h.get("GEOKEYDIRECTORY");const e=c.values;if(e&&e.length>4){const a=e[0]+"."+e[1]+"."+e[2];c.data=A(t,n,c.valueOffset+6-i,i,f,2).ifd,c.data&&c.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[a]})}}if(h.has("XMP")){c=h.get("XMP");const t=c.values;"number"==typeof t[0]&&7===c.type&&(c.values=[e(new Uint8Array(t))])}}return u}function Y(e){const{width:t,height:n,tileHeight:a,tileWidth:i}=e,r=e.planes,s=i?i*a:t*n,l=y(e.ifds[0],"BITSPERSAMPLE");let o="";return s*r>2**30/(l>8?l/8:1)&&(o=i?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),o}function _(e,t,n,a,i){const r=a?4:1,s=n*r*i;a&&(e=new Uint8Array(e.buffer));for(let f=0;f<t;f++){const t=f*s;for(let n=i;n<s;n++)e[t+n]+=e[t+n-i]}if(!a)return e;const l=new Uint8Array(e.length),o=n*i;for(let f=0;f<t;f++){const t=f*s;for(let n=0;n<o;n++)for(let a=0;a<r;a++)l[t+n*r+a]=e[t+n+(r-a-1)*o]}return new Float32Array(l.buffer)}async function j(e,t){const{headerInfo:n,ifd:a,offsets:i,sizes:s}=t,l=[];for(let r=0;r<i.length;r++){s[r];const t=await b(e,n.littleEndian,a,i[r],s[r]||e.byteLength);l.push(t)}const o=k(a,n),f=y(a,"BITSPERSAMPLE"),u=I(y(a,"SAMPLEFORMAT")??1,f),c=y(a,"SAMPLESPERPIXEL")||n.planes,h=T(u),g=y(a,"TILEWIDTH"),E=y(a,"TILELENGTH"),w=y(a,"COMPRESSION")??1,p=g*E;let d;const m=[];let A=l[0];const S=34887===w;for(let r=0;r<c;r++){if(d=new h(p),l.length===c)A=l[r],A.length===p&&(d=A);else if(A.length)if(o||S)d=A.length===p?A:A.slice(p*r,p*(r+1));else for(let e=0;e<p;e++)d[e]=A[e*c+r];m.push(d)}const M=n.noData?n.noData[0]:t.noDataValue,P=n.metadata?n.metadata.statistics:null,O=P?P.map((e=>e.min)):null,x=P?P.map((e=>e.max)):null,L={pixelType:u,width:g,height:E,pixels:m,noDataValue:M};return null!=M?r(L,M,{matchAllNoData:t?.matchAllNoData}):O&&x&&t.applyMinMaxConstraint&&(L.mask=D(m,O,x)),L}async function X(e,t={}){const n=t.pyramidLevel||0,a=t.headerInfo||v(e),{ifds:i,noData:s}=a;if(0===i.length)throw new Error("no valid image file directory");const l=Y(a);if(l)throw l;let o=null;const f=-1===n?i[i.length-1]:i[n],u=s??t.noDataValue;if(o=a.tileWidth?await x(e,a,f):L(e,a,f),!o)return o;if(null!=u){r(o,u,{matchAllNoData:null==s&&t?.matchAllNoData})}return o}export{X as decode,j as decodeTileOrStrip,U as getImageInfo,G as getMaskIFDs,C as getPyramidIFDs,k as isBSQConfig,N as parseFieldValues,v as parseHeader,H as parseIFD,W as parseSignature};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const e=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),i=(()=>{const i=e.slice();return i[36864]="ExifVersion",i[40960]="FlashpixVersion",i[40961]="ColorSpace",i[42240]="Gamma",i[37121]="ComponentsConfiguration",i[37122]="CompressedBitsPerPixel",i[40962]="PixelXDimension",i[40963]="PixelYDimension",i[37500]="MakerNote",i[37510]="UserComment",i[40964]="RelatedSoundFile",i[36867]="DateTimeOriginal",i[36868]="DateTimeDigitized",i[36880]="OffsetTime",i[36881]="OffsetTimeOriginal",i[36882]="OffsetTimeDigitized",i[37520]="SubSecTime",i[37521]="SubSecTimeOriginal",i[37522]="SubSecTimeDigitized",i[37888]="Temperature",i[37889]="Humidity",i[37890]="Pressure",i[37891]="WaterDepth",i[37892]="Acceleration",i[37893]="CameraElevationAngle",i[42016]="ImageUniqueID",i[42032]="CameraOwnerName",i[42033]="BodySerialNumber",i[42034]="LensSpecification",i[42035]="LensMake",i[42036]="LensModel",i[42037]="LensSerialNumber",i[33434]="ExposureTime",i[33437]="FNumber",i[34850]="ExposureProgram",i[34852]="SpectralSensitivity",i[34855]="PhotographicSensitivity",i[34856]="OECF",i[34864]="SensitivityType",i[34865]="StandardOutputSensitivity",i[34866]="RecommendedExposureIndex",i[34867]="ISOSpeed",i[34868]="ISOSpeedLatitudeyyy",i[34869]="ISOSpeedLatitudezzz",i[37377]="ShutterSpeedValue",i[37378]="ApertureValue",i[37379]="BrightnessValue",i[37380]="ExposureBiasValue",i[37381]="MaxApertureValue",i[37382]="SubjectDistance",i[37383]="MeteringMode",i[37384]="LightSource",i[37385]="Flash",i[37386]="FocalLength",i[37396]="SubjectArea",i[41483]="FlashEnergy",i[41484]="SpatialFrequencyResponse",i[41486]="FocalPlaneXResolution",i[41487]="FocalPlaneYResolution",i[41488]="FocalPlaneResolutionUnit",i[41492]="SubjectLocation",i[41493]="ExposureIndex",i[41495]="SensingMethod",i[41728]="FileSource",i[41729]="SceneType",i[41730]="CFAPattern",i[41985]="CustomRendered",i[41986]="ExposureMode",i[41987]="WhiteBalance",i[41988]="DigitalZoomRatio",i[41989]="FocalLengthIn35mmFilm",i[41990]="SceneCaptureType",i[41991]="GainControl",i[41992]="Contrast",i[41993]="Saturation",i[41994]="Sharpness",i[41995]="DeviceSettingDescription",i[41996]="SubjectDistanceRange",i})(),t=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],o=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),S=(i,t)=>{let o=(t||e)[i];return void 0===o&&(o="unknown"+String(i)),o},E=new Map;E.set("EXIFIFD",i),E.set("GPSIFD",t);const n={tiffTags:e,ifdTags:E,geoKeys:o,getTagName:S};export{n as default};
5
+ const e=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),i=(()=>{const i=e.slice();return i[36864]="ExifVersion",i[40960]="FlashpixVersion",i[40961]="ColorSpace",i[42240]="Gamma",i[37121]="ComponentsConfiguration",i[37122]="CompressedBitsPerPixel",i[40962]="PixelXDimension",i[40963]="PixelYDimension",i[37500]="MakerNote",i[37510]="UserComment",i[40964]="RelatedSoundFile",i[36867]="DateTimeOriginal",i[36868]="DateTimeDigitized",i[36880]="OffsetTime",i[36881]="OffsetTimeOriginal",i[36882]="OffsetTimeDigitized",i[37520]="SubSecTime",i[37521]="SubSecTimeOriginal",i[37522]="SubSecTimeDigitized",i[37888]="Temperature",i[37889]="Humidity",i[37890]="Pressure",i[37891]="WaterDepth",i[37892]="Acceleration",i[37893]="CameraElevationAngle",i[42016]="ImageUniqueID",i[42032]="CameraOwnerName",i[42033]="BodySerialNumber",i[42034]="LensSpecification",i[42035]="LensMake",i[42036]="LensModel",i[42037]="LensSerialNumber",i[33434]="ExposureTime",i[33437]="FNumber",i[34850]="ExposureProgram",i[34852]="SpectralSensitivity",i[34855]="PhotographicSensitivity",i[34856]="OECF",i[34864]="SensitivityType",i[34865]="StandardOutputSensitivity",i[34866]="RecommendedExposureIndex",i[34867]="ISOSpeed",i[34868]="ISOSpeedLatitudeyyy",i[34869]="ISOSpeedLatitudezzz",i[37377]="ShutterSpeedValue",i[37378]="ApertureValue",i[37379]="BrightnessValue",i[37380]="ExposureBiasValue",i[37381]="MaxApertureValue",i[37382]="SubjectDistance",i[37383]="MeteringMode",i[37384]="LightSource",i[37385]="Flash",i[37386]="FocalLength",i[37396]="SubjectArea",i[41483]="FlashEnergy",i[41484]="SpatialFrequencyResponse",i[41486]="FocalPlaneXResolution",i[41487]="FocalPlaneYResolution",i[41488]="FocalPlaneResolutionUnit",i[41492]="SubjectLocation",i[41493]="ExposureIndex",i[41495]="SensingMethod",i[41728]="FileSource",i[41729]="SceneType",i[41730]="CFAPattern",i[41985]="CustomRendered",i[41986]="ExposureMode",i[41987]="WhiteBalance",i[41988]="DigitalZoomRatio",i[41989]="FocalLengthIn35mmFilm",i[41990]="SceneCaptureType",i[41991]="GainControl",i[41992]="Contrast",i[41993]="Saturation",i[41994]="Sharpness",i[41995]="DeviceSettingDescription",i[41996]="SubjectDistanceRange",i})(),o=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],t=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),S=(i,o)=>{let t=(o||e)[i];return void 0===t&&(t="unknown"+String(i)),t},E=new Map([["EXIFIFD",i],["GPSIFD",o]]);export{t as geoKeys,S as getTagName,E as ifdTags,e as tiffTags};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{isIntegerPixelType as r}from"../rasterFormats/pixelRangeUtils.js";import i from"./BandArithmeticFunctionArguments.js";import{calculateBandIndex as n,getBandMatrix3 as a}from"./bandIndexUtils.js";import o from"./BaseRasterFunction.js";const c=new Set(["vari","mtvi2","rtvi-core","evi"]);let u=class extends o{constructor(){super(...arguments),this.functionName="BandArithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const e=this.sourceRasterInfos[0];if(e.bandCount<2)return{success:!1,supportsGPU:!1,error:"band-arithmetic-function: source raster has insufficient amount of raster bands"};const t=e.clone();t.pixelType=this.outputPixelType,t.bandCount="sultan"===this.functionArguments.method?3:1,this._removeStatsHistColormapVAT(t),t.keyProperties={...t.keyProperties,BandProperties:void 0},this.rasterInfo=t;return{success:!0,supportsGPU:!["custom","gvitm","sultan"].includes(this.functionArguments.method)}}_processPixels(e){const t=e.pixelBlocks?.[0];if(null==t)return t;const{method:s,bandIndexes:r}=this.functionArguments,i=r.split(" ").map((e=>parseFloat(e)));return n(t,{method:s,bandIndexes:i,equation:r,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const e=this.functionArguments.bandIndexes.split(" ").map((e=>parseFloat(e)-1));2===e.length&&e.push(0);const t=this.isInputBandIdsSwizzled?[0,1,2]:e;let s,i;const n=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":s=a([t[0],t[1],0]),i="ndxi";break;case"ndwi":s=a([t[1],t[0],0]),i="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":s=a([t[0],t[1],0]),i="sr";break;case"ci-g":case"ci-re":s=a([t[0],t[1],0]),i="ci";break;case"savi":s=a([t[0],t[1],0]),i="savi",n[0]=e[2]+1;break;case"tsavi":s=a([t[0],t[1],0]),i="tsavi",n[0]=e[2]+1,n[1]=e[3]+1,n[2]=e[4]+1;break;case"msavi":s=a([t[0],t[1],0]),i="msavi";break;case"gemi":s=a([t[0],t[1],0]),i="gemi";break;case"pvi":s=a([t[0],t[1],0]),i="tsavi",n[0]=e[2]+1,n[1]=e[3]+1;break;case"vari":s=a([t[0],t[1],t[2]]),i="vari";break;case"mtvi2":s=a([t[0],t[1],t[2]]),i="mtvi";break;case"rtvi-core":s=a([t[0],t[1],t[2]]),i="rtvicore";break;case"evi":s=a([t[0],t[1],t[2]]),i="evi";break;case"wndwi":s=a([t[0],t[1],0]),i="wndwi",n[0]=e[3]?e[3]+1:.5;break;case"bai":s=a([t[1],t[0],0]),i="bai";break;default:s=a([0,1,2]),i="custom"}return{bandIndexMat3:s,indexType:i,adjustments:n,isOutputRounded:r(this.outputPixelType)}}_getInputBandIds(e){if("custom"===this.functionArguments.method)return e;const t=this.functionArguments.bandIndexes.split(" ").map((e=>parseFloat(e)-1)),s=e.length,r=t.map((e=>e>=s?s-1:e)),i=c.has(this.functionArguments.method)?3:2,n=r.slice(0,i).map((t=>e[t]));return 2===n.length&&n.push(0),n}};e([t({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),e([t({type:i,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),e([t()],u.prototype,"rasterArgumentNames",void 0),u=e([s("esri.layers.support.rasterFunctions.BandArithmeticFunction")],u);const m=u;export{m as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{isIntegerPixelType as r}from"../rasterFormats/pixelRangeUtils.js";import i from"./BandArithmeticFunctionArguments.js";import{calculateBandIndex as n,getBandMatrix3 as a}from"./bandIndexUtils.js";import o from"./BaseRasterFunction.js";const c=new Set(["vari","mtvi2","rtvi-core","evi"]);let u=class extends o{constructor(){super(...arguments),this.functionName="BandArithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const e=this.sourceRasterInfos[0];if(e.bandCount<2)return{success:!1,supportsGPU:!1,error:"band-arithmetic-function: source raster has insufficient amount of raster bands"};const t=e.clone();t.pixelType=this.outputPixelType,t.bandCount="sultan"===this.functionArguments.method?3:1,this._removeStatsHistColormapVAT(t),t.keyProperties={...t.keyProperties,BandProperties:void 0},this.rasterInfo=t;return{success:!0,supportsGPU:!["custom","gvitm","sultan"].includes(this.functionArguments.method)}}_processPixels(e){const t=e.pixelBlocks?.[0];if(null==t)return t;const{method:s,bandIndexes:r}=this.functionArguments,i=r.split(" ").map((e=>parseFloat(e)));return n(t,{method:s,bandIndexes:i,equation:r,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const e=this.functionArguments.bandIndexes.split(" ").map((e=>parseFloat(e)-1));2===e.length&&e.push(0);const t=this.isInputBandIdsSwizzled?[0,1,2]:e;let s,i;const n=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":s=a([t[0],t[1],0]),i="ndxi";break;case"ndwi":s=a([t[1],t[0],0]),i="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":s=a([t[0],t[1],0]),i="sr";break;case"ci-g":case"ci-re":s=a([t[0],t[1],0]),i="ci";break;case"savi":s=a([t[0],t[1],0]),i="savi",n[0]=e[2]+1;break;case"tsavi":s=a([t[0],t[1],0]),i="tsavi",n[0]=e[2]+1,n[1]=e[3]+1,n[2]=e[4]+1;break;case"msavi":s=a([t[0],t[1],0]),i="msavi";break;case"gemi":s=a([t[0],t[1],0]),i="gemi";break;case"pvi":s=a([t[0],t[1],0]),i="tsavi",n[0]=e[2]+1,n[1]=e[3]+1;break;case"vari":s=a([t[0],t[1],t[2]]),i="vari";break;case"mtvi2":s=a([t[0],t[1],t[2]]),i="mtvi";break;case"rtvi-core":s=a([t[0],t[1],t[2]]),i="rtvicore";break;case"evi":s=a([t[0],t[1],t[2]]),i="evi";break;case"wndwi":s=a([t[0],t[1],0]),i="wndwi",n[0]=e[3]?e[3]+1:.5;break;case"bai":s=a([t[1],t[0],0]),i="bai";break;default:s=a([0,1,2]),i="custom"}return{bandIndexMat3:s,indexType:i,adjustments:n,isOutputRounded:r(this.outputPixelType)}}_getInputBandIds(e){if("custom"===this.functionArguments.method)return e;const t=this.functionArguments.bandIndexes.split(" ").map((e=>parseFloat(e)-1)),s=e.length,r=t.map((e=>e>=s?s-1:e)),i=c.has(this.functionArguments.method)?3:2,n=r.slice(0,i).map((t=>e[t]));return 2===n.length&&n.push(0),n}_swizzleBandIds(e){const t=this.functionArguments.bandIndexes.split(" ").map((e=>parseFloat(e)-1));2===t.length&&t.push(0);const{method:s}=this.functionArguments,r=(["vari","mtvi2","rtvi-core","evi"].includes(s)?t.slice(0,3):"bai"===s||"ndwi"===s?[t[1],t[0]]:t.slice(0,2)).map((t=>e.indexOf(t)));return r[2]??=r[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=r,!1}};e([t({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),e([t({type:i,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),e([t()],u.prototype,"rasterArgumentNames",void 0),u=e([s("esri.layers.support.rasterFunctions.BandArithmeticFunction")],u);const m=u;export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import s from"../../../core/JSONSupport.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import{cast as r}from"../../../core/accessorSupport/decorators/cast.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../PixelBlock.js";import o from"../RasterInfo.js";const a=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let u=class extends s{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._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const s=[t],{parameters:e}=t;let r=e.rasters||e.raster&&[e.raster];for(;r?.length;){s.unshift(...r);const t=[];for(let s=0;s<r.length;s++){const{parameters:e}=r[s],i=e.rasters||e.raster&&[e.raster];i?.length&&t.push(...i)}r=t}for(let a=s.length-1;a>=0;a--)s[a].isNoopProcess&&s.splice(a,1);let i=!1;for(let a=0;a<s.length;a++){const t=s[a];t.id=s.length-a-1;const{rasters:e}=t.parameters;i=i||null!=e&&e.length>1}const n=s.some((({name:t})=>a.has(t.toLowerCase()))),{rawSourceRasterInfos:o}=this;return{functions:s,hasBranches:i,hasFocalFunction:n,isSourceSingleBand:1===o?.[0]?.bandCount}}bind(t,s=!1,e=-1){this.id=e+1;const r=this._getRasterValues();let i=!0;for(let n=0;n<r.length;n++){const e=r[n];if(null!=e&&this._isRasterFunctionValue(e)){const r=e.bind(t,s,this.id+n);if(!r.success)return this._bindingResult=r,r;i=i&&r.supportsGPU}}return!this.rasterInfo||s?(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),this._bindingResult.success&&this._patchRasterInfo(),this._bindingResult.supportsGPU=i&&this._bindingResult.supportsGPU,this.processInputBandIds(),this._bindingResult):(this._bindingResult={success:!0,supportsGPU:!0},this.processInputBandIds(),this._bindingResult)}process(t){const s=this._getRasterValues(),e=0===s.length?t.pixelBlocks??t.primaryPixelBlocks:s.map((s=>this._readRasterValue(s,t)));return this._processPixels({...t,pixelBlocks:e})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let s;if(t.length>1){const s=t.map((t=>t.processInputBandIds()[0]));this.rawInputBandIds=s,this.isInputBandIdsSwizzled=this.rawInputBandIds.some(((t,s)=>t!==s));const e=t.filter((t=>"ExtractBand"===t.functionName));return e.length&&e.forEach(((t,s)=>{t.isInputBandIdsSwizzled=!0,t.swizzledBandSelection=[s,s,s]})),this.rawInputBandIds}const e=t[0];if(e){if(s=e.processInputBandIds(),e.isInputBandIdsSwizzled)return this.rawInputBandIds=s,s}else{s=[];const{bandCount:t}=this.sourceRasterInfos[0];for(let e=0;e<t;e++)s.push(e)}const r=this._getInputBandIds(s);return this.isInputBandIdsSwizzled=r.some(((t,s)=>t!==s)),this.rawInputBandIds=r,this.rawInputBandIds}getPrimaryRasters(){const t=[],s=[];return this._getPrimaryRasters(this,t,s),{rasters:t,rasterIds:s}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:s,rasters:e}=this.functionArguments;return e&&Array.isArray(e)&&e.length?(t.rasters=e.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(s)&&(t.raster=s.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:s,rasters:e}=this.functionArguments;if(e&&Array.isArray(e)&&e.length)e.forEach((s=>{if(this._isRasterFunctionValue(s)){const e=s.getClippingGeometries();t.push(...e)}}));else if(this._isRasterFunctionValue(s)){const e=s.getClippingGeometries();t.push(...e)}return t}_getOutputPixelType(t){return"unknown"===this.outputPixelType?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_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 s=this._getRasterValues(),{rasterInfos:e,rasterIds:r}=t;if(0===s.length)return e;const i=s.map((t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&r.includes(t)?e[r.indexOf(t)]:"number"!=typeof t?e[0]:void 0)),n=i.find((t=>t))??e[0];return i.forEach(((t,s)=>{void 0===t&&(i[s]=n)})),i}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,s=[],e=[]){for(let r=0;r<t.sourceRasters.length;r++){const i=t.sourceRasters[r];if("number"!=typeof i)if("bind"in i)this._getPrimaryRasters(i,s,e);else{const t=i,r=this._getPrimaryRasterId(t);if(null==r)continue;e.includes(r)||(this.mainPrimaryRasterId===r?(s.unshift(t),e.unshift(r)):(s.push(t),e.push(r)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,s){const{primaryPixelBlocks:e}=s;if(null==t||"$$"===t){const t=e[0];return null==t?null:t.clone()}if("string"==typeof t){const r=s.primaryRasterIds.indexOf(t);return-1===r?null:e[r]}if("number"==typeof t){const s=e[0];if(null==s)return null;const{width:r,height:i,pixelType:o}=s,a=new Float32Array(r*i);a.fill(t);const u=this.sourceRasterInfos[0].bandCount,p=new Array(u).fill(a);return new n({width:r,height:i,pixelType:o,pixels:p})}return t.process(s)}_patchRasterInfo(){const{rasterInfo:t}=this;if(!t?.keyProperties)return;const{bandCount:s,keyProperties:e,statistics:r,histograms:i}=t,n=e.BandProperties;n&&n.length!==s&&(t.keyProperties={...e,BandProperties:void 0}),r&&r.length!==s&&(t.statistics=r.length>s?r.slice(0,s):null),i&&i.length!==s&&(t.histograms=i.length>s?i.slice(0,s):null),e.BAND_COUNT&&Number(e.BAND_COUNT)!==s&&(t.keyProperties={...e,BAND_COUNT:"string"==typeof e.BAND_COUNT?String(s):s})}};t([e({json:{write:!0}})],u.prototype,"functionName",void 0),t([e({json:{write:!0}})],u.prototype,"functionArguments",void 0),t([e()],u.prototype,"rasterArgumentNames",void 0),t([e({json:{write:!0}}),r((t=>t?.toLowerCase()))],u.prototype,"outputPixelType",void 0),t([e({json:{write:!0}})],u.prototype,"mainPrimaryRasterId",void 0),t([e()],u.prototype,"sourceRasters",void 0),t([e({type:[o],json:{write:!0}})],u.prototype,"sourceRasterInfos",void 0),t([e({json:{write:!0}})],u.prototype,"rasterInfo",void 0),t([e({json:{write:!0}})],u.prototype,"readingBufferSize",void 0),t([e({json:{write:!0}})],u.prototype,"id",void 0),t([e()],u.prototype,"isNoopProcess",void 0),t([e()],u.prototype,"supportsGPU",null),t([e()],u.prototype,"rawInputBandIds",void 0),t([e()],u.prototype,"rawSourceRasterInfos",void 0),t([e()],u.prototype,"isInputBandIdsSwizzled",void 0),t([e()],u.prototype,"swizzledBandSelection",void 0),t([e()],u.prototype,"isBranch",void 0),t([e({readOnly:!0})],u.prototype,"flatWebGLFunctionChain",null),t([e()],u.prototype,"_bindingResult",void 0),u=t([i("esri.layers.support.rasterFunctions.BaseRasterFunction")],u);const p=u;export{p as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import s from"../../../core/JSONSupport.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import{cast as r}from"../../../core/accessorSupport/decorators/cast.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../PixelBlock.js";import o from"../RasterInfo.js";const a=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let u=class extends s{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 s=[t],{parameters:e}=t;let r=e.rasters||e.raster&&[e.raster];for(;r?.length;){s.unshift(...r);const t=[];for(let s=0;s<r.length;s++){const{parameters:e}=r[s],i=e.rasters||e.raster&&[e.raster];i?.length&&t.push(...i)}r=t}for(let a=s.length-1;a>=0;a--)s[a].isNoopProcess&&s.splice(a,1);let i=!1;for(let a=0;a<s.length;a++){const t=s[a];t.id=s.length-a-1;const{rasters:e}=t.parameters;i=i||null!=e&&e.length>1}const n=s.some((({name:t})=>a.has(t.toLowerCase()))),{rawSourceRasterInfos:o}=this;return{functions:s,hasBranches:i,hasFocalFunction:n,isSourceSingleBand:1===o?.[0]?.bandCount}}bind(t,s=!1,e=-1){this.id=e+1;const r=this._getRasterValues();let i=!0;for(let n=0;n<r.length;n++){const e=r[n];if(null!=e&&this._isRasterFunctionValue(e)){const r=e.bind(t,s,this.id+n);if(!r.success)return this._bindingResult=r,r;i=i&&r.supportsGPU}}if(!this.rasterInfo||s){if(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),i&&=this._bindingResult.supportsGPU,this._bindingResult.success&&(this._patchRasterInfo(),i&&this.isRoot)){this.processInputBandIds();this.swizzleInputBandIds(this.rawInputBandIds)||(i=this.rawInputBandIds.length<=3)}return this._bindingResult.supportsGPU=i,this._bindingResult}return this._bindingResult={success:!0,supportsGPU:!0},this._bindingResult}process(t){const s=this._getRasterValues(),e=0===s.length?t.pixelBlocks??t.primaryPixelBlocks:s.map((s=>this._readRasterValue(s,t)));return this._processPixels({...t,pixelBlocks:e})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);if(t.length>1){const s=t.map((t=>t.processInputBandIds()));return this.rawInputBandIds=[...new Set(s.flat())],this.rawInputBandIds}const s=t[0];if(s)return this.rawInputBandIds=s.processInputBandIds(),this.rawInputBandIds;const{bandCount:e}=this.sourceRasterInfos[0],r=Array.from({length:e},((t,s)=>s));return this.rawInputBandIds=this._getInputBandIds(r),this.rawInputBandIds}swizzleInputBandIds(t){const s=this._getRasterValues().filter(this._isRasterFunctionValue);let e=!0;for(const r of s)e=r.swizzleInputBandIds(t)&&e;return!!e&&this._swizzleBandIds(t)}getPrimaryRasters(){const t=[],s=[];return this._getPrimaryRasters(this,t,s),{rasters:t,rasterIds:s}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:s,rasters:e}=this.functionArguments;return e&&Array.isArray(e)&&e.length?(t.rasters=e.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(s)&&(t.raster=s.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:s,rasters:e}=this.functionArguments;if(e&&Array.isArray(e)&&e.length)e.forEach((s=>{if(this._isRasterFunctionValue(s)){const e=s.getClippingGeometries();t.push(...e)}}));else if(this._isRasterFunctionValue(s)){const e=s.getClippingGeometries();t.push(...e)}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 s=this._getRasterValues(),{rasterInfos:e,rasterIds:r}=t;if(0===s.length)return e;const i=s.map((t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&r.includes(t)?e[r.indexOf(t)]:"number"!=typeof t?e[0]:void 0)),n=i.find((t=>t))??e[0];return i.forEach(((t,s)=>{void 0===t&&(i[s]=n)})),i}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,s=[],e=[]){for(let r=0;r<t.sourceRasters.length;r++){const i=t.sourceRasters[r];if("number"!=typeof i)if("bind"in i)this._getPrimaryRasters(i,s,e);else{const t=i,r=this._getPrimaryRasterId(t);if(null==r)continue;e.includes(r)||(this.mainPrimaryRasterId===r?(s.unshift(t),e.unshift(r)):(s.push(t),e.push(r)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,s){const{primaryPixelBlocks:e}=s;if(null==t||"$$"===t){const t=e[0];return null==t?null:t.clone()}if("string"==typeof t){const r=s.primaryRasterIds.indexOf(t);return-1===r?null:e[r]}if("number"==typeof t){const s=e[0];if(null==s)return null;const{width:r,height:i,pixelType:o}=s,a=new Float32Array(r*i);a.fill(t);const u=this.sourceRasterInfos[0].bandCount,p=new Array(u).fill(a);return new n({width:r,height:i,pixelType:o,pixels:p})}return t.process(s)}_patchRasterInfo(){const{rasterInfo:t}=this;if(!t?.keyProperties)return;const{bandCount:s,keyProperties:e,statistics:r,histograms:i}=t,n=e.BandProperties;n&&n.length!==s&&(t.keyProperties={...e,BandProperties:void 0}),r&&r.length!==s&&(t.statistics=r.length>s?r.slice(0,s):null),i&&i.length!==s&&(t.histograms=i.length>s?i.slice(0,s):null),e.BAND_COUNT&&Number(e.BAND_COUNT)!==s&&(t.keyProperties={...e,BAND_COUNT:"string"==typeof e.BAND_COUNT?String(s):s})}};t([e({json:{write:!0}})],u.prototype,"functionName",void 0),t([e({json:{write:!0}})],u.prototype,"functionArguments",void 0),t([e()],u.prototype,"rasterArgumentNames",void 0),t([e({json:{write:!0}}),r((t=>t?.toLowerCase()))],u.prototype,"outputPixelType",void 0),t([e({json:{write:!0}})],u.prototype,"mainPrimaryRasterId",void 0),t([e()],u.prototype,"sourceRasters",void 0),t([e({type:[o],json:{write:!0}})],u.prototype,"sourceRasterInfos",void 0),t([e({json:{write:!0}})],u.prototype,"rasterInfo",void 0),t([e({json:{write:!0}})],u.prototype,"readingBufferSize",void 0),t([e({json:{write:!0}})],u.prototype,"id",void 0),t([e()],u.prototype,"isNoopProcess",void 0),t([e()],u.prototype,"supportsGPU",null),t([e()],u.prototype,"rawInputBandIds",void 0),t([e()],u.prototype,"rawSourceRasterInfos",void 0),t([e()],u.prototype,"isInputBandIdsSwizzled",void 0),t([e()],u.prototype,"swizzledBandSelection",void 0),t([e()],u.prototype,"isBranch",void 0),t([e()],u.prototype,"isRoot",void 0),t([e({readOnly:!0})],u.prototype,"flatWebGLFunctionChain",null),t([e()],u.prototype,"_bindingResult",void 0),u=t([i("esri.layers.support.rasterFunctions.BaseRasterFunction")],u);const p=u;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{getBandMatrix3 as s}from"./bandIndexUtils.js";import r from"./BaseRasterFunction.js";import o from"./ExtractBandFunctionArguments.js";import{MissingBandAction as a}from"./pixelUtils.js";let i=class extends r{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:n}=this,e=n[0],{method:s,bandNames:r,bandWavelengths:o,bandIds:i,missingBandAction:l}=t,h=r?.length&&("name"===s||"id"!==s&&!i?.length),d=o?.length&&("wavelength"===s||"id"!==s&&!i?.length),g=l===a.fail,p=h?u(e,r):d?m(e,o,this.functionArguments,g):c(e,i,g);if(null==p){return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${h?"band names":d?"band wavelengths":"band ids"} for the imagery data source`}}this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const f=e.clone();f.pixelType=this.outputPixelType,f.bandCount=p.length;const{statistics:b,histograms:x}=f;null!=b&&b.length&&(f.statistics=p.map((t=>b[t]||b[b.length-1]))),null!=x&&x.length&&(f.histograms=p.map((t=>x[t]||x[x.length-1]))),f.multidimensionalInfo&&f.multidimensionalInfo.variables.forEach((t=>{const{statistics:n,histograms:e}=t;null!=n&&n.length&&(t.statistics=p.map((t=>n[t]||n[n.length-1]))),null!=e&&e.length&&(t.histograms=p.map((t=>e[t]||e[e.length-1])))}));let I=f.keyProperties?.BandProperties;I?.length&&(I=p.map((t=>t>=I.length?I[I.length-1]:I[t])),f.keyProperties={...f.keyProperties,BandProperties:I}),this.rasterInfo=f;return{success:!0,supportsGPU:f.bandCount<=3}}_processPixels(t){const n=t.pixelBlocks?.[0];if(null==n)return null;const e=n.pixels.length,s=this.functionArguments.bandIds.map((t=>t>=e?e-1:t));return n.extractBands(s)}_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 n=0;n<3;n++)t[n]=Math.min(t[n],2)}return{bandIndexMat3:s(t)}}_getInputBandIds(t){const n=t.length;return this.functionArguments.bandIds.map((t=>t>=n?n-1:t)).map((n=>t[n]))}};t([n({json:{write:!0,name:"rasterFunction"}})],i.prototype,"functionName",void 0),t([n({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],i.prototype,"functionArguments",void 0),t([n()],i.prototype,"rasterArgumentNames",void 0),i=t([e("esri.layers.support.rasterFunctions.ExtractBandFunction")],i);const l=i;function u(t,n){const e=t.bandInfos.map((({name:t})=>t.toLowerCase())),s=[];for(let r=0;r<n.length;r++){const t=n[r].toLowerCase();let o=e.indexOf(t);if(-1===o&&"nearinfrared"===t&&(o=e.findIndex((t=>t.startsWith("nearinfrared_1"))),-1===o&&(o=e.findIndex((t=>t.startsWith("nearinfrared"))))),-1===o)return null;s.push(o)}return s}function c(t,n,e){const{bandCount:s}=t;return!n?.length||e&&n.some((t=>t<0||t>=s))?null:n}function m(t,n,{wavelengthMatchTolerance:e},s){const{bandInfos:r}=t,o=[];for(let i=0;i<r.length;i++){const{minWavelength:t,maxWavelength:n}=r[i];if(!t||!n)return null;o.push({minWavelength:t,maxWavelength:n})}const a=[];for(let i=0;i<n.length;i++){const t=n[i];let r=!1,l=-1,u=Number.MAX_VALUE;for(let n=0;n<o.length;n++){const e=o[n],s=t>=e.minWavelength&&t<=e.maxWavelength,a=Math.abs(t-(e.minWavelength+e.maxWavelength)/2);s?a<u&&(r=!0,l=n,u=a):!r&&a<u&&(l=n,u=a)}if(!r&&e&&u<e&&(r=!0),!r&&s)return null;a.push(l)}return a}export{l as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{getBandMatrix3 as s}from"./bandIndexUtils.js";import r from"./BaseRasterFunction.js";import o from"./ExtractBandFunctionArguments.js";import{MissingBandAction as i}from"./pixelUtils.js";let a=class extends r{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:n}=this,e=n[0],{method:s,bandNames:r,bandWavelengths:o,bandIds:a,missingBandAction:l}=t,h=r?.length&&("name"===s||"id"!==s&&!a?.length),m=o?.length&&("wavelength"===s||"id"!==s&&!a?.length),p=l===i.fail,g=h?u(e,r):m?d(e,o,this.functionArguments,p):c(e,a,p);if(null==g){return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${h?"band names":m?"band wavelengths":"band ids"} for the imagery data source`}}this.functionArguments.bandIds=g,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const f=e.clone();f.pixelType=this.outputPixelType,f.bandCount=g.length;const{statistics:b,histograms:x}=f;null!=b&&b.length&&(f.statistics=g.map((t=>b[t]||b[b.length-1]))),null!=x&&x.length&&(f.histograms=g.map((t=>x[t]||x[x.length-1]))),f.multidimensionalInfo&&f.multidimensionalInfo.variables.forEach((t=>{const{statistics:n,histograms:e}=t;null!=n&&n.length&&(t.statistics=g.map((t=>n[t]||n[n.length-1]))),null!=e&&e.length&&(t.histograms=g.map((t=>e[t]||e[e.length-1])))}));let I=f.keyProperties?.BandProperties;I?.length&&(I=g.map((t=>t>=I.length?I[I.length-1]:I[t])),f.keyProperties={...f.keyProperties,BandProperties:I}),this.rasterInfo=f;return{success:!0,supportsGPU:f.bandCount<=3}}_processPixels(t){const n=t.pixelBlocks?.[0];if(null==n)return null;const e=n.pixels.length,s=this.functionArguments.bandIds.map((t=>t>=e?e-1:t));return n.extractBands(s)}_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 n=0;n<3;n++)t[n]=Math.min(t[n],2)}return{bandIndexMat3:s(t)}}_getInputBandIds(t){const n=t.length;return this.functionArguments.bandIds.map((t=>t>=n?n-1:t)).map((n=>t[n]))}_swizzleBandIds(t){const n=this.functionArguments.bandIds.map((n=>t.indexOf(n)));return this.isInputBandIdsSwizzled=!0,n[1]??=n[0],n[2]??=n[1],this.swizzledBandSelection=n,!1}};t([n({json:{write:!0,name:"rasterFunction"}})],a.prototype,"functionName",void 0),t([n({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],a.prototype,"functionArguments",void 0),t([n()],a.prototype,"rasterArgumentNames",void 0),a=t([e("esri.layers.support.rasterFunctions.ExtractBandFunction")],a);const l=a;function u(t,n){const e=t.bandInfos.map((({name:t})=>t.toLowerCase())),s=[];for(let r=0;r<n.length;r++){const t=n[r].toLowerCase();let o=e.indexOf(t);if(-1===o&&"nearinfrared"===t&&(o=e.findIndex((t=>t.startsWith("nearinfrared_1"))),-1===o&&(o=e.findIndex((t=>t.startsWith("nearinfrared"))))),-1===o)return null;s.push(o)}return s}function c(t,n,e){const{bandCount:s}=t;return!n?.length||e&&n.some((t=>t<0||t>=s))?null:n}function d(t,n,{wavelengthMatchTolerance:e},s){const{bandInfos:r}=t,o=[];for(let a=0;a<r.length;a++){const{minWavelength:t,maxWavelength:n}=r[a];if(!t||!n)return null;o.push({minWavelength:t,maxWavelength:n})}const i=[];for(let a=0;a<n.length;a++){const t=n[a];let r=!1,l=-1,u=Number.MAX_VALUE;for(let n=0;n<o.length;n++){const e=o[n],s=t>=e.minWavelength&&t<=e.maxWavelength,i=Math.abs(t-(e.minWavelength+e.maxWavelength)/2);s?i<u&&(r=!0,l=n,u=i):!r&&i<u&&(l=n,u=i)}if(!r&&e&&u<e&&(r=!0),!r&&s)return null;i.push(l)}return i}export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{calculateNDVI as e,getBandMatrix3 as n}from"./bandIndexUtils.js";import i from"./BaseRasterFunction.js";import o from"./NDVIFunctionArguments.js";let u=class extends i{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{scientificOutput:t,visibleBandID:s,infraredBandID:r}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(t?"f32":"u8");const e=this.sourceRasterInfos[0],n=Math.max(s,r);if(e.bandCount<2||n>=e.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};if(s<0||r<0)return{success:!1,supportsGPU:!1,error:"ndvi-function: invalid visible or infrared band id"};const i=e.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),i.bandCount=1,i.keyProperties={...i.keyProperties,BandProperties:void 0};const[o,u,a,c]=t?[-1,1,0,.1]:[0,200,100,10];return i.statistics=[{min:o,max:u,avg:a,stddev:c}],this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(t){const s=t.pixelBlocks?.[0];if(null==s)return null;const{visibleBandID:r,infraredBandID:n,scientificOutput:i}=this.functionArguments;return e(s,r,n,!i)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:s,scientificOutput:r}=this.functionArguments,e=this.isInputBandIdsSwizzled?[0,1,2]:[s,t,0];return{bandIndexMat3:n(e),scaled:!r}}_getInputBandIds(t){const{visibleBandID:s,infraredBandID:r}=this.functionArguments;return[r,s,0].map((s=>t[s]))}};t([s({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),t([s({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),t([s()],u.prototype,"rasterArgumentNames",void 0),u=t([r("esri.layers.support.rasterFunctions.NDVIFunction")],u);const a=u;export{a as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{calculateNDVI as n,getBandMatrix3 as r}from"./bandIndexUtils.js";import i from"./BaseRasterFunction.js";import o from"./NDVIFunctionArguments.js";let u=class extends i{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{scientificOutput:t,visibleBandID:s,infraredBandID:e}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(t?"f32":"u8");const n=this.sourceRasterInfos[0],r=Math.max(s,e);if(n.bandCount<2||r>=n.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};if(s<0||e<0)return{success:!1,supportsGPU:!1,error:"ndvi-function: invalid visible or infrared band id"};const i=n.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),i.bandCount=1,i.keyProperties={...i.keyProperties,BandProperties:void 0};const[o,u,a,c]=t?[-1,1,0,.1]:[0,200,100,10];return i.statistics=[{min:o,max:u,avg:a,stddev:c}],this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(t){const s=t.pixelBlocks?.[0];if(null==s)return null;const{visibleBandID:e,infraredBandID:r,scientificOutput:i}=this.functionArguments;return n(s,e,r,!i)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:s,scientificOutput:e}=this.functionArguments,n=this.isInputBandIdsSwizzled?[0,1,2]:[s,t,0];return{bandIndexMat3:r(n),scaled:!e}}_getInputBandIds(t){const{visibleBandID:s,infraredBandID:e}=this.functionArguments;return[e,s,0].map((s=>t[s]))}_swizzleBandIds(t){const{visibleBandID:s,infraredBandID:e}=this.functionArguments,n=[s,e].map((s=>t.indexOf(s)));return n[2]=n[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=n,!1}};t([s({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),t([s({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),t([s()],u.prototype,"rasterArgumentNames",void 0),u=t([e("esri.layers.support.rasterFunctions.NDVIFunction")],u);const a=u;export{a as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{numberMaxFloat32 as e}from"../../../core/mathUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{getPixelValueRange as o}from"../rasterFormats/pixelRangeUtils.js";import a from"./BaseRasterFunction.js";import{createRemapLUT as u,maxMapSizeGpu as r,lookupPixels as i,lookupBandValues as l,remap as p,createRangeMaps as m}from"./pixelUtils.js";import c from"./RemapFunctionArguments.js";let g=class extends a{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;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.bandCount=1;const{statistics:s}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:n,replacementValue:o,outputValues:a,inputRanges:i,noDataRanges:l,isLastInputRangeInclusive:p}=this.functionArguments;if(null!=s&&s.length&&a?.length)if(n&&null==o){const e=Math.min.apply(null,[...a,s[0].min]),n=Math.max.apply(null,[...a,s[0].max]);t.statistics=[{...s[0],min:e,max:n}]}else{let e=a[0],u=e;for(let t=0;t<a.length;t++)e=e>a[t]?a[t]:e,u=u>a[t]?u:a[t];n&&null!=o&&(e=Math.min(e,o),u=Math.max(u,o)),t.statistics=[{...s[0],min:e,max:u}]}this.rasterInfo=t,this.lookup=n?null:u({srcPixelType:e,inputRanges:i,outputValues:a,noDataRanges:l,allowUnmatched:n,isLastInputRangeInclusive:p,outputPixelType:this.outputPixelType});return{success:!0,supportsGPU:(!a||a.length<=r)&&(!l||l.length<=r)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{lookup:s,outputPixelType:n}=this;if(s){const t=i(e,{lut:[s.lut],offset:s.offset,outputPixelType:n});return null!=t&&s.mask&&(t.mask=l(e.pixels[0],e.mask,s.mask,s.offset,"u8")),t}const{inputRanges:o,outputValues:a,noDataRanges:u,allowUnmatched:r,isLastInputRangeInclusive:m,replacementValue:c}=this.functionArguments;return p(e,{inputRanges:o,outputValues:a,noDataRanges:u,outputPixelType:n,allowUnmatched:r,isLastInputRangeInclusive:m,replacementValue:c})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:s,isLastInputRangeInclusive:n}=this.functionArguments,a=this.functionArguments.inputRanges??[],u=this.functionArguments.outputValues??[],i=m(a,u,n),l=new Float32Array(2*r);l.fill(e),s?.length&&l.set(s);return{allowUnmatched:t,rangeMaps:i,noDataRanges:l,clampRange:o(this.outputPixelType),replacementValue:this.functionArguments.replacementValue}}};t([s({json:{write:!0,name:"rasterFunction"}})],g.prototype,"functionName",void 0),t([s({type:c,json:{write:!0,name:"rasterFunctionArguments"}})],g.prototype,"functionArguments",void 0),t([s()],g.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],g.prototype,"lookup",void 0),g=t([n("esri.layers.support.rasterFunctions.RemapFunction")],g);const h=g;export{h as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{numberMaxFloat32 as e}from"../../../core/mathUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{getPixelValueRange as o}from"../rasterFormats/pixelRangeUtils.js";import a from"./BaseRasterFunction.js";import{createRemapLUT as u,maxMapSizeGpu as i,lookupPixels as r,lookupBandValues as l,remap as p,createRangeMaps as m}from"./pixelUtils.js";import c from"./RemapFunctionArguments.js";let g=class extends a{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:s}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:n,replacementValue:a,outputValues:r,inputRanges:l,noDataRanges:p,isLastInputRangeInclusive:m}=this.functionArguments,c="unknown"===this.outputPixelType||null==this.outputPixelType;if(this.outputPixelType=this._getOutputPixelType(e),r?.length){const u=s?.[0];if(n&&null==a){let e=u?.min??r[0],s=u?.max??r[0];e=Math.min.apply(null,[...r,e]),s=Math.max.apply(null,[...r,s]),t.statistics=[{min:e,max:s,avg:u?.avg??0,stddev:u?.stddev??-1}]}else{let e=r[0],s=e;for(let t=0;t<r.length;t++)e=e>r[t]?r[t]:e,s=s>r[t]?s:r[t];n&&null!=a&&(e=Math.min(e,a),s=Math.max(s,a)),t.statistics=[{min:e,max:s,avg:u?.avg??0,stddev:u?.stddev??-1}]}if(c){const{min:s,max:u}=t.statistics[0],i=["u8","s8","u16","s16","u32","s32","f32"],l=i.find((t=>{const[e,n]=o(t);return s>=e&&u<=n}))??"f64";r.some((t=>Math.floor(t)!==t))?this.outputPixelType="f64"===l?"f64":"f32":this.outputPixelType=n&&null==a&&i.indexOf(e)>i.indexOf(l)?e:l}}t.pixelType=this.outputPixelType,this.rasterInfo=t,this.lookup=n?null:u({srcPixelType:e,inputRanges:l,outputValues:r,noDataRanges:p,allowUnmatched:n,isLastInputRangeInclusive:m,outputPixelType:this.outputPixelType});return{success:!0,supportsGPU:(!r||r.length<=i)&&(!p||p.length<=i)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{lookup:s,outputPixelType:n}=this;if(s){const t=r(e,{lut:[s.lut],offset:s.offset,outputPixelType:n});return null!=t&&s.mask&&(t.mask=l(e.pixels[0],e.mask,s.mask,s.offset,"u8")),t}const{inputRanges:o,outputValues:a,noDataRanges:u,allowUnmatched:i,isLastInputRangeInclusive:m,replacementValue:c}=this.functionArguments;return p(e,{inputRanges:o,outputValues:a,noDataRanges:u,outputPixelType:n,allowUnmatched:i,isLastInputRangeInclusive:m,replacementValue:c})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:s,isLastInputRangeInclusive:n}=this.functionArguments,a=this.functionArguments.inputRanges??[],u=this.functionArguments.outputValues??[],r=m(a,u,n),l=new Float32Array(2*i);l.fill(e),s?.length&&l.set(s);return{allowUnmatched:t,rangeMaps:r,noDataRanges:l,clampRange:o(this.outputPixelType),replacementValue:this.functionArguments.replacementValue}}};t([s({json:{write:!0,name:"rasterFunction"}})],g.prototype,"functionName",void 0),t([s({type:c,json:{write:!0,name:"rasterFunctionArguments"}})],g.prototype,"functionArguments",void 0),t([s()],g.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],g.prototype,"lookup",void 0),g=t([n("esri.layers.support.rasterFunctions.RemapFunction")],g);const f=g;export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{toRGB as t}from"../../../core/colorUtils.js";import e from"../../../core/Error.js";import{clone as r}from"../../../core/lang.js";import n from"./ArithmeticFunction.js";import o from"./AspectFunction.js";import s from"./BandArithmeticFunction.js";import a from"./ClipFunction.js";import i from"./ColormapFunction.js";import c from"./ColormapToRGBFunction.js";import u from"./CompositeBandFunction.js";import m from"./ComputeChangeFunction.js";import l from"./ContrastBrightnessFunction.js";import p from"./ConvolutionFunction.js";import f from"./CurvatureFunction.js";import d from"./ExtractBandFunction.js";import g from"./GrayscaleFunction.js";import F from"./HillshadeFunction.js";import h from"./LocalFunction.js";import A from"./MaskFunction.js";import y from"./NDVIFunction.js";import b from"./RemapFunction.js";import j from"./ShadedReliefFunction.js";import C from"./SlopeFunction.js";import _ from"./StatisticsFunction.js";import R from"./StatisticsHistogramFunction.js";import N from"./StretchFunction.js";import S from"./TableFunction.js";const v=new Map;function w(t,e){const{rasterFunctionArguments:r}=t;if(!r)return;(r.rasters||[r.raster,r.raster2]).forEach((t=>{t&&"number"!=typeof t&&("string"==typeof t?t.startsWith("http")&&(e.includes(t)||e.push(t)):"rasterFunctionArguments"in t&&w(t,e))}))}function T(t,n){n=n??{};try{if("function"in(t=r(t))&&"arguments"in t&&t.arguments){const r=$(t,new Map,n);if(L(r),!r.renderingRule)throw new e("raster-function-helper","Unsupported raster function json.");t=r.renderingRule}if("rasterFunction"in t)return k(t=B(t),n)}catch{}throw new e("raster-function-helper","unsupported raster function json.")}function D(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map((e=>t[e]))}function V(t){return!!(t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments)}function B(t){const{rasterFunction:e,rasterFunctionArguments:r}=t,n={};for(const o in r){let t=r[o];const e=o.toLowerCase();if("rasters"===e&&Array.isArray(t))n.rasters=t.map((t=>V(t)?B(t):t));else switch(V(t)&&(t=B(t)),e){case"dra":n.dra=t;break;case"pspower":n.psPower=t;break;case"pszfactor":n.psZFactor=t;break;case"bandids":n.bandIds=t;break;default:n[o[0].toLowerCase()+o.slice(1)]=t}}return"Local"!==e||n.rasters?.length||(n.rasters=["$$"]),{...t,rasterFunctionArguments:n}}function k(t,r){const{rasterFunction:n,rasterFunctionArguments:o}=t,s=t.outputPixelType?.toLowerCase();if(null==n||!v.has(n))throw new e("raster-function-helper",`unsupported raster function: ${n}`);const a=v.get(n),i=("function"==typeof a.ctor?a.ctor:a.ctor.default).fromJSON({...t,outputPixelType:s}),{rasterArgumentNames:c}=i,u=[],m=D(o,c),l="rasters"===c[0]||c.length>1,p=[];for(let e=0;e<m.length;e++){const t=m[e];let n;null==t||"string"==typeof t&&t.startsWith("$")?u.push(r?.raster):"string"==typeof t?r[t]&&u.push(r[t]):"number"!=typeof t&&"rasterFunction"in t&&(n=k(t,r),l||(i.functionArguments[c[e]]=n),u.push(n)),l&&p.push(n??t)}if(l&&("rasters"===c[0]?i.functionArguments.rasters=p:c.forEach(((t,e)=>{i.functionArguments[t]=p[e]}))),r){i.sourceRasters=u;const t=r.raster?.url;t&&(i.mainPrimaryRasterId=t)}return i}function x(t,e){if(t&&e)for(const r in t){const n=t[r];n&&"object"==typeof n&&"type"in n&&("RasterFunctionTemplate"===n.type?x(n.arguments,e):"RasterFunctionVariable"===n.type&&null!=e[n.name]&&(n.value=e[n.name]))}}function E(t,r){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?E(t,r):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 o=n;switch(n.type){case"Scalar":o=n.value;break;case"AlgorithmicColorRamp":o=M(n);break;case"MultiPartColorRamp":o={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(M)};break;case"ArgumentArray":if(n.elements?.length&&"RasterStatistics"!==n.elements[0].type){const t=[];for(let o=0;o<n.elements.length;o++){const s=n.elements[o],{type:a}=s;if(a)if("RasterFunctionTemplate"===a){const{renderingRule:e}=$(s,r);t.push(e),null!=s._object_id&&r.set(s._object_id,e)}else{if("RasterFunctionVariable"!==a)throw new e("raster-function-helper","unsupported raster function json.");{const e=E(s,r);t.push(e),null!=s._object_id&&r.set(s._object_id,e)}}else t.push(s)}o=t}else o=n.elements}return null!=n._object_id&&r.set(n._object_id,o),o}function M(e){const r=e.algorithm??"esriHSVAlgorithm";let{FromColor:n,ToColor:o}=e;if(!Array.isArray(n)){const{r:e,g:r,b:o}=t({h:n.Hue,s:n.Saturation,v:n.Value});n=[e,r,o,n.AlphaValue]}if(!Array.isArray(o)){const{r:e,g:r,b:n}=t({h:o.Hue,s:o.Saturation,v:o.Value});o=[e,r,n,o.AlphaValue]}return{type:"algorithmic",algorithm:r,fromColor:n,toColor:o}}function $(t,e,r){r&&x(t,r);const n={renderingRule:{},templates:e};return H(t,n),n}function H(t,e){if(!t||!e.renderingRule)return;const{renderingRule:r,templates:n}=e,{function:o,arguments:s,_object_id:a}=t;if(!o||!s)return;null!=a&&n.set(a,r),r.rasterFunction=o.type.replace("Function",""),r.outputPixelType=o.pixelType;const i={};r.rasterFunctionArguments=i;for(const c in s){if("type"===c||"object_id"===c||"_object_ref_id"===c)continue;const t=s[c];t&&"object"==typeof t&&"type"in t&&("RasterFunctionTemplate"===t.type||"RasterFunctionVariable"===t.type)?("RasterFunctionVariable"===t.type?i[c]=E(t,n):(r.rasterFunctionArguments[c]={},H(t,{renderingRule:r.rasterFunctionArguments[c],templates:n})),null!=t._object_id&&n.set(t._object_id,i[c])):i[c]=t}switch(i.DEM&&!i.Raster&&(i.Raster=i.DEM,delete i.DEM),r.rasterFunction){case"Stretch":O(i);break;case"Colormap":G(i);break;case"Convolution":P(i);break;case"Mask":I(i)}}function L(t){const{renderingRule:r,templates:n}=t;if("object"!=typeof r||!r?.rasterFunctionArguments||!n.size)return;const{rasterFunctionArguments:o}=r;for(const s in o){const t=o[s],r="_object_ref_id"===s?t:t&&"object"==typeof t&&"_object_ref_id"in t?t._object_ref_id:null;if(null==r)t&&"object"==typeof t&&(t.rasterFunctionArguments&&L({renderingRule:t,templates:n}),Array.isArray(t)&&t.forEach(((o,s)=>{if(o&&"object"==typeof o)if(null!=o._object_ref_id){if(!n.has(o._object_ref_id))throw new e("raster-function-helper",`unsupported raster function json. _object_ref_id: ${t} does not exist`);const a=n.get(r);a&&"object"==typeof a?Object.assign(o,a):t[s]=a}else L({renderingRule:o,templates:n})})));else{if(!n.has(r))throw new e("raster-function-helper",`unsupported raster function json. _object_ref_id: ${r} does not exist`);const t=n.get(r);"_object_ref_id"!==s?o[s]=t:t&&"object"==typeof t&&Object.assign(o,t)}}}function O(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)}function G(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}function P(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function I(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter((t=>""!==t)).map((t=>Number(t))))}v.set("Arithmetic",{desc:"Arithmetic Function",ctor:n,rasterArgumentNames:["rasters"]}),v.set("Aspect",{desc:"Aspect Function",ctor:o,rasterArgumentNames:["raster"]}),v.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:s,rasterArgumentNames:["raster"]}),v.set("Colormap",{desc:"Colormap Function",ctor:i,rasterArgumentNames:["raster"]}),v.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:c,rasterArgumentNames:["raster"]}),v.set("CompositeBand",{desc:"CompositeBand Function",ctor:u,rasterArgumentNames:["rasters"]}),v.set("ComputeChange",{desc:"ComputeChange Function",ctor:m,rasterArgumentNames:["rasters"]}),v.set("Convolution",{desc:"Convolution Function",ctor:p,rasterArgumentNames:["raster"]}),v.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:l,rasterArgumentNames:["raster"]}),v.set("ExtractBand",{desc:"ExtractBand Function",ctor:d,rasterArgumentNames:["raster"]}),v.set("Curvature",{desc:"Curvature Function",ctor:f,rasterArgumentNames:["raster"]}),v.set("Hillshade",{desc:"Hillshade Function",ctor:F,rasterArgumentNames:["raster"]}),v.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:j,rasterArgumentNames:["raster"]}),v.set("Grayscale",{desc:"Grayscale Function",ctor:g,rasterArgumentNames:["raster"]}),v.set("Clip",{desc:"Clip Function",ctor:a,rasterArgumentNames:["raster"]}),v.set("Local",{desc:"Local Function",ctor:h,rasterArgumentNames:["rasters"]}),v.set("Mask",{desc:"Mask Function",ctor:A,rasterArgumentNames:["raster"]}),v.set("NDVI",{desc:"NDVI Function",ctor:y,rasterArgumentNames:["raster"]}),v.set("Remap",{desc:"Remap Function",ctor:b,rasterArgumentNames:["raster"]}),v.set("Slope",{desc:"Slope Function",ctor:C,rasterArgumentNames:["raster"]}),v.set("Statistics",{desc:"Focal Statistics Function",ctor:_,rasterArgumentNames:["raster"]}),v.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:R,rasterArgumentNames:["raster"]}),v.set("Stretch",{desc:"Stretch Function",ctor:N,rasterArgumentNames:["raster"]}),v.set("Table",{desc:"Attribute Table Function",ctor:S,rasterArgumentNames:["raster"]});export{T as create,w as getPrimaryRasterUrls,D as getRasterValues};
5
+ import{toRGB as t}from"../../../core/colorUtils.js";import e from"../../../core/Error.js";import{clone as r}from"../../../core/lang.js";import n from"./ArithmeticFunction.js";import o from"./AspectFunction.js";import s from"./BandArithmeticFunction.js";import a from"./ClipFunction.js";import i from"./ColormapFunction.js";import c from"./ColormapToRGBFunction.js";import u from"./CompositeBandFunction.js";import m from"./ComputeChangeFunction.js";import l from"./ContrastBrightnessFunction.js";import p from"./ConvolutionFunction.js";import f from"./CurvatureFunction.js";import d from"./ExtractBandFunction.js";import g from"./GrayscaleFunction.js";import F from"./HillshadeFunction.js";import h from"./LocalFunction.js";import A from"./MaskFunction.js";import y from"./NDVIFunction.js";import b from"./RemapFunction.js";import j from"./ShadedReliefFunction.js";import C from"./SlopeFunction.js";import _ from"./StatisticsFunction.js";import R from"./StatisticsHistogramFunction.js";import N from"./StretchFunction.js";import S from"./TableFunction.js";const v=new Map;function w(t,e){const{rasterFunctionArguments:r}=t;if(!r)return;(r.rasters||[r.raster,r.raster2]).forEach((t=>{t&&"number"!=typeof t&&("string"==typeof t?t.startsWith("http")&&(e.includes(t)||e.push(t)):"rasterFunctionArguments"in t&&w(t,e))}))}function T(t,n){n=n??{};try{if("function"in(t=r(t))&&"arguments"in t&&t.arguments){const r=$(t,new Map,n);if(L(r),!r.renderingRule)throw new e("raster-function-helper","Unsupported raster function json.");t=r.renderingRule}if("rasterFunction"in t){const e=k(t=B(t),n);return e.isRoot=!0,e}}catch{}throw new e("raster-function-helper","unsupported raster function json.")}function D(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map((e=>t[e]))}function V(t){return!!(t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments)}function B(t){const{rasterFunction:e,rasterFunctionArguments:r}=t,n={};for(const o in r){let t=r[o];const e=o.toLowerCase();if("rasters"===e&&Array.isArray(t))n.rasters=t.map((t=>V(t)?B(t):t));else switch(V(t)&&(t=B(t)),e){case"dra":n.dra=t;break;case"pspower":n.psPower=t;break;case"pszfactor":n.psZFactor=t;break;case"bandids":n.bandIds=t;break;default:n[o[0].toLowerCase()+o.slice(1)]=t}}return"Local"!==e||n.rasters?.length||(n.rasters=["$$"]),{...t,rasterFunctionArguments:n}}function k(t,r){const{rasterFunction:n,rasterFunctionArguments:o}=t,s=t.outputPixelType?.toLowerCase();if(null==n||!v.has(n))throw new e("raster-function-helper",`unsupported raster function: ${n}`);const a=v.get(n),i=("function"==typeof a.ctor?a.ctor:a.ctor.default).fromJSON({...t,outputPixelType:s}),{rasterArgumentNames:c}=i,u=[],m=D(o,c),l="rasters"===c[0]||c.length>1,p=[];for(let e=0;e<m.length;e++){const t=m[e];let n;null==t||"string"==typeof t&&t.startsWith("$")?u.push(r?.raster):"string"==typeof t?r[t]&&u.push(r[t]):"number"!=typeof t&&"rasterFunction"in t&&(n=k(t,r),l||(i.functionArguments[c[e]]=n),u.push(n)),l&&p.push(n??t)}if(l&&("rasters"===c[0]?i.functionArguments.rasters=p:c.forEach(((t,e)=>{i.functionArguments[t]=p[e]}))),r){i.sourceRasters=u;const t=r.raster?.url;t&&(i.mainPrimaryRasterId=t)}return i}function x(t,e){if(t&&e)for(const r in t){const n=t[r];n&&"object"==typeof n&&"type"in n&&("RasterFunctionTemplate"===n.type?x(n.arguments,e):"RasterFunctionVariable"===n.type&&null!=e[n.name]&&(n.value=e[n.name]))}}function E(t,r){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?E(t,r):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 o=n;switch(n.type){case"Scalar":o=n.value;break;case"AlgorithmicColorRamp":o=M(n);break;case"MultiPartColorRamp":o={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(M)};break;case"ArgumentArray":if(n.elements?.length&&"RasterStatistics"!==n.elements[0].type){const t=[];for(let o=0;o<n.elements.length;o++){const s=n.elements[o],{type:a}=s;if(a)if("RasterFunctionTemplate"===a){const{renderingRule:e}=$(s,r);t.push(e),null!=s._object_id&&r.set(s._object_id,e)}else{if("RasterFunctionVariable"!==a)throw new e("raster-function-helper","unsupported raster function json.");{const e=E(s,r);t.push(e),null!=s._object_id&&r.set(s._object_id,e)}}else t.push(s)}o=t}else o=n.elements}return null!=n._object_id&&r.set(n._object_id,o),o}function M(e){const r=e.algorithm??"esriHSVAlgorithm";let{FromColor:n,ToColor:o}=e;if(!Array.isArray(n)){const{r:e,g:r,b:o}=t({h:n.Hue,s:n.Saturation,v:n.Value});n=[e,r,o,n.AlphaValue]}if(!Array.isArray(o)){const{r:e,g:r,b:n}=t({h:o.Hue,s:o.Saturation,v:o.Value});o=[e,r,n,o.AlphaValue]}return{type:"algorithmic",algorithm:r,fromColor:n,toColor:o}}function $(t,e,r){r&&x(t,r);const n={renderingRule:{},templates:e};return H(t,n),n}function H(t,e){if(!t||!e.renderingRule)return;const{renderingRule:r,templates:n}=e,{function:o,arguments:s,_object_id:a}=t;if(!o||!s)return;null!=a&&n.set(a,r),r.rasterFunction=o.type.replace("Function",""),r.outputPixelType=o.pixelType;const i={};r.rasterFunctionArguments=i;for(const c in s){if("type"===c||"object_id"===c||"_object_ref_id"===c)continue;const t=s[c];t&&"object"==typeof t&&"type"in t&&("RasterFunctionTemplate"===t.type||"RasterFunctionVariable"===t.type)?("RasterFunctionVariable"===t.type?i[c]=E(t,n):(r.rasterFunctionArguments[c]={},H(t,{renderingRule:r.rasterFunctionArguments[c],templates:n})),null!=t._object_id&&n.set(t._object_id,i[c])):i[c]=t}switch(i.DEM&&!i.Raster&&(i.Raster=i.DEM,delete i.DEM),r.rasterFunction){case"Stretch":O(i);break;case"Colormap":G(i);break;case"Convolution":P(i);break;case"Mask":I(i)}}function L(t){const{renderingRule:r,templates:n}=t;if("object"!=typeof r||!r?.rasterFunctionArguments||!n.size)return;const{rasterFunctionArguments:o}=r;for(const s in o){const t=o[s],r="_object_ref_id"===s?t:t&&"object"==typeof t&&"_object_ref_id"in t?t._object_ref_id:null;if(null==r)t&&"object"==typeof t&&(t.rasterFunctionArguments&&L({renderingRule:t,templates:n}),Array.isArray(t)&&t.forEach(((o,s)=>{if(o&&"object"==typeof o)if(null!=o._object_ref_id){if(!n.has(o._object_ref_id))throw new e("raster-function-helper",`unsupported raster function json. _object_ref_id: ${t} does not exist`);const a=n.get(r);a&&"object"==typeof a?Object.assign(o,a):t[s]=a}else L({renderingRule:o,templates:n})})));else{if(!n.has(r))throw new e("raster-function-helper",`unsupported raster function json. _object_ref_id: ${r} does not exist`);const t=n.get(r);"_object_ref_id"!==s?o[s]=t:t&&"object"==typeof t&&Object.assign(o,t)}}}function O(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)}function G(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}function P(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function I(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter((t=>""!==t)).map((t=>Number(t))))}v.set("Arithmetic",{desc:"Arithmetic Function",ctor:n,rasterArgumentNames:["rasters"]}),v.set("Aspect",{desc:"Aspect Function",ctor:o,rasterArgumentNames:["raster"]}),v.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:s,rasterArgumentNames:["raster"]}),v.set("Colormap",{desc:"Colormap Function",ctor:i,rasterArgumentNames:["raster"]}),v.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:c,rasterArgumentNames:["raster"]}),v.set("CompositeBand",{desc:"CompositeBand Function",ctor:u,rasterArgumentNames:["rasters"]}),v.set("ComputeChange",{desc:"ComputeChange Function",ctor:m,rasterArgumentNames:["rasters"]}),v.set("Convolution",{desc:"Convolution Function",ctor:p,rasterArgumentNames:["raster"]}),v.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:l,rasterArgumentNames:["raster"]}),v.set("ExtractBand",{desc:"ExtractBand Function",ctor:d,rasterArgumentNames:["raster"]}),v.set("Curvature",{desc:"Curvature Function",ctor:f,rasterArgumentNames:["raster"]}),v.set("Hillshade",{desc:"Hillshade Function",ctor:F,rasterArgumentNames:["raster"]}),v.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:j,rasterArgumentNames:["raster"]}),v.set("Grayscale",{desc:"Grayscale Function",ctor:g,rasterArgumentNames:["raster"]}),v.set("Clip",{desc:"Clip Function",ctor:a,rasterArgumentNames:["raster"]}),v.set("Local",{desc:"Local Function",ctor:h,rasterArgumentNames:["rasters"]}),v.set("Mask",{desc:"Mask Function",ctor:A,rasterArgumentNames:["raster"]}),v.set("NDVI",{desc:"NDVI Function",ctor:y,rasterArgumentNames:["raster"]}),v.set("Remap",{desc:"Remap Function",ctor:b,rasterArgumentNames:["raster"]}),v.set("Slope",{desc:"Slope Function",ctor:C,rasterArgumentNames:["raster"]}),v.set("Statistics",{desc:"Focal Statistics Function",ctor:_,rasterArgumentNames:["raster"]}),v.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:R,rasterArgumentNames:["raster"]}),v.set("Stretch",{desc:"Stretch Function",ctor:N,rasterArgumentNames:["raster"]}),v.set("Table",{desc:"Attribute Table Function",ctor:S,rasterArgumentNames:["raster"]});export{T as create,w as getPrimaryRasterUrls,D as getRasterValues};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{once as e}from"../../core/events.js";function r(r,t){return new Promise(((n,o)=>{r.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?n():(t(e(r,"canplay",n)),t(e(r,"error",o)))}))}export{r as whenVideoPlayable};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.33.0-next.20250422",
3
+ "version": "4.33.0-next.20250424",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -31,7 +31,7 @@
31
31
  "@vaadin/grid": "~24.7.3",
32
32
  "@zip.js/zip.js": "~2.7.60",
33
33
  "luxon": "~3.6.1",
34
- "marked": "~15.0.8"
34
+ "marked": "~15.0.9"
35
35
  },
36
36
  "type": "module"
37
37
  }