@arcgis/core 4.25.0-next.20220705 → 4.25.0-next.20220708

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 (336) hide show
  1. package/TimeExtent.js +1 -1
  2. package/arcade/arcadeCompiler.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/0703495557b0df6878c5.js +1 -0
  5. package/assets/esri/core/workers/chunks/1570676351a313f1841b.js +1 -0
  6. package/assets/esri/core/workers/chunks/{695f90305478f5024fa7.js → 1ecbf642debc2207b762.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{30dbdf2aa1bc8e61cad4.js → 268e7b46202fc1decf9f.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{47d78b4f7117554acecf.js → 357a27203f5d8fa152de.js} +1 -1
  9. package/assets/esri/core/workers/chunks/35dfba25a9077ab5dbaf.js +982 -0
  10. package/assets/esri/core/workers/chunks/377354a81e402edf3077.js +1 -0
  11. package/assets/esri/core/workers/chunks/3a42d96ea3b59d33bfe8.js +1 -0
  12. package/assets/esri/core/workers/chunks/3a61e4ab83183f5526a7.js +1 -0
  13. package/assets/esri/core/workers/chunks/{3790f0362b6f27ee798b.js → 3ee5e8d00cd3bc47a9fa.js} +1 -1
  14. package/assets/esri/core/workers/chunks/425d1fabc713a598139c.js +1 -0
  15. package/assets/esri/core/workers/chunks/425e16862feccb467191.js +1 -0
  16. package/assets/esri/core/workers/chunks/{bbe51b49fe7093e47306.js → 48c8ac9a22190c2b890c.js} +1 -1
  17. package/assets/esri/core/workers/chunks/4a364bc073fdc7c1b563.js +1 -0
  18. package/assets/esri/core/workers/chunks/4ca6ada7a4ccde5b5a24.js +1 -0
  19. package/assets/esri/core/workers/chunks/{905130ff0118962c8140.js → 61b71b8e028eda10ccab.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{b34cffd5c45d3a8134bc.js → 69f57ad2227e59b323e8.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{290899b47a52f8b28a9c.js → 791220164501a791b2cd.js} +1 -1
  22. package/assets/esri/core/workers/chunks/792b4b0a43b4bbbc14ab.js +1 -0
  23. package/assets/esri/core/workers/chunks/7b32b8e8ebe48ae0dae2.js +1 -0
  24. package/assets/esri/core/workers/chunks/7f00125b02bb7211de43.js +1 -0
  25. package/assets/esri/core/workers/chunks/81074accfce5f109f909.js +1 -0
  26. package/assets/esri/core/workers/chunks/{594d7fdb80ad9cdedb85.js → 823e25dbc70e71257b6e.js} +1 -1
  27. package/assets/esri/core/workers/chunks/92e43e05265dfc8173a0.js +1 -0
  28. package/assets/esri/core/workers/chunks/{40fa9b28ca882a70813a.js → 92f7415c2e40e320addc.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{9520b32d5d53ea9cd0d3.js → 9341e9e1fe0f6800aa44.js} +1 -1
  30. package/assets/esri/core/workers/chunks/95451d6405729a9f50c7.js +1 -0
  31. package/assets/esri/core/workers/chunks/{910a2ffb4328f8ee7a0d.js → 95cb9cd08941c28ebd85.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{97f32af5893c86f6444c.js → 9b9a40b84640f00a1dcb.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{77c6ba5ea85915d9078c.js → ac07c732aca6e67232f8.js} +1 -1
  34. package/assets/esri/core/workers/chunks/ae8e87da97411cff3783.js +1 -0
  35. package/assets/esri/core/workers/chunks/{65161a874595b0a34aa1.js → b312dd3027492007d75e.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{83c9da68d6dbc77f60e5.js → beead2b06c994b4e61af.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{5e20fd8b7c9497f2da1f.js → bfb08d3e2208c6178af9.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{04e5486f0d8d4c6bd8a2.js → c3236a7058e64ea3b939.js} +1 -1
  39. package/assets/esri/core/workers/chunks/c4e9c71be6299c60c539.js +1 -0
  40. package/assets/esri/core/workers/chunks/c705f907ce60a646d9aa.js +1 -0
  41. package/assets/esri/core/workers/chunks/ce6abfafa0171b9c8d81.js +1 -0
  42. package/assets/esri/core/workers/chunks/{08a5c5a33a7c7c6852e5.js → d00b0f8236f1526099d4.js} +1 -1
  43. package/assets/esri/core/workers/chunks/d13951412a57e1af6208.js +1 -0
  44. package/assets/esri/core/workers/chunks/ecaf8f030026e41e1d1a.js +1 -0
  45. package/assets/esri/core/workers/chunks/f328a6cd4b7d8c653fc7.js +1 -0
  46. package/assets/esri/core/workers/chunks/f6a6178d4df029ff010d.js +1 -0
  47. package/assets/esri/core/workers/chunks/fde2301c6cd97a3cfb86.js +1 -0
  48. package/assets/esri/core/workers/chunks/fe84bcdfd9028b5e7ef6.js +1 -0
  49. package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +4 -0
  50. package/assets/esri/themes/base/widgets/_LayerList.scss +4 -0
  51. package/assets/esri/themes/dark/main.css +1 -1
  52. package/assets/esri/themes/light/main.css +1 -1
  53. package/assets/esri/themes/light/view.css +1 -1
  54. package/chunks/CheckerBoard.glsl.js +2 -2
  55. package/chunks/ColorMaterial.glsl.js +9 -9
  56. package/chunks/ComponentShader.glsl.js +33 -33
  57. package/chunks/DefaultMaterial.glsl.js +35 -35
  58. package/chunks/HUDMaterial.glsl.js +11 -11
  59. package/chunks/ImageMaterial.glsl.js +5 -5
  60. package/chunks/LineMarker.glsl.js +17 -17
  61. package/chunks/NativeLine.glsl.js +3 -3
  62. package/chunks/Path.glsl.js +28 -28
  63. package/chunks/Pattern.glsl.js +9 -9
  64. package/chunks/PointRenderer.glsl.js +1 -1
  65. package/chunks/RealisticTree.glsl.js +4 -4
  66. package/chunks/RibbonLine.glsl.js +1 -1
  67. package/chunks/ShadedColorMaterial.glsl.js +1 -1
  68. package/chunks/SimpleAtmosphere.glsl.js +1 -1
  69. package/chunks/Terrain.glsl.js +92 -92
  70. package/chunks/WaterSurface.glsl.js +22 -22
  71. package/chunks/common.js +1 -1
  72. package/chunks/mat2.js +1 -1
  73. package/chunks/mat2d.js +1 -1
  74. package/chunks/mat3.js +1 -1
  75. package/chunks/mat4.js +1 -1
  76. package/chunks/quat.js +1 -1
  77. package/chunks/quat2.js +1 -1
  78. package/chunks/vec2.js +1 -1
  79. package/chunks/vec3.js +1 -1
  80. package/chunks/vec4.js +1 -1
  81. package/core/Message.js +1 -1
  82. package/core/accessorSupport/tracking.js +1 -1
  83. package/core/libs/gl-matrix-2/math/common.js +1 -1
  84. package/core/libs/gl-matrix-2/math/vec2.js +1 -1
  85. package/core/pbf.js +1 -1
  86. package/core/quantity.js +0 -1
  87. package/core/sql/WhereClause.js +1 -1
  88. package/core/urlUtils.js +1 -1
  89. package/geometry/support/scaleUtils.js +1 -1
  90. package/identity/IdentityForm.js +1 -1
  91. package/identity/IdentityModal.js +1 -1
  92. package/identity/OAuthCredential.js +1 -1
  93. package/interfaces.d.ts +3347 -190
  94. package/intl/date.js +1 -1
  95. package/intl/duration.js +1 -1
  96. package/intl/messages.js +1 -1
  97. package/intl/substitute.js +1 -1
  98. package/kernel.js +1 -1
  99. package/layers/ImageryTileLayer.js +1 -1
  100. package/layers/VoxelWasmPerSceneView.js +1 -1
  101. package/layers/mixins/ArcGISImageService.js +1 -1
  102. package/layers/mixins/ImageryTileMixin.js +1 -1
  103. package/layers/support/ControlPointsGeoreference.d.ts +4 -0
  104. package/layers/support/ControlPointsGeoreference.js +5 -0
  105. package/layers/support/CornersGeoreference.js +1 -1
  106. package/layers/support/ElevationSamplerData.js +5 -0
  107. package/layers/support/ElevationTile.js +1 -1
  108. package/layers/support/ExportImageServiceParameters.js +1 -1
  109. package/layers/support/MediaElementBase.js +1 -1
  110. package/layers/support/imageryRendererUtils.js +1 -1
  111. package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
  112. package/package.json +1 -1
  113. package/renderers/support/RasterSymbolizer.js +1 -1
  114. package/request.js +1 -1
  115. package/rest/route/utils.js +1 -1
  116. package/rest/serviceArea.js +1 -1
  117. package/rest/support/ServiceAreaParameters.js +1 -1
  118. package/rest/support/ServiceAreaSolveResult.js +1 -1
  119. package/smartMapping/raster/renderers/classBreaks.js +1 -1
  120. package/smartMapping/raster/renderers/uniqueValue.js +1 -1
  121. package/support/apiKeyUtils.js +1 -1
  122. package/support/requestUtils.js +1 -1
  123. package/support/revision.js +1 -1
  124. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  125. package/views/2d/navigation/actions/Pinch.js +1 -1
  126. package/views/2d/tiling/TileCache.js +1 -1
  127. package/views/2d/viewpointUtils.js +1 -1
  128. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  129. package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
  130. package/views/3d/environment/CloudsTechnique.js +1 -1
  131. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  132. package/views/3d/environment/FogTechnique.js +1 -1
  133. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  134. package/views/3d/environment/Precipitation.js +1 -1
  135. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  136. package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
  137. package/views/3d/environment/SimpleAtmosphereTechniqueConfiguration.js +1 -1
  138. package/views/3d/environment/StarsTechnique.js +1 -1
  139. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  140. package/views/3d/interactive/Manipulator3D.js +1 -1
  141. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  142. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  143. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  144. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  145. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  146. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  147. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  148. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  149. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  150. package/views/3d/layers/support/FeatureVisibilityFilter.js +5 -0
  151. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  152. package/views/3d/state/ViewStateManager.js +1 -1
  153. package/views/3d/support/LaserlinePathData.js +1 -1
  154. package/views/3d/support/ResourceController.js +1 -1
  155. package/views/3d/terrain/BlendLayersTechnique.js +1 -1
  156. package/views/3d/terrain/ElevationData.js +1 -1
  157. package/views/3d/terrain/GeometryState.js +1 -1
  158. package/views/3d/terrain/OverlayRenderTarget.js +1 -1
  159. package/views/3d/terrain/OverlayRenderer.js +1 -1
  160. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  161. package/views/3d/terrain/PatchRenderData.js +1 -1
  162. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  163. package/views/3d/terrain/TerrainConst.js +1 -1
  164. package/views/3d/terrain/TerrainRenderer.js +1 -1
  165. package/views/3d/terrain/TerrainSurface.js +1 -1
  166. package/views/3d/terrain/Tile.js +1 -1
  167. package/views/3d/terrain/tileUtils.js +1 -1
  168. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  169. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  170. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  171. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  172. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  173. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  174. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  175. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
  176. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +5 -0
  177. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputConfiguration.js +5 -0
  178. package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +4 -4
  179. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +11 -11
  180. package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +1 -1
  181. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +55 -55
  182. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +3 -3
  183. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
  184. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  185. package/views/3d/webgl-engine/lib/BlendWeightsTechnique.js +1 -1
  186. package/views/3d/webgl-engine/lib/BlurTechnique.js +1 -1
  187. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  188. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  189. package/views/3d/webgl-engine/lib/EdgeDetectTechnique.js +1 -1
  190. package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
  191. package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
  192. package/views/3d/webgl-engine/lib/Material.js +1 -1
  193. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  194. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  195. package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
  196. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  197. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  198. package/views/3d/webgl-engine/lib/SSAOTechnique.js +1 -1
  199. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  200. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  201. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  202. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  203. package/views/3d/webgl-engine/lib/TransparencyPassType.js +5 -0
  204. package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
  205. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  206. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  207. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  208. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  209. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  210. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  211. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  212. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  213. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  214. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  215. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  216. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  217. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  218. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  219. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  220. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  221. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  222. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  223. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  224. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  225. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  226. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  227. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  228. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  229. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  230. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  231. package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
  232. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  233. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  234. package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
  235. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  236. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  237. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  238. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  239. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  240. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  241. package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
  242. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  243. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  244. package/views/3d/webgl-engine/shaders/HighlightApplyTechnique.js +1 -1
  245. package/views/3d/webgl-engine/shaders/HighlightBlurTechnique.js +1 -1
  246. package/views/3d/webgl-engine/shaders/HighlightDownsampleTechnique.js +1 -1
  247. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  248. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  249. package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
  250. package/views/3d/webgl-engine/shaders/LaserlineTechnique.js +1 -1
  251. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  252. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  253. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  254. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  255. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  256. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  257. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  258. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
  259. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  260. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  261. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  262. package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
  263. package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
  264. package/views/3d/webgl-engine/shaders/PointRendererTechniqueConfiguration.js +1 -1
  265. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  266. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  267. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  268. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  269. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  270. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  271. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  272. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  273. package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
  274. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  275. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  276. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  277. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  278. package/views/SceneView.js +1 -1
  279. package/views/draw/support/Reshape.js +1 -1
  280. package/views/interactive/GraphicManipulator.js +1 -1
  281. package/views/interactive/SegmentLabels.js +1 -1
  282. package/views/interactive/coordinateHelper.js +1 -1
  283. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  284. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  285. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  286. package/views/interactive/snapping/SnappingConstraint.js +1 -1
  287. package/views/interactive/snapping/SnappingManager.js +1 -1
  288. package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
  289. package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
  290. package/views/interactive/snapping/snappingUtils.js +1 -1
  291. package/views/interactive/support/viewUtils.js +1 -1
  292. package/views/layers/ImageryTileLayerView.js +1 -1
  293. package/views/support/geometry2dUtils.js +1 -1
  294. package/webscene/Slide.js +1 -1
  295. package/widgets/BasemapLayerList.js +1 -1
  296. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  297. package/widgets/ElevationProfile.js +1 -1
  298. package/widgets/LayerList/ListItemPanel.js +1 -1
  299. package/widgets/LayerList.js +1 -1
  300. package/widgets/Widget.js +1 -1
  301. package/widgets/Zoom/ZoomConditions3D.js +1 -1
  302. package/widgets/Zoom/ZoomViewModel.js +1 -1
  303. package/widgets/Zoom.js +1 -1
  304. package/widgets/support/widgetUtils.js +1 -1
  305. package/assets/esri/core/workers/chunks/06a7f58260225f52f8e6.js +0 -1
  306. package/assets/esri/core/workers/chunks/0e00741d35cdbf48e72d.js +0 -1
  307. package/assets/esri/core/workers/chunks/1ebb29ceabc81509646c.js +0 -1
  308. package/assets/esri/core/workers/chunks/24f7a3df08c3a2d3795c.js +0 -1
  309. package/assets/esri/core/workers/chunks/39a754713a48d46618bd.js +0 -1
  310. package/assets/esri/core/workers/chunks/462163f31fa134b7b216.js +0 -1
  311. package/assets/esri/core/workers/chunks/4bfcb7350ca492767a45.js +0 -1
  312. package/assets/esri/core/workers/chunks/5470cb0c3f670957c22c.js +0 -1
  313. package/assets/esri/core/workers/chunks/6889d698a2c796ed1ce6.js +0 -1
  314. package/assets/esri/core/workers/chunks/869310ef4c98542bf9df.js +0 -1
  315. package/assets/esri/core/workers/chunks/8ebaad46e2fe8925e3b0.js +0 -1
  316. package/assets/esri/core/workers/chunks/98c519ac806cc55bc19b.js +0 -1
  317. package/assets/esri/core/workers/chunks/9d07969fbea13aa5b03c.js +0 -1
  318. package/assets/esri/core/workers/chunks/9e6ce879ec0da884b9b8.js +0 -1
  319. package/assets/esri/core/workers/chunks/abd1bd74ba571e39ab5a.js +0 -1
  320. package/assets/esri/core/workers/chunks/b26ea76e3f41b45756e0.js +0 -1
  321. package/assets/esri/core/workers/chunks/c2286d97539066c8549a.js +0 -1
  322. package/assets/esri/core/workers/chunks/c495a66978d67c7e17f3.js +0 -1
  323. package/assets/esri/core/workers/chunks/c7fa92daca3f6e91734e.js +0 -987
  324. package/assets/esri/core/workers/chunks/c9e890b4be9d01c13efe.js +0 -1
  325. package/assets/esri/core/workers/chunks/dda5ea7f8d35e257815c.js +0 -1
  326. package/assets/esri/core/workers/chunks/e153e89c8a15c2f036ef.js +0 -1
  327. package/assets/esri/core/workers/chunks/e201ffcca7321771ee20.js +0 -1
  328. package/assets/esri/core/workers/chunks/e5b5b93e707173a4c883.js +0 -1
  329. package/assets/esri/core/workers/chunks/f7d1f75b6aa3ef566d74.js +0 -1
  330. package/assets/esri/core/workers/chunks/fde9e9683335fa6c8236.js +0 -1
  331. package/core/queryUtils.js +0 -5
  332. package/views/3d/layers/graphics/Graphics3DFilterVisibility.js +0 -5
  333. package/views/3d/layers/support/HeatmapFilterVisibility.js +0 -5
  334. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputOptions.js +0 -5
  335. package/views/3d/webgl-engine/core/shaderLibrary/util/HeaderComment.glsl.js +0 -10
  336. package/views/3d/webgl-engine/lib/RenderPass.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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{toHSV as t}from"../../core/colorUtils.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{unwrap as a,isSome as o,isNone as n}from"../../core/maybe.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../layers/support/RasterInfo.js";import{isValidPixelBlock as c,extractBands as p,colorize as d,remapColor as h,lookupPixels as m,createColormapLUT as f}from"../../layers/support/rasterFunctions/pixelUtils.js";import{stretch as b,getStretchCutoff as y,createStretchLUT as g,computeGammaValues as S,createHistogramEqualizationLUT as k}from"../../layers/support/rasterFunctions/stretchUtils.js";import{hillshade as x,tintHillshade as I,calculateHillshadeParams as R}from"../../layers/support/rasterFunctions/surfaceUtils.js";import{convertColorRampToColormap as C}from"./colorRampUtils.js";function L(e,t){const{attributeTable:r,bandCount:s}=e;if(n(r)||s>1)return!1;if(t){if(null==r.fields.find((e=>e.name.toLowerCase()===t.toLowerCase())))return!1}return!0}function _(e){const{bandCount:t,dataType:r,pixelType:s}=e;return"elevation"===r||"generic"===r&&1===t&&("s16"===s||"f32"===s||"f64"===s)}function V(e){const{bandCount:t,colormap:r}=e;return o(r)&&r.length&&1===t}let v=class extends r{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e&&e.pixelBlock;if(!O(t))return t;if(e.simpleStretchParams&&"rasterStretch"===this.rendererJSON.type)return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=p(t,[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const{extent:s}=e,a=s.spatialReference.isGeographic,o={x:(s.xmax-s.xmin)/t.width,y:(s.ymax-s.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:a,resolution:o});break}}return r}catch(r){return s.getLogger(this.declaredClass).error("symbolize",r.message),t}}simpleStretch(e,t){if(!O(e))return e;try{return e.pixels.length>3&&(e=p(e,[0,1,2])),b(e,t)}catch(r){return s.getLogger(this.declaredClass).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:e,offset:t}=this.lookup?.colormapLut||{};return{colormap:e,colormapOffset:t,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:s,bandIds:a}=e,{rendererJSON:o}=this;return"rasterStretch"===o.type?this._generateStretchWebGLParams(t,o,a):"rasterShadedRelief"===o.type?this._generateShadedReliefWebGLParams(o,r,s):"vectorField"===o.type?this._generateVectorFieldWebGLParams(o):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){if(this._isLUTChanged()){if(!this.bind().success)return e}return d(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);if(this._isLUTChanged()){if(!this.bind().success)return e}return t?d(e,this.lookup.colormapLut):h(e,this.lookup.remapLut)}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:s,bandCount:o}=r,n=this.rendererJSON,i=["u8","u16","s8","s16"].includes(s);let l,u;const{dra:c}=n,{gamma:p}=this.lookup;if("histogramEqualization"===n.stretchType){const s=c?null:this.lookup.histogramLut,a=y(n,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!s}),o=b(e,{...a,gamma:p});u=m(o,{lut:c?a.histogramLut:s,offset:0})}else if(i){if(c){const a=y(n,{rasterInfo:r,pixelBlock:e,bandIds:t});l=g({pixelType:s,...a,gamma:p})}else if(this._isLUTChanged()){if(!this.bind().success)return e;l=this.lookup?this.lookup.stretchLut:null}else l=this.lookup?this.lookup.stretchLut:null;if(!l)return e;o>1&&t?.length===a(e)?.pixels.length&&l?.lut.length===o&&(l={lut:t.map((e=>l.lut[e])),offset:l.offset}),u=m(e,l)}else{const s=y(n,{rasterInfo:r,pixelBlock:e,bandIds:t});u=b(e,{...s,gamma:p})}if(n.colorRamp){if(this._isLUTChanged(!0)){if(!this.bind().success)return e}u=d(u,this.lookup.colormapLut)}return u}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,s={...r,...t},o=x(e,s);if(!r.colorRamp)return o;let n;if(this._isLUTChanged(!0)){if(!this.bind().success)return o;n=this.lookup?this.lookup.hsvMap:null}else n=this.lookup?this.lookup.hsvMap:null;if(!n)return o;const i=a(this.rasterInfo.statistics)?.[0]??{min:0,max:8e3};return I(o,e,n,i),o}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2===e&&("vector-magdir"===t||"vector-uv"===t)}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:s}=this.rasterInfo,a=e.field1;if(!a)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const o=e.defaultSymbol,n=1===t&&["u8","s8"].includes(s);if(!L(this.rasterInfo,a)&&!n)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const i=[];if(r){const t=r.fields.find((e=>"value"===e.name.toLowerCase()));if(!t)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach((r=>{const s=e.uniqueValueInfos.find((e=>String(e.value)===String(r.attributes[a])))?.symbol?.color;s?i.push([r.attributes[t.name]].concat(s)):o&&i.push([r.attributes[t.name]].concat(o.color))}))}else{if("value"!==a.toLowerCase())return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};e.uniqueValueInfos.forEach((e=>{const t=e?.symbol?.color;t?i.push([parseInt(""+e.value,10)].concat(t)):o&&i.push([parseInt(""+e.value,10)].concat(o.color))}))}if(0===i.length)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const l=f({colormap:i});return this.lookup={rendererJSON:e,colormapLut:l},this.canRenderInWebGL=!0,{success:!0}}_updateColormapRenderer(e){if(!V(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map((e=>[e.value].concat(e.color))).sort(((e,t)=>e[0]-t[0]));if(!t||0===t.length)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=f({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,{success:!0}}_updateShadedReliefRenderer(e){if(!_(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const r=C(e.colorRamp,256,!0),s=f({colormap:r}),a=[],o=s.indexedColormap;for(let e=0;e<o.length;e+=4){const r=t({r:o[e],g:o[e+1],b:o[e+2]});a.push([r.h/60,r.s/100,255*r.v/100])}this.lookup={rendererJSON:e,colormapLut:s,hsvMap:a}}else this.lookup=null;return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,s=o(t)?t.fields.find((e=>"value"===e.name.toLowerCase())):null,a=o(t)?t.fields.find((t=>t.name.toLowerCase()===e.field.toLowerCase())):null,n=null!=s&&null!==a;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||n,tableValueField:s,tableBreakField:a}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:s,tableBreakField:a}=this._analyzeClassBreaks(e),o=e.classBreakInfos;if(!o?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const n=o.sort(((e,t)=>e.classMaxValue-t.classMaxValue)),i=n[n.length-1];let l=e.minValue;if(!r){const t=[];for(let e=0;e<n.length;e++)t.push({value:n[e].classMinValue??l,mappedColor:n[e].symbol.color}),l=n[e].classMaxValue;return t.push({value:i.classMaxValue,mappedColor:i.symbol.color}),this.lookup={rendererJSON:e,remapLut:t},this.canRenderInWebGL=!1,{success:!0}}const u=[];if(null!=s&&null!==a&&s!==a){const r=s.name,o=a.name,i=n[n.length-1],{classMaxValue:c}=i;l=e.minValue;for(const e of t.features){const t=e.attributes[r],s=e.attributes[o],a=s===c?i:s<l?null:n.find((({classMaxValue:e})=>e>s));a&&u.push([t].concat(a.symbol.color))}}else{l=Math.floor(e.minValue);for(let e=0;e<n.length;e++){const t=n[e];for(let e=l;e<t.classMaxValue;e++)u.push([e].concat(t.symbol.color));l=Math.ceil(t.classMaxValue)}i.classMaxValue===l&&u.push([i.classMaxValue].concat(i.symbol.color))}const c=f({colormap:u,fillUnspecified:!1});return this.lookup={rendererJSON:e,colormapLut:c},this.canRenderInWebGL=!0,{success:!0}}_isHistogramRequired(e){return"percentClip"===e||"histogramEqualization"===e}_isValidRasterStatistics(e){return o(e)&&e.length>0&&null!=e[0].min&&null!=e[0].max}_updateStretchRenderer(e){let{stretchType:t,dra:r}=e;if(!("none"===t||e.statistics?.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const s=a(e.histograms||this.rasterInfo.histograms);!this._isHistogramRequired(e.stretchType)||s?.length||r||(t="minMax");const{computeGamma:o,useGamma:n,colorRamp:i}=e;let{gamma:l}=e;if(n&&o&&!l?.length){const t=e.statistics?.length?e.statistics:a(this.rasterInfo.statistics);l=S(this.rasterInfo.pixelType,t)}const u=this.rasterInfo.pixelType,c=!r&&["u8","u16","s8","s16"].includes(u);if("histogramEqualization"===t){const t=s.map((e=>k(e)));this.lookup={rendererJSON:e,histogramLut:t}}else if(c){const t=y(e,{rasterInfo:this.rasterInfo}),r=g({pixelType:u,...t,gamma:n?l:null});this.lookup={rendererJSON:e,stretchLut:r}}if(i){const t=C(i,256,!0);this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=f({colormap:t}),this.lookup.rendererJSON=e}return this.lookup.gamma=n&&l?.length?l:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,t,r){let s=null,a=null;const n=this.lookup&&this.lookup.colormapLut;t.colorRamp&&n&&(s=n.indexedColormap,a=n.offset),"histogramEqualization"===t.stretchType&&(t={...t,stretchType:"minMax"});const{gamma:i}=this.lookup,l=!!(t.useGamma&&i&&i.some((e=>1!==e))),{minCutOff:u,maxCutOff:c,outMin:p,outMax:d}=y(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let h=0;o(e)&&(h=e.getPlaneCount(),2===h&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const m=Math.min(3,r?.length||h||this.rasterInfo.bandCount),f=new Float32Array(m),b=s||l?1:255;let g;for(g=0;g<m;g++)f[g]=(d-p)/(c[g]-u[g])/b;const S=new Float32Array(m);if(l)for(g=0;g<m;g++)i[g]>1?i[g]>2?S[g]=6.5+(i[g]-2)**2.5:S[g]=6.5+100*(2-i[g])**4:S[g]=1;return{bandCount:m,outMin:p/b,outMax:d/b,minCutOff:u,maxCutOff:c,factor:f,useGamma:l,gamma:l?i:[1,1,1],gammaCorrection:l?S:[1,1,1],colormap:s,colormapOffset:a,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t,r){let s=null,o=null;const n=this.lookup&&this.lookup.colormapLut;e.colorRamp&&n&&(s=n.indexedColormap,o=n.offset);const i={...e,isGCS:t,resolution:r},l=R(i),u=a(this.rasterInfo.statistics)?.[0];return{...l,minValue:u?.min??0,maxValue:u?.max??8e3,hillshadeType:"traditional"===e.hillshadeType?0:1,type:"hillshade",colormap:s,colormapOffset:o}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:s,visualVariables:a,symbolTileSize:n,flowRepresentation:i}=e;let l;const u=this.rasterInfo.statistics?.[0].min??0,c=this.rasterInfo.statistics?.[0].max??50,p=a?.find((e=>"sizeInfo"===e.type))??{type:"sizeInfo",field:"Magnitude",maxDataValue:c,maxSize:.8*n,minDataValue:u,minSize:.2*n},d=p.minDataValue??u,h=p.maxDataValue??c,m=o(p.maxSize)&&o(p.minSize)?[p.minSize/n,p.maxSize/n]:[.2,.8];if("wind_speed"===t){const e=(m[0]+m[1])/2;m[0]=m[1]=e}const f=o(d)&&o(h)?[d,h]:null;if("classified_arrow"===t)if(o(d)&&o(h)&&o(p)){l=[];const e=(p.maxDataValue-p.minDataValue)/5;for(let t=0;t<6;t++)l.push(p.minDataValue+e*t)}else l=[0,1e-6,3.5,7,10.5,14];const b="flow_to"===i===("ocean_current_kn"===t||"ocean_current_m"===t)?0:Math.PI,y=a?.find((e=>"rotationInfo"===e.type));return{breakValues:l,dataRange:f,inputUnit:r,outputUnit:s,symbolTileSize:n,symbolPercentRange:m,style:t||"single_arrow",rotation:b,rotationType:this.rasterInfo.storageInfo?.tileInfo&&"vector-uv"===this.rasterInfo.dataType?"geographic":y?.rotationType||e.rotationType,type:"vectorField"}}};function O(e){return c(e)&&0!==e.validPixelCount}e([i({json:{write:!0}})],v.prototype,"rendererJSON",void 0),e([i({type:u,json:{write:!0}})],v.prototype,"rasterInfo",void 0),e([i({json:{write:!0}})],v.prototype,"lookup",void 0),e([i()],v.prototype,"canRenderInWebGL",void 0),v=e([l("esri.renderers.support.RasterSymbolizer")],v);const T=v;export{T as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{toHSV as t}from"../../core/colorUtils.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{unwrap as a,isSome as o,isNone as n}from"../../core/maybe.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../layers/support/RasterInfo.js";import{isValidPixelBlock as c,extractBands as p,colorize as d,remapColor as h,lookupPixels as m,createColormapLUT as f}from"../../layers/support/rasterFunctions/pixelUtils.js";import{stretch as b,getStretchCutoff as y,createStretchLUT as g,computeGammaValues as S,createHistogramEqualizationLUT as k}from"../../layers/support/rasterFunctions/stretchUtils.js";import{hillshade as x,tintHillshade as I,calculateHillshadeParams as R}from"../../layers/support/rasterFunctions/surfaceUtils.js";import{convertColorRampToColormap as C}from"./colorRampUtils.js";function L(e,t){const{attributeTable:r,bandCount:s}=e;if(n(r)||s>1)return!1;if(t){if(null==r.fields.find((e=>e.name.toLowerCase()===t.toLowerCase())))return!1}return!0}function _(e){const{bandCount:t,dataType:r,pixelType:s}=e;return"elevation"===r||"generic"===r&&1===t&&("s16"===s||"f32"===s||"f64"===s)}function V(e){const{bandCount:t,colormap:r}=e;return o(r)&&r.length&&1===t}let v=class extends r{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e&&e.pixelBlock;if(!O(t))return t;if(e.simpleStretchParams&&"rasterStretch"===this.rendererJSON.type)return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=p(t,[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const{extent:s}=e,a=s.spatialReference.isGeographic,o={x:(s.xmax-s.xmin)/t.width,y:(s.ymax-s.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:a,resolution:o});break}}return r}catch(r){return s.getLogger(this.declaredClass).error("symbolize",r.message),t}}simpleStretch(e,t){if(!O(e))return e;try{return e.pixels.length>3&&(e=p(e,[0,1,2])),b(e,t)}catch(r){return s.getLogger(this.declaredClass).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:e,offset:t}=this.lookup?.colormapLut||{};return{colormap:e,colormapOffset:t,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:s,bandIds:a}=e,{rendererJSON:o}=this;return"rasterStretch"===o.type?this._generateStretchWebGLParams(t,o,a):"rasterShadedRelief"===o.type?this._generateShadedReliefWebGLParams(o,r,s):"vectorField"===o.type?this._generateVectorFieldWebGLParams(o):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){if(this._isLUTChanged()){if(!this.bind().success)return e}return d(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);if(this._isLUTChanged()){if(!this.bind().success)return e}return t?d(e,this.lookup.colormapLut):h(e,this.lookup.remapLut)}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:s,bandCount:o}=r,n=this.rendererJSON,i=["u8","u16","s8","s16"].includes(s);let l,u;const{dra:c}=n,{gamma:p}=this.lookup;if("histogramEqualization"===n.stretchType){const s=c?null:this.lookup.histogramLut,a=y(n,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!s}),o=b(e,{...a,gamma:p});u=m(o,{lut:c?a.histogramLut:s,offset:0})}else if(i){if(c){const a=y(n,{rasterInfo:r,pixelBlock:e,bandIds:t});l=g({pixelType:s,...a,gamma:p})}else if(this._isLUTChanged()){if(!this.bind().success)return e;l=this.lookup?this.lookup.stretchLut:null}else l=this.lookup?this.lookup.stretchLut:null;if(!l)return e;o>1&&t?.length===a(e)?.pixels.length&&l?.lut.length===o&&(l={lut:t.map((e=>l.lut[e])),offset:l.offset}),u=m(e,l)}else{const s=y(n,{rasterInfo:r,pixelBlock:e,bandIds:t});u=b(e,{...s,gamma:p})}if(n.colorRamp){if(this._isLUTChanged(!0)){if(!this.bind().success)return e}u=d(u,this.lookup.colormapLut)}return u}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,s={...r,...t},o=x(e,s);if(!r.colorRamp)return o;let n;if(this._isLUTChanged(!0)){if(!this.bind().success)return o;n=this.lookup?this.lookup.hsvMap:null}else n=this.lookup?this.lookup.hsvMap:null;if(!n)return o;const i=a(this.rasterInfo.statistics)?.[0]??{min:0,max:8e3};return I(o,e,n,i),o}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2===e&&("vector-magdir"===t||"vector-uv"===t)}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:s}=this.rasterInfo,a=e.field1;if(!a)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const n=e.defaultSymbol,i=1===t&&["u8","s8"].includes(s);if(!L(this.rasterInfo,a)&&!i)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const l=[];if(o(r)){const t=r.fields.find((e=>"value"===e.name.toLowerCase()));if(!t)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach((r=>{const s=e.uniqueValueInfos.find((e=>String(e.value)===String(r.attributes[a])))?.symbol?.color;s?l.push([r.attributes[t.name]].concat(s)):n&&l.push([r.attributes[t.name]].concat(n.color))}))}else{if("value"!==a.toLowerCase())return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};e.uniqueValueInfos.forEach((e=>{const t=e?.symbol?.color;t?l.push([parseInt(""+e.value,10)].concat(t)):n&&l.push([parseInt(""+e.value,10)].concat(n.color))}))}if(0===l.length)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const u=f({colormap:l});return this.lookup={rendererJSON:e,colormapLut:u},this.canRenderInWebGL=!0,{success:!0}}_updateColormapRenderer(e){if(!V(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map((e=>[e.value].concat(e.color))).sort(((e,t)=>e[0]-t[0]));if(!t||0===t.length)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=f({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,{success:!0}}_updateShadedReliefRenderer(e){if(!_(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const r=C(e.colorRamp,256,!0),s=f({colormap:r}),a=[],o=s.indexedColormap;for(let e=0;e<o.length;e+=4){const r=t({r:o[e],g:o[e+1],b:o[e+2]});a.push([r.h/60,r.s/100,255*r.v/100])}this.lookup={rendererJSON:e,colormapLut:s,hsvMap:a}}else this.lookup=null;return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,s=o(t)?t.fields.find((e=>"value"===e.name.toLowerCase())):null,a=o(t)?t.fields.find((t=>t.name.toLowerCase()===e.field.toLowerCase())):null,n=null!=s&&null!==a;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||n,tableValueField:s,tableBreakField:a}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:s,tableBreakField:a}=this._analyzeClassBreaks(e),n=e.classBreakInfos;if(!n?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const i=n.sort(((e,t)=>e.classMaxValue-t.classMaxValue)),l=i[i.length-1];let u=e.minValue;if(!r){const t=[];for(let e=0;e<i.length;e++)t.push({value:i[e].classMinValue??u,mappedColor:i[e].symbol.color}),u=i[e].classMaxValue;return t.push({value:l.classMaxValue,mappedColor:l.symbol.color}),this.lookup={rendererJSON:e,remapLut:t},this.canRenderInWebGL=!1,{success:!0}}const c=[];if(o(t)&&null!=s&&null!==a&&s!==a){const r=s.name,o=a.name,n=i[i.length-1],{classMaxValue:l}=n;u=e.minValue;for(const e of t.features){const t=e.attributes[r],s=e.attributes[o],a=s===l?n:s<u?null:i.find((({classMaxValue:e})=>e>s));a&&c.push([t].concat(a.symbol.color))}}else{u=Math.floor(e.minValue);for(let e=0;e<i.length;e++){const t=i[e];for(let e=u;e<t.classMaxValue;e++)c.push([e].concat(t.symbol.color));u=Math.ceil(t.classMaxValue)}l.classMaxValue===u&&c.push([l.classMaxValue].concat(l.symbol.color))}const p=f({colormap:c,fillUnspecified:!1});return this.lookup={rendererJSON:e,colormapLut:p},this.canRenderInWebGL=!0,{success:!0}}_isHistogramRequired(e){return"percentClip"===e||"histogramEqualization"===e}_isValidRasterStatistics(e){return o(e)&&e.length>0&&null!=e[0].min&&null!=e[0].max}_updateStretchRenderer(e){let{stretchType:t,dra:r}=e;if(!("none"===t||e.statistics?.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const s=a(e.histograms||this.rasterInfo.histograms);!this._isHistogramRequired(e.stretchType)||s?.length||r||(t="minMax");const{computeGamma:o,useGamma:n,colorRamp:i}=e;let{gamma:l}=e;if(n&&o&&!l?.length){const t=e.statistics?.length?e.statistics:a(this.rasterInfo.statistics);l=S(this.rasterInfo.pixelType,t)}const u=this.rasterInfo.pixelType,c=!r&&["u8","u16","s8","s16"].includes(u);if("histogramEqualization"===t){const t=s.map((e=>k(e)));this.lookup={rendererJSON:e,histogramLut:t}}else if(c){const t=y(e,{rasterInfo:this.rasterInfo}),r=g({pixelType:u,...t,gamma:n?l:null});this.lookup={rendererJSON:e,stretchLut:r}}if(i){const t=C(i,256,!0);this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=f({colormap:t}),this.lookup.rendererJSON=e}return this.lookup.gamma=n&&l?.length?l:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,t,r){let s=null,a=null;const n=this.lookup&&this.lookup.colormapLut;t.colorRamp&&n&&(s=n.indexedColormap,a=n.offset),"histogramEqualization"===t.stretchType&&(t={...t,stretchType:"minMax"});const{gamma:i}=this.lookup,l=!!(t.useGamma&&i&&i.some((e=>1!==e))),{minCutOff:u,maxCutOff:c,outMin:p,outMax:d}=y(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let h=0;o(e)&&(h=e.getPlaneCount(),2===h&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const m=Math.min(3,r?.length||h||this.rasterInfo.bandCount),f=new Float32Array(m),b=s||l?1:255;let g;for(g=0;g<m;g++)f[g]=(d-p)/(c[g]-u[g])/b;const S=new Float32Array(m);if(l)for(g=0;g<m;g++)i[g]>1?i[g]>2?S[g]=6.5+(i[g]-2)**2.5:S[g]=6.5+100*(2-i[g])**4:S[g]=1;return{bandCount:m,outMin:p/b,outMax:d/b,minCutOff:u,maxCutOff:c,factor:f,useGamma:l,gamma:l?i:[1,1,1],gammaCorrection:l?S:[1,1,1],colormap:s,colormapOffset:a,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t,r){let s=null,o=null;const n=this.lookup&&this.lookup.colormapLut;e.colorRamp&&n&&(s=n.indexedColormap,o=n.offset);const i={...e,isGCS:t,resolution:r},l=R(i),u=a(this.rasterInfo.statistics)?.[0];return{...l,minValue:u?.min??0,maxValue:u?.max??8e3,hillshadeType:"traditional"===e.hillshadeType?0:1,type:"hillshade",colormap:s,colormapOffset:o}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:s,visualVariables:a,symbolTileSize:n,flowRepresentation:i}=e;let l;const u=this.rasterInfo.statistics?.[0].min??0,c=this.rasterInfo.statistics?.[0].max??50,p=a?.find((e=>"sizeInfo"===e.type))??{type:"sizeInfo",field:"Magnitude",maxDataValue:c,maxSize:.8*n,minDataValue:u,minSize:.2*n},d=p.minDataValue??u,h=p.maxDataValue??c,m=o(p.maxSize)&&o(p.minSize)?[p.minSize/n,p.maxSize/n]:[.2,.8];if("wind_speed"===t){const e=(m[0]+m[1])/2;m[0]=m[1]=e}const f=o(d)&&o(h)?[d,h]:null;if("classified_arrow"===t)if(o(d)&&o(h)&&o(p)){l=[];const e=(p.maxDataValue-p.minDataValue)/5;for(let t=0;t<6;t++)l.push(p.minDataValue+e*t)}else l=[0,1e-6,3.5,7,10.5,14];const b="flow_to"===i===("ocean_current_kn"===t||"ocean_current_m"===t)?0:Math.PI,y=a?.find((e=>"rotationInfo"===e.type));return{breakValues:l,dataRange:f,inputUnit:r,outputUnit:s,symbolTileSize:n,symbolPercentRange:m,style:t||"single_arrow",rotation:b,rotationType:this.rasterInfo.storageInfo?.tileInfo&&"vector-uv"===this.rasterInfo.dataType?"geographic":y?.rotationType||e.rotationType,type:"vectorField"}}};function O(e){return c(e)&&0!==e.validPixelCount}e([i({json:{write:!0}})],v.prototype,"rendererJSON",void 0),e([i({type:u,json:{write:!0}})],v.prototype,"rasterInfo",void 0),e([i({json:{write:!0}})],v.prototype,"lookup",void 0),e([i()],v.prototype,"canRenderInWebGL",void 0),v=e([l("esri.renderers.support.RasterSymbolizer")],v);const T=v;export{T as default};
package/request.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"./config.js";import{id as r}from"./kernel.js";import t from"./core/Error.js";import has from"./core/has.js";import{clone as s}from"./core/lang.js";import{unwrap as o}from"./core/maybe.js";import{onAbort as n,isAbortError as a,createAbortError as i,isAborted as l}from"./core/promiseUtils.js";import{isDataProtocol as u,isBlobProtocol as c,normalize as d,getInterceptor as p,isTrustedServer as h,getOrigin as m,toHTTPS as f,addQueryParameter as y,objectToQuery as w,getProxyRule as g,getProxyUrl as b,addQueryParameters as q,hasSameOrigin as T,getAppUrl as k,addProxyRule as O}from"./core/urlUtils.js";import{supportsApiKey as S}from"./support/apiKeyUtils.js";import{registerNoCorsDomains as C,isNoCorsRequestRequired as x,sendNoCorsRequest as v,loadImageAsync as E}from"./support/requestUtils.js";async function L(e,r){const t=u(e),s=c(e);s||t||(e=d(e));const a={url:e,requestOptions:{...o(r)}};let i=p(e);if(i){const e=await W(i,a);if(null!=e)return{data:e,getHeader:I,requestOptions:a.requestOptions,url:a.url};i.after||i.error||(i=null)}if(e=a.url,"image"===(r=a.requestOptions).responseType){if(has("host-webworker")||has("host-node"))throw A("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),a)}else if(t)throw A("request:invalid-parameters",new Error("Data URLs are not supported for responseType = "+r.responseType),a);if("head"===r.method){if(r.body)throw A("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),a);if(t||s)throw A("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),a)}if(await N(),U)return U.execute(e,r);const l=new AbortController;n(r,(()=>l.abort()));const h={controller:l,credential:null,credentialToken:null,fetchOptions:null,hasToken:!1,interceptor:i,params:a,redoRequest:!1,useIdentity:j.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},m=await X(h);return i?.after?.(m),m}let U;const j=e.request,P="FormData"in globalThis,D=[499,498,403,401],_=["COM_0056","COM_0057","SB_0008"],F=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],I=()=>null,M=Symbol();function R(e){const r=m(e);r&&!L._corsServers.includes(r)&&L._corsServers.push(r)}function H(e){const r=m(e);return!r||r.endsWith(".arcgis.com")||L._corsServers.includes(r)||h(r)}function A(e,r,o,n){let l="Error";const u={url:o.url,requestOptions:o.requestOptions,getHeader:I,ssl:!1};if(r instanceof t)return r.details?(r.details=s(r.details),r.details.url=o.url,r.details.requestOptions=o.requestOptions):r.details=u,r;if(r){const e=n&&(e=>n.headers.get(e)),t=n&&n.status,s=r.message;s&&(l=s),e&&(u.getHeader=e),u.httpStatus=(null!=r.httpCode?r.httpCode:r.code)||t||0,u.subCode=r.subcode,u.messageCode=r.messageCode,"string"==typeof r.details?u.messages=[r.details]:u.messages=r.details,u.raw=M in r?r[M]:r}return a(r)?i():new t(e,l,u)}async function N(){has("host-webworker")?U||(U=await import("./core/workers/request.js")):L._abortableFetch||(L._abortableFetch=globalThis.fetch.bind(globalThis))}async function B(){r||await import("./identity/IdentityManager.js")}async function $(t){const s=t.params.url,o=t.params.requestOptions,n=t.controller.signal,a=o.body;let i=null,u=null;if(P&&"HTMLFormElement"in globalThis&&(a instanceof FormData?i=a:a instanceof HTMLFormElement&&(i=new FormData(a))),"string"==typeof a&&(u=a),t.fetchOptions={cache:o.cacheBust&&!L._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:o.headers||{},method:"head"===o.method?"HEAD":"GET",mode:"cors",priority:j.priority,redirect:"follow",signal:n},(i||u)&&(t.fetchOptions.body=i||u),"anonymous"===o.authMode&&(t.useIdentity=!1),t.hasToken=!!(/token=/i.test(s)||o.query?.token||i?.get("token")),!t.hasToken&&e.apiKey&&S(s)&&(o.query||(o.query={}),o.query.token=e.apiKey,t.hasToken=!0),t.useIdentity&&!t.hasToken&&!t.credentialToken&&!z(s)&&!l(n)){let e;"immediate"===o.authMode?(await B(),e=await r.getCredential(s,{signal:n}),t.credential=e):"no-prompt"===o.authMode?(await B(),e=await r.getCredential(s,{prompt:!1,signal:n}).catch((()=>{})),t.credential=e):r&&(e=r.findCredential(s)),e&&(t.credentialToken=e.token,t.useSSL=!!e.ssl)}}function z(e){return F.some((r=>r.test(e)))}async function K(e){let t=e.params.url;const s=e.params.requestOptions,o=e.fetchOptions,n=c(t)||u(t),a=s.responseType||"json",l=n?0:null!=s.timeout?s.timeout:j.timeout;let d=!1;if(!n){e.useSSL&&(t=f(t)),s.cacheBust&&"default"===o.cache&&(t=y(t,"request.preventCache",Date.now()));let n={...s.query};e.credentialToken&&(n.token=e.credentialToken);let a=w(n);has("esri-url-encodes-apostrophe")&&(a=a.replace(/'/g,"%27"));const i=t.length+1+a.length;let l;d="delete"===s.method||"post"===s.method||"put"===s.method||!!s.body||i>j.maxUrlLength;const u=s.useProxy||!!g(t);if(u){const e=b(t);l=e.path,!d&&l.length+1+i>j.maxUrlLength&&(d=!0),e.query&&(n={...e.query,...n})}if("HEAD"===o.method&&(d||u)){if(d){if(i>j.maxUrlLength)throw A("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params);throw A("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params)}if(u)throw A("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(d?(o.method="delete"===s.method?"DELETE":"put"===s.method?"PUT":"POST",s.body?t=q(t,n):(o.body=w(n),o.headers["Content-Type"]="application/x-www-form-urlencoded")):t=q(t,n),u&&(e.useProxy=!0,t=`${l}?${t}`),n.token&&P&&o.body instanceof FormData&&!/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(t)&&o.body.set("token",n.token),s.hasOwnProperty("withCredentials"))e.withCredentials=s.withCredentials;else if(!T(t,k()))if(h(t))e.withCredentials=!0;else if(r){const s=r.findServerInfo(t);s&&s.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(o.credentials="include",x(t)&&await v(d?q(t,n):t))}let p,S,C=0,E=!1;l>0&&(C=setTimeout((()=>{E=!0,e.controller.abort()}),l));try{if("native-request-init"===s.responseType)S=o,S.url=t;else if("image"!==s.responseType||"default"!==o.cache||"GET"!==o.method||d||G(s.headers)||!n&&!e.useProxy&&j.proxyUrl&&!H(t)){if(p=await L._abortableFetch(t,o),e.useProxy||R(t),"native"===s.responseType)S=p;else if("HEAD"!==o.method)if(p.ok){switch(a){case"array-buffer":S=await p.arrayBuffer();break;case"blob":case"image":S=await p.blob();break;default:S=await p.text()}if(C&&(clearTimeout(C),C=0),"json"===a||"xml"===a||"document"===a)if(S)switch(a){case"json":S=JSON.parse(S);break;case"xml":S=J(S,"application/xml");break;case"document":S=J(S,"text/html")}else S=null;if(S){if("array-buffer"===a||"blob"===a){const e=p.headers.get("Content-Type");if(/application\/json|text\/plain/i.test(e)&&S["blob"===a?"size":"byteLength"]<=750)try{const e=await new Response(S).json();e.error&&(S=e)}catch{}}"image"===a&&S instanceof Blob&&(S=await V(URL.createObjectURL(S),e,!0))}}else S=await p.text()}else S=await V(t,e)}catch(U){if("AbortError"===U.name){if(E)throw new Error("Timeout exceeded");throw i("Request canceled")}if(!(!p&&U instanceof TypeError&&j.proxyUrl)||s.body||"delete"===s.method||"head"===s.method||"post"===s.method||"put"===s.method||e.useProxy||H(t))throw U;e.redoRequest=!0,O({proxyUrl:j.proxyUrl,urlPrefix:m(t)})}finally{C&&clearTimeout(C)}return[p,S]}async function W(e,r){if(null!=e.responseData)return e.responseData;if(e.headers&&(r.requestOptions.headers={...r.requestOptions.headers,...e.headers}),e.query&&(r.requestOptions.query={...r.requestOptions.query,...e.query}),e.before){let o,n;try{n=await e.before(r)}catch(s){o=A("request:interceptor",s,r)}if((n instanceof Error||n instanceof t)&&(o=A("request:interceptor",n,r)),o)throw e.error&&e.error(o),o;return n}}function G(e){if(e)for(const r of Object.getOwnPropertyNames(e))if(e[r])return!0;return!1}function J(e,r){let t;try{t=(new DOMParser).parseFromString(e,r)}catch{}if(!t||t.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return t}async function X(e){let t,s;await $(e);try{do{[t,s]=await K(e)}while(!await Q(e,t,s))}catch(a){const r=A("request:server",a,e.params,t);throw r.details.ssl=e.useSSL,e.interceptor&&e.interceptor.error&&e.interceptor.error(r),r}const o=e.params.url;if(s&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(o)){if(!e.hasToken&&!e.credentialToken&&s.user?.username&&!h(o)){const e=m(o,!0);e&&j.trustedServers.push(e)}Array.isArray(s.authorizedCrossOriginNoCorsDomains)&&C(s.authorizedCrossOriginNoCorsDomains)}const n=e.credential;if(n&&r){const e=r.findServerInfo(n.server);let t=e&&e.owningSystemUrl;if(t){t=t.replace(/\/?$/,"/sharing");const e=r.findCredential(t,n.userId);e&&-1===r._getIdenticalSvcIdx(t,e)&&e.resources.unshift(t)}}return{data:s,getHeader:t?e=>t.headers.get(e):I,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}async function Q(e,t,s){if(e.redoRequest)return e.redoRequest=!1,!1;const o=e.params.requestOptions;if(!t||"native"===o.responseType||"native-request-init"===o.responseType)return!0;let n,a,i,l;if(!t.ok)throw n=new Error(`Unable to load ${t.url} status: ${t.status}`),n[M]=s,n;s?.error&&(n=s.error),n&&(a=Number(n.code),i=n.hasOwnProperty("subcode")?Number(n.subcode):null,l=n.messageCode,l=l&&l.toUpperCase());const u=o.authMode;if(403===a&&(4===i||n.message&&n.message.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===a)&&D.includes(a)&&!z(e.params.url)&&(403!==a||!_.includes(l)&&(null==i||2===i&&e.credentialToken))){await B();try{const t=await r.getCredential(e.params.url,{error:A("request:server",n,e.params),prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=t,e.credentialToken=t.token,e.useSSL=e.useSSL||t.ssl,!1}catch(c){if("no-prompt"===u)return e.credential=null,e.credentialToken=null,!1;n=c}}if(n)throw n;return!0}function V(e,r,t=!1){const s=r.controller.signal,o=new Image;return r.withCredentials?o.crossOrigin="use-credentials":o.crossOrigin="anonymous",o.alt="",o.fetchPriority=j.priority,o.src=e,E(o,e,t,s)}L._abortableFetch=null,L._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"];export{L as default};
5
+ import e from"./config.js";import{id as r}from"./kernel.js";import t from"./core/Error.js";import has from"./core/has.js";import{clone as s}from"./core/lang.js";import{unwrap as o}from"./core/maybe.js";import{onAbort as n,isAbortError as a,createAbortError as i,isAborted as l}from"./core/promiseUtils.js";import{isDataProtocol as u,isBlobProtocol as c,normalize as d,getInterceptor as p,isTrustedServer as h,getOrigin as m,toHTTPS as f,addQueryParameter as y,objectToQuery as w,getProxyRule as g,getProxyUrl as b,addQueryParameters as q,hasSameOrigin as T,getAppUrl as k,addProxyRule as O}from"./core/urlUtils.js";import{supportsApiKey as v}from"./support/apiKeyUtils.js";import{registerNoCorsDomains as S,isNoCorsRequestRequired as C,sendNoCorsRequest as x,loadImageAsync as E}from"./support/requestUtils.js";async function L(e,r){const t=u(e),s=c(e);s||t||(e=d(e));const a={url:e,requestOptions:{...o(r)}};let i=p(e);if(i){const e=await W(i,a);if(null!=e)return{data:e,getHeader:I,requestOptions:a.requestOptions,url:a.url};i.after||i.error||(i=null)}if(e=a.url,"image"===(r=a.requestOptions).responseType){if(has("host-webworker")||has("host-node"))throw A("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),a)}else if(t)throw A("request:invalid-parameters",new Error("Data URLs are not supported for responseType = "+r.responseType),a);if("head"===r.method){if(r.body)throw A("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),a);if(t||s)throw A("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),a)}if(await N(),U)return U.execute(e,r);const l=new AbortController;n(r,(()=>l.abort()));const h={controller:l,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:i,params:a,redoRequest:!1,useIdentity:j.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},m=await X(h);return i?.after?.(m),m}let U;const j=e.request,P="FormData"in globalThis,D=[499,498,403,401],_=["COM_0056","COM_0057","SB_0008"],F=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],I=()=>null,M=Symbol();function R(e){const r=m(e);r&&!L._corsServers.includes(r)&&L._corsServers.push(r)}function H(e){const r=m(e);return!r||r.endsWith(".arcgis.com")||L._corsServers.includes(r)||h(r)}function A(e,r,o,n){let l="Error";const u={url:o.url,requestOptions:o.requestOptions,getHeader:I,ssl:!1};if(r instanceof t)return r.details?(r.details=s(r.details),r.details.url=o.url,r.details.requestOptions=o.requestOptions):r.details=u,r;if(r){const e=n&&(e=>n.headers.get(e)),t=n&&n.status,s=r.message;s&&(l=s),e&&(u.getHeader=e),u.httpStatus=(null!=r.httpCode?r.httpCode:r.code)||t||0,u.subCode=r.subcode,u.messageCode=r.messageCode,"string"==typeof r.details?u.messages=[r.details]:u.messages=r.details,u.raw=M in r?r[M]:r}return a(r)?i():new t(e,l,u)}async function N(){has("host-webworker")?U||(U=await import("./core/workers/request.js")):L._abortableFetch||(L._abortableFetch=globalThis.fetch.bind(globalThis))}async function B(){r||await import("./identity/IdentityManager.js")}async function $(t){const s=t.params.url,o=t.params.requestOptions,n=t.controller.signal,a=o.body;let i=null,u=null;if(P&&"HTMLFormElement"in globalThis&&(a instanceof FormData?i=a:a instanceof HTMLFormElement&&(i=new FormData(a))),"string"==typeof a&&(u=a),t.fetchOptions={cache:o.cacheBust&&!L._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:o.headers||{},method:"head"===o.method?"HEAD":"GET",mode:"cors",priority:j.priority,redirect:"follow",signal:n},(i||u)&&(t.fetchOptions.body=i||u),"anonymous"===o.authMode&&(t.useIdentity=!1),t.hasToken=!!(/token=/i.test(s)||o.query?.token||i?.get("token")),!t.hasToken&&e.apiKey&&v(s)&&(o.query||(o.query={}),o.query.token=e.apiKey,t.hasToken=!0),t.useIdentity&&!t.hasToken&&!t.credentialToken&&!z(s)&&!l(n)){let e;"immediate"===o.authMode?(await B(),e=await r.getCredential(s,{signal:n}),t.credential=e):"no-prompt"===o.authMode?(await B(),e=await r.getCredential(s,{prompt:!1,signal:n}).catch((()=>{})),t.credential=e):r&&(e=r.findCredential(s)),e&&(t.credentialToken=e.token,t.useSSL=!!e.ssl)}}function z(e){return F.some((r=>r.test(e)))}async function K(e){let t=e.params.url;const s=e.params.requestOptions,o=e.fetchOptions??{},n=c(t)||u(t),a=s.responseType||"json",l=n?0:null!=s.timeout?s.timeout:j.timeout;let d=!1;if(!n){e.useSSL&&(t=f(t)),s.cacheBust&&"default"===o.cache&&(t=y(t,"request.preventCache",Date.now()));let n={...s.query};e.credentialToken&&(n.token=e.credentialToken);let a=w(n);has("esri-url-encodes-apostrophe")&&(a=a.replace(/'/g,"%27"));const i=t.length+1+a.length;let l;d="delete"===s.method||"post"===s.method||"put"===s.method||!!s.body||i>j.maxUrlLength;const u=s.useProxy||!!g(t);if(u){const e=b(t);l=e.path,!d&&l.length+1+i>j.maxUrlLength&&(d=!0),e.query&&(n={...e.query,...n})}if("HEAD"===o.method&&(d||u)){if(d){if(i>j.maxUrlLength)throw A("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params);throw A("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params)}if(u)throw A("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(d?(o.method="delete"===s.method?"DELETE":"put"===s.method?"PUT":"POST",s.body?t=q(t,n):(o.body=w(n),o.headers||(o.headers={}),o.headers["Content-Type"]="application/x-www-form-urlencoded")):t=q(t,n),u&&(e.useProxy=!0,t=`${l}?${t}`),n.token&&P&&o.body instanceof FormData&&!/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(t)&&o.body.set("token",n.token),s.hasOwnProperty("withCredentials"))e.withCredentials=s.withCredentials;else if(!T(t,k()))if(h(t))e.withCredentials=!0;else if(r){const s=r.findServerInfo(t);s&&s.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(o.credentials="include",C(t)&&await x(d?q(t,n):t))}let p,v,S=0,E=!1;l>0&&(S=setTimeout((()=>{E=!0,e.controller.abort()}),l));try{if("native-request-init"===s.responseType)v=o,v.url=t;else if("image"!==s.responseType||"default"!==o.cache||"GET"!==o.method||d||G(s.headers)||!n&&!e.useProxy&&j.proxyUrl&&!H(t)){if(p=await L._abortableFetch(t,o),e.useProxy||R(t),"native"===s.responseType)v=p;else if("HEAD"!==o.method)if(p.ok){switch(a){case"array-buffer":v=await p.arrayBuffer();break;case"blob":case"image":v=await p.blob();break;default:v=await p.text()}if(S&&(clearTimeout(S),S=0),"json"===a||"xml"===a||"document"===a)if(v)switch(a){case"json":v=JSON.parse(v);break;case"xml":v=J(v,"application/xml");break;case"document":v=J(v,"text/html")}else v=null;if(v){if("array-buffer"===a||"blob"===a){const e=p.headers.get("Content-Type");if(e&&/application\/json|text\/plain/i.test(e)&&v["blob"===a?"size":"byteLength"]<=750)try{const e=await new Response(v).json();e.error&&(v=e)}catch{}}"image"===a&&v instanceof Blob&&(v=await V(URL.createObjectURL(v),e,!0))}}else v=await p.text()}else v=await V(t,e)}catch(U){if("AbortError"===U.name){if(E)throw new Error("Timeout exceeded");throw i("Request canceled")}if(!(!p&&U instanceof TypeError&&j.proxyUrl)||s.body||"delete"===s.method||"head"===s.method||"post"===s.method||"put"===s.method||e.useProxy||H(t))throw U;e.redoRequest=!0,O({proxyUrl:j.proxyUrl,urlPrefix:m(t)??""})}finally{S&&clearTimeout(S)}return[p,v]}async function W(e,r){if(null!=e.responseData)return e.responseData;if(e.headers&&(r.requestOptions.headers={...r.requestOptions.headers,...e.headers}),e.query&&(r.requestOptions.query={...r.requestOptions.query,...e.query}),e.before){let o,n;try{n=await e.before(r)}catch(s){o=A("request:interceptor",s,r)}if((n instanceof Error||n instanceof t)&&(o=A("request:interceptor",n,r)),o)throw e.error&&e.error(o),o;return n}}function G(e){if(e)for(const r of Object.getOwnPropertyNames(e))if(e[r])return!0;return!1}function J(e,r){let t;try{t=(new DOMParser).parseFromString(e,r)}catch{}if(!t||t.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return t}async function X(e){let t,s;await $(e);try{do{[t,s]=await K(e)}while(!await Q(e,t,s))}catch(a){const r=A("request:server",a,e.params,t);throw r.details.ssl=e.useSSL,e.interceptor&&e.interceptor.error&&e.interceptor.error(r),r}const o=e.params.url;if(s&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(o)){if(!e.hasToken&&!e.credentialToken&&s.user?.username&&!h(o)){const e=m(o,!0);e&&j.trustedServers.push(e)}Array.isArray(s.authorizedCrossOriginNoCorsDomains)&&S(s.authorizedCrossOriginNoCorsDomains)}const n=e.credential;if(n&&r){const e=r.findServerInfo(n.server);let t=e&&e.owningSystemUrl;if(t){t=t.replace(/\/?$/,"/sharing");const e=r.findCredential(t,n.userId);e&&-1===r._getIdenticalSvcIdx(t,e)&&e.resources.unshift(t)}}return{data:s,getHeader:t?e=>t?.headers.get(e):I,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}async function Q(e,t,s){if(e.redoRequest)return e.redoRequest=!1,!1;const o=e.params.requestOptions;if(!t||"native"===o.responseType||"native-request-init"===o.responseType)return!0;let n,a;if(!t.ok)throw n=new Error(`Unable to load ${t.url} status: ${t.status}`),n[M]=s,n;s?.error&&(n=s.error);let i,l=null;n&&(a=Number(n.code),l=n.hasOwnProperty("subcode")?Number(n.subcode):null,i=n.messageCode,i=i&&i.toUpperCase());const u=o.authMode;if(403===a&&(4===l||n.message&&n.message.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===a)&&void 0!==a&&D.includes(a)&&!z(e.params.url)&&(403!==a||i&&!_.includes(i)&&(null==l||2===l&&e.credentialToken))){await B();try{const t=await r.getCredential(e.params.url,{error:A("request:server",n,e.params),prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=t,e.credentialToken=t.token,e.useSSL=e.useSSL||t.ssl,!1}catch(c){if("no-prompt"===u)return e.credential=void 0,e.credentialToken=void 0,!1;n=c}}if(n)throw n;return!0}function V(e,r,t=!1){const s=r.controller.signal,o=new Image;return r.withCredentials?o.crossOrigin="use-credentials":o.crossOrigin="anonymous",o.alt="",o.fetchPriority=j.priority,o.src=e,E(o,e,t,s)}L._abortableFetch=null,L._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"];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.25/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as t}from"../../core/maybe.js";import{impedanceAttributeNameJsonMap as r}from"../support/networkEnums.js";function e(e,i){if(t(e))return null;const s={},o=new RegExp(`^${i}`,"i");for(const t of Object.keys(e))if(o.test(t)){const o=t.substring(i.length);s[r.fromJSON(o)]=e[t]}return s}function i(e,i,s){if(!t(e)){i.attributes||(i.attributes={});for(const t in e){const o=r.toJSON(t);i.attributes[`${s}${o}`]=e[t]}}}function s(t){const e={};for(const i of Object.keys(t)){const s=i;e[r.fromJSON(s)]=t[i]}return e}function o(t){const e={};for(const i of Object.keys(t)){const s=i;e[r.toJSON(s)]=t[i]}return e}function n(r,e){return t(r)||t(e)?null:Math.round((r-e)/6e4)}function a(t){const r=t.toJSON(),e=r;return e.accumulateAttributeNames&&(e.accumulateAttributeNames=r.accumulateAttributeNames.join()),e.attributeParameterValues&&(e.attributeParameterValues=JSON.stringify(r.attributeParameterValues)),e.barriers&&(e.barriers=JSON.stringify(r.barriers)),e.outSR&&(e.outSR=r.outSR.wkid),e.overrides&&(e.overrides=JSON.stringify(r.overrides)),e.polygonBarriers&&(e.polygonBarriers=JSON.stringify(r.polygonBarriers)),e.polylineBarriers&&(e.polylineBarriers=JSON.stringify(r.polylineBarriers)),e.restrictionAttributeNames&&(e.restrictionAttributeNames=r.restrictionAttributeNames.join()),e.stops&&(e.stops=JSON.stringify(r.stops)),e.travelMode&&(e.travelMode=JSON.stringify(r.travelMode)),e}function u(t){const r=t.toJSON(),e=r;return e.accumulateAttributeNames&&(e.accumulateAttributeNames=r.accumulateAttributeNames.join()),e.attributeParameterValues&&(e.attributeParameterValues=JSON.stringify(r.attributeParameterValues)),e.barriers&&(e.barriers=JSON.stringify(r.barriers)),e.facilities&&(e.facilities=JSON.stringify(r.facilities)),e.incidents&&(e.incidents=JSON.stringify(r.incidents)),e.outSR&&(e.outSR=r.outSR.wkid),e.overrides&&(e.overrides=JSON.stringify(r.overrides)),e.polygonBarriers&&(e.polygonBarriers=JSON.stringify(r.polygonBarriers)),e.polylineBarriers&&(e.polylineBarriers=JSON.stringify(r.polylineBarriers)),e.restrictionAttributeNames&&(e.restrictionAttributeNames=r.restrictionAttributeNames.join()),e.travelMode&&(e.travelMode=JSON.stringify(r.travelMode)),e}export{u as closestFacilityParametersToQueryParameters,o as fromKebabImpedanceAttributes,e as getPrefixedProperties,n as getTimezoneOffset,a as routeParametersToQueryParameters,i as setPrefixedProperties,s as toKebabImpedanceAttributes};
5
+ import{isNone as r}from"../../core/maybe.js";import{impedanceAttributeNameJsonMap as t}from"../support/networkEnums.js";function e(e,i){if(r(e))return null;const s={},o=new RegExp(`^${i}`,"i");for(const r of Object.keys(e))if(o.test(r)){const o=r.substring(i.length);s[t.fromJSON(o)]=e[r]}return s}function i(e,i,s){if(!r(e)){i.attributes||(i.attributes={});for(const r in e){const o=t.toJSON(r);i.attributes[`${s}${o}`]=e[r]}}}function s(r){const e={};for(const i of Object.keys(r)){const s=i;e[t.fromJSON(s)]=r[i]}return e}function o(r){const e={};for(const i of Object.keys(r)){const s=i;e[t.toJSON(s)]=r[i]}return e}function a(t,e){return r(t)||r(e)?null:Math.round((t-e)/6e4)}function n(r){const t=r.toJSON(),e=t;return e.accumulateAttributeNames&&(e.accumulateAttributeNames=t.accumulateAttributeNames.join()),e.attributeParameterValues&&(e.attributeParameterValues=JSON.stringify(t.attributeParameterValues)),e.barriers&&(e.barriers=JSON.stringify(t.barriers)),e.outSR&&(e.outSR=t.outSR.wkid),e.overrides&&(e.overrides=JSON.stringify(t.overrides)),e.polygonBarriers&&(e.polygonBarriers=JSON.stringify(t.polygonBarriers)),e.polylineBarriers&&(e.polylineBarriers=JSON.stringify(t.polylineBarriers)),e.restrictionAttributeNames&&(e.restrictionAttributeNames=t.restrictionAttributeNames.join()),e.stops&&(e.stops=JSON.stringify(t.stops)),e.travelMode&&(e.travelMode=JSON.stringify(t.travelMode)),e}function u(r){const t=r.toJSON(),e=t;return e.accumulateAttributeNames&&(e.accumulateAttributeNames=t.accumulateAttributeNames.join()),e.attributeParameterValues&&(e.attributeParameterValues=JSON.stringify(t.attributeParameterValues)),e.barriers&&(e.barriers=JSON.stringify(t.barriers)),e.facilities&&(e.facilities=JSON.stringify(t.facilities)),e.incidents&&(e.incidents=JSON.stringify(t.incidents)),e.outSR&&(e.outSR=t.outSR.wkid),e.overrides&&(e.overrides=JSON.stringify(t.overrides)),e.polygonBarriers&&(e.polygonBarriers=JSON.stringify(t.polygonBarriers)),e.polylineBarriers&&(e.polylineBarriers=JSON.stringify(t.polylineBarriers)),e.restrictionAttributeNames&&(e.restrictionAttributeNames=t.restrictionAttributeNames.join()),e.travelMode&&(e.travelMode=JSON.stringify(t.travelMode)),e}function l(r){const t=r.toJSON(),e=t;return e.accumulateAttributeNames&&(e.accumulateAttributeNames=t.accumulateAttributeNames.join()),e.attributeParameterValues&&(e.attributeParameterValues=JSON.stringify(t.attributeParameterValues)),e.barriers&&(e.barriers=JSON.stringify(t.barriers)),e.defaultBreaks&&(e.defaultBreaks=t.defaultBreaks.join()),e.excludeSourcesFromPolygons&&(e.excludeSourcesFromPolygons=t.excludeSourcesFromPolygons.join()),e.facilities&&(e.facilities=JSON.stringify(t.facilities)),e.outSR&&(e.outSR=t.outSR.wkid),e.overrides&&(e.overrides=JSON.stringify(t.overrides)),e.polygonBarriers&&(e.polygonBarriers=JSON.stringify(t.polygonBarriers)),e.polylineBarriers&&(e.polylineBarriers=JSON.stringify(t.polylineBarriers)),e.restrictionAttributeNames&&(e.restrictionAttributeNames=t.restrictionAttributeNames.join()),e.travelMode&&(e.travelMode=JSON.stringify(t.travelMode)),e}export{u as closestFacilityParametersToQueryParameters,o as fromKebabImpedanceAttributes,e as getPrefixedProperties,a as getTimezoneOffset,n as routeParametersToQueryParameters,l as serviceAreaParametersToQueryParameters,i as setPrefixedProperties,s as toKebabImpedanceAttributes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import r from"../request.js";import{createQueryParamsHelper as e}from"../core/queryUtils.js";import{normalizeCentralMeridian as t}from"../geometry/support/normalizeUtils.js";import{collectGeometries as i,isInputGeometryZAware as a,fetchServiceDescription as s,dropZValuesOffInputGeometry as o}from"./networkService.js";import{parseUrl as n}from"./utils.js";import u from"./support/ServiceAreaSolveResult.js";const l=e({accumulateAttributes:{name:"accumulateAttributeNames"},attributeParameterValues:!0,defaultBreaks:!0,facilities:!0,outSpatialReference:{name:"outSR",getter:r=>r.outSpatialReference.wkid},pointBarriers:{name:"barriers"},polylineBarriers:!0,polygonBarriers:!0,restrictionAttributes:{name:"restrictionAttributeNames"},returnPointBarriers:{name:"returnBarriers"},travelMode:!0});async function f(e,f,p){const c=[],m=[],y={},B={},g=n(e),{path:S}=g;f.facilities&&f.facilities.features&&i(f.facilities.features,m,"facilities.features",y),f.pointBarriers&&f.pointBarriers.features&&i(f.pointBarriers.features,m,"pointBarriers.features",y),f.polylineBarriers&&f.polylineBarriers.features&&i(f.polylineBarriers.features,m,"polylineBarriers.features",y),f.polygonBarriers&&f.polygonBarriers.features&&i(f.polygonBarriers.features,m,"polygonBarriers.features",y);const j=await t(m);for(const r in y){const e=y[r];c.push(r),B[r]=j.slice(e[0],e[1])}if(a(B,c)){let r=null;try{r=await s(S,f.apiKey,p)}catch{}r&&!r.hasZ&&o(B,c)}for(const r in B)B[r].forEach(((e,t)=>{f.get(r)[t].geometry=e}));const b={...p,query:{...g.query,...l.toQueryParams(f),f:"json"}},{data:v}=await r(`${S}/solveServiceArea`,b);return u.fromJSON(v)}export{f as solve};
5
+ import r from"../request.js";import{normalizeCentralMeridian as e}from"../geometry/support/normalizeUtils.js";import{collectGeometries as t,isInputGeometryZAware as o,fetchServiceDescription as i,dropZValuesOffInputGeometry as s}from"./networkService.js";import{parseUrl as a}from"./utils.js";import{serviceAreaParametersToQueryParameters as n}from"./route/utils.js";import f from"./support/FeatureSet.js";import p from"./support/ServiceAreaSolveResult.js";function u(r){return r instanceof f}async function l(f,l,c){const m=[],y=[],B={},j={},g=a(f),{path:S}=g;u(l.facilities)&&t(l.facilities.features,y,"facilities.features",B),u(l.pointBarriers)&&t(l.pointBarriers.features,y,"pointBarriers.features",B),u(l.polylineBarriers)&&t(l.polylineBarriers.features,y,"polylineBarriers.features",B),u(l.polygonBarriers)&&t(l.polygonBarriers.features,y,"polygonBarriers.features",B);const h=await e(y);for(const r in B){const e=B[r];m.push(r),j[r]=h.slice(e[0],e[1])}if(o(j,m)){let r=null;try{r=await i(S,l.apiKey,c)}catch{}r&&!r.hasZ&&s(j,m)}for(const r in j)j[r].forEach(((e,t)=>{l.get(r)[t].geometry=e}));const v={...c,query:{...g.query,...n(l),f:"json"}},{data:w}=await r(`${S}/solveServiceArea`,v);return p.fromJSON(w)}export{l as solve};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import"../../geometry.js";import{JSONSupport as e}from"../../core/JSONSupport.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{enumeration as r}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as i}from"../../core/accessorSupport/decorators/reader.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import{apiKey as n}from"./commonProperties.js";import{lengthUnitJsonMap as l,outputLineJsonMap as a,outputPolygonJsonMap as y,restrictUTurnJsonMap as u,travelDirectionJsonMap as m}from"./networkEnums.js";import c from"./TravelMode.js";import d from"../../geometry/SpatialReference.js";let v=class extends e{constructor(t){super(t),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.defaultBreaks=null,this.excludeSourcesFromPolygons=null,this.facilities=null,this.impedanceAttribute=null,this.mergeSimilarPolygonRanges=!1,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines=null,this.outputPolygons=null,this.outSpatialReference=null,this.overlapLines=!1,this.overlapPolygons=!1,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnFacilities=!1,this.returnPointBarriers=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.splitLinesAtBreaks=!1,this.splitPolygonsAtBreaks=!1,this.timeOfDay=null,this.travelDirection=null,this.travelMode=null,this.trimOuterPolygon=!1,this.trimPolygonDistance=null,this.trimPolygonDistanceUnits=null,this.useHierarchy=null}readTimeOfDay(t,e){return null!=e.timeOfDay?new Date(e.timeOfDay):null}writeTimeOfDay(t,e){e.timeOfDay=t?t.getTime():null}};t([o({type:[String],json:{write:!0}})],v.prototype,"accumulateAttributes",void 0),t([o(n)],v.prototype,"apiKey",void 0),t([o({json:{write:!0}})],v.prototype,"attributeParameterValues",void 0),t([o({type:[Number],json:{write:!0}})],v.prototype,"defaultBreaks",void 0),t([o({type:[String],json:{write:!0}})],v.prototype,"excludeSourcesFromPolygons",void 0),t([o({json:{write:!0}})],v.prototype,"facilities",void 0),t([o({type:String,json:{read:{source:"impedanceAttributeName"},write:{target:"impedanceAttributeName"}}})],v.prototype,"impedanceAttribute",void 0),t([o({type:Boolean,json:{write:!0}})],v.prototype,"mergeSimilarPolygonRanges",void 0),t([o({type:Number,json:{write:!0}})],v.prototype,"outputGeometryPrecision",void 0),t([r(l)],v.prototype,"outputGeometryPrecisionUnits",void 0),t([r(a)],v.prototype,"outputLines",void 0),t([r(y)],v.prototype,"outputPolygons",void 0),t([o({type:d,json:{write:!0}})],v.prototype,"outSpatialReference",void 0),t([o({type:Boolean,json:{write:!0}})],v.prototype,"overlapLines",void 0),t([o({type:Boolean,json:{write:!0}})],v.prototype,"overlapPolygons",void 0),t([o({json:{write:!0}})],v.prototype,"pointBarriers",void 0),t([o({json:{write:!0}})],v.prototype,"polygonBarriers",void 0),t([o({json:{write:!0}})],v.prototype,"polylineBarriers",void 0),t([o({type:[String],json:{write:!0}})],v.prototype,"restrictionAttributes",void 0),t([r(u)],v.prototype,"restrictUTurns",void 0),t([o({type:Boolean,json:{write:!0}})],v.prototype,"returnFacilities",void 0),t([o({type:Boolean,json:{write:!0}})],v.prototype,"returnPointBarriers",void 0),t([o({type:Boolean,json:{write:!0}})],v.prototype,"returnPolygonBarriers",void 0),t([o({type:Boolean,json:{write:!0}})],v.prototype,"returnPolylineBarriers",void 0),t([o({type:Boolean,json:{write:!0}})],v.prototype,"splitLinesAtBreaks",void 0),t([o({type:Boolean,json:{write:!0}})],v.prototype,"splitPolygonsAtBreaks",void 0),t([o({type:Date,json:{type:Number,write:!0}})],v.prototype,"timeOfDay",void 0),t([i("timeOfDay")],v.prototype,"readTimeOfDay",null),t([p("timeOfDay")],v.prototype,"writeTimeOfDay",null),t([r(m)],v.prototype,"travelDirection",void 0),t([o({type:c,json:{write:!0}})],v.prototype,"travelMode",void 0),t([o({type:Boolean,json:{write:!0}})],v.prototype,"trimOuterPolygon",void 0),t([o({type:Number,json:{write:!0}})],v.prototype,"trimPolygonDistance",void 0),t([r(l)],v.prototype,"trimPolygonDistanceUnits",void 0),t([o({type:Boolean,json:{write:!0}})],v.prototype,"useHierarchy",void 0),v=t([s("esri.rest.support.ServiceAreaParameters")],v);const j=v;export{j as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import"../../geometry.js";import{ClonableMixin as e}from"../../core/Clonable.js";import r from"../../core/Collection.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{isNone as i,isSome as s}from"../../core/maybe.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{ensureClass as p}from"../../core/accessorSupport/ensureType.js";import{enumeration as l}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{writer as y}from"../../core/accessorSupport/decorators/writer.js";import{apiKey as m}from"./commonProperties.js";import{impedanceAttributeNameJsonMap as c,restrictionAttributeNameJsonMap as d,lengthUnitJsonMap as v,outputLineJsonMap as w,outputPolygonJsonMap as j,restrictUTurnJsonMap as h,travelDirectionJsonMap as g}from"./networkEnums.js";import B from"./TravelMode.js";import P from"../../geometry/SpatialReference.js";var f;function b(t,e,o){s(t)&&(e[o]=r.isCollection(t)?{features:t.toArray().map((t=>t.toJSON()))}:t.toJSON())}let A=f=class extends(e(o)){constructor(t){super(t),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.defaultBreaks=null,this.excludeSourcesFromPolygons=null,this.facilities=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.mergeSimilarPolygonRanges=!1,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines=null,this.outputPolygons=null,this.outSpatialReference=null,this.overlapLines=!1,this.overlapPolygons=!1,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnFacilities=!1,this.returnPointBarriers=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.splitLinesAtBreaks=!1,this.splitPolygonsAtBreaks=!1,this.timeOfDay=null,this.timeOfDayIsUTC=null,this.travelDirection=null,this.travelMode=null,this.trimOuterPolygon=!1,this.trimPolygonDistance=null,this.trimPolygonDistanceUnits=null,this.useHierarchy=null}static from(t){return p(f,t)}readAccumulateAttributes(t){return i(t)?null:t.map((t=>c.fromJSON(t)))}writeAccumulateAttributes(t,e,r){!i(t)&&t.length&&(e[r]=t.map((t=>c.toJSON(t))))}writeFacilities(t,e,r){b(t,e,r)}writePointBarriers(t,e,r){b(t,e,r)}writePolygonBarrier(t,e,r){b(t,e,r)}writePolylineBarrier(t,e,r){b(t,e,r)}readRestrictionAttributes(t){return i(t)?null:t.map((t=>d.fromJSON(t)))}writeRestrictionAttributes(t,e,r){!i(t)&&t.length&&(e[r]=t.map((t=>d.toJSON(t))))}readTimeOfDay(t,e){const{timeOfDay:r}=e;return i(r)?null:"now"===r?"now":new Date(r)}writeTimeOfDay(t,e){i(t)||(e.timeOfDay="now"===t?"now":t.getTime())}};t([n({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],A.prototype,"accumulateAttributes",void 0),t([a("accumulateAttributes")],A.prototype,"readAccumulateAttributes",null),t([y("accumulateAttributes")],A.prototype,"writeAccumulateAttributes",null),t([n(m)],A.prototype,"apiKey",void 0),t([n({json:{write:!0}})],A.prototype,"attributeParameterValues",void 0),t([n({type:[Number],json:{write:!0}})],A.prototype,"defaultBreaks",void 0),t([n({type:[String],json:{write:!0}})],A.prototype,"excludeSourcesFromPolygons",void 0),t([n({json:{write:!0}})],A.prototype,"facilities",void 0),t([y("facilities")],A.prototype,"writeFacilities",null),t([n({type:Number,json:{write:!0}})],A.prototype,"geometryPrecision",void 0),t([n({type:Number,json:{write:!0}})],A.prototype,"geometryPrecisionM",void 0),t([n({type:Number,json:{write:!0}})],A.prototype,"geometryPrecisionZ",void 0),t([n({type:Boolean,json:{write:!0}})],A.prototype,"ignoreInvalidLocations",void 0),t([l(c,{name:"impedanceAttributeName",ignoreUnknown:!1})],A.prototype,"impedanceAttribute",void 0),t([n({type:Boolean,json:{write:!0}})],A.prototype,"mergeSimilarPolygonRanges",void 0),t([n({type:Number,json:{write:!0}})],A.prototype,"outputGeometryPrecision",void 0),t([l(v)],A.prototype,"outputGeometryPrecisionUnits",void 0),t([l(w)],A.prototype,"outputLines",void 0),t([l(j)],A.prototype,"outputPolygons",void 0),t([n({type:P,json:{name:"outSR",write:!0}})],A.prototype,"outSpatialReference",void 0),t([n({type:Boolean,json:{write:!0}})],A.prototype,"overlapLines",void 0),t([n({type:Boolean,json:{write:!0}})],A.prototype,"overlapPolygons",void 0),t([n({json:{write:!0}})],A.prototype,"overrides",void 0),t([n({json:{name:"barriers",write:!0}})],A.prototype,"pointBarriers",void 0),t([y("pointBarriers")],A.prototype,"writePointBarriers",null),t([n({json:{write:!0}})],A.prototype,"polygonBarriers",void 0),t([y("polygonBarriers")],A.prototype,"writePolygonBarrier",null),t([n({json:{write:!0}})],A.prototype,"polylineBarriers",void 0),t([y("polylineBarriers")],A.prototype,"writePolylineBarrier",null),t([n({type:Boolean,json:{write:!0}})],A.prototype,"preserveObjectID",void 0),t([n({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],A.prototype,"restrictionAttributes",void 0),t([a("restrictionAttributes")],A.prototype,"readRestrictionAttributes",null),t([y("restrictionAttributes")],A.prototype,"writeRestrictionAttributes",null),t([l(h)],A.prototype,"restrictUTurns",void 0),t([n({type:Boolean,json:{write:!0}})],A.prototype,"returnFacilities",void 0),t([n({type:Boolean,json:{name:"returnBarriers",write:!0}})],A.prototype,"returnPointBarriers",void 0),t([n({type:Boolean,json:{write:!0}})],A.prototype,"returnPolygonBarriers",void 0),t([n({type:Boolean,json:{write:!0}})],A.prototype,"returnPolylineBarriers",void 0),t([n({type:Boolean,json:{write:!0}})],A.prototype,"splitLinesAtBreaks",void 0),t([n({type:Boolean,json:{write:!0}})],A.prototype,"splitPolygonsAtBreaks",void 0),t([n({type:Date,json:{type:Number,write:!0}})],A.prototype,"timeOfDay",void 0),t([a("timeOfDay")],A.prototype,"readTimeOfDay",null),t([y("timeOfDay")],A.prototype,"writeTimeOfDay",null),t([n({type:Boolean,json:{write:!0}})],A.prototype,"timeOfDayIsUTC",void 0),t([l(g)],A.prototype,"travelDirection",void 0),t([n({type:B,json:{write:!0}})],A.prototype,"travelMode",void 0),t([n({type:Boolean,json:{write:!0}})],A.prototype,"trimOuterPolygon",void 0),t([n({type:Number,json:{write:!0}})],A.prototype,"trimPolygonDistance",void 0),t([l(v)],A.prototype,"trimPolygonDistanceUnits",void 0),t([n({type:Boolean,json:{write:!0}})],A.prototype,"useHierarchy",void 0),A=f=t([u("esri.rest.support.ServiceAreaParameters")],A);const S=A;export{S 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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import"../../geometry.js";import e from"../../Graphic.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{filterNones as t,isSome as s,unwrap as i}from"../../core/maybe.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import n from"../../geometry/SpatialReference.js";import y from"./NAMessage.js";import c from"../../geometry/Point.js";import m from"../../geometry/Polyline.js";import u from"../../geometry/Polygon.js";import{fromJSON as f}from"../../geometry/support/jsonUtils.js";function d(r){return r.features.map((o=>{const t=n.fromJSON(r.spatialReference),s=e.fromJSON(o);return i(s.geometry).spatialReference=t,s}))}function g(r){return t(r.features.map((e=>(s(e.geometry)&&(e.geometry.spatialReference=r.spatialReference),f(e.geometry)))))}let P=class extends o{constructor(r){super(r),this.facilities=null,this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.serviceAreaPolylines=null,this.serviceAreaPolygons=null}readFacilities(r){return g(r)}readPointBarriers(r,e){return g(e.barriers)}readPolylineBarriers(r){return g(r)}readPolygonBarriers(r){return g(r)}readIncidents(r,e){return d(e.saPolylines)}readServiceAreaPolygons(r,e){return d(e.saPolygons)}};r([p({type:[c]})],P.prototype,"facilities",void 0),r([a("facilities")],P.prototype,"readFacilities",null),r([p({type:[y]})],P.prototype,"messages",void 0),r([p({type:[c]})],P.prototype,"pointBarriers",void 0),r([a("pointBarriers",["barriers"])],P.prototype,"readPointBarriers",null),r([p({type:[m]})],P.prototype,"polylineBarriers",void 0),r([a("polylineBarriers")],P.prototype,"readPolylineBarriers",null),r([p({type:[u]})],P.prototype,"polygonBarriers",void 0),r([a("polygonBarriers")],P.prototype,"readPolygonBarriers",null),r([p({type:[e]})],P.prototype,"serviceAreaPolylines",void 0),r([a("serviceAreaPolylines",["saPolylines"])],P.prototype,"readIncidents",null),r([p({type:[e]})],P.prototype,"serviceAreaPolygons",void 0),r([a("serviceAreaPolygons",["saPolygons"])],P.prototype,"readServiceAreaPolygons",null),P=r([l("esri.rest.support.ServiceAreaSolveResult")],P);const j=P;export{j as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import{JSONSupport as e}from"../../core/JSONSupport.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import t from"./FeatureSet.js";import i from"./NAMessage.js";let p=class extends e{constructor(r){super(r),this.facilities=null,this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.serviceAreaPolylines=null,this.serviceAreaPolygons=null}};r([o({type:t})],p.prototype,"facilities",void 0),r([o({type:[i]})],p.prototype,"messages",void 0),r([o({type:t,json:{read:{source:"barriers"}}})],p.prototype,"pointBarriers",void 0),r([o({type:t})],p.prototype,"polylineBarriers",void 0),r([o({type:t})],p.prototype,"polygonBarriers",void 0),r([o({type:t,json:{read:{source:"saPolylines"}}})],p.prototype,"serviceAreaPolylines",void 0),r([o({type:t,json:{read:{source:"saPolygons"}}})],p.prototype,"serviceAreaPolygons",void 0),p=r([s("esri.rest.support.ServiceAreaSolveResult")],p);const l=p;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.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import{isNone as r,isSome as a}from"../../../core/maybe.js";import{formatNumber as t}from"../../../intl/number.js";import{createClassBreaksRenderer as s,getField as n}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as o}from"../support/utils.js";async function i(t){const s=(t=await o(t)).layer,{rasterInfo:i}=s;if(i.bandCount>1)throw new e("raster-class-breaks-renderer:not-supported","Multiband raster is not supported");t.field||(t.field=a(i.attributeTable)?n(i.attributeTable,"value").name:"value");if(!(a(i.attributeTable)&&i.attributeTable.fields.find((e=>e.name.toLowerCase()===t.field.toLowerCase())))&&!a(i.histograms)&&(await s.updateRasterInfoWithEstimatedStats({renderingRule:t.renderingRule,signal:t.signal}),r(i.histograms)))throw new e("raster-class-breaks-renderer:not-supported","Histograms or raster attribute table is required on the source raster. Unable to estimate histograms");const{colors:l,numClasses:u}=t;if(l&&u&&l.length!==u)throw new e("raster-class-breaks-renderer:not-supported","The size of the `colors` parameter does not match 'numClasses'");return t.classificationMethod||(t.classificationMethod="natural-breaks"),t}async function l(a){a=await i(a);const t=s(a.layer.rasterInfo,a);if(r(t))throw new e("raster-class-breaks-renderer:not-supported","Class breaks renderer is not supported on this data");const n={minValue:t.minValue,maxValue:t.classBreakInfos[t.classBreakInfos.length-1].maxValue,normalizationTotal:null,classBreakInfos:t.classBreakInfos.map((e=>{const r=u(e.minValue,e.maxValue);return e.label=r,{minValue:e.minValue,maxValue:e.maxValue,label:r}}))};return{renderer:t,classBreaksResult:n}}function u(e,r){return t(e,{maximumFractionDigits:3})+" - "+t(r,{maximumFractionDigits:3})}export{l as createRenderer};
5
+ import e from"../../../core/Error.js";import{isNone as r,isSome as a}from"../../../core/maybe.js";import{formatNumber as s}from"../../../intl/number.js";import{createClassBreaksRenderer as t,getField as n}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as o}from"../support/utils.js";async function i(s){const t=(s=await o(s)).layer,{rasterInfo:i}=t;if(i.bandCount>1)throw new e("raster-class-breaks-renderer:not-supported","Multiband raster is not supported");const{attributeTable:l}=i;s.field||(s.field=a(l)?n(l,"value").name:"value");if(!(a(l)&&l.fields.find((e=>e.name.toLowerCase()===s.field.toLowerCase())))&&!a(i.histograms)&&(await t.updateRasterInfoWithEstimatedStats({renderingRule:s.renderingRule,signal:s.signal}),r(i.histograms)))throw new e("raster-class-breaks-renderer:not-supported","Histograms or raster attribute table is required on the source raster. Unable to estimate histograms");const{colors:u,numClasses:m}=s;if(u&&m&&u.length!==m)throw new e("raster-class-breaks-renderer:not-supported","The size of the `colors` parameter does not match 'numClasses'");return s.classificationMethod||(s.classificationMethod="natural-breaks"),s}async function l(a){a=await i(a);const s=t(a.layer.rasterInfo,a);if(r(s))throw new e("raster-class-breaks-renderer:not-supported","Class breaks renderer is not supported on this data");const n={minValue:s.minValue,maxValue:s.classBreakInfos[s.classBreakInfos.length-1].maxValue,normalizationTotal:null,classBreakInfos:s.classBreakInfos.map((e=>{const r=u(e.minValue,e.maxValue);return e.label=r,{minValue:e.minValue,maxValue:e.maxValue,label:r}}))};return{renderer:s,classBreaksResult:n}}function u(e,r){return s(e,{maximumFractionDigits:3})+" - "+s(r,{maximumFractionDigits:3})}export{l as createRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import{isNone as r}from"../../../core/maybe.js";import{createUVRenderer as t,isSingleBand8BitRasterWithStats as a,getClassField as s}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as o}from"../support/utils.js";async function n(r){r=await o(r);const{rasterInfo:t}=r.layer;if(t.bandCount>1)throw new e("raster-class-breaks-renderer:not-supported","Multiband raster is not supported");if(null===t.attributeTable&&!a(t))throw new e("raster-unique-value-renderer:not-supported","The source raster does not have an attribute table");const n=r.classFieldName?.toLowerCase();if(n&&!t.attributeTable.fields.some((e=>e.name.toLowerCase()===n)))throw new e("raster-unique-value-renderer:invalid-parameters","A valid 'classfieldName' is required");return n||(r.classFieldName=s(t.attributeTable).name),r}async function i(a){a=await n(a);const{classFieldName:s,colors:o,colorRamp:i}=a,u=t(a.layer.rasterInfo,s,o,i);if(r(u))throw new e("raster-unique-value-renderer:not-supported","UniqueValueRenderer is not supported on the provided data source");return{renderer:u,classFieldName:s}}export{i as createRenderer};
5
+ import e from"../../../core/Error.js";import{isNone as r}from"../../../core/maybe.js";import{createUVRenderer as a,isSingleBand8BitRasterWithStats as s,getClassField as t}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as o}from"../support/utils.js";async function n(a){a=await o(a);const{rasterInfo:n}=a.layer;if(n.bandCount>1)throw new e("raster-class-breaks-renderer:not-supported","Multiband raster is not supported");const{attributeTable:i}=n;if(r(i)){if(s(n))return a.classFieldName=a.classFieldName||"value",a;throw new e("raster-unique-value-renderer:not-supported","The source raster does not have an attribute table")}const l=a.classFieldName?.toLowerCase();if(l&&!i.fields.some((e=>e.name.toLowerCase()===l)))throw new e("raster-unique-value-renderer:invalid-parameters","A valid 'classfieldName' is required");return l||(a.classFieldName=t(i).name),a}async function i(s){s=await n(s);const{classFieldName:t,colors:o,colorRamp:i}=s,l=a(s.layer.rasterInfo,t,o,i);if(r(l))throw new e("raster-unique-value-renderer:not-supported","UniqueValueRenderer is not supported on the provided data source");return{renderer:l,classFieldName:t}}export{i as createRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{getOrigin as s}from"../core/urlUtils.js";const t=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function c(s){return s&&s.length>4&&s.startsWith("AAPK")}function r(c){const r=s(c,!0);return r&&r.endsWith(".arcgis.com")&&!t.includes(r)&&!c.endsWith("/sharing/rest/generateToken")}export{c as isApiKey,r as supportsApiKey};
5
+ import{getOrigin as s}from"../core/urlUtils.js";const t=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function c(s){return!!s&&s.length>4&&s.startsWith("AAPK")}function r(c){const r=s(c,!0);return!!r&&(r.endsWith(".arcgis.com")&&!t.includes(r)&&!c.endsWith("/sharing/rest/generateToken"))}export{c as isApiKey,r as supportsApiKey};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import r from"../config.js";import has from"../core/has.js";import{isSome as e}from"../core/maybe.js";import{isAborted as o}from"../core/promiseUtils.js";import{getOrigin as t,hasSameOrigin as n,urlToObject as s,getAppUrl as i}from"../core/urlUtils.js";function c(r,t,n=!1,s){return new Promise(((i,c)=>{if(o(s))return void c(a());let m=()=>{f(),c(new Error(`Unable to load ${t}`))},u=()=>{const e=r;f(),i(e)},d=()=>{if(!r)return;const e=r;f(),e.src="",c(a())};const f=()=>{has("esri-image-decode")||(r.removeEventListener("error",m),r.removeEventListener("load",u)),m=null,u=null,r=null,e(s)&&s.removeEventListener("abort",d),d=null,n&&URL.revokeObjectURL(t)};e(s)&&s.addEventListener("abort",d),has("esri-image-decode")?r.decode().then(u,m):(r.addEventListener("error",m),r.addEventListener("load",u))}))}function a(){try{return new DOMException("Aborted","AbortError")}catch{const r=new Error;return r.name="AbortError",r}}function m(e){r.request.crossOriginNoCorsDomains||(r.request.crossOriginNoCorsDomains={});const o=r.request.crossOriginNoCorsDomains;for(let r of e)r=r.toLowerCase(),/^https?:\/\//.test(r)?o[t(r)]=0:(o[t("http://"+r)]=0,o[t("https://"+r)]=0)}function u(e){const o=r.request.crossOriginNoCorsDomains;if(o){let r=t(e);if(r)return r=r.toLowerCase(),!n(r,i())&&o[r]<Date.now()-36e5}return!1}async function d(e){const o=r.request.crossOriginNoCorsDomains;o&&(o[t(e).toLowerCase()]=Date.now());const n=s(e);e=n.path,"json"===n.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}}export{u as isNoCorsRequestRequired,c as loadImageAsync,m as registerNoCorsDomains,d as sendNoCorsRequest};
5
+ import r from"../config.js";import has from"../core/has.js";import{isSome as e}from"../core/maybe.js";import{isAborted as o}from"../core/promiseUtils.js";import{getOrigin as t,hasSameOrigin as n,getAppUrl as s,urlToObject as i}from"../core/urlUtils.js";function c(r,t,n=!1,s){return new Promise(((i,c)=>{if(o(s))return void c(a());let m=()=>{f(),c(new Error(`Unable to load ${t}`))},u=()=>{const e=r;f(),i(e)},d=()=>{if(!r)return;const e=r;f(),e.src="",c(a())};const f=()=>{has("esri-image-decode")||(r.removeEventListener("error",m),r.removeEventListener("load",u)),m=null,u=null,r=null,e(s)&&s.removeEventListener("abort",d),d=null,n&&URL.revokeObjectURL(t)};e(s)&&s.addEventListener("abort",d),has("esri-image-decode")?r.decode().then(u,m):(r.addEventListener("error",m),r.addEventListener("load",u))}))}function a(){try{return new DOMException("Aborted","AbortError")}catch{const r=new Error;return r.name="AbortError",r}}function m(e){r.request.crossOriginNoCorsDomains||(r.request.crossOriginNoCorsDomains={});const o=r.request.crossOriginNoCorsDomains;for(let r of e)r=r.toLowerCase(),/^https?:\/\//.test(r)?o[t(r)??""]=0:(o[t("http://"+r)??""]=0,o[t("https://"+r)??""]=0)}function u(e){const o=r.request.crossOriginNoCorsDomains;if(o){let r=t(e);if(r)return r=r.toLowerCase(),!n(r,s())&&o[r]<Date.now()-36e5}return!1}async function d(e){const o=r.request.crossOriginNoCorsDomains,n=t(e);o&&n&&(o[n.toLowerCase()]=Date.now());const s=i(e);e=s.path,"json"===s.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}}export{u as isNoCorsRequestRequired,c as loadImageAsync,m as registerNoCorsDomains,d as sendNoCorsRequest};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- const e="20220705",f="2ffeb1ba19a7be6123a2382e7d4f00f581760d96";export{e as buildDate,f as commitHash};
5
+ const a="20220708",b="736a7d84a104bb98f0d24e137a1a98fb9e771053";export{a as buildDate,b as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import i from"../../../Graphic.js";import s from"../../../core/Collection.js";import{isSome as t,isNone as r}from"../../../core/maybe.js";import{watch as h,on as a,initial as o}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/Error.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView2DMixin as n}from"./LayerView2D.js";import c from"./graphics/GraphicContainer.js";import l from"./graphics/GraphicsView2D.js";import g from"../../layers/LayerView.js";const d="sublayers",u="layerView",f=Object.freeze({remove(){},pause(){},resume(){}});let m=class extends(n(g)){constructor(){super(...arguments),this._highlightIds=new Map}async fetchPopupFeatures(e){return Array.from(this.graphicsViews(),(i=>i.hitTest(e).filter((e=>!!e.popupTemplate)))).flat()}*graphicsViews(){t(this._graphicsViewsFeatureCollectionMap)?yield*this._graphicsViewsFeatureCollectionMap.keys():t(this._graphicsViews)?yield*this._graphicsViews:yield*[]}async hitTest(e,i){return Array.from(this.graphicsViews(),(i=>{const s=i.hitTest(e);if(t(this._graphicsViewsFeatureCollectionMap)){const e=this._graphicsViewsFeatureCollectionMap.get(i);for(const i of s)!i.popupTemplate&&e.popupTemplate&&(i.popupTemplate=e.popupTemplate)}return s})).flat().map((i=>({type:"graphic",graphic:i,layer:this.layer,mapPoint:e})))}highlight(e){let t;return"number"==typeof e?t=[e]:e instanceof i?t=[e.uid]:Array.isArray(e)&&e.length>0?t="number"==typeof e[0]?e:e.map((e=>e&&e.uid)):s.isCollection(e)&&(t=e.map((e=>e&&e.uid)).toArray()),t=t.filter((e=>null!=e)),t.length?(this._addHighlight(t),{remove:()=>{this._removeHighlight(t)}}):f}update(e){for(const i of this.graphicsViews())i.processUpdate(e)}attach(){const e=this.view,i=()=>this.requestUpdate(),s=this.layer.featureCollections;if(t(s)&&s.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const t of s){const s=new c(this.view.featuresTilingScheme);s.fadeTransitionEnabled=!0;const r=new l({view:e,graphics:t.source,renderer:t.renderer,requestUpdateCallback:i,container:s});this._graphicsViewsFeatureCollectionMap.set(r,t),this.container.addChild(r.container),this.handles.add([h((()=>t.visible),(e=>r.container.visible=e),o),h((()=>r.updating),(()=>this.notifyChange("updating")),o)],u)}this._updateHighlight()}else t(this.layer.sublayers)&&this.handles.add(a((()=>this.layer.sublayers),"change",(()=>this._createGraphicsViews()),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),d)}detach(){this._destroyGraphicsViews(),this.handles.remove(d)}moveStart(){}moveEnd(){}viewChange(){for(const e of this.graphicsViews())e.viewChange()}isUpdating(){for(const e of this.graphicsViews())if(e.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.handles.remove(u);for(const e of this.graphicsViews())e.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),r(this.layer.sublayers))return;const e=[],i=this.view,s=()=>this.requestUpdate();for(const t of this.layer.sublayers){const r=new c(this.view.featuresTilingScheme);r.fadeTransitionEnabled=!0;const a=new l({view:i,graphics:t.graphics,requestUpdateCallback:s,container:r});this.handles.add([t.on("graphic-update",a.graphicUpdateHandler),h((()=>t.visible),(e=>a.container.visible=e),o),h((()=>a.updating),(()=>this.notifyChange("updating")),o)],u),this.container.addChild(a.container),e.push(a)}this._graphicsViews=e,this._updateHighlight()}_addHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const e=this._highlightIds.get(i);this._highlightIds.set(i,e+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_removeHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const e=this._highlightIds.get(i)-1;0===e?this._highlightIds.delete(i):this._highlightIds.set(i,e)}this._updateHighlight()}_updateHighlight(){const e=Array.from(this._highlightIds.keys());for(const i of this.graphicsViews())i.setHighlight(e)}};m=e([p("esri.views.2d.layers.MapNotesLayerView2D")],m);const w=m;export{w as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import i from"../../../Graphic.js";import s from"../../../core/Collection.js";import{isSome as t,isNone as r}from"../../../core/maybe.js";import{watch as h,on as a,initial as o}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/Error.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{Container as p}from"../engine/Container.js";import{GroupContainer as c}from"../engine/webgl/GroupContainer.js";import{LayerView2DMixin as l}from"./LayerView2D.js";import g from"./graphics/GraphicContainer.js";import d from"./graphics/GraphicsView2D.js";import u from"../../layers/LayerView.js";const f="sublayers",m="layerView",w=Object.freeze({remove(){},pause(){},resume(){}});let y=class extends(l(u)){constructor(){super(...arguments),this._highlightIds=new Map,this.container=new c}async fetchPopupFeatures(e){return Array.from(this.graphicsViews(),(i=>i.hitTest(e).filter((e=>!!e.popupTemplate)))).flat()}*graphicsViews(){t(this._graphicsViewsFeatureCollectionMap)?yield*this._graphicsViewsFeatureCollectionMap.keys():t(this._graphicsViews)?yield*this._graphicsViews:yield*[]}async hitTest(e,i){return Array.from(this.graphicsViews(),(i=>{const s=i.hitTest(e);if(t(this._graphicsViewsFeatureCollectionMap)){const e=this._graphicsViewsFeatureCollectionMap.get(i);for(const i of s)!i.popupTemplate&&e.popupTemplate&&(i.popupTemplate=e.popupTemplate)}return s})).flat().map((i=>({type:"graphic",graphic:i,layer:this.layer,mapPoint:e})))}highlight(e){let t;return"number"==typeof e?t=[e]:e instanceof i?t=[e.uid]:Array.isArray(e)&&e.length>0?t="number"==typeof e[0]?e:e.map((e=>e&&e.uid)):s.isCollection(e)&&(t=e.map((e=>e&&e.uid)).toArray()),t=t.filter((e=>null!=e)),t.length?(this._addHighlight(t),{remove:()=>{this._removeHighlight(t)}}):w}update(e){for(const i of this.graphicsViews())i.processUpdate(e)}attach(){const e=this.view,i=()=>this.requestUpdate(),s=this.layer.featureCollections;if(t(s)&&s.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const t of s){const s=new g(this.view.featuresTilingScheme);s.fadeTransitionEnabled=!0;const r=new d({view:e,graphics:t.source,renderer:t.renderer,requestUpdateCallback:i,container:s});this._graphicsViewsFeatureCollectionMap.set(r,t),this.container.addChild(r.container),this.handles.add([h((()=>t.visible),(e=>r.container.visible=e),o),h((()=>r.updating),(()=>this.notifyChange("updating")),o)],m)}this._updateHighlight()}else t(this.layer.sublayers)&&this.handles.add(a((()=>this.layer.sublayers),"change",(()=>this._createGraphicsViews()),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),f)}detach(){this._destroyGraphicsViews(),this.handles.remove(f)}moveStart(){}moveEnd(){}viewChange(){for(const e of this.graphicsViews())e.viewChange()}isUpdating(){for(const e of this.graphicsViews())if(e.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.handles.remove(m);for(const e of this.graphicsViews())e.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),r(this.layer.sublayers))return;const e=[],i=this.view,s=()=>this.requestUpdate();for(const t of this.layer.sublayers){const r=new p,a=new g(this.view.featuresTilingScheme);a.fadeTransitionEnabled=!0;const n=new d({view:i,graphics:t.graphics,requestUpdateCallback:s,container:a});this.handles.add([t.on("graphic-update",n.graphicUpdateHandler),h((()=>t.visible),(e=>n.container.visible=e),o),h((()=>n.updating),(()=>this.notifyChange("updating")),o)],m),r.addChild(n.container),this.container.addChild(r),e.push(n)}this._graphicsViews=e,this._updateHighlight()}_addHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const e=this._highlightIds.get(i);this._highlightIds.set(i,e+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_removeHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const e=this._highlightIds.get(i)-1;0===e?this._highlightIds.delete(i):this._highlightIds.set(i,e)}this._updateHighlight()}_updateHighlight(){const e=Array.from(this._highlightIds.keys());for(const i of this.graphicsViews())i.setHighlight(e)}};y=e([n("esri.views.2d.layers.MapNotesLayerView2D")],y);const _=y;export{_ 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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import o from"../../../../Viewpoint.js";import i from"../../../../core/Accessor.js";import{when as s}from"../../../../core/reactiveUtils.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{s as m,i as a}from"../../../../chunks/vec2.js";import{a as r}from"../../../../chunks/vec2f64.js";import{getPaddingScreenTranslation as h,scaleAndRotateBy as u}from"../../viewpointUtils.js";import{RotationMomentumEstimator as p}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as c}from"../../../navigation/ZoomMomentumEstimator.js";import l from"../../../../geometry/Point.js";let _=class extends i{constructor(t){super(t),this._animationTime=0,this._momentumFinished=!1,this._rotationMomentumEstimator=new p(.6,.15,.95),this._rotationDirection=1,this._zoomDirection=1,this._zoomMomentumEstimator=new c,this._zoomOnly=null,this.zoomMomentum=null,this.rotateMomentum=null,this.viewpoint=new o({targetGeometry:new l,scale:0,rotation:0}),this.addHandles(s((()=>this._momentumFinished),(()=>this.navigation.stop())))}begin(t,o){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=o.angle,this._previousRadius=this._startRadius=o.radius,this._previousCenter=o.center,this._updateTimestamp=null,t.constraints.rotationEnabled&&this.addToRotateEstimator(0,o.timestamp),this.addToZoomEstimator(o,1)}update(t,o){null===this._updateTimestamp&&(this._updateTimestamp=o.timestamp);const i=o.angle,s=o.radius,e=o.center,n=Math.abs(180*(i-this._startAngle)/Math.PI),m=Math.abs(s-this._startRadius),a=this._startRadius/s;if(this._previousRadius){const r=s/this._previousRadius;let h=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=h>=0?1:-1,this._zoomDirection=r>=1?1:-1,t.constraints.rotationEnabled?(null===this._zoomOnly&&o.timestamp-this._updateTimestamp>200&&(this._zoomOnly=m-n>0),null===this._zoomOnly||this._zoomOnly?h=0:this.addToRotateEstimator(i-this._startAngle,o.timestamp)):h=0,this.addToZoomEstimator(o,a),this.navigation.setViewpoint([e.x,e.y],1/r,h,[this._previousCenter.x-e.x,e.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=s,this._previousCenter=e}end(t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(t),this.navigation.end()}addToRotateEstimator(t,o){this._rotationMomentumEstimator.add(t,.001*o)}addToZoomEstimator(t,o){this._zoomMomentumEstimator.add(o,.001*t.timestamp)}canZoomIn(t){const o=t.scale,i=t.constraints.effectiveMaxScale;return 0===i||o>i}canZoomOut(t){const o=t.scale,i=t.constraints.effectiveMinScale;return 0===i||o<i}onAnimationUpdate(t){this.navigation.animationManager.animateContinous(t.viewpoint,((o,i)=>{const s=!this.canZoomIn(t)&&this._zoomDirection>1||!this.canZoomOut(t)&&this._zoomDirection<1,e=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),n=s||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),p=.001*i;if(this._momentumFinished=e&&n,!this._momentumFinished){const i=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,p))*this._rotationDirection*180/Math.PI:0;let s=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,p)):1;const e=r(),n=r();if(this._previousCenter){m(e,this._previousCenter.x,this._previousCenter.y),h(n,t.size,t.padding),a(e,e,n);const{constraints:r,scale:p}=t,c=p*s;s<1&&!r.canZoomInTo(c)?(s=p/r.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):s>1&&!r.canZoomOutTo(c)&&(s=p/r.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),u(o,t.viewpoint,s,i,e,t.size),t.constraints.constrainByGeometry(o)}}this._animationTime+=p}))}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};t([e()],_.prototype,"_momentumFinished",void 0),t([e()],_.prototype,"viewpoint",void 0),t([e()],_.prototype,"navigation",void 0),_=t([n("esri.views.2d.navigation.actions.Pinch")],_);const d=_;export{d as default};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import o from"../../../../Viewpoint.js";import i from"../../../../core/Accessor.js";import{when as s}from"../../../../core/reactiveUtils.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{s as m,j as a}from"../../../../chunks/vec2.js";import{a as r}from"../../../../chunks/vec2f64.js";import{getPaddingScreenTranslation as h,scaleAndRotateBy as u}from"../../viewpointUtils.js";import{RotationMomentumEstimator as p}from"../../../navigation/RotationMomentumEstimator.js";import{ZoomMomentumEstimator as c}from"../../../navigation/ZoomMomentumEstimator.js";import l from"../../../../geometry/Point.js";let _=class extends i{constructor(t){super(t),this._animationTime=0,this._momentumFinished=!1,this._rotationMomentumEstimator=new p(.6,.15,.95),this._rotationDirection=1,this._zoomDirection=1,this._zoomMomentumEstimator=new c,this._zoomOnly=null,this.zoomMomentum=null,this.rotateMomentum=null,this.viewpoint=new o({targetGeometry:new l,scale:0,rotation:0}),this.addHandles(s((()=>this._momentumFinished),(()=>this.navigation.stop())))}begin(t,o){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=o.angle,this._previousRadius=this._startRadius=o.radius,this._previousCenter=o.center,this._updateTimestamp=null,t.constraints.rotationEnabled&&this.addToRotateEstimator(0,o.timestamp),this.addToZoomEstimator(o,1)}update(t,o){null===this._updateTimestamp&&(this._updateTimestamp=o.timestamp);const i=o.angle,s=o.radius,e=o.center,n=Math.abs(180*(i-this._startAngle)/Math.PI),m=Math.abs(s-this._startRadius),a=this._startRadius/s;if(this._previousRadius){const r=s/this._previousRadius;let h=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=h>=0?1:-1,this._zoomDirection=r>=1?1:-1,t.constraints.rotationEnabled?(null===this._zoomOnly&&o.timestamp-this._updateTimestamp>200&&(this._zoomOnly=m-n>0),null===this._zoomOnly||this._zoomOnly?h=0:this.addToRotateEstimator(i-this._startAngle,o.timestamp)):h=0,this.addToZoomEstimator(o,a),this.navigation.setViewpoint([e.x,e.y],1/r,h,[this._previousCenter.x-e.x,e.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=s,this._previousCenter=e}end(t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(t),this.navigation.end()}addToRotateEstimator(t,o){this._rotationMomentumEstimator.add(t,.001*o)}addToZoomEstimator(t,o){this._zoomMomentumEstimator.add(o,.001*t.timestamp)}canZoomIn(t){const o=t.scale,i=t.constraints.effectiveMaxScale;return 0===i||o>i}canZoomOut(t){const o=t.scale,i=t.constraints.effectiveMinScale;return 0===i||o<i}onAnimationUpdate(t){this.navigation.animationManager.animateContinous(t.viewpoint,((o,i)=>{const s=!this.canZoomIn(t)&&this._zoomDirection>1||!this.canZoomOut(t)&&this._zoomDirection<1,e=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),n=s||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),p=.001*i;if(this._momentumFinished=e&&n,!this._momentumFinished){const i=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,p))*this._rotationDirection*180/Math.PI:0;let s=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,p)):1;const e=r(),n=r();if(this._previousCenter){m(e,this._previousCenter.x,this._previousCenter.y),h(n,t.size,t.padding),a(e,e,n);const{constraints:r,scale:p}=t,c=p*s;s<1&&!r.canZoomInTo(c)?(s=p/r.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):s>1&&!r.canZoomOutTo(c)&&(s=p/r.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),u(o,t.viewpoint,s,i,e,t.size),t.constraints.constrainByGeometry(o)}}this._animationTime+=p}))}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};t([e()],_.prototype,"_momentumFinished",void 0),t([e()],_.prototype,"viewpoint",void 0),t([e()],_.prototype,"navigation",void 0),_=t([n("esri.views.2d.navigation.actions.Pinch")],_);const d=_;export{d 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.25/esri/copyright.txt for details.
4
4
  */
5
- import{j as e}from"../../../chunks/vec2.js";class t{constructor(e,t,i){this.maxSize=e,this._tileInfoView=t,this._removedFunc=i,this._tilePerId=new Map,this._tileKeysPerLevel=[]}has(e){return this._tilePerId.has(e)}get(e){return this._tilePerId.get(e)}pop(e){const t=this._tilePerId.get(e);if(!t)return null;const s=t.key.level,r=this._tileKeysPerLevel[s];i(this._tilePerId,e);for(let i=0;i<r.length;i++)if(r[i].id===e){r.splice(i,1);break}return t.visible=!0,t}add(e){e.visible=!1;const t=e.key,i=t.id;if(this._tilePerId.has(i))return;this._tilePerId.set(i,e);const s=t.level;this._tileKeysPerLevel[s]||(this._tileKeysPerLevel[s]=[]),this._tileKeysPerLevel[s].push(t)}prune(e,t,i){let s=this._tilePerId.size;if(s<=this.maxSize)return;let r=this._tileKeysPerLevel.length-1;for(;s>this.maxSize&&r>=0;)r!==e&&(s=this._pruneAroundCenterTile(s,t,i,r)),r--;s>this.maxSize&&(s=this._pruneAroundCenterTile(s,t,i,e))}_pruneAroundCenterTile(t,i,s,r){const l=this._tileKeysPerLevel[r];if(!l||0===l.length)return t;const{size:n,origin:h}=this._tileInfoView.tileInfo,o=s*n[0],_=s*n[1],u=[0,0],d=[0,0];for(l.sort(((t,s)=>(u[0]=h.x+o*(t.col+.5),u[1]=h.y-_*(t.row+.5),d[0]=h.x+o*(s.col+.5),d[1]=h.y-_*(s.row+.5),e(u,i)-e(d,i))));l.length>0;){const e=l.pop();if(this._removeTile(e.id),--t===this.maxSize)break}return t}_removeTile(e){const t=this._tilePerId.get(e);this._removedFunc&&this._removedFunc(t),i(this._tilePerId,e)}}function i(e,t){e.delete(t)}export{t as default};
5
+ import{k as e}from"../../../chunks/vec2.js";class t{constructor(e,t,i){this.maxSize=e,this._tileInfoView=t,this._removedFunc=i,this._tilePerId=new Map,this._tileKeysPerLevel=[]}has(e){return this._tilePerId.has(e)}get(e){return this._tilePerId.get(e)}pop(e){const t=this._tilePerId.get(e);if(!t)return null;const s=t.key.level,r=this._tileKeysPerLevel[s];i(this._tilePerId,e);for(let i=0;i<r.length;i++)if(r[i].id===e){r.splice(i,1);break}return t.visible=!0,t}add(e){e.visible=!1;const t=e.key,i=t.id;if(this._tilePerId.has(i))return;this._tilePerId.set(i,e);const s=t.level;this._tileKeysPerLevel[s]||(this._tileKeysPerLevel[s]=[]),this._tileKeysPerLevel[s].push(t)}prune(e,t,i){let s=this._tilePerId.size;if(s<=this.maxSize)return;let r=this._tileKeysPerLevel.length-1;for(;s>this.maxSize&&r>=0;)r!==e&&(s=this._pruneAroundCenterTile(s,t,i,r)),r--;s>this.maxSize&&(s=this._pruneAroundCenterTile(s,t,i,e))}_pruneAroundCenterTile(t,i,s,r){const l=this._tileKeysPerLevel[r];if(!l||0===l.length)return t;const{size:n,origin:h}=this._tileInfoView.tileInfo,o=s*n[0],_=s*n[1],u=[0,0],d=[0,0];for(l.sort(((t,s)=>(u[0]=h.x+o*(t.col+.5),u[1]=h.y-_*(t.row+.5),d[0]=h.x+o*(s.col+.5),d[1]=h.y-_*(s.row+.5),e(u,i)-e(d,i))));l.length>0;){const e=l.pop();if(this._removeTile(e.id),--t===this.maxSize)break}return t}_removeTile(e){const t=this._tilePerId.get(e);this._removedFunc&&this._removedFunc(t),i(this._tilePerId,e)}}function i(e,t){e.delete(t)}export{t 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.25/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../Viewpoint.js";import e from"../../core/Collection.js";import{isSome as n,get as r,isNone as o}from"../../core/maybe.js";import{getMetersPerUnitForSR as a}from"../../core/unitUtils.js";import{t as i}from"../../chunks/common.js";import{f as c,r as s,t as u,a as f,s as l,b as m,c as y}from"../../chunks/mat2d.js";import{c as p}from"../../chunks/mat2df64.js";import{b as g,s as x,c as h,e as b,n as w,a as d,f as j,g as G,h as R,l as A,t as k,i as S}from"../../chunks/vec2.js";import{f as v,a as M}from"../../chunks/vec2f64.js";import F from"../../geometry/Extent.js";import N from"../../geometry/Geometry.js";import z from"../../geometry/Point.js";import{isLoaded as I,canProjectWithoutEngine as V,load as q,project as L}from"../../geometry/projection.js";import P from"../../geometry/SpatialReference.js";import{isValid as C,equals as E,getInfo as O}from"../../geometry/support/spatialReferenceUtils.js";const Q=96,U=39.37,B=180/Math.PI;function D(t){return t.wkid?t:t.spatialReference||P.WGS84}function T(t,e){return e.type?x(t,e.x,e.y):h(t,e)}function W(t){return a(t)}function H(t,e){const n=Math.max(1,e[0]),r=Math.max(1,e[1]);return Math.max(t.width/n,t.height/r)*ct(t.spatialReference)}async function J(t,a,i,c){let s,u;if(!t)return null;if(Array.isArray(t)&&!t.length)return null;if(e.isCollection(t)&&(t=t.toArray()),Array.isArray(t)&&t.length&&"object"==typeof t[0]){const e=t.every((t=>"attributes"in t)),r=t.some((t=>!t.geometry));let o=t;if(e&&r&&a&&a.allLayerViews){const e=new Map;for(const n of t){const t=n.layer,r=e.get(t)||[],o=n.attributes[t.objectIdField];null!=o&&r.push(o),e.set(t,r)}const r=[];e.forEach(((t,e)=>{const n=a.allLayerViews.find((t=>t.layer.id===e.id));if("queryFeatures"in n){const o=e.createQuery();o.objectIds=t,o.returnGeometry=!0,r.push(n.queryFeatures(o))}}));const i=await Promise.all(r),c=[];for(const t of i)if(t&&t.features&&t.features.length)for(const e of t.features)n(e.geometry)&&c.push(e.geometry);o=c}for(const t of o)c=await J(t,a,i,c);return c}if(Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])s=new z(t);else if(t instanceof N)s=t;else if("geometry"in t)if(t.geometry)s=t.geometry;else if(t.layer){const e=t.layer,n=a.allLayerViews.find((t=>t.layer.id===e.id));if("queryFeatures"in n){const o=e.createQuery();o.objectIds=[t.attributes[e.objectIdField]],o.returnGeometry=!0;const a=await n.queryFeatures(o);s=r(a,"features",0,"geometry")}}if(o(s))return null;if(u="point"===s.type?new F({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference}):s.extent,!u)return null;I()||V(u.spatialReference,i)||await q();const f=L(u,i);return f?c=c?c.union(f):f:null}function K(t){if(t&&(!Array.isArray(t)||"number"!=typeof t[0])&&("object"==typeof t||Array.isArray(t)&&"object"==typeof t[0])){if("layer"in t&&t.layer&&t.layer.minScale&&t.layer.maxScale){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every((t=>"layer"in t))){let e=0,n=0;for(const r of t){const t=r.layer;t&&t.minScale&&t.maxScale&&(e=t.minScale<e?t.minScale:e,n=t.maxScale>n?t.maxScale:n)}return e&&n?{min:e,max:n}:null}}}function X(t,e){return E(D(t),e)?t:L(t,e)}async function Y(e,r){if(!e||!r)return new t({targetGeometry:new z,scale:0,rotation:0});let o=r.spatialReference;const{constraints:a,padding:i,viewpoint:c,size:s}=r,u=[i?s[0]-i.left-i.right:s[0],i?s[1]-i.top-i.bottom:s[1]];let f=null;e instanceof t?f=e:e.viewpoint?f=e.viewpoint:e.target&&"esri.Viewpoint"===e.target.declaredClass&&(f=e.target);let l=null;f&&f.targetGeometry?l=f.targetGeometry:e instanceof F?l=e:(e||e&&("center"in e||"extent"in e||"target"in e))&&(l=await J(e.center,r,o)||await J(e.extent,r,o)||await J(e.target,r,o)||await J(e,r,o)),!l&&c&&c.targetGeometry?l=c.targetGeometry:!l&&r.extent&&(l=r.extent),o||(o=D(r.spatialReference||r.extent||l)),I()||E(l.spatialReference,o)||V(l,o)||await q();const m=X(l.center?l.center:l,o);let y=null;if(f&&n(f.targetGeometry)&&"point"===f.targetGeometry.type)y=f.scale;else if("scale"in e&&e.scale)y=e.scale;else if("zoom"in e&&-1!==e.zoom&&a&&a.effectiveLODs)y=a.zoomToScale(e.zoom);else if(Array.isArray(l)||"point"===l.type||"extent"===l.type&&0===l.width&&0===l.height){const t=X(r.extent,o);y=n(t)?H(t,u):r.extent?H(r.extent,u):c.scale}else y=H(X(l.extent,o),u);const p=K(e);p&&(p.min&&p.min>y?y=p.min:p.max&&p.max<y&&(y=p.max));let g=0;f?g=f.rotation:e.hasOwnProperty("rotation")?g=e.rotation:c&&(g=c.rotation);let x=new t({targetGeometry:m,scale:y,rotation:g});return a&&(x=a.fit(x),a.constrainByGeometry(x),a.rotationEnabled||(x.rotation=g)),x}function Z(t,e){const n=t.targetGeometry,r=e.targetGeometry;return n.x=r.x,n.y=r.y,n.spatialReference=r.spatialReference,t.scale=e.scale,t.rotation=e.rotation,t}function $(t,e,n){return n?x(t,.5*(e[0]-n.right+n.left),.5*(e[1]-n.bottom+n.top)):g(t,e,.5)}const _=function(){const t=M();return function(e,n,r){const o=n.targetGeometry;T(t,o);const a=.5*ot(n);return e.xmin=t[0]-a*r[0],e.ymin=t[1]-a*r[1],e.xmax=t[0]+a*r[0],e.ymax=t[1]+a*r[1],e.spatialReference=o.spatialReference,e}}();function tt(t,e,n,r,o){return xt(t,e,n.center),t.scale=H(n,r),o&&o.constraints&&o.constraints.constrain(t),t}function et(t,e,n,r){return ft(t,e,n,r),m(t,t)}const nt=function(){const t=M();return function(e,n,r){return b(e,st(e,n),$(t,n,r))}}(),rt=function(){const t=p(),e=M();return function(n,r,o,a){const i=ot(r),f=it(r);return x(e,i,i),c(t,e),s(t,t,f),u(t,t,nt(e,o,a)),u(t,t,[0,a.top-a.bottom]),x(n,t[4],t[5])}}();function ot(t){return t.scale*at(t.targetGeometry)}function at(t){return n(t)&&C(t.spatialReference)?1/(W(t.spatialReference)*U*Q):1}function it(t){return i(t.rotation)||0}function ct(t){return C(t)?W(t)*U*Q:1}function st(t,e){return g(t,e,.5)}const ut=function(){const t=M(),e=M(),n=M();return function(r,o,a,i,c,m){return w(t,o),g(e,a,.5*m),x(n,1/i*m,-1/i*m),f(r,e),c&&s(r,r,c),l(r,r,n),u(r,r,t),r}}(),ft=function(){const t=M();return function(e,n,r,o){const a=ot(n),i=it(n);return T(t,n.targetGeometry),ut(e,t,r,a,i,o)}}(),lt=function(){const t=M();return function(e,n,r,o){const a=ot(n);return T(t,n.targetGeometry),ut(e,t,r,a,0,o)}}();function mt(t){const e=O(t);return e?e.valid[1]-e.valid[0]:0}function yt(t,e){return Math.round(mt(t)/e)}const pt=function(){const t=M(),e=M(),n=[0,0,0];return function(r,o,a){d(t,r,o),j(t,t),d(e,r,a),j(e,e),G(n,t,e);let i=Math.acos(R(t,e)/(A(t)*A(e)))*B;return n[2]<0&&(i=-i),isNaN(i)&&(i=0),i}}(),gt=function(){const t=M();return function(e,n,r,o){const a=e.targetGeometry;return Z(e,n),rt(t,n,r,o),a.x+=t[0],a.y+=t[1],e}}(),xt=function(t,e,n){Z(t,e);const r=t.targetGeometry;return r.x=n.x,r.y=n.y,r.spatialReference=n.spatialReference,t},ht=function(){const t=M();return function(e,n,r,o,a){a||(a="center"),b(t,r,o),g(t,t,.5);const i=t[0],c=t[1];switch(a){case"center":x(t,0,0);break;case"left":x(t,-i,0);break;case"top":x(t,0,c);break;case"right":x(t,i,0);break;case"bottom":x(t,0,-c);break;case"top-left":x(t,-i,c);break;case"bottom-left":x(t,-i,-c);break;case"top-right":x(t,i,c);break;case"bottom-right":x(t,i,-c)}return St(e,n,t),e}}();function bt(t,e,n){return Z(t,e),t.rotation+=n,t}function wt(t,e,n){return Z(t,e),t.rotation=n,t}const dt=function(){const t=M();return function(e,n,r,o,a){return Z(e,n),isNaN(r)||0===r||(At(t,o,n,a),e.scale=n.scale*r,kt(t,t,e,a),St(e,e,x(t,t[0]-o[0],o[1]-t[1]))),e}}();function jt(t,e,n){return Z(t,e),t.scale=n,t}const Gt=function(){const t=M();return function(e,n,r,o,a,i){return Z(e,n),isNaN(r)||0===r||(At(t,a,n,i),e.scale=n.scale*r,e.rotation+=o,kt(t,t,e,i),St(e,e,x(t,t[0]-a[0],a[1]-t[1]))),e}}(),Rt=function(){const t=M(),e=M();return function(n,r,o,a,i,c,s){return nt(e,c,s),S(t,i,e),a?Gt(n,r,o,a,t,c):dt(n,r,o,t,c)}}(),At=function(){const t=p();return function(e,n,r,o){return k(e,n,et(t,r,o,1))}}(),kt=function(){const t=p();return function(e,n,r,o){return k(e,n,ft(t,r,o,1))}}(),St=function(){const t=M(),e=p();return function(n,r,o){Z(n,r);const a=ot(r),i=n.targetGeometry;return y(e,it(r)),l(e,e,v(a,a)),k(t,o,e),i.x+=t[0],i.y+=t[1],n}}();export{gt as addPadding,pt as angleBetween,xt as centerAt,Z as copy,Y as create,H as extentToScale,$ as getAnchor,_ as getExtent,ut as getMatrix,rt as getPaddingMapTranslation,nt as getPaddingScreenTranslation,ot as getResolution,ct as getResolutionToScaleFactor,ft as getTransform,lt as getTransformNoRotation,yt as getWorldScreenWidth,mt as getWorldWidth,Rt as padAndScaleAndRotateBy,ht as resize,bt as rotateBy,wt as rotateTo,Gt as scaleAndRotateBy,jt as scaleTo,tt as setExtent,At as toMap,kt as toScreen,St as translateBy};
5
+ import t from"../../Viewpoint.js";import e from"../../core/Collection.js";import{isSome as n,get as r,isNone as o}from"../../core/maybe.js";import{getMetersPerUnitForSR as a}from"../../core/unitUtils.js";import{t as i}from"../../chunks/common.js";import{f as c,r as s,t as u,a as f,s as l,b as m,c as y}from"../../chunks/mat2d.js";import{c as p}from"../../chunks/mat2df64.js";import{b as g,s as x,c as h,e as b,n as w,a as d,f as j,g as G,h as R,i as A,t as k,j as S}from"../../chunks/vec2.js";import{f as v,a as M}from"../../chunks/vec2f64.js";import F from"../../geometry/Extent.js";import N from"../../geometry/Geometry.js";import z from"../../geometry/Point.js";import{isLoaded as I,canProjectWithoutEngine as V,load as q,project as L}from"../../geometry/projection.js";import P from"../../geometry/SpatialReference.js";import{isValid as C,equals as E,getInfo as O}from"../../geometry/support/spatialReferenceUtils.js";const Q=96,U=39.37,B=180/Math.PI;function D(t){return t.wkid?t:t.spatialReference||P.WGS84}function T(t,e){return e.type?x(t,e.x,e.y):h(t,e)}function W(t){return a(t)}function H(t,e){const n=Math.max(1,e[0]),r=Math.max(1,e[1]);return Math.max(t.width/n,t.height/r)*ct(t.spatialReference)}async function J(t,a,i,c){let s,u;if(!t)return null;if(Array.isArray(t)&&!t.length)return null;if(e.isCollection(t)&&(t=t.toArray()),Array.isArray(t)&&t.length&&"object"==typeof t[0]){const e=t.every((t=>"attributes"in t)),r=t.some((t=>!t.geometry));let o=t;if(e&&r&&a&&a.allLayerViews){const e=new Map;for(const n of t){const t=n.layer,r=e.get(t)||[],o=n.attributes[t.objectIdField];null!=o&&r.push(o),e.set(t,r)}const r=[];e.forEach(((t,e)=>{const n=a.allLayerViews.find((t=>t.layer.id===e.id));if("queryFeatures"in n){const o=e.createQuery();o.objectIds=t,o.returnGeometry=!0,r.push(n.queryFeatures(o))}}));const i=await Promise.all(r),c=[];for(const t of i)if(t&&t.features&&t.features.length)for(const e of t.features)n(e.geometry)&&c.push(e.geometry);o=c}for(const t of o)c=await J(t,a,i,c);return c}if(Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])s=new z(t);else if(t instanceof N)s=t;else if("geometry"in t)if(t.geometry)s=t.geometry;else if(t.layer){const e=t.layer,n=a.allLayerViews.find((t=>t.layer.id===e.id));if("queryFeatures"in n){const o=e.createQuery();o.objectIds=[t.attributes[e.objectIdField]],o.returnGeometry=!0;const a=await n.queryFeatures(o);s=r(a,"features",0,"geometry")}}if(o(s))return null;if(u="point"===s.type?new F({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference}):s.extent,!u)return null;I()||V(u.spatialReference,i)||await q();const f=L(u,i);return f?c=c?c.union(f):f:null}function K(t){if(t&&(!Array.isArray(t)||"number"!=typeof t[0])&&("object"==typeof t||Array.isArray(t)&&"object"==typeof t[0])){if("layer"in t&&t.layer&&t.layer.minScale&&t.layer.maxScale){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every((t=>"layer"in t))){let e=0,n=0;for(const r of t){const t=r.layer;t&&t.minScale&&t.maxScale&&(e=t.minScale<e?t.minScale:e,n=t.maxScale>n?t.maxScale:n)}return e&&n?{min:e,max:n}:null}}}function X(t,e){return E(D(t),e)?t:L(t,e)}async function Y(e,r){if(!e||!r)return new t({targetGeometry:new z,scale:0,rotation:0});let o=r.spatialReference;const{constraints:a,padding:i,viewpoint:c,size:s}=r,u=[i?s[0]-i.left-i.right:s[0],i?s[1]-i.top-i.bottom:s[1]];let f=null;e instanceof t?f=e:e.viewpoint?f=e.viewpoint:e.target&&"esri.Viewpoint"===e.target.declaredClass&&(f=e.target);let l=null;f&&f.targetGeometry?l=f.targetGeometry:e instanceof F?l=e:(e||e&&("center"in e||"extent"in e||"target"in e))&&(l=await J(e.center,r,o)||await J(e.extent,r,o)||await J(e.target,r,o)||await J(e,r,o)),!l&&c&&c.targetGeometry?l=c.targetGeometry:!l&&r.extent&&(l=r.extent),o||(o=D(r.spatialReference||r.extent||l)),I()||E(l.spatialReference,o)||V(l,o)||await q();const m=X(l.center?l.center:l,o);let y=null;if(f&&n(f.targetGeometry)&&"point"===f.targetGeometry.type)y=f.scale;else if("scale"in e&&e.scale)y=e.scale;else if("zoom"in e&&-1!==e.zoom&&a&&a.effectiveLODs)y=a.zoomToScale(e.zoom);else if(Array.isArray(l)||"point"===l.type||"extent"===l.type&&0===l.width&&0===l.height){const t=X(r.extent,o);y=n(t)?H(t,u):r.extent?H(r.extent,u):c.scale}else y=H(X(l.extent,o),u);const p=K(e);p&&(p.min&&p.min>y?y=p.min:p.max&&p.max<y&&(y=p.max));let g=0;f?g=f.rotation:e.hasOwnProperty("rotation")?g=e.rotation:c&&(g=c.rotation);let x=new t({targetGeometry:m,scale:y,rotation:g});return a&&(x=a.fit(x),a.constrainByGeometry(x),a.rotationEnabled||(x.rotation=g)),x}function Z(t,e){const n=t.targetGeometry,r=e.targetGeometry;return n.x=r.x,n.y=r.y,n.spatialReference=r.spatialReference,t.scale=e.scale,t.rotation=e.rotation,t}function $(t,e,n){return n?x(t,.5*(e[0]-n.right+n.left),.5*(e[1]-n.bottom+n.top)):g(t,e,.5)}const _=function(){const t=M();return function(e,n,r){const o=n.targetGeometry;T(t,o);const a=.5*ot(n);return e.xmin=t[0]-a*r[0],e.ymin=t[1]-a*r[1],e.xmax=t[0]+a*r[0],e.ymax=t[1]+a*r[1],e.spatialReference=o.spatialReference,e}}();function tt(t,e,n,r,o){return xt(t,e,n.center),t.scale=H(n,r),o&&o.constraints&&o.constraints.constrain(t),t}function et(t,e,n,r){return ft(t,e,n,r),m(t,t)}const nt=function(){const t=M();return function(e,n,r){return b(e,st(e,n),$(t,n,r))}}(),rt=function(){const t=p(),e=M();return function(n,r,o,a){const i=ot(r),f=it(r);return x(e,i,i),c(t,e),s(t,t,f),u(t,t,nt(e,o,a)),u(t,t,[0,a.top-a.bottom]),x(n,t[4],t[5])}}();function ot(t){return t.scale*at(t.targetGeometry)}function at(t){return n(t)&&C(t.spatialReference)?1/(W(t.spatialReference)*U*Q):1}function it(t){return i(t.rotation)||0}function ct(t){return C(t)?W(t)*U*Q:1}function st(t,e){return g(t,e,.5)}const ut=function(){const t=M(),e=M(),n=M();return function(r,o,a,i,c,m){return w(t,o),g(e,a,.5*m),x(n,1/i*m,-1/i*m),f(r,e),c&&s(r,r,c),l(r,r,n),u(r,r,t),r}}(),ft=function(){const t=M();return function(e,n,r,o){const a=ot(n),i=it(n);return T(t,n.targetGeometry),ut(e,t,r,a,i,o)}}(),lt=function(){const t=M();return function(e,n,r,o){const a=ot(n);return T(t,n.targetGeometry),ut(e,t,r,a,0,o)}}();function mt(t){const e=O(t);return e?e.valid[1]-e.valid[0]:0}function yt(t,e){return Math.round(mt(t)/e)}const pt=function(){const t=M(),e=M(),n=[0,0,0];return function(r,o,a){d(t,r,o),j(t,t),d(e,r,a),j(e,e),G(n,t,e);let i=Math.acos(R(t,e)/(A(t)*A(e)))*B;return n[2]<0&&(i=-i),isNaN(i)&&(i=0),i}}(),gt=function(){const t=M();return function(e,n,r,o){const a=e.targetGeometry;return Z(e,n),rt(t,n,r,o),a.x+=t[0],a.y+=t[1],e}}(),xt=function(t,e,n){Z(t,e);const r=t.targetGeometry;return r.x=n.x,r.y=n.y,r.spatialReference=n.spatialReference,t},ht=function(){const t=M();return function(e,n,r,o,a){a||(a="center"),b(t,r,o),g(t,t,.5);const i=t[0],c=t[1];switch(a){case"center":x(t,0,0);break;case"left":x(t,-i,0);break;case"top":x(t,0,c);break;case"right":x(t,i,0);break;case"bottom":x(t,0,-c);break;case"top-left":x(t,-i,c);break;case"bottom-left":x(t,-i,-c);break;case"top-right":x(t,i,c);break;case"bottom-right":x(t,i,-c)}return St(e,n,t),e}}();function bt(t,e,n){return Z(t,e),t.rotation+=n,t}function wt(t,e,n){return Z(t,e),t.rotation=n,t}const dt=function(){const t=M();return function(e,n,r,o,a){return Z(e,n),isNaN(r)||0===r||(At(t,o,n,a),e.scale=n.scale*r,kt(t,t,e,a),St(e,e,x(t,t[0]-o[0],o[1]-t[1]))),e}}();function jt(t,e,n){return Z(t,e),t.scale=n,t}const Gt=function(){const t=M();return function(e,n,r,o,a,i){return Z(e,n),isNaN(r)||0===r||(At(t,a,n,i),e.scale=n.scale*r,e.rotation+=o,kt(t,t,e,i),St(e,e,x(t,t[0]-a[0],a[1]-t[1]))),e}}(),Rt=function(){const t=M(),e=M();return function(n,r,o,a,i,c,s){return nt(e,c,s),S(t,i,e),a?Gt(n,r,o,a,t,c):dt(n,r,o,t,c)}}(),At=function(){const t=p();return function(e,n,r,o){return k(e,n,et(t,r,o,1))}}(),kt=function(){const t=p();return function(e,n,r,o){return k(e,n,ft(t,r,o,1))}}(),St=function(){const t=M(),e=p();return function(n,r,o){Z(n,r);const a=ot(r),i=n.targetGeometry;return y(e,it(r)),l(e,e,v(a,a)),k(t,o,e),i.x+=t[0],i.y+=t[1],n}}();export{gt as addPadding,pt as angleBetween,xt as centerAt,Z as copy,Y as create,H as extentToScale,$ as getAnchor,_ as getExtent,ut as getMatrix,rt as getPaddingMapTranslation,nt as getPaddingScreenTranslation,ot as getResolution,ct as getResolutionToScaleFactor,ft as getTransform,lt as getTransformNoRotation,yt as getWorldScreenWidth,mt as getWorldWidth,Rt as padAndScaleAndRotateBy,ht as resize,bt as rotateBy,wt as rotateTo,Gt as scaleAndRotateBy,jt as scaleTo,tt as setExtent,At as toMap,kt as toScreen,St as translateBy};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{a as e}from"../../../chunks/vec2f64.js";import{c as r}from"../../../chunks/vec4f64.js";import{C as i}from"../../../chunks/ChapmanAtmosphere.glsl.js";import{NoParameters as t}from"../webgl-engine/core/shaderModules/interfaces.js";import{ReloadableShaderModule as s}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as n}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{Default3D as o}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as a}from"../webgl-engine/lib/Program.js";import{BlendFactor as h,CompareFunction as l}from"../../webgl/enums.js";import{makePipelineState as m,separateBlendingParams as c,defaultColorWriteParams as g}from"../../webgl/renderState.js";class d extends t{constructor(){super(...arguments),this.heightParameters=r(),this.radii=e(),this.innerFadeDistance=0,this.altitudeFade=0,this.hazeStrength=1}}class u extends n{initializeProgram(e){const r=u.shader.get().build(this.configuration);return new a(e.rctx,r,o)}initializePipeline(){return this.configuration.haze?m({blending:c(h.ONE,h.ZERO,h.ONE_MINUS_SRC_COLOR,h.ONE),colorWrite:g}):m({blending:c(h.SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA,h.ONE_MINUS_SRC_ALPHA),depthTest:{func:l.LEQUAL},colorWrite:g})}}u.shader=new s(i,(()=>import("./ChapmanAtmosphere.glsl.js")));export{d as ChapmanAtmospherePassParameters,u as ChapmanAtmosphereTechnique};
5
+ import{a as e}from"../../../chunks/vec2f64.js";import{c as r}from"../../../chunks/vec4f64.js";import{C as i}from"../../../chunks/ChapmanAtmosphere.glsl.js";import{NoParameters as t}from"../webgl-engine/core/shaderModules/interfaces.js";import{ReloadableShaderModule as s}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as n}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{Default3D as o}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as a}from"../webgl-engine/lib/Program.js";import{BlendFactor as h,CompareFunction as l}from"../../webgl/enums.js";import{makePipelineState as m,separateBlendingParams as c,defaultColorWriteParams as g}from"../../webgl/renderState.js";class d extends t{constructor(){super(...arguments),this.heightParameters=r(),this.radii=e(),this.innerFadeDistance=0,this.altitudeFade=0,this.hazeStrength=1}}class u extends n{initializeProgram(e){return new a(e.rctx,u.shader.get().build(this.configuration),o)}initializePipeline(){return this.configuration.haze?m({blending:c(h.ONE,h.ZERO,h.ONE_MINUS_SRC_COLOR,h.ONE),colorWrite:g}):m({blending:c(h.SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA,h.ONE_MINUS_SRC_ALPHA),depthTest:{func:l.LEQUAL},colorWrite:g})}}u.shader=new s(i,(()=>import("./ChapmanAtmosphere.glsl.js")));export{d as ChapmanAtmospherePassParameters,u as ChapmanAtmosphereTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{C as e}from"../../../chunks/CloudsComposition.glsl.js";import{ReloadableShaderModule as r}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{Default3D as i}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as t}from"../webgl-engine/lib/Program.js";import{BlendFactor as n,CompareFunction as s}from"../../webgl/enums.js";import{makePipelineState as l,simpleBlendingParams as m,defaultColorWriteParams as a}from"../../webgl/renderState.js";class u extends o{constructor(e){super(e,null,(()=>this.destroy()))}initializeProgram(e){const r=u.shader.get().build();return new t(e.rctx,r,i)}initializePipeline(){return l({blending:m(n.ONE,n.SRC_ALPHA),depthTest:{func:s.LEQUAL},colorWrite:a})}}u.shader=new r(e,(()=>import("./CloudsComposition.glsl.js")));export{u as CloudsCompositionTechnique};
5
+ import{C as e}from"../../../chunks/CloudsComposition.glsl.js";import{ReloadableShaderModule as r}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{ShaderTechniqueConfiguration as o}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Default3D as n}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as t}from"../webgl-engine/lib/Program.js";import{BlendFactor as s,CompareFunction as l}from"../../webgl/enums.js";import{makePipelineState as m,simpleBlendingParams as a,defaultColorWriteParams as g}from"../../webgl/renderState.js";class u extends i{constructor(e){super(e,new o,(()=>this.destroy()))}initializeProgram(e){return new t(e.rctx,u.shader.get().build(),n)}initializePipeline(){return m({blending:a(s.ONE,s.SRC_ALPHA),depthTest:{func:l.LEQUAL},colorWrite:g})}}u.shader=new r(e,(()=>import("./CloudsComposition.glsl.js")));export{u as CloudsCompositionTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{b as e}from"../../../chunks/Clouds.glsl.js";import{ReloadableShaderModule as r}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{Default3D as o}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as t}from"../webgl-engine/lib/Program.js";import{BlendFactor as n,CompareFunction as s}from"../../webgl/enums.js";import{makePipelineState as l,separateBlendingParams as a,defaultColorWriteParams as m}from"../../webgl/renderState.js";class g extends i{constructor(e,r){super(e,r,(()=>this.destroy()))}initializeProgram(e){const r=g.shader.get().build(this.configuration);return new t(e.rctx,r,o)}initializePipeline(){return l({blending:a(n.ONE,n.ONE,n.ZERO,n.ZERO),depthTest:{func:s.LEQUAL},colorWrite:m})}}g.shader=new r(e,(()=>import("./Clouds.glsl.js")));export{g as CloudsTechnique};
5
+ import{b as e}from"../../../chunks/Clouds.glsl.js";import{ReloadableShaderModule as r}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{Default3D as o}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as t}from"../webgl-engine/lib/Program.js";import{BlendFactor as n,CompareFunction as s}from"../../webgl/enums.js";import{makePipelineState as l,separateBlendingParams as a,defaultColorWriteParams as m}from"../../webgl/renderState.js";class g extends i{constructor(e,r){super(e,r,(()=>this.destroy()))}initializeProgram(e){return new t(e.rctx,g.shader.get().build(this.configuration),o)}initializePipeline(){return l({blending:a(n.ONE,n.ONE,n.ZERO,n.ZERO),depthTest:{func:s.LEQUAL},colorWrite:m})}}g.shader=new r(e,(()=>import("./Clouds.glsl.js")));export{g as CloudsTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import s from"../../../core/Handles.js";import{lerp as i}from"../../../core/mathUtils.js";import{destroyMaybe as r,isSome as n,isNone as o}from"../../../core/maybe.js";import{when as h,syncAndInitial as a,watch as p,initial as d}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{l as m}from"../../../chunks/vec3.js";import{getReferenceEllipsoid as c}from"../../../geometry/projectionEllipsoid.js";import{isMoon as u,isEarth as g}from"../../../geometry/support/spatialReferenceUtils.js";import{ChapmanAtmosphere as w}from"./ChapmanAtmosphere.js";import{CloudsComposition as y}from"./CloudsComposition.js";import{isReadyCloudsData as v}from"./CloudsData.js";import{CloudsGenerator as f}from"./CloudsGenerator.js";import{cloudPresets as A}from"./CloudsPresets.js";import{Fog as R}from"./Fog.js";import{PanoramicAtmosphere as b}from"./PanoramicAtmosphere.js";import{Precipitation as E}from"./Precipitation.js";import N from"./SimpleAtmosphere.js";import{Stars as j}from"./Stars.js";import{weatherHeightLimit as T}from"./weather.js";import{RenderPass as x}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as C}from"../webgl-engine/lib/RenderSlot.js";var P;const O=[C.POSTPROCESSING_ENVIRONMENT_OPAQUE,C.POSTPROCESSING_ENVIRONMENT_TRANSPARENT];let S,M=P=class extends t{constructor(e){super(e),this._handles=new s,this._context=null,this._pendingAtmosphere=null,this._atmosphere=null}initialize(){this.view._stage.addRenderPlugin(O,this)}destroy(){this._pendingAtmosphere=r(this._pendingAtmosphere),null!=this.view?._stage&&this.view._stage.removeRenderPlugin(this),this._handles=r(this._handles),this._set("view",null)}get atmosphereType(){return n(this._pendingAtmosphere)?this._pendingAtmosphere.type:n(this._atmosphere)?this._atmosphere.type:"none"}get canRender(){return!!this.view.basemapTerrain?.renderer.canRender||"global"!==this.view.viewingMode}get needsLinearDepth(){return n(this._atmosphere)&&"realistic"===this._atmosphere.type}updateAnimation(e){return!!n(this._precipitation)&&this._precipitation.update(e)}get updating(){return n(this._pendingAtmosphere)||n(this._stars)&&this._stars.updating||n(this._clouds)&&this._clouds.running}get weatherVisible(){return m(this.view.state.camera.eye)-c(this.view.spatialReference).radius<=T}get _stars(){const e=this.view,t=e.environment?.starsEnabled??!1,s=this._get("_stars");return!t||o(this._context)?(r(s),null):n(s)?s:new j({view:e,requestRender:()=>this._setNeedsRender()})}get _precipitation(){const e=this._get("_precipitation");if(!this._precipitationEnabled||o(this._context))return r(e),null;const t=this.view,s=this._context;return n(e)&&e.context===s?e:(r(e),new E({context:s,view:t}))}get _clouds(){const e=this._get("_clouds");if(!this.weatherEnabled||o(this._context))return r(e),null;if(n(e))return e;const t=this.view,s=this._context;return r(e),new f({context:s,view:t,requestRender:()=>this._setNeedsRender()})}get _cloudsComposition(){const e=this._get("_cloudsComposition");if(!this.weatherEnabled||o(this._context))return r(e),null;const t=this.view.state.viewingMode,s=this._context.renderContext.rctx,i=c(this.view.spatialReference).radius;return n(e)&&e.viewingMode===t&&e.planetRadius===i?e:(r(e),new y({rctx:s,viewingMode:t,planetRadius:i,requestRender:()=>this._setNeedsRender()}))}get _fog(){const e=this._get("_fog");if(!this.weatherEnabled||o(this._context))return r(e),null;if(n(e))return e;const t=this.view,s=this._context;return r(e),new R({context:s,view:t})}get weatherEnabled(){return!!this.view?.environmentManager?.weatherEnabled}get _precipitationEnabled(){return this.weatherEnabled&&("rainy"===this.view.environment.weather.type||"snowy"===this.view.environment.weather.type)}initializeRenderContext(e=null){this._context=e,this._handles.add([h((()=>this.view?.basemapTerrain),(()=>this._updateBasemapTerrain()),a),p((()=>({viewingMode:this.view.viewingMode,atmosphereEnabled:this.view.environment.atmosphereEnabled,atmosphereQuality:this.view.environment.atmosphere.quality})),(()=>this._updateAtmosphere()),a),p((()=>this._stars),(()=>this._setNeedsRender())),p((()=>this._clouds),(()=>this._updateWeather(this._weatherUpdateParameters)),d),p((()=>this._precipitation),(()=>this._setNeedsRender())),p((()=>this._fog),(()=>this._updateFog(this._weatherUpdateParameters)),d),p((()=>this._weatherUpdateParameters),(e=>{this._updateWeather(e),this._updateFog(e)}),a)])}uninitializeRenderContext(){this._context=null,this._atmosphere=r(this._atmosphere),this._set("_stars",r(this._stars)),this._set("_precipitation",r(this._precipitation)),this._set("_clouds",r(this._clouds)),this._set("_cloudsComposition",r(this._cloudsComposition)),this._set("_fog",r(this._fog))}prepareRender(e){e.bindParameters.clouds.data=v(this._clouds)?this._clouds:null}render(e){if(e.pass===x.MATERIAL)switch(e.bindParameters.slot){case C.POSTPROCESSING_ENVIRONMENT_OPAQUE:n(this._stars)&&this._stars.render(e),n(this._atmosphere)&&(this._atmosphere.render(e),n(this._cloudsComposition)&&n(e.bindParameters.clouds.data)&&(this.weatherVisible&&n(this._clouds)&&this._clouds.ensureWeatherTile(),this._cloudsComposition.render(e,n(this.view.animation))));break;case C.POSTPROCESSING_ENVIRONMENT_TRANSPARENT:if(n(this._atmosphere)){const t=this.weatherEnabled?this.view.environment.weather.type:"disabled";if(this._atmosphere.renderHaze(e,"rainy"===t),n(this._fog)){const s="foggy"===t||"rainy"===t||"snowy"===t;(s||"realistic"!==this._selectAtmosphereType())&&this._fog.render(e,s,"rainy"===t)}if(n(this._precipitation)){const t=this.view.environment.weather;"rainy"!==t.type&&"snowy"!==t.type||this._precipitation.render(e,t.precipitation,t.type)}}}}get _weatherUpdateParameters(){const e=this.weatherEnabled?this.view.environment.weather:null;return o(e)?null:"rainy"===e.type||"snowy"===e.type?{type:e.type,weatherAdjustment:e.cloudCover,effect:e.precipitation}:{type:e.type,weatherAdjustment:"foggy"===e.type?e.fogStrength:e.cloudCover}}_updateWeather(e){o(e)||o(this._clouds)||(this._clouds.applyPreset(A[e.type],e.weatherAdjustment),this._setNeedsRender())}_setNeedsRender(){n(this._context)&&this._context.requestRender()}_updateFog(e){if(!o(this._fog)&&!o(e))switch(e.type){case"foggy":this._fog.strength=i(3e-5,.005,e.weatherAdjustment**3),this._setNeedsRender();break;case"rainy":case"snowy":this._fog.strength=i(4e-6,2e-4,e.effect**3),this._setNeedsRender();break;default:this._fog.strength=4e-6,this._setNeedsRender()}}_updateAtmosphere(){const e=this._selectAtmosphereType();if(this.atmosphereType===e)return;n(this._pendingAtmosphere)&&(this._pendingAtmosphere!==this._atmosphere&&this._pendingAtmosphere.destroy(),this._pendingAtmosphere=null);const t=this._getAtmosphereClass();if(!t)return n(this._atmosphere)&&(this._atmosphere.destroy(),this._atmosphere=null,this._setNeedsRender()),void this._updateBasemapTerrain();const s=new t(this.view);n(this._context)&&s.initializeRenderContext(this._context),o(this._atmosphere)&&(this._atmosphere=s,this._setNeedsRender()),this._pendingAtmosphere=s,s.when().then((()=>{n(this._atmosphere)&&this._pendingAtmosphere&&this._pendingAtmosphere!==this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=this._pendingAtmosphere),this._pendingAtmosphere=null,this._setNeedsRender(),this._updateBasemapTerrain()})).catch((()=>{this._pendingAtmosphere===s&&(this._pendingAtmosphere=null)}))}_getAtmosphereClass(){switch(this._selectAtmosphereType()){case"none":return null;case"realistic":return w;case"panoramic":return b;case"simple":return N;default:return}}_selectAtmosphereType(){const e=this.view.get("environment.atmosphereEnabled"),t=this.view.get("environment.atmosphere.quality"),s=this.view.viewingMode;return!e||null==t||u(this.view.spatialReference)?"none":"local"===s?"panoramic":"high"===t&&n(this._context)&&w.isSupported(this._context)&&g(this.view.spatialReference)?"realistic":"simple"}_updateBasemapTerrain(){this.view.basemapTerrain&&(this.view.basemapTerrain.velvetOverground=n(this._atmosphere)&&"simple"===this.atmosphereType)}get test(){return{atmosphere:this._atmosphere,clouds:this._clouds,selectAtmosphereType:()=>this._selectAtmosphereType(),stubGetAtmosphereClass:e=>{S=P.prototype._getAtmosphereClass,P.prototype._getAtmosphereClass=e},restoreGetAtmosphereClass:()=>{P.prototype._getAtmosphereClass=S}}}};e([l({constructOnly:!0})],M.prototype,"view",void 0),e([l({type:Boolean,readOnly:!0})],M.prototype,"updating",null),e([l({readOnly:!0})],M.prototype,"weatherVisible",null),e([l()],M.prototype,"_context",void 0),e([l()],M.prototype,"_pendingAtmosphere",void 0),e([l({readOnly:!0})],M.prototype,"_stars",null),e([l({readOnly:!0})],M.prototype,"_precipitation",null),e([l({readOnly:!0})],M.prototype,"_clouds",null),e([l({readOnly:!0})],M.prototype,"_cloudsComposition",null),e([l({readOnly:!0})],M.prototype,"_fog",null),e([l({readOnly:!0})],M.prototype,"weatherEnabled",null),e([l({readOnly:!0})],M.prototype,"_precipitationEnabled",null),e([l({readOnly:!0})],M.prototype,"_weatherUpdateParameters",null),M=P=e([_("esri.views.3d.environment.EnvironmentRenderer")],M);export{M as EnvironmentRenderer};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import s from"../../../core/Handles.js";import{lerp as i}from"../../../core/mathUtils.js";import{destroyMaybe as r,isSome as o,isNone as n}from"../../../core/maybe.js";import{when as h,syncAndInitial as a,watch as p,initial as d}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{l as m}from"../../../chunks/vec3.js";import{getReferenceEllipsoid as c}from"../../../geometry/projectionEllipsoid.js";import{isMoon as u,isEarth as g}from"../../../geometry/support/spatialReferenceUtils.js";import{ChapmanAtmosphere as w}from"./ChapmanAtmosphere.js";import{CloudsComposition as y}from"./CloudsComposition.js";import{isReadyCloudsData as v}from"./CloudsData.js";import{CloudsGenerator as f}from"./CloudsGenerator.js";import{cloudPresets as A}from"./CloudsPresets.js";import{Fog as R}from"./Fog.js";import{PanoramicAtmosphere as b}from"./PanoramicAtmosphere.js";import{Precipitation as E}from"./Precipitation.js";import N from"./SimpleAtmosphere.js";import{Stars as j}from"./Stars.js";import{weatherHeightLimit as x}from"./weather.js";import{ShaderOutput as C}from"../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{RenderSlot as T}from"../webgl-engine/lib/RenderSlot.js";var O;const P=[T.POSTPROCESSING_ENVIRONMENT_OPAQUE,T.POSTPROCESSING_ENVIRONMENT_TRANSPARENT];let S,M=O=class extends t{constructor(e){super(e),this._handles=new s,this._context=null,this._pendingAtmosphere=null,this._atmosphere=null}initialize(){this.view._stage.addRenderPlugin(P,this)}destroy(){this._pendingAtmosphere=r(this._pendingAtmosphere),null!=this.view?._stage&&this.view._stage.removeRenderPlugin(this),this._handles=r(this._handles),this._set("view",null)}get atmosphereType(){return o(this._pendingAtmosphere)?this._pendingAtmosphere.type:o(this._atmosphere)?this._atmosphere.type:"none"}get canRender(){return!!this.view.basemapTerrain?.renderer.canRender||"global"!==this.view.viewingMode}get needsLinearDepth(){return o(this._atmosphere)&&"realistic"===this._atmosphere.type}updateAnimation(e){return!!o(this._precipitation)&&this._precipitation.update(e)}get updating(){return o(this._pendingAtmosphere)||o(this._stars)&&this._stars.updating||o(this._clouds)&&this._clouds.running}get weatherVisible(){return m(this.view.state.camera.eye)-c(this.view.spatialReference).radius<=x}get _stars(){const e=this.view,t=e.environment?.starsEnabled??!1,s=this._get("_stars");return!t||n(this._context)?(r(s),null):o(s)?s:new j({view:e,requestRender:()=>this._setNeedsRender()})}get _precipitation(){const e=this._get("_precipitation");if(!this._precipitationEnabled||n(this._context))return r(e),null;const t=this.view,s=this._context;return o(e)&&e.context===s?e:(r(e),new E({context:s,view:t}))}get _clouds(){const e=this._get("_clouds");if(!this.weatherEnabled||n(this._context))return r(e),null;if(o(e))return e;const t=this.view,s=this._context;return r(e),new f({context:s,view:t,requestRender:()=>this._setNeedsRender()})}get _cloudsComposition(){const e=this._get("_cloudsComposition");if(!this.weatherEnabled||n(this._context))return r(e),null;const t=this.view.state.viewingMode,s=this._context.renderContext.rctx,i=c(this.view.spatialReference).radius;return o(e)&&e.viewingMode===t&&e.planetRadius===i?e:(r(e),new y({rctx:s,viewingMode:t,planetRadius:i,requestRender:()=>this._setNeedsRender()}))}get _fog(){const e=this._get("_fog");if(!this.weatherEnabled||n(this._context))return r(e),null;if(o(e))return e;const t=this.view,s=this._context;return r(e),new R({context:s,view:t})}get weatherEnabled(){return!!this.view?.environmentManager?.weatherEnabled}get _precipitationEnabled(){return this.weatherEnabled&&("rainy"===this.view.environment.weather.type||"snowy"===this.view.environment.weather.type)}initializeRenderContext(e=null){this._context=e,this._handles.add([h((()=>this.view?.basemapTerrain),(()=>this._updateBasemapTerrain()),a),p((()=>({viewingMode:this.view.viewingMode,atmosphereEnabled:this.view.environment.atmosphereEnabled,atmosphereQuality:this.view.environment.atmosphere.quality})),(()=>this._updateAtmosphere()),a),p((()=>this._stars),(()=>this._setNeedsRender())),p((()=>this._clouds),(()=>this._updateWeather(this._weatherUpdateParameters)),d),p((()=>this._precipitation),(()=>this._setNeedsRender())),p((()=>this._fog),(()=>this._updateFog(this._weatherUpdateParameters)),d),p((()=>this._weatherUpdateParameters),(e=>{this._updateWeather(e),this._updateFog(e)}),a)])}uninitializeRenderContext(){this._context=null,this._atmosphere=r(this._atmosphere),this._set("_stars",r(this._stars)),this._set("_precipitation",r(this._precipitation)),this._set("_clouds",r(this._clouds)),this._set("_cloudsComposition",r(this._cloudsComposition)),this._set("_fog",r(this._fog))}prepareRender(e){e.bindParameters.clouds.data=v(this._clouds)?this._clouds:null}render(e){if(e.output===C.Color)switch(e.bindParameters.slot){case T.POSTPROCESSING_ENVIRONMENT_OPAQUE:o(this._stars)&&this._stars.render(e),o(this._atmosphere)&&(this._atmosphere.render(e),o(this._cloudsComposition)&&o(e.bindParameters.clouds.data)&&(this.weatherVisible&&o(this._clouds)&&this._clouds.ensureWeatherTile(),this._cloudsComposition.render(e,o(this.view.animation))));break;case T.POSTPROCESSING_ENVIRONMENT_TRANSPARENT:if(o(this._atmosphere)){const t=this.weatherEnabled?this.view.environment.weather.type:"disabled";if(this._atmosphere.renderHaze(e,"rainy"===t),o(this._fog)){const s="foggy"===t||"rainy"===t||"snowy"===t;(s||"realistic"!==this._selectAtmosphereType())&&this._fog.render(e,s,"rainy"===t)}if(o(this._precipitation)){const t=this.view.environment.weather;"rainy"!==t.type&&"snowy"!==t.type||this._precipitation.render(e,t.precipitation,t.type)}}}}get _weatherUpdateParameters(){const e=this.weatherEnabled?this.view.environment.weather:null;return n(e)?null:"rainy"===e.type||"snowy"===e.type?{type:e.type,weatherAdjustment:e.cloudCover,effect:e.precipitation}:{type:e.type,weatherAdjustment:"foggy"===e.type?e.fogStrength:e.cloudCover}}_updateWeather(e){n(e)||n(this._clouds)||(this._clouds.applyPreset(A[e.type],e.weatherAdjustment),this._setNeedsRender())}_setNeedsRender(){o(this._context)&&this._context.requestRender()}_updateFog(e){if(!n(this._fog)&&!n(e))switch(e.type){case"foggy":this._fog.strength=i(3e-5,.005,e.weatherAdjustment**3),this._setNeedsRender();break;case"rainy":case"snowy":this._fog.strength=i(4e-6,2e-4,e.effect**3),this._setNeedsRender();break;default:this._fog.strength=4e-6,this._setNeedsRender()}}_updateAtmosphere(){const e=this._selectAtmosphereType();if(this.atmosphereType===e)return;o(this._pendingAtmosphere)&&(this._pendingAtmosphere!==this._atmosphere&&this._pendingAtmosphere.destroy(),this._pendingAtmosphere=null);const t=this._getAtmosphereClass();if(!t)return o(this._atmosphere)&&(this._atmosphere.destroy(),this._atmosphere=null,this._setNeedsRender()),void this._updateBasemapTerrain();const s=new t(this.view);o(this._context)&&s.initializeRenderContext(this._context),n(this._atmosphere)&&(this._atmosphere=s,this._setNeedsRender()),this._pendingAtmosphere=s,s.when().then((()=>{o(this._atmosphere)&&this._pendingAtmosphere&&this._pendingAtmosphere!==this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=this._pendingAtmosphere),this._pendingAtmosphere=null,this._setNeedsRender(),this._updateBasemapTerrain()})).catch((()=>{this._pendingAtmosphere===s&&(this._pendingAtmosphere=null)}))}_getAtmosphereClass(){switch(this._selectAtmosphereType()){case"none":return null;case"realistic":return w;case"panoramic":return b;case"simple":return N;default:return}}_selectAtmosphereType(){const e=this.view.get("environment.atmosphereEnabled"),t=this.view.get("environment.atmosphere.quality"),s=this.view.viewingMode;return!e||null==t||u(this.view.spatialReference)?"none":"local"===s?"panoramic":"high"===t&&o(this._context)&&w.isSupported(this._context)&&g(this.view.spatialReference)?"realistic":"simple"}_updateBasemapTerrain(){this.view.basemapTerrain&&(this.view.basemapTerrain.velvetOverground=o(this._atmosphere)&&"simple"===this.atmosphereType)}get test(){return{atmosphere:this._atmosphere,clouds:this._clouds,selectAtmosphereType:()=>this._selectAtmosphereType(),stubGetAtmosphereClass:e=>{S=O.prototype._getAtmosphereClass,O.prototype._getAtmosphereClass=e},restoreGetAtmosphereClass:()=>{O.prototype._getAtmosphereClass=S}}}};e([l({constructOnly:!0})],M.prototype,"view",void 0),e([l({type:Boolean,readOnly:!0})],M.prototype,"updating",null),e([l({readOnly:!0})],M.prototype,"weatherVisible",null),e([l()],M.prototype,"_context",void 0),e([l()],M.prototype,"_pendingAtmosphere",void 0),e([l({readOnly:!0})],M.prototype,"_stars",null),e([l({readOnly:!0})],M.prototype,"_precipitation",null),e([l({readOnly:!0})],M.prototype,"_clouds",null),e([l({readOnly:!0})],M.prototype,"_cloudsComposition",null),e([l({readOnly:!0})],M.prototype,"_fog",null),e([l({readOnly:!0})],M.prototype,"weatherEnabled",null),e([l({readOnly:!0})],M.prototype,"_precipitationEnabled",null),e([l({readOnly:!0})],M.prototype,"_weatherUpdateParameters",null),M=O=e([_("esri.views.3d.environment.EnvironmentRenderer")],M);export{M as EnvironmentRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{a as r}from"../../../chunks/Fog.glsl.js";import{ReloadableShaderModule as i}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{parameter as n,ShaderTechniqueConfiguration as t}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Default3D as s}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as a}from"../webgl-engine/lib/Program.js";import{BlendFactor as l}from"../../webgl/enums.js";import{makePipelineState as g,separateBlendingParams as m,defaultColorWriteParams as c}from"../../webgl/renderState.js";class h extends o{initializeProgram(e){const r=h.shader.get().build(this.configuration);return new a(e.rctx,r,s)}initializePipeline(){return this.configuration.haze?g({blending:m(l.ONE,l.ZERO,l.ONE_MINUS_SRC_COLOR,l.ONE),colorWrite:c}):g({blending:m(l.SRC_ALPHA,l.ZERO,l.ONE_MINUS_SRC_ALPHA,l.ONE),colorWrite:c})}}h.shader=new i(r,(()=>import("./Fog.glsl.js")));class u extends t{constructor(){super(...arguments),this.haze=!1}}e([n()],u.prototype,"haze",void 0);export{h as FogTechnique,u as FogTechniqueConfiguration};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{a as r}from"../../../chunks/Fog.glsl.js";import{ReloadableShaderModule as i}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{parameter as n,ShaderTechniqueConfiguration as t}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Default3D as s}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as a}from"../webgl-engine/lib/Program.js";import{BlendFactor as l}from"../../webgl/enums.js";import{makePipelineState as g,separateBlendingParams as m,defaultColorWriteParams as h}from"../../webgl/renderState.js";class c extends o{initializeProgram(e){return new a(e.rctx,c.shader.get().build(this.configuration),s)}initializePipeline(){return this.configuration.haze?g({blending:m(l.ONE,l.ZERO,l.ONE_MINUS_SRC_COLOR,l.ONE),colorWrite:h}):g({blending:m(l.SRC_ALPHA,l.ZERO,l.ONE_MINUS_SRC_ALPHA,l.ONE),colorWrite:h})}}c.shader=new i(r,(()=>import("./Fog.glsl.js")));class u extends t{constructor(){super(...arguments),this.haze=!1}}e([n()],u.prototype,"haze",void 0);export{c as FogTechnique,u as FogTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{a as e}from"../../../chunks/NoiseTextureAtlas.glsl.js";import{NoiseTextureRenderMode as r}from"./NoiseTextureAtlasConfiguration.js";import{ReloadableShaderModule as i}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{Default3D as o}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as n}from"../webgl-engine/lib/Program.js";import{BlendFactor as s,CompareFunction as l}from"../../webgl/enums.js";import{makePipelineState as a,simpleBlendingParams as m,separateBlendingParams as g,defaultColorWriteParams as u}from"../../webgl/renderState.js";class c extends t{initializeProgram(e){const r=c.shader.get().build(this.configuration);return new n(e.rctx,r,o)}initializePipeline(){return a({blending:this.configuration.mode===r.Full?m(s.ONE,s.ZERO):g(s.ZERO,s.ONE,s.ONE,s.ZERO),depthTest:{func:l.ALWAYS},colorWrite:u})}}c.shader=new i(e,(()=>import("./NoiseTextureAtlas.glsl.js")));export{c as NoiseTextureAtlasTechnique};
5
+ import{a as e}from"../../../chunks/NoiseTextureAtlas.glsl.js";import{NoiseTextureRenderMode as r}from"./NoiseTextureAtlasConfiguration.js";import{ReloadableShaderModule as i}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{Default3D as o}from"../webgl-engine/lib/DefaultVertexAttributeLocations.js";import{Program as n}from"../webgl-engine/lib/Program.js";import{BlendFactor as s,CompareFunction as l}from"../../webgl/enums.js";import{makePipelineState as a,simpleBlendingParams as m,separateBlendingParams as g,defaultColorWriteParams as u}from"../../webgl/renderState.js";class d extends t{initializeProgram(e){return new n(e.rctx,d.shader.get().build(this.configuration),o)}initializePipeline(){return a({blending:this.configuration.mode===r.Full?m(s.ONE,s.ZERO):g(s.ZERO,s.ONE,s.ONE,s.ZERO),depthTest:{func:l.ALWAYS},colorWrite:u})}}d.shader=new i(e,(()=>import("./NoiseTextureAtlas.glsl.js")));export{d as NoiseTextureAtlasTechnique};