@arcgis/core 6.0.0-next.27 → 6.0.0-next.29

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 (421) hide show
  1. package/Map.d.ts +6 -0
  2. package/analysis/AreaMeasurementAnalysis.d.ts +4 -2
  3. package/analysis/DirectLineMeasurementAnalysis.d.ts +8 -4
  4. package/arcgisGlobal.d.ts +0 -2
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/131185d26343a997495e.js +1 -0
  7. package/assets/esri/core/workers/chunks/144bad0c2415c345736a.js +1 -0
  8. package/assets/esri/core/workers/chunks/176d0a06ebff5a29dedf.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b0ca81a07cff25df19d2.js → 176d75e76318bfc25a53.js} +1 -1
  10. package/assets/esri/core/workers/chunks/18776a130d96879a68b1.js +1 -0
  11. package/assets/esri/core/workers/chunks/{e35641a3a4da8cfbcf54.js → 189321d88026bd7e6d3e.js} +1 -1
  12. package/assets/esri/core/workers/chunks/18e7fa4d3e0b1a084cc6.js +1 -0
  13. package/assets/esri/core/workers/chunks/{1168bc5c9f0a7e1f63a2.js → 1989410a618865f02dec.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{2c0cb214fedb29487eef.js → 199a7f97916679e0257c.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1c406ab2bf99ac563316.js +1 -0
  16. package/assets/esri/core/workers/chunks/1d96fbad881a7d14a950.js +1 -0
  17. package/assets/esri/core/workers/chunks/{42d44c7d532df5ee70e9.js → 1deca3de77b1a9a07da4.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{45f826554499c38968c6.js → 1ee4df0fd61440cb5f02.js} +1 -1
  19. package/assets/esri/core/workers/chunks/22e73501e1435a896826.js +1 -0
  20. package/assets/esri/core/workers/chunks/25657f70c5f04a4ed978.js +1 -0
  21. package/assets/esri/core/workers/chunks/276a0b549acf048e8673.js +1 -0
  22. package/assets/esri/core/workers/chunks/{56e903ccef66cbe18f92.js → 2cd60fd062d954322c1f.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{ad96132bc89671e595f3.js → 2d3e0e4442dbc6ec6def.js} +1 -1
  24. package/assets/esri/core/workers/chunks/2de4296590bf9f9e9add.js +1 -0
  25. package/assets/esri/core/workers/chunks/2f5d014d6a72108b0b3a.js +1 -0
  26. package/assets/esri/core/workers/chunks/{0363d29fc665d169ebc4.js → 3105336a05f38a95ebea.js} +1 -1
  27. package/assets/esri/core/workers/chunks/379ef56f6b32494832a6.js +1 -0
  28. package/assets/esri/core/workers/chunks/3aafdb905c697bc9b1ad.js +1 -0
  29. package/assets/esri/core/workers/chunks/40c2674dae73f0942751.js +1 -0
  30. package/assets/esri/core/workers/chunks/418addce122dbb8897b4.js +1 -0
  31. package/assets/esri/core/workers/chunks/4419732baf3459a80e6d.js +1 -0
  32. package/assets/esri/core/workers/chunks/4976f5567fc7f1b63d10.js +1 -0
  33. package/assets/esri/core/workers/chunks/4e17665dd9048c300d87.js +1 -0
  34. package/assets/esri/core/workers/chunks/5396b6e99a0546a25d19.js +1 -0
  35. package/assets/esri/core/workers/chunks/53c7510df09b71ab5646.js +1 -0
  36. package/assets/esri/core/workers/chunks/561c48cb4d49b150765b.js +1 -0
  37. package/assets/esri/core/workers/chunks/{d90a3bfd45b5ed4092e0.js → 590fe0f56bc4c33a50e7.js} +1 -1
  38. package/assets/esri/core/workers/chunks/5bb6c255bdc8aa9ba23e.js +1 -0
  39. package/assets/esri/core/workers/chunks/5f1cb79aec9c4a9b7ddc.js +29 -0
  40. package/assets/esri/core/workers/chunks/{23a4806b4cdf7cc32e4d.js → 5f787809b74eed7b9a91.js} +1 -1
  41. package/assets/esri/core/workers/chunks/636e9c4ac1f9ae98f9d1.js +1 -0
  42. package/assets/esri/core/workers/chunks/654f5441227579d2b6b4.js +1 -0
  43. package/assets/esri/core/workers/chunks/692f0093c444fcc752b5.js +1 -0
  44. package/assets/esri/core/workers/chunks/69627b2634da64dd885f.js +1 -0
  45. package/assets/esri/core/workers/chunks/6a7de221cea4426cb490.js +1 -0
  46. package/assets/esri/core/workers/chunks/7030a4d0714a35995a58.js +1 -0
  47. package/assets/esri/core/workers/chunks/72d20d3957d612f86431.js +1 -0
  48. package/assets/esri/core/workers/chunks/7862abd24fb5c3b12e6b.js +1 -0
  49. package/assets/esri/core/workers/chunks/7a0b4dc0cda190367a39.js +1 -0
  50. package/assets/esri/core/workers/chunks/{ab1660f5f8a5268c2fac.js → 84038dd85005fea413eb.js} +1 -1
  51. package/assets/esri/core/workers/chunks/849f446c718e892f39ce.js +1 -0
  52. package/assets/esri/core/workers/chunks/{8ac2098ecdc40ad41055.js → 8502274806ea52308822.js} +1 -1
  53. package/assets/esri/core/workers/chunks/865cebc5c982c040ab6f.js +1 -0
  54. package/assets/esri/core/workers/chunks/{76196c414e48834f7b92.js → 8f008eedb11685ee2048.js} +1 -1
  55. package/assets/esri/core/workers/chunks/90d797ab82d4a68ba32f.js +1 -0
  56. package/assets/esri/core/workers/chunks/9184c947cdefe06bf551.js +1 -0
  57. package/assets/esri/core/workers/chunks/9976eaa81085c0d17e14.js +1 -0
  58. package/assets/esri/core/workers/chunks/{177f353ce72133e2eeed.js → 9c2436464b7dfd666678.js} +1 -1
  59. package/assets/esri/core/workers/chunks/a125650edbed802e419a.js +1 -0
  60. package/assets/esri/core/workers/chunks/{23fd4de56de352f63e2d.js → a2196a49f89d57a0a1c7.js} +1 -1
  61. package/assets/esri/core/workers/chunks/ad21757d78e372fa2ed6.js +1 -0
  62. package/assets/esri/core/workers/chunks/b01688ccc29d33bfc82d.js +1 -0
  63. package/assets/esri/core/workers/chunks/b5eff28cf482d920b9ea.js +1 -0
  64. package/assets/esri/core/workers/chunks/{04ecf15524ff3838c01c.js → ba4520ddcb6a49988da6.js} +1 -1
  65. package/assets/esri/core/workers/chunks/be55771758e4bcef0976.js +1 -0
  66. package/assets/esri/core/workers/chunks/bead830a677690eeb6fb.js +1 -0
  67. package/assets/esri/core/workers/chunks/c131e0dd180a4c10e12e.js +1 -0
  68. package/assets/esri/core/workers/chunks/c1cf3edce15f09648eb4.js +1 -0
  69. package/assets/esri/core/workers/chunks/c4f78a481f43cfae7b63.js +1 -0
  70. package/assets/esri/core/workers/chunks/c570b90995c65bbb2e14.js +1 -0
  71. package/assets/esri/core/workers/chunks/c576bef77e34920af188.js +1 -0
  72. package/assets/esri/core/workers/chunks/c9feffb9884cfed52c4b.js +1 -0
  73. package/assets/esri/core/workers/chunks/cc97e4fd0dacad970a23.js +1 -0
  74. package/assets/esri/core/workers/chunks/ce324dde6d7daea33638.js +1 -0
  75. package/assets/esri/core/workers/chunks/d1d6154b4af1c9cc497b.js +1 -0
  76. package/assets/esri/core/workers/chunks/d3c3fb079ad97970f834.js +1 -0
  77. package/assets/esri/core/workers/chunks/daae21cf77864f3293ef.js +1 -0
  78. package/assets/esri/core/workers/chunks/dc2f93453dfa40f623ab.js +1 -0
  79. package/assets/esri/core/workers/chunks/dcf6024dc19428ff2b9d.js +1 -0
  80. package/assets/esri/core/workers/chunks/dd30b02c5978c1c5f511.js +1 -0
  81. package/assets/esri/core/workers/chunks/de3f140058aa0b907b65.js +1 -0
  82. package/assets/esri/core/workers/chunks/df375d1b0dab5ecbd1be.js +1 -0
  83. package/assets/esri/core/workers/chunks/{ef2c3febcceedc44b3ac.js → dfd4782b11d6fdca0492.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{48cc58890fddbcf69cef.js → e121d15b883184ee83e7.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{67e06d606c7fd2064adf.js → e2c6cd8dac01e129ccfe.js} +1 -1
  86. package/assets/esri/core/workers/chunks/e3b212f8af448ec29eef.js +1 -0
  87. package/assets/esri/core/workers/chunks/e4042e43f0081fe49f7b.js +1 -0
  88. package/assets/esri/core/workers/chunks/e480e7d5f40049a2053b.js +1 -0
  89. package/assets/esri/core/workers/chunks/eaab787a5f2445be5e5a.js +1 -0
  90. package/assets/esri/core/workers/chunks/edd36a1fc80b1d29907e.js +1 -0
  91. package/assets/esri/core/workers/chunks/ee0dc906cc7979080329.js +1 -0
  92. package/assets/esri/core/workers/chunks/f07fb9b3fa30d7ee1681.js +1 -0
  93. package/assets/esri/core/workers/chunks/f09bc86cd52224febfcb.js +1 -0
  94. package/assets/esri/core/workers/chunks/{037c67ef5c4398d5954d.js → f2dab9fcd90ce38ae3d1.js} +1 -1
  95. package/assets/esri/core/workers/chunks/f39c700f3db7db52b522.js +1 -0
  96. package/assets/esri/core/workers/chunks/f3b4159c0722df8ffe13.js +1 -0
  97. package/assets/esri/core/workers/chunks/f3dc0bc0e00635855a7a.js +1 -0
  98. package/assets/esri/core/workers/chunks/f45064066e1ab041a0b2.js +1 -0
  99. package/assets/esri/core/workers/chunks/f7398cfd8bbd041bd635.js +1 -0
  100. package/assets/esri/core/workers/chunks/f9dc38761b314d33890f.js +1 -0
  101. package/assets/esri/core/workers/chunks/fe6dcb21570395e46ce8.js +1 -0
  102. package/assets/esri/core/workers/chunks/{00580a68835aac653038.js → fefdd10bdd5a4c8d8ed0.js} +45 -48
  103. package/assets/esri/core/workers/chunks/ffe49d9e7df081bef4a5.js +1 -0
  104. package/assets/esri/themes/base/_core.scss +0 -2
  105. package/assets/esri/themes/dark/main.css +1 -1
  106. package/assets/esri/themes/light/main.css +1 -1
  107. package/assets/esri/themes/light/view.css +1 -1
  108. package/chunks/BlendLayers.glsl.js +1 -1
  109. package/chunks/Component.glsl.js +51 -54
  110. package/chunks/EmissionComposite.glsl.js +1 -1
  111. package/chunks/Fog.glsl.js +1 -1
  112. package/chunks/GaussianSplat.glsl.js +65 -21
  113. package/chunks/GaussianSplatDepth.glsl.js +53 -4
  114. package/chunks/GaussianSplatShadow.glsl.js +83 -19
  115. package/chunks/GlobalIllumination.glsl.js +2 -17
  116. package/chunks/LineMarker.glsl.js +32 -31
  117. package/chunks/OITAddEmission.glsl.js +1 -1
  118. package/chunks/RasterColorizer.glsl.js +1 -1
  119. package/chunks/RibbonLine.glsl.js +34 -34
  120. package/chunks/Terrain.glsl.js +3 -4
  121. package/chunks/Water.glsl.js +22 -23
  122. package/config.d.ts +12 -9
  123. package/config.js +1 -1
  124. package/form/FormTemplate.d.ts +1 -1
  125. package/form/elements/AttachmentElement.d.ts +2 -0
  126. package/form/elements/FieldElement.d.ts +2 -2
  127. package/form/elements/FieldElement.js +1 -1
  128. package/form/elements/RelationshipElement.d.ts +1 -1
  129. package/form/elements/TextElement.d.ts +2 -2
  130. package/form/elements/UtilityNetworkAssociationsElement.d.ts +1 -1
  131. package/form/elements/inputs/DynamicChoiceInput.d.ts +2 -2
  132. package/form/elements/inputs/inputUtils.js +1 -1
  133. package/form/elements/inputs/types.d.ts +19 -0
  134. package/form/elements/inputs.d.ts +3 -2
  135. package/form/elements/inputs.js +1 -1
  136. package/geometry/operators/containsOperator.d.ts +1 -1
  137. package/geometry/operators/densifyOperator.d.ts +1 -1
  138. package/geometry/operators/differenceOperator.d.ts +6 -4
  139. package/geometry/operators/distanceOperator.d.ts +1 -1
  140. package/geometry/operators/geodesicProximityOperator.d.ts +8 -8
  141. package/geometry/operators/graphicBufferOperator.d.ts +6 -6
  142. package/geometry/operators/integrateOperator.d.ts +2 -2
  143. package/geometry/operators/intersectsOperator.d.ts +3 -3
  144. package/geometry/operators/linesToPolygonsOperator.d.ts +2 -2
  145. package/geometry/operators/locateBetweenOperator.d.ts +2 -2
  146. package/geometry/operators/minimumBoundingCircleOperator.d.ts +1 -1
  147. package/geometry/operators/multiPartToSinglePartOperator.d.ts +2 -2
  148. package/geometry/operators/polygonSlicerOperator.d.ts +2 -2
  149. package/geometry/operators/projectOperator.d.ts +2 -2
  150. package/geometry/operators/proximityOperator.d.ts +15 -15
  151. package/geometry/operators/shapePreservingProjectOperator.d.ts +2 -2
  152. package/geometry/operators/simplifyOperator.d.ts +2 -2
  153. package/geometry/operators/support/GeographicTransformationStep.d.ts +3 -3
  154. package/geometry/operators/support/Transformation.d.ts +8 -8
  155. package/geometry/operators/support/geographicTransformationUtils.d.ts +3 -3
  156. package/geometry/operators/symmetricDifferenceOperator.d.ts +2 -2
  157. package/geometry/operators/withinOperator.d.ts +3 -3
  158. package/interfaces.d.ts +0 -14
  159. package/kernel.js +1 -1
  160. package/layers/GeospatialPDFLayer.d.ts +2 -2
  161. package/layers/ParquetLayer.d.ts +1 -1
  162. package/layers/VideoLayer.d.ts +5 -5
  163. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  164. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  165. package/layers/orientedImagery/transformations/rotationUtils.js +2 -0
  166. package/layers/orientedImagery/transformations/utils.js +1 -1
  167. package/layers/save/parquetLayerUtils.js +1 -1
  168. package/layers/support/vectorTileLayerLoader.js +1 -1
  169. package/package.json +2 -2
  170. package/popup/FeaturesModel.js +1 -1
  171. package/popup/support/featureUtils.js +1 -1
  172. package/rest/featureService/FeatureService.d.ts +0 -5
  173. package/rest/networks/support/TraceLocation.d.ts +2 -1
  174. package/rest/networks/support/TraceResult.d.ts +0 -4
  175. package/rest/support/OutDistance.d.ts +0 -1
  176. package/smartMapping/statistics/histogramForTimeSeries.js +1 -1
  177. package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +1 -1
  178. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  179. package/support/BasemapStyle.d.ts +2 -2
  180. package/symbols/cim/types.d.ts +7 -9
  181. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  182. package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSource.js +1 -1
  183. package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSourceWorker.js +1 -1
  184. package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +2 -0
  185. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  186. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  187. package/views/2d/engine/webgl/collisions/LabelStore.js +1 -1
  188. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  189. package/views/2d/layers/features/FeatureContainer.js +1 -1
  190. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  191. package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
  192. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  193. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  194. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  195. package/views/3d/analysis/support/projectionUtils.js +1 -1
  196. package/views/3d/environment/SunLighting.d.ts +15 -2
  197. package/views/3d/environment/VirtualLighting.d.ts +15 -2
  198. package/views/3d/input/SceneInputManager.js +1 -1
  199. package/views/3d/input/handlers/ground/GroundMouseWheelMove.js +2 -0
  200. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  201. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  202. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  203. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  204. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  205. package/views/3d/navigation/Navigation3D.js +1 -1
  206. package/views/3d/state/controllers/GroundMouseWheelController.js +2 -0
  207. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  208. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  209. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  210. package/views/3d/support/ResourceController.js +1 -1
  211. package/views/3d/terrain/BlendLayers.glsl.js +1 -1
  212. package/views/3d/terrain/RasterColorizer.glsl.js +1 -1
  213. package/views/3d/terrain/TerrainRenderer.js +1 -1
  214. package/views/3d/terrain/TerrainSurface.js +1 -1
  215. package/views/3d/terrain/TileAgent.js +1 -1
  216. package/views/3d/terrain/TileCompositor.js +1 -1
  217. package/views/3d/terrain/TileRenderer.js +1 -1
  218. package/views/3d/webgl-engine/Stage.js +1 -1
  219. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  220. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +23 -26
  221. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +18 -21
  222. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js +7 -8
  223. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +5 -5
  224. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +10 -12
  225. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +22 -25
  226. package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -5
  227. package/views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js +6 -0
  228. package/views/3d/webgl-engine/core/shaderLibrary/shading/getLocalUp.glsl.js +4 -0
  229. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +1 -1
  230. package/views/3d/webgl-engine/core/shaderLibrary/terrain/{TileBackground.glsl.js → blendLayers.glsl.js} +10 -11
  231. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +8 -2
  232. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
  233. package/views/3d/webgl-engine/effects/RenderPluginContext.js +2 -0
  234. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  235. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  236. package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +3 -3
  237. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  238. package/views/3d/webgl-engine/lib/GaussianSplatDepthRenderer.js +1 -1
  239. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  240. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  241. package/views/3d/webgl-engine/lib/edgeRendering/EdgeUtil.glsl.js +30 -35
  242. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  243. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  244. package/views/3d/webgl-engine/shaders/EmissiveTechniqueConfiguration.js +1 -1
  245. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  246. package/views/3d/webgl-engine/shaders/GaussianSplatDepth.glsl.js +1 -1
  247. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +70 -108
  248. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
  249. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  250. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  251. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  252. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  253. package/views/VideoView.d.ts +10 -0
  254. package/views/VideoView.js +1 -1
  255. package/views/draw/DrawOperation.js +1 -1
  256. package/views/draw/DrawScreenTool.js +1 -1
  257. package/views/input/types.d.ts +2 -4
  258. package/views/interactive/options/LabelOptions.d.ts +5 -5
  259. package/views/interactive/options/SnappingOptions.d.ts +2 -2
  260. package/views/layers/LayerView.d.ts +10 -2
  261. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +2 -3
  262. package/widgets/Editor/EditorViewModel.d.ts +10 -12
  263. package/widgets/Editor/VisibleElements.d.ts +4 -0
  264. package/widgets/Editor.d.ts +2 -0
  265. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  266. package/widgets/FeatureTable/support/EditableColumnTemplateMixin.js +1 -1
  267. package/widgets/FeatureTable.js +1 -1
  268. package/widgets/Features/FeaturesViewModel.js +1 -1
  269. package/widgets/OrientedImageryViewer/ImageMeasurementWorker.js +1 -1
  270. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  271. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  272. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  273. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  274. package/widgets/OrientedImageryViewer/imageMeasurementWorkerUtils.js +2 -0
  275. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  276. package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
  277. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
  278. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  279. package/widgets/PanoramicViewer/utils.js +1 -1
  280. package/widgets/Search/LayerSearchSource.d.ts +1 -1
  281. package/widgets/Sketch/VisibleElements.d.ts +4 -0
  282. package/widgets/Sketch.d.ts +2 -0
  283. package/widgets/support/iconUtils.js +1 -1
  284. package/assets/esri/core/workers/chunks/010f57ec7fdbedf78d02.js +0 -1
  285. package/assets/esri/core/workers/chunks/0487e1d7a7cecf7c1c25.js +0 -1
  286. package/assets/esri/core/workers/chunks/09300e74e5b014ce6269.js +0 -1
  287. package/assets/esri/core/workers/chunks/0bd04bcd4b2710838d48.js +0 -1
  288. package/assets/esri/core/workers/chunks/0d9c4c6c571ce26d356b.js +0 -1
  289. package/assets/esri/core/workers/chunks/112ed86f812e4400a7e0.js +0 -1
  290. package/assets/esri/core/workers/chunks/151e5799ede763a03ee2.js +0 -1
  291. package/assets/esri/core/workers/chunks/173f89c55a5c79ff065b.js +0 -1
  292. package/assets/esri/core/workers/chunks/2447d2e2a4a3ab8fcf94.js +0 -1
  293. package/assets/esri/core/workers/chunks/2a36fe3f3f257a779a1b.js +0 -1
  294. package/assets/esri/core/workers/chunks/2a97268000c6d03ef720.js +0 -1
  295. package/assets/esri/core/workers/chunks/2cf8172be83b10b11bdc.js +0 -1
  296. package/assets/esri/core/workers/chunks/2df37a9a95ceebb87a5f.js +0 -1
  297. package/assets/esri/core/workers/chunks/2e00c155e447e4930442.js +0 -1
  298. package/assets/esri/core/workers/chunks/2f91fd61019d2a37476d.js +0 -1
  299. package/assets/esri/core/workers/chunks/30af63b3b750142faadb.js +0 -1
  300. package/assets/esri/core/workers/chunks/3a47fc97c400fca2c736.js +0 -1
  301. package/assets/esri/core/workers/chunks/3cd04d23b73beaf79650.js +0 -1
  302. package/assets/esri/core/workers/chunks/426b4eb500fdfe9df325.js +0 -1
  303. package/assets/esri/core/workers/chunks/45367aa8e5c5d574de94.js +0 -1
  304. package/assets/esri/core/workers/chunks/47c97640ec525676918b.js +0 -1
  305. package/assets/esri/core/workers/chunks/47d074136a7f8e551a9a.js +0 -1
  306. package/assets/esri/core/workers/chunks/4a6b92ecbb1f1c55cc43.js +0 -1
  307. package/assets/esri/core/workers/chunks/4cb751dc8d00bdaeb04c.js +0 -1
  308. package/assets/esri/core/workers/chunks/518ab22f80c3300bcfff.js +0 -1
  309. package/assets/esri/core/workers/chunks/53ff68d4f9e365fc15cd.js +0 -1
  310. package/assets/esri/core/workers/chunks/58609bf94f72bc4f1952.js +0 -1
  311. package/assets/esri/core/workers/chunks/586a929bc037e23857af.js +0 -1
  312. package/assets/esri/core/workers/chunks/5c7780f804d789cb37f5.js +0 -1
  313. package/assets/esri/core/workers/chunks/5d76f4d97beee494bbbf.js +0 -1
  314. package/assets/esri/core/workers/chunks/603fdbbe9534c614928f.js +0 -1
  315. package/assets/esri/core/workers/chunks/611e3cdf67283c11576f.js +0 -1
  316. package/assets/esri/core/workers/chunks/6431480ba0fa8c8d487f.js +0 -1
  317. package/assets/esri/core/workers/chunks/652faf4359ac072c5dde.js +0 -1
  318. package/assets/esri/core/workers/chunks/65c98f3449044fa4fd79.js +0 -1
  319. package/assets/esri/core/workers/chunks/6b9961261241fdce0e94.js +0 -1
  320. package/assets/esri/core/workers/chunks/6dfe96b056bec30068df.js +0 -1
  321. package/assets/esri/core/workers/chunks/6f897b4e7ddd1dd1672b.js +0 -1
  322. package/assets/esri/core/workers/chunks/70cc2d79653d66e85b58.js +0 -1
  323. package/assets/esri/core/workers/chunks/7159d9c36869cd82599e.js +0 -29
  324. package/assets/esri/core/workers/chunks/7393f63043a1da3d05a6.js +0 -1
  325. package/assets/esri/core/workers/chunks/7449568eb2305bf2d650.js +0 -1
  326. package/assets/esri/core/workers/chunks/75d551a449bba61ce238.js +0 -1
  327. package/assets/esri/core/workers/chunks/7748c2886d0122b40eeb.js +0 -1
  328. package/assets/esri/core/workers/chunks/78643f116677950ea29a.js +0 -1
  329. package/assets/esri/core/workers/chunks/78fbe330f16bdbdb886e.js +0 -1
  330. package/assets/esri/core/workers/chunks/7e0f04a5038e2a4f6e4b.js +0 -1
  331. package/assets/esri/core/workers/chunks/7f16ae01ccd9b6114d1c.js +0 -1
  332. package/assets/esri/core/workers/chunks/90153b5230b3a4985c14.js +0 -1
  333. package/assets/esri/core/workers/chunks/9189dfe19a2a2ccd5173.js +0 -1
  334. package/assets/esri/core/workers/chunks/943a0f140813ee4ab04a.js +0 -1
  335. package/assets/esri/core/workers/chunks/98be2f621801e230aa01.js +0 -1
  336. package/assets/esri/core/workers/chunks/99f51d5d9da6e9bfc430.js +0 -1
  337. package/assets/esri/core/workers/chunks/9aebe876b1a2fb075f9c.js +0 -1
  338. package/assets/esri/core/workers/chunks/9b6929faf649e81265fb.js +0 -1
  339. package/assets/esri/core/workers/chunks/9dd1fc56eb1ea6eb705e.js +0 -1
  340. package/assets/esri/core/workers/chunks/9dd48e75b4e8d9811d81.js +0 -1
  341. package/assets/esri/core/workers/chunks/a163c6005aba3378edaa.js +0 -1
  342. package/assets/esri/core/workers/chunks/a8286febe371dc186aaa.js +0 -1
  343. package/assets/esri/core/workers/chunks/acb265a22be5e12f38e5.js +0 -1
  344. package/assets/esri/core/workers/chunks/b12acf1f694f82e00df9.js +0 -1
  345. package/assets/esri/core/workers/chunks/b83cef2d3f528726d492.js +0 -1
  346. package/assets/esri/core/workers/chunks/b9596d862da1ec342cd3.js +0 -1
  347. package/assets/esri/core/workers/chunks/bc1fcc9c897461e68e29.js +0 -1
  348. package/assets/esri/core/workers/chunks/bdc221d94300c225665a.js +0 -1
  349. package/assets/esri/core/workers/chunks/be97a629e2ae4d13ceb3.js +0 -1
  350. package/assets/esri/core/workers/chunks/bfb39590c548188f5052.js +0 -1
  351. package/assets/esri/core/workers/chunks/c2318c014e97ba519be8.js +0 -1
  352. package/assets/esri/core/workers/chunks/c29091fe157564cffcf7.js +0 -1
  353. package/assets/esri/core/workers/chunks/c62237c344e341619341.js +0 -1
  354. package/assets/esri/core/workers/chunks/c8eae00b0ec87d8b2ff3.js +0 -1
  355. package/assets/esri/core/workers/chunks/cdb5c26fed7d9a97db49.js +0 -1
  356. package/assets/esri/core/workers/chunks/cdf0c7706d3e1221f49b.js +0 -1
  357. package/assets/esri/core/workers/chunks/cea0db3ee326f60610eb.js +0 -1
  358. package/assets/esri/core/workers/chunks/d7f2f1708d2a2668676c.js +0 -1
  359. package/assets/esri/core/workers/chunks/daf9b691817e83a11f3c.js +0 -1
  360. package/assets/esri/core/workers/chunks/db41490bd39d863305bf.js +0 -1
  361. package/assets/esri/core/workers/chunks/ddc95cdac6c06fc4794c.js +0 -1
  362. package/assets/esri/core/workers/chunks/df26ec0b508cf4716e0a.js +0 -1
  363. package/assets/esri/core/workers/chunks/e11159e3dc3353b27c57.js +0 -1
  364. package/assets/esri/core/workers/chunks/e4a57a0a9629faafd6c6.js +0 -1
  365. package/assets/esri/core/workers/chunks/ebc1a2ef3aed8aa29424.js +0 -1
  366. package/assets/esri/core/workers/chunks/ec1c4d66142b6efb0e8b.js +0 -1
  367. package/assets/esri/core/workers/chunks/ef12fa3574d4cbf8b084.js +0 -1
  368. package/assets/esri/core/workers/chunks/f2d56f5c15d5977e1d19.js +0 -1
  369. package/assets/esri/core/workers/chunks/f7bfa3d33b05b250ce33.js +0 -1
  370. package/assets/esri/core/workers/chunks/f905f1a1aa4c123cbe83.js +0 -1
  371. package/assets/esri/core/workers/chunks/fc139f251dc0523074e7.js +0 -1
  372. package/assets/esri/themes/base/widgets/_VideoPlayer.scss +0 -129
  373. package/assets/esri/widgets/VideoPlayer/t9n/messages.ar.json +0 -1
  374. package/assets/esri/widgets/VideoPlayer/t9n/messages.bg.json +0 -1
  375. package/assets/esri/widgets/VideoPlayer/t9n/messages.bs.json +0 -1
  376. package/assets/esri/widgets/VideoPlayer/t9n/messages.ca.json +0 -1
  377. package/assets/esri/widgets/VideoPlayer/t9n/messages.cs.json +0 -1
  378. package/assets/esri/widgets/VideoPlayer/t9n/messages.da.json +0 -1
  379. package/assets/esri/widgets/VideoPlayer/t9n/messages.de.json +0 -1
  380. package/assets/esri/widgets/VideoPlayer/t9n/messages.el.json +0 -1
  381. package/assets/esri/widgets/VideoPlayer/t9n/messages.en.json +0 -1
  382. package/assets/esri/widgets/VideoPlayer/t9n/messages.es.json +0 -1
  383. package/assets/esri/widgets/VideoPlayer/t9n/messages.et.json +0 -1
  384. package/assets/esri/widgets/VideoPlayer/t9n/messages.fi.json +0 -1
  385. package/assets/esri/widgets/VideoPlayer/t9n/messages.fr.json +0 -1
  386. package/assets/esri/widgets/VideoPlayer/t9n/messages.he.json +0 -1
  387. package/assets/esri/widgets/VideoPlayer/t9n/messages.hr.json +0 -1
  388. package/assets/esri/widgets/VideoPlayer/t9n/messages.hu.json +0 -1
  389. package/assets/esri/widgets/VideoPlayer/t9n/messages.id.json +0 -1
  390. package/assets/esri/widgets/VideoPlayer/t9n/messages.it.json +0 -1
  391. package/assets/esri/widgets/VideoPlayer/t9n/messages.ja.json +0 -1
  392. package/assets/esri/widgets/VideoPlayer/t9n/messages.ko.json +0 -1
  393. package/assets/esri/widgets/VideoPlayer/t9n/messages.lt.json +0 -1
  394. package/assets/esri/widgets/VideoPlayer/t9n/messages.lv.json +0 -1
  395. package/assets/esri/widgets/VideoPlayer/t9n/messages.nl.json +0 -1
  396. package/assets/esri/widgets/VideoPlayer/t9n/messages.no.json +0 -1
  397. package/assets/esri/widgets/VideoPlayer/t9n/messages.pl.json +0 -1
  398. package/assets/esri/widgets/VideoPlayer/t9n/messages.pt-BR.json +0 -1
  399. package/assets/esri/widgets/VideoPlayer/t9n/messages.pt-PT.json +0 -1
  400. package/assets/esri/widgets/VideoPlayer/t9n/messages.ro.json +0 -1
  401. package/assets/esri/widgets/VideoPlayer/t9n/messages.ru.json +0 -1
  402. package/assets/esri/widgets/VideoPlayer/t9n/messages.sk.json +0 -1
  403. package/assets/esri/widgets/VideoPlayer/t9n/messages.sl.json +0 -1
  404. package/assets/esri/widgets/VideoPlayer/t9n/messages.sr.json +0 -1
  405. package/assets/esri/widgets/VideoPlayer/t9n/messages.sv.json +0 -1
  406. package/assets/esri/widgets/VideoPlayer/t9n/messages.th.json +0 -1
  407. package/assets/esri/widgets/VideoPlayer/t9n/messages.tr.json +0 -1
  408. package/assets/esri/widgets/VideoPlayer/t9n/messages.uk.json +0 -1
  409. package/assets/esri/widgets/VideoPlayer/t9n/messages.vi.json +0 -1
  410. package/assets/esri/widgets/VideoPlayer/t9n/messages.zh-CN.json +0 -1
  411. package/assets/esri/widgets/VideoPlayer/t9n/messages.zh-HK.json +0 -1
  412. package/assets/esri/widgets/VideoPlayer/t9n/messages.zh-TW.json +0 -1
  413. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +0 -232
  414. package/widgets/VideoPlayer/VideoPlayerViewModel.js +0 -2
  415. package/widgets/VideoPlayer/components/MetadataSection.js +0 -2
  416. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +0 -2
  417. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +0 -2
  418. package/widgets/VideoPlayer/components/SettingsButton.js +0 -2
  419. package/widgets/VideoPlayer/css.js +0 -2
  420. package/widgets/VideoPlayer.d.ts +0 -119
  421. package/widgets/VideoPlayer.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import n from"../../../../../core/Logger.js";import{watch as r,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import s from"../../../../../geometry/Point.js";import{tryProject as c}from"../../../../../geometry/projectionUtils.js";import{empty as l,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as d}from"../../support/projectionUtils.js";import{createCoordinateHelper as f}from"../../../../interactive/coordinateHelper.js";import{EditGeometry as p}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as m}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let h=class extends t{constructor(e={}){super(e),this._version=0,this._internalGeometryChange=!1,this._extent=l()}set areaMeasurement(e){this._set(`areaMeasurement`,e),e!=null&&this.view!=null&&this._initialize(e,this.view)}set view(e){this._set(`view`,e),e!=null&&this.areaMeasurement!=null&&this._initialize(this.areaMeasurement,e)}get constructed(){return this.areaMeasurement!=null&&this.view!=null}get version(){return this._version}get isEmptyPolygon(){return!this.constructed||this._editGeometry.parts.length===0}get isValidPolygon(){return this.constructed&&this.polygonIsClosed}get extent(){if(this.constructed&&this._editGeometry.parts[0]?.vertices.length){let e=l(this._extent);return this.forEachVertex(t=>{u(e,t.pos)}),e}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this.removeAllHandles(),this.addHandles(r(()=>e.geometry,()=>{this._updateEditGeometryFromModelGeometry(e,t)},i)),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange(`polygonIsClosed`),this.notifyChange(`isValidPolygon`),this.notifyChange(`initialized`),this.notifyChange(`extent`),e&&this.notifyChange(`numVertices`)}_updateEditGeometryFromModelGeometry(e,t){if(this._version++,this._internalGeometryChange)return;this.removeHandles(`EditGeometry`);let r=e.geometry;if(r!=null){let i=c(r,t.spatialReference);i??d(e,r.spatialReference,n.getLogger(this)),r=i}this._editGeometryOperations=r==null?new m(new p(`polygon`,f(!0,!1,t.spatialReference)),t.state.viewingMode):m.fromGeometry(r,t.state.viewingMode),this._makeDirty(!0),this.emit(`change`),this.addHandles(this._editGeometry.on(`change`,t=>{this._makeDirty(t.addedVertices!=null||t.removedVertices!=null),this._internalGeometryChange=!0,e.geometry=this.numVertices>0?this._editGeometry.geometry:null,this._internalGeometryChange=!1}),`EditGeometry`)}get _editGeometry(){return this._editGeometryOperations.data}get vertices(){let e=[];return this.forEachVertex(t=>{e.push(t)}),e}get numVertices(){return this.constructed?this._editGeometry.parts[0]?.vertices.length??0:0}get polygonIsClosed(){return this._editGeometry.parts[0]?.isClosed()??!1}get firstPoint(){if(this.constructed){let{coordinateHelper:e,parts:t}=this._editGeometry,n=t[0]?.getFirstVertex();if(n!=null)return e.vectorToPoint(n.pos)}return null}get lastPoint(){if(this.constructed){let{coordinateHelper:e,parts:t}=this._editGeometry,n=t[0]?.getLastVertex();if(n!=null)return e.vectorToPoint(n.pos)}return null}getVertex(e){if(!this.constructed||!this._editGeometry.parts[0]?.vertices.length)return null;let t=this._editGeometry.parts[0].vertices[0],n=t;do{if(n.index===e)return n;n=n.rightSegment.rightVertex}while(n!==t&&n!=null);return null}getVertexPositionAsPoint(e){return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}getVertexPositionAsPointFromIndex(e){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(e).pos)}forEachVertex(e){if(this.constructed&&this._editGeometry.parts.length>0)for(let t of this._editGeometry.parts[0].iterateVertices())e(t,t.index)}forEachVertexPosition(e){let t=this._editGeometry.coordinateHelper;this.forEachVertex((n,r)=>{t.vectorToPoint(n.pos,g),e(g,r)})}clear(){this.areaMeasurement!=null&&(this.areaMeasurement.geometry=null)}add(e){if(!this.constructed)return null;let t=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(e),this._editGeometry.parts.at(0));return this.emit(`change`),t}close(){if(!this.constructed||this._editGeometry.parts.length===0)return null;let e=this._editGeometryOperations.closePart(this._editGeometry.parts[0]);return this.emit(`change`),e}ensureContains(e,t=``){let n=!1;if(this._editGeometry.parts.forEach(t=>{for(let r of t.iterateVertices())r===e&&(n=!0)}),!n)throw Error(`vertex doesn't exist ${t}`);return n}setVertexPosition(e,t){if(!this.constructed)return null;let n=this._editGeometryOperations.setVertexPosition(e,this._editGeometry.coordinateHelper.pointToVector(t));return this.emit(`change`),n}equals(e){if(this.numVertices!==e.numVertices)return!1;let t=!0;return this.forEachVertexPosition((n,r)=>{let i=e.getVertexPositionAsPointFromIndex(r);n.equals(i)||(t=!1)}),!!t}};e([a({value:null})],h.prototype,`areaMeasurement`,null),e([a({value:null})],h.prototype,`view`,null),e([a()],h.prototype,`isEmptyPolygon`,null),e([a()],h.prototype,`isValidPolygon`,null),e([a()],h.prototype,`extent`,null),e([a()],h.prototype,`spatialReference`,null),e([a()],h.prototype,`numVertices`,null),e([a()],h.prototype,`polygonIsClosed`,null),h=e([o(`esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementPathHelper`)],h);const g=new s;export{h as AreaMeasurement3DPathHelper};
2
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import n from"../../../../../core/Logger.js";import{watch as r,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import s from"../../../../../geometry/Point.js";import{empty as c,expandPointInPlace as l}from"../../../../../geometry/support/aaBoundingRect.js";import{applyPolygonProjectionAndElevationAlignment as u,logFailedGeometryProjectionError as d}from"../../support/projectionUtils.js";import{getElevationAtPoint as f}from"../../../support/ElevationProvider.js";import{createElevationUpdateHandle as p}from"../../../support/elevationUpdateUtils.js";import{createCoordinateHelper as m}from"../../../../interactive/coordinateHelper.js";import{EditGeometry as h}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as g}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let _=class extends t{constructor(e={}){super(e),this._version=0,this._internalGeometryChange=!1,this._extent=c()}set areaMeasurement(e){this._set(`areaMeasurement`,e),e!=null&&this.view!=null&&this._initialize(e,this.view)}set view(e){this._set(`view`,e),e!=null&&this.areaMeasurement!=null&&this._initialize(this.areaMeasurement,e)}get constructed(){return this.areaMeasurement!=null&&this.view!=null}get version(){return this._version}get isEmptyPolygon(){return!this.constructed||this._editGeometry.parts.length===0}get isValidPolygon(){return this.constructed&&this.polygonIsClosed}get extent(){if(this.constructed&&this._editGeometry.parts[0]?.vertices.length){let e=c(this._extent);return this.forEachVertex(t=>{l(e,t.pos)}),e}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this.removeAllHandles(),this.addHandles([r(()=>e.geometry,()=>{this._updateEditGeometryFromModelGeometry(e,t)},i),p({view:t,geometry:()=>{let t=e.geometry;return t?.hasZ?null:t},context:`ground`,onElevationChanges:()=>this._elevationAlignEditGeometry(e,t)})]),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange(`polygonIsClosed`),this.notifyChange(`isValidPolygon`),this.notifyChange(`initialized`),this.notifyChange(`extent`),e&&this.notifyChange(`numVertices`)}_updateEditGeometryFromModelGeometry(e,t){if(this._version++,this._internalGeometryChange)return;this.removeHandles(`EditGeometry`);let r=e.geometry;if(r!=null){let i=u(r,t.spatialReference,t.elevationProvider);i??d(e,r.spatialReference,n.getLogger(this)),r=i}this._editGeometryOperations=r==null?new g(new h(`polygon`,m(!0,!1,t.spatialReference)),t.state.viewingMode):g.fromGeometry(r,t.state.viewingMode),this._makeDirty(!0),this.emit(`change`),this.addHandles(this._editGeometry.on(`change`,t=>{this._internalGeometryChange||=(this._makeDirty(t.addedVertices!=null||t.removedVertices!=null),this._internalGeometryChange=!0,e.geometry=this.numVertices>0?this._editGeometry.geometry:null,!1)}),`EditGeometry`)}_elevationAlignEditGeometry(e,t){let n=e.geometry;if(n==null||n.hasZ)return;let r=[],i=this._editGeometry;for(let e of i.iterateVertices()){let n=i.coordinateHelper.vectorToPoint(e.pos,v),a=f(t.elevationProvider,n)??0;e.pos[2]!==a&&(e.pos[2]=a,r.push(e))}r.length!==0&&(this._internalGeometryChange=!0,i.notifyChanges({operation:`apply`,updatedVertices:r}),this._internalGeometryChange=!1,this._version++,this.emit(`change`))}get _editGeometry(){return this._editGeometryOperations.data}get geometry(){return this._editGeometry.geometry}get vertices(){let e=[];return this.forEachVertex(t=>{e.push(t)}),e}get numVertices(){return this.constructed?this._editGeometry.parts[0]?.vertices.length??0:0}get polygonIsClosed(){return this._editGeometry.parts[0]?.isClosed()??!1}get firstPoint(){if(this.constructed){let{coordinateHelper:e,parts:t}=this._editGeometry,n=t[0]?.getFirstVertex();if(n!=null)return e.vectorToPoint(n.pos)}return null}get lastPoint(){if(this.constructed){let{coordinateHelper:e,parts:t}=this._editGeometry,n=t[0]?.getLastVertex();if(n!=null)return e.vectorToPoint(n.pos)}return null}getVertex(e){if(!this.constructed||!this._editGeometry.parts[0]?.vertices.length)return null;let t=this._editGeometry.parts[0].vertices[0],n=t;do{if(n.index===e)return n;n=n.rightSegment.rightVertex}while(n!==t&&n!=null);return null}getVertexPositionAsPoint(e){return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}getVertexPositionAsPointFromIndex(e){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(e).pos)}forEachVertex(e){if(this.constructed&&this._editGeometry.parts.length>0)for(let t of this._editGeometry.parts[0].iterateVertices())e(t,t.index)}forEachVertexPosition(e){let t=this._editGeometry.coordinateHelper;this.forEachVertex((n,r)=>{t.vectorToPoint(n.pos,v),e(v,r)})}clear(){this.areaMeasurement!=null&&(this.areaMeasurement.geometry=null)}add(e){if(!this.constructed)return null;let t=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(e),this._editGeometry.parts.at(0));return this.emit(`change`),t}close(){if(!this.constructed||this._editGeometry.parts.length===0)return null;let e=this._editGeometryOperations.closePart(this._editGeometry.parts[0]);return this.emit(`change`),e}ensureContains(e,t=``){let n=!1;if(this._editGeometry.parts.forEach(t=>{for(let r of t.iterateVertices())r===e&&(n=!0)}),!n)throw Error(`vertex doesn't exist ${t}`);return n}setVertexPosition(e,t){if(!this.constructed)return null;let n=this._editGeometryOperations.setVertexPosition(e,this._editGeometry.coordinateHelper.pointToVector(t));return this.emit(`change`),n}equals(e){if(this.numVertices!==e.numVertices)return!1;let t=!0;return this.forEachVertexPosition((n,r)=>{let i=e.getVertexPositionAsPointFromIndex(r);n.equals(i)||(t=!1)}),!!t}};e([a({value:null})],_.prototype,`areaMeasurement`,null),e([a({value:null})],_.prototype,`view`,null),e([a()],_.prototype,`isEmptyPolygon`,null),e([a()],_.prototype,`isValidPolygon`,null),e([a()],_.prototype,`extent`,null),e([a()],_.prototype,`spatialReference`,null),e([a()],_.prototype,`numVertices`,null),e([a()],_.prototype,`polygonIsClosed`,null),_=e([o(`esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementPathHelper`)],_);const v=new s;export{_ as AreaMeasurement3DPathHelper};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{resizeFilled as n}from"../../../../../core/arrayUtils.js";import{deg2rad as r}from"../../../../../core/mathUtils.js";import{abortMaybe as i}from"../../../../../core/maybe.js";import{debounce as a,throwIfAborted as o,isPromiseLike as s}from"../../../../../core/promiseUtils.js";import{valueInUnit as c}from"../../../../../core/quantity.js";import{lengthUnitFromSpatialReference as l,areaUnitFromSpatialReference as u}from"../../../../../core/units.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import{subclass as f}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as p}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{copy as h,set as g,cross as _,subtract as v,dot as y,scale as b,add as x}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as C}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as w}from"../../../../../core/support/UpdatingHandles.js";import T from"../../../../../geometry/Polygon.js";import E from"../../../../../geometry/SpatialReference.js";import{isPCPF as D}from"../../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectDirection as O}from"../../../../../geometry/projection/projectDirection.js";import{projectPointToVector as k}from"../../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as A}from"../../../../../geometry/projection/projectVectorToVector.js";import{Sphere as j}from"../../../../../geometry/support/sphere.js";import{bestFitPlane as M,planePointDistance as N,boundingSphere as P}from"../../support/measurementUtils.js";import{getElevationAtPoint as F}from"../../../support/ElevationProvider.js";import{midpoint3d as I,makeOrthonormal as L}from"../../../support/mathUtils.js";import{polygonToRenderInfoNotElevationAligned as R}from"../../../support/renderInfoUtils/polygon.js";import{GeometryWorkerHandle as z}from"../../../../support/GeometryWorkerHandle.js";import{computeEuclideanMeasurementSR as B}from"../../../../support/measurementUtils.js";import{autoMeasurementMode as V}from"../../../../support/measurementWorkerUtils.js";class H{constructor(e){this.positionsWorld=[],this.positionsRender=[],this.positionsFittedRender=[],this.triangleIndices=null,this.areaPolygon=new T({rings:[[]],spatialReference:e}),this.positionsFittedWorldPlaneProjected=this.areaPolygon.rings[0],this.trianglePositions=this.positionsFittedRender,this.triangleUvs=this.positionsFittedWorldPlaneProjected}}class U{constructor(e,t=null,n=null,r=null,i=null,a=null,o=null){this.mode=e,this.area=t,this.geodesicArea=n,this.perimeter=r,this.geodesicPerimeter=i,this.areaCentroidRenderCoords=a,this.geodesicAreaCentroidRenderCoords=o}}let W=class extends t{get numVertices(){return this._length}get hasStagedVertex(){return this._lastCursorPoint!=null}get fittingMode(){return this._fittingMode}get measurements(){return this._measurements}get updating(){return this._updatingHandles.updating}get renderSpatialReference(){return this.view.renderSpatialReference}get updateId(){return this._updateId}constructor(e){super(e),this._length=0,this._lastCursorPoint=null,this._lastPath=null,this._lastPathVersion=-1,this._lastMode=null,this._updatingHandles=new w,this._fittingMode=null,this._measurements=null,this._updateId=0,this._centroidRenderCoords=S(),this._planeWorldCoords=C(),this._worldUp=S(),this._worldTangent=S(),this._frame=[S(),S(),S()],this._worldOrigin=S(),this._updateAxisU=S(),this._updateAxisV=S(),this._updateWorldOrigin=S(),this._tempU=S(),this._tempV=S(),this._tempVec3=S(),this._tempSphere=new j,this._measurementWorker=new z({preloadGeodetic:!0}),this._retryAfterLoadScheduled=!1,this._updateAbortController=null,this._retryAfterTessellationLoad=()=>{if(this._retryAfterLoadScheduled=!1,this.destroyed)return;let e=this._lastPath,t=this._lastCursorPoint,n=this._lastMode;e&&n!=null&&this._update(e,t,n)},this._updateMeasurements=a(async(e,t,n,r)=>{let i=this.view.spatialReference,a=V(i)===0;h(this._updateAxisU,this._frame[0]),h(this._updateAxisV,this._frame[1]),h(this._updateWorldOrigin,this._worldOrigin);let s=(e,t)=>(e&&this.view.renderCoordsHelper.toRenderCoords(e,t)||g(t,0,0,0),t),c=e.areaMeasurement?.geometry,l=a&&t!==1&&c?await this._measurementWorker.geodeticLength(c,void 0,n):null;o(r);let u=this._calculateMode(t,l),d=u===`geodesic`,[f,p]=await Promise.all([d?null:this._measurementWorker.area2D(this.vertexData.areaPolygon,{unit:this._areaMeasurementUnit,lengthUnit:this._lengthMeasurementUnit,returnCentroid:!0,returnLength:!0}),d&&c?await this._measurementWorker.geodeticArea(c,{returnCentroid:!0},n):null]);o(r);let m=d?null:S();m&&f?.centroid&&this._projectWorldPlaneProjectedPointToRender(m,this._updateWorldOrigin,[f.centroid?.x??0,f.centroid?.y??0],this._updateAxisU,this._updateAxisV,this.view.renderSpatialReference,this._measurementSR);let _=p?.centroid?s(p.centroid,S()):null;this._measurements=new U(u,d?null:f?.area,d?p?.area:null,d?null:f?.length,d?l:null,d?null:m,d?_:null)});let t=B(e.view.spatialReference);this._measurementSR=t,this._lengthMeasurementUnit=l(t)??`meters`,this._areaMeasurementUnit=u(t)??`square-meters`;let n=D(t)?E.WebMercator:t;this.vertexData=new H(n)}destroy(){this._measurementWorker.destroy(),this._updatingHandles.destroy()}update(e,t,n){let r=this._lastPathVersion===e.version,i=t?t.equals(this._lastCursorPoint):this._lastCursorPoint==null,a=this._lastMode===n;return r&&a&&i?!1:(this._lastPath=e,this._lastPathVersion=e.version,this._lastCursorPoint=t,this._lastMode=n,this._update(e,t,n),!0)}_scheduleRetryAfterTessellationLoad(e){this._retryAfterLoadScheduled||(this._retryAfterLoadScheduled=!0,this._updatingHandles.consumePromise(e.then(()=>this._retryAfterTessellationLoad(),()=>{this._retryAfterLoadScheduled=!1})))}_update(e,t,n){let r=this._measurementSR,a=e.numVertices,o=t!=null&&!t.equals(e.lastPoint)&&!(a>2&&t.equals(e.firstPoint))&&!e.polygonIsClosed;o&&(a+=1);let s=!e.polygonIsClosed&&a>2,c=e.polygonIsClosed||s;this._resize(a);let{positionsWorld:l,positionsRender:u}=this.vertexData,d=(e,t)=>{G(this.view.elevationProvider,e),k(e,l[t],r),k(e,u[t],this.renderSpatialReference)};e.forEachVertexPosition((e,t)=>d(e,t)),o&&d(t,a-1),this.vertexData.areaPolygon.clearCache(),c?this._updateVertexData()&&(this._updateId++,this._updateAbortController??=new AbortController,this._updatingHandles.consumePromise(this._updateMeasurements(e,n,t,this._updateAbortController.signal))):(this._measurements=null,this.vertexData.triangleIndices=null,this._updateId++,this._updateAbortController=i(this._updateAbortController))}_resize(e){let{positionsWorld:t,positionsRender:r,positionsFittedWorldPlaneProjected:i,positionsFittedRender:a}=this.vertexData;n(t,e,S),n(r,e,S),n(i,e,m),n(a,e,S),this._length=e}_updateVertexData(){let e=this._measurementSR,t=this.view.renderCoordsHelper,{positionsWorld:n,positionsRender:r}=this.vertexData,i=this._planeWorldCoords,a=this._centroidRenderCoords;I(r,a),t.worldUpAtPosition(a,this._worldUp),t.worldBasisAtPosition(a,0,this._worldTangent),O(a,this._worldUp,this.renderSpatialReference,this._worldUp,e),O(a,this._worldTangent,this.renderSpatialReference,this._worldTangent,e),n.length>2&&M(n,i),this._fittingMode=this._selectFittingMode(i,n,this._worldUp,this.fittingSettings);let o=0;if(this._fittingMode===`horizontal`){let e=-1/0;r.forEach((n,i)=>{let a=t.getAltitude(r[i]);a>e&&(e=a,o=i)})}let{_worldOrigin:s}=this;h(this._worldOrigin,n[o]);let c=i,l=this._worldTangent;this._fittingMode===`horizontal`?c=this._worldUp:this._fittingMode===`vertical`&&(c=this._tempVec3,l=this._worldUp,L(i,this._worldUp,c));let u=this._frame[0],d=this._frame[1];h(this._frame[2],c),L(l,c,u),_(d,u,this._frame[2]);let{positionsFittedRender:f,positionsFittedWorldPlaneProjected:m}=this.vertexData,g=this._tempVec3;for(let t=0;t<this._length;++t){let r=m[t],i=f[t];v(g,n[t],s),p(r,y(u,g),y(d,g)),this._projectWorldPlaneProjectedPointToRender(i,s,r,u,d,this.renderSpatialReference,e)}return this._triangulate(new q(s,u,d,this.renderSpatialReference,e))}_triangulate(e){let{worldOrigin:t,axisU:r,axisV:i,renderSR:a,worldSR:o}=e,{areaPolygon:c}=this.vertexData,l=R(c);if(s(l))return this._scheduleRetryAfterTessellationLoad(l),!1;let u=l;if(u==null)return!0;let{positions:d,polygonIndices:f,vertexCount:h}=u,g=[],_=[];n(_,h,S),n(g,h,m);for(let e=0,n=0;e<d.length;e+=3,n++){let s=_[n],c=g[n];p(c,d[e],d[e+1]),this._projectWorldPlaneProjectedPointToRender(s,t,c,r,i,a,o)}return this.vertexData.trianglePositions=_,this.vertexData.triangleIndices=f,this.vertexData.triangleUvs=g,!0}_projectWorldPlaneProjectedPointToRender(e,t,n,r,i,a,o){let s=this._tempU,c=this._tempV;b(s,r,n[0]),b(c,i,n[1]),x(e,s,c),x(e,e,t),A(e,o,e,a)}_selectFittingMode(e,t,n,i){let a=t.map(t=>Math.abs(N(e,t))).reduce((e,t)=>Math.max(e,t),0);P(t,this._tempSphere);let o=a/(this._tempSphere.radius*2),s=o<i.maxRelativeErrorCoplanar,c=o<i.maxRelativeErrorAlmostCoplanar,l=`horizontal`;return s?l=`oblique`:c&&(l=Math.abs(y(n,e))>Math.cos(r(i.verticalAngleThreshold))?`horizontal`:`vertical`),l}_calculateMode(e,t){return t!=null&&e===0?c(t,`meters`)>K?`geodesic`:`euclidean`:t==null||e===1?`euclidean`:`geodesic`}};e([d()],W.prototype,`_measurements`,void 0),e([d()],W.prototype,`updating`,null),e([d()],W.prototype,`renderSpatialReference`,null),e([d()],W.prototype,`_updateId`,void 0),e([d()],W.prototype,`view`,void 0),e([d({constructOnly:!0})],W.prototype,`fittingSettings`,void 0),W=e([f(`esri.views.3d.analysis.AreaMeasurement.support.MeasurementData`)],W);function G(e,t){t.hasZ||(t.z=F(e,t,`ground`)??0)}const K=1e5;class q{constructor(e,t,n,r,i){this.worldOrigin=e,this.axisU=t,this.axisV=n,this.renderSR=r,this.worldSR=i}}export{U as AreaMeasurementQuantities,W as MeasurementData};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{resizeFilled as n}from"../../../../../core/arrayUtils.js";import{deg2rad as r}from"../../../../../core/mathUtils.js";import{abortMaybe as i}from"../../../../../core/maybe.js";import{debounce as a,throwIfAborted as o,isPromiseLike as s}from"../../../../../core/promiseUtils.js";import{valueInUnit as c}from"../../../../../core/quantity.js";import{lengthUnitFromSpatialReference as l,areaUnitFromSpatialReference as u}from"../../../../../core/units.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import{subclass as f}from"../../../../../core/accessorSupport/decorators/subclass.js";import{set as p}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{copy as h,set as g,cross as _,subtract as v,dot as y,scale as b,add as x}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as C}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as w}from"../../../../../core/support/UpdatingHandles.js";import T from"../../../../../geometry/Polygon.js";import E from"../../../../../geometry/SpatialReference.js";import{isPCPF as D}from"../../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectDirection as O}from"../../../../../geometry/projection/projectDirection.js";import{projectPointToVector as k}from"../../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as A}from"../../../../../geometry/projection/projectVectorToVector.js";import{Sphere as j}from"../../../../../geometry/support/sphere.js";import{bestFitPlane as M,planePointDistance as N,boundingSphere as P}from"../../support/measurementUtils.js";import{getElevationAtPoint as F}from"../../../support/ElevationProvider.js";import{midpoint3d as I,makeOrthonormal as L}from"../../../support/mathUtils.js";import{polygonToRenderInfoNotElevationAligned as R}from"../../../support/renderInfoUtils/polygon.js";import{GeometryWorkerHandle as z}from"../../../../support/GeometryWorkerHandle.js";import{computeEuclideanMeasurementSR as B}from"../../../../support/measurementUtils.js";import{autoMeasurementMode as V}from"../../../../support/measurementWorkerUtils.js";class H{constructor(e){this.positionsWorld=[],this.positionsRender=[],this.positionsFittedRender=[],this.triangleIndices=null,this.areaPolygon=new T({rings:[[]],spatialReference:e}),this.positionsFittedWorldPlaneProjected=this.areaPolygon.rings[0],this.trianglePositions=this.positionsFittedRender,this.triangleUvs=this.positionsFittedWorldPlaneProjected}}class U{constructor(e,t=null,n=null,r=null,i=null,a=null,o=null){this.mode=e,this.area=t,this.geodesicArea=n,this.perimeter=r,this.geodesicPerimeter=i,this.areaCentroidRenderCoords=a,this.geodesicAreaCentroidRenderCoords=o}}let W=class extends t{get numVertices(){return this._length}get hasStagedVertex(){return this._lastCursorPoint!=null}get fittingMode(){return this._fittingMode}get measurements(){return this._measurements}get updating(){return this._updatingHandles.updating}get renderSpatialReference(){return this.view.renderSpatialReference}get updateId(){return this._updateId}constructor(e){super(e),this._length=0,this._lastCursorPoint=null,this._lastPath=null,this._lastPathVersion=-1,this._lastMode=null,this._updatingHandles=new w,this._fittingMode=null,this._measurements=null,this._updateId=0,this._centroidRenderCoords=S(),this._planeWorldCoords=C(),this._worldUp=S(),this._worldTangent=S(),this._frame=[S(),S(),S()],this._worldOrigin=S(),this._updateAxisU=S(),this._updateAxisV=S(),this._updateWorldOrigin=S(),this._tempU=S(),this._tempV=S(),this._tempVec3=S(),this._tempSphere=new j,this._measurementWorker=new z({preloadGeodetic:!0}),this._retryAfterLoadScheduled=!1,this._updateAbortController=null,this._retryAfterTessellationLoad=()=>{if(this._retryAfterLoadScheduled=!1,this.destroyed)return;let e=this._lastPath,t=this._lastCursorPoint,n=this._lastMode;e&&n!=null&&this._update(e,t,n)},this._updateMeasurements=a(async(e,t,n,r)=>{let i=this.view.spatialReference,a=V(i)===0;h(this._updateAxisU,this._frame[0]),h(this._updateAxisV,this._frame[1]),h(this._updateWorldOrigin,this._worldOrigin);let s=(e,t)=>(e&&this.view.renderCoordsHelper.toRenderCoords(e,t)||g(t,0,0,0),t),c=e.geometry,l=a&&t!==1&&c?await this._measurementWorker.geodeticLength(c,void 0,n):null;o(r);let u=this._calculateMode(t,l),d=u===`geodesic`,[f,p]=await Promise.all([d?null:this._measurementWorker.area2D(this.vertexData.areaPolygon,{unit:this._areaMeasurementUnit,lengthUnit:this._lengthMeasurementUnit,returnCentroid:!0,returnLength:!0}),d&&c?await this._measurementWorker.geodeticArea(c,{returnCentroid:!0},n):null]);o(r);let m=d?null:S();m&&f?.centroid&&this._projectWorldPlaneProjectedPointToRender(m,this._updateWorldOrigin,[f.centroid?.x??0,f.centroid?.y??0],this._updateAxisU,this._updateAxisV,this.view.renderSpatialReference,this._measurementSR);let _=p?.centroid?s(p.centroid,S()):null;this._measurements=new U(u,d?null:f?.area,d?p?.area:null,d?null:f?.length,d?l:null,d?null:m,d?_:null)});let t=B(e.view.spatialReference);this._measurementSR=t,this._lengthMeasurementUnit=l(t)??`meters`,this._areaMeasurementUnit=u(t)??`square-meters`;let n=D(t)?E.WebMercator:t;this.vertexData=new H(n)}destroy(){this._updateAbortController=i(this._updateAbortController),this._measurementWorker.destroy(),this._updatingHandles.destroy()}update(e,t,n){let r=this._lastPathVersion===e.version,i=t?t.equals(this._lastCursorPoint):this._lastCursorPoint==null,a=this._lastMode===n;return r&&a&&i?!1:(this._lastPath=e,this._lastPathVersion=e.version,this._lastCursorPoint=t,this._lastMode=n,this._update(e,t,n),!0)}_scheduleRetryAfterTessellationLoad(e){this._retryAfterLoadScheduled||(this._retryAfterLoadScheduled=!0,this._updatingHandles.consumePromise(e.then(()=>this._retryAfterTessellationLoad(),()=>{this._retryAfterLoadScheduled=!1})))}_update(e,t,n){let r=this._measurementSR,a=e.numVertices,o=t!=null&&!t.equals(e.lastPoint)&&!(a>2&&t.equals(e.firstPoint))&&!e.polygonIsClosed;o&&(a+=1);let s=!e.polygonIsClosed&&a>2,c=e.polygonIsClosed||s;this._resize(a);let{positionsWorld:l,positionsRender:u}=this.vertexData,d=(e,t)=>{G(this.view.elevationProvider,e),k(e,l[t],r),k(e,u[t],this.renderSpatialReference)};e.forEachVertexPosition((e,t)=>d(e,t)),o&&d(t,a-1),this.vertexData.areaPolygon.clearCache(),c?this._updateVertexData()&&(this._updateId++,this._updateAbortController=i(this._updateAbortController),this._updateAbortController=new AbortController,this._updatingHandles.consumePromise(this._updateMeasurements(e,n,t,this._updateAbortController.signal))):(this._measurements=null,this.vertexData.triangleIndices=null,this._updateId++,this._updateAbortController=i(this._updateAbortController))}_resize(e){let{positionsWorld:t,positionsRender:r,positionsFittedWorldPlaneProjected:i,positionsFittedRender:a}=this.vertexData;n(t,e,S),n(r,e,S),n(i,e,m),n(a,e,S),this._length=e}_updateVertexData(){let e=this._measurementSR,t=this.view.renderCoordsHelper,{positionsWorld:n,positionsRender:r}=this.vertexData,i=this._planeWorldCoords,a=this._centroidRenderCoords;I(r,a),t.worldUpAtPosition(a,this._worldUp),t.worldBasisAtPosition(a,0,this._worldTangent),O(a,this._worldUp,this.renderSpatialReference,this._worldUp,e),O(a,this._worldTangent,this.renderSpatialReference,this._worldTangent,e),n.length>2&&M(n,i),this._fittingMode=this._selectFittingMode(i,n,this._worldUp,this.fittingSettings);let o=0;if(this._fittingMode===`horizontal`){let e=-1/0;r.forEach((n,i)=>{let a=t.getAltitude(r[i]);a>e&&(e=a,o=i)})}let{_worldOrigin:s}=this;h(this._worldOrigin,n[o]);let c=i,l=this._worldTangent;this._fittingMode===`horizontal`?c=this._worldUp:this._fittingMode===`vertical`&&(c=this._tempVec3,l=this._worldUp,L(i,this._worldUp,c));let u=this._frame[0],d=this._frame[1];h(this._frame[2],c),L(l,c,u),_(d,u,this._frame[2]);let{positionsFittedRender:f,positionsFittedWorldPlaneProjected:m}=this.vertexData,g=this._tempVec3;for(let t=0;t<this._length;++t){let r=m[t],i=f[t];v(g,n[t],s),p(r,y(u,g),y(d,g)),this._projectWorldPlaneProjectedPointToRender(i,s,r,u,d,this.renderSpatialReference,e)}return this._triangulate(new q(s,u,d,this.renderSpatialReference,e))}_triangulate(e){let{worldOrigin:t,axisU:r,axisV:i,renderSR:a,worldSR:o}=e,{areaPolygon:c}=this.vertexData,l=R(c);if(s(l))return this._scheduleRetryAfterTessellationLoad(l),!1;let u=l;if(u==null)return!0;let{positions:d,polygonIndices:f,vertexCount:h}=u,g=[],_=[];n(_,h,S),n(g,h,m);for(let e=0,n=0;e<d.length;e+=3,n++){let s=_[n],c=g[n];p(c,d[e],d[e+1]),this._projectWorldPlaneProjectedPointToRender(s,t,c,r,i,a,o)}return this.vertexData.trianglePositions=_,this.vertexData.triangleIndices=f,this.vertexData.triangleUvs=g,!0}_projectWorldPlaneProjectedPointToRender(e,t,n,r,i,a,o){let s=this._tempU,c=this._tempV;b(s,r,n[0]),b(c,i,n[1]),x(e,s,c),x(e,e,t),A(e,o,e,a)}_selectFittingMode(e,t,n,i){let a=t.map(t=>Math.abs(N(e,t))).reduce((e,t)=>Math.max(e,t),0);P(t,this._tempSphere);let o=a/(this._tempSphere.radius*2),s=o<i.maxRelativeErrorCoplanar,c=o<i.maxRelativeErrorAlmostCoplanar,l=`horizontal`;return s?l=`oblique`:c&&(l=Math.abs(y(n,e))>Math.cos(r(i.verticalAngleThreshold))?`horizontal`:`vertical`),l}_calculateMode(e,t){return t!=null&&e===0?c(t,`meters`)>K?`geodesic`:`euclidean`:t==null||e===1?`euclidean`:`geodesic`}};e([d()],W.prototype,`_measurements`,void 0),e([d()],W.prototype,`updating`,null),e([d()],W.prototype,`renderSpatialReference`,null),e([d()],W.prototype,`_updateId`,void 0),e([d()],W.prototype,`view`,void 0),e([d({constructOnly:!0})],W.prototype,`fittingSettings`,void 0),W=e([f(`esri.views.3d.analysis.AreaMeasurement.support.MeasurementData`)],W);function G(e,t){t.hasZ||(t.z=F(e,t,`ground`)??0)}const K=1e5;class q{constructor(e,t,n,r,i){this.worldOrigin=e,this.axisU=t,this.axisV=n,this.renderSR=r,this.worldSR=i}}export{U as AreaMeasurementQuantities,W as MeasurementData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Logger.js";import{debounce as r}from"../../../../core/promiseUtils.js";import{toUnit as i}from"../../../../core/quantity.js";import{watch as a,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{adaptiveLengthUnit as s,adaptiveVerticalLengthUnit as c}from"../../../../core/units.js";import{property as l,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{applyProjectionAndElevationAlignment as f,logFailedGeometryProjectionError as p}from"../support/projectionUtils.js";import{euclideanDistanceBetweenPoints as m}from"../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as h}from"../../../support/GeometryWorkerHandle.js";import{autoMeasurementMode as g}from"../../../support/measurementWorkerUtils.js";let _=class extends t{get updating(){return this._updatingHandles.updating}constructor(e){super(e),this._updatingHandles=new d,this._measurementWorker=new h({preloadGeodetic:!0}),this._computeResultDebounced=r(async({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,measurementMode:n,unit:r})=>{if(e==null||t==null)return null;let a=m(e,t);if(!a)return null;let o=n===1?`euclidean`:n===2||g(this.view.spatialReference)===0?`geodesic`:`euclidean`,l=o===`geodesic`?await this._measurementWorker.geodeticDistanceBetweenPoints(e,t):a?.horizontal,{direct:u,vertical:d}=a,f=s(u.value,u.unit,r),p=s(l.value,l.unit,r),h=c(d.value,d.unit,r);return{mode:o,directDistance:i(u,f),horizontalDistance:i(l,p),verticalDistance:i(d,h)}})}initialize(){this.addHandles([a(()=>({viewData:this.viewData,startPoint:this.analysis.startPoint}),({viewData:e,startPoint:t})=>{e.elevationAlignedStartPoint=this._applyProjectionAndElevationAlignment(t)},o),a(()=>({viewData:this.viewData,endPoint:this.analysis.endPoint}),({viewData:e,endPoint:t})=>{e.elevationAlignedEndPoint=this._applyProjectionAndElevationAlignment(t)},o),a(()=>{let{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,measurementMode:n,unit:r}=this.viewData;return{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,measurementMode:n,unit:r}},e=>{this._updatingHandles.consumePromise(this._computeResultDebounced(e).then(e=>{this.viewData.result=e}))},o)])}destroy(){this._updatingHandles.destroy(),this._measurementWorker.destroy()}_applyProjectionAndElevationAlignment(e){if(e==null)return e;let{spatialReference:t,elevationProvider:r}=this.view;return f(e,t,r)??(p(this.analysis,e.spatialReference,n.getLogger(this)),null)}};e([l({constructOnly:!0})],_.prototype,`view`,void 0),e([l({constructOnly:!0})],_.prototype,`analysis`,void 0),e([l({constructOnly:!0})],_.prototype,`viewData`,void 0),_=e([u(`esri.views.3d.analysis.DirectLineMeasurement.DirectLineMeasurementController`)],_);export{_ as DirectLineMeasurementController};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Logger.js";import{debounce as r}from"../../../../core/promiseUtils.js";import{toUnit as i}from"../../../../core/quantity.js";import{watch as a,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{adaptiveLengthUnit as s,adaptiveVerticalLengthUnit as c}from"../../../../core/units.js";import{property as l,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{applyProjectionAndElevationAlignment as f,logFailedGeometryProjectionError as p}from"../support/projectionUtils.js";import{createElevationUpdateHandle as m}from"../../support/elevationUpdateUtils.js";import{euclideanDistanceBetweenPoints as h}from"../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as g}from"../../../support/GeometryWorkerHandle.js";import{autoMeasurementMode as _}from"../../../support/measurementWorkerUtils.js";let v=class extends t{get updating(){return this._updatingHandles.updating}constructor(e){super(e),this._updatingHandles=new d,this._measurementWorker=new g({preloadGeodetic:!0}),this._computationId=0,this._computeResultDebounced=r(async({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,measurementMode:n,unit:r})=>{if(e==null||t==null)return null;let a=h(e,t);if(!a)return null;let o=n===1?`euclidean`:n===2||_(this.view.spatialReference)===0?`geodesic`:`euclidean`,l=o===`geodesic`?await this._measurementWorker.geodeticDistanceBetweenPoints(e,t):a?.horizontal,{direct:u,vertical:d}=a,f=s(u.value,u.unit,r),p=s(l.value,l.unit,r),m=c(d.value,d.unit,r);return{mode:o,directDistance:i(u,f),horizontalDistance:i(l,p),verticalDistance:i(d,m)}})}initialize(){for(let[e,t]of[[`startPoint`,`elevationAlignedStartPoint`],[`endPoint`,`elevationAlignedEndPoint`]]){let n=()=>{this.viewData[t]=this._applyProjectionAndElevationAlignment(this.analysis[e])};this.addHandles([a(()=>this.analysis[e],n,o),m({view:this.view,geometry:()=>{let t=this.analysis[e];return t?.hasZ?null:t},context:`ground`,onElevationChanges:n})])}this.addHandles([a(()=>{let{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,measurementMode:n,unit:r}=this.viewData;return{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,measurementMode:n,unit:r}},e=>{let t=++this._computationId;this._updatingHandles.consumePromise(this._computeResultDebounced(e).then(e=>{!this.destroyed&&t===this._computationId&&(this.viewData.result=e)}))},o)])}destroy(){this._updatingHandles.destroy(),this._measurementWorker.destroy()}_applyProjectionAndElevationAlignment(e){if(e==null)return e;let{spatialReference:t,elevationProvider:r}=this.view;return f(e,t,r)??(p(this.analysis,e.spatialReference,n.getLogger(this)),null)}};e([l({constructOnly:!0})],v.prototype,`view`,void 0),e([l({constructOnly:!0})],v.prototype,`analysis`,void 0),e([l({constructOnly:!0})],v.prototype,`viewData`,void 0),v=e([u(`esri.views.3d.analysis.DirectLineMeasurement.DirectLineMeasurementController`)],v);export{v as DirectLineMeasurementController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{tryProject as e}from"../../../../geometry/projectionUtils.js";import{getElevationAtPoint as t}from"../../support/ElevationProvider.js";function n(n,r,i,a=!1){let o=e(n,r);return o==null?null:((!o.hasZ||a)&&i!=null&&(o.z=t(i,o)??0),o)}function r(e,t,n){n.warnOnce(`Failed to project analysis geometry (id: '${e.id}'), projection from spatial reference (wkid: '${t.wkid}') to view spatial reference is not supported. Projection may be possible after calling projectOperator.load().`)}export{n as applyProjectionAndElevationAlignment,r as logFailedGeometryProjectionError};
2
+ import{tryProject as e}from"../../../../geometry/projectionUtils.js";import{getElevationAtPoint as t}from"../../support/ElevationProvider.js";function n(n,r,i,a=!1){let o=e(n,r);return o==null?null:((!o.hasZ||a)&&i!=null&&(o.z=t(i,o)??0),o)}function r(t,n,r){let i=e(t,n);if(i==null||t.hasZ)return i;for(let e of i.rings)for(let t of e){let e=r.getElevation(t[0],t[1],0,i.spatialReference,`ground`)??0;t.splice(2,+!!i.hasZ,e)}return i.hasZ=!0,i}function i(e,t,n){n.warnOnce(`Failed to project analysis geometry (id: '${e.id}'), projection from spatial reference (wkid: '${t.wkid}') to view spatial reference is not supported. Projection may be possible after calling projectOperator.load().`)}export{r as applyPolygonProjectionAndElevationAlignment,n as applyProjectionAndElevationAlignment,i as logFailedGeometryProjectionError};
@@ -64,8 +64,19 @@ export default class SunLighting extends SunLightingSuperclass {
64
64
  get date(): Date;
65
65
  set date(value: (Date | number | string));
66
66
  /**
67
- * Enables global illumination for more realistic lighting in the scene. Emissive materials illuminate nearby
68
- * surfaces, while areas where surrounding objects block ambient light receive more natural shading.
67
+ * Enables global illumination for more realistic lighting in the scene through ambient occlusion and emissive lighting.
68
+ * * **Ambient occlusion** darkens areas where surrounding geometry blocks ambient light, adding definition to corners, crevices, and spaces between buildings.
69
+ * * **Emissive lighting** illuminates surfaces near emissive materials. The illumination depends on the emitters’ strength and color, as well as their distance from the surfaces they illuminate.
70
+ *
71
+ * <figure>
72
+ * <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/views/3d/gi-onoff.avif"
73
+ * alt="Comparison of scene lighting with global illumination enabled and disabled" />
74
+ * <figcaption>Global illumination, enabled on the right, adds more detailed ambient occlusion shading and lighting from emissive materials.</figcaption>
75
+ * </figure>
76
+ *
77
+ * Global illumination uses a screen-space technique to maintain interactive performance. The result depends on the camera position and viewing angle. Emissive objects outside the camera’s view or hidden behind other geometry do not contribute lighting.
78
+ *
79
+ * Global illumination progressively accumulates lighting over multiple frames, reducing noise and improving visual quality. Camera movements and animated objects may cause temporary noise or other visual artifacts.
69
80
  *
70
81
  * **Known limitations**
71
82
  *
@@ -74,8 +85,10 @@ export default class SunLighting extends SunLightingSuperclass {
74
85
  * - May produce temporarily noisy lighting after camera or scene changes.
75
86
  * - May reduce rendering performance.
76
87
  *
88
+ * @default false
77
89
  * @beta
78
90
  * @since 5.2
91
+ * @see [Sample - Global Illumination](https://developers.arcgis.com/javascript/latest/sample-code/global-illumination/)
79
92
  */
80
93
  accessor globalIllumination: boolean;
81
94
  /** Indicates that the light source is simulated position of the sun. */
@@ -42,8 +42,19 @@ export interface VirtualLightingProperties extends WebSceneVirtualLightingProper
42
42
  export default class VirtualLighting extends VirtualLightingSuperclass {
43
43
  constructor(properties?: VirtualLightingProperties);
44
44
  /**
45
- * Enables global illumination for more realistic lighting in the scene. Emissive materials illuminate nearby
46
- * surfaces, while areas where surrounding objects block ambient light receive more natural shading.
45
+ * Enables global illumination for more realistic lighting in the scene through ambient occlusion and emissive lighting.
46
+ * * **Ambient occlusion** darkens areas where surrounding geometry blocks ambient light, adding definition to corners, crevices, and spaces between buildings.
47
+ * * **Emissive lighting** illuminates surfaces near emissive materials. The illumination depends on the emitters’ strength and color, as well as their distance from the surfaces they illuminate.
48
+ *
49
+ * <figure>
50
+ * <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/views/3d/gi-onoff.avif"
51
+ * alt="Comparison of scene lighting with global illumination enabled and disabled" />
52
+ * <figcaption>Global illumination, enabled on the right, adds more detailed ambient occlusion shading and lighting from emissive materials.</figcaption>
53
+ * </figure>
54
+ *
55
+ * Global illumination uses a screen-space technique to maintain interactive performance. The result depends on the camera position and viewing angle. Emissive objects outside the camera’s view or hidden behind other geometry do not contribute lighting.
56
+ *
57
+ * Global illumination progressively accumulates lighting over multiple frames, reducing noise and improving visual quality. Camera movements and animated objects may cause temporary noise or other visual artifacts.
47
58
  *
48
59
  * **Known limitations**
49
60
  *
@@ -52,8 +63,10 @@ export default class VirtualLighting extends VirtualLightingSuperclass {
52
63
  * - May produce temporarily noisy lighting after camera or scene changes.
53
64
  * - May reduce rendering performance.
54
65
  *
66
+ * @default false
55
67
  * @beta
56
68
  * @since 5.2
69
+ * @see [Sample - Global Illumination](https://developers.arcgis.com/javascript/latest/sample-code/global-illumination/)
57
70
  */
58
71
  accessor globalIllumination: boolean;
59
72
  /**
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as r,initial as i,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DragRotate as l}from"./handlers/DragRotate.js";import{DragZoom as u}from"./handlers/DragZoom.js";import{DragZoomBox as d}from"./handlers/DragZoomBox.js";import{GamepadNavigation as f}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as p}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as m}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as h}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as g}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as _}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as v}from"./handlers/TwoFingerTilt.js";import{GroundDoubleClickMove as y}from"./handlers/ground/GroundDoubleClickMove.js";import{GroundNavigation as b}from"./handlers/ground/GroundNavigation.js";import{BrowserEventSource as x}from"../../input/BrowserEventSource.js";import{InputManager as S,ViewEventPriorities as C}from"../../input/InputManager.js";import{PreventContextMenu as w}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as T}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as E}from"../../input/handlers/support.js";import{Drag as D}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as O}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as k}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as A}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as j}from"../../input/recognizers/VerticalTwoFingerDrag.js";const M=`modeDependentNavigation`;let N=class extends t{constructor(){super(...arguments),this.mode=`default`,this._keys={fov:`Shift`,pan:{left:`ArrowLeft`,right:`ArrowRight`,forward:`ArrowUp`,backward:`ArrowDown`,up:[`u`,`U`],down:[`j`,`J`]},lookAround:{headingLeft:[`a`,`A`],headingRight:[`d`,`D`],tiltUp:[`w`,`W`],tiltDown:[`s`,`S`]},modifier:[`b`,`B`],zoom:{zoomIn:[`+`,`=`],zoomOut:[`-`,`_`]},reset:{heading:[`n`,`N`],tilt:[`p`,`P`]},precisionPanModifier:`Alt`,coarsePanModifier:`Shift`},this._updateMode=({mode:e,dragPrimary:t,dragSecondary:n,dragTertiary:r})=>{e===`pro`&&(n=`zoom`,r=t===`pan`?`rotate`:`pan`);let i={dragPrimary:t,dragSecondary:n,dragTertiary:r};this._modeDragPan&&(this._modeDragPan.pointerActions=E(`pan`,i)),this._modeGroundNavigation&&(this._modeGroundNavigation.pointerActions=E(`pan`,i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=E(`rotate`,i)),this._modeGroundNavigationDragRotate&&(this._modeGroundNavigationDragRotate.pointerActions=E(`rotate`,i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=E(`zoom`,i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(e){let{actionMap:t}=this.view.navigation;t.dragPrimary=e,t.dragSecondary=e===`pan`?`rotate`:`pan`}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeGroundNavigation=null,this._modeDragRotate=null,this._modeGroundNavigationDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=n(this._inputManager),this._source=n(this._source)}connect(){let e=this.view;this._source=new x(this.view.surface,e.input);let t=[new O,new k,new A,new D(this.view.navigation),new j],n=new S({eventSource:this._source,recognizers:t});this._inputManager=n,n.installHandlers(`prevent-context-menu`,[new w],C.INTERNAL),n.installHandlers(`prevent-touch-text-selection-gesture`,[new T(this.view)],C.INTERNAL),this._modeDragPan=new g(e,[`primary`]),this._modeDragRotate=new l(e,[`secondary`],0),this._modeDragZoom=new u(e,[`tertiary`],this._keys.fov),this._modeKeyboardNavigation=new p(e,this._keys);let o=[new _(e),new c(e),new f(e),new m(e,this._keys.fov,!0),new h(e),new d(e),new l(e,[`primary`],1,this._keys.modifier),new b(e,[`secondary`],this._keys.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new v(e)];this._modeGroundNavigation=new b(e,[`primary`]),this._modeGroundNavigationDragRotate=new l(e,[`secondary`],1);let s=[this._modeGroundNavigation,new m(e,this._keys.fov,!1),new b(e,[`tertiary`]),this._modeGroundNavigationDragRotate,this._modeKeyboardNavigation,new y(e)];this.view.viewEvents.connect(n),this.addHandles([r(()=>this.view.navigation.mode,e=>{switch(n.hasHandlers(M)&&n.uninstallHandlers(M),e.type){case`default`:n.installHandlers(M,o,C.INTERNAL);break;case`ground`:n.installHandlers(M,s,C.INTERNAL)}},{initial:!0}),r(()=>this.view.navigation?.browserTouchPanEnabled,e=>{this._source.browserTouchPanningEnabled=!e},i),r(()=>{let{actionMap:e}=this.view.navigation,{dragPrimary:t,dragSecondary:n,dragTertiary:r}=e;return{mode:this.mode,dragPrimary:t,dragSecondary:n,dragTertiary:r}},this._updateMode,a)])}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}get test(){}};e([o()],N.prototype,`view`,void 0),e([o({type:[`default`,`pro`]})],N.prototype,`mode`,void 0),e([o({readOnly:!0})],N.prototype,`updating`,null),e([o()],N.prototype,`latestPointerInfo`,null),e([o()],N.prototype,`latestPenInfo`,null),e([o()],N.prototype,`multiTouchActive`,null),e([o()],N.prototype,`_inputManager`,void 0),N=e([s(`esri.views.3d.input.SceneInputManager`)],N);const P=N;export{P as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{watch as r,initial as i,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DragRotate as l}from"./handlers/DragRotate.js";import{DragZoom as u}from"./handlers/DragZoom.js";import{DragZoomBox as d}from"./handlers/DragZoomBox.js";import{GamepadNavigation as f}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as p}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as m}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as h}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as g}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as _}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as v}from"./handlers/TwoFingerTilt.js";import{GroundDoubleClickMove as y}from"./handlers/ground/GroundDoubleClickMove.js";import{GroundMouseWheelMove as b}from"./handlers/ground/GroundMouseWheelMove.js";import{GroundNavigation as x}from"./handlers/ground/GroundNavigation.js";import{BrowserEventSource as S}from"../../input/BrowserEventSource.js";import{InputManager as C,ViewEventPriorities as w}from"../../input/InputManager.js";import{PreventContextMenu as T}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as E}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{Drag as O}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as k}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as A}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as j}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as M}from"../../input/recognizers/VerticalTwoFingerDrag.js";const N=`modeDependentNavigation`;let P=class extends t{constructor(){super(...arguments),this.mode=`default`,this._keys={fov:`Shift`,pan:{left:`ArrowLeft`,right:`ArrowRight`,forward:`ArrowUp`,backward:`ArrowDown`,up:[`u`,`U`],down:[`j`,`J`]},lookAround:{headingLeft:[`a`,`A`],headingRight:[`d`,`D`],tiltUp:[`w`,`W`],tiltDown:[`s`,`S`]},modifier:[`b`,`B`],zoom:{zoomIn:[`+`,`=`],zoomOut:[`-`,`_`]},reset:{heading:[`n`,`N`],tilt:[`p`,`P`]},precisionPanModifier:`Alt`,coarsePanModifier:`Shift`},this._updateMode=({mode:e,dragPrimary:t,dragSecondary:n,dragTertiary:r})=>{e===`pro`&&(n=`zoom`,r=t===`pan`?`rotate`:`pan`);let i={dragPrimary:t,dragSecondary:n,dragTertiary:r};this._modeDragPan&&(this._modeDragPan.pointerActions=D(`pan`,i)),this._modeGroundNavigation&&(this._modeGroundNavigation.pointerActions=D(`pan`,i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=D(`rotate`,i)),this._modeGroundNavigationDragRotate&&(this._modeGroundNavigationDragRotate.pointerActions=D(`rotate`,i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=D(`zoom`,i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(e){let{actionMap:t}=this.view.navigation;t.dragPrimary=e,t.dragSecondary=e===`pan`?`rotate`:`pan`}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeGroundNavigation=null,this._modeDragRotate=null,this._modeGroundNavigationDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=n(this._inputManager),this._source=n(this._source)}connect(){let e=this.view;this._source=new S(this.view.surface,e.input);let t=[new k,new A,new j,new O(this.view.navigation),new M],n=new C({eventSource:this._source,recognizers:t});this._inputManager=n,n.installHandlers(`prevent-context-menu`,[new T],w.INTERNAL),n.installHandlers(`prevent-touch-text-selection-gesture`,[new E(this.view)],w.INTERNAL),this._modeDragPan=new g(e,[`primary`]),this._modeDragRotate=new l(e,[`secondary`],0),this._modeDragZoom=new u(e,[`tertiary`],this._keys.fov),this._modeKeyboardNavigation=new p(e,this._keys);let o=[new _(e),new c(e),new f(e),new m(e,this._keys.fov,!0),new h(e),new d(e),new l(e,[`primary`],1,this._keys.modifier),new x(e,[`secondary`],this._keys.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new v(e)];this._modeGroundNavigation=new x(e,[`primary`]),this._modeGroundNavigationDragRotate=new l(e,[`secondary`],1);let s=[this._modeGroundNavigation,new m(e,this._keys.fov,!1),new x(e,[`tertiary`]),this._modeGroundNavigationDragRotate,this._modeKeyboardNavigation,new y(e),new b(e)];this.view.viewEvents.connect(n),this.addHandles([r(()=>this.view.navigation.mode,e=>{switch(n.hasHandlers(N)&&n.uninstallHandlers(N),e.type){case`default`:n.installHandlers(N,o,w.INTERNAL);break;case`ground`:n.installHandlers(N,s,w.INTERNAL)}},{initial:!0}),r(()=>this.view.navigation?.browserTouchPanEnabled,e=>{this._source.browserTouchPanningEnabled=!e},i),r(()=>{let{actionMap:e}=this.view.navigation,{dragPrimary:t,dragSecondary:n,dragTertiary:r}=e;return{mode:this.mode,dragPrimary:t,dragSecondary:n,dragTertiary:r}},this._updateMode,a)])}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}get test(){}};e([o()],P.prototype,`view`,void 0),e([o({type:[`default`,`pro`]})],P.prototype,`mode`,void 0),e([o({readOnly:!0})],P.prototype,`updating`,null),e([o()],P.prototype,`latestPointerInfo`,null),e([o()],P.prototype,`latestPenInfo`,null),e([o()],P.prototype,`multiTouchActive`,null),e([o()],P.prototype,`_inputManager`,void 0),P=e([s(`esri.views.3d.input.SceneInputManager`)],P);const F=P;export{F as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{createScreenPointArray as e}from"../../../../../core/screenUtils.js";import{subtract as t,length as n,scale as r}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{GroundMouseWheelController as a}from"../../../state/controllers/GroundMouseWheelController.js";import{InputHandler as o}from"../../../../input/InputHandler.js";const s=i();class c extends o{constructor(e,t){super(!0),this._view=e,this._modifiers=t,this._controller=null,this.registerIncoming(`mouse-wheel`,this._modifiers,e=>this._handleMouseWheel(e))}_handleMouseWheel(o){let c=this._view.sceneIntersectionHelper,l=this._view.navigation.mode;if(l.type!==`ground`){this.onUninstall();return}if(!c.intersectScreen(e(o.data.x,o.data.y),s,{include:l.include,exclude:l.exclude}))return;let u=t(i(),s,this._view.state.camera.eye),d=n(u);r(u,u,1/d),!this._controller?.running&&(this._controller=new a({view:this._view}),this._view.state.switchCameraController(this._controller),!this._controller.running)?(this._controller.destroy(),this._controller=null):(this._controller.addMovement(u,Math.sqrt(Math.min(d,100))*-o.data.deltaY*.0125),o.preventDefault(),o.stopPropagation())}onUninstall(){this._controller?.stopController(),this._controller=null}}export{c as GroundMouseWheelMove};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as n}from"../../../../../core/arrayUtils.js";import{EventEmitter as r}from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a,handlesGroup as o,destroyHandle as s}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as c,removeMaybe as l}from"../../../../../core/maybe.js";import{initial as u,on as d,watch as f,syncAndInitial as p,when as m,sync as h}from"../../../../../core/reactiveUtils.js";import{property as g,subclass as _}from"../../../../../core/accessorSupport/decorators.js";import{IDENTITY as v}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as y,subtract as b,lerp as x,set as ee,add as te,scale as ne}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as re,create as ie}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as ae}from"../../../../../core/support/UpdatingHandles.js";import oe from"../../../../../geometry/Point.js";import se from"../../../../../geometry/Polyline.js";import{projectPoint as ce}from"../../../../../geometry/projectionUtils.js";import le from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as ue}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as de}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as fe}from"../../../../../symbols/support/utils.js";import{Manipulator3D as S}from"../../Manipulator3D.js";import{createManipulatorMaterials as C,createSphereGeometryAsOffsets as w,placeAtObject as pe,screenSizeManipulatorSettings as me}from"../../manipulatorUtils.js";import{RenderObject as T}from"../../RenderObject.js";import{SegmentLabels3D as he}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as ge}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as E,screenToRenderPlaneFromEvent as _e,convertToMapCoordinates as ve}from"../dragEventPipeline3D.js";import{orientation as ye}from"../geometryUtils.js";import{canMoveZOperations as D}from"../manipulatorUtils.js";import{Settings as be}from"../settings.js";import{createVisualElements as xe}from"../visualElementUtils.js";import{discRadiusSmall as Se}from"../manipulations/config.js";import{MoveManipulation as O}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Ce}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as k,createEdgeOffsetIntersectionPlane as A,createEdgeOffsetOperation as j,edgeOffsetRotationMatrix as we,screenEdgeLengthSquared as Te,getDistanceInGeometrySR as Ee}from"./edgeOffsetUtils.js";import{createTooltipInfos as De,connectTooltipToManipulatedObject as Oe,getUpdatedTranslateObjectTooltipInfo as ke,getUpdatedEdgeOffsetTooltipInfo as M}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as N}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as Ae}from"../../../support/elevationUpdateUtils.js";import{createExtrudedTriangle as P}from"../../../webgl-engine/lib/GeometryUtil.js";import{mouseButtons as F}from"../../../../input/mouseButtons.js";import{sceneSnappingAtLocation as I,addMapDelta as L,createManipulatorDragEventPipeline as R,dragAtLocation as z,addScreenDelta as je}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as Me}from"../../../../interactive/keybindings.js";import{SnappingContext as B}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as V}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Ne,enterInputModeIfAvailable as H}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Pe}from"../../../../support/GeometryWorkerHandle.js";const U=Symbol(),W=Symbol(),Fe=Symbol(),G=Symbol();let K=class extends t{get _movingManipulatorsHidden(){return this.hasHandles(G)}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new i,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new ae,this._recreatingManipulators=!1,this._settings=new be({getTheme:()=>this.view.effectiveTheme}),this.events=new r,this.activeTooltipInfo=null,this._measurementWorker=new Pe({preloadGeodetic:!0}),this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit(`reshape`,{type:`reshape`,object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit(`move`,{type:`move`,object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){let{view:e}=this,t=this._settings.manipulators,n=t.vertex;this.tooltipInfos=De(this._toolOptions,e),this._vertexManipulatorMaterials=C({color:n.color.toUnitRGBA(),outlineColor:n.outlineColor.toUnitRGBA(),focusedOutlineColor:n.focusedOutlineColor.toUnitRGBA(),screenSize:n,renderOccluded:n.renderOccluded});let r=t.edge;this._edgeManipulatorMaterials=C({color:r.color.toUnitRGBA(),outlineColor:r.outlineColor.toUnitRGBA(),screenSize:r,renderOccluded:r.renderOccluded});let i=t.edgeOffset;this._edgeOffsetManipulatorMaterials=C({color:i.color.toUnitRGBA(),focusedColor:i.focusedColor.toUnitRGBA(),renderOccluded:i.renderOccluded,shaded:!1});let a=t.selected;this._selectedManipulatorMaterials=C({color:a.color.toUnitRGBA(),outlineColor:a.outlineColor.toUnitRGBA(),focusedOutlineColor:a.focusedOutlineColor.toUnitRGBA(),screenSize:a,renderOccluded:a.renderOccluded}),this.tooltip=Ne(()=>({view:e,options:this._toolOptions.tooltips})),this.addHandles([this._updatingHandles.add(()=>{let e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:n,selectedSettings:r})=>{e.applyColor(this._vertexManipulatorMaterials.material),e.applyOutline(this._vertexManipulatorMaterials.outlineMaterial),e.applyFocusedOutline(this._vertexManipulatorMaterials.focusedMaterial),t.applyColor(this._edgeManipulatorMaterials.material),t.applyOutline(this._edgeManipulatorMaterials.outlineMaterial),n.applyColor(this._edgeOffsetManipulatorMaterials.material),n.applyFocused(this._edgeOffsetManipulatorMaterials.focusedMaterial),r.applyColor(this._selectedManipulatorMaterials.material),r.applyOutline(this._selectedManipulatorMaterials.outlineMaterial),r.applyFocusedOutline(this._selectedManipulatorMaterials.focusedMaterial)}),this._updatingHandles.add(()=>this.object.visible,e=>{for(let t of this._manipulatorInfos)t.manipulator.available=e,Y(t)&&(t.edgeManipulator.available=e)}),this._updatingHandles.add(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),this._updatingHandles.add(()=>({labels:this._segmentLabels,enabled:this._toolOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:n})=>{e!=null&&(e.visible=t,e.edgeDistance=n?`far`:`default`)},u),Oe(this.tooltip,this.object,()=>this._tooltipsContext,this._updatingHandles),this._updatingHandles.add(()=>this.tooltip.mode,(e,t)=>{t===`input`&&e!==`input`&&this._resetTooltip()}),d(()=>this._operations,`vertex-update`,e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),d(()=>this._operations?.data,`change`,e=>{(e.operation===`undo`||e.operation===`redo`)&&this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=c(this._segmentLabels),this.tooltip=c(this.tooltip),this._measurementWorker.destroy()}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _toolOptions(){return this.tool.toolOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return e.type!==`key-down`||e.key!==Me.enterInputMode?!1:this.activeTooltipInfo?.type===`reshape-edge-offset`?this._enterInputModeDuringEdgeOffset(e):H(e,this.tooltip)?(this.tool.endDrag(),!0):!1}removeSelectedVertices(){let e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&e.type===`vertex`);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit(`manipulators-changed`)}_removeManipulators(){this._manipulatorHandles.removeAll(),this.removeHandles(W),this.removeHandles(G),this._moveManipulation=c(this._moveManipulation),this._objectMoveManipulation=c(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(this._operations==null)return;let t=this.object.elevationInfo;for(let{vertices:n,segments:r,index:i}of this._operations.data.parts){let a=e?.byPartIndex.get(i);for(let e of n){let n=a?.has(e.index);this._createVertexOrEdgeManipulator(e,t,n)}for(let e of r)e.type===`line`&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e,!0)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit(`undo`),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=c(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){let e=this._toolOptions.labels;this._segmentLabels=new he({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if(t.action===`end`)return t;let n=0,r=[],i=e===1&&this._someVerticesSelected;for(let e of this._manipulatorInfos)e.type===`vertex`&&(e.manipulator.grabbing||i&&!e.manipulator.selected||r.push(e),n++);if(r.length===n){if(i||this._hideReshapeControls(),this._moveVertices(r,t),this._updateEventState(1),this.destroyed)return t;this.events.emit(`move`,{type:`move`,dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._moveVertices(r,t),this._updateEventState(2),this.destroyed)return t;this.events.emit(`reshape`,{type:`reshape`,object:this.object})}return t}_hideReshapeControls(){this._movingManipulatorsHidden||this.addHandles([this._hideReshapeManipulators(),this._moveManipulation.hideManipulatorsExceptGrabbedGroup(),a(()=>this._forEachVertex(e=>this._updateManipulatorPosition(e)))],G)}_showReshapeControls(){this.removeHandles(G)}_shouldHideReshapeControlsOnGrab(e){return this._objectMoveManipulation.hasManipulator(e)||this._moveManipulation.hasManipulator(e)&&!this._someVerticesSelected}get _canShowReshapeControls(){return!this._objectMoveManipulation.grabbing&&(!this._moveManipulation.grabbing||this._someVerticesSelected)}_hideManipulatorsForEdgeOffset(e){let t=this._manipulatorInfos.filter(Y).find(t=>t.manipulator===e||t.edgeManipulator===e);t!=null&&(this.removeHandles(W),this.addHandles([this._moveManipulation.hideManipulators(),this._hideReshapeManipulators(t)],W))}_hideReshapeManipulators(e){return o(this._manipulatorInfos.flatMap(t=>t===e?null:[t.manipulator.disableDisplay(),Y(t)?t.edgeManipulator.disableDisplay():null]))}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(U):this.tool.manipulators.forEach(({manipulator:e})=>{let t=e.disableDisplay?.();t&&this.addHandles(t,U)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>t.type===`vertex`&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;let{mapDeltaX:t,mapDeltaY:n,mapDeltaZ:r}=e;if(!t&&!n&&!r)return;let i=[];this._forEachVertex(t=>{let{selected:n,grabbing:r}=t.manipulator;(n&&!r||t===e.info)&&i.push(t)}),this._moveVertices(i,e,1),this.events.emit(`reshape`,{type:`reshape`,object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(this._numGrabbing!==0||this._numDragging!==0))return!1;switch(this._reshapeEventState){case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object}),this.destroyed||this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit(`reshape`,{type:`reshape-start`,object:this.object});break;case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit(`reshape`,{type:`reshape-start`,object:this.object})}}if(this.destroyed)return!1;let n=this._reshapeEventState!==e;return this._reshapeEventState=e,n}_createObjectMoveManipulation(){let{tool:e,view:t,object:n,_operations:r}=this;if(r){if(this._objectMoveManipulation=new Ce({tool:e,view:t,object:n}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,n,i)=>{n.next(e=>this._trackNumDragging(e)).next(t=>(t.action===`start`&&(e=r.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{t.action===`end`&&(this._showReshapeControls(),this._resetTooltip(),e=l(e))}),i.next(()=>this._onDragCancel(!0,()=>e=l(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on(`immediate-click`,e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){let{object:t,tool:n,view:r,_operations:i}=this;if(!i)return;this._moveManipulation=new O({tool:n,view:r,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&D(t.operations,t.elevationInfo),snapToScene:!1,radius:O.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on(`immediate-click`,t=>{!this._moveManipulation.zManipulation.hasManipulator(e)&&!this._manipulatorInfos.some(e=>e.manipulator.selected)&&this.events.emit(`immediate-click`,{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));let a=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(a(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(a(1)),this._moveManipulation.zManipulation.forEachManipulator(a(2)),this._moveManipulation.elevationInfo={mode:`absolute-height`,offset:0};let o=i.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((r,a,o,s,c)=>{let{snappingStep:l,cancelSnapping:u}=V({predicate:e=>!!e.info,snappingManager:n.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:e,pointer:c,excludeFeature:t.graphic,visualizer:new ge}),updatingHandles:this._updatingHandles,useZ:!1});return s=s.next(e=>(this._onDragCancel(),e)).next(u),o=o.next(e=>this._trackNumDragging(e)).next(e=>{let t=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.manipulatorType===1&&t.length===1?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(I(this.view,e,t.graphic??void 0)).next(...l).next(L()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(e.action===`end`&&this._showReshapeControls(),this._updateTranslateTooltip(r,e),e)),{steps:o,cancel:s}},e,o,t.graphic),this._updatingHandles.add(()=>t.visible,()=>this._updateMoveManipulationPosition(),u),t.on(`committed`,()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),this._updatingHandles.add(()=>t.isDraped,e=>{this._updateMoveManipulationPosition(),this.removeHandles(Fe),e&&this.addHandles(Ae({view:this.view,geometry:()=>t.graphic?.geometry,elevationInfo:t.elevationInfo,onElevationChanges:()=>this._updateMoveManipulationPosition()}),Fe)},u)])}_createVisualElements(){let{object:e,view:t}=this,n=xe({view:t,object:e,forEachManipulator:e=>{if(!(this.destroyed||this._recreatingManipulators)){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(let t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on(`manipulators-changed`,e)});n!=null&&(this._outlineVisualElement=n.visualElement instanceof N?n.visualElement:null);let r=this._outlineVisualElement;if(r!=null){let t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(d(()=>r.events,`attachment-origin-changed`,t,{onListenerAdd:t}))}this._manipulatorHandles.add(n)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){let n=this.view,r=this._operations;if(e.part.vertices.length<=2||!r)return null;let i=r.data.spatialReference,a=this._settings.manipulators.edgeOffset,s=a.size/2,c=s+a.collisionPadding,l=s/c,u=l/2,d=l*Math.sqrt(3)/2,{height:f,offset:p}=a,{material:m,focusedMaterial:h}=this._edgeOffsetManipulatorMaterials;if(!this._edgeOffsetManipulatorGeometryInside){let e=P(m,d,u,u,f,p);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){let e=P(m,-d,u,u,f,-p);this._edgeOffsetManipulatorGeometryOutside=e}let g=[new T(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryInside.instantiate({material:h}),2),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:h}),2)],_=new S({view:n,renderObjects:g,elevationInfo:t.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?t:{mode:`absolute-height`,offset:0},worldOriented:!1,focusMultiplier:1,radius:c,available:this.object.visible,collisionType:{type:`disc`,direction:re(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:J(i)}),v=new S({view:n,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?`move`:`default`,metadata:{deleting:!1},location:J(i)}),y={manipulator:_,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0,edgeManipulator:v,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(y,a.minSquaredEdgeLength);let b=()=>this._updateEdgeOffsetManipulator(y);b(),y.locationUpdateHandle=o([e.leftVertex,e.rightVertex].map(e=>this._getManipulatorInfoFromHandle(e)?.manipulator.events.on(`location-update`,b)));let x=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([y.locationUpdateHandle,this._watchAndUpdateGrabState(_,!0),this._watchAndUpdateGrabState(v,!0),R(_,this._createEdgeOffsetPipeline(y,t,r)),R(v,this._createEdgePipeline(y,t,r)),v.events.on(`immediate-click`,x),_.events.on(`immediate-click`,x),_.events.on(`focus-changed`,()=>this._resetTooltip()),_.events.on(`grab-changed`,({screenPoint:e,action:t})=>{y.grabMapPoint=t===`start`?k(e,this.view,this.object,y):null})],_),this._manipulatorInfos.push(y),this.manipulators.addMany([_,v]),this.events.emit(`manipulators-changed`),y}_autoHideEdgeOffsetManipulator(e,t){let n=e.manipulator,r=e.edgeManipulator,i=()=>{e.visibilityHandle=l(e.visibilityHandle);let i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),s=this._getManipulatorInfoFromHandle(e.handle.rightVertex),c=i!=null&&s!=null&&Te(i.manipulator.renderLocation,s.manipulator.renderLocation,this.view.state.camera)<t;(!n.focused&&!r.focused||c)&&(n.grabbable=!c,r.grabbable=!c,e.visibilityHandle=o([n.disableDisplay(),a(()=>{n.grabbable=!0,r.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([n.events.on(`focus-changed`,i),r.events.on(`focus-changed`,i),a(()=>{l(e.visibilityHandle),r.metadata.deleting=!0,this.manipulators.remove(r)})],n),i()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);let{coordinateHelper:t}=this._operations.data,n=A(this.view,e.manipulator.elevationAlignedLocation,j(t,e.handle,e.manipulator.elevationInfo)),r=this._getManipulatorInfoFromHandle(e.handle.leftVertex),i=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(r==null||i==null)return;let a=r.manipulator.renderLocation,o=i.manipulator.renderLocation,s=n==null?v:we(n,a,o);e.manipulator.modelTransform=s,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=s;let c=y(b(Z,a,o))/2;e.edgeManipulator.collisionType={type:`line`,paths:[[[-c,0,0],[c,0,0]]]}}_createEdgePipeline(e,t,n){return(r,i,a,o)=>{if(o===`touch`)this._createEdgeOffsetPipeline(e,t,n)(r,i,a);else if(this.enableMoveObject){let e=this.object.graphic,o=n.data.spatialReference,{elevationAlignedLocation:s}=r;i.next(e=>this._trackNumDragging(e)).next(z(this.view,s)).next(E(this.view,s,t,o,e)).next(je()).next(L()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{e.action===`end`&&(this._showReshapeControls(),this._resetTooltip())}),a.next(()=>this._onDragCancel(!r.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,n){return(r,i,a)=>{let o=this._pendingEdgeOffsetInfo;if(o?.manipulatorInfo===e&&o.mode!==`drag`){a.execute({action:`cancel`});return}this._clearSelection();let{initializeStep:s,cleanup:c}=this._initializeEdgeOffset(e,t,n,a),l=this._applyEdgeOffsetStep(e);i.next(e=>this._trackNumDragging(e)).next(z(this.view,r.elevationAlignedLocation)).next(s).next(_e(this.view)).next(ve(this.view,n.data.spatialReference)).next(L()).next(Ie()).next(e=>this._pendingEdgeOffsetInfo?e:l(e)).next(e=>{e.action===`end`&&!this._pendingEdgeOffsetInfo&&c()}),a.next(()=>{this._exitEdgeOffsetInputMode(),r.metadata.deleting||(c(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,n,r){let{view:i,object:a}=this,s=j(n.data.coordinateHelper,e.handle,t),c=n.createUndoGroup(),u=A(i,e.manipulator.elevationAlignedLocation,s);this._splitEdgesBeforeEdgeOffset(e,s),this._selectEdgeOffsetArrow(e,s);let d,f=()=>{this._cleanEdgeOffsetCollapsedEdges(e,n),d=l(d)},p=this.events.on(`undo`,f);return d=o([this._initializeEdgeOffsetVisualElement(e,a,t,n),c,p,this._connectEdgeOffsetTooltip(e,s,n,()=>{r.execute({action:`cancel`})})]),{initializeStep:e=>s==null||u==null?(f(),null):{...e,operation:s,plane:u},cleanup:f}}_initializeEdgeOffsetVisualElement(e,t,n,r){let i=()=>new se({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:r.data.spatialReference}),a=new N({view:this.view,isDraped:t.isDraped,geometry:i(),elevationInfo:n,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),c=o([f(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{a.color=e.toUnitRGBA(),a.isDraped=t},p),t.on(`committed`,()=>{a.geometry=i()}),s(a)]);return a.attached=!0,c}_applyEdgeOffsetStep(e){return t=>(this.destroyed||t.operation==null||!this._operations||(this._updateEventState(2),t.signedDistance==null?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit(`reshape`,{type:`reshape`,object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){let n=e.handle.leftVertex.leftSegment?.leftVertex,r=e.handle.leftVertex,i=e.handle.rightVertex.rightSegment?.rightVertex,a=e.handle.rightVertex,o=t.data.coordinateHelper,s=this.view.pixelSizeAt(o.vectorToDehydratedPoint(r.pos),o.spatialReference),c=[];if(n&&o.distance(n.pos,r.pos)<Le){let e=this._getManipulatorInfoFromHandle(r);e!=null&&c.push(e)}if(o.distance(r.pos,a.pos)<s||i&&o.distance(i.pos,a.pos)<Le){let e=this._getManipulatorInfoFromHandle(a);e!=null&&c.push(e)}c.length&&this._removeVertices(c)}_enterInputModeDuringEdgeOffset(e){let t=this._findActiveEdgeOffsetManipulatorInfo();return t&&H(e,this.tooltip)?t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`drag`},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`hover`},this._connectEdgeOffsetTooltipOnHover(t),!0):!1}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Y).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){let{_operations:t,object:n}=this;if(!t)return;let{elevationInfo:r}=n,i=j(t.data.coordinateHelper,e.handle,r);this._selectEdgeOffsetArrow(e,i),this.addHandles([this._initializeEdgeOffsetVisualElement(e,n,r,t),this._connectEdgeOffsetTooltip(e,i,t,()=>{this.removeHandles(i),this._exitEdgeOffsetInputMode()})],i)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){let t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);t!=null&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){let t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);t!=null&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){let n=e.grabMapPoint??k(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);n&&t.selectArrowFromStartPoint(n)}_connectEdgeOffsetTooltip(e,t,n,r){let i=()=>this.tooltipInfos.edgeOffset.distance.actual,a=i=>{r(),queueMicrotask(()=>{this.view.focus();let r=n.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,Ee(i,e.manipulator.location,t,n)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,n),r.remove()})},s=()=>{let e=i();e==null?r():a(e)};return o([m(()=>this.tooltip&&!this.tooltip.focused,()=>s(),h),this.tooltip.on(`discard`,r),this.tooltip.on(`commit`,e=>{e.type===`commit-and-exit`&&s()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,n=!1){let r=this.view,i=this._operations;if(!i)return null;let a=i.data.type,s=i.data.spatialReference;if(e.type===`line`){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(this._vertexManipulatorGeometry==null||this._vertexManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._vertexManipulatorMaterials;this._vertexManipulatorGeometry=w(e),this._vertexManipulatorOutlineGeometry=w(t)}if(this._edgeManipulatorGeometry==null||this._edgeManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._edgeManipulatorMaterials;this._edgeManipulatorGeometry=w(e),this._edgeManipulatorOutlineGeometry=w(t)}let c=this._vertexManipulatorGeometry,u=this._vertexManipulatorOutlineGeometry,d=[];if(a!==`point`&&a!==`mesh`){d.push(new T(c.instantiate(),Q|4),new T(u.instantiate(),Q|5),new T(u.instantiate({material:this._vertexManipulatorMaterials.focusedMaterial}),Q|6));{let{material:e,outlineMaterial:t,focusedMaterial:n}=this._selectedManipulatorMaterials;d.push(new T(c.instantiate({material:e}),8),new T(u.instantiate({material:t}),9),new T(u.instantiate({material:n}),10))}}if(this.enableMidpoints){let{material:e,focusedMaterial:t}=this._vertexManipulatorMaterials,n=this._edgeManipulatorGeometry,r=this._edgeManipulatorOutlineGeometry,i=$|6,a=$|5;d.push(new T(n.instantiate({material:e}),i),new T(r.instantiate({material:t}),i),new T(n.instantiate(),a),new T(r.instantiate(),a))}let f=e.type===`vertex`,p=new S({view:r,renderObjects:d,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,usePreciseLocalOrigin:a===`point`||a===`mesh`,available:this.object.visible,metadata:{deleting:!1},location:J(s),...me});p.selected=n,this._setTypeSpecificManipulatorSettings(p,e,t);let m=f?{manipulator:p,handle:e,type:`vertex`,selectedIndex:0}:{manipulator:p,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0};if(this._manipulatorInfos.push(m),this.manipulators.add(p),this._updateManipulatorPosition(m),m.type===`edge`){let e=[];for(let t of[m.handle.leftVertex,m.handle.rightVertex]){let n=this._getManipulatorInfoFromHandle(t);n!=null&&e.push(n.manipulator.events.on(`location-update`,()=>this._updateManipulatorPosition(m)))}m.locationUpdateHandle=o(e),this._manipulatorHandles.add(m.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);let h=R(p,(e,n,a,o)=>{let c=null,{snappingStep:u,cancelSnapping:d}=V({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new B({editGeometryOperations:i,elevationInfo:t,pointer:o,excludeFeature:this.object.graphic,visualizer:new ge}),updatingHandles:this._updatingHandles,useZ:this.tool.snapToScene});a.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>c=l(c)),t)).next(d);let{elevationAlignedLocation:f}=e,p=this.object.graphic??void 0,h=this.tool.snapToScene?this._screenToSceneMapForVertexDrag(t,i,p):E(r,f,t,s,p);n.next(e=>this._trackNumDragging(e)).next(e=>{if(e.action===`start`&&i&&(c=i.createUndoGroup()),m.type===`edge`){let t=this._splitEdgeManipulator(m);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:m,snapOrigin:m.handle.pos}}).next(z(r,f)).next(h).next(I(r,t,p)).next(...u).next(L()).next(e=>{this._perVertexManipulatorDragAction(e),e.action===`end`&&(c=l(c)),this._resetTooltip()})});return this._manipulatorHandles.add([h,p.events.on(`immediate-click`,e=>this._manipulatorClickCallback(e,m)),p.events.on(`select-changed`,()=>{m.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),p.events.on(`focus-changed`,()=>{this._resetTooltip()})],p),this.events.emit(`manipulators-changed`),m}_screenToSceneMapForVertexDrag(e,t,n){let{view:r}=this,{coordinateHelper:i,spatialReference:a}=t.data,o=null;return t=>{if(t.action===`start`&&(o=i.vectorToPoint(t.snapOrigin)),o==null)return null;let s=r.toMap(t.screenEnd,{exclude:n,excludeLabels:!0});return s==null||(s.z=de(s,r,e),!ce(s,s,a))?null:{...t,mapStart:o,mapEnd:s}}}_trackNumDragging(e){switch(e.action){case`start`:this._numDragging++;break;case`end`:this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._showReshapeControls(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit(`move`,{type:`move`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape`,object:this.object})}t?.(),this.destroyed||this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,n){let r=this._settings;switch(t.type){case`vertex`:{e.selectable=!0,e.cursor=`move`,e.collisionPriority=2,e.elevationInfo=n;let t=this._operations?.data.type;e.interactive=t!=null&&t!==`point`&&t!==`mesh`;let{size:i,collisionPadding:a}=r.manipulators.vertex;e.radius=i/2+a,e.state=Q;break}case`line`:{e.state=$,e.selectable=!1,e.cursor=`copy`,e.collisionPriority=2;let{size:t,collisionPadding:i}=r.manipulators.edge;e.radius=t/2+i,e.elevationInfo=n.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?n:{mode:`absolute-height`,offset:0};break}}}_watchAndUpdateGrabState(e,t){return e.events.on(`grab-changed`,n=>{this._onGrabStateChanged(e,t,n.action,n.pointerType)})}_onGrabStateChanged(e,t,n,r=`mouse`){if(!this._recreatingManipulators){if(n===`start`)t&&this._updateSelection(e),this._numGrabbing++,this._shouldHideReshapeControlsOnGrab(e)&&this._hideReshapeControls(),this._hideManipulatorsForEdgeOffset(e);else if(this._numGrabbing--,this.removeHandles(W),this._updateEventState(0),this._canShowReshapeControls&&this._showReshapeControls(),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,(r!==`touch`||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{let{manipulator:t}=e,n=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&n!=null&&n!==`point`&&n!==`mesh`,Y(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(let e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit(`manipulators-changed`))}_removeManipulator(e){e!=null&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),n(this._manipulatorInfos,e),this.events.emit(`manipulators-changed`),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){if(!this._movingManipulatorsHidden)for(let t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){let t=this._operations;if(e!=null&&t){if(e.type===`vertex`)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,X),e.manipulator.grabbing&&this._vertexLaserLineVisualElement!=null&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if(e.type===`edge`){let n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(n==null||r==null)return;let i=n.manipulator,a=r.manipulator;if(e.manipulator.elevationInfo?.mode===`on-the-ground`){let n=i.location,r=a.location,o=.5,s=n.x+o*(r.x-n.x),c=n.y+o*(r.y-n.y),l=n.hasZ&&r.hasZ?0:void 0;e.manipulator.location=ue(s,c,l,t.data.spatialReference)}else x(Z,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=Z}}}_splitEdgeManipulator(e,t=.5){let n=this._operations,r=n.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=l(e.locationUpdateHandle);let i=this.object.elevationInfo,a;this.enableEdgeOffset?(this._removeManipulator(e),a=this._createVertexOrEdgeManipulator(r)):(a=e,a.handle=r,a.type=`vertex`,this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,i)),r.leftSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.leftSegment),r.rightSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.rightSegment),this._updateManipulatorPosition(a),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);let o=this._updateEventState(2),s=n.data.coordinateHelper.vectorToArray(a.handle.pos),c=n.data.parts.indexOf(r.part);return this.events.emit(`vertex-add`,{type:`vertex-add`,object:this.object,vertices:[{coordinates:s,componentIndex:c,vertexIndex:r.index}],added:s}),o&&this._updateEventState(0),a}_updateMoveManipulationPosition(){let e=ee(Z,0,0,0),t=0,n=!1,r=null,i=null;for(let a of this._manipulatorInfos)a.type===`vertex`&&(a.manipulator.selected?(t++,te(e,e,a.manipulator.renderLocation),r==null||a.selectedIndex>r.selectedIndex?(i=r,r=a):(i==null||a.selectedIndex>i.selectedIndex)&&(i=a)):n=!0);let a=this.object,o=this._operations?.data.geometry;if(t===0){let e=a.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&D(this._operations,a.elevationInfo),this._moveManipulation.angle=ye(o),this._moveManipulation.radius=O.radiusForSymbol(a.graphic?.symbol)}else{let e=a.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&D(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&t!==1;let n=0;if(r!=null){let e=r.handle.pos,t=i==null?r.handle.leftSegment?.leftVertex?r.handle.leftSegment.leftVertex.pos:null:i.handle.pos,a=i==null&&r.handle.rightSegment?.rightVertex?r.handle.rightSegment.rightVertex.pos:null;t&&a?this._moveManipulation.xyAxisManipulation.available=!1:t?n=q(t,e):a&&(n=q(e,a))}this._moveManipulation.angle=n,this._moveManipulation.radius=Se}t!==0&&n?(ne(e,e,1/t),X.spatialReference=this._operations.data.spatialReference,X.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,X),this._moveManipulation.elevationAlignedLocation=X):this._outlineVisualElement!=null&&!this.object.isDraped&&this._outlineVisualElement.attachmentOrigin!=null?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:pe(this._moveManipulation,this.object)}_removeVertices(e){let t=[],n=this._operations;if(!n)return;let r=e.filter(e=>e.type===`vertex`&&n.canRemoveVertex(e.handle.part));if(r.length>0){let e=this._createBeforeVertexRemoveEvent(r);if(this.events.emit(`before-vertex-remove`,e),e.defaultPrevented)return}for(let e of r){let r=e.handle.part;if(n.canRemoveVertex(r)){t.push(e.handle),this._removeManipulator(e),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightSegment));let i=n.removeVertices([e.handle]).removedVertices?.[0].createdSegment;i&&i.type===`line`?this._createVertexOrEdgeManipulator(i):this.enableEdgeOffset&&r.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(r.segments[0]))}}if(t.length>0){let e=t.map(e=>{let t=n.data.parts.indexOf(e.part);return{coordinates:n.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),r=this._updateEventState(2);if(this.destroyed||(this.events.emit(`vertex-remove`,{type:`vertex-remove`,object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)||r&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}_createBeforeVertexRemoveEvent(e){let t=this._operations,n=e.map(e=>{let n=t.data.parts.indexOf(e.handle.part);return{coordinates:t.data.coordinateHelper.vectorToArray(e.handle.pos),componentIndex:n,vertexIndex:e.handle.index}}),r=!1;return{type:`before-vertex-remove`,object:this.object,removed:n.map(e=>e.coordinates),vertices:n,get defaultPrevented(){return r},preventDefault(){r=!0}}}_moveVertices(e,t,n=t.action===`start`?0:1){let r=this._operations;if(r&&(e.length>0&&r.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,n),!this._movingManipulatorsHidden))for(let t of e)this._updateManipulatorPosition(t)}_offsetEdge(e,t,n){if(!this._operations)return;let r=t.clone();r.distance=n,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],r),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),t.type===`vertex`&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===F.Right&&this._removeVertices([t])),t.type===`edge`&&e.button===F.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){this._defaultTooltipInfo==null?this._updateTranslateObjectTooltip(e,t):this._resetTooltip()}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=ke(e,t,this._tooltipsContext,this._updatingHandles))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=M(this.object,e,this._tooltipsContext,this._updatingHandles))}_resetTooltip(){let e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&e?.type===`reshape-edge-offset`)return;let t=null;t=this._pendingEdgeOffsetInfo||this._findActiveEdgeOffsetManipulatorInfo()!=null?M(this.object,null,this._tooltipsContext,this._updatingHandles):this._defaultTooltipInfo,t!==e&&(e==null||t==null||this.tooltip.mode!==`input`)&&(this.activeTooltipInfo=t)}get _defaultTooltipInfo(){switch(this._operations?.data.type){case`polyline`:case`polygon`:return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case`point`:case`mesh`:return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){let e=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.length===1?e[0]:null}get _someVerticesSelected(){return this._manipulatorInfos.some(e=>e.type===`vertex`&&e.manipulator.selected)}_forEachVertex(e){for(let t of this._manipulatorInfos)t.type===`vertex`&&e(t)}get _tooltipsContext(){let{tooltipInfos:e,activeTooltipInfo:t}=this;return{toolOptions:this._toolOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,measurementWorker:this._measurementWorker}}get test(){}};e([g()],K.prototype,`_numGrabbing`,void 0),e([g()],K.prototype,`_numDragging`,void 0),e([g()],K.prototype,`_pendingEdgeOffsetInfo`,void 0),e([g()],K.prototype,`_operations`,null),e([g()],K.prototype,`_segmentLabels`,void 0),e([g({constructOnly:!0})],K.prototype,`tool`,void 0),e([g()],K.prototype,`tooltip`,void 0),e([g()],K.prototype,`activeTooltipInfo`,void 0),e([g({readOnly:!0})],K.prototype,`updating`,null),e([g()],K.prototype,`manipulators`,null),e([g()],K.prototype,`view`,null),e([g()],K.prototype,`object`,null),e([g()],K.prototype,`enableZShape`,null),e([g()],K.prototype,`enableDeleteVertices`,null),e([g()],K.prototype,`enableZVertex`,null),e([g()],K.prototype,`autoHideManipulators`,null),e([g()],K.prototype,`enableMoveObject`,null),e([g()],K.prototype,`enableMidpoints`,null),e([g()],K.prototype,`enableEdgeOffset`,null),e([g()],K.prototype,`_toolOptions`,null),e([g()],K.prototype,`_accentColor`,null),e([g()],K.prototype,`_tooltipsContext`,null),K=e([_(`esri.views.3d.interactive.editingTools.reshape.ReshapeOperation`)],K);function Ie(){return e=>{let{operation:t,mapEnd:n}=e;return t==null||n==null?e:{...e,signedDistance:t.signedDistanceToPoint(n)}}}function q(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function J(e){return new oe({x:0,y:0,z:0,spatialReference:e})}function Y(e){return e.type===`edge`&&`edgeManipulator`in e}const X=ue(0,0,void 0,le.WGS84),Z=ie(),Le=1e-6,Q=16,$=32;export{K as ReshapeOperation};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as n}from"../../../../../core/arrayUtils.js";import{EventEmitter as r}from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a,handlesGroup as o,destroyHandle as s}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as c,removeMaybe as l}from"../../../../../core/maybe.js";import{initial as u,on as d,watch as f,syncAndInitial as p,when as m,sync as h}from"../../../../../core/reactiveUtils.js";import{property as g,subclass as _}from"../../../../../core/accessorSupport/decorators.js";import{IDENTITY as v}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{length as y,subtract as b,lerp as x,set as ee,add as te,scale as ne}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as re,create as ie}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as ae}from"../../../../../core/support/UpdatingHandles.js";import oe from"../../../../../geometry/Point.js";import se from"../../../../../geometry/Polyline.js";import{projectPoint as ce}from"../../../../../geometry/projectionUtils.js";import le from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as ue}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as de}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as fe}from"../../../../../symbols/support/utils.js";import{Manipulator3D as S}from"../../Manipulator3D.js";import{createManipulatorMaterials as C,createSphereGeometryAsOffsets as w,placeAtObject as pe,screenSizeManipulatorSettings as me}from"../../manipulatorUtils.js";import{RenderObject as T}from"../../RenderObject.js";import{SegmentLabels3D as he}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as E}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as D,screenToRenderPlaneFromEvent as ge,convertToMapCoordinates as _e}from"../dragEventPipeline3D.js";import{orientation as ve}from"../geometryUtils.js";import{canMoveZOperations as O}from"../manipulatorUtils.js";import{Settings as ye}from"../settings.js";import{createVisualElements as be}from"../visualElementUtils.js";import{discRadiusSmall as xe}from"../manipulations/config.js";import{MoveManipulation as k}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Se}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as Ce,createEdgeOffsetIntersectionPlane as we,createEdgeOffsetOperation as A,edgeOffsetRotationMatrix as Te,screenEdgeLengthSquared as Ee,getDistanceInGeometrySR as De}from"./edgeOffsetUtils.js";import{createTooltipInfos as Oe,connectTooltipToManipulatedObject as ke,getUpdatedTranslateObjectTooltipInfo as Ae,getUpdatedEdgeOffsetTooltipInfo as j}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as M}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as je}from"../../../support/elevationUpdateUtils.js";import{createExtrudedTriangle as N}from"../../../webgl-engine/lib/GeometryUtil.js";import{mouseButtons as P}from"../../../../input/mouseButtons.js";import{sceneSnappingAtLocation as F,addMapDelta as I,createManipulatorDragEventPipeline as L,dragAtLocation as R,addScreenDelta as Me}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as Ne}from"../../../../interactive/keybindings.js";import{SnappingContext as z}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as B}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Pe,enterInputModeIfAvailable as V}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Fe}from"../../../../support/GeometryWorkerHandle.js";const H=Symbol(),U=Symbol(),W=Symbol(),G=Symbol(),K=Symbol();let q=class extends t{get _movingManipulatorsHidden(){return this.hasHandles(K)}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new i,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new ae,this._recreatingManipulators=!1,this._settings=new ye({getTheme:()=>this.view.effectiveTheme}),this.events=new r,this.activeTooltipInfo=null,this._measurementWorker=new Fe({preloadGeodetic:!0}),this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit(`reshape`,{type:`reshape`,object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit(`move`,{type:`move`,object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){let{view:e}=this,t=this._settings.manipulators,n=t.vertex;this.tooltipInfos=Oe(this._toolOptions,e),this._vertexManipulatorMaterials=C({color:n.color.toUnitRGBA(),outlineColor:n.outlineColor.toUnitRGBA(),focusedOutlineColor:n.focusedOutlineColor.toUnitRGBA(),screenSize:n,renderOccluded:n.renderOccluded});let r=t.edge;this._edgeManipulatorMaterials=C({color:r.color.toUnitRGBA(),outlineColor:r.outlineColor.toUnitRGBA(),screenSize:r,renderOccluded:r.renderOccluded});let i=t.edgeOffset;this._edgeOffsetManipulatorMaterials=C({color:i.color.toUnitRGBA(),focusedColor:i.focusedColor.toUnitRGBA(),renderOccluded:i.renderOccluded,shaded:!1});let a=t.selected;this._selectedManipulatorMaterials=C({color:a.color.toUnitRGBA(),outlineColor:a.outlineColor.toUnitRGBA(),focusedOutlineColor:a.focusedOutlineColor.toUnitRGBA(),screenSize:a,renderOccluded:a.renderOccluded}),this.tooltip=Pe(()=>({view:e,options:this._toolOptions.tooltips})),this.addHandles([this._updatingHandles.add(()=>{let e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:n,selectedSettings:r})=>{e.applyColor(this._vertexManipulatorMaterials.material),e.applyOutline(this._vertexManipulatorMaterials.outlineMaterial),e.applyFocusedOutline(this._vertexManipulatorMaterials.focusedMaterial),t.applyColor(this._edgeManipulatorMaterials.material),t.applyOutline(this._edgeManipulatorMaterials.outlineMaterial),n.applyColor(this._edgeOffsetManipulatorMaterials.material),n.applyFocused(this._edgeOffsetManipulatorMaterials.focusedMaterial),r.applyColor(this._selectedManipulatorMaterials.material),r.applyOutline(this._selectedManipulatorMaterials.outlineMaterial),r.applyFocusedOutline(this._selectedManipulatorMaterials.focusedMaterial)}),this._updatingHandles.add(()=>this.object.visible,e=>{for(let t of this._manipulatorInfos)t.manipulator.available=e,Y(t)&&(t.edgeManipulator.available=e)}),this._updatingHandles.add(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),this._updatingHandles.add(()=>({labels:this._segmentLabels,enabled:this._toolOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:n})=>{e!=null&&(e.visible=t,e.edgeDistance=n?`far`:`default`)},u),ke(this.tooltip,this.object,()=>this._tooltipsContext,this._updatingHandles),this._updatingHandles.add(()=>this.tooltip.mode,(e,t)=>{t===`input`&&e!==`input`&&this._resetTooltip()}),d(()=>this._operations,`vertex-update`,e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),d(()=>this._operations?.data,`change`,e=>{(e.operation===`undo`||e.operation===`redo`)&&this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=c(this._segmentLabels),this.tooltip=c(this.tooltip),this._measurementWorker.destroy()}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _toolOptions(){return this.tool.toolOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return e.type!==`key-down`||e.key!==Ne.enterInputMode?!1:this.activeTooltipInfo?.type===`reshape-edge-offset`?this._enterInputModeDuringEdgeOffset(e):V(e,this.tooltip)?(this.tool.endDrag(),!0):!1}removeSelectedVertices(){let e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&e.type===`vertex`);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit(`manipulators-changed`)}_removeManipulators(){this._manipulatorHandles.removeAll(),this.removeHandles(W),this.removeHandles(U),this.removeHandles(K),this._moveManipulation=c(this._moveManipulation),this._objectMoveManipulation=c(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._pendingEdgeOffsetInfo&&this._exitEdgeOffsetInputMode()}_createManipulators(e){if(this._operations==null)return;let t=this.object.elevationInfo;for(let{vertices:n,segments:r,index:i}of this._operations.data.parts){let a=e?.byPartIndex.get(i);for(let e of n){let n=a?.has(e.index);this._createVertexOrEdgeManipulator(e,t,n)}for(let e of r)e.type===`line`&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e,!0)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit(`undo`),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=c(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){let e=this._toolOptions.labels;this._segmentLabels=new he({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if(t.action===`end`)return t;let n=0,r=[],i=e===1&&this._someVerticesSelected;for(let e of this._manipulatorInfos)e.type===`vertex`&&(e.manipulator.grabbing||i&&!e.manipulator.selected||r.push(e),n++);if(r.length===n){if(i||this._hideReshapeControls(),this._moveVertices(r,t),this._updateEventState(1),this.destroyed)return t;this.events.emit(`move`,{type:`move`,dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._moveVertices(r,t),this._updateEventState(2),this.destroyed)return t;this.events.emit(`reshape`,{type:`reshape`,object:this.object})}return t}_hideReshapeControls(){this._movingManipulatorsHidden||this.addHandles([this._hideReshapeManipulators(),this._moveManipulation.hideManipulatorsExceptGrabbedGroup(),a(()=>this._forEachVertex(e=>this._updateManipulatorPosition(e)))],K)}_showReshapeControls(){this.removeHandles(K)}_shouldHideReshapeControlsOnGrab(e){return this._objectMoveManipulation.hasManipulator(e)||this._moveManipulation.hasManipulator(e)&&!this._someVerticesSelected}get _canShowReshapeControls(){return!this._objectMoveManipulation.grabbing&&(!this._moveManipulation.grabbing||this._someVerticesSelected)}_hideManipulatorsForEdgeOffset(e){let t=this._manipulatorInfos.filter(Y).find(t=>t.manipulator===e||t.edgeManipulator===e);t!=null&&(this.removeHandles(U),this.addHandles([this._moveManipulation.hideManipulators(),this._hideReshapeManipulators(t)],U))}_hideReshapeManipulators(e){return o(this._manipulatorInfos.flatMap(t=>t===e?null:[t.manipulator.disableDisplay(),Y(t)?t.edgeManipulator.disableDisplay():null]))}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(H):this.tool.manipulators.forEach(({manipulator:e})=>{let t=e.disableDisplay?.();t&&this.addHandles(t,H)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>t.type===`vertex`&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;let{mapDeltaX:t,mapDeltaY:n,mapDeltaZ:r}=e;if(!t&&!n&&!r)return;let i=[];this._forEachVertex(t=>{let{selected:n,grabbing:r}=t.manipulator;(n&&!r||t===e.info)&&i.push(t)}),this._moveVertices(i,e,1),this.events.emit(`reshape`,{type:`reshape`,object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(this._numGrabbing!==0||this._numDragging!==0))return!1;switch(this._reshapeEventState){case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape-stop`,object:this.object}),this.destroyed||this.events.emit(`move`,{type:`move-start`,dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit(`reshape`,{type:`reshape-start`,object:this.object});break;case 1:this._showReshapeControls(),this.events.emit(`move`,{type:`move-stop`,dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit(`reshape`,{type:`reshape-start`,object:this.object})}}if(this.destroyed)return!1;let n=this._reshapeEventState!==e;return this._reshapeEventState=e,n}_createObjectMoveManipulation(){let{tool:e,view:t,object:n,_operations:r}=this;if(r){if(this._objectMoveManipulation=new Se({tool:e,view:t,object:n}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,n,i)=>{n.next(e=>this._trackNumDragging(e)).next(t=>(t.action===`start`&&(e=r.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{t.action===`end`&&(this._showReshapeControls(),this._resetTooltip(),e=l(e))}),i.next(()=>this._onDragCancel(!0,()=>e=l(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on(`immediate-click`,e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){let{object:t,tool:n,view:r,_operations:i}=this;if(!i)return;this._moveManipulation=new k({tool:n,view:r,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&O(t.operations,t.elevationInfo),snapToScene:!1,radius:k.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on(`immediate-click`,t=>{!this._moveManipulation.zManipulation.hasManipulator(e)&&!this._manipulatorInfos.some(e=>e.manipulator.selected)&&this.events.emit(`immediate-click`,{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));let a=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(a(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(a(1)),this._moveManipulation.zManipulation.forEachManipulator(a(2)),this._moveManipulation.elevationInfo={mode:`absolute-height`,offset:0};let o=i.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((r,a,o,s,c)=>{let{snappingStep:l,cancelSnapping:u}=B({predicate:e=>!!e.info,snappingManager:n.snappingManager,snappingContext:new z({editGeometryOperations:i,elevationInfo:e,pointer:c,excludeFeature:t.graphic,visualizer:new E}),updatingHandles:this._updatingHandles,useZ:!1});return s=s.next(e=>(this._onDragCancel(),e)).next(u),o=o.next(e=>this._trackNumDragging(e)).next(e=>{let t=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.manipulatorType===1&&t.length===1?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(F(this.view,e,t.graphic??void 0)).next(...l).next(I()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(e.action===`end`&&this._showReshapeControls(),this._updateTranslateTooltip(r,e),e)),{steps:o,cancel:s}},e,o,t.graphic),this._updatingHandles.add(()=>t.visible,()=>this._updateMoveManipulationPosition(),u),t.on(`committed`,()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),this._updatingHandles.add(()=>t.isDraped,e=>{this._updateMoveManipulationPosition(),this.removeHandles(G),e&&this.addHandles(je({view:this.view,geometry:()=>t.graphic?.geometry,elevationInfo:t.elevationInfo,onElevationChanges:()=>this._updateMoveManipulationPosition()}),G)},u)])}_createVisualElements(){let{object:e,view:t}=this,n=be({view:t,object:e,forEachManipulator:e=>{if(!(this.destroyed||this._recreatingManipulators)){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(let t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on(`manipulators-changed`,e)});n!=null&&(this._outlineVisualElement=n.visualElement instanceof M?n.visualElement:null);let r=this._outlineVisualElement;if(r!=null){let t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(d(()=>r.events,`attachment-origin-changed`,t,{onListenerAdd:t}))}this._manipulatorHandles.add(n)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){let n=this.view,r=this._operations;if(e.part.vertices.length<=2||!r)return null;let i=r.data.spatialReference,a=this._settings.manipulators.edgeOffset,s=a.size/2,c=s+a.collisionPadding,l=s/c,u=l/2,d=l*Math.sqrt(3)/2,{height:f,offset:p}=a,{material:m,focusedMaterial:h}=this._edgeOffsetManipulatorMaterials;if(!this._edgeOffsetManipulatorGeometryInside){let e=N(m,d,u,u,f,p);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){let e=N(m,-d,u,u,f,-p);this._edgeOffsetManipulatorGeometryOutside=e}let g=[new T(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryInside.instantiate({material:h}),2),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new T(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:h}),2)],_=new S({view:n,renderObjects:g,elevationInfo:t.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?t:{mode:`absolute-height`,offset:0},worldOriented:!1,focusMultiplier:1,radius:c,available:this.object.visible,collisionType:{type:`disc`,direction:re(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:J(i)}),v=new S({view:n,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?`move`:`default`,metadata:{deleting:!1},location:J(i)}),y={manipulator:_,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0,edgeManipulator:v,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(y,a.minSquaredEdgeLength);let b=()=>this._updateEdgeOffsetManipulator(y);b(),y.locationUpdateHandle=o([e.leftVertex,e.rightVertex].map(e=>this._getManipulatorInfoFromHandle(e)?.manipulator.events.on(`location-update`,b)));let x=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit(`immediate-click`,{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([y.locationUpdateHandle,this._watchAndUpdateGrabState(_,!0),this._watchAndUpdateGrabState(v,!0),L(_,this._createEdgeOffsetPipeline(y,t,r)),L(v,this._createEdgePipeline(y,t,r)),v.events.on(`immediate-click`,x),_.events.on(`immediate-click`,x),_.events.on(`focus-changed`,()=>this._resetTooltip()),_.events.on(`grab-changed`,({screenPoint:e,action:t})=>{y.grabMapPoint=t===`start`?Ce(e,this.view,this.object,y):null})],_),this._manipulatorInfos.push(y),this.manipulators.addMany([_,v]),this.events.emit(`manipulators-changed`),y}_autoHideEdgeOffsetManipulator(e,t){let n=e.manipulator,r=e.edgeManipulator,i=()=>{e.visibilityHandle=l(e.visibilityHandle);let i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),s=this._getManipulatorInfoFromHandle(e.handle.rightVertex),c=i!=null&&s!=null&&Ee(i.manipulator.renderLocation,s.manipulator.renderLocation,this.view.state.camera)<t;(!n.focused&&!r.focused||c)&&(n.grabbable=!c,r.grabbable=!c,e.visibilityHandle=o([n.disableDisplay(),a(()=>{n.grabbable=!0,r.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([n.events.on(`focus-changed`,i),r.events.on(`focus-changed`,i),a(()=>{l(e.visibilityHandle),r.metadata.deleting=!0,this.manipulators.remove(r)})],n),i()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);let{coordinateHelper:t}=this._operations.data,n=we(this.view,e.manipulator.elevationAlignedLocation,A(t,e.handle,e.manipulator.elevationInfo)),r=this._getManipulatorInfoFromHandle(e.handle.leftVertex),i=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(r==null||i==null)return;let a=r.manipulator.renderLocation,o=i.manipulator.renderLocation,s=n==null?v:Te(n,a,o);e.manipulator.modelTransform=s,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=s;let c=y(b(Z,a,o))/2;e.edgeManipulator.collisionType={type:`line`,paths:[[[-c,0,0],[c,0,0]]]}}_createEdgePipeline(e,t,n){return(r,i,a,o)=>{if(o===`touch`)this._createEdgeOffsetPipeline(e,t,n)(r,i,a);else if(this.enableMoveObject){let e=this.object.graphic,o=n.data.spatialReference,{elevationAlignedLocation:s}=r;i.next(e=>this._trackNumDragging(e)).next(R(this.view,s)).next(D(this.view,s,t,o,e)).next(Me()).next(I()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{e.action===`end`&&(this._showReshapeControls(),this._resetTooltip())}),a.next(()=>this._onDragCancel(!r.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,n){return(r,i,a)=>{let o=this._pendingEdgeOffsetInfo;if(o?.manipulatorInfo===e&&o.mode!==`drag`){a.execute({action:`cancel`});return}this._clearSelection();let{initializeStep:s,cleanup:c}=this._initializeEdgeOffset(e,t,n,a),l=this._applyEdgeOffsetStep(e);i.next(e=>this._trackNumDragging(e)).next(R(this.view,r.elevationAlignedLocation)).next(s).next(ge(this.view)).next(_e(this.view,n.data.spatialReference)).next(I()).next(Ie()).next(e=>this._pendingEdgeOffsetInfo?e:l(e)).next(e=>{e.action===`end`&&!this._pendingEdgeOffsetInfo&&c()}),a.next(()=>{this._exitEdgeOffsetInputMode(),r.metadata.deleting||(c(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,n,r){let{view:i,object:a}=this,o=A(n.data.coordinateHelper,e.handle,t),s=n.createUndoGroup(),c=we(i,e.manipulator.elevationAlignedLocation,o);this._splitEdgesBeforeEdgeOffset(e,o),this._selectEdgeOffsetArrow(e,o);let l=()=>{this._cleanEdgeOffsetCollapsedEdges(e,n),this.removeHandles(W)},u=this.events.on(`undo`,l);return this.addHandles([this._initializeEdgeOffsetVisualElement(e,a,t,n),s,u,this._connectEdgeOffsetTooltip(e,o,n,()=>{r.execute({action:`cancel`})})],W),{initializeStep:e=>o==null||c==null?(l(),null):{...e,operation:o,plane:c},cleanup:l}}_initializeEdgeOffsetVisualElement(e,t,n,r){let i=()=>new se({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:r.data.spatialReference}),a=new M({view:this.view,isDraped:t.isDraped,geometry:i(),elevationInfo:n,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),c=o([f(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{a.color=e.toUnitRGBA(),a.isDraped=t},p),t.on(`committed`,()=>{a.geometry=i()}),s(a)]);return a.attached=!0,c}_applyEdgeOffsetStep(e){return t=>(this.destroyed||t.operation==null||!this._operations||(this._updateEventState(2),t.signedDistance==null?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit(`reshape`,{type:`reshape`,object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){let n=e.handle.leftVertex.leftSegment?.leftVertex,r=e.handle.leftVertex,i=e.handle.rightVertex.rightSegment?.rightVertex,a=e.handle.rightVertex,o=t.data.coordinateHelper,s=this.view.pixelSizeAt(o.vectorToDehydratedPoint(r.pos),o.spatialReference),c=[];if(n&&o.distance(n.pos,r.pos)<Re){let e=this._getManipulatorInfoFromHandle(r);e!=null&&c.push(e)}if(o.distance(r.pos,a.pos)<s||i&&o.distance(i.pos,a.pos)<Re){let e=this._getManipulatorInfoFromHandle(a);e!=null&&c.push(e)}c.length&&this._removeVertices(c)}_enterInputModeDuringEdgeOffset(e){let t=this._findActiveEdgeOffsetManipulatorInfo();return t&&V(e,this.tooltip)?t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`drag`},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:`hover`},this._connectEdgeOffsetTooltipOnHover(t),!0):!1}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Y).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){let{_operations:t,object:n}=this;if(!t)return;let{elevationInfo:r}=n,i=A(t.data.coordinateHelper,e.handle,r);this._selectEdgeOffsetArrow(e,i),this.addHandles([this._initializeEdgeOffsetVisualElement(e,n,r,t),this._connectEdgeOffsetTooltip(e,i,t,()=>{this.removeHandles(W),this._exitEdgeOffsetInputMode()})],W)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){let t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);t!=null&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){let t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);t!=null&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){let n=e.grabMapPoint??Ce(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);n&&t.selectArrowFromStartPoint(n)}_connectEdgeOffsetTooltip(e,t,n,r){let i=()=>this.tooltipInfos.edgeOffset.distance.actual,a=i=>{r(),queueMicrotask(()=>{this.view.focus();let r=n.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,De(i,e.manipulator.location,t,n)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,n),r.remove()})},s=()=>{let e=i();e==null?r():a(e)};return o([m(()=>this.tooltip&&!this.tooltip.focused,()=>s(),h),this.tooltip.on(`discard`,r),this.tooltip.on(`commit`,e=>{e.type===`commit-and-exit`&&s()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,n=!1){let r=this.view,i=this._operations;if(!i)return null;let a=i.data.type,s=i.data.spatialReference;if(e.type===`line`){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(this._vertexManipulatorGeometry==null||this._vertexManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._vertexManipulatorMaterials;this._vertexManipulatorGeometry=w(e),this._vertexManipulatorOutlineGeometry=w(t)}if(this._edgeManipulatorGeometry==null||this._edgeManipulatorOutlineGeometry==null){let{material:e,outlineMaterial:t}=this._edgeManipulatorMaterials;this._edgeManipulatorGeometry=w(e),this._edgeManipulatorOutlineGeometry=w(t)}let c=this._vertexManipulatorGeometry,u=this._vertexManipulatorOutlineGeometry,d=[];if(a!==`point`&&a!==`mesh`){d.push(new T(c.instantiate(),Q|4),new T(u.instantiate(),Q|5),new T(u.instantiate({material:this._vertexManipulatorMaterials.focusedMaterial}),Q|6));{let{material:e,outlineMaterial:t,focusedMaterial:n}=this._selectedManipulatorMaterials;d.push(new T(c.instantiate({material:e}),8),new T(u.instantiate({material:t}),9),new T(u.instantiate({material:n}),10))}}if(this.enableMidpoints){let{material:e,focusedMaterial:t}=this._vertexManipulatorMaterials,n=this._edgeManipulatorGeometry,r=this._edgeManipulatorOutlineGeometry,i=$|6,a=$|5;d.push(new T(n.instantiate({material:e}),i),new T(r.instantiate({material:t}),i),new T(n.instantiate(),a),new T(r.instantiate(),a))}let f=e.type===`vertex`,p=new S({view:r,renderObjects:d,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,usePreciseLocalOrigin:a===`point`||a===`mesh`,available:this.object.visible,metadata:{deleting:!1},location:J(s),...me});p.selected=n,this._setTypeSpecificManipulatorSettings(p,e,t);let m=f?{manipulator:p,handle:e,type:`vertex`,selectedIndex:0}:{manipulator:p,handle:e,locationUpdateHandle:null,type:`edge`,selectedIndex:0};if(this._manipulatorInfos.push(m),this.manipulators.add(p),this._updateManipulatorPosition(m),m.type===`edge`){let e=[];for(let t of[m.handle.leftVertex,m.handle.rightVertex]){let n=this._getManipulatorInfoFromHandle(t);n!=null&&e.push(n.manipulator.events.on(`location-update`,()=>this._updateManipulatorPosition(m)))}m.locationUpdateHandle=o(e),this._manipulatorHandles.add(m.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);let h=L(p,(e,n,a,o)=>{let c=null,{snappingStep:u,cancelSnapping:d}=B({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new z({editGeometryOperations:i,elevationInfo:t,pointer:o,excludeFeature:this.object.graphic,visualizer:new E}),updatingHandles:this._updatingHandles,useZ:this.tool.snapToScene});a.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>c=l(c)),t)).next(d);let{elevationAlignedLocation:f}=e,p=this.object.graphic??void 0,h=this.tool.snapToScene?this._screenToSceneMapForVertexDrag(t,i,p):D(r,f,t,s,p);n.next(e=>this._trackNumDragging(e)).next(e=>{if(e.action===`start`&&i&&(c=i.createUndoGroup()),m.type===`edge`){let t=this._splitEdgeManipulator(m);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:m,snapOrigin:m.handle.pos}}).next(R(r,f)).next(h).next(F(r,t,p)).next(...u).next(I()).next(e=>{this._perVertexManipulatorDragAction(e),e.action===`end`&&(c=l(c)),this._resetTooltip()})});return this._manipulatorHandles.add([h,p.events.on(`immediate-click`,e=>this._manipulatorClickCallback(e,m)),p.events.on(`select-changed`,()=>{m.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),p.events.on(`focus-changed`,()=>{this._resetTooltip()})],p),this.events.emit(`manipulators-changed`),m}_screenToSceneMapForVertexDrag(e,t,n){let{view:r}=this,{coordinateHelper:i,spatialReference:a}=t.data,o=null;return t=>{if(t.action===`start`&&(o=i.vectorToPoint(t.snapOrigin)),o==null)return null;let s=r.toMap(t.screenEnd,{exclude:n,excludeLabels:!0});return s==null||(s.z=de(s,r,e),!ce(s,s,a))?null:{...t,mapStart:o,mapEnd:s}}}_trackNumDragging(e){switch(e.action){case`start`:this._numDragging++;break;case`end`:this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._showReshapeControls(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit(`move`,{type:`move`,dx:0,dy:0,object:this.object});break;case 2:this.events.emit(`reshape`,{type:`reshape`,object:this.object})}t?.(),this.destroyed||this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,n){let r=this._settings;switch(t.type){case`vertex`:{e.selectable=!0,e.cursor=`move`,e.collisionPriority=2,e.elevationInfo=n;let t=this._operations?.data.type;e.interactive=t!=null&&t!==`point`&&t!==`mesh`;let{size:i,collisionPadding:a}=r.manipulators.vertex;e.radius=i/2+a,e.state=Q;break}case`line`:{e.state=$,e.selectable=!1,e.cursor=`copy`,e.collisionPriority=2;let{size:t,collisionPadding:i}=r.manipulators.edge;e.radius=t/2+i,e.elevationInfo=n.mode===`on-the-ground`&&!fe(this.object.graphic?.symbol)?n:{mode:`absolute-height`,offset:0};break}}}_watchAndUpdateGrabState(e,t){return e.events.on(`grab-changed`,n=>{this._onGrabStateChanged(e,t,n.action,n.pointerType)})}_onGrabStateChanged(e,t,n,r=`mouse`){if(!this._recreatingManipulators){if(n===`start`)t&&this._updateSelection(e),this._numGrabbing++,this._shouldHideReshapeControlsOnGrab(e)&&this._hideReshapeControls(),this._hideManipulatorsForEdgeOffset(e);else if(this._numGrabbing--,this.removeHandles(U),this._updateEventState(0),this._canShowReshapeControls&&this._showReshapeControls(),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,(r!==`touch`||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{let{manipulator:t}=e,n=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&n!=null&&n!==`point`&&n!==`mesh`,Y(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(let e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit(`manipulators-changed`))}_removeManipulator(e){e!=null&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),n(this._manipulatorInfos,e),this.events.emit(`manipulators-changed`),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){if(!this._movingManipulatorsHidden)for(let t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){let t=this._operations;if(e!=null&&t){if(e.type===`vertex`)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,X),e.manipulator.grabbing&&this._vertexLaserLineVisualElement!=null&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if(e.type===`edge`){let n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(n==null||r==null)return;let i=n.manipulator,a=r.manipulator;if(e.manipulator.elevationInfo?.mode===`on-the-ground`){let n=i.location,r=a.location,o=.5,s=n.x+o*(r.x-n.x),c=n.y+o*(r.y-n.y),l=n.hasZ&&r.hasZ?0:void 0;e.manipulator.location=ue(s,c,l,t.data.spatialReference)}else x(Z,i.renderLocation,a.renderLocation,.5),e.manipulator.renderLocation=Z}}}_splitEdgeManipulator(e,t=.5){let n=this._operations,r=n.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=l(e.locationUpdateHandle);let i=this.object.elevationInfo,a;this.enableEdgeOffset?(this._removeManipulator(e),a=this._createVertexOrEdgeManipulator(r)):(a=e,a.handle=r,a.type=`vertex`,this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,i)),r.leftSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.leftSegment),r.rightSegment?.type===`line`&&this._createVertexOrEdgeManipulator(r.rightSegment),this._updateManipulatorPosition(a),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);let o=this._updateEventState(2),s=n.data.coordinateHelper.vectorToArray(a.handle.pos),c=n.data.parts.indexOf(r.part);return this.events.emit(`vertex-add`,{type:`vertex-add`,object:this.object,vertices:[{coordinates:s,componentIndex:c,vertexIndex:r.index}],added:s}),o&&this._updateEventState(0),a}_updateMoveManipulationPosition(){let e=ee(Z,0,0,0),t=0,n=!1,r=null,i=null;for(let a of this._manipulatorInfos)a.type===`vertex`&&(a.manipulator.selected?(t++,te(e,e,a.manipulator.renderLocation),r==null||a.selectedIndex>r.selectedIndex?(i=r,r=a):(i==null||a.selectedIndex>i.selectedIndex)&&(i=a)):n=!0);let a=this.object,o=this._operations?.data.geometry;if(t===0){let e=a.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&O(this._operations,a.elevationInfo),this._moveManipulation.angle=ve(o),this._moveManipulation.radius=k.radiusForSymbol(a.graphic?.symbol)}else{let e=a.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&O(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&t!==1;let n=0;if(r!=null){let e=r.handle.pos,t=i==null?r.handle.leftSegment?.leftVertex?r.handle.leftSegment.leftVertex.pos:null:i.handle.pos,a=i==null&&r.handle.rightSegment?.rightVertex?r.handle.rightSegment.rightVertex.pos:null;t&&a?this._moveManipulation.xyAxisManipulation.available=!1:t?n=Le(t,e):a&&(n=Le(e,a))}this._moveManipulation.angle=n,this._moveManipulation.radius=xe}t!==0&&n?(ne(e,e,1/t),X.spatialReference=this._operations.data.spatialReference,X.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,X),this._moveManipulation.elevationAlignedLocation=X):this._outlineVisualElement!=null&&!this.object.isDraped&&this._outlineVisualElement.attachmentOrigin!=null?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:pe(this._moveManipulation,this.object)}_removeVertices(e){let t=[],n=this._operations;if(!n)return;let r=e.filter(e=>e.type===`vertex`&&n.canRemoveVertex(e.handle.part));if(r.length>0){let e=this._createBeforeVertexRemoveEvent(r);if(this.events.emit(`before-vertex-remove`,e),e.defaultPrevented)return}for(let e of r){let r=e.handle.part;if(n.canRemoveVertex(r)){t.push(e.handle),this._removeManipulator(e),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(e.handle.rightSegment));let i=n.removeVertices([e.handle]).removedVertices?.[0].createdSegment;i&&i.type===`line`?this._createVertexOrEdgeManipulator(i):this.enableEdgeOffset&&r.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(r.segments[0]))}}if(t.length>0){let e=t.map(e=>{let t=n.data.parts.indexOf(e.part);return{coordinates:n.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),r=this._updateEventState(2);if(this.destroyed||(this.events.emit(`vertex-remove`,{type:`vertex-remove`,object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)||r&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}_createBeforeVertexRemoveEvent(e){let t=this._operations,n=e.map(e=>{let n=t.data.parts.indexOf(e.handle.part);return{coordinates:t.data.coordinateHelper.vectorToArray(e.handle.pos),componentIndex:n,vertexIndex:e.handle.index}}),r=!1;return{type:`before-vertex-remove`,object:this.object,removed:n.map(e=>e.coordinates),vertices:n,get defaultPrevented(){return r},preventDefault(){r=!0}}}_moveVertices(e,t,n=t.action===`start`?0:1){let r=this._operations;if(r&&(e.length>0&&r.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,n),!this._movingManipulatorsHidden))for(let t of e)this._updateManipulatorPosition(t)}_offsetEdge(e,t,n){if(!this._operations)return;let r=t.clone();r.distance=n,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],r),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),t.type===`vertex`&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===P.Right&&this._removeVertices([t])),t.type===`edge`&&e.button===P.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){this._defaultTooltipInfo==null?this._updateTranslateObjectTooltip(e,t):this._resetTooltip()}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=Ae(e,t,this._tooltipsContext,this._updatingHandles))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=j(this.object,e,this._tooltipsContext,this._updatingHandles))}_resetTooltip(){let e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&e?.type===`reshape-edge-offset`)return;let t=null;t=this._pendingEdgeOffsetInfo||this._findActiveEdgeOffsetManipulatorInfo()!=null?j(this.object,null,this._tooltipsContext,this._updatingHandles):this._defaultTooltipInfo,t!==e&&(e==null||t==null||this.tooltip.mode!==`input`)&&(this.activeTooltipInfo=t)}get _defaultTooltipInfo(){switch(this._operations?.data.type){case`polyline`:case`polygon`:return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case`point`:case`mesh`:return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){let e=this._manipulatorInfos.filter(e=>e.type===`vertex`&&e.manipulator.selected);return e.length===1?e[0]:null}get _someVerticesSelected(){return this._manipulatorInfos.some(e=>e.type===`vertex`&&e.manipulator.selected)}_forEachVertex(e){for(let t of this._manipulatorInfos)t.type===`vertex`&&e(t)}get _tooltipsContext(){let{tooltipInfos:e,activeTooltipInfo:t}=this;return{toolOptions:this._toolOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,measurementWorker:this._measurementWorker}}get test(){}};e([g()],q.prototype,`_numGrabbing`,void 0),e([g()],q.prototype,`_numDragging`,void 0),e([g()],q.prototype,`_pendingEdgeOffsetInfo`,void 0),e([g()],q.prototype,`_operations`,null),e([g()],q.prototype,`_segmentLabels`,void 0),e([g({constructOnly:!0})],q.prototype,`tool`,void 0),e([g()],q.prototype,`tooltip`,void 0),e([g()],q.prototype,`activeTooltipInfo`,void 0),e([g({readOnly:!0})],q.prototype,`updating`,null),e([g()],q.prototype,`manipulators`,null),e([g()],q.prototype,`view`,null),e([g()],q.prototype,`object`,null),e([g()],q.prototype,`enableZShape`,null),e([g()],q.prototype,`enableDeleteVertices`,null),e([g()],q.prototype,`enableZVertex`,null),e([g()],q.prototype,`autoHideManipulators`,null),e([g()],q.prototype,`enableMoveObject`,null),e([g()],q.prototype,`enableMidpoints`,null),e([g()],q.prototype,`enableEdgeOffset`,null),e([g()],q.prototype,`_toolOptions`,null),e([g()],q.prototype,`_accentColor`,null),e([g()],q.prototype,`_tooltipsContext`,null),q=e([_(`esri.views.3d.interactive.editingTools.reshape.ReshapeOperation`)],q);function Ie(){return e=>{let{operation:t,mapEnd:n}=e;return t==null||n==null?e:{...e,signedDistance:t.signedDistanceToPoint(n)}}}function Le(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function J(e){return new oe({x:0,y:0,z:0,spatialReference:e})}function Y(e){return e.type===`edge`&&`edgeManipulator`in e}const X=ue(0,0,void 0,le.WGS84),Z=ie(),Re=1e-6,Q=16,$=32;export{q as ReshapeOperation};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as h}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,resetProperties as b}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as x}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as w}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as T}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as E}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as D}from"../../../../support/screenUtils.js";let O=class extends _{constructor(e){super(e),this._updatingHandles=new c,this._snappingManagerResult=null,this._emulatedDrag=null,this.lineState=`initial`,this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=n(e=>new C({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new S(new x(`point`,v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new f}))}initialize(){let{view:e,analysis:t,analysisViewData:n,visible:o}=this;this.measurementView=new h({toolState:this,view:e,analysis:t,analysisViewData:n,visible:o});let{start:s,end:c,cursor:d}=this.measurementView.createManipulators(),f=(e,t,n)=>{let r=y(e,(e,r,i,a)=>{let o=m(e),s=this._ensureSnappingManager(),c=this._getSnappingContext(a),d=this._updatingHandles,{lineState:f}=this;i=i.next(o).next(b(this,[n,t])).next(n=>{if(t!==`cursorPoint`){let n=this.analysis[t];n!=null&&(e.location=n)}return n});let h=p(this.view),g=r.next(o).next(e=>{let r=h(e);return r||this.lineState!==`drawing`&&this.lineState!==`initial`||(this[t]=null,this[n]=null),r});if(a!==`touch`||f===`editing`){let{snappingStep:e,cancelSnapping:t}=w({snappingManager:s,snappingContext:c,updatingHandles:d});i.next(t),g=g.next(...e)}g.next(e=>e.action===`start`?null:e).next(r=>{let i=u(r.mapEnd,new l);this[t]=i,e.location=i,this[n]=this._surfaceLocation(i,r.surfaceType)})});return t===`cursorPoint`?[r]:[r,e.events.on(`grab-changed`,()=>{let e=s.grabbing||c.grabbing;this.lineState=e?`editing`:`measured`}),this._updatingHandles.add(()=>this.analysis[t],t=>{t&&(e.location=t)})]};this.startManipulator=s,this.endManipulator=c,this.cursorManipulator=d,this.manipulators.add(s),this.manipulators.add(c),this.manipulators.add(d),this.addHandles([...f(s,`startPoint`,`startPointSurfaceLocation`),...f(c,`endPoint`,`endPointSurfaceLocation`),...f(d,`cursorPoint`,`cursorPointSurfaceLocation`),r(()=>this.state===`measured`,()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)},i),a(()=>({startPointAvailable:this.startPoint!=null,endPointAvailable:this.endPoint!=null}),({startPointAvailable:e,endPointAvailable:t})=>{this.startManipulator.available=e,this.endManipulator.available=t},i)]),E(this)}destroy(){this._updatingHandles=t(this._updatingHandles),this.measurementView=t(this.measurementView)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(this._snappingManagerResult==null){let e=T(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}get state(){let{analysis:e}=this;if(e.startPoint==null&&e.endPoint==null)return`ready`;let{lineState:t}=this;return this.validMeasurement&&t!==`editing`&&t!==`drawing`?`measured`:`measuring`}get cursor(){return this.active&&(this.state===`ready`||this.lineState!==`measured`)?`crosshair`:null}get startPoint(){return this.analysis.startPoint}set startPoint(e){this.analysis.startPoint=e}get endPoint(){return this.analysis.endPoint}set endPoint(e){this.analysis.endPoint=e}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(e){this.measurementView.cursorPoint=e}get snappingOptions(){return this._snappingManager?.options}get validMeasurement(){return this.analysis.startPoint!=null&&this.analysis.endPoint!=null}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}resetCreated(){super.resetCreated(),this.lineState=`initial`,this.cursorPoint=null,this.state===`measured`&&this.finishToolCreation()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._emulatedDrag?.cancel(),this._emulatedDrag=null}onInputEvent(e){switch(e.type){case`immediate-click`:this._handleImmediateClick(e);break;case`pointer-move`:this._handlePointerMove(e)}}_handlePointerMove(e){if(!this.active||this.view.navigating)return;let{pointerType:t}=e;if(t!==`mouse`)return;let n=D(e),{lineState:r,cursorManipulator:i,endManipulator:a}=this,o=!1;this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(i,t,n),o=!0),r===`initial`&&(this._emulatedDrag?.update(n),o=!0),r===`drawing`&&(a.events.emit(`drag`,{action:`update`,start:n,screenPoint:n}),o=!0),o&&e.stopPropagation()}_handleImmediateClick(e){if(!this.active||!d(e))return;let t=D(e),{pointerType:n}=e,{cursorManipulator:r,startManipulator:i,endManipulator:a,lineState:o}=this,s=!1;switch(this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(r,n,t)),o){case`initial`:if(this._emulatedDrag?.update(t),this.cursorPoint!=null){this._emulatedDrag?.end(t),this._emulatedDrag=null,this.analysis.valid&&(this.analysis.clear(),this._set(`created`,!1));let{cursorPoint:e}=this;this.startPoint=e,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,i.location=e,i.interactive=!1,a.interactive=!1,this.lineState=`drawing`,this._emulatedDrag=k(a,n,t),s=!0}break;case`drawing`:this._emulatedDrag?.update(t),this.endPoint!=null&&(this._emulatedDrag?.end(t),this._emulatedDrag=null,i.interactive=!0,a.interactive=!0,this.lineState=`measured`,s=!0)}s&&e.stopPropagation()}_surfaceLocation(e,t){return t===0?`on-the-surface`:(e.z??0)>=this._getElevation(e)?`above-the-surface`:`below-the-surface`}_getElevation(e){return this.view.groundView?.ready?g(this.view.elevationProvider,e)??0:0}get test(){}};e([o()],O.prototype,`_snappingManagerResult`,void 0),e([o()],O.prototype,`_snappingManager`,null),e([o({readOnly:!0})],O.prototype,`state`,null),e([o()],O.prototype,`lineState`,void 0),e([o({readOnly:!0})],O.prototype,`cursor`,null),e([o()],O.prototype,`startPoint`,null),e([o()],O.prototype,`endPoint`,null),e([o()],O.prototype,`cursorPoint`,null),e([o({constructOnly:!0})],O.prototype,`analysis`,void 0),e([o({constructOnly:!0})],O.prototype,`analysisViewData`,void 0),e([o()],O.prototype,`measurementView`,void 0),e([o()],O.prototype,`removeIncompleteOnCancel`,void 0),e([o({constructOnly:!0})],O.prototype,`view`,void 0),e([o({readOnly:!0})],O.prototype,`validMeasurement`,null),e([o({value:null})],O.prototype,`startPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`endPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`cursorPointSurfaceLocation`,void 0),e([o()],O.prototype,`updating`,null),O=e([s(`esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool`)],O);function k(e,t,n){return e.events.emit(`drag`,{action:`start`,pointerType:t,start:n,screenPoint:n}),{update:t=>e.events.emit(`drag`,{action:`update`,start:t,screenPoint:t}),end:t=>e.events.emit(`drag`,{action:`end`,start:t,screenPoint:t}),cancel:()=>e.events.emit(`drag`,{action:`cancel`})}}const A=O;export{A as default};
2
+ import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as h}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,resetProperties as b}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as x}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as w}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as T}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as E}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as D}from"../../../../support/screenUtils.js";let O=class extends _{constructor(e){super(e),this._updatingHandles=new c,this._snappingManagerResult=null,this._emulatedDrag=null,this.lineState=`initial`,this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=n(e=>new C({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new S(new x(`point`,v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new f}))}initialize(){let{view:e,analysis:t,analysisViewData:n,visible:o}=this;this.measurementView=new h({toolState:this,view:e,analysis:t,analysisViewData:n,visible:o});let{start:s,end:c,cursor:d}=this.measurementView.createManipulators(),f=(e,t,n)=>{let r=()=>t===`startPoint`?this.analysisViewData.elevationAlignedStartPoint:this.analysisViewData.elevationAlignedEndPoint,i=y(e,(e,i,a,o)=>{let s=m(e),c=this._ensureSnappingManager(),d=this._getSnappingContext(o),f=this._updatingHandles,{lineState:h}=this;a=a.next(s).next(b(this,[n,t])).next(n=>{if(t!==`cursorPoint`){let t=r();t!=null&&(e.location=t)}return n});let g=p(this.view),_=i.next(s).next(e=>{let r=g(e);return r||this.lineState!==`drawing`&&this.lineState!==`initial`||(this[t]=null,this[n]=null),r});if(o!==`touch`||h===`editing`){let{snappingStep:e,cancelSnapping:t}=w({snappingManager:c,snappingContext:d,updatingHandles:f});a.next(t),_=_.next(...e)}_.next(e=>e.action===`start`?null:e).next(r=>{let i=u(r.mapEnd,new l);this[t]=i,e.location=i,this[n]=this._surfaceLocation(i,r.surfaceType)})});return t===`cursorPoint`?[i]:[i,e.events.on(`grab-changed`,()=>{let e=s.grabbing||c.grabbing;this.lineState=e?`editing`:`measured`}),this._updatingHandles.add(r,t=>{t&&(e.location=t)})]};this.startManipulator=s,this.endManipulator=c,this.cursorManipulator=d,this.manipulators.add(s),this.manipulators.add(c),this.manipulators.add(d),this.addHandles([...f(s,`startPoint`,`startPointSurfaceLocation`),...f(c,`endPoint`,`endPointSurfaceLocation`),...f(d,`cursorPoint`,`cursorPointSurfaceLocation`),r(()=>this.state===`measured`,()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)},i),a(()=>({startPointAvailable:this.analysisViewData.elevationAlignedStartPoint!=null,endPointAvailable:this.analysisViewData.elevationAlignedEndPoint!=null}),({startPointAvailable:e,endPointAvailable:t})=>{this.startManipulator.available=e,this.endManipulator.available=t},i)]),E(this)}destroy(){this._updatingHandles=t(this._updatingHandles),this.measurementView=t(this.measurementView)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(this._snappingManagerResult==null){let e=T(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}get state(){let{analysis:e}=this;if(e.startPoint==null&&e.endPoint==null)return`ready`;let{lineState:t}=this;return this.validMeasurement&&t!==`editing`&&t!==`drawing`?`measured`:`measuring`}get cursor(){return this.active&&(this.state===`ready`||this.lineState!==`measured`)?`crosshair`:null}get startPoint(){return this.analysis.startPoint}set startPoint(e){this.analysis.startPoint=e}get endPoint(){return this.analysis.endPoint}set endPoint(e){this.analysis.endPoint=e}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(e){this.measurementView.cursorPoint=e}get snappingOptions(){return this._snappingManager?.options}get validMeasurement(){return this.analysis.startPoint!=null&&this.analysis.endPoint!=null}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}resetCreated(){super.resetCreated(),this.lineState=`initial`,this.cursorPoint=null,this.state===`measured`&&this.finishToolCreation()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._emulatedDrag?.cancel(),this._emulatedDrag=null}onInputEvent(e){switch(e.type){case`immediate-click`:this._handleImmediateClick(e);break;case`pointer-move`:this._handlePointerMove(e)}}_handlePointerMove(e){if(!this.active||this.view.navigating)return;let{pointerType:t}=e;if(t!==`mouse`)return;let n=D(e),{lineState:r,cursorManipulator:i,endManipulator:a}=this,o=!1;this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(i,t,n),o=!0),r===`initial`&&(this._emulatedDrag?.update(n),o=!0),r===`drawing`&&(a.events.emit(`drag`,{action:`update`,start:n,screenPoint:n}),o=!0),o&&e.stopPropagation()}_handleImmediateClick(e){if(!this.active||!d(e))return;let t=D(e),{pointerType:n}=e,{cursorManipulator:r,startManipulator:i,endManipulator:a,lineState:o}=this,s=!1;switch(this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(r,n,t)),o){case`initial`:if(this._emulatedDrag?.update(t),this.cursorPoint!=null){this._emulatedDrag?.end(t),this._emulatedDrag=null,this.analysis.valid&&(this.analysis.clear(),this._set(`created`,!1));let{cursorPoint:e}=this;this.startPoint=e,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,i.location=e,i.interactive=!1,a.interactive=!1,this.lineState=`drawing`,this._emulatedDrag=k(a,n,t),s=!0}break;case`drawing`:this._emulatedDrag?.update(t),this.endPoint!=null&&(this._emulatedDrag?.end(t),this._emulatedDrag=null,i.interactive=!0,a.interactive=!0,this.lineState=`measured`,s=!0)}s&&e.stopPropagation()}_surfaceLocation(e,t){return t===0?`on-the-surface`:(e.z??0)>=this._getElevation(e)?`above-the-surface`:`below-the-surface`}_getElevation(e){return this.view.groundView?.ready?g(this.view.elevationProvider,e)??0:0}get test(){}};e([o()],O.prototype,`_snappingManagerResult`,void 0),e([o()],O.prototype,`_snappingManager`,null),e([o({readOnly:!0})],O.prototype,`state`,null),e([o()],O.prototype,`lineState`,void 0),e([o({readOnly:!0})],O.prototype,`cursor`,null),e([o()],O.prototype,`startPoint`,null),e([o()],O.prototype,`endPoint`,null),e([o()],O.prototype,`cursorPoint`,null),e([o({constructOnly:!0})],O.prototype,`analysis`,void 0),e([o({constructOnly:!0})],O.prototype,`analysisViewData`,void 0),e([o()],O.prototype,`measurementView`,void 0),e([o()],O.prototype,`removeIncompleteOnCancel`,void 0),e([o({constructOnly:!0})],O.prototype,`view`,void 0),e([o({readOnly:!0})],O.prototype,`validMeasurement`,null),e([o({value:null})],O.prototype,`startPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`endPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`cursorPointSurfaceLocation`,void 0),e([o()],O.prototype,`updating`,null),O=e([s(`esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool`)],O);function k(e,t,n){return e.events.emit(`drag`,{action:`start`,pointerType:t,start:n,screenPoint:n}),{update:t=>e.events.emit(`drag`,{action:`update`,start:t,screenPoint:t}),end:t=>e.events.emit(`drag`,{action:`end`,start:t,screenPoint:t}),cancel:()=>e.events.emit(`drag`,{action:`cancel`})}}const A=O;export{A as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as n,getContrast as r,colorVectorEquals as i,colorVectorToColorAndOpacity as a}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{watch as s,initial as c}from"../../../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPoints as f}from"../../../../../geometry/support/lineSegment.js";import{Manipulator3D as p}from"../../Manipulator3D.js";import{createManipulatorMaterial as m}from"../../manipulatorUtils.js";import{RenderObject as h}from"../../RenderObject.js";import{LaserlineVisualElement as g}from"../../visualElements/LaserlineVisualElement.js";import{createSphereGeometry as _}from"../../../webgl-engine/lib/GeometryUtil.js";let v=class extends t{constructor(e){super(e),this.cursorPoint=null,this._visible=!1,this._laserLine=null,this.laserLineEnabled=!0,this._lastDraggedHandle=null}initialize(){this._laserLine=new g({view:this.view,attached:!0,isDecoration:!0}),this._updateVisibility(this._visible),this._connectToAnalysisView(),this.addHandles(s(()=>this._params,({laserLineGlowColor:e,laserLineInnerColor:t,laserLineGlobalAlpha:n})=>{let r=this._laserLine;r.style={...r.style,innerColor:t,glowColor:e,globalAlpha:n}}))}destroy(){this._laserLine=o(this._laserLine)}get _params(){let{accentColor:e}=this.view.effectiveTheme;return{laserLineGlowColor:e.toUnitRGB(),laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:r(e).toUnitRGB(),laserLineInnerWidth:.75,laserLineGlobalAlpha:e.a*.75,handleColor:n(e,.5),handleRadius:5}}get visible(){return this._visible}set visible(e){e?this.show():this.hide()}get testData(){}get _cursorPosition(){let e=d(),t=this.cursorPoint;return t&&this.view.renderCoordsHelper.toRenderCoords(t,e),e}get _startPosition(){let e=d(),t=this.analysis.startPoint;return t&&this.view.renderCoordsHelper.toRenderCoords(t,e),e}get _endPosition(){let e=d(),t=this.analysis.endPoint;return t&&this.view.renderCoordsHelper.toRenderCoords(t,e),e}get _laserLineParams(){let e=this._focusPosition,{active:t,lineState:n}=this.toolState,r=this.analysisViewData,i=this.laserLineEnabled&&!!e&&n!==`measured`&&t;if(!i||!this.visible||r==null||r.destroyed)return{heightManifoldTarget:null,pointDistanceLine:null,lineVerticalPlaneSegment:null};let a=r.actualVisualizedMeasurement,o=this.view.viewingMode!==`local`&&i&&!!this.analysis.startPoint&&a===`geodesic`,s=i&&r.viewMode===2;return{heightManifoldTarget:a===`euclidean`?e:null,pointDistanceLine:o?this._pointDistanceLine:null,lineVerticalPlaneSegment:s?f(this._startPosition,this._endPosition):null}}get _focusPosition(){let{lineState:e}=this.toolState,t=this.analysisViewData,n=t!=null&&!t.destroyed&&t.measurementMode===1&&t.viewMode===1;switch(e){case`drawing`:return n?this._startPosition:this.analysis.endPoint?this._endPosition:this._startPosition;case`editing`:return n?this._lastDraggedHandle===`start`?this._endPosition:this._startPosition:this._lastDraggedHandle===`start`?this._startPosition:this._endPosition;default:return this.cursorPoint==null?null:this._cursorPosition}}get _pointDistanceLine(){return{origin:this.toolState.lineState===`drawing`||this._lastDraggedHandle===`end`?this._startPosition:this._endPosition,target:this._focusPosition}}createManipulators(){let e=this._params,{view:t}=this,n=()=>{let n=m(e.handleColor);n.setParameters({testsTransparentRenderOrder:5});let r=[new h(_(n,1,32,32))],i=new p({view:t,renderObjects:r});return i.available=!1,i.radius=e.handleRadius,[i,n]},[r,o]=n(),[c,l]=n(),u=new p({view:this.view,available:!1,interactive:!1});this.analysis.startPoint!=null&&(r.location=this.analysis.startPoint,r.available=!0),this.analysis.endPoint!=null&&(c.location=this.analysis.endPoint,c.available=!0);let d=()=>{let e=this._lastDraggedHandle;r.grabbing&&!c.grabbing&&(e=`start`),c.grabbing&&!r.grabbing&&(e=`end`),!r.grabbing&&!c.grabbing&&(e=null),this._lastDraggedHandle=e},f=r.events.on(`grab-changed`,d),g=c.events.on(`grab-changed`,d);return this.addHandles([f,g,s(()=>a(this._params.handleColor),e=>{o.setParameters({color:e}),l.setParameters({color:e})},{equals:i})],`manipulators`),{start:r,end:c,cursor:u}}show(){!this.destroyed&&!this._visible&&this._updateVisibility(!0)}hide(){!this.destroyed&&this._visible&&this._updateVisibility(!1)}_connectToAnalysisView(){this.removeHandles(`analysis-view`),this.addHandles([s(()=>this.analysisViewData?.destroyed,e=>{e&&this.removeHandles(`analysis-view`)},c),s(()=>[this.toolState.lineState===`measured`,this.analysisViewData],([e,t])=>{t!=null&&!t.destroyed&&(t.allowVisualElementsOrientationChange=!e)},c),s(()=>this._laserLineParams,e=>{let t=this._laserLine;t.heightManifoldTarget=e.heightManifoldTarget,t.pointDistanceLine=e.pointDistanceLine,t.lineVerticalPlaneSegment=e.lineVerticalPlaneSegment},c)],`analysis-view`)}_updateVisibility(e){this.initialized&&(this._visible=e,e&&(this._laserLine.style={innerColor:this._params.laserLineInnerColor,innerWidth:this._params.laserLineInnerWidth,glowColor:this._params.laserLineGlowColor,glowWidth:this._params.laserLineGlowWidth,glowFalloff:this._params.laserLineGlowFalloff,globalAlpha:this._params.laserLineGlobalAlpha}),this._laserLine.visible=e)}};e([l({constructOnly:!0})],v.prototype,`view`,void 0),e([l()],v.prototype,`_params`,null),e([l({constructOnly:!0})],v.prototype,`analysis`,void 0),e([l({constructOnly:!0})],v.prototype,`analysisViewData`,void 0),e([l()],v.prototype,`cursorPoint`,void 0),e([l()],v.prototype,`toolState`,void 0),e([l()],v.prototype,`visible`,null),e([l()],v.prototype,`testData`,null),e([l()],v.prototype,`_visible`,void 0),e([l()],v.prototype,`_laserLine`,void 0),e([l({constructOnly:!0})],v.prototype,`laserLineEnabled`,void 0),e([l()],v.prototype,`_cursorPosition`,null),e([l()],v.prototype,`_startPosition`,null),e([l()],v.prototype,`_endPosition`,null),e([l()],v.prototype,`_lastDraggedHandle`,void 0),e([l()],v.prototype,`_laserLineParams`,null),e([l()],v.prototype,`_focusPosition`,null),e([l()],v.prototype,`_pointDistanceLine`,null),v=e([u(`esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DView`)],v);export{v as DirectLineMeasurement3DView};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as n,getContrast as r,colorVectorEquals as i,colorVectorToColorAndOpacity as a}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{watch as s,initial as c}from"../../../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPoints as f}from"../../../../../geometry/support/lineSegment.js";import{Manipulator3D as p}from"../../Manipulator3D.js";import{createManipulatorMaterial as m}from"../../manipulatorUtils.js";import{RenderObject as h}from"../../RenderObject.js";import{LaserlineVisualElement as g}from"../../visualElements/LaserlineVisualElement.js";import{createSphereGeometry as _}from"../../../webgl-engine/lib/GeometryUtil.js";let v=class extends t{constructor(e){super(e),this.cursorPoint=null,this._visible=!1,this._laserLine=null,this.laserLineEnabled=!0,this._lastDraggedHandle=null}initialize(){this._laserLine=new g({view:this.view,attached:!0,isDecoration:!0}),this._updateVisibility(this._visible),this._connectToAnalysisView(),this.addHandles(s(()=>this._params,({laserLineGlowColor:e,laserLineInnerColor:t,laserLineGlobalAlpha:n})=>{let r=this._laserLine;r.style={...r.style,innerColor:t,glowColor:e,globalAlpha:n}}))}destroy(){this._laserLine=o(this._laserLine)}get _params(){let{accentColor:e}=this.view.effectiveTheme;return{laserLineGlowColor:e.toUnitRGB(),laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:r(e).toUnitRGB(),laserLineInnerWidth:.75,laserLineGlobalAlpha:e.a*.75,handleColor:n(e,.5),handleRadius:5}}get visible(){return this._visible}set visible(e){e?this.show():this.hide()}get testData(){}get _cursorPosition(){let e=d(),t=this.cursorPoint;return t&&this.view.renderCoordsHelper.toRenderCoords(t,e),e}get _startPosition(){let e=d(),t=this.analysisViewData.elevationAlignedStartPoint;return t&&this.view.renderCoordsHelper.toRenderCoords(t,e),e}get _endPosition(){let e=d(),t=this.analysisViewData.elevationAlignedEndPoint;return t&&this.view.renderCoordsHelper.toRenderCoords(t,e),e}get _laserLineParams(){let e=this._focusPosition,{active:t,lineState:n}=this.toolState,r=this.analysisViewData,i=this.laserLineEnabled&&!!e&&n!==`measured`&&t;if(!i||!this.visible||r==null||r.destroyed)return{heightManifoldTarget:null,pointDistanceLine:null,lineVerticalPlaneSegment:null};let a=r.actualVisualizedMeasurement,o=this.view.viewingMode!==`local`&&i&&!!this.analysis.startPoint&&a===`geodesic`,s=i&&r.viewMode===2;return{heightManifoldTarget:a===`euclidean`?e:null,pointDistanceLine:o?this._pointDistanceLine:null,lineVerticalPlaneSegment:s?f(this._startPosition,this._endPosition):null}}get _focusPosition(){let{lineState:e}=this.toolState,t=this.analysisViewData,n=t!=null&&!t.destroyed&&t.measurementMode===1&&t.viewMode===1;switch(e){case`drawing`:return n?this._startPosition:this.analysis.endPoint?this._endPosition:this._startPosition;case`editing`:return n?this._lastDraggedHandle===`start`?this._endPosition:this._startPosition:this._lastDraggedHandle===`start`?this._startPosition:this._endPosition;default:return this.cursorPoint==null?null:this._cursorPosition}}get _pointDistanceLine(){return{origin:this.toolState.lineState===`drawing`||this._lastDraggedHandle===`end`?this._startPosition:this._endPosition,target:this._focusPosition}}createManipulators(){let e=this._params,{view:t}=this,n=()=>{let n=m(e.handleColor);n.setParameters({testsTransparentRenderOrder:5});let r=[new h(_(n,1,32,32))],i=new p({view:t,renderObjects:r});return i.available=!1,i.radius=e.handleRadius,[i,n]},[r,o]=n(),[c,l]=n(),u=new p({view:this.view,available:!1,interactive:!1}),{elevationAlignedStartPoint:d,elevationAlignedEndPoint:f}=this.analysisViewData;d!=null&&(r.location=d,r.available=!0),f!=null&&(c.location=f,c.available=!0);let g=()=>{let e=this._lastDraggedHandle;r.grabbing&&!c.grabbing&&(e=`start`),c.grabbing&&!r.grabbing&&(e=`end`),!r.grabbing&&!c.grabbing&&(e=null),this._lastDraggedHandle=e},v=r.events.on(`grab-changed`,g),y=c.events.on(`grab-changed`,g);return this.addHandles([v,y,s(()=>a(this._params.handleColor),e=>{o.setParameters({color:e}),l.setParameters({color:e})},{equals:i})],`manipulators`),{start:r,end:c,cursor:u}}show(){!this.destroyed&&!this._visible&&this._updateVisibility(!0)}hide(){!this.destroyed&&this._visible&&this._updateVisibility(!1)}_connectToAnalysisView(){this.removeHandles(`analysis-view`),this.addHandles([s(()=>this.analysisViewData?.destroyed,e=>{e&&this.removeHandles(`analysis-view`)},c),s(()=>[this.toolState.lineState===`measured`,this.analysisViewData],([e,t])=>{t!=null&&!t.destroyed&&(t.allowVisualElementsOrientationChange=!e)},c),s(()=>this._laserLineParams,e=>{let t=this._laserLine;t.heightManifoldTarget=e.heightManifoldTarget,t.pointDistanceLine=e.pointDistanceLine,t.lineVerticalPlaneSegment=e.lineVerticalPlaneSegment},c)],`analysis-view`)}_updateVisibility(e){this.initialized&&(this._visible=e,e&&(this._laserLine.style={innerColor:this._params.laserLineInnerColor,innerWidth:this._params.laserLineInnerWidth,glowColor:this._params.laserLineGlowColor,glowWidth:this._params.laserLineGlowWidth,glowFalloff:this._params.laserLineGlowFalloff,globalAlpha:this._params.laserLineGlobalAlpha}),this._laserLine.visible=e)}};e([l({constructOnly:!0})],v.prototype,`view`,void 0),e([l()],v.prototype,`_params`,null),e([l({constructOnly:!0})],v.prototype,`analysis`,void 0),e([l({constructOnly:!0})],v.prototype,`analysisViewData`,void 0),e([l()],v.prototype,`cursorPoint`,void 0),e([l()],v.prototype,`toolState`,void 0),e([l()],v.prototype,`visible`,null),e([l()],v.prototype,`testData`,null),e([l()],v.prototype,`_visible`,void 0),e([l()],v.prototype,`_laserLine`,void 0),e([l({constructOnly:!0})],v.prototype,`laserLineEnabled`,void 0),e([l()],v.prototype,`_cursorPosition`,null),e([l()],v.prototype,`_startPosition`,null),e([l()],v.prototype,`_endPosition`,null),e([l()],v.prototype,`_lastDraggedHandle`,void 0),e([l()],v.prototype,`_laserLineParams`,null),e([l()],v.prototype,`_focusPosition`,null),e([l()],v.prototype,`_pointDistanceLine`,null),v=e([u(`esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DView`)],v);export{v as DirectLineMeasurement3DView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as n,watch as r,sync as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{computeSrcResolutions as s,projectDatasetExtent as c}from"../../../layers/raster/functions/rasterProjectionHelper.js";import{LayerView3D as l}from"./LayerView3D.js";import{TiledLayerView3D as u}from"./TiledLayerView3D.js";import d from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as f}from"../terrain/RasterTile.js";import p from"../../layers/ImageryTileLayerView.js";import{RefreshableLayerView as m}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as h}from"../../support/drapedUtils.js";import{getWebGLCapabilities as g}from"../../webgl/capabilities.js";let _=class extends m(u(l(p))){constructor(){super(...arguments),this._srcResolutions=[],this.type=`imagery-tile-3d`,this._isAlignedMapTile=!0,this._flowSubView=null,this.ignoresMemoryFactor=!1,this.unloadedMemory=0}initialize(){this.layer.increaseRasterJobHandlerUsage(),this.fullExtent??this.addResolvingPromise(Promise.reject(new t(`layerview:spatial-reference-incompatible`,`The layer extent cannot be projected to the view's spatial reference`,{layer:this.layer})));let e=n(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{let e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=[`png`,`png24`,`png32`,`jpg`,`mixed`].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this._srcResolutions=s(this.layer.serviceRasterInfo,this.tileInfo),this.addHandles([r(()=>this.layer.renderer,e=>{this._setSubView(e),this._updatingHandles.consumePromise(this.doRefresh())},i),r(()=>[this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this._updatingHandles.addPromise(this.doRefresh()),i)])});this._setSubView(this.layer.renderer),this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}_setSubView(e){if(this.layer.type===`wcs`)return;let t=e?.type===`flow`,n=this._flowSubView;t&&n!=null||(n?.destroy(),this._flowSubView=t?new d({layerView:this}):null)}get _hasFlow(){return this._flowSubView!=null}get imageFormatIsOpaque(){return this.layer.tileInfo.format===`jpg`}get hasMixedImageFormats(){return this.layer.tileInfo.format===`mixed`}get dataLevelRange(){let e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,n=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,n)}get visibleAtCurrentScale(){return this._flowSubView?.visibleAtCurrentScale??this.tilesVisibleAtCurrentScale()}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.groundView?.spatialReference??this.view.spatialReference)}async fetchTile(e,n){if(this._isAlignedMapTile)return this.layer.fetchImageBitmapTile(e[0],e[1],e[2],{...n,allowDeriveTypeFromData:!0,imageOrientation:`flipY`});let r=this.tileInfo,i=this._canSymbolizeInWebGL(),a={tileInfo:r,requestRawData:i&&!this._hasFlow,signal:n.signal,timeExtent:this.timeExtent,requestProjectedLocalDirections:this._hasFlow,srcResolution:this._srcResolutions[e[0]],noClip:!1},{layer:o}=this,[s,c,l]=e,u=await o.fetchTile(s,c,l,a);if(u instanceof HTMLImageElement||u instanceof ImageBitmap)throw new t(`layerview:unexpected-tile-data`,`Expected fetchTile to return raster data, but received an image element. This may indicate a problem with the layer's fetchTile implementation.`);let d=u?.pixelBlock;if(d==null||!i&&!this._hasFlow&&(d=await o.applyRenderer(u),d==null))return null;let p=new f([s,c,l],d,r.size[0],r.size[1]);return i?(p.symbolizerRenderer=o.symbolizer.rendererJSON,p.symbolizerParameters=o.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(s)),p.transformGrid=u.transformGrid,p.bandIds=o.bandIds):(p.isRenderedSource=!0,p.bandIds=null),p.interpolation=o.interpolation,p}_getSymbolizerOptions(e){let t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:this.view.groundView?.spatialReference==null?this.view.spatialReference.isGeographic:this.view.groundView.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return h(e,t,this.view)}async doRefresh(){this.suspended||(this._flowSubView?.doRefresh(),this.emit(`data-changed`))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){let e=g(),{symbolizer:t}=this.layer,n=t.lookup.colormapLut?.indexedColormap,r=!!this.layer.rasterFunction?.hasClipFunction,i=n&&n.length>(e.maxTextureSize||4096)*4;return t.canRenderInWebGL&&!i&&!r}get usedMemory(){return this._flowSubView?.usedMemory??0}get test(){}};e([a()],_.prototype,`fullExtent`,null),e([a()],_.prototype,`_hasFlow`,null),e([a({readOnly:!0})],_.prototype,`imageFormatIsOpaque`,null),e([a({readOnly:!0})],_.prototype,`hasMixedImageFormats`,null),e([a()],_.prototype,`_flowSubView`,void 0),e([a({readOnly:!0})],_.prototype,`dataLevelRange`,null),e([a({readOnly:!0})],_.prototype,`visibleAtCurrentScale`,null),_=e([o(`esri.views.3d.layers.ImageryTileLayerView3D`)],_);const v=_;export{v as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as n,watch as r,sync as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{computeSrcResolutions as s,projectDatasetExtent as c}from"../../../layers/raster/functions/rasterProjectionHelper.js";import{LayerView3D as l}from"./LayerView3D.js";import{TiledLayerView3D as u}from"./TiledLayerView3D.js";import d from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as f}from"../terrain/RasterTile.js";import p from"../../layers/ImageryTileLayerView.js";import{RefreshableLayerView as m}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as h}from"../../support/drapedUtils.js";import{getWebGLCapabilities as g}from"../../webgl/capabilities.js";let _=class extends m(u(l(p))){constructor(){super(...arguments),this._srcResolutions=[],this.type=`imagery-tile-3d`,this._isAlignedMapTile=!0,this._flowSubView=null,this.ignoresMemoryFactor=!1,this.unloadedMemory=0}initialize(){this.layer.increaseRasterJobHandlerUsage(),this.fullExtent??this.addResolvingPromise(Promise.reject(new t(`layerview:spatial-reference-incompatible`,`The layer extent cannot be projected to the view's spatial reference`,{layer:this.layer})));let e=n(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{let e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=[`png`,`png24`,`png32`,`jpg`,`mixed`].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this._srcResolutions=s(this.layer.serviceRasterInfo,this.tileInfo),this.addHandles([r(()=>this.layer.renderer,e=>{this._setSubView(e),this._updatingHandles.consumePromise(this.doRefresh())},i),r(()=>[this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this._updatingHandles.addPromise(this.doRefresh()),i)])});this._setSubView(this.layer.renderer),this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}_setSubView(e){if(this.layer.type===`wcs`)return;let t=e?.type===`flow`,n=this._flowSubView;t&&n!=null||(n?.destroy(),this._flowSubView=t?new d({layerView:this}):null)}get _hasFlow(){return this._flowSubView!=null}get imageFormatIsOpaque(){return this.layer.tileInfo?.format===`jpg`}get hasMixedImageFormats(){return this.layer.tileInfo?.format===`mixed`}get dataLevelRange(){let e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,n=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,n)}get visibleAtCurrentScale(){return this._flowSubView?.visibleAtCurrentScale??this.tilesVisibleAtCurrentScale()}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.groundView?.spatialReference??this.view.spatialReference)}async fetchTile(e,n){if(this._isAlignedMapTile)return this.layer.fetchImageBitmapTile(e[0],e[1],e[2],{...n,allowDeriveTypeFromData:!0,imageOrientation:`flipY`});let r=this.tileInfo,i=this._canSymbolizeInWebGL(),a={tileInfo:r,requestRawData:i&&!this._hasFlow,signal:n.signal,timeExtent:this.timeExtent,requestProjectedLocalDirections:this._hasFlow,srcResolution:this._srcResolutions[e[0]],noClip:!1},{layer:o}=this,[s,c,l]=e,u=await o.fetchTile(s,c,l,a);if(u instanceof HTMLImageElement||u instanceof ImageBitmap)throw new t(`layerview:unexpected-tile-data`,`Expected fetchTile to return raster data, but received an image element. This may indicate a problem with the layer's fetchTile implementation.`);let d=u?.pixelBlock;if(d==null||!i&&!this._hasFlow&&(d=await o.applyRenderer(u),d==null))return null;let p=new f([s,c,l],d,r.size[0],r.size[1]);return i?(p.symbolizerRenderer=o.symbolizer.rendererJSON,p.symbolizerParameters=o.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(s)),p.transformGrid=u.transformGrid,p.bandIds=o.bandIds):(p.isRenderedSource=!0,p.bandIds=null),p.interpolation=o.interpolation,p}_getSymbolizerOptions(e){let t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:this.view.groundView?.spatialReference==null?this.view.spatialReference.isGeographic:this.view.groundView.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return h(e,t,this.view)}async doRefresh(){this.suspended||(this._flowSubView?.doRefresh(),this.emit(`data-changed`))}isUpdating(){return super.isUpdating()||(this._flowSubView?.updating??!1)}_canSymbolizeInWebGL(){let e=g(),{symbolizer:t}=this.layer,n=t.lookup.colormapLut?.indexedColormap,r=!!this.layer.rasterFunction?.hasClipFunction,i=n&&n.length>(e.maxTextureSize||4096)*4;return t.canRenderInWebGL&&!i&&!r}get usedMemory(){return this._flowSubView?.usedMemory??0}get test(){}};e([a()],_.prototype,`fullExtent`,null),e([a()],_.prototype,`_hasFlow`,null),e([a({readOnly:!0})],_.prototype,`imageFormatIsOpaque`,null),e([a({readOnly:!0})],_.prototype,`hasMixedImageFormats`,null),e([a()],_.prototype,`_flowSubView`,void 0),e([a({readOnly:!0})],_.prototype,`dataLevelRange`,null),e([a({readOnly:!0})],_.prototype,`visibleAtCurrentScale`,null),_=e([o(`esri.views.3d.layers.ImageryTileLayerView3D`)],_);const v=_;export{v as default};