@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"../../../geometry.js";import t from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import r from"../../../core/Error.js";import o from"../../../core/Evented.js";import n from"../../../core/Handles.js";import a from"../../../core/Logger.js";import{destroyMaybe as h,isNone as c,isSome as p,abortMaybe as l,get as d}from"../../../core/maybe.js";import{when as m,pausable as v}from"../../../core/reactiveUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{closeRingsAndFixWinding as g,geometryToCoordinates as u,getMidpoint as x}from"../../../geometry/support/coordsUtils.js";import f from"../../../layers/GraphicsLayer.js";import G from"../../../symbols/SimpleMarkerSymbol.js";import{ViewingMode as b}from"../../ViewingMode.js";import{SnappingVisualizer2D as V}from"../../2d/interactive/SnappingVisualizer2D.js";import{cloneMove as M}from"./drawUtils.js";import w from"./GraphicMover.js";import S from"./HighlightHelper.js";import{addUniqueLayer as k}from"./layerUtils.js";import{settings as E}from"./settings.js";import{ViewEventPriorities as I}from"../../input/InputManager.js";import{SKETCH_KEYS as C}from"../../interactive/keybindings.js";import{EditGeometryOperations as O}from"../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as R}from"../../interactive/snapping/SnappingContext.js";import j from"../../../geometry/Polyline.js";import H from"../../../geometry/Point.js";class A{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-start"}}class U{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape"}}class T{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-stop"}}class D{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-start"}}class F{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move"}}class z{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-stop"}}class L{constructor(e){this.added=e,this.type="vertex-select"}}class P{constructor(e){this.removed=e,this.type="vertex-deselect"}}class K{constructor(e,t,i,s){this.added=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-add"}}class N{constructor(e,t,i,s){this.removed=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-remove"}}const q=E.reshapeGraphics,B={vertices:{default:new G({style:"circle",size:q.vertex.size,color:q.vertex.color,outline:{color:q.vertex.outlineColor,width:1}}),hover:new G({style:"circle",size:q.vertex.hoverSize,color:q.vertex.hoverColor,outline:{color:q.vertex.hoverOutlineColor,width:1}}),selected:new G({style:"circle",size:q.selected.size,color:q.selected.color,outline:{color:q.selected.outlineColor,width:1}})},midpoints:{default:new G({style:"circle",size:q.midpoint.size,color:q.midpoint.color,outline:{color:q.midpoint.outlineColor,width:1}}),hover:new G({style:"circle",size:q.midpoint.size,color:q.midpoint.color,outline:{color:q.midpoint.outlineColor,width:1}})}};let J=class extends o.EventedAccessor{constructor(e){super(e),this._activeOperationInfo=null,this._editGeometryOperations=null,this._handles=new n,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._snappingTask=null,this._stagedVertex=null,this._viewHandles=new n,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.enableMidpoints=!0,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.layer=null,this.midpointGraphics=new s,this.midpointSymbol=new G({style:"circle",size:6,color:[200,200,200],outline:{color:[100,100,100],width:1}}),this.selectedVertices=[],this.snappingManager=null,this.type="reshape",this.vertexGraphics=new s,this.view=null}initialize(){this._highlightHelper=new S({view:this.view}),this._setup(),this._handles.add([m((()=>this.view?.ready),(()=>{const{layer:e,view:t}=this;k(t,e),this._viewHandles.add(t.on("key-down",(e=>this._keyDownHandler(e)),I.TOOL))}),{once:!0,initial:!0}),v((()=>this.graphic),(()=>this.refresh())),v((()=>this.layer),((e,t)=>{t&&(this._clearSelection(),this._resetGraphics(t)),this.refresh()})),v((()=>this.enableMidpoints),(()=>this.refresh()))])}destroy(){this._reset(),this._mover?.destroy(),this._mover=null,this._handles=h(this._handles),this._viewHandles=h(this._viewHandles)}set highlightsEnabled(e){this._highlightHelper?.removeAll(),this._set("highlightsEnabled",e),this._setUpHighlights()}get state(){const e=!!this.get("view.ready"),t=!(!this.get("graphic")||!this.get("layer"));return e&&t?"active":e?"ready":"disabled"}set symbols(e){const{midpoints:t=B.midpoints,vertices:i=B.vertices}=e||{};this._set("symbols",{midpoints:t,vertices:i})}isUIGraphic(e){const t=[];return this.graphic&&t.push(this.graphic),t.concat(this.vertexGraphics.items,this.midpointGraphics.items),t.length&&t.includes(e)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_setup(){const{graphic:e,layer:t}=this;if(!t||!e||c(e.geometry))return;const i=e.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&g(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper.add(this.graphic)}_setUpGeometryHelper(){const e=this.graphic.geometry;if(c(e)||"mesh"===e.type||"extent"===e.type)return void this._logGeometryTypeError();const t="multipoint"===e.type?new j({paths:e.points,spatialReference:e.spatialReference}):e;this._editGeometryOperations=O.fromGeometry(t,b.Local)}_saveSnappingContextForHandle(e,t){this._snappingGraphicsLayer=new f({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer),this._snappingContext=new R({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:t.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,visualizer:new V(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(e)})}_reset(){this._clearSelection(),this._highlightHelper.removeAll(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover&&this._mover.destroy(),this._mover=null,this.view.cursor="default"}_resetSnappingStateVars(){p(this.snappingManager)&&this.snappingManager.doneSnapping(),p(this._snappingGraphicsLayer)&&(this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=h(this._editGeometryOperations),this._snappingTask=l(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(e){this._removeMidpointGraphics(e),this._removeVertexGraphics(e),this._set("selectedVertices",[])}_removeMidpointGraphics(e){const t=e||this.layer;t&&t.removeMany(this.midpointGraphics.items),this.midpointGraphics.items.forEach((e=>e.destroy())),this.midpointGraphics.removeAll()}_removeVertexGraphics(e){const t=e||this.layer;t&&t.removeMany(this.vertexGraphics.items),this.vertexGraphics.items.forEach((e=>e.destroy())),this.vertexGraphics.removeAll()}_getCoordinatesForUI(e){const t=u(e.clone());if("polygon"===e.type)for(const i of t){const e=i[i.length-1];i[0][0]===e[0]&&i[0][1]===e[1]&&i.length>2&&i.pop()}return t}_setupGraphics(){const e=this.graphic.geometry;if(p(e)&&("polyline"===e.type||"polygon"===e.type)){const t=this._getCoordinatesForUI(e);this.enableMidpoints&&this._setUpMidpointGraphics(t),this.enableVertices&&this._setUpVertexGraphics(t)}}_setUpMidpointGraphics(e){this._removeMidpointGraphics();const t=this._createMidpointGraphics(e);this.midpointGraphics.addMany(t),this.layer.addMany(t)}_setUpVertexGraphics(e){this._removeVertexGraphics();const t=this._createVertexGraphics(e);this.vertexGraphics.addMany(t),this._storeRelatedVertexIndices(),this.layer.addMany(t)}_createVertexGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:r}}=this,o=[];return e?.forEach(((e,n)=>{e.forEach(((e,a)=>{const[h,c]=e;o.push(new t({geometry:new H({x:h,y:c,spatialReference:r}),symbol:s?.vertices?.default,attributes:{...i,pathIndex:n,pointIndex:a}}))}))})),o}_createMidpointGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:r}}=this,o=[];return e?.forEach(((e,n)=>{e.forEach(((a,h)=>{const[c,p]=a,l=e[h+1]?h+1:0;if("polygon"===d(this.graphic.geometry,"type")||0!==l){const[a,d]=e[l],[m,v]=x([c,p],[a,d]);o.push(new t({geometry:new H({x:m,y:v,spatialReference:r}),symbol:s.midpoints.default,attributes:{...i,pathIndex:n,pointIndexStart:h,pointIndexEnd:l}}))}}))})),o}_storeRelatedVertexIndices(){const e=this.vertexGraphics.items;if(!e)return;const t=e.map((({geometry:e})=>({x:e.x,y:e.y})));for(let i=0;i<t.length;i++){const s=[];for(let e=0;e<t.length;e++){if(i===e)continue;const r=t[i],o=t[e];r.x===o.x&&r.y===o.y&&s.push(e)}e[i].attributes.relatedGraphicIndices=s}}_setupMover(){const{enableMovement:e,graphic:t,midpointGraphics:i,vertexGraphics:s,view:r}=this,o=s.concat(i).items;e&&o.push(t),this._mover=new w({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:o,view:r,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_onGraphicClickCallback(e){e.viewEvent.stopPropagation();const t=e.graphic;if(t===this.graphic)this.clearSelection(),this.emit("graphic-click",e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e);else if(this._isMidpoint(t)){if(2===e.viewEvent.button)return;const i=this.graphic.clone(),s=this._createVertexFromMidpoint(t);this.refresh(),this._emitVertexAddEvent([t],i,s)}else if(this._isVertex(t))if(e.viewEvent.stopPropagation(),2===e.viewEvent.button)this._removeVertices(t);else{e.viewEvent.native.shiftKey||this._clearSelection(),this.selectedVertices.includes(t)?this._removeFromSelection(t,!0):this._addToSelection(t)}}_setUpOperation(e){const{graphic:t,dx:i,dy:s}=e,r=t===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(t,e),this._activeOperationInfo={target:this.graphic,mover:t,operationType:r?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(e){const t=e.graphic,{dx:i,dy:s}=e;if(t===this.graphic)return this._clearSelection(),this._resetGraphics(),this._setUpOperation(e),this._emitMoveStartEvent(i,s),void("point"===this._editGeometryOperations.data.type&&this._onHandleMove(t,i,s,e,(()=>this._emitMoveEvent(i,s))));if(!this.selectedVertices.includes(t)){if(this._clearSelection(),this._isMidpoint(t)){const e=this.graphic.clone(),i=this._createVertexFromMidpoint(t);this._emitVertexAddEvent([t],e,i)}this._addToSelection(t)}this._setUpOperation(e),this._emitReshapeStartEvent(t),this._onHandleMove(t,i,s,e,(()=>this._emitReshapeEvent(t)))}_onGraphicMoveCallback(e){const{graphic:t,dx:i,dy:s}=e;this._activeOperationInfo.totalDx+=i,this._activeOperationInfo.totalDy+=s;const{operationType:r}=this._activeOperationInfo;"move"===r?"point"===this._editGeometryOperations.data.type?this._onHandleMove(t,i,s,e,(()=>this._emitMoveEvent(i,s))):this._emitMoveEvent(i,s):this._onHandleMove(t,i,s,e,(()=>this._emitReshapeEvent(t)))}_onGraphicMoveStopCallback(e){const{graphic:t,dx:i,dy:s}=e;this._activeOperationInfo.totalDx+=i,this._activeOperationInfo.totalDy+=s,this._onHandleMove(t,i,s,e,(()=>t===this.graphic?this._emitMoveStopEvent():this._emitReshapeStopEvent(t))),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._isMidpoint(t)&&this.refresh()}_updateMidpointGraphicLocations(e){for(const t of this.midpointGraphics){const{pathIndex:i,pointIndexStart:s,pointIndexEnd:r}=t.attributes,[o,n]=e[i][s],[a,h]=e[i][r],[c,p]=x([o,n],[a,h]);t.geometry=new H({x:c,y:p,spatialReference:this.view.spatialReference})}}_getIndicesForVertexGraphic({attributes:e}){return[e?.pathIndex||0,e?.pointIndex||0]}_getVertexFromEditGeometry(e){const[t,i]=this._getIndicesForVertexGraphic(e);return this._editGeometryOperations.data.components[t].vertices[i]}_onHandleMove(e,t,s,r,o){if(l(this._snappingTask),!this._snappingContext)return;const n=e.geometry,a="graphic-move-stop"===r.type;if(p(this.snappingManager)&&this.selectedVertices.length<2&&!a){const r=this.snappingManager;this._stagedVertex=r.update(n,this._snappingContext),this._syncGeometryAfterVertexMove(e,new H(this._stagedVertex),t,s,a),o(),this._snappingTask=i((async i=>{const h=await r.snap(n,this._snappingContext,i);h.valid&&(this._stagedVertex=h.apply(),this._syncGeometryAfterVertexMove(e,new H(this._stagedVertex),t,s,a),o())}))}else{const i=p(this._stagedVertex)?new H(this._stagedVertex):n;this._syncGeometryAfterVertexMove(e,i,t,s,a),o()}}async _syncGeometryAfterVertexMove(e,t,i,s,r=!1){const o=this._editGeometryOperations.data.geometry;if("point"===o.type)e.geometry=t;else{const{x:n,y:a}=t,[h,c]=this._getIndicesForVertexGraphic(e);let p=u(o);const l=p[h].length-1;p[h][c]=[n,a],"polygon"===o.type&&(0===c?p[h][l]=[n,a]:c===l&&(p[h][0]=[n,a])),this._isVertex(e)&&(p=this._moveRelatedCoordinates(p,e,n,a),p=this._moveSelectedHandleCoordinates(p,e,i,s,"polygon"===o.type),this._updateMidpointGraphicLocations(p)),this.graphic.geometry=o.clone();const d=this._getVertexFromEditGeometry(e),m=n-d.pos[0],v=a-d.pos[1];this._editGeometryOperations.moveVertices([d],m,v,0),r&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(e),t):e.geometry=t)}}_moveRelatedCoordinates(e,t,i,s){const{relatedGraphicIndices:r}=t.attributes;for(const o of r){const r=this.vertexGraphics.getItemAt(o),{pathIndex:n,pointIndex:a}=r.attributes;e[n][a]=[i,s],r.geometry=t.geometry}return e}_moveSelectedHandleCoordinates(e,t,i,s,r){for(const o of this.selectedVertices)if(o!==t){const{pathIndex:t,pointIndex:n,relatedGraphicIndices:a}=o.attributes,h=M(o.geometry,i,s,this.view),c=e[t].length-1;e[t][n]=[h.x,h.y],o.geometry=h,r&&(0===n?e[t][c]=[h.x,h.y]:n===c&&(e[t][0]=[h.x,h.y]));for(const i of a){const t=this.vertexGraphics.getItemAt(i),{pathIndex:s,pointIndex:r}=t.attributes;e[s][r]=[h.x,h.y],t.geometry=h}}return e}_onGraphicPointerOverCallback(e){const t=e.graphic;this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.hover),this._updateHoverCursor(t)}_onGraphicPointerOutCallback(e){const t=e.graphic;this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.default),this.view.cursor="default"}_createVertexFromMidpoint(e){const{_graphicAttributes:t,graphic:i}=this,s=i.geometry;if(c(s)||"polygon"!==s.type&&"polyline"!==s.type)return[];const r=s.clone(),o=[],{pathIndex:n,pointIndexStart:a,pointIndexEnd:h}=e.attributes,{x:p,y:l}=e.geometry,d=0===h?a+1:h,m=u(r);return m[n].splice(d,0,[p,l]),e.attributes={...t,pathIndex:n,pointIndex:d,relatedGraphicIndices:[]},o.push({coordinates:m[n][d],componentIndex:n,vertexIndex:d}),this.graphic.geometry=r,o}_addToSelection(e){e instanceof t&&(e=[e]);for(const t of e)t.symbol=this.symbols.vertices.selected;this._set("selectedVertices",this.selectedVertices.concat(e)),this._emitSelectEvent(e)}_removeFromSelection(e,i){const{vertices:s}=this.symbols,r=i?s.hover:s.default;e instanceof t&&(e=[e]);for(const t of e)this.selectedVertices.splice(this.selectedVertices.indexOf(t),1),this._set("selectedVertices",this.selectedVertices),t.set("symbol",r);this._emitDeselectEvent(e)}_clearSelection(){if(this.selectedVertices.length){const e=this.selectedVertices;for(const t of this.selectedVertices)t.set("symbol",this.symbols.vertices.default);this._set("selectedVertices",[]),this._emitDeselectEvent(e)}}_keyDownHandler(e){C.delete.includes(e.key)&&!e.repeat&&this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_removeVertices(e){const i=this.graphic.geometry;if(c(i)||"polygon"!==i.type&&"polyline"!==i.type)return;if("polygon"===i.type&&this.vertexGraphics.length<4||this.vertexGraphics.length<3)return;e instanceof t&&(e=[e]);const s=this.graphic.clone(),r=i.clone();let o=u(r);const n=[];e instanceof t&&(e=[e]);for(const t of e){const{x:e,y:i}=t.geometry;for(let t=0;t<o.length;t++){const s=o[t];for(let r=0;r<s.length;r++){const[a,h]=s[r];e===a&&i===h&&(n.push({coordinates:o[t][r],componentIndex:t,vertexIndex:r}),o[t].splice(Number(r),1))}}}if("polygon"===r.type)o=o.filter((e=>{if(e.length<2)return!1;const[t,i]=e[0],[s,r]=e[e.length-1];return(2!==e.length||t!==s||i!==r)&&(t===s&&i===r||e.push(e[0]),!0)})),r.rings=o;else{for(const e of o)1===e.length&&o.splice(o.indexOf(e),1);r.paths=o}this.graphic.geometry=r,this.refresh(),this._emitVertexRemoveEvent(e,s,n)}_isVertex(e){return this.vertexGraphics.includes(e)}_isSelected(e){return this._isVertex(e)&&this.selectedVertices.includes(e)}_isMidpoint(e){return this.midpointGraphics.includes(e)}_updateHoverCursor(e){this.view.cursor=this._isMidpoint(e)?"copy":"move"}_emitMoveStartEvent(e,t){const i=new D(this.graphic,e,t);this.emit("move-start",i),this.callbacks.onMoveStart&&this.callbacks.onMoveStart(i)}_emitMoveEvent(e,t){const i=new F(this.graphic,e,t);this.emit("move",i),this.callbacks.onMove&&this.callbacks.onMove(i)}_emitMoveStopEvent(){const{totalDx:e,totalDy:t}=this._activeOperationInfo,i=new z(this.graphic,e,t);this.emit("move-stop",i),this.callbacks.onMoveStop&&this.callbacks.onMoveStop(i)}_emitReshapeStartEvent(e){const t=new A(this.graphic,e,this.selectedVertices);this.emit("reshape-start",t),this.callbacks.onReshapeStart&&this.callbacks.onReshapeStart(t)}_emitReshapeEvent(e){const t=new U(this.graphic,e,this.selectedVertices);this.emit("reshape",t),this.callbacks.onReshape&&this.callbacks.onReshape(t)}_emitReshapeStopEvent(e){const t=new T(this.graphic,e,this.selectedVertices);this.emit("reshape-stop",t),this.callbacks.onReshapeStop&&this.callbacks.onReshapeStop(t)}_emitSelectEvent(e){const t=new L(e);this.emit("select",t),this.callbacks.onVertexSelect&&this.callbacks.onVertexSelect(t)}_emitDeselectEvent(e){const t=new P(e);this.emit("deselect",t),this.callbacks.onVertexDeselect&&this.callbacks.onVertexDeselect(t)}_emitVertexAddEvent(e,t,i){const s=new K(e,this.graphic,t,i);this.emit("vertex-add",s),this.callbacks.onVertexAdd&&this.callbacks.onVertexAdd(s)}_emitVertexRemoveEvent(e,t,i){const s=new N(e,this.graphic,t,i);this.emit("vertex-remove",s),this.callbacks.onVertexRemove&&this.callbacks.onVertexRemove(s)}_logGeometryTypeError(){a.getLogger(this.declaredClass).error(new r("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};e([y()],J.prototype,"callbacks",void 0),e([y()],J.prototype,"enableMidpoints",void 0),e([y()],J.prototype,"enableMovement",void 0),e([y()],J.prototype,"enableVertices",void 0),e([y()],J.prototype,"graphic",void 0),e([y({value:!0})],J.prototype,"highlightsEnabled",null),e([y()],J.prototype,"layer",void 0),e([y({readOnly:!0})],J.prototype,"midpointGraphics",void 0),e([y()],J.prototype,"midpointSymbol",void 0),e([y({readOnly:!0})],J.prototype,"selectedVertices",void 0),e([y()],J.prototype,"snappingManager",void 0),e([y({readOnly:!0})],J.prototype,"state",null),e([y({value:B})],J.prototype,"symbols",null),e([y({readOnly:!0})],J.prototype,"type",void 0),e([y({readOnly:!0})],J.prototype,"vertexGraphics",void 0),e([y()],J.prototype,"view",void 0),J=e([_("esri.views.draw.support.Reshape")],J);const Q=J;export{Q as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import r from"../../../core/Error.js";import o from"../../../core/Evented.js";import n from"../../../core/Handles.js";import a from"../../../core/Logger.js";import{destroyMaybe as h,isNone as c,isSome as p,abortMaybe as l,get as d}from"../../../core/maybe.js";import{when as m,pausable as v}from"../../../core/reactiveUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{closeRingsAndFixWinding as g,geometryToCoordinates as u,getMidpoint as x}from"../../../geometry/support/coordsUtils.js";import f from"../../../layers/GraphicsLayer.js";import G from"../../../symbols/SimpleMarkerSymbol.js";import{ViewingMode as b}from"../../ViewingMode.js";import{SnappingVisualizer2D as V}from"../../2d/interactive/SnappingVisualizer2D.js";import{cloneMove as M}from"./drawUtils.js";import w from"./GraphicMover.js";import S from"./HighlightHelper.js";import{addUniqueLayer as k}from"./layerUtils.js";import{settings as E}from"./settings.js";import{ViewEventPriorities as I}from"../../input/InputManager.js";import{SKETCH_KEYS as O}from"../../interactive/keybindings.js";import{EditGeometryOperations as C}from"../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as R}from"../../interactive/snapping/SnappingContext.js";import j from"../../../geometry/Polyline.js";import H from"../../../geometry/Point.js";class A{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-start"}}class U{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape"}}class T{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-stop"}}class D{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-start"}}class F{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move"}}class z{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-stop"}}class L{constructor(e){this.added=e,this.type="vertex-select"}}class P{constructor(e){this.removed=e,this.type="vertex-deselect"}}class K{constructor(e,t,i,s){this.added=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-add"}}class N{constructor(e,t,i,s){this.removed=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-remove"}}const q=E.reshapeGraphics,B={vertices:{default:new G({style:"circle",size:q.vertex.size,color:q.vertex.color,outline:{color:q.vertex.outlineColor,width:1}}),hover:new G({style:"circle",size:q.vertex.hoverSize,color:q.vertex.hoverColor,outline:{color:q.vertex.hoverOutlineColor,width:1}}),selected:new G({style:"circle",size:q.selected.size,color:q.selected.color,outline:{color:q.selected.outlineColor,width:1}})},midpoints:{default:new G({style:"circle",size:q.midpoint.size,color:q.midpoint.color,outline:{color:q.midpoint.outlineColor,width:1}}),hover:new G({style:"circle",size:q.midpoint.size,color:q.midpoint.color,outline:{color:q.midpoint.outlineColor,width:1}})}};let J=class extends o.EventedAccessor{constructor(e){super(e),this._activeOperationInfo=null,this._editGeometryOperations=null,this._handles=new n,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._snappingTask=null,this._stagedVertex=null,this._viewHandles=new n,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.enableMidpoints=!0,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.layer=null,this.midpointGraphics=new s,this.midpointSymbol=new G({style:"circle",size:6,color:[200,200,200],outline:{color:[100,100,100],width:1}}),this.selectedVertices=[],this.snappingManager=null,this.type="reshape",this.vertexGraphics=new s,this.view=null}initialize(){this._highlightHelper=new S({view:this.view}),this._setup(),this._handles.add([m((()=>this.view?.ready),(()=>{const{layer:e,view:t}=this;k(t,e),this._viewHandles.add(t.on("key-down",(e=>this._keyDownHandler(e)),I.TOOL))}),{once:!0,initial:!0}),v((()=>this.graphic),(()=>this.refresh())),v((()=>this.layer),((e,t)=>{t&&(this._clearSelection(),this._resetGraphics(t)),this.refresh()})),v((()=>this.enableMidpoints),(()=>this.refresh()))])}destroy(){this._reset(),this._mover?.destroy(),this._mover=null,this._handles=h(this._handles),this._viewHandles=h(this._viewHandles)}set highlightsEnabled(e){this._highlightHelper?.removeAll(),this._set("highlightsEnabled",e),this._setUpHighlights()}get state(){const e=!!this.get("view.ready"),t=!(!this.get("graphic")||!this.get("layer"));return e&&t?"active":e?"ready":"disabled"}set symbols(e){const{midpoints:t=B.midpoints,vertices:i=B.vertices}=e||{};this._set("symbols",{midpoints:t,vertices:i})}isUIGraphic(e){const t=[];return this.graphic&&t.push(this.graphic),t.concat(this.vertexGraphics.items,this.midpointGraphics.items),t.length&&t.includes(e)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_setup(){const{graphic:e,layer:t}=this;if(!t||!e||c(e.geometry))return;const i=e.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&g(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper.add(this.graphic)}_setUpGeometryHelper(){const e=this.graphic.geometry;if(c(e)||"mesh"===e.type||"extent"===e.type)return void this._logGeometryTypeError();const t="multipoint"===e.type?new j({paths:e.points,spatialReference:e.spatialReference}):e;this._editGeometryOperations=C.fromGeometry(t,b.Local)}_saveSnappingContextForHandle(e,t){this._snappingGraphicsLayer=new f({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer),this._snappingContext=new R({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:t.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,visualizer:new V(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(e)})}_reset(){this._clearSelection(),this._highlightHelper.removeAll(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover&&this._mover.destroy(),this._mover=null,this.view.cursor="default"}_resetSnappingStateVars(){p(this.snappingManager)&&this.snappingManager.doneSnapping(),p(this._snappingGraphicsLayer)&&(this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=h(this._editGeometryOperations),this._snappingTask=l(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(e){this._removeMidpointGraphics(e),this._removeVertexGraphics(e),this._set("selectedVertices",[])}_removeMidpointGraphics(e){const t=e||this.layer;t&&t.removeMany(this.midpointGraphics.items),this.midpointGraphics.items.forEach((e=>e.destroy())),this.midpointGraphics.removeAll()}_removeVertexGraphics(e){const t=e||this.layer;t&&t.removeMany(this.vertexGraphics.items),this.vertexGraphics.items.forEach((e=>e.destroy())),this.vertexGraphics.removeAll()}_getCoordinatesForUI(e){const t=u(e.clone());if("polygon"===e.type)for(const i of t){const e=i[i.length-1];i[0][0]===e[0]&&i[0][1]===e[1]&&i.length>2&&i.pop()}return t}_setupGraphics(){const e=this.graphic.geometry;if(p(e)&&("polyline"===e.type||"polygon"===e.type)){const t=this._getCoordinatesForUI(e);this.enableMidpoints&&this._setUpMidpointGraphics(t),this.enableVertices&&this._setUpVertexGraphics(t)}}_setUpMidpointGraphics(e){this._removeMidpointGraphics();const t=this._createMidpointGraphics(e);this.midpointGraphics.addMany(t),this.layer.addMany(t)}_setUpVertexGraphics(e){this._removeVertexGraphics();const t=this._createVertexGraphics(e);this.vertexGraphics.addMany(t),this._storeRelatedVertexIndices(),this.layer.addMany(t)}_createVertexGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:r}}=this,o=[];return e?.forEach(((e,n)=>{e.forEach(((e,a)=>{const[h,c]=e;o.push(new t({geometry:new H({x:h,y:c,spatialReference:r}),symbol:s?.vertices?.default,attributes:{...i,pathIndex:n,pointIndex:a}}))}))})),o}_createMidpointGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:r}}=this,o=[];return e?.forEach(((e,n)=>{e.forEach(((a,h)=>{const[c,p]=a,l=e[h+1]?h+1:0;if("polygon"===d(this.graphic.geometry,"type")||0!==l){const[a,d]=e[l],[m,v]=x([c,p],[a,d]);o.push(new t({geometry:new H({x:m,y:v,spatialReference:r}),symbol:s.midpoints.default,attributes:{...i,pathIndex:n,pointIndexStart:h,pointIndexEnd:l}}))}}))})),o}_storeRelatedVertexIndices(){const e=this.vertexGraphics.items;if(!e)return;const t=e.map((({geometry:e})=>({x:e.x,y:e.y})));for(let i=0;i<t.length;i++){const s=[];for(let e=0;e<t.length;e++){if(i===e)continue;const r=t[i],o=t[e];r.x===o.x&&r.y===o.y&&s.push(e)}e[i].attributes.relatedGraphicIndices=s}}_setupMover(){const{enableMovement:e,graphic:t,midpointGraphics:i,vertexGraphics:s,view:r}=this,o=s.concat(i).items;e&&o.push(t),this._mover=new w({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:o,view:r,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_onGraphicClickCallback(e){e.viewEvent.stopPropagation();const t=e.graphic;if(t===this.graphic)this.clearSelection(),this.emit("graphic-click",e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e);else if(this._isMidpoint(t)){if(2===e.viewEvent.button)return;const i=this.graphic.clone(),s=this._createVertexFromMidpoint(t);this.refresh(),this._emitVertexAddEvent([t],i,s)}else if(this._isVertex(t))if(e.viewEvent.stopPropagation(),2===e.viewEvent.button)this._removeVertices(t);else{e.viewEvent.native.shiftKey||this._clearSelection(),this.selectedVertices.includes(t)?this._removeFromSelection(t,!0):this._addToSelection(t)}}_setUpOperation(e){const{graphic:t,dx:i,dy:s}=e,r=t===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(t,e),this._activeOperationInfo={target:this.graphic,mover:t,operationType:r?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(e){const t=e.graphic,{dx:i,dy:s}=e;if(t===this.graphic)return this._clearSelection(),this._resetGraphics(),this._setUpOperation(e),this._emitMoveStartEvent(i,s),void("point"===this._editGeometryOperations.data.type&&this._onHandleMove(t,i,s,e,(()=>this._emitMoveEvent(i,s))));if(!this.selectedVertices.includes(t)){if(this._clearSelection(),this._isMidpoint(t)){const e=this.graphic.clone(),i=this._createVertexFromMidpoint(t);this._emitVertexAddEvent([t],e,i)}this._addToSelection(t)}this._setUpOperation(e),this._emitReshapeStartEvent(t),this._onHandleMove(t,i,s,e,(()=>this._emitReshapeEvent(t)))}_onGraphicMoveCallback(e){const{graphic:t,dx:i,dy:s}=e;this._activeOperationInfo.totalDx+=i,this._activeOperationInfo.totalDy+=s;const{operationType:r}=this._activeOperationInfo;"move"===r?"point"===this._editGeometryOperations.data.type?this._onHandleMove(t,i,s,e,(()=>this._emitMoveEvent(i,s))):this._emitMoveEvent(i,s):this._onHandleMove(t,i,s,e,(()=>this._emitReshapeEvent(t)))}_onGraphicMoveStopCallback(e){const{graphic:t,dx:i,dy:s}=e,r=t===this.graphic,o="point"!==this._editGeometryOperations.data.type;this._activeOperationInfo.totalDx+=i,this._activeOperationInfo.totalDy+=s,this._onHandleMove(t,i,s,e,(()=>r?this._emitMoveStopEvent():this._emitReshapeStopEvent(t))),r&&o||this._isMidpoint(t)?this.refresh():(this._resetSnappingStateVars(),this._activeOperationInfo=null)}_updateMidpointGraphicLocations(e){for(const t of this.midpointGraphics){const{pathIndex:i,pointIndexStart:s,pointIndexEnd:r}=t.attributes,[o,n]=e[i][s],[a,h]=e[i][r],[c,p]=x([o,n],[a,h]);t.geometry=new H({x:c,y:p,spatialReference:this.view.spatialReference})}}_getIndicesForVertexGraphic({attributes:e}){return[e?.pathIndex||0,e?.pointIndex||0]}_getVertexFromEditGeometry(e){const[t,i]=this._getIndicesForVertexGraphic(e);return this._editGeometryOperations.data.components[t].vertices[i]}_onHandleMove(e,t,s,r,o){if(l(this._snappingTask),!this._snappingContext)return;const n=e.geometry,a="graphic-move-stop"===r.type;if(p(this.snappingManager)&&this.selectedVertices.length<2&&!a){const r=this.snappingManager;this._stagedVertex=r.update(n,this._snappingContext),this._syncGeometryAfterVertexMove(e,new H(this._stagedVertex),t,s,a),o(),this._snappingTask=i((async i=>{const h=await r.snap(n,this._snappingContext,i);h.valid&&(this._stagedVertex=h.apply(),this._syncGeometryAfterVertexMove(e,new H(this._stagedVertex),t,s,a),o())}))}else{const i=p(this._stagedVertex)?new H(this._stagedVertex):n;this._syncGeometryAfterVertexMove(e,i,t,s,a),o()}}async _syncGeometryAfterVertexMove(e,t,i,s,r=!1){const o=this._editGeometryOperations.data.geometry;if("point"===o.type)e.geometry=t;else{const{x:n,y:a}=t,[h,c]=this._getIndicesForVertexGraphic(e);let p=u(o);const l=p[h].length-1;p[h][c]=[n,a],"polygon"===o.type&&(0===c?p[h][l]=[n,a]:c===l&&(p[h][0]=[n,a])),this._isVertex(e)&&(p=this._moveRelatedCoordinates(p,e,n,a),p=this._moveSelectedHandleCoordinates(p,e,i,s,"polygon"===o.type),this._updateMidpointGraphicLocations(p)),this.graphic.geometry=o.clone();const d=this._getVertexFromEditGeometry(e),m=n-d.pos[0],v=a-d.pos[1];this._editGeometryOperations.moveVertices([d],m,v,0),r&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(e),t):e.geometry=t)}}_moveRelatedCoordinates(e,t,i,s){const{relatedGraphicIndices:r}=t.attributes;for(const o of r){const r=this.vertexGraphics.getItemAt(o),{pathIndex:n,pointIndex:a}=r.attributes;e[n][a]=[i,s],r.geometry=t.geometry}return e}_moveSelectedHandleCoordinates(e,t,i,s,r){for(const o of this.selectedVertices)if(o!==t){const{pathIndex:t,pointIndex:n,relatedGraphicIndices:a}=o.attributes,h=M(o.geometry,i,s,this.view),c=e[t].length-1;e[t][n]=[h.x,h.y],o.geometry=h,r&&(0===n?e[t][c]=[h.x,h.y]:n===c&&(e[t][0]=[h.x,h.y]));for(const i of a){const t=this.vertexGraphics.getItemAt(i),{pathIndex:s,pointIndex:r}=t.attributes;e[s][r]=[h.x,h.y],t.geometry=h}}return e}_onGraphicPointerOverCallback(e){const t=e.graphic;this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.hover),this._updateHoverCursor(t)}_onGraphicPointerOutCallback(e){const t=e.graphic;this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.default),this.view.cursor="default"}_createVertexFromMidpoint(e){const{_graphicAttributes:t,graphic:i}=this,s=i.geometry;if(c(s)||"polygon"!==s.type&&"polyline"!==s.type)return[];const r=s.clone(),o=[],{pathIndex:n,pointIndexStart:a,pointIndexEnd:h}=e.attributes,{x:p,y:l}=e.geometry,d=0===h?a+1:h,m=u(r);return m[n].splice(d,0,[p,l]),e.attributes={...t,pathIndex:n,pointIndex:d,relatedGraphicIndices:[]},o.push({coordinates:m[n][d],componentIndex:n,vertexIndex:d}),this.graphic.geometry=r,o}_addToSelection(e){e instanceof t&&(e=[e]);for(const t of e)t.symbol=this.symbols.vertices.selected;this._set("selectedVertices",this.selectedVertices.concat(e)),this._emitSelectEvent(e)}_removeFromSelection(e,i){const{vertices:s}=this.symbols,r=i?s.hover:s.default;e instanceof t&&(e=[e]);for(const t of e)this.selectedVertices.splice(this.selectedVertices.indexOf(t),1),this._set("selectedVertices",this.selectedVertices),t.set("symbol",r);this._emitDeselectEvent(e)}_clearSelection(){if(this.selectedVertices.length){const e=this.selectedVertices;for(const t of this.selectedVertices)t.set("symbol",this.symbols.vertices.default);this._set("selectedVertices",[]),this._emitDeselectEvent(e)}}_keyDownHandler(e){O.delete.includes(e.key)&&!e.repeat&&this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_removeVertices(e){const i=this.graphic.geometry;if(c(i)||"polygon"!==i.type&&"polyline"!==i.type)return;if("polygon"===i.type&&this.vertexGraphics.length<4||this.vertexGraphics.length<3)return;e instanceof t&&(e=[e]);const s=this.graphic.clone(),r=i.clone();let o=u(r);const n=[];e instanceof t&&(e=[e]);for(const t of e){const{x:e,y:i}=t.geometry;for(let t=0;t<o.length;t++){const s=o[t];for(let r=0;r<s.length;r++){const[a,h]=s[r];e===a&&i===h&&(n.push({coordinates:o[t][r],componentIndex:t,vertexIndex:r}),o[t].splice(Number(r),1))}}}if("polygon"===r.type)o=o.filter((e=>{if(e.length<2)return!1;const[t,i]=e[0],[s,r]=e[e.length-1];return(2!==e.length||t!==s||i!==r)&&(t===s&&i===r||e.push(e[0]),!0)})),r.rings=o;else{for(const e of o)1===e.length&&o.splice(o.indexOf(e),1);r.paths=o}this.graphic.geometry=r,this.refresh(),this._emitVertexRemoveEvent(e,s,n)}_isVertex(e){return this.vertexGraphics.includes(e)}_isSelected(e){return this._isVertex(e)&&this.selectedVertices.includes(e)}_isMidpoint(e){return this.midpointGraphics.includes(e)}_updateHoverCursor(e){this.view.cursor=this._isMidpoint(e)?"copy":"move"}_emitMoveStartEvent(e,t){const i=new D(this.graphic,e,t);this.emit("move-start",i),this.callbacks.onMoveStart&&this.callbacks.onMoveStart(i)}_emitMoveEvent(e,t){const i=new F(this.graphic,e,t);this.emit("move",i),this.callbacks.onMove&&this.callbacks.onMove(i)}_emitMoveStopEvent(){const{totalDx:e,totalDy:t}=this._activeOperationInfo,i=new z(this.graphic,e,t);this.emit("move-stop",i),this.callbacks.onMoveStop&&this.callbacks.onMoveStop(i)}_emitReshapeStartEvent(e){const t=new A(this.graphic,e,this.selectedVertices);this.emit("reshape-start",t),this.callbacks.onReshapeStart&&this.callbacks.onReshapeStart(t)}_emitReshapeEvent(e){const t=new U(this.graphic,e,this.selectedVertices);this.emit("reshape",t),this.callbacks.onReshape&&this.callbacks.onReshape(t)}_emitReshapeStopEvent(e){const t=new T(this.graphic,e,this.selectedVertices);this.emit("reshape-stop",t),this.callbacks.onReshapeStop&&this.callbacks.onReshapeStop(t)}_emitSelectEvent(e){const t=new L(e);this.emit("select",t),this.callbacks.onVertexSelect&&this.callbacks.onVertexSelect(t)}_emitDeselectEvent(e){const t=new P(e);this.emit("deselect",t),this.callbacks.onVertexDeselect&&this.callbacks.onVertexDeselect(t)}_emitVertexAddEvent(e,t,i){const s=new K(e,this.graphic,t,i);this.emit("vertex-add",s),this.callbacks.onVertexAdd&&this.callbacks.onVertexAdd(s)}_emitVertexRemoveEvent(e,t,i){const s=new N(e,this.graphic,t,i);this.emit("vertex-remove",s),this.callbacks.onVertexRemove&&this.callbacks.onVertexRemove(s)}_logGeometryTypeError(){a.getLogger(this.declaredClass).error(new r("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};e([y()],J.prototype,"callbacks",void 0),e([y()],J.prototype,"enableMidpoints",void 0),e([y()],J.prototype,"enableMovement",void 0),e([y()],J.prototype,"enableVertices",void 0),e([y()],J.prototype,"graphic",void 0),e([y({value:!0})],J.prototype,"highlightsEnabled",null),e([y()],J.prototype,"layer",void 0),e([y({readOnly:!0})],J.prototype,"midpointGraphics",void 0),e([y()],J.prototype,"midpointSymbol",void 0),e([y({readOnly:!0})],J.prototype,"selectedVertices",void 0),e([y()],J.prototype,"snappingManager",void 0),e([y({readOnly:!0})],J.prototype,"state",null),e([y({value:B})],J.prototype,"symbols",null),e([y({readOnly:!0})],J.prototype,"type",void 0),e([y({readOnly:!0})],J.prototype,"vertexGraphics",void 0),e([y()],J.prototype,"view",void 0),J=e([_("esri.views.draw.support.Reshape")],J);const Q=J;export{Q 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 e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import i from"../../core/Evented.js";import{isNone as o,isSome as s}from"../../core/maybe.js";import{watch as r,sync as l}from"../../core/reactiveUtils.js";import{pt2px as a,screenPointObjectToArray as n,createScreenPointArray as c}from"../../core/screenUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{j as m}from"../../chunks/vec2.js";import{i as u}from"../../chunks/vec3.js";import{c as y}from"../../chunks/vec3f64.js";import{canProjectWithoutEngine as g,project as b,projectPointToVector as d}from"../../geometry/projection.js";import{getGraphicEffectiveElevationMode as f}from"../../support/elevationInfoUtils.js";import{getDefaultSymbol2D as _}from"../../symbols/support/defaults.js";import v from"../../symbols/support/ElevationInfo.js";import{intersectsDrapedGeometry as S}from"../support/drapedUtils.js";let C=class extends t{constructor(e){super(e),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.events=new i.EventEmitter,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}set graphic(e){this._circleCollisionCache=null,this._originalSymbol=e.symbol,this._set("graphic",e),this.attachSymbolChanged()}get elevationInfo(){const e="elevationInfo"in this.graphic.layer&&this.graphic.layer.elevationInfo,t=f(this.graphic),i=e?e.offset:0;return new v({mode:t,offset:i})}set focusedSymbol(e){e!==this._get("focusedSymbol")&&(this._set("focusedSymbol",e),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(e){e!==this._get("grabbing")&&(this._set("grabbing",e),this._updateGraphicSymbol())}set hovering(e){e!==this._get("hovering")&&(this._set("hovering",e),this._updateGraphicSymbol())}set selected(e){e!==this._get("selected")&&(this._set("selected",e),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(e){const t=this.graphic;if(!1===t.visible)return null;const i=t.geometry;if(o(i))return null;const r=this._get("focusedSymbol"),l=s(r)?r:t.symbol;return"2d"===this.view.type?this._intersectDistance2D(this.view,e,i,l):this._intersectDistance3D(this.view,e,t)}attach(){this.attachSymbolChanged(),s(this.layer)&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),s(this.layer)&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=r((()=>this.graphic?.symbol),(e=>{s(e)&&e!==this.focusedSymbol&&e!==this._originalSymbol&&(this._originalSymbol=e,this._focused&&s(this.focusedSymbol)&&(this.graphic.symbol=this.focusedSymbol))}),l)}detachSymbolChanged(){s(this._graphicSymbolChangedHandle)&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&s(this.focusedSymbol)?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(e,t,i,r){if(r=r||_(i),o(r))return null;const l=1;let c=this._circleCollisionCache;if("point"!==i.type||"simple-marker"!==r.type)return S(t,i,e)?l:null;if(o(c)||!c.originalPoint.equals(i)){const t=i,o=e.spatialReference;if(g(t.spatialReference,o)){const e=b(t,o);c={originalPoint:t.clone(),mapPoint:e,radiusPx:a(r.size)},this._circleCollisionCache=c}}if(s(c)){const i=n(t,D),o=e.toScreen(c.mapPoint),s=c.radiusPx,h=o.x+a(r.xoffset),p=o.y-a(r.yoffset);return m(i,[h,p])<s*s?l:null}return null}_intersectDistance3D(e,t,i){const o=e.toMap(t,{include:[i]});return o&&d(o,j,e.renderSpatialReference)?u(j,e.state.camera.eye):null}};e([h({constructOnly:!0,nonNullable:!0})],C.prototype,"graphic",null),e([h()],C.prototype,"elevationInfo",null),e([h({constructOnly:!0,nonNullable:!0})],C.prototype,"view",void 0),e([h({value:null})],C.prototype,"focusedSymbol",null),e([h({constructOnly:!0})],C.prototype,"layer",void 0),e([h()],C.prototype,"interactive",void 0),e([h()],C.prototype,"selectable",void 0),e([h()],C.prototype,"grabbable",void 0),e([h({value:!1})],C.prototype,"grabbing",null),e([h()],C.prototype,"dragging",void 0),e([h()],C.prototype,"hovering",null),e([h({value:!1})],C.prototype,"selected",null),e([h()],C.prototype,"cursor",void 0),C=e([p("esri.views.interactive.GraphicManipulator")],C);const j=y(),D=c();export{C as GraphicManipulator};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import i from"../../core/Evented.js";import{isNone as o,isSome as s}from"../../core/maybe.js";import{watch as r,sync as l}from"../../core/reactiveUtils.js";import{pt2px as a,screenPointObjectToArray as n,createScreenPointArray as c}from"../../core/screenUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{k as m}from"../../chunks/vec2.js";import{i as u}from"../../chunks/vec3.js";import{c as y}from"../../chunks/vec3f64.js";import{canProjectWithoutEngine as g,project as b,projectPointToVector as d}from"../../geometry/projection.js";import{getGraphicEffectiveElevationMode as f}from"../../support/elevationInfoUtils.js";import{getDefaultSymbol2D as _}from"../../symbols/support/defaults.js";import v from"../../symbols/support/ElevationInfo.js";import{intersectsDrapedGeometry as S}from"../support/drapedUtils.js";let C=class extends t{constructor(e){super(e),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.events=new i.EventEmitter,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}set graphic(e){this._circleCollisionCache=null,this._originalSymbol=e.symbol,this._set("graphic",e),this.attachSymbolChanged()}get elevationInfo(){const e="elevationInfo"in this.graphic.layer&&this.graphic.layer.elevationInfo,t=f(this.graphic),i=e?e.offset:0;return new v({mode:t,offset:i})}set focusedSymbol(e){e!==this._get("focusedSymbol")&&(this._set("focusedSymbol",e),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(e){e!==this._get("grabbing")&&(this._set("grabbing",e),this._updateGraphicSymbol())}set hovering(e){e!==this._get("hovering")&&(this._set("hovering",e),this._updateGraphicSymbol())}set selected(e){e!==this._get("selected")&&(this._set("selected",e),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(e){const t=this.graphic;if(!1===t.visible)return null;const i=t.geometry;if(o(i))return null;const r=this._get("focusedSymbol"),l=s(r)?r:t.symbol;return"2d"===this.view.type?this._intersectDistance2D(this.view,e,i,l):this._intersectDistance3D(this.view,e,t)}attach(){this.attachSymbolChanged(),s(this.layer)&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),s(this.layer)&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=r((()=>this.graphic?.symbol),(e=>{s(e)&&e!==this.focusedSymbol&&e!==this._originalSymbol&&(this._originalSymbol=e,this._focused&&s(this.focusedSymbol)&&(this.graphic.symbol=this.focusedSymbol))}),l)}detachSymbolChanged(){s(this._graphicSymbolChangedHandle)&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&s(this.focusedSymbol)?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(e,t,i,r){if(r=r||_(i),o(r))return null;const l=1;let c=this._circleCollisionCache;if("point"!==i.type||"simple-marker"!==r.type)return S(t,i,e)?l:null;if(o(c)||!c.originalPoint.equals(i)){const t=i,o=e.spatialReference;if(g(t.spatialReference,o)){const e=b(t,o);c={originalPoint:t.clone(),mapPoint:e,radiusPx:a(r.size)},this._circleCollisionCache=c}}if(s(c)){const i=n(t,D),o=e.toScreen(c.mapPoint),s=c.radiusPx,h=o.x+a(r.xoffset),p=o.y-a(r.yoffset);return m(i,[h,p])<s*s?l:null}return null}_intersectDistance3D(e,t,i){const o=e.toMap(t,{include:[i]});return o&&d(o,j,e.renderSpatialReference)?u(j,e.state.camera.eye):null}};e([h({constructOnly:!0,nonNullable:!0})],C.prototype,"graphic",null),e([h()],C.prototype,"elevationInfo",null),e([h({constructOnly:!0,nonNullable:!0})],C.prototype,"view",void 0),e([h({value:null})],C.prototype,"focusedSymbol",null),e([h({constructOnly:!0})],C.prototype,"layer",void 0),e([h()],C.prototype,"interactive",void 0),e([h()],C.prototype,"selectable",void 0),e([h()],C.prototype,"grabbable",void 0),e([h({value:!1})],C.prototype,"grabbing",null),e([h()],C.prototype,"dragging",void 0),e([h()],C.prototype,"hovering",null),e([h({value:!1})],C.prototype,"selected",null),e([h()],C.prototype,"cursor",void 0),C=e([p("esri.views.interactive.GraphicManipulator")],C);const j=y(),D=c();export{C as GraphicManipulator};
@@ -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{createTask as s}from"../../core/asyncUtils.js";import{makeHandle as o}from"../../core/handleUtils.js";import{isNone as i,isSome as r,applySome as a}from"../../core/maybe.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import{formatLength as l}from"../../core/quantityFormatUtils.js";import{watch as c,on as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as h}from"../../core/screenUtils.js";import{getDefaultUnitForView as d}from"../../core/unitUtils.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{j as b,s as f,f as g,b as _,m as x,i as y}from"../../chunks/vec2.js";import{a as v}from"../../chunks/vec2f64.js";import{z as j}from"../../chunks/vec3.js";import{isClockwise as U}from"../../geometry/support/coordsUtils.js";import{fetchMessageBundle as I}from"../../intl/messages.js";import{getGeometryEffectiveElevationMode as L}from"../../support/elevationInfoUtils.js";import D from"../overlay/TextOverlayItem.js";import{autoDirectDistanceByElevationMode as O}from"../support/automaticLengthMeasurementUtils.js";const S=3025,w={default:15,far:25};let P=class extends t{constructor(e){super(e),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const e=s((async e=>{const t=await I("esri/core/t9n/Units");n(e),this._messagesUnits=t})),t=()=>a(this.context,(e=>e.editGeometryOperations));this.addHandles([c((()=>[r(this.context)&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((e=>p(t,e,(()=>this._update())))),o((()=>e.abort()))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return i(this._messagesUnits)}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map((e=>e.label.text))}}get _edgeDistancePixels(){return w[this.edgeDistance]}_update(){this._nextLabelIndex=0;const e=this.context;if(i(e))return void this._destroyUnusedLabels();const{components:t,geometry:s,coordinateHelper:o}=e.editGeometryOperations.data;if(!s)return void this._destroyUnusedLabels();const a=t.length;for(let i=0;i<a;++i){const n=[];if(t[i].iterateVertices((e=>{n.push(o.toXYZ(e.pos))})),0===i&&r(this.stagedVertex)&&n.push(o.toXYZ(this.stagedVertex)),n.length<2)continue;const l=n[0],c=n[n.length-1];"polygon"===s.type&&n.length>2&&!j(l,c)&&n.push(l);const p=1===a&&!U(n,!1,!1);let h=C,d=G;this.toScreenPointArray(e,l,h);for(let t=1;t<n.length;++t){const s=n[t-1],o=n[t];this.toScreenPointArray(e,o,d),this._addLabel(e,s,h,o,d,p),[h,d]=[d,h]}}this._destroyUnusedLabels()}_addLabel(e,t,s,o,i,a){const{label:n}=this._getOrCreateLabel(e);if(!this.visible||b(s,i)<S)return void(n.visible=!1);const c=r(e.graphicState)?e.graphicState.isDraped?"on-the-ground":"absolute-height":L(e.editGeometryOperations.data.geometry,e.elevationInfo),{spatialReference:p}=e.editGeometryOperations.data,h=O(t,o,p,c),m=this._messagesUnits,u=d(e.view);n.text=r(m)&&r(h)?l(m,h,u):"",n.visible=!0;const v=i[0]-s[0],j=i[1]-s[1];a?f(V,-j,v):f(V,j,-v),g(V,V),_(V,V,this._edgeDistancePixels),x(k,s,i,.5),y(k,k,V),n.position=[k[0],k[1]],Math.abs(V[0])>Math.abs(V[1])?n.anchor=V[0]>0?"left":"right":n.anchor=-V[1]<0?"top":"bottom"}_getOrCreateLabel(e){if(this._labelInfos.length>this._nextLabelIndex)return this._labelInfos[this._nextLabelIndex++];const t=new D({fontSize:10,anchor:"center"});e.view.overlay.items.add(t);const s={label:t};return this._labelInfos.push(s),this._nextLabelIndex=this._labelInfos.length,s}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:e}){a(this.context,(t=>t.view.overlay.items.remove(e))),e.destroy()}};e([m()],P.prototype,"context",void 0),e([m()],P.prototype,"stagedVertex",void 0),e([m()],P.prototype,"visible",void 0),e([m()],P.prototype,"edgeDistance",void 0),e([m()],P.prototype,"updating",null),e([m()],P.prototype,"_messagesUnits",void 0),e([m()],P.prototype,"_edgeDistancePixels",null),P=e([u("esri.views.interactive")],P);const V=v(),k=v(),C=h(),G=h();export{P as SegmentLabels};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import{makeHandle as o}from"../../core/handleUtils.js";import{isNone as i,isSome as r,applySome as a}from"../../core/maybe.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import{formatLength as l}from"../../core/quantityFormatUtils.js";import{watch as c,on as p}from"../../core/reactiveUtils.js";import{createScreenPointArray as h}from"../../core/screenUtils.js";import{getDefaultUnitForView as d}from"../../core/unitUtils.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{k as b,s as f,f as g,b as _,l as x,j as y}from"../../chunks/vec2.js";import{a as v}from"../../chunks/vec2f64.js";import{z as j}from"../../chunks/vec3.js";import{isClockwise as U}from"../../geometry/support/coordsUtils.js";import{fetchMessageBundle as I}from"../../intl/messages.js";import{getGeometryEffectiveElevationMode as L}from"../../support/elevationInfoUtils.js";import D from"../overlay/TextOverlayItem.js";import{autoDirectDistanceByElevationMode as O}from"../support/automaticLengthMeasurementUtils.js";const S=3025,w={default:15,far:25};let P=class extends t{constructor(e){super(e),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const e=s((async e=>{const t=await I("esri/core/t9n/Units");n(e),this._messagesUnits=t})),t=()=>a(this.context,(e=>e.editGeometryOperations));this.addHandles([c((()=>[r(this.context)&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((e=>p(t,e,(()=>this._update())))),o((()=>e.abort()))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return i(this._messagesUnits)}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map((e=>e.label.text))}}get _edgeDistancePixels(){return w[this.edgeDistance]}_update(){this._nextLabelIndex=0;const e=this.context;if(i(e))return void this._destroyUnusedLabels();const{components:t,geometry:s,coordinateHelper:o}=e.editGeometryOperations.data;if(!s)return void this._destroyUnusedLabels();const a=t.length;for(let i=0;i<a;++i){const n=[];if(t[i].iterateVertices((e=>{n.push(o.toXYZ(e.pos))})),0===i&&r(this.stagedVertex)&&n.push(o.toXYZ(this.stagedVertex)),n.length<2)continue;const l=n[0],c=n[n.length-1];"polygon"===s.type&&n.length>2&&!j(l,c)&&n.push(l);const p=1===a&&!U(n,!1,!1);let h=C,d=G;this.toScreenPointArray(e,l,h);for(let t=1;t<n.length;++t){const s=n[t-1],o=n[t];this.toScreenPointArray(e,o,d),this._addLabel(e,s,h,o,d,p),[h,d]=[d,h]}}this._destroyUnusedLabels()}_addLabel(e,t,s,o,i,a){const{label:n}=this._getOrCreateLabel(e);if(!this.visible||b(s,i)<S)return void(n.visible=!1);const c=r(e.graphicState)?e.graphicState.isDraped?"on-the-ground":"absolute-height":L(e.editGeometryOperations.data.geometry,e.elevationInfo),{spatialReference:p}=e.editGeometryOperations.data,h=O(t,o,p,c),m=this._messagesUnits,u=d(e.view);n.text=r(m)&&r(h)?l(m,h,u):"",n.visible=!0;const v=i[0]-s[0],j=i[1]-s[1];a?f(V,-j,v):f(V,j,-v),g(V,V),_(V,V,this._edgeDistancePixels),x(k,s,i,.5),y(k,k,V),n.position=[k[0],k[1]],Math.abs(V[0])>Math.abs(V[1])?n.anchor=V[0]>0?"left":"right":n.anchor=-V[1]<0?"top":"bottom"}_getOrCreateLabel(e){if(this._labelInfos.length>this._nextLabelIndex)return this._labelInfos[this._nextLabelIndex++];const t=new D({fontSize:10,anchor:"center"});e.view.overlay.items.add(t);const s={label:t};return this._labelInfos.push(s),this._nextLabelIndex=this._labelInfos.length,s}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:e}){a(this.context,(t=>t.view.overlay.items.remove(e))),e.destroy()}};e([m()],P.prototype,"context",void 0),e([m()],P.prototype,"stagedVertex",void 0),e([m()],P.prototype,"visible",void 0),e([m()],P.prototype,"edgeDistance",void 0),e([m()],P.prototype,"updating",null),e([m()],P.prototype,"_messagesUnits",void 0),e([m()],P.prototype,"_edgeDistancePixels",null),P=e([u("esri.views.interactive")],P);const V=v(),k=v(),C=h(),G=h();export{P as SegmentLabels};
@@ -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{m as e,d as t,c as r}from"../../chunks/vec2.js";import{a,f as i,b as n}from"../../chunks/vec2f64.js";import{h as s,i as o,c as u}from"../../chunks/vec3.js";import{f as c,c as h,d as p}from"../../chunks/vec3f64.js";import{l as v,c as y}from"../../chunks/vec4.js";import{c as l,f as d,b as f}from"../../chunks/vec4f64.js";import T from"../../geometry/Point.js";var _;!function(e){e[e.Z=0]="Z",e[e.M=1]="M"}(_||(_={}));class m{constructor(e){this.spatialReference=e}createVector(){return this._tag(a())}pointToVector(e){return this._tag(i(e.x,e.y))}arrayToVector(e){return this._tag(i(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.hasZ=!1,t.hasM=!1,t.spatialReference=this.spatialReference,t}lerp(t,r,a,i){return e(i,t,r,a)}addDelta(e,t,r){e[0]+=t,e[1]+=r}distance(e,r){return t(e,r)}getZ(e,t){return t}hasZ(){return!1}getM(e,t){return t}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,t){return r(t,e)}fromXYZ(e){return this._tag(i(e[0],e[1]))}toXYZ(e,t=0){return c(e[0],e[1],t)}_tag(e){return e}}class Z{constructor(e,t){this._valueType=e,this.spatialReference=t}createVector(){return this._tag(h())}pointToVector(e){return this._tag(c(e.x,e.y,this._valueType===_.Z?e.z:e.m))}arrayToVector(e){return this._tag(c(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this._valueType===_.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=this._valueType===_.Z?e[2]:void 0,t.m=this._valueType===_.M?e[2]:void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=this._valueType===_.Z?e[2]:void 0,t.m=this._valueType===_.M?e[2]:void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){const r=this._valueType===_.Z,a=this._valueType===_.M;return t.x=e[0],t.y=e[1],t.z=r?e[2]:void 0,t.m=a?e[2]:void 0,t.hasZ=r,t.hasM=a,t.spatialReference=this.spatialReference,t}lerp(e,t,r,a){return s(a,e,t,r)}addDelta(e,t,r,a){e[0]+=t,e[1]+=r,this._valueType===_.Z&&(e[2]+=a)}distance(e,r){return this._valueType===_.Z?o(e,r):t(e,r)}getZ(e,t){return this._valueType===_.Z?e[2]:t}hasZ(){return this._valueType===_.Z}getM(e,t){return this._valueType===_.M?e[2]:t}hasM(){return this._valueType===_.M}clone(e){return this._tag(p(e))}copy(e,t){return u(t,e)}fromXYZ(e,t=0,r=0){return this._tag(c(e[0],e[1],this._valueType===_.Z?e.length>2?e[2]:t:r))}toXYZ(e,t=0){return this._tag(c(e[0],e[1],this._valueType===_.Z?e[2]:t))}_tag(e){return e}}class g{constructor(e){this.spatialReference=e}createVector(){return this._tag(l())}pointToVector(e){return this._tag(d(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(d(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.hasZ=!0,t.hasM=!0,t.spatialReference=this.spatialReference,t}lerp(e,t,r,a){return v(a,e,t,r)}addDelta(e,t,r,a){e[0]+=t,e[1]+=r,e[2]+=a}distance(e,t){return o(e,t)}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(f(e))}copy(e,t){return y(t,e)}fromXYZ(e,t=0,r=0){return this._tag(d(e[0],e[1],e.length>2?e[2]:t,r))}toXYZ(e){return c(e[0],e[1],e[2])}_tag(e){return e}}function R(e,t,r){return e&&t?new g(r):t?new Z(_.M,r):e?new Z(_.Z,r):new m(r)}export{m as CoordinateHelper2D,Z as CoordinateHelper3D,g as CoordinateHelper4D,R as createCoordinateHelper};
5
+ import{l as e,d as t,c as r}from"../../chunks/vec2.js";import{a,f as i,b as n}from"../../chunks/vec2f64.js";import{h as s,i as o,c as u}from"../../chunks/vec3.js";import{f as c,c as h,d as p}from"../../chunks/vec3f64.js";import{l as v,c as y}from"../../chunks/vec4.js";import{c as l,f as d,b as f}from"../../chunks/vec4f64.js";import T from"../../geometry/Point.js";var _;!function(e){e[e.Z=0]="Z",e[e.M=1]="M"}(_||(_={}));class m{constructor(e){this.spatialReference=e}createVector(){return this._tag(a())}pointToVector(e){return this._tag(i(e.x,e.y))}arrayToVector(e){return this._tag(i(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.hasZ=!1,t.hasM=!1,t.spatialReference=this.spatialReference,t}lerp(t,r,a,i){return e(i,t,r,a)}addDelta(e,t,r){e[0]+=t,e[1]+=r}distance(e,r){return t(e,r)}getZ(e,t){return t}hasZ(){return!1}getM(e,t){return t}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,t){return r(t,e)}fromXYZ(e){return this._tag(i(e[0],e[1]))}toXYZ(e,t=0){return c(e[0],e[1],t)}_tag(e){return e}}class Z{constructor(e,t){this._valueType=e,this.spatialReference=t}createVector(){return this._tag(h())}pointToVector(e){return this._tag(c(e.x,e.y,this._valueType===_.Z?e.z:e.m))}arrayToVector(e){return this._tag(c(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this._valueType===_.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=this._valueType===_.Z?e[2]:void 0,t.m=this._valueType===_.M?e[2]:void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=this._valueType===_.Z?e[2]:void 0,t.m=this._valueType===_.M?e[2]:void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){const r=this._valueType===_.Z,a=this._valueType===_.M;return t.x=e[0],t.y=e[1],t.z=r?e[2]:void 0,t.m=a?e[2]:void 0,t.hasZ=r,t.hasM=a,t.spatialReference=this.spatialReference,t}lerp(e,t,r,a){return s(a,e,t,r)}addDelta(e,t,r,a){e[0]+=t,e[1]+=r,this._valueType===_.Z&&(e[2]+=a)}distance(e,r){return this._valueType===_.Z?o(e,r):t(e,r)}getZ(e,t){return this._valueType===_.Z?e[2]:t}hasZ(){return this._valueType===_.Z}getM(e,t){return this._valueType===_.M?e[2]:t}hasM(){return this._valueType===_.M}clone(e){return this._tag(p(e))}copy(e,t){return u(t,e)}fromXYZ(e,t=0,r=0){return this._tag(c(e[0],e[1],this._valueType===_.Z?e.length>2?e[2]:t:r))}toXYZ(e,t=0){return this._tag(c(e[0],e[1],this._valueType===_.Z?e[2]:t))}_tag(e){return e}}class g{constructor(e){this.spatialReference=e}createVector(){return this._tag(l())}pointToVector(e){return this._tag(d(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(d(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.hasZ=!0,t.hasM=!0,t.spatialReference=this.spatialReference,t}lerp(e,t,r,a){return v(a,e,t,r)}addDelta(e,t,r,a){e[0]+=t,e[1]+=r,e[2]+=a}distance(e,t){return o(e,t)}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(f(e))}copy(e,t){return y(t,e)}fromXYZ(e,t=0,r=0){return this._tag(d(e[0],e[1],e.length>2?e[2]:t,r))}toXYZ(e){return c(e[0],e[1],e[2])}_tag(e){return e}}function R(e,t,r){return e&&t?new g(r):t?new Z(_.M,r):e?new Z(_.Z,r):new m(r)}export{m as CoordinateHelper2D,Z as CoordinateHelper3D,g as CoordinateHelper4D,R as createCoordinateHelper};
@@ -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 s}from"../../../../core/maybe.js";import{max as o}from"../../../../core/quantityUtils.js";import{q as i,s as t,h as n,x as r,y as a,a as e,i as c,b as g}from"../../../../chunks/vec2.js";import{a as b,I as f,g as u,b as m,h as p,f as I,n as d,e as N,l as h,C as j}from"../../../../chunks/vec3.js";import{f as l,Z as x}from"../../../../chunks/vec3f64.js";import{a as E,u as T}from"../../../../chunks/boundedPlane.js";import{sv2d as V,sv3d as v}from"../../../../geometry/support/vectorStacks.js";import{MoveVertex as C}from"../operations/MoveVertex.js";import{RotateVertex as R}from"../operations/RotateVertex.js";import{ScaleVertex as k}from"../operations/ScaleVertex.js";import{UpdateVertices as y}from"../operations/UpdateVertices.js";import{autoHorizontalDistanceByElevationMode as F}from"../../../support/automaticLengthMeasurementUtils.js";function S(s,o){return _(s,o,!1)}function Y(s,o){return _(s,o,!0)}function _(s,o,i){if(s instanceof y){if(s.operation instanceof C)return P(s.operation,o,i),!0;if(s.operation instanceof R)return U(s.operation,o,i),!0;if(s.operation instanceof k)return q(s.operation,o,i),!0}return!1}function P(s,o,i=!1){const t=i?-1:1,n=l(t*s.dx,t*s.dy,t*s.dz);b(o.origin,o.origin,n)}function U(s,o,i=!1){const t=i?-s.angle:s.angle;f(o.basis1,o.basis1,x,t),f(o.basis2,o.basis2,x,t)}function q(s,o,t=!1){const n=t?1/s.factor1:s.factor1,r=t?1/s.factor2:s.factor2;u(o.basis1,o.basis1,n),u(o.basis2,o.basis2,r),i(o.origin,o.origin,s.origin,s.axis1,n),i(o.origin,o.origin,s.origin,s.axis2,r)}function A(s,o,i,b){b||(b=E());const f=t(V.get(),s[1],-s[0]),u=t(V.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),m=t(V.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=V.get();o.components.forEach((o=>o.vertices.forEach((o=>{const i=o.pos;t(p,n(s,i),n(f,i)),r(u,u,p),a(m,m,p)}))));const I=1e-6,d=t(V.get(),m[0]-u[0]<I?i/2:0,m[1]-u[1]<I?i/2:0);return e(u,u,d),c(m,m,d),g(b.basis1,s,(m[0]-u[0])/2),g(b.basis2,f,(m[1]-u[1])/2),t(b.origin,u[0]*s[0]+u[1]*f[0],u[0]*s[1]+u[1]*f[1]),c(b.origin,b.origin,b.basis1),c(b.origin,b.origin,b.basis2),b}function G(s,o,i,t=0,n){n||(n=E()),o.toRenderCoords(s.origin,i,n.origin);const r=v.get();b(r,s.origin,s.basis1),b(r,r,s.basis2),o.toRenderCoords(r,i,r);const a=v.get();b(a,s.origin,s.basis1),m(a,a,s.basis2),o.toRenderCoords(a,i,a);const e=v.get();m(e,s.origin,s.basis1),m(e,e,s.basis2),o.toRenderCoords(e,i,e);const c=v.get();m(c,s.origin,s.basis1),b(c,c,s.basis2),o.toRenderCoords(c,i,c);const g=p(v.get(),r,a,.5);m(g,g,n.origin);const f=p(v.get(),e,c,.5);m(f,n.origin,f),p(n.basis1,g,f,.5);const j=p(v.get(),c,r,.5);m(j,j,n.origin);const l=p(v.get(),a,e,.5);m(l,n.origin,l),p(n.basis2,j,l,.5);const x=I(v.get(),n.basis1,n.basis2),V=I(x,x,n.basis1);return d(V,V),u(n.basis2,V,N(n.basis2,V)),u(n.basis1,n.basis1,1+t/h(n.basis1)),u(n.basis2,n.basis2,1+t/h(n.basis2)),T(n),n}function M(i,t,n,r){const a=v.get();m(a,m(a,i.origin,i.basis1),i.basis2);const e=v.get();j(e,a,i.basis1,2);const c=v.get();j(c,e,i.basis2,2);const g=v.get();j(g,a,i.basis2,2),a[2]=e[2]=c[2]=g[2]=t;const b=r?"on-the-ground":"absolute-height",f=o(F(a,e,n,b),F(g,c,n,b)),u=o(F(e,c,n,b),F(a,g,n,b));return s(u)||s(f)?null:[f,u]}export{S as apply,A as calculateOrientedBounds,M as mapPlaneAutoHorizontalSizeByElevationMode,G as mapPlaneToRenderPlane,Y as unapply};
5
+ import{isNone as s}from"../../../../core/maybe.js";import{max as o}from"../../../../core/quantityUtils.js";import{q as i,s as t,h as n,x as r,y as a,a as e,j as c,b as g}from"../../../../chunks/vec2.js";import{a as b,I as f,g as u,b as m,h as p,f as I,n as d,e as N,l as j,C as h}from"../../../../chunks/vec3.js";import{f as l,Z as x}from"../../../../chunks/vec3f64.js";import{a as E,u as T}from"../../../../chunks/boundedPlane.js";import{sv2d as V,sv3d as v}from"../../../../geometry/support/vectorStacks.js";import{MoveVertex as C}from"../operations/MoveVertex.js";import{RotateVertex as R}from"../operations/RotateVertex.js";import{ScaleVertex as k}from"../operations/ScaleVertex.js";import{UpdateVertices as y}from"../operations/UpdateVertices.js";import{autoHorizontalDistanceByElevationMode as F}from"../../../support/automaticLengthMeasurementUtils.js";function S(s,o){return _(s,o,!1)}function Y(s,o){return _(s,o,!0)}function _(s,o,i){if(s instanceof y){if(s.operation instanceof C)return P(s.operation,o,i),!0;if(s.operation instanceof R)return U(s.operation,o,i),!0;if(s.operation instanceof k)return q(s.operation,o,i),!0}return!1}function P(s,o,i=!1){const t=i?-1:1,n=l(t*s.dx,t*s.dy,t*s.dz);b(o.origin,o.origin,n)}function U(s,o,i=!1){const t=i?-s.angle:s.angle;f(o.basis1,o.basis1,x,t),f(o.basis2,o.basis2,x,t)}function q(s,o,t=!1){const n=t?1/s.factor1:s.factor1,r=t?1/s.factor2:s.factor2;u(o.basis1,o.basis1,n),u(o.basis2,o.basis2,r),i(o.origin,o.origin,s.origin,s.axis1,n),i(o.origin,o.origin,s.origin,s.axis2,r)}function A(s,o,i,b){b||(b=E());const f=t(V.get(),s[1],-s[0]),u=t(V.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),m=t(V.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=V.get();o.components.forEach((o=>o.vertices.forEach((o=>{const i=o.pos;t(p,n(s,i),n(f,i)),r(u,u,p),a(m,m,p)}))));const I=1e-6,d=t(V.get(),m[0]-u[0]<I?i/2:0,m[1]-u[1]<I?i/2:0);return e(u,u,d),c(m,m,d),g(b.basis1,s,(m[0]-u[0])/2),g(b.basis2,f,(m[1]-u[1])/2),t(b.origin,u[0]*s[0]+u[1]*f[0],u[0]*s[1]+u[1]*f[1]),c(b.origin,b.origin,b.basis1),c(b.origin,b.origin,b.basis2),b}function G(s,o,i,t=0,n){n||(n=E()),o.toRenderCoords(s.origin,i,n.origin);const r=v.get();b(r,s.origin,s.basis1),b(r,r,s.basis2),o.toRenderCoords(r,i,r);const a=v.get();b(a,s.origin,s.basis1),m(a,a,s.basis2),o.toRenderCoords(a,i,a);const e=v.get();m(e,s.origin,s.basis1),m(e,e,s.basis2),o.toRenderCoords(e,i,e);const c=v.get();m(c,s.origin,s.basis1),b(c,c,s.basis2),o.toRenderCoords(c,i,c);const g=p(v.get(),r,a,.5);m(g,g,n.origin);const f=p(v.get(),e,c,.5);m(f,n.origin,f),p(n.basis1,g,f,.5);const h=p(v.get(),c,r,.5);m(h,h,n.origin);const l=p(v.get(),a,e,.5);m(l,n.origin,l),p(n.basis2,h,l,.5);const x=I(v.get(),n.basis1,n.basis2),V=I(x,x,n.basis1);return d(V,V),u(n.basis2,V,N(n.basis2,V)),u(n.basis1,n.basis1,1+t/j(n.basis1)),u(n.basis2,n.basis2,1+t/j(n.basis2)),T(n),n}function M(i,t,n,r){const a=v.get();m(a,m(a,i.origin,i.basis1),i.basis2);const e=v.get();h(e,a,i.basis1,2);const c=v.get();h(c,e,i.basis2,2);const g=v.get();h(g,a,i.basis2,2),a[2]=e[2]=c[2]=g[2]=t;const b=r?"on-the-ground":"absolute-height",f=o(F(a,e,n,b),F(g,c,n,b)),u=o(F(e,c,n,b),F(a,g,n,b));return s(u)||s(f)?null:[f,u]}export{S as apply,A as calculateOrientedBounds,M as mapPlaneAutoHorizontalSizeByElevationMode,G as mapPlaneToRenderPlane,Y as unapply};
@@ -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{unwrap as e}from"../../../core/maybe.js";import{j as t}from"../../../chunks/vec2.js";import{a as r}from"../../../chunks/vec2f64.js";import{defaults as o}from"./Settings.js";import{SnappingAlgorithm as i}from"./SnappingAlgorithm.js";import{squareDistance as s}from"./snappingUtils.js";import{ParallelLineSnappingCandidate as n}from"./candidates/ParallelLineSnappingCandidate.js";import{anyMapPointToScreenPoint as l}from"../support/viewUtils.js";import{projectPointToLine as a}from"../../support/geometry2dUtils.js";class c extends i{constructor(){super(...arguments),this._tmpProjection=r()}snapNewVertex(e,t){const r=t.editGeometryOperations.data.components[0],o=r.edges.length,i=r.vertices.length,s=[];if(o<2)return s;const n=l(e,t.coordinateHelper,t.elevationInfo,this.view),a=r.vertices[i-1],c=r.vertices[0],h=r.edges[o-1];let p=h;do{this.edgeExceedsShortLineThreshold(p,t)&&(this._checkEdgeForParalleLines(p,a.pos,e,n,t,s),this._checkEdgeForParalleLines(p,c.pos,e,n,t,s)),p=p.leftVertex.leftEdge}while(p&&p!==h);return s}snapExistingVertex(t,r){const o=[],i=e(r.vertexHandle),s=i.component;if(s.edges.length<3)return o;const n=l(t,r.coordinateHelper,r.elevationInfo,this.view),a=i.leftEdge,c=i.rightEdge,h=s.vertices[0],p=s.vertices.length,d=s.vertices[p-1],g=s.edges[0];let m=g;do{m!==a&&m!==c&&this.edgeExceedsShortLineThreshold(m,r)&&(a&&this._checkEdgeForParalleLines(m,a.leftVertex.pos,t,n,r,o),c&&this._checkEdgeForParalleLines(m,c.rightVertex.pos,t,n,r,o),i===h?this._checkEdgeForParalleLines(m,d.pos,t,n,r,o):i===d&&this._checkEdgeForParalleLines(m,h.pos,t,n,r,o)),m=m.rightVertex.rightEdge}while(m&&m!==g);return o}_checkEdgeForParalleLines(e,r,i,c,h,p){const d=e.leftVertex.pos,g=e.rightVertex.pos;if(a(this._tmpProjection,r,d,g),t(this._tmpProjection,r)<o.parallelLineThreshold)return;a(this._tmpProjection,i,d,g,r);const{coordinateHelper:m,elevationInfo:f,pointer:v}=h,P=m.fromXYZ(this._tmpProjection,m.getZ(i,0));if(s(c,l(P,m,f,this.view))<this.squaredProximityTreshold(v)){if(this._parallelToPreviousCandidate(e,p))return;p.push(new n({coordinateHelper:m,referenceLine:e,lineStart:r,targetPoint:P,elevationInfo:f}))}}_parallelToPreviousCandidate(e,r){const i=e.leftVertex.pos,s=e.rightVertex.pos;for(const n of r)if(a(this._tmpProjection,s,n.constraint.start,n.constraint.end,i),t(this._tmpProjection,s)<o.parallelLineThreshold)return n.addReferenceLine(e),!0;return!1}}export{c as ParallelLineSnapper};
5
+ import{unwrap as e}from"../../../core/maybe.js";import{k as t}from"../../../chunks/vec2.js";import{a as r}from"../../../chunks/vec2f64.js";import{defaults as o}from"./Settings.js";import{SnappingAlgorithm as i}from"./SnappingAlgorithm.js";import{squareDistance as s}from"./snappingUtils.js";import{ParallelLineSnappingCandidate as n}from"./candidates/ParallelLineSnappingCandidate.js";import{anyMapPointToScreenPoint as l}from"../support/viewUtils.js";import{projectPointToLine as a}from"../../support/geometry2dUtils.js";class c extends i{constructor(){super(...arguments),this._tmpProjection=r()}snapNewVertex(e,t){const r=t.editGeometryOperations.data.components[0],o=r.edges.length,i=r.vertices.length,s=[];if(o<2)return s;const n=l(e,t.coordinateHelper,t.elevationInfo,this.view),a=r.vertices[i-1],c=r.vertices[0],h=r.edges[o-1];let p=h;do{this.edgeExceedsShortLineThreshold(p,t)&&(this._checkEdgeForParalleLines(p,a.pos,e,n,t,s),this._checkEdgeForParalleLines(p,c.pos,e,n,t,s)),p=p.leftVertex.leftEdge}while(p&&p!==h);return s}snapExistingVertex(t,r){const o=[],i=e(r.vertexHandle),s=i.component;if(s.edges.length<3)return o;const n=l(t,r.coordinateHelper,r.elevationInfo,this.view),a=i.leftEdge,c=i.rightEdge,h=s.vertices[0],p=s.vertices.length,d=s.vertices[p-1],g=s.edges[0];let m=g;do{m!==a&&m!==c&&this.edgeExceedsShortLineThreshold(m,r)&&(a&&this._checkEdgeForParalleLines(m,a.leftVertex.pos,t,n,r,o),c&&this._checkEdgeForParalleLines(m,c.rightVertex.pos,t,n,r,o),i===h?this._checkEdgeForParalleLines(m,d.pos,t,n,r,o):i===d&&this._checkEdgeForParalleLines(m,h.pos,t,n,r,o)),m=m.rightVertex.rightEdge}while(m&&m!==g);return o}_checkEdgeForParalleLines(e,r,i,c,h,p){const d=e.leftVertex.pos,g=e.rightVertex.pos;if(a(this._tmpProjection,r,d,g),t(this._tmpProjection,r)<o.parallelLineThreshold)return;a(this._tmpProjection,i,d,g,r);const{coordinateHelper:m,elevationInfo:f,pointer:v}=h,P=m.fromXYZ(this._tmpProjection,m.getZ(i,0));if(s(c,l(P,m,f,this.view))<this.squaredProximityTreshold(v)){if(this._parallelToPreviousCandidate(e,p))return;p.push(new n({coordinateHelper:m,referenceLine:e,lineStart:r,targetPoint:P,elevationInfo:f}))}}_parallelToPreviousCandidate(e,r){const i=e.leftVertex.pos,s=e.rightVertex.pos;for(const n of r)if(a(this._tmpProjection,s,n.constraint.start,n.constraint.end,i),t(this._tmpProjection,s)<o.parallelLineThreshold)return n.addReferenceLine(e),!0;return!1}}export{c as ParallelLineSnapper};
@@ -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{unwrap as e}from"../../../core/maybe.js";import{m as t,d as o}from"../../../chunks/vec2.js";import{a as r}from"../../../chunks/vec2f64.js";import{SnappingAlgorithm as s}from"./SnappingAlgorithm.js";import{squareDistance as i}from"./snappingUtils.js";import{RightAngleTriangleSnappingCandidate as n}from"./candidates/RightAngleTriangleSnappingCandidate.js";import{anyMapPointToScreenPoint as p}from"../support/viewUtils.js";import{projectPointToCircle as a}from"../../support/geometry2dUtils.js";class d extends s{snapNewVertex(e,t){const o=t.editGeometryOperations.data.components[0],r=[],s=o.vertices.length;if("polygon"!==t.editGeometryOperations.data.type||s<2)return r;const i=o.vertices[0],n=o.vertices[s-1];return this._processCandidateProposal(i.pos,n.pos,e,t,r),r}snapExistingVertex(t,o){const r=[],s=e(o.vertexHandle),i=s.component;return i.edges.length<2?r:"polyline"!==o.editGeometryOperations.data.type||0!==s.index&&s.index!==i.vertices.length-1?(this._processCandidateProposal(s.leftEdge.leftVertex.pos,s.rightEdge.rightVertex.pos,t,o,r),r):r}_processCandidateProposal(e,s,d,m,l){if(!this.exceedsShortLineThreshold(e,s,m))return;const c=t(r(),e,s,.5),g=.5*o(e,s),h=a(r(),d,c,g),{coordinateHelper:f,elevationInfo:v,pointer:x}=m,u=f.fromXYZ(h,f.getZ(d,0)),y=p(d,f,v,this.view);i(y,p(u,f,v,this.view))<this.squaredProximityTreshold(x)&&l.push(new n({coordinateHelper:f,targetPoint:u,point1:e,point2:s,elevationInfo:v}))}}export{d as RightAngleTriangleSnapper};
5
+ import{unwrap as e}from"../../../core/maybe.js";import{l as t,d as o}from"../../../chunks/vec2.js";import{a as r}from"../../../chunks/vec2f64.js";import{SnappingAlgorithm as s}from"./SnappingAlgorithm.js";import{squareDistance as i}from"./snappingUtils.js";import{RightAngleTriangleSnappingCandidate as n}from"./candidates/RightAngleTriangleSnappingCandidate.js";import{anyMapPointToScreenPoint as p}from"../support/viewUtils.js";import{projectPointToCircle as a}from"../../support/geometry2dUtils.js";class d extends s{snapNewVertex(e,t){const o=t.editGeometryOperations.data.components[0],r=[],s=o.vertices.length;if("polygon"!==t.editGeometryOperations.data.type||s<2)return r;const i=o.vertices[0],n=o.vertices[s-1];return this._processCandidateProposal(i.pos,n.pos,e,t,r),r}snapExistingVertex(t,o){const r=[],s=e(o.vertexHandle),i=s.component;return i.edges.length<2?r:"polyline"!==o.editGeometryOperations.data.type||0!==s.index&&s.index!==i.vertices.length-1?(this._processCandidateProposal(s.leftEdge.leftVertex.pos,s.rightEdge.rightVertex.pos,t,o,r),r):r}_processCandidateProposal(e,s,d,l,m){if(!this.exceedsShortLineThreshold(e,s,l))return;const c=t(r(),e,s,.5),g=.5*o(e,s),h=a(r(),d,c,g),{coordinateHelper:f,elevationInfo:v,pointer:x}=l,u=f.fromXYZ(h,f.getZ(d,0)),y=p(d,f,v,this.view);i(y,p(u,f,v,this.view))<this.squaredProximityTreshold(x)&&m.push(new n({coordinateHelper:f,targetPoint:u,point1:e,point2:s,elevationInfo:v}))}}export{d as RightAngleTriangleSnapper};
@@ -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 t,a as s,h as e,c as n}from"../../../chunks/vec2.js";import{a as r}from"../../../chunks/vec2f64.js";import{defaults as i}from"./Settings.js";import{objectEqual as o}from"./snappingUtils.js";import{intersectLineAndPoint as c,LineType as h,intersectCircleAndPoint as a,intersectLineAndRay as u,intersectLineLikeAndCircle as p,pointToLineDistance as d,projectPointToRay as l,projectPointToLine as f,projectPointToCircle as j}from"../../support/geometry2dUtils.js";class E{constructor(t){this.coordinateHelper=t}}class m extends E{constructor(t,s){super(t),this.point=s}objectEqual(t){return t instanceof m&&o(this.point,t.point)}check(s){return t(s,this.point)<i.pointThreshold}closestTo(){return this.coordinateHelper.clone(this.point)}intersect(t){const s=[];return t instanceof b?s.push(...c({start:t.start,end:t.end,type:t instanceof H?h.LINE:h.RAY},this.point)):t instanceof T&&s.push(...a(t.center,t.radius,this.point)),s.map((s=>new L(this.coordinateHelper,s,this,t)))}}class b extends E{constructor(t,s,e){super(t),this.start=s,this.end=e}objectEqual(t){return t instanceof b&&(o(this.start,t.start)&&o(this.end,t.end))}intersect(t){const s=[];return t instanceof m?s.push(...c({start:this.start,end:this.end,type:this instanceof H?h.LINE:h.RAY},t.point)):t instanceof b?s.push(...u({start:this.start,end:this.end,type:this instanceof H?h.LINE:h.RAY},{start:t.start,end:t.end,type:t instanceof H?h.LINE:h.RAY})):t instanceof T&&s.push(...p({start:this.start,end:this.end,type:this instanceof H?h.LINE:h.RAY},t.center,t.radius)),s.map((s=>new L(this.coordinateHelper,s,this,t)))}}class q extends b{constructor(t,s,e){super(t,s,e),this.dir=r(),this.p=r()}objectEqual(t){return t instanceof q&&super.objectEqual(t)}check(t){return s(this.dir,this.end,this.start),s(this.p,t,this.start),e(this.dir,this.p)>=0&&d(t,this.start,this.end)<i.pointOnLineThreshold}closestTo(t){const s=this.coordinateHelper.clone(t);return l(s,t,this.start,this.end),s}}class H extends b{constructor(t,s,e){super(t,s,e)}objectEqual(t){return t instanceof H&&super.objectEqual(t)}check(t){return d(t,this.start,this.end)<i.pointOnLineThreshold}closestTo(t){const s=this.coordinateHelper.clone(t);return f(s,t,this.start,this.end),s}}class L extends E{constructor(t,s,e,n){super(t),this.intersection=s,this.first=e,this.second=n}objectEqual(t){return t instanceof L&&(this.first.objectEqual(t.first)&&this.second.objectEqual(t.second))}check(){return!1}closestTo(t){const s=this.coordinateHelper.clone(t);return n(s,this.intersection),s}intersect(){return[]}}class T extends E{constructor(t,s,e){super(t),this.center=s,this.radius=e}objectEqual(t){return t instanceof T&&(this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius)}check(){return!1}closestTo(t){const s=this.coordinateHelper.clone(t);return j(s,t,this.center,this.radius),s}intersect(t){const s=[];return t instanceof b?s.push(...p({start:t.start,end:t.end,type:t instanceof H?h.LINE:h.RAY},this.center,this.radius)):t instanceof m&&s.push(...a(this.center,this.radius,t.point)),s.map((s=>new L(this.coordinateHelper,s,this,t)))}}export{L as IntersectionConstraint,H as LineConstraint,b as LineLikeConstraint,T as PlanarCircleConstraint,m as PointConstraint,q as RayConstraint,E as SnappingConstraint};
5
+ import{k as t,a as s,h as e,c as n}from"../../../chunks/vec2.js";import{a as r}from"../../../chunks/vec2f64.js";import{defaults as i}from"./Settings.js";import{objectEqual as o}from"./snappingUtils.js";import{intersectLineAndPoint as c,LineType as h,intersectCircleAndPoint as a,intersectLineAndRay as u,intersectLineLikeAndCircle as p,pointToLineDistance as d,projectPointToRay as l,projectPointToLine as f,projectPointToCircle as E}from"../../support/geometry2dUtils.js";class j{constructor(t){this.coordinateHelper=t}}class m extends j{constructor(t,s){super(t),this.point=s}objectEqual(t){return t instanceof m&&o(this.point,t.point)}check(s){return t(s,this.point)<i.pointThreshold}closestTo(){return this.coordinateHelper.clone(this.point)}intersect(t){const s=[];return t instanceof b?s.push(...c({start:t.start,end:t.end,type:t instanceof H?h.LINE:h.RAY},this.point)):t instanceof L&&s.push(...a(t.center,t.radius,this.point)),s.map((s=>new k(this.coordinateHelper,s,this,t)))}}class b extends j{constructor(t,s,e){super(t),this.start=s,this.end=e}objectEqual(t){return t instanceof b&&(o(this.start,t.start)&&o(this.end,t.end))}intersect(t){const s=[];return t instanceof m?s.push(...c({start:this.start,end:this.end,type:this instanceof H?h.LINE:h.RAY},t.point)):t instanceof b?s.push(...u({start:this.start,end:this.end,type:this instanceof H?h.LINE:h.RAY},{start:t.start,end:t.end,type:t instanceof H?h.LINE:h.RAY})):t instanceof L&&s.push(...p({start:this.start,end:this.end,type:this instanceof H?h.LINE:h.RAY},t.center,t.radius)),s.map((s=>new k(this.coordinateHelper,s,this,t)))}}class q extends b{constructor(t,s,e){super(t,s,e),this.dir=r(),this.p=r()}objectEqual(t){return t instanceof q&&super.objectEqual(t)}check(t){return s(this.dir,this.end,this.start),s(this.p,t,this.start),e(this.dir,this.p)>=0&&d(t,this.start,this.end)<i.pointOnLineThreshold}closestTo(t){const s=this.coordinateHelper.clone(t);return l(s,t,this.start,this.end),s}}class H extends b{constructor(t,s,e){super(t,s,e)}objectEqual(t){return t instanceof H&&super.objectEqual(t)}check(t){return d(t,this.start,this.end)<i.pointOnLineThreshold}closestTo(t){const s=this.coordinateHelper.clone(t);return f(s,t,this.start,this.end),s}}class k extends j{constructor(t,s,e,n){super(t),this.intersection=s,this.first=e,this.second=n}objectEqual(t){return t instanceof k&&(this.first.objectEqual(t.first)&&this.second.objectEqual(t.second))}check(){return!1}closestTo(t){const s=this.coordinateHelper.clone(t);return n(s,this.intersection),s}intersect(){return[]}}class L extends j{constructor(t,s,e){super(t),this.center=s,this.radius=e}objectEqual(t){return t instanceof L&&(this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius)}check(){return!1}closestTo(t){const s=this.coordinateHelper.clone(t);return E(s,t,this.center,this.radius),s}intersect(t){const s=[];return t instanceof b?s.push(...p({start:t.start,end:t.end,type:t instanceof H?h.LINE:h.RAY},this.center,this.radius)):t instanceof m&&s.push(...a(this.center,this.radius,t.point)),s.map((s=>new k(this.coordinateHelper,s,this,t)))}}export{k as IntersectionConstraint,H as LineConstraint,b as LineLikeConstraint,L as PlanarCircleConstraint,m as PointConstraint,q as RayConstraint,j as SnappingConstraint};
@@ -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 e from"../../../core/Evented.js";import{HandleOwner as i}from"../../../core/HandleOwner.js";import{isSome as n}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{watch as r,sync as o,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{j as h}from"../../../chunks/vec2.js";import{defaultSnappingEnginesFactory as p}from"./snappingFactory.js";import l from"./SnappingOptions.js";import{squareDistance as u,sortCandidatesInPlace as f}from"./snappingUtils.js";import{IntersectionSnappingCandidate as v}from"./candidates/IntersectionSnappingCandidate.js";import{anyMapPointToScreenPoint as _}from"../support/viewUtils.js";let g=class extends(e.EventedMixin(i)){constructor(t){super(t),this.options=new l,this.snappingEnginesFactory=p,this._engines=[],this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}initialize(){this.handles.add([r((()=>{const{effectiveFeatureEnabled:t,effectiveSelfEnabled:e,touchSensitivityMultiplier:i,distance:n}=this.options;return{effectiveFeatureEnabled:t,effectiveSelfEnabled:e,touchSensitivityMultiplier:i,distance:n}}),(()=>{this.doneSnapping(),this.emit("changed")}),o),r((()=>this.options),(t=>{for(const e of this._engines)e.options=t}),o),r((()=>({viewReady:this.view.ready,viewSpatialReference:this.view.spatialReference,snappingEnginesFactory:this.snappingEnginesFactory})),(({viewReady:t,snappingEnginesFactory:e})=>this._recreateEngines(t,e)),a)])}destroy(){this._destroyEngines()}get updating(){return this._engines.some((t=>t.updating))}_recreateEngines(t,e){if(this._destroyEngines(),!t)return;const{view:i,options:n}=this;this._engines=e(i,n)}_destroyEngines(){for(const t of this._engines)t.destroy();this._engines=[]}get _squaredMouseProximityTreshold(){return this.options.distance*this.options.distance}get _squaredTouchProximityThreshold(){const{distance:t,touchSensitivityMultiplier:e}=this.options,i=t*e;return i*i}async snap(t,e,i){const r=e.coordinateHelper.pointToVector(t),o=await this._fetchCandidates(r,e,i);return{get valid(){return!s(i)},apply:()=>{const{snappedPoint:t,hints:i}=this._processCandidates(r,o,e);return this._removeVisualization(),n(e.visualizer)&&this.handles.add(e.visualizer.draw(i,{coordinateHelper:e.coordinateHelper,elevationInfo:e.elevationInfo,view:this.view}),m),t}}}update(t,e){this._removeVisualization();let i=t;const s=[];if(n(this._currentMainCandidate)){const n=e.coordinateHelper,r=n.pointToVector(t),o=this._currentMainCandidate.constraint.closestTo(r);if(u(_(r,n,e.elevationInfo,this.view),_(o,n,e.elevationInfo,this.view))<this._squaredPointProximityThreshold(e.pointer)){i=n.vectorToDehydratedPoint(o),this._currentMainCandidate.targetPoint=o,s.push(...this._currentMainCandidate.hints);for(const t of this._currentOtherActiveCandidates)t.targetPoint=o,s.push(...t.hints)}else this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}return n(e.visualizer)&&this.handles.add(e.visualizer.draw(s,{coordinateHelper:e.coordinateHelper,elevationInfo:e.elevationInfo,view:this.view}),m),i}doneSnapping(){this._removeVisualization(),this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}_removeVisualization(){this.handles.remove(m)}async _fetchCandidates(t,e,i){return(await Promise.all(this._engines.map((n=>n.fetchCandidates(t,e,i))))).flat()}_processCandidates(t,e,i){if(e.length<1)return this.doneSnapping(),{snappedPoint:i.coordinateHelper.vectorToDehydratedPoint(t),hints:[]};f(t,e);const s=this._currentMainCandidate;if(n(s)){const n=this._findOldConstraintInNewCandidates(s,e);if(n>=0){if(!(e[n]instanceof v))return this._intersectWithOtherCandidates(n,e,t,i);if(h(t,s.targetPoint)<this._squaredPointProximityThreshold(i.pointer))return this._updateSnappingCandidate(s,e,i)}}return this._intersectWithOtherCandidates(0,e,t,i)}_findOldConstraintInNewCandidates(t,e){return t instanceof v?this._findOldCandidateIndex(e,t.first)>=0&&this._findOldCandidateIndex(e,t.second)>=0?0:-1:this._findOldCandidateIndex(e,t)}_intersectWithOtherCandidates(t,e,i,n){const s=e[t],r=[],o=n.coordinateHelper;for(let a=0;a<e.length;++a){if(a===t)continue;const d=e[a];for(const t of s.constraint.intersect(d.constraint)){const e=o.fromXYZ(t.intersection,s.targetPoint[2]);r.push([new v(o,e,s,d,d.elevationInfo),u(_(i,n.coordinateHelper,n.elevationInfo,this.view),_(e,n.coordinateHelper,n.elevationInfo,this.view))])}}return r.length>0&&(r.sort(((t,e)=>t[1]-e[1])),r[0][1]<this._squaredPointProximityThreshold(n.pointer))?this._updateSnappingCandidate(r[0][0],e,n):this._updateSnappingCandidate(s,e,n)}_updateSnappingCandidate(t,e,i){this.doneSnapping(),this._currentMainCandidate=t;const n=this._currentMainCandidate.targetPoint,s=[];s.push(...t.hints);for(const r of e){if(t instanceof v){if(r.constraint.objectEqual(t.first.constraint)||r.constraint.objectEqual(t.second.constraint))continue}else if(r.constraint.objectEqual(t.constraint))continue;r.constraint.check(n)&&(r.targetPoint=n,this._currentOtherActiveCandidates.push(r),s.push(...r.hints))}return{snappedPoint:i.coordinateHelper.vectorToDehydratedPoint(n),hints:s}}_squaredPointProximityThreshold(t){return"touch"===t?this._squaredTouchProximityThreshold:this._squaredMouseProximityTreshold}_findOldCandidateIndex(t,e){let i=-1;for(let n=0;n<t.length;++n)if(e.constraint.objectEqual(t[n].constraint)){i=n;break}return i}get test(){return{visualizationsActive:this.handles.has(m),engines:this._engines}}};t([d({constructOnly:!0})],g.prototype,"view",void 0),t([d()],g.prototype,"options",void 0),t([d({readOnly:!0})],g.prototype,"updating",null),t([d()],g.prototype,"snappingEnginesFactory",void 0),t([d()],g.prototype,"_engines",void 0),t([d()],g.prototype,"_squaredMouseProximityTreshold",null),t([d()],g.prototype,"_squaredTouchProximityThreshold",null),g=t([c("esri.views.interactive.snapping.SnappingManager")],g);const m="visualization-handle";export{g as SnappingManager};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Evented.js";import{HandleOwner as i}from"../../../core/HandleOwner.js";import{isSome as n}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{watch as r,sync as o,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{k as h}from"../../../chunks/vec2.js";import{defaultSnappingEnginesFactory as p}from"./snappingFactory.js";import l from"./SnappingOptions.js";import{squareDistance as u,sortCandidatesInPlace as f}from"./snappingUtils.js";import{IntersectionSnappingCandidate as v}from"./candidates/IntersectionSnappingCandidate.js";import{anyMapPointToScreenPoint as _}from"../support/viewUtils.js";let g=class extends(e.EventedMixin(i)){constructor(t){super(t),this.options=new l,this.snappingEnginesFactory=p,this._engines=[],this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}initialize(){this.handles.add([r((()=>{const{effectiveFeatureEnabled:t,effectiveSelfEnabled:e,touchSensitivityMultiplier:i,distance:n}=this.options;return{effectiveFeatureEnabled:t,effectiveSelfEnabled:e,touchSensitivityMultiplier:i,distance:n}}),(()=>{this.doneSnapping(),this.emit("changed")}),o),r((()=>this.options),(t=>{for(const e of this._engines)e.options=t}),o),r((()=>({viewReady:this.view.ready,viewSpatialReference:this.view.spatialReference,snappingEnginesFactory:this.snappingEnginesFactory})),(({viewReady:t,snappingEnginesFactory:e})=>this._recreateEngines(t,e)),a)])}destroy(){this._destroyEngines()}get updating(){return this._engines.some((t=>t.updating))}_recreateEngines(t,e){if(this._destroyEngines(),!t)return;const{view:i,options:n}=this;this._engines=e(i,n)}_destroyEngines(){for(const t of this._engines)t.destroy();this._engines=[]}get _squaredMouseProximityTreshold(){return this.options.distance*this.options.distance}get _squaredTouchProximityThreshold(){const{distance:t,touchSensitivityMultiplier:e}=this.options,i=t*e;return i*i}async snap(t,e,i){const r=e.coordinateHelper.pointToVector(t),o=await this._fetchCandidates(r,e,i);return{get valid(){return!s(i)},apply:()=>{const{snappedPoint:t,hints:i}=this._processCandidates(r,o,e);return this._removeVisualization(),n(e.visualizer)&&this.handles.add(e.visualizer.draw(i,{coordinateHelper:e.coordinateHelper,elevationInfo:e.elevationInfo,view:this.view}),m),t}}}update(t,e){this._removeVisualization();let i=t;const s=[];if(n(this._currentMainCandidate)){const n=e.coordinateHelper,r=n.pointToVector(t),o=this._currentMainCandidate.constraint.closestTo(r);if(u(_(r,n,e.elevationInfo,this.view),_(o,n,e.elevationInfo,this.view))<this._squaredPointProximityThreshold(e.pointer)){i=n.vectorToDehydratedPoint(o),this._currentMainCandidate.targetPoint=o,s.push(...this._currentMainCandidate.hints);for(const t of this._currentOtherActiveCandidates)t.targetPoint=o,s.push(...t.hints)}else this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}return n(e.visualizer)&&this.handles.add(e.visualizer.draw(s,{coordinateHelper:e.coordinateHelper,elevationInfo:e.elevationInfo,view:this.view}),m),i}doneSnapping(){this._removeVisualization(),this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}_removeVisualization(){this.handles.remove(m)}async _fetchCandidates(t,e,i){return(await Promise.all(this._engines.map((n=>n.fetchCandidates(t,e,i))))).flat()}_processCandidates(t,e,i){if(e.length<1)return this.doneSnapping(),{snappedPoint:i.coordinateHelper.vectorToDehydratedPoint(t),hints:[]};f(t,e);const s=this._currentMainCandidate;if(n(s)){const n=this._findOldConstraintInNewCandidates(s,e);if(n>=0){if(!(e[n]instanceof v))return this._intersectWithOtherCandidates(n,e,t,i);if(h(t,s.targetPoint)<this._squaredPointProximityThreshold(i.pointer))return this._updateSnappingCandidate(s,e,i)}}return this._intersectWithOtherCandidates(0,e,t,i)}_findOldConstraintInNewCandidates(t,e){return t instanceof v?this._findOldCandidateIndex(e,t.first)>=0&&this._findOldCandidateIndex(e,t.second)>=0?0:-1:this._findOldCandidateIndex(e,t)}_intersectWithOtherCandidates(t,e,i,n){const s=e[t],r=[],o=n.coordinateHelper;for(let a=0;a<e.length;++a){if(a===t)continue;const d=e[a];for(const t of s.constraint.intersect(d.constraint)){const e=o.fromXYZ(t.intersection,s.targetPoint[2]);r.push([new v(o,e,s,d,d.elevationInfo),u(_(i,n.coordinateHelper,n.elevationInfo,this.view),_(e,n.coordinateHelper,n.elevationInfo,this.view))])}}return r.length>0&&(r.sort(((t,e)=>t[1]-e[1])),r[0][1]<this._squaredPointProximityThreshold(n.pointer))?this._updateSnappingCandidate(r[0][0],e,n):this._updateSnappingCandidate(s,e,n)}_updateSnappingCandidate(t,e,i){this.doneSnapping(),this._currentMainCandidate=t;const n=this._currentMainCandidate.targetPoint,s=[];s.push(...t.hints);for(const r of e){if(t instanceof v){if(r.constraint.objectEqual(t.first.constraint)||r.constraint.objectEqual(t.second.constraint))continue}else if(r.constraint.objectEqual(t.constraint))continue;r.constraint.check(n)&&(r.targetPoint=n,this._currentOtherActiveCandidates.push(r),s.push(...r.hints))}return{snappedPoint:i.coordinateHelper.vectorToDehydratedPoint(n),hints:s}}_squaredPointProximityThreshold(t){return"touch"===t?this._squaredTouchProximityThreshold:this._squaredMouseProximityTreshold}_findOldCandidateIndex(t,e){let i=-1;for(let n=0;n<t.length;++n)if(e.constraint.objectEqual(t[n].constraint)){i=n;break}return i}get test(){return{visualizationsActive:this.handles.has(m),engines:this._engines}}};t([d({constructOnly:!0})],g.prototype,"view",void 0),t([d()],g.prototype,"options",void 0),t([d({readOnly:!0})],g.prototype,"updating",null),t([d()],g.prototype,"snappingEnginesFactory",void 0),t([d()],g.prototype,"_engines",void 0),t([d()],g.prototype,"_squaredMouseProximityTreshold",null),t([d()],g.prototype,"_squaredTouchProximityThreshold",null),g=t([c("esri.views.interactive.snapping.SnappingManager")],g);const m="visualization-handle";export{g as SnappingManager};
@@ -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,i as t}from"../../../../chunks/vec2.js";import{LineConstraint as n}from"../SnappingConstraint.js";import{LineSegmentHintType as i}from"../snappingUtils.js";import{SnappingCandidate as r}from"./SnappingCandidate.js";import{LineSnappingHint as s}from"../hints/LineSnappingHint.js";import{ParallelSnappingHint as a}from"../hints/ParallelSnappingHint.js";class o extends r{constructor({coordinateHelper:i,referenceLine:r,lineStart:s,targetPoint:a,elevationInfo:o}){const f=i.clone(s);e(f,t(f,f,r.rightVertex.pos),r.leftVertex.pos),super(i,a,new n(i,s,f),o),this._referenceLines=[{edge:r,fadeLeft:!0,fadeRight:!0}]}get hints(){const e=this.elevationInfo;return[new s(i.TARGET,this.constraint.start,this.targetPoint,e),new a(this.constraint.start,this.targetPoint,e),...this._referenceLines.map((t=>new s(i.REFERENCE,t.edge.leftVertex.pos,t.edge.rightVertex.pos,e,t.fadeLeft,t.fadeRight)))]}addReferenceLine(e){const t={edge:e,fadeLeft:!0,fadeRight:!0};this._referenceLines.forEach((n=>{e.rightVertex.rightEdge===n.edge&&(n.fadeLeft=!1,t.fadeRight=!1),e.leftVertex.leftEdge===n.edge&&(n.fadeRight=!1,t.fadeLeft=!1)})),this._referenceLines.push(t)}}export{o as ParallelLineSnappingCandidate};
5
+ import{a as e,j as t}from"../../../../chunks/vec2.js";import{LineConstraint as n}from"../SnappingConstraint.js";import{LineSegmentHintType as i}from"../snappingUtils.js";import{SnappingCandidate as r}from"./SnappingCandidate.js";import{LineSnappingHint as s}from"../hints/LineSnappingHint.js";import{ParallelSnappingHint as a}from"../hints/ParallelSnappingHint.js";class o extends r{constructor({coordinateHelper:i,referenceLine:r,lineStart:s,targetPoint:a,elevationInfo:o}){const f=i.clone(s);e(f,t(f,f,r.rightVertex.pos),r.leftVertex.pos),super(i,a,new n(i,s,f),o),this._referenceLines=[{edge:r,fadeLeft:!0,fadeRight:!0}]}get hints(){const e=this.elevationInfo;return[new s(i.TARGET,this.constraint.start,this.targetPoint,e),new a(this.constraint.start,this.targetPoint,e),...this._referenceLines.map((t=>new s(i.REFERENCE,t.edge.leftVertex.pos,t.edge.rightVertex.pos,e,t.fadeLeft,t.fadeRight)))]}addReferenceLine(e){const t={edge:e,fadeLeft:!0,fadeRight:!0};this._referenceLines.forEach((n=>{e.rightVertex.rightEdge===n.edge&&(n.fadeLeft=!1,t.fadeRight=!1),e.leftVertex.leftEdge===n.edge&&(n.fadeRight=!1,t.fadeLeft=!1)})),this._referenceLines.push(t)}}export{o as ParallelLineSnappingCandidate};
@@ -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{m as t,d as n}from"../../../../chunks/vec2.js";import{a as i}from"../../../../chunks/vec2f64.js";import{PlanarCircleConstraint as s}from"../SnappingConstraint.js";import{LineSegmentHintType as o}from"../snappingUtils.js";import{SnappingCandidate as p}from"./SnappingCandidate.js";import{LineSnappingHint as r}from"../hints/LineSnappingHint.js";import{RightAngleSnappingHint as e}from"../hints/RightAngleSnappingHint.js";class a extends p{constructor({coordinateHelper:i,targetPoint:o,point1:p,point2:r,elevationInfo:e}){super(i,o,new s(i,t(h,p,r,.5),.5*n(p,r)),e),this.p1=p,this.p2=r}get hints(){const t=this.elevationInfo;return[new r(o.REFERENCE,this.targetPoint,this.p1,t),new r(o.REFERENCE,this.targetPoint,this.p2,t),new e(this.p1,this.targetPoint,this.p2,t)]}}const h=i();export{a as RightAngleTriangleSnappingCandidate};
5
+ import{l as t,d as n}from"../../../../chunks/vec2.js";import{a as i}from"../../../../chunks/vec2f64.js";import{PlanarCircleConstraint as s}from"../SnappingConstraint.js";import{LineSegmentHintType as o}from"../snappingUtils.js";import{SnappingCandidate as p}from"./SnappingCandidate.js";import{LineSnappingHint as r}from"../hints/LineSnappingHint.js";import{RightAngleSnappingHint as e}from"../hints/RightAngleSnappingHint.js";class a extends p{constructor({coordinateHelper:i,targetPoint:o,point1:p,point2:r,elevationInfo:e}){super(i,o,new s(i,t(h,p,r,.5),.5*n(p,r)),e),this.p1=p,this.p2=r}get hints(){const t=this.elevationInfo;return[new r(o.REFERENCE,this.targetPoint,this.p1,t),new r(o.REFERENCE,this.targetPoint,this.p2,t),new e(this.p1,this.targetPoint,this.p2,t)]}}const h=i();export{a as RightAngleTriangleSnappingCandidate};
@@ -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 t}from"../../../chunks/vec2.js";function E(t,E){const n=t.x-E.x,r=t.y-E.y;return n*n+r*r}function n(t,E){const n=t.length===E.length&&t[0]===E[0]&&t[1]===E[1];switch(t.length){case 2:return n;case 3:return n&&t[2]===E[2];case 4:return n&&t[3]===E[3]}return!1}function r(E,n){n.sort(((n,r)=>t(n.targetPoint,E)-t(r.targetPoint,E)))}var e;!function(t){t[t.TARGET=0]="TARGET",t[t.REFERENCE=1]="REFERENCE",t[t.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"}(e||(e={}));export{e as LineSegmentHintType,n as objectEqual,r as sortCandidatesInPlace,E as squareDistance};
5
+ import{k as t}from"../../../chunks/vec2.js";function E(t,E){const n=t.x-E.x,r=t.y-E.y;return n*n+r*r}function n(t,E){const n=t.length===E.length&&t[0]===E[0]&&t[1]===E[1];switch(t.length){case 2:return n;case 3:return n&&t[2]===E[2];case 4:return n&&t[3]===E[3]}return!1}function r(E,n){n.sort(((n,r)=>t(n.targetPoint,E)-t(r.targetPoint,E)))}var e;!function(t){t[t.TARGET=0]="TARGET",t[t.REFERENCE=1]="REFERENCE",t[t.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"}(e||(e={}));export{e as LineSegmentHintType,n as objectEqual,r as sortCandidatesInPlace,E as squareDistance};
@@ -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{createScreenPoint as e,createRenderScreenPointArray3 as r,createScreenPointArray as o}from"../../../core/screenUtils.js";import{a as t,f as n,j as c}from"../../../chunks/vec2.js";import{c as s}from"../../../chunks/vec3.js";import{c as a}from"../../../chunks/vec3f64.js";import i from"../../../geometry/Point.js";import{getConvertedElevationFromVector as p}from"../../../support/elevationInfoUtils.js";function f(e,r,o,c){o.projectToRenderScreen(e,S),o.projectToRenderScreen(r,T),t(c,T,S),n(c,c)}function d(e,r,o){return Math.sqrt(u(e,r,o))}function u(e,r,o){const{camera:t}=o.state;return t.projectToScreen(e,v),t.projectToScreen(r,H),c(v,H)}function l(e,r,o,t,n=a()){const c=r.toXYZ(e);return c[2]=p(t,c,r.spatialReference,o)||0,t.renderCoordsHelper.toRenderCoords(c,r.spatialReference,n),n}function m(e,r,o,t,n=a()){const c=s(h,e);return c[2]=p(t,c,r,o)||0,t.renderCoordsHelper.toRenderCoords(c,r,n),n}function j(r,o,t,n){return"2d"===n.type?n.toScreen(o.vectorToPoint(r,C)):(l(r,o,t,n,h),n.state.camera.projectToScreen(h,v),e(v[0],v[1]))}function R(e,r,o,t,n,c,s){const a=o.toXYZ(e),i=o.toXYZ(r);if("absolute-height"!==t.mode){const e=p(n,a,o.spatialReference,t),r=p(n,i,o.spatialReference,t),c=(null==e?r:null==r?e:Math.min(e,r))||0;a[2]=c,i[2]=c}n.renderCoordsHelper.toRenderCoords(a,o.spatialReference,c),n.renderCoordsHelper.toRenderCoords(i,o.spatialReference,s)}const C=new i,h=a(),S=r(),T=r(),v=o(),H=o();export{l as anyMapPointToRender,j as anyMapPointToScreenPoint,R as anyMapPointsToRenderWithEqualRelativeZ,f as renderScreenSpaceTangent,d as screenDistance,u as screenDistanceSquared,m as vectorToRender};
5
+ import{createScreenPoint as e,createRenderScreenPointArray3 as r,createScreenPointArray as o}from"../../../core/screenUtils.js";import{a as t,f as n,k as c}from"../../../chunks/vec2.js";import{c as s}from"../../../chunks/vec3.js";import{c as a}from"../../../chunks/vec3f64.js";import i from"../../../geometry/Point.js";import{getConvertedElevationFromVector as p}from"../../../support/elevationInfoUtils.js";function f(e,r,o,c){o.projectToRenderScreen(e,S),o.projectToRenderScreen(r,T),t(c,T,S),n(c,c)}function d(e,r,o){return Math.sqrt(u(e,r,o))}function u(e,r,o){const{camera:t}=o.state;return t.projectToScreen(e,v),t.projectToScreen(r,k),c(v,k)}function l(e,r,o,t,n=a()){const c=r.toXYZ(e);return c[2]=p(t,c,r.spatialReference,o)||0,t.renderCoordsHelper.toRenderCoords(c,r.spatialReference,n),n}function m(e,r,o,t,n=a()){const c=s(h,e);return c[2]=p(t,c,r,o)||0,t.renderCoordsHelper.toRenderCoords(c,r,n),n}function R(r,o,t,n){return"2d"===n.type?n.toScreen(o.vectorToPoint(r,C)):(l(r,o,t,n,h),n.state.camera.projectToScreen(h,v),e(v[0],v[1]))}function j(e,r,o,t,n,c,s){const a=o.toXYZ(e),i=o.toXYZ(r);if("absolute-height"!==t.mode){const e=p(n,a,o.spatialReference,t),r=p(n,i,o.spatialReference,t),c=(null==e?r:null==r?e:Math.min(e,r))||0;a[2]=c,i[2]=c}n.renderCoordsHelper.toRenderCoords(a,o.spatialReference,c),n.renderCoordsHelper.toRenderCoords(i,o.spatialReference,s)}const C=new i,h=a(),S=r(),T=r(),v=o(),k=o();export{l as anyMapPointToRender,R as anyMapPointToScreenPoint,j as anyMapPointsToRenderWithEqualRelativeZ,f as renderScreenSpaceTangent,d as screenDistance,u as screenDistanceSquared,m as vectorToRender};
@@ -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 e from"../../Graphic.js";import r from"../../core/Error.js";import{unwrap as i,isNone as o}from"../../core/maybe.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{combinedViewLayerTimeExtentProperty as n}from"../../layers/support/commonProperties.js";import{getDefaultDatumTransformationForDataset as l,projectExtent as u}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as p}from"./support/popupUtils.js";const m=m=>{let f=class extends m{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return this.projectFullExtent(this.view.spatialReference)}get hasTilingEffects(){return this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment}get datumTransformation(){return l(i(this.layer.fullExtent),this.view.spatialReference,!0)}supportsSpatialReference(t){return!!this.projectFullExtent(t)}projectFullExtent(t){const e=i(this.layer.fullExtent),r=l(e,t,!1);return u(e,t,r)}async fetchPopupFeatures(t,i){const{layer:s}=this;if(!t)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:a}=s,n=p(s,i);if(!a||o(n))throw new r("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:a,popupTemplate:n});const l=[],{value:u,magdirValue:m}=await s.identify(t,{timeExtent:this.timeExtent});let f="";if(u&&u.length){f="imagery-tile"===s.type&&s.hasStandardTime()&&null!=u[0]?u.map((t=>s.getStandardTimeValue(t))).join(", "):u.join(", ");const t={ObjectId:0},r="Raster.ServicePixelValue";t[r]=this._formatAttributeValue(f,r);const i=s.rasterInfo?.attributeTable?.features;if(i&&i.length>0){const e=i.filter((t=>{const e=t.attributes.value||t.attributes.Value||t.attributes.VALUE;return String(e)===f}));if(e.length>0){const r=e[0];if(r)for(const e in r.attributes)if(r.attributes.hasOwnProperty(e)){const i=this._rasterFieldPrefix+e;t[i]=this._formatAttributeValue(r.attributes[e],i)}}}const o=s.rasterInfo.dataType;"vector-magdir"!==o&&"vector-uv"!==o||(t["Raster.Magnitude"]=m?.[0],t["Raster.Direction"]=m?.[1]);const a=new e(this.fullExtent.clone(),null,t);a.layer=s,a.sourceLayer=a.layer,l.push(a)}return l}_formatAttributeValue(t,e){if("string"==typeof t){const r=this.layer.popupTemplate&&this.layer.popupTemplate.fieldInfos,i=this._getFieldInfo(r,e),o=i&&i.format;if(o){let e,r;return t.trim().includes(",")?(e=",",r=e+" ",this._formatDelimitedString(t,e,r,o)):t.trim().includes(" ")?(e=r=" ",this._formatDelimitedString(t,e,r,o)):this._formatNumberFromString(t,o)}}return t}_getFieldInfo(t,e){if(!t||!t.length||!e)return;const r=e.toLowerCase();let i;return t.some((t=>!(!t.fieldName||t.fieldName.toLowerCase()!==r&&t.fieldName.toLowerCase()!==r.replace(/ /g,"_"))&&(i=t,!0))),i}_formatDelimitedString(t,e,r,i){return t&&e&&r&&i?t.trim().split(e).map((t=>this._formatNumberFromString(t,i))).join(r):t}_formatNumberFromString(t,e){if(!t||!e)return t;const r=Number(t);return isNaN(r)?t:e.format(r)}};return t([s()],f.prototype,"layer",void 0),t([s(n)],f.prototype,"timeExtent",void 0),t([s()],f.prototype,"view",void 0),t([s()],f.prototype,"fullExtent",null),t([s()],f.prototype,"tileInfo",void 0),t([s({readOnly:!0})],f.prototype,"hasTilingEffects",null),f=t([a("esri.views.layers.ImageryTileLayerView")],f),f};export{m as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import r from"../../core/Error.js";import{unwrap as i,isNone as o}from"../../core/maybe.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{combinedViewLayerTimeExtentProperty as n}from"../../layers/support/commonProperties.js";import{getDefaultDatumTransformationForDataset as l,projectExtent as u}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as p}from"./support/popupUtils.js";const m=m=>{let f=class extends m{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return this.projectFullExtent(this.view.spatialReference)}get hasTilingEffects(){return this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment}get datumTransformation(){return l(i(this.layer.fullExtent),this.view.spatialReference,!0)}supportsSpatialReference(t){return!!this.projectFullExtent(t)}projectFullExtent(t){const e=i(this.layer.fullExtent),r=l(e,t,!1);return u(e,t,r)}async fetchPopupFeatures(t,i){const{layer:s}=this;if(!t)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:a}=s,n=p(s,i);if(!a||o(n))throw new r("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:a,popupTemplate:n});const l=[],{value:u,magdirValue:m}=await s.identify(t,{timeExtent:this.timeExtent});let f="";if(u&&u.length){f="imagery-tile"===s.type&&s.hasStandardTime()&&null!=u[0]?u.map((t=>s.getStandardTimeValue(t))).join(", "):u.join(", ");const t={ObjectId:0},r="Raster.ServicePixelValue";t[r]=this._formatAttributeValue(f,r);const i=s.rasterInfo?.attributeTable,a=o(i)?null:i.features;if(a&&a.length>0){const e=a.filter((t=>{const e=t.attributes.value||t.attributes.Value||t.attributes.VALUE;return String(e)===f}));if(e.length>0){const r=e[0];if(r)for(const e in r.attributes)if(r.attributes.hasOwnProperty(e)){const i=this._rasterFieldPrefix+e;t[i]=this._formatAttributeValue(r.attributes[e],i)}}}const n=s.rasterInfo.dataType;"vector-magdir"!==n&&"vector-uv"!==n||(t["Raster.Magnitude"]=m?.[0],t["Raster.Direction"]=m?.[1]);const p=new e(this.fullExtent.clone(),null,t);p.layer=s,p.sourceLayer=p.layer,l.push(p)}return l}_formatAttributeValue(t,e){if("string"==typeof t){const r=this.layer.popupTemplate&&this.layer.popupTemplate.fieldInfos,i=this._getFieldInfo(r,e),o=i&&i.format;if(o){let e,r;return t.trim().includes(",")?(e=",",r=e+" ",this._formatDelimitedString(t,e,r,o)):t.trim().includes(" ")?(e=r=" ",this._formatDelimitedString(t,e,r,o)):this._formatNumberFromString(t,o)}}return t}_getFieldInfo(t,e){if(!t||!t.length||!e)return;const r=e.toLowerCase();let i;return t.some((t=>!(!t.fieldName||t.fieldName.toLowerCase()!==r&&t.fieldName.toLowerCase()!==r.replace(/ /g,"_"))&&(i=t,!0))),i}_formatDelimitedString(t,e,r,i){return t&&e&&r&&i?t.trim().split(e).map((t=>this._formatNumberFromString(t,i))).join(r):t}_formatNumberFromString(t,e){if(!t||!e)return t;const r=Number(t);return isNaN(r)?t:e.format(r)}};return t([s()],f.prototype,"layer",void 0),t([s(n)],f.prototype,"timeExtent",void 0),t([s()],f.prototype,"view",void 0),t([s()],f.prototype,"fullExtent",null),t([s()],f.prototype,"tileInfo",void 0),t([s({readOnly:!0})],f.prototype,"hasTilingEffects",null),f=t([a("esri.views.layers.ImageryTileLayerView")],f),f};export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{floatEqualAbsolute as t}from"../../core/mathUtils.js";import{d as n,h as r,u as s,b as e,a as o,i as u,v as a,c,l as i}from"../../chunks/vec2.js";import{d as f,a as p}from"../../chunks/vec2f64.js";function h(t,n){return t[0]*n[1]-t[1]*n[0]}function E(t,r,s){const e=(r[0]-t[0])*(s[1]-t[1])-(r[1]-t[1])*(s[0]-t[0]);return Math.abs(e)/n(r,s)}function I(t,n,o){const u=r(o,n)/s(o);return e(t,o,u)}function L(t,n,r,s,e=r){return o(M,s,r),o(A,n,e),I(R,A,M),u(t,e,R)}function N(t,n,e,u){o(M,u,e),o(A,n,e);const i=r(M,A)/s(M);return i>0?a(t,e,M,i):c(t,e)}function m(t,n,r,s){o(M,n,r);const e=s/i(M);return a(t,r,M,e)}function d(n,r){return L(A,r,n.start,n.end),t(A[0],r[0])&&t(A[1],r[1])?[f(r)]:[]}function y(n,r,s){return m(A,s,n,r),t(A[0],s[0])&&t(A[1],s[1])?[f(s)]:[]}function l(t,n){const r=t.start,s=t.end,e=n.start,u=n.end,c=o(M,s,r),i=o(k,u,e),f=h(c,i);if(Math.abs(f)<=j)return[];const p=o(A,r,e),E=h(i,p)/f,I=h(c,p)/f;if(E>=0){if(I>=0||n.type===b.LINE)return[a(R,r,c,E)]}else if(t.type===b.LINE&&(I>=0||n.type===b.LINE))return[a(R,r,c,E)];return[]}function v(t,n,e){const u=[],c=o(M,t.end,t.start),i=o(k,t.start,n),f=s(c),p=2*r(c,i),h=p*p-4*f*(s(i)-e*e);if(0===h){const n=-p/(2*f);(t.type===b.LINE||n>=0)&&u.push(a(R,t.start,c,n))}else if(h>0){const n=Math.sqrt(h),r=(-p+n)/(2*f);(t.type===b.LINE||r>=0)&&u.push(a(R,t.start,c,r));const s=(-p-n)/(2*f);(t.type===b.LINE||s>=0)&&u.push(a(A,t.start,c,s))}return u}var b;!function(t){t[t.RAY=0]="RAY",t[t.LINE=1]="LINE"}(b||(b={}));const j=1e-6,M=p(),k=p(),A=p(),R=p();export{b as LineType,h as cross,y as intersectCircleAndPoint,d as intersectLineAndPoint,l as intersectLineAndRay,v as intersectLineLikeAndCircle,E as pointToLineDistance,I as projectPoint,m as projectPointToCircle,L as projectPointToLine,N as projectPointToRay};
5
+ import{floatEqualAbsolute as t}from"../../core/mathUtils.js";import{d as n,h as r,u as s,b as e,a as o,j as u,v as a,c,i}from"../../chunks/vec2.js";import{d as f,a as p}from"../../chunks/vec2f64.js";function h(t,n){return t[0]*n[1]-t[1]*n[0]}function E(t,r,s){const e=(r[0]-t[0])*(s[1]-t[1])-(r[1]-t[1])*(s[0]-t[0]);return Math.abs(e)/n(r,s)}function I(t,n,o){const u=r(o,n)/s(o);return e(t,o,u)}function L(t,n,r,s,e=r){return o(M,s,r),o(A,n,e),I(R,A,M),u(t,e,R)}function N(t,n,e,u){o(M,u,e),o(A,n,e);const i=r(M,A)/s(M);return i>0?a(t,e,M,i):c(t,e)}function m(t,n,r,s){o(M,n,r);const e=s/i(M);return a(t,r,M,e)}function d(n,r){return L(A,r,n.start,n.end),t(A[0],r[0])&&t(A[1],r[1])?[f(r)]:[]}function y(n,r,s){return m(A,s,n,r),t(A[0],s[0])&&t(A[1],s[1])?[f(s)]:[]}function j(t,n){const r=t.start,s=t.end,e=n.start,u=n.end,c=o(M,s,r),i=o(k,u,e),f=h(c,i);if(Math.abs(f)<=l)return[];const p=o(A,r,e),E=h(i,p)/f,I=h(c,p)/f;if(E>=0){if(I>=0||n.type===b.LINE)return[a(R,r,c,E)]}else if(t.type===b.LINE&&(I>=0||n.type===b.LINE))return[a(R,r,c,E)];return[]}function v(t,n,e){const u=[],c=o(M,t.end,t.start),i=o(k,t.start,n),f=s(c),p=2*r(c,i),h=p*p-4*f*(s(i)-e*e);if(0===h){const n=-p/(2*f);(t.type===b.LINE||n>=0)&&u.push(a(R,t.start,c,n))}else if(h>0){const n=Math.sqrt(h),r=(-p+n)/(2*f);(t.type===b.LINE||r>=0)&&u.push(a(R,t.start,c,r));const s=(-p-n)/(2*f);(t.type===b.LINE||s>=0)&&u.push(a(A,t.start,c,s))}return u}var b;!function(t){t[t.RAY=0]="RAY",t[t.LINE=1]="LINE"}(b||(b={}));const l=1e-6,M=p(),k=p(),A=p(),R=p();export{b as LineType,h as cross,y as intersectCircleAndPoint,d as intersectLineAndPoint,j as intersectLineAndRay,v as intersectLineLikeAndCircle,E as pointToLineDistance,I as projectPoint,m as projectPointToCircle,L as projectPointToLine,N as projectPointToRay};
package/webscene/Slide.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{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import r from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{JSONSupport as s}from"../core/JSONSupport.js";import a from"../core/Logger.js";import{isSome as l,removeMaybe as p}from"../core/maybe.js";import{eachAlways as m,onAbortOrThrow as h,isAbortError as c}from"../core/promiseUtils.js";import{watch as u}from"../core/reactiveUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as y}from"../core/accessorSupport/decorators/cast.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as v}from"../core/accessorSupport/ensureType.js";import{d as f}from"../chunks/vec3.js";import{c as w}from"../chunks/vec3f64.js";import b from"../layers/BuildingSceneLayer.js";import L from"../layers/Layer.js";import j from"../layers/MapImageLayer.js";import{isOperationalLayer as T}from"../layers/mixins/OperationalLayer.js";import{ensureType as _,clonePreservingTiledLayers as C}from"../support/basemapUtils.js";import{moduloPositive as S}from"../views/3d/support/mathUtils.js";import{toCamera as U}from"../views/3d/support/viewpointUtils.js";import{TaskPriority as V}from"../views/support/Scheduler.js";import{SlideThumbnail as E}from"../webdoc/support/SlideThumbnail.js";import I from"./SunLighting.js";import k from"./VirtualLighting.js";import x from"./support/Description.js";import{SlideEnvironment as D}from"./support/SlideEnvironment.js";import M from"./support/SlideGround.js";import{SlideVisibleLayer as R}from"./support/SlideVisibleLayer.js";import A from"./support/Title.js";let O=0;const q=r.ofType(R);let B=class extends s{constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+O++,this.title=new A,this.description=new x,this.thumbnail=new E,this.viewpoint=null,this.basemap=null,this.ground=null,this.environment=new D,this.visibleLayers=new q}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail&&this.thumbnail.destroy(),this.description=null,this.title=null,this.thumbnail=null}castTitle(e){return"string"==typeof e?new A({text:e}):v(A,e)}castDescription(e){return"string"==typeof e?new x({text:e}):v(x,e)}castThumbnail(e){return"string"==typeof e?new E({url:e}):v(E,e)}castBasemap(e){return _(e)}set visibleLayers(e){this._set("visibleLayers",o(e,this._get("visibleLayers"),q))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if("listMode"in e||e instanceof L){const t=G(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:e.sublayerIds}:(a.getLogger(this.declaredClass).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}clone(){return new(0,this.constructor)({id:this.id,title:this.title.clone(),thumbnail:this.thumbnail.clone(),description:this.description&&this.description.clone()||null,viewpoint:this.viewpoint&&this.viewpoint.clone()||null,basemap:this.basemap&&this.basemap.clone()||null,ground:this.ground&&this.ground.clone()||null,visibleLayers:this.visibleLayers.clone(),environment:this.environment&&this.environment.clone()||null})}_updateVisibleLayersFrom(e){const t=[];return m(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=G(i);t.push(new R({id:e.layer.id,sublayerIds:n}))}})))).toArray()).then((()=>{this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}))}updateFrom(e,t){return t={screenshot:{format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t&&t.screenshot}},e.when((()=>(this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?k.prototype.clone.apply(e.environment.lighting):I.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.basemap=e.map.basemap&&e.map.basemap.clone()||null,this.ground=e.map.ground?M.fromGround(e.map.ground):null,this._updateVisibleLayersFrom(e)))).then((()=>e.takeScreenshot(t.screenshot))).then((e=>(this.thumbnail=new E({url:e.dataUrl}),this)))}async applyTo(e,t){l(this._applyToController)&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=h(t,(()=>i.abort())),o=e.resourceController.scheduler.registerTask(V.SLIDE);let s=!1;t={animate:!0,...t,signal:this._applyToController.signal};const a=async()=>{await Promise.all([o.schedule((()=>s=this._setViewpointOfInterest(e,t))),o.schedule((()=>this._applyBasemap(e,t)),t.signal)]),await Promise.all([o.schedule((()=>this._applyLayerVisibility(e)),t.signal),o.schedule((()=>this._applyGround(e)),t.signal),o.schedule((()=>this._applyViewpoint(e,t)),t.signal)]),await o.schedule((()=>e.environment.weather=this.environment.weather.clone()))},p=await n(e.addUpdatingPromise(a()));if(s&&(e.contentCamera=null),o.remove(),this._applyToController===i&&(this._applyToController=null),i=null,r?.remove(),!1===p.ok)throw p.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(c(i))throw i}e.map.basemap=C(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_getLayers(e){const t=new r;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach((e=>{T(e)&&(t.add(e),"layers"in e&&this._collectLayers(e,t))}))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t&&t.sublayerIds,n=F(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}_setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t.ignoreViewpoint||!t.useDestinationCamera)return!1;const i=U(e,this.viewpoint);return e.contentCamera=i,l(i)}async _applyViewpoint(e,t){if(this.viewpoint&&!t.ignoreViewpoint){if(l(this.viewpoint.camera)&&(this.viewpoint.camera.fov=e.camera.fov),t.animate&&this.get("environment.lighting.date"))return void await this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(this.environment.lighting.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then((()=>e.environment.applyLighting(this.environment.lighting.clone()))).finally((()=>{p(i),"virtual"!==e.environment.lighting.type&&(e.environment.lighting.cameraTrackingEnabled=!0)}))}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e,t,i){const n=new Date(t.date.toString()),[r,o]=this._getTime(n),[s,a]=this._getTime(i.date),p=N(o,a),m=e.renderCoordsHelper,h=w();m.toRenderCoords(e.camera.position,h);const c=w(),d=w();l(this.viewpoint.camera)&&m.toRenderCoords(this.viewpoint.camera.position,c);const y=new Date;return u((()=>e.camera),(e=>{m.toRenderCoords(e.position,d);const i=f(h,d),n=f(c,d);let a=0;i+n!==0&&(a=i/(i+n));const l=r+(s-r)*a,u=W(o,p*a);t.date=this._setTime(y,l,u)}))}static createFrom(e,t){return(new this).updateFrom(e,t)}};function F(e){if(e instanceof b||e instanceof j)return e.allSublayers.toArray()}function G(e){const t=F(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}e([d({type:String,json:{write:{isRequired:!0}}})],B.prototype,"id",void 0),e([d({type:A,json:{default:()=>new A({text:""}),write:{isRequired:!0}}})],B.prototype,"title",void 0),e([y("title")],B.prototype,"castTitle",null),e([d({type:x,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],B.prototype,"description",void 0),e([y("description")],B.prototype,"castDescription",null),e([d({type:E,json:{default:()=>new E({url:""}),write:{isRequired:!0}}})],B.prototype,"thumbnail",void 0),e([y("thumbnail")],B.prototype,"castThumbnail",null),e([d({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],B.prototype,"viewpoint",void 0),e([d({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],B.prototype,"basemap",void 0),e([y("basemap")],B.prototype,"castBasemap",null),e([d({type:M,json:{write:!0}})],B.prototype,"ground",void 0),e([d({type:q,json:{write:{isRequired:!0}}})],B.prototype,"visibleLayers",null),e([y("visibleLayers")],B.prototype,"castVisibleLayers",null),e([d({type:D,json:{write:!0}})],B.prototype,"environment",void 0),B=e([g("esri.webscene.Slide")],B);const P=86400,H=43200;function N(e,t){let i=t-e;return i>H&&(i-=P),i<-H&&(i+=P),i}function W(e,t){return S(e+t,P)}const J=B;export{J as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import r from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{JSONSupport as s}from"../core/JSONSupport.js";import a from"../core/Logger.js";import{isSome as l,removeMaybe as p}from"../core/maybe.js";import{eachAlways as m,onAbortOrThrow as h,isAbortError as c}from"../core/promiseUtils.js";import{when as u}from"../core/reactiveUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as y}from"../core/accessorSupport/decorators/cast.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as v}from"../core/accessorSupport/ensureType.js";import{d as f}from"../chunks/vec3.js";import{c as w}from"../chunks/vec3f64.js";import b from"../layers/BuildingSceneLayer.js";import L from"../layers/Layer.js";import j from"../layers/MapImageLayer.js";import{isOperationalLayer as T}from"../layers/mixins/OperationalLayer.js";import{ensureType as _,clonePreservingTiledLayers as C}from"../support/basemapUtils.js";import{moduloPositive as S}from"../views/3d/support/mathUtils.js";import{toCamera as U}from"../views/3d/support/viewpointUtils.js";import{TaskPriority as V}from"../views/support/Scheduler.js";import{SlideThumbnail as E}from"../webdoc/support/SlideThumbnail.js";import I from"./SunLighting.js";import k from"./VirtualLighting.js";import x from"./support/Description.js";import{SlideEnvironment as D}from"./support/SlideEnvironment.js";import M from"./support/SlideGround.js";import{SlideVisibleLayer as R}from"./support/SlideVisibleLayer.js";import A from"./support/Title.js";let O=0;const q=r.ofType(R);let B=class extends s{constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+O++,this.title=new A,this.description=new x,this.thumbnail=new E,this.viewpoint=null,this.basemap=null,this.ground=null,this.environment=new D,this.visibleLayers=new q}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail&&this.thumbnail.destroy(),this.description=null,this.title=null,this.thumbnail=null}castTitle(e){return"string"==typeof e?new A({text:e}):v(A,e)}castDescription(e){return"string"==typeof e?new x({text:e}):v(x,e)}castThumbnail(e){return"string"==typeof e?new E({url:e}):v(E,e)}castBasemap(e){return _(e)}set visibleLayers(e){this._set("visibleLayers",o(e,this._get("visibleLayers"),q))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if("listMode"in e||e instanceof L){const t=G(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:e.sublayerIds}:(a.getLogger(this.declaredClass).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}clone(){return new(0,this.constructor)({id:this.id,title:this.title.clone(),thumbnail:this.thumbnail.clone(),description:this.description&&this.description.clone()||null,viewpoint:this.viewpoint&&this.viewpoint.clone()||null,basemap:this.basemap&&this.basemap.clone()||null,ground:this.ground&&this.ground.clone()||null,visibleLayers:this.visibleLayers.clone(),environment:this.environment&&this.environment.clone()||null})}_updateVisibleLayersFrom(e){const t=[];return m(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=G(i);t.push(new R({id:e.layer.id,sublayerIds:n}))}})))).toArray()).then((()=>{this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}))}updateFrom(e,t){return t={screenshot:{format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t&&t.screenshot}},e.when((()=>(this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?k.prototype.clone.apply(e.environment.lighting):I.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.basemap=e.map.basemap&&e.map.basemap.clone()||null,this.ground=e.map.ground?M.fromGround(e.map.ground):null,this._updateVisibleLayersFrom(e)))).then((()=>e.takeScreenshot(t.screenshot))).then((e=>(this.thumbnail=new E({url:e.dataUrl}),this)))}async applyTo(e,t){l(this._applyToController)&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=h(t,(()=>i.abort())),o=e.resourceController.scheduler.registerTask(V.SLIDE);let s=!1;t={animate:!0,...t,signal:this._applyToController.signal};const a=async()=>{await Promise.all([o.schedule((()=>s=this._setViewpointOfInterest(e,t))),o.schedule((()=>this._applyBasemap(e,t)),t.signal)]),await Promise.all([o.schedule((()=>this._applyLayerVisibility(e)),t.signal),o.schedule((()=>this._applyGround(e)),t.signal),o.schedule((()=>this._applyViewpoint(e,t)),t.signal)]),await o.schedule((()=>e.environment.weather=this.environment.weather.clone()))},p=await n(e.addUpdatingPromise(a()));if(s&&(e.contentCamera=null),o.remove(),this._applyToController===i&&(this._applyToController=null),i=null,r?.remove(),!1===p.ok)throw p.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(c(i))throw i}e.map.basemap=C(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_getLayers(e){const t=new r;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach((e=>{T(e)&&(t.add(e),"layers"in e&&this._collectLayers(e,t))}))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t&&t.sublayerIds,n=F(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}_setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t.ignoreViewpoint||!t.useDestinationCamera)return!1;const i=U(e,this.viewpoint);return e.contentCamera=i,l(i)}async _applyViewpoint(e,t){if(this.viewpoint&&!t.ignoreViewpoint){if(l(this.viewpoint.camera)&&(this.viewpoint.camera.fov=e.camera.fov),t.animate&&this.get("environment.lighting.date"))return void await this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(this.environment.lighting.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then((()=>e.environment.applyLighting(this.environment.lighting.clone()))).finally((()=>{p(i),"virtual"!==e.environment.lighting.type&&(e.environment.lighting.cameraTrackingEnabled=!0)}))}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e,t,i){const n=new Date(t.date.toString()),[r,o]=this._getTime(n),[s,a]=this._getTime(i.date),p=N(o,a),m=e.renderCoordsHelper,h=w();m.toRenderCoords(e.camera.position,h);const c=w(),d=w();l(this.viewpoint.camera)&&m.toRenderCoords(this.viewpoint.camera.position,c);const y=new Date;return u((()=>e.camera),(e=>{m.toRenderCoords(e.position,d);const i=f(h,d),n=f(c,d);let a=0;i+n!==0&&(a=i/(i+n));const l=r+(s-r)*a,u=W(o,p*a);t.date=this._setTime(y,l,u)}))}static createFrom(e,t){return(new this).updateFrom(e,t)}};function F(e){if(e instanceof b||e instanceof j)return e.allSublayers.toArray()}function G(e){const t=F(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}e([d({type:String,json:{write:{isRequired:!0}}})],B.prototype,"id",void 0),e([d({type:A,json:{default:()=>new A({text:""}),write:{isRequired:!0}}})],B.prototype,"title",void 0),e([y("title")],B.prototype,"castTitle",null),e([d({type:x,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],B.prototype,"description",void 0),e([y("description")],B.prototype,"castDescription",null),e([d({type:E,json:{default:()=>new E({url:""}),write:{isRequired:!0}}})],B.prototype,"thumbnail",void 0),e([y("thumbnail")],B.prototype,"castThumbnail",null),e([d({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],B.prototype,"viewpoint",void 0),e([d({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],B.prototype,"basemap",void 0),e([y("basemap")],B.prototype,"castBasemap",null),e([d({type:M,json:{write:!0}})],B.prototype,"ground",void 0),e([d({type:q,json:{write:{isRequired:!0}}})],B.prototype,"visibleLayers",null),e([y("visibleLayers")],B.prototype,"castVisibleLayers",null),e([d({type:D,json:{write:!0}})],B.prototype,"environment",void 0),B=e([g("esri.webscene.Slide")],B);const P=86400,H=43200;function N(e,t){let i=t-e;return i>H&&(i-=P),i<-H&&(i+=P),i}function W(e,t){return S(e+t,P)}const J=B;export{J as default};