@arcgis/core 6.0.0-next.54 → 6.0.0-next.56

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 (467) hide show
  1. package/WebScene.js +2 -2
  2. package/applications/Components/OrientedImageryViewer/shared/constants.js +1 -1
  3. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  4. package/arcade/arcadeAsyncRuntime.js +1 -1
  5. package/arcade/arcadeCompiler.js +1 -1
  6. package/arcade/arcadeRuntime.js +1 -1
  7. package/arcade/featureset/support/sqlUtils.js +1 -1
  8. package/arcade/validation/arcadeValidator.js +1 -1
  9. package/arcgisGlobal.d.ts +1 -0
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/0329fa3aa3403f1c243b.js +1 -0
  12. package/assets/esri/core/workers/chunks/033b9fcd9833db3b6e7d.js +1 -0
  13. package/assets/esri/core/workers/chunks/{6602310c3fcd91fb6a2f.js → 07c8ac092e4b9e8d5b3c.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0978e12dd6a1cbc50b80.js +1 -0
  15. package/assets/esri/core/workers/chunks/0a97b1974367382cfdf5.js +1 -0
  16. package/assets/esri/core/workers/chunks/{db0a7671ab5cbe8afd72.js → 123661019bb69c53f2d3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{e956845255bce0910944.js → 1507297550c3cd1268e2.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{1b41ba050cde068d2860.js → 193a73a2c7f4f8482c21.js} +1 -1
  19. package/assets/esri/core/workers/chunks/1c0f5c42331fb6fc26cb.js +1 -0
  20. package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +1 -0
  21. package/assets/esri/core/workers/chunks/2cd2fcf4a37d180d5d5c.js +1 -0
  22. package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +1 -0
  23. package/assets/esri/core/workers/chunks/{afb4dfb89fbc8a342cc5.js → 3354f1fa90f8ce4c8fde.js} +1 -1
  24. package/assets/esri/core/workers/chunks/3982409149571a827390.js +1 -0
  25. package/assets/esri/core/workers/chunks/{9b458b0d1627f22fdd93.js → 3b11e4d2e69b7aea1d65.js} +1 -1
  26. package/assets/esri/core/workers/chunks/3d851710f7fcc27c5b60.js +2 -0
  27. package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +1 -0
  28. package/assets/esri/core/workers/chunks/41694ee8990e799da225.js +1 -0
  29. package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +1 -0
  30. package/assets/esri/core/workers/chunks/{12add2003631fa314f25.js → 5060be52a380fc4920f8.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{2aa6be0b047a1b25a520.js → 53bbb9aa6e4e4a0a8121.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{c6d82397044e403a1f61.js → 5954f02c3901b28d8e73.js} +1 -1
  33. package/assets/esri/core/workers/chunks/5ba6007c3c49a8153256.js +1 -0
  34. package/assets/esri/core/workers/chunks/5bdd95eeb8f34dbf26f2.js +2 -0
  35. package/assets/esri/core/workers/chunks/{4707aedcc1b3bdf5e987.js → 5c34d49a6c9cc34b7626.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js → 5e47026c681238038955.js} +2 -2
  37. package/assets/esri/core/workers/chunks/{2baf35b1b19482d603b5.js → 5f7505ada0991cfbdd84.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{976303f47c342b9d1cc0.js → 62ddd3a82864e26f009a.js} +1 -1
  39. package/assets/esri/core/workers/chunks/69a09c6acb5ae03c67f6.js +1 -0
  40. package/assets/esri/core/workers/chunks/{542a9c414c99d84d52ab.js → 6a202ef9ba9b89e09153.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{0826feebdca8a31eb630.js → 6ba6fece5c11fe2a6ace.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{5eb69e2895e5aec81051.js → 6fd10891506925560443.js} +1 -1
  43. package/assets/esri/core/workers/chunks/7b156905d168bf973518.js +1 -0
  44. package/assets/esri/core/workers/chunks/7b6fd287e7043ad50f4e.js +1 -0
  45. package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +1 -0
  46. package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +1 -0
  47. package/assets/esri/core/workers/chunks/{c3c0f24a9e0047232ae1.js → 8679dfc0c53355b6feb0.js} +1 -1
  48. package/assets/esri/core/workers/chunks/8a636dc51372e14c98f5.js +1 -0
  49. package/assets/esri/core/workers/chunks/{d14732a57c8e63948c60.js → 9117c9b720c9ba6e7a6e.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{f7e33d37dd11fb08f3f8.js → 97107e64407fa6825620.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{5118c7269b706089c88e.js → a05a2c2aaf0c288f9681.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{944f17e9c9f681b971fb.js → a12e2a345005189c64be.js} +1 -1
  53. package/assets/esri/core/workers/chunks/a22458e5272332d86cb9.js +1 -0
  54. package/assets/esri/core/workers/chunks/{15b3386ad92a0b4149b8.js → a24dc5350af001db417a.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{10967a36c77c5188690d.js → a66d6298236d59a615db.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{3ea480cebf8ee56228a5.js → a7dfca326883384d2751.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{723d8316f5d4b6ce2942.js → a9539393e2f1812a973a.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{ac8d38016e4bee37a77c.js → ab784764ddf9d7f693a1.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{255f5b45c4d32f97f86c.js → ac0861014b3d2f1a1de2.js} +1 -1
  60. package/assets/esri/core/workers/chunks/ace210d313ce53f3ae10.js +1 -0
  61. package/assets/esri/core/workers/chunks/ae48ee283cfa5b3c14b0.js +1 -0
  62. package/assets/esri/core/workers/chunks/b38b6fe08a367e9de4f5.js +1 -0
  63. package/assets/esri/core/workers/chunks/{4e651869e9a196494694.js → b6e628b5d2643af4c19b.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{b37ab6b1cb4cfc85cd9d.js → b7828d7e2c5b75644057.js} +1 -1
  65. package/assets/esri/core/workers/chunks/bbd8fcb0bbba7bde3d9b.js +1 -0
  66. package/assets/esri/core/workers/chunks/{ec465abb0344ad719e9d.js → bd8e329ec74d921d311a.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{56e6e70aa40e51827290.js → c3f94024c6c9eed9f273.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{6d17b45022dfd2548098.js → c5ddf8b347c31fe772a3.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{ee9af58ae202b803bba7.js → c7a0c4ca37ebd1d98cf1.js} +1 -1
  70. package/assets/esri/core/workers/chunks/d0659f1b0495734be4b3.js +1 -0
  71. package/assets/esri/core/workers/chunks/d7763c42754152510e13.js +2 -0
  72. package/assets/esri/core/workers/chunks/{b9a2b05ede02c305e865.js → d8ffb1502def5c85740b.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{7dfe1e78d2e66de6be22.js → d9ef244019954d5a8a27.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{95403bb27a4ea0a4b7b1.js → ddbfa664e69612295785.js} +1 -1
  75. package/assets/esri/core/workers/chunks/dfa1b0308e5e82d1ddfe.js +1120 -0
  76. package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +1 -0
  77. package/assets/esri/core/workers/chunks/e74586b074d0fa6abb4b.js +1 -0
  78. package/assets/esri/core/workers/chunks/e7dff025780726d5feae.js +1 -0
  79. package/assets/esri/core/workers/chunks/e96fa029acba59c04e4e.js +2 -0
  80. package/assets/esri/core/workers/chunks/{55d28d3f5b8ced061e39.js → eaf73ce60f39a48ddd2a.js} +1 -1
  81. package/assets/esri/core/workers/chunks/ed2f2a5da830d058e339.js +1 -0
  82. package/assets/esri/core/workers/chunks/{e592f2483db71230e8e5.js → efd6ea0966f60ab19520.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{944cb751c85d3a127f49.js → f52d081bbde5c95265cf.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{1de9be7b65109c207bd5.js → fbd5f3b81cd9f061824d.js} +1 -1
  85. package/assets/esri/core/workers/chunks/fdfbd201be372d3796bf.js +2 -0
  86. package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +1 -0
  87. package/assets/esri/layers/raster/formats/blosc-wasm.wasm +0 -0
  88. package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
  89. package/basemapGallery/support/basemapCompatibilityUtils.js +1 -1
  90. package/chunks/BlendLayers.glsl.js +1 -1
  91. package/chunks/ColorMaterial.glsl.js +14 -14
  92. package/chunks/Component.glsl.js +37 -37
  93. package/chunks/CypherParser.js +1 -1
  94. package/chunks/DefaultMaterial.glsl.js +15 -15
  95. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  96. package/chunks/HUDMaterial.glsl.js +3 -3
  97. package/chunks/MultiPathImpl.js +1 -1
  98. package/chunks/OperatorGeodesicBuffer.js +1 -1
  99. package/chunks/Path.glsl.js +15 -15
  100. package/chunks/Pattern.glsl.js +20 -20
  101. package/chunks/RasterColorizer.glsl.js +1 -1
  102. package/chunks/ShadowHighlight.glsl.js +1 -1
  103. package/chunks/Terrain.glsl.js +24 -24
  104. package/chunks/UnitFactory.js +1 -1
  105. package/chunks/Water.glsl.js +29 -20
  106. package/chunks/blosc-wasm.js +2 -0
  107. package/chunks/cameraUtilsSpherical.js +1 -1
  108. package/chunks/parquet.js +1 -1
  109. package/chunks/pdf.js +57 -0
  110. package/chunks/text.js +1 -1
  111. package/config.js +1 -1
  112. package/core/accessorSupport/write.js +1 -1
  113. package/core/scheduling.js +1 -1
  114. package/core/sql/SqlInterval.js +1 -1
  115. package/core/urlUtils.js +1 -1
  116. package/geometry/geometryEngine.js +1 -1
  117. package/geometry/operators/gx/operatorOffset.js +1 -1
  118. package/geometry/support/Ellipsoid.js +1 -1
  119. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  120. package/geometry/support/geodesicConstants.js +1 -1
  121. package/geometry/support/meshUtils/primitives.js +1 -1
  122. package/kernel.js +1 -1
  123. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  124. package/layers/VoxelWasmPerSceneView.js +1 -1
  125. package/layers/effects/parser.js +1 -1
  126. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  127. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -56
  128. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  129. package/layers/geospatialPDF/parserUtils.js +2 -0
  130. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  131. package/layers/graphics/data/QueryEngineResult.js +1 -1
  132. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  133. package/layers/parquet.js +1 -1
  134. package/layers/raster/datasets/ZarrRaster.js +1 -1
  135. package/layers/raster/datasets/wcsCoverageParser.js +1 -1
  136. package/layers/raster/formats/RasterCodec.js +1 -1
  137. package/layers/raster/formats/blosc.js +2 -0
  138. package/layers/support/BuildingFilter.js +1 -1
  139. package/layers/support/ControlPoint.js +1 -1
  140. package/layers/support/ControlPointsGeoreference.js +1 -1
  141. package/layers/support/IntegratedMeshSemantics.js +1 -1
  142. package/layers/support/commonProperties.js +1 -1
  143. package/layers/support/fieldUtils.d.ts +23 -87
  144. package/layers/support/fieldUtils.js +1 -1
  145. package/layers/support/geospatialPDFUtils.d.ts +63 -0
  146. package/layers/support/geospatialPDFUtils.js +2 -0
  147. package/layers/support/layersMapping.js +1 -1
  148. package/layers/video/VideoController.js +1 -1
  149. package/legend/ActiveLayerInfo.js +1 -1
  150. package/libs/ajv/ajv.bundle-wrapper.js +1 -1
  151. package/package.json +6 -6
  152. package/renderers/types.d.ts +1 -1
  153. package/rest/knowledgeGraphService.js +1 -1
  154. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  155. package/smartMapping/statistics/support/attributeDensity.js +1 -1
  156. package/smartMapping/support/adapters/support/utils.js +1 -1
  157. package/support/tests/serviceMockDependencies.js +1 -1
  158. package/symbols/CIMSymbol.d.ts +9 -9
  159. package/symbols/PathSymbol3DLayer.d.ts +1 -1
  160. package/symbols/WaterSymbol3DLayer.d.ts +13 -1
  161. package/symbols/WaterSymbol3DLayer.js +1 -1
  162. package/symbols/cim/CIMEffects.js +1 -1
  163. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  164. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  165. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  166. package/symbols/cim/rasterizingUtils.js +1 -1
  167. package/views/2d/PaddedViewState.js +1 -1
  168. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  169. package/views/2d/engine/vectorTiles/constants.js +1 -1
  170. package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +1 -1
  171. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  172. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  173. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  174. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  175. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  176. package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
  177. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  178. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  179. package/views/2d/layers/ParquetLayerView2D.js +1 -1
  180. package/views/2d/layers/features/Processor.js +1 -1
  181. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  182. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  183. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  184. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  185. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  186. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  187. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  188. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  189. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  190. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  191. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  192. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  193. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  194. package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
  195. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
  196. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  197. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  198. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  199. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementVisualization.js +1 -1
  200. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  201. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  202. package/views/3d/camera/constraintUtils.js +1 -1
  203. package/views/3d/camera/intersectionUtils.js +1 -1
  204. package/views/3d/environment/EnvironmentView.js +1 -1
  205. package/views/3d/focusAreaUtils.js +1 -1
  206. package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
  207. package/views/3d/interactive/Manipulator3D.js +1 -1
  208. package/views/3d/interactive/Manipulator3DBase.js +1 -1
  209. package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
  210. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  211. package/views/3d/interactive/editingTools/manipulations/config.js +1 -1
  212. package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
  213. package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
  214. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  215. package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
  216. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  217. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  218. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  219. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  220. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  221. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  222. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  223. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  224. package/views/3d/layers/DrapedSubView3D.js +1 -1
  225. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  226. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  227. package/views/3d/layers/FlowSubView3D.js +1 -1
  228. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  229. package/views/3d/layers/I3SMeshView3D.js +1 -1
  230. package/views/3d/layers/RouteLayerView3D.js +1 -1
  231. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  232. package/views/3d/layers/TiledLayerView3D.js +1 -1
  233. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  234. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  235. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  236. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  237. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  238. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  239. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  240. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  241. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  242. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  243. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  244. package/views/3d/layers/graphics/Graphics3DSymbolFactory.js +1 -1
  245. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  246. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  247. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  248. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  249. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  250. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  251. package/views/3d/layers/i3s/I3SNode.js +1 -1
  252. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  253. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  254. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  255. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  256. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  257. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  258. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  259. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  260. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  261. package/views/3d/layers/support/Tiles3DBVH.js +1 -1
  262. package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +1 -1
  263. package/views/3d/layers/support/createTileBVHForLayer.js +1 -1
  264. package/views/3d/layers/support/selectTiles3DSpatialReference.js +1 -1
  265. package/views/3d/layers/support/uvUtils.js +1 -1
  266. package/views/3d/state/Constraints.js +1 -1
  267. package/views/3d/state/ConstraintsManager.js +1 -1
  268. package/views/3d/state/NearFarHeuristic.js +1 -1
  269. package/views/3d/state/ViewState.js +1 -1
  270. package/views/3d/state/ViewStateManager.js +1 -1
  271. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  272. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  273. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  274. package/views/3d/state/controllers/RotateController.js +1 -1
  275. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  276. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  277. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  278. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  279. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  280. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  281. package/views/3d/state/utils/navigationUtils.js +1 -1
  282. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  283. package/views/3d/support/QualityProfile.js +1 -1
  284. package/views/3d/support/QualitySettings.js +1 -1
  285. package/views/3d/support/RenderCoordsHelper.js +1 -1
  286. package/views/3d/support/SweptSphereVolume.js +1 -1
  287. package/views/3d/support/cameraUtils.js +1 -1
  288. package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
  289. package/views/3d/support/engineContent/line.js +1 -1
  290. package/views/3d/support/engineContent/marker.js +1 -1
  291. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  292. package/views/3d/support/hitTest.js +1 -1
  293. package/views/3d/support/orientedBoundingBox.js +1 -1
  294. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  295. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  296. package/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates.js +1 -1
  297. package/views/3d/support/sunUtils.js +1 -1
  298. package/views/3d/terrain/BlendLayersTechniqueConfiguration.js +1 -1
  299. package/views/3d/terrain/ExtentHelper.js +1 -1
  300. package/views/3d/terrain/OverlayManager.js +1 -1
  301. package/views/3d/terrain/OverlayRenderer.js +1 -1
  302. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  303. package/views/3d/terrain/RasterColorizerTechniqueConfiguration.js +1 -1
  304. package/views/3d/terrain/TerrainRenderer.js +1 -1
  305. package/views/3d/terrain/TerrainSurface.js +1 -1
  306. package/views/3d/terrain/Tile.js +1 -1
  307. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  308. package/views/3d/terrain/terrainUtils.js +1 -1
  309. package/views/3d/webgl/RenderCamera.js +1 -1
  310. package/views/3d/webgl-engine/Stage.js +1 -1
  311. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  312. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  313. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  314. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
  315. package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
  316. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  317. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  318. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  319. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  320. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  321. package/views/3d/webgl-engine/core/shaderLibrary/clampShadowPosition.glsl.js +2 -0
  322. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +14 -14
  323. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
  324. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  325. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -3
  326. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  327. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  328. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  329. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  330. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  331. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
  332. package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
  333. package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
  334. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  335. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  336. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  337. package/views/3d/webgl-engine/lib/Program.js +1 -1
  338. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  339. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  340. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  341. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  342. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  343. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  344. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  345. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  346. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  347. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  348. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  349. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  350. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  351. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  352. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  353. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  354. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  355. package/views/3d/webgl-engine/parts/Model.js +1 -1
  356. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  357. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  358. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  359. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  360. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  361. package/views/Attribution.js +5 -5
  362. package/views/DOMContainer.d.ts +2 -1
  363. package/views/MapView.d.ts +1 -0
  364. package/views/SceneView.js +1 -1
  365. package/views/View2D.js +1 -1
  366. package/views/ViewingMode.js +1 -1
  367. package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
  368. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  369. package/views/draw/DrawAction.js +1 -1
  370. package/views/draw/DrawGraphicTool.js +1 -1
  371. package/views/draw/DrawOperation.js +1 -1
  372. package/views/draw/DrawTool.js +1 -1
  373. package/views/draw/SegmentDrawAction.js +1 -1
  374. package/views/draw/support/Reshape.js +1 -1
  375. package/views/draw/support/helpMessageUtils.js +1 -1
  376. package/views/draw/support/managers/EditSessionManager.js +1 -1
  377. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  378. package/views/interactive/dragEventPipeline.js +1 -1
  379. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  380. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  381. package/views/interactive/editGeometry/operations/AddOrUpdatePart.js +1 -1
  382. package/views/layers/support/editableLayerViews.js +1 -1
  383. package/views/overlay/TextOverlayItem.js +1 -1
  384. package/views/support/DefaultsFromMap.js +1 -1
  385. package/views/support/Scheduler.js +1 -1
  386. package/views/support/spatialReferenceSupport.js +1 -1
  387. package/views/webgl/Program.js +3 -3
  388. package/views/webgl/ShaderBuilder.js +23 -23
  389. package/views/webgl/ShaderTranspiler.js +2 -2
  390. package/webscene/Slide.js +1 -1
  391. package/webscene/VirtualLighting.d.ts +2 -4
  392. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  393. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  394. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +17 -1
  395. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  396. package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +7 -0
  397. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  398. package/widgets/BatchAttributeForm.js +1 -1
  399. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  400. package/widgets/Editor/workflowUtils.js +1 -1
  401. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  402. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  403. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  404. package/widgets/FeatureForm.js +1 -1
  405. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  406. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  407. package/widgets/Measurement.js +1 -1
  408. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  409. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  410. package/widgets/Search/support/layerSearchUtils.js +1 -1
  411. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  412. package/widgets/Sketch/SketchViewModel.js +1 -1
  413. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  414. package/widgets/UtilityNetworkAssociations.js +1 -1
  415. package/widgets/Weather/WeatherViewModel.js +1 -1
  416. package/widgets/Weather/css.js +1 -1
  417. package/widgets/Weather.js +1 -1
  418. package/widgets/support/ContingentValuesManager.js +1 -1
  419. package/widgets/support/forms/types.d.ts +23 -1
  420. package/assets/esri/core/workers/chunks/021bd07b9a3e70598840.js +0 -1
  421. package/assets/esri/core/workers/chunks/032733b863426c5bde00.js +0 -1121
  422. package/assets/esri/core/workers/chunks/144f18a3dd2c8cf07cf7.js +0 -1
  423. package/assets/esri/core/workers/chunks/170e68624b71ac96de4a.js +0 -1
  424. package/assets/esri/core/workers/chunks/23fc1c1ed483ed3b2298.js +0 -1
  425. package/assets/esri/core/workers/chunks/2634927d26cb1139c6d0.js +0 -1
  426. package/assets/esri/core/workers/chunks/2d1b8154ee40afc9d40b.js +0 -1
  427. package/assets/esri/core/workers/chunks/2d3e977f3b75474d7ebc.js +0 -1
  428. package/assets/esri/core/workers/chunks/4a41bf3d1e2e9bb79771.js +0 -2
  429. package/assets/esri/core/workers/chunks/5f324d88785ffcb73ae0.js +0 -1
  430. package/assets/esri/core/workers/chunks/70695e0fb53018d48e7b.js +0 -2
  431. package/assets/esri/core/workers/chunks/723c9ad4c25be2b82476.js +0 -1
  432. package/assets/esri/core/workers/chunks/766a1357be2ed7f4e125.js +0 -1
  433. package/assets/esri/core/workers/chunks/817bf487df056da1e6ec.js +0 -1
  434. package/assets/esri/core/workers/chunks/89e55895683369b5277a.js +0 -1
  435. package/assets/esri/core/workers/chunks/8a820e303941b351de81.js +0 -1
  436. package/assets/esri/core/workers/chunks/8c94e987754b3919181e.js +0 -1
  437. package/assets/esri/core/workers/chunks/90d567e920b6982b402d.js +0 -1
  438. package/assets/esri/core/workers/chunks/919115788da38049aea7.js +0 -2
  439. package/assets/esri/core/workers/chunks/97cdcedfe853280f6258.js +0 -1
  440. package/assets/esri/core/workers/chunks/9ebc6026934400fc1e1f.js +0 -1
  441. package/assets/esri/core/workers/chunks/b33e7e74cf8fa3926617.js +0 -1
  442. package/assets/esri/core/workers/chunks/b4a325dcf50e276751d7.js +0 -1
  443. package/assets/esri/core/workers/chunks/bb2af16e55cb39163827.js +0 -1
  444. package/assets/esri/core/workers/chunks/be5857b0d1b00faf430b.js +0 -1
  445. package/assets/esri/core/workers/chunks/cd9100a7c8309dfa7569.js +0 -1
  446. package/assets/esri/core/workers/chunks/d5bb9f9b7b341c671525.js +0 -1
  447. package/assets/esri/core/workers/chunks/d96e63d66f7b1f4ea54a.js +0 -2
  448. package/assets/esri/core/workers/chunks/e3bcd2e356f75afc316a.js +0 -1
  449. package/assets/esri/core/workers/chunks/e507dfc4788295d9c244.js +0 -1
  450. package/assets/esri/core/workers/chunks/e58f51618251f74aaafd.js +0 -1
  451. package/assets/esri/core/workers/chunks/e80526571f1a34de3278.js +0 -1
  452. package/assets/esri/core/workers/chunks/e83806797979138fd22a.js +0 -1
  453. package/assets/esri/core/workers/chunks/ea71850ba87ae6038000.js +0 -1
  454. package/assets/esri/core/workers/chunks/f537a5e808dc546813c7.js +0 -1
  455. package/assets/esri/core/workers/chunks/fe811d651d201f698b8f.js +0 -2
  456. package/chunks/NativeLine.glsl.js +0 -8
  457. package/layers/geospatialPDF/geospatialPDFParserUtils.js +0 -2
  458. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +0 -2
  459. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +0 -2
  460. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +0 -2
  461. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +0 -2
  462. /package/assets/esri/core/workers/chunks/{919115788da38049aea7.js.LICENSE.txt → 3d851710f7fcc27c5b60.js.LICENSE.txt} +0 -0
  463. /package/assets/esri/core/workers/chunks/{fe811d651d201f698b8f.js.LICENSE.txt → 5bdd95eeb8f34dbf26f2.js.LICENSE.txt} +0 -0
  464. /package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js.LICENSE.txt → 5e47026c681238038955.js.LICENSE.txt} +0 -0
  465. /package/assets/esri/core/workers/chunks/{4a41bf3d1e2e9bb79771.js.LICENSE.txt → d7763c42754152510e13.js.LICENSE.txt} +0 -0
  466. /package/assets/esri/core/workers/chunks/{d96e63d66f7b1f4ea54a.js.LICENSE.txt → e96fa029acba59c04e4e.js.LICENSE.txt} +0 -0
  467. /package/assets/esri/core/workers/chunks/{70695e0fb53018d48e7b.js.LICENSE.txt → fdfbd201be372d3796bf.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import n from"../../../../core/Accessor.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{equals as a}from"../../../../core/arrayUtils.js";import{cyclicalPI as o}from"../../../../core/Cyclical.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as c,normalize as l,subtract as u,cross as d,dot as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p,fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{destroyMaybe as h}from"../../../../core/maybe.js";import{isPromiseLike as g}from"../../../../core/promiseUtils.js";import{preferredVolumePrecision as _,formatDecimal as v}from"../../../../core/quantityFormatUtils.js";import{initial as y}from"../../../../core/reactiveUtils.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import{adaptiveVolumeUnit as x}from"../../../../core/units.js";import{computeTranslationToOriginAndRotation as S}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{t as C}from"../../../../chunks/vec3.js";import{angleAroundAxis as w}from"../../../../geometry/support/vector.js";import{onLocaleChange as T,substitute as E,fetchMessageBundle as D}from"../../../../intl.js";import O from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as k}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as A}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as j}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as M}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as N}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as P}from"../../layers/graphics/extrudePolygon.js";import{polygonToRenderInfoElevationAligned as F}from"../../support/renderInfoUtils/polygon.js";import{CutFill as I,VolumeGeometry as L}from"../../webgl-engine/lib/CutFill.js";import{createStipplePatternSimple as R}from"../../webgl-engine/materials/lineStippleUtils.js";let z=class extends n{get visible(){return this.viewData.visible&&this.viewData.elevationAlignedGeometry!=null&&this.viewData.targetGeometry!=null}get inView(){return this.viewData.analysisObb?.intersectsFrustum(this.view.frustum)??!1}get updating(){return this.loadingMessages||this._updatingHandles.updating}get hasUnsupportedError(){let{error:e}=this.viewData;return e?[`unsupported-coordinate-system`,`unsupported-layer-transparency`].includes(e.name):!1}get _extrusionHeights(){let{renderCoordsHelper:e}=this.view,{depthExtremaPositions:n,targetGeometry:r}=this.viewData,{targetElevationRange:i}=t;if(!r||!n)return{cut:i,fill:-i};let a=-1/0;for(let e of r.rings)for(let t of e)a=Math.max(a,t[2]);let o=e.getAltitude(n.fill);return{cut:i,fill:Math.min(o-a,0)-1}}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._updatingHandles=new b,this._elevationContext=N.fromElevationInfo(new O({mode:`absolute-height`})),this._projectionLines=[]}initialize(){let{view:e}=this,n={view:e,isDecoration:!0},r=t,i={...n,width:r.geometryOutlineWidth};this._elevationAlignedGeometry=new j({...i,isDraped:!0,color:r.geometryOutlineColor.toUnitRGBA()}),this._targetGeometry=new j(i);let a={...n,attached:!0,width:r.projectionLineWidth,renderOccluded:4,polygonOffset:3},o={...a,stipplePattern:R(r.projectionLineStippleSize)},s=r.cutProjectionLineColor.toUnitRGBA(),c=r.fillProjectionLineColor.toUnitRGBA();this._cutProjectionLines=new A({...a,color:s}),this._occludedCutProjectionLines=new A({...o,color:s}),this._fillProjectionLines=new A({...a,color:c,renderOccluded:8}),this._occludedFillProjectionLines=new A({...o,color:c});let l={...n,attached:!0};this._cutVolumeLabel=new k({...l,distance:r.labelDistance}),this._fillVolumeLabel=new k({...l,distance:-r.labelDistance}),this._visualization=new I({view:e,cutColor:r.cutColor,fillColor:r.fillColor,borderColor:r.geometryOutlineColor}),this.addHandles([this._updatingHandles.add(()=>({elevationAlignedGeometry:this.viewData.elevationAlignedGeometry,targetGeometry:this.viewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},y),this._updatingHandles.add(()=>({interactive:this.viewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:n})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&n===`cut-fill`,this._visualization.measureType=n},y),this._updatingHandles.add(()=>({elevationAlignedGeometry:this.viewData.elevationAlignedGeometry,targetGeometry:this.viewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:n})=>this._updateProjectionLines(e,t,n),y),this._updatingHandles.add(()=>({interactive:this.viewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.viewData.result}),({interactive:e,accentColor:t,hasResult:n})=>{this._updateColors(e,t,n)},y),this._updatingHandles.add(()=>[this.viewData.targetGeometry,this.inView,this._extrusionHeights,this._polygonRenderInfo],()=>this._updateCutFillGeometry(),y),this._updatingHandles.add(()=>this.visible&&this.inView&&this.view.state.camera.aboveGround&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),y),this._updatingHandles.add(()=>{let{messages:e,unitsMessages:t,visible:n,viewData:r}=this;return{depthExtremaPositions:r.depthExtremaPositions,effectiveDisplayUnits:r.effectiveDisplayUnits,messages:e,unitsMessages:t,result:r.result,visible:n&&!!r.result}},e=>this._updateLabels(e)),this._updatingHandles.add(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e),y),T(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=h(this._elevationAlignedGeometry),this._targetGeometry=h(this._targetGeometry),this._cutProjectionLines=h(this._cutProjectionLines),this._occludedCutProjectionLines=h(this._occludedCutProjectionLines),this._fillProjectionLines=h(this._fillProjectionLines),this._occludedFillProjectionLines=h(this._occludedFillProjectionLines),this._cutVolumeLabel=h(this._cutVolumeLabel),this._fillVolumeLabel=h(this._fillVolumeLabel),this._visualization.destroy(),this._updatingHandles.destroy()}_updateProjectionLines(e,t,n){if(this._cutProjectionLines.visible=n,this._occludedCutProjectionLines.visible=n,this._fillProjectionLines.visible=n,this._occludedFillProjectionLines.visible=n,!e||!t)return;let{renderCoordsHelper:r}=this.view,i=[],o=[],s=[],l=[],u=[],d=e.spatialReference;for(let n=0;n<e.rings.length;n++){let f=e.rings[n],m=f.length>1&&a(f[0],f[f.length-1]),h=f.length-+!!m,g=[];for(let e=0;e<h;++e){let i=f[e],a=c(p(),i[0],i[1],i[2]);r.toRenderCoords(a,d,a);let o=t.rings[n][e],s=c(p(),o[0],o[1],o[2]);r.toRenderCoords(s,d,s);let l=new M(a,s);g.push(l)}let _=this.view.state.camera;for(let e=0;e<g.length;++e){let r=g[e],a=g[e===0?g.length-1:e-1],c=g[e===g.length-1?0:e+1],d=f[e],p=t.rings[n][e],m=d[2]>p[2],h=new V(r,a,c,m);i.push(h),h.updateOccluded(_);let v=h.isOccluded;m?(v?s:o).push(r):(v?u:l).push(r)}}this._projectionLines=i,this._cutProjectionLines.setGeometryFromSegments(o),this._occludedCutProjectionLines.setGeometryFromSegments(s),this._fillProjectionLines.setGeometryFromSegments(l),this._occludedFillProjectionLines.setGeometryFromSegments(u)}_updateProjectionLineOcclusion(e){let t=[],n=[],r=[],i=[],a=!1,o=!1;for(let s of this._projectionLines){s.updateOccluded(e)&&(a||=s.isCut,o||=!s.isCut);let c=s.isOccluded;(s.isCut?c?n:t:c?i:r).push(s.segment)}o&&(this._fillProjectionLines.setGeometryFromSegments(r),this._occludedFillProjectionLines.setGeometryFromSegments(i)),a&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(n))}_updateColors(e,n,r){let{geometryOutlineColor:i,cutColor:a,fillColor:o,cutColorMuted:s,fillColorMuted:c,cutProjectionLineColor:l,fillProjectionLineColor:u}=t;if(this._visualization.cutColor=r?a:s,this._visualization.fillColor=r?o:c,e){let e=n.toUnitRGBA();this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._visualization.borderColor=n}else{this._targetGeometry.color=i.toUnitRGBA();let e=(r?l:s).toUnitRGBA();this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;let t=(r?u:c).toUnitRGBA();this._fillProjectionLines.color=t,this._occludedFillProjectionLines.color=t,this._visualization.borderColor=i}}_updateLabels(e){let{effectiveDisplayUnits:t,depthExtremaPositions:n,messages:r,unitsMessages:i,result:a,visible:o}=e;if(this._cutVolumeLabel.visible=o,this._fillVolumeLabel.visible=o,this._cutVolumeLabel.geometry=n?{type:`point`,point:n.cut}:null,this._fillVolumeLabel.geometry=n?{type:`point`,point:n.fill}:null,a==null||r==null||i==null){this._cutVolumeLabel.text=`-`,this._fillVolumeLabel.text=`-`;return}let s=t.volume,c=E(r.labels.cut,{volume:B(i,a.cutVolume,s)}),l=E(r.labels.fill,{volume:B(i,a.fillVolume,s)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=l}_updateCutFillVisibility(e){e?this._visualization.enable():this._visualization.disable()}get _polygonRenderInfo(){let{renderCoordsHelper:e,elevationProvider:t}=this.view,{targetGeometry:n}=this.viewData;if(n==null)return null;let r=F(n,t,e,this._elevationContext,{outlineOutput:`tessellated-indices`});return g(r)?(this._updatingHandles.consumePromise(r),null):r}_updateCutFillGeometry(){let{view:e,viewData:t,inView:n}=this,{renderCoordsHelper:r}=e,{targetGeometry:i}=t,{cut:a,fill:o}=this._extrusionHeights;if(!i?.extent||!n)return;let{center:s}=i.extent,c=m(s.x,s.y,0),l=p();r.toRenderCoords(c,i.spatialReference,l);let u=this._getExtrudedVolume(a,c,l),d=this._getExtrudedVolume(o,c,l);u!=null&&d!=null&&this._visualization.updateGeometries(u,d,l)}_getExtrudedVolume(e,t,n){let{renderCoordsHelper:r,spatialReference:i}=this.view,a=p(),o=r.viewingMode===1;r.worldUpAtPosition(n,a);let c=P(this._polygonRenderInfo,{height:e,worldUp:a,spherical:o,requireElevation:!1,requireNormals:!0,requireSizes:!1});if(c==null)return null;let l=s(),u=s();if(S(i,t,l,r.spatialReference),u[12]=-l[12],u[13]=-l[13],u[14]=-l[14],C(c.vertices,c.vertices,u),this.analysis.measureType===`stockpile`)for(let e=0;e<c.normals.length;e+=3)c.normals[e]=a[0],c.normals[e+1]=a[1],c.normals[e+2]=a[2];return new L(c.vertices,c.bottomIndices,c.indices,c.normals)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await D(`esri/core/t9n/Units`),this.messages=await D(`esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis`)}finally{this.loadingMessages=!1}}};e([r({constructOnly:!0})],z.prototype,`view`,void 0),e([r({constructOnly:!0})],z.prototype,`analysis`,void 0),e([r({constructOnly:!0})],z.prototype,`viewData`,void 0),e([r()],z.prototype,`unitsMessages`,void 0),e([r()],z.prototype,`messages`,void 0),e([r()],z.prototype,`loadingMessages`,void 0),e([r({readOnly:!0})],z.prototype,`_updatingHandles`,void 0),e([r({readOnly:!0})],z.prototype,`visible`,null),e([r()],z.prototype,`inView`,null),e([r()],z.prototype,`updating`,null),e([r()],z.prototype,`hasUnsupportedError`,null),e([r()],z.prototype,`_extrusionHeights`,null),e([r()],z.prototype,`_polygonRenderInfo`,null),z=e([i(`esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementVisualization`)],z);function B(e,t,n){if(!t||!e)return null;let r=x(t.value,t.unit,n),i=_(r);return v(e,t,r,i)}class V{constructor(e,t,n,r){this.segment=e,this.previous=t,this.next=n,this.isCut=r,this._isOccluded=!1,this._n1=p(),this._n2=p();let i=l(H,u(H,e.endRenderSpace,e.startRenderSpace));l(this._n1,d(this._n1,i,l(U,u(U,t.startRenderSpace,e.startRenderSpace)))),l(this._n2,d(this._n2,i,l(U,u(U,e.startRenderSpace,n.startRenderSpace)))),this._isConvex=o.normalize(w(this._n1,this._n2,i))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){u(H,this.segment.startRenderSpace,e.eye);let t=f(this._n1,H)<0,n=f(this._n2,H)<0,r=this._isOccluded;return this._isOccluded=this._isConvex?t&&n:t||n,this._isOccluded!==r}}const H=p(),U=p();export{z as VolumeMeasurementVisualization};
2
+ import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import n from"../../../../core/Accessor.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{equals as a}from"../../../../core/arrayUtils.js";import{cyclicalPI as o}from"../../../../core/Cyclical.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as c,normalize as l,subtract as u,cross as d,dot as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p,fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{destroyMaybe as h}from"../../../../core/maybe.js";import{isPromiseLike as g}from"../../../../core/promiseUtils.js";import{preferredVolumePrecision as _,formatDecimal as v}from"../../../../core/quantityFormatUtils.js";import{initial as y}from"../../../../core/reactiveUtils.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import{adaptiveVolumeUnit as x}from"../../../../core/units.js";import{computeTranslationToOriginAndRotation as S}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{t as C}from"../../../../chunks/vec3.js";import{angleAroundAxis as w}from"../../../../geometry/support/vector.js";import{onLocaleChange as T,substitute as E,fetchMessageBundle as D}from"../../../../intl.js";import O from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as k}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as A}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as j}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as M}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as N}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as P}from"../../layers/graphics/extrudePolygon.js";import{polygonToRenderInfoElevationAligned as F}from"../../support/renderInfoUtils/polygon.js";import{CutFill as I,VolumeGeometry as L}from"../../webgl-engine/lib/CutFill.js";import{createStipplePatternSimple as R}from"../../webgl-engine/materials/lineStippleUtils.js";let z=class extends n{get visible(){return this.viewData.visible&&this.viewData.elevationAlignedGeometry!=null&&this.viewData.targetGeometry!=null}get inView(){return this.viewData.analysisObb?.intersectsFrustum(this.view.frustum)??!1}get updating(){return this.loadingMessages||this._updatingHandles.updating}get hasUnsupportedError(){let{error:e}=this.viewData;return e?[`unsupported-coordinate-system`,`unsupported-layer-transparency`].includes(e.name):!1}get _extrusionHeights(){let{renderCoordsHelper:e}=this.view,{depthExtremaPositions:n,targetGeometry:r}=this.viewData,{targetElevationRange:i}=t;if(!r||!n)return{cut:i,fill:-i};let a=-1/0;for(let e of r.rings)for(let t of e)a=Math.max(a,t[2]);let o=e.getAltitude(n.fill);return{cut:i,fill:Math.min(o-a,0)-1}}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._updatingHandles=new b,this._elevationContext=N.fromElevationInfo(new O({mode:`absolute-height`})),this._projectionLines=[]}initialize(){let{view:e}=this,n={view:e,isDecoration:!0},r=t,i={...n,width:r.geometryOutlineWidth};this._elevationAlignedGeometry=new j({...i,isDraped:!0,color:r.geometryOutlineColor.toUnitRGBA()}),this._targetGeometry=new j(i);let a={...n,attached:!0,width:r.projectionLineWidth,renderOccluded:4,polygonOffset:3},o={...a,stipplePattern:R(r.projectionLineStippleSize)},s=r.cutProjectionLineColor.toUnitRGBA(),c=r.fillProjectionLineColor.toUnitRGBA();this._cutProjectionLines=new A({...a,color:s}),this._occludedCutProjectionLines=new A({...o,color:s}),this._fillProjectionLines=new A({...a,color:c,renderOccluded:8}),this._occludedFillProjectionLines=new A({...o,color:c});let l={...n,attached:!0};this._cutVolumeLabel=new k({...l,distance:r.labelDistance}),this._fillVolumeLabel=new k({...l,distance:-r.labelDistance}),this._visualization=new I({view:e,cutColor:r.cutColor,fillColor:r.fillColor,borderColor:r.geometryOutlineColor}),this.addHandles([this._updatingHandles.add(()=>({elevationAlignedGeometry:this.viewData.elevationAlignedGeometry,targetGeometry:this.viewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},y),this._updatingHandles.add(()=>({interactive:this.viewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:n})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&n===`cut-fill`,this._visualization.measureType=n},y),this._updatingHandles.add(()=>({elevationAlignedGeometry:this.viewData.elevationAlignedGeometry,targetGeometry:this.viewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:n})=>this._updateProjectionLines(e,t,n),y),this._updatingHandles.add(()=>({interactive:this.viewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.viewData.result}),({interactive:e,accentColor:t,hasResult:n})=>{this._updateColors(e,t,n)},y),this._updatingHandles.add(()=>[this.viewData.targetGeometry,this.inView,this._extrusionHeights,this._polygonRenderInfo],()=>this._updateCutFillGeometry(),y),this._updatingHandles.add(()=>this.visible&&this.inView&&this.view.state.camera.aboveGround&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),y),this._updatingHandles.add(()=>{let{messages:e,unitsMessages:t,visible:n,viewData:r}=this;return{depthExtremaPositions:r.depthExtremaPositions,effectiveDisplayUnits:r.effectiveDisplayUnits,messages:e,unitsMessages:t,result:r.result,visible:n&&!!r.result}},e=>this._updateLabels(e)),this._updatingHandles.add(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e),y),T(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=h(this._elevationAlignedGeometry),this._targetGeometry=h(this._targetGeometry),this._cutProjectionLines=h(this._cutProjectionLines),this._occludedCutProjectionLines=h(this._occludedCutProjectionLines),this._fillProjectionLines=h(this._fillProjectionLines),this._occludedFillProjectionLines=h(this._occludedFillProjectionLines),this._cutVolumeLabel=h(this._cutVolumeLabel),this._fillVolumeLabel=h(this._fillVolumeLabel),this._visualization.destroy(),this._updatingHandles.destroy()}_updateProjectionLines(e,t,n){if(this._cutProjectionLines.visible=n,this._occludedCutProjectionLines.visible=n,this._fillProjectionLines.visible=n,this._occludedFillProjectionLines.visible=n,!e||!t)return;let{renderCoordsHelper:r}=this.view,i=[],o=[],s=[],l=[],u=[],d=e.spatialReference;for(let n=0;n<e.rings.length;n++){let f=e.rings[n],m=f.length>1&&a(f[0],f[f.length-1]),h=f.length-+!!m,g=[];for(let e=0;e<h;++e){let i=f[e],a=c(p(),i[0],i[1],i[2]);r.toRenderCoords(a,d,a);let o=t.rings[n][e],s=c(p(),o[0],o[1],o[2]);r.toRenderCoords(s,d,s);let l=new M(a,s);g.push(l)}let _=this.view.state.camera;for(let e=0;e<g.length;++e){let r=g[e],a=g[e===0?g.length-1:e-1],c=g[e===g.length-1?0:e+1],d=f[e],p=t.rings[n][e],m=d[2]>p[2],h=new V(r,a,c,m);i.push(h),h.updateOccluded(_);let v=h.isOccluded;m?(v?s:o).push(r):(v?u:l).push(r)}}this._projectionLines=i,this._cutProjectionLines.setGeometryFromSegments(o),this._occludedCutProjectionLines.setGeometryFromSegments(s),this._fillProjectionLines.setGeometryFromSegments(l),this._occludedFillProjectionLines.setGeometryFromSegments(u)}_updateProjectionLineOcclusion(e){let t=[],n=[],r=[],i=[],a=!1,o=!1;for(let s of this._projectionLines){s.updateOccluded(e)&&(a||=s.isCut,o||=!s.isCut);let c=s.isOccluded;(s.isCut?c?n:t:c?i:r).push(s.segment)}o&&(this._fillProjectionLines.setGeometryFromSegments(r),this._occludedFillProjectionLines.setGeometryFromSegments(i)),a&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(n))}_updateColors(e,n,r){let{geometryOutlineColor:i,cutColor:a,fillColor:o,cutColorMuted:s,fillColorMuted:c,cutProjectionLineColor:l,fillProjectionLineColor:u}=t;if(this._visualization.cutColor=r?a:s,this._visualization.fillColor=r?o:c,e){let e=n.toUnitRGBA();this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._visualization.borderColor=n}else{this._targetGeometry.color=i.toUnitRGBA();let e=(r?l:s).toUnitRGBA();this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;let t=(r?u:c).toUnitRGBA();this._fillProjectionLines.color=t,this._occludedFillProjectionLines.color=t,this._visualization.borderColor=i}}_updateLabels(e){let{effectiveDisplayUnits:t,depthExtremaPositions:n,messages:r,unitsMessages:i,result:a,visible:o}=e;if(this._cutVolumeLabel.visible=o,this._fillVolumeLabel.visible=o,this._cutVolumeLabel.geometry=n?{type:`point`,point:n.cut}:null,this._fillVolumeLabel.geometry=n?{type:`point`,point:n.fill}:null,a==null||r==null||i==null){this._cutVolumeLabel.text=`-`,this._fillVolumeLabel.text=`-`;return}let s=t.volume,c=E(r.labels.cut,{volume:B(i,a.cutVolume,s)}),l=E(r.labels.fill,{volume:B(i,a.fillVolume,s)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=l}_updateCutFillVisibility(e){e?this._visualization.enable():this._visualization.disable()}get _polygonRenderInfo(){let{renderCoordsHelper:e,elevationProvider:t}=this.view,{targetGeometry:n}=this.viewData;if(n==null)return null;let r=F(n,t,e,this._elevationContext,{outlineOutput:`tessellated-indices`});return g(r)?(this._updatingHandles.consumePromise(r),null):r}_updateCutFillGeometry(){let{view:e,viewData:t,inView:n}=this,{renderCoordsHelper:r}=e,{targetGeometry:i}=t,{cut:a,fill:o}=this._extrusionHeights;if(!i?.extent||!n)return;let{center:s}=i.extent,c=m(s.x,s.y,0),l=p();r.toRenderCoords(c,i.spatialReference,l);let u=this._getExtrudedVolume(a,c,l),d=this._getExtrudedVolume(o,c,l);u!=null&&d!=null&&this._visualization.updateGeometries(u,d,l)}_getExtrudedVolume(e,t,n){let{renderCoordsHelper:r,spatialReference:i}=this.view,a=p(),o=r.isGlobal;r.worldUpAtPosition(n,a);let c=P(this._polygonRenderInfo,{height:e,worldUp:a,spherical:o,requireElevation:!1,requireNormals:!0,requireSizes:!1});if(c==null)return null;let l=s(),u=s();if(S(i,t,l,r.spatialReference),u[12]=-l[12],u[13]=-l[13],u[14]=-l[14],C(c.vertices,c.vertices,u),this.analysis.measureType===`stockpile`)for(let e=0;e<c.normals.length;e+=3)c.normals[e]=a[0],c.normals[e+1]=a[1],c.normals[e+2]=a[2];return new L(c.vertices,c.bottomIndices,c.indices,c.normals)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await D(`esri/core/t9n/Units`),this.messages=await D(`esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis`)}finally{this.loadingMessages=!1}}};e([r({constructOnly:!0})],z.prototype,`view`,void 0),e([r({constructOnly:!0})],z.prototype,`analysis`,void 0),e([r({constructOnly:!0})],z.prototype,`viewData`,void 0),e([r()],z.prototype,`unitsMessages`,void 0),e([r()],z.prototype,`messages`,void 0),e([r()],z.prototype,`loadingMessages`,void 0),e([r({readOnly:!0})],z.prototype,`_updatingHandles`,void 0),e([r({readOnly:!0})],z.prototype,`visible`,null),e([r()],z.prototype,`inView`,null),e([r()],z.prototype,`updating`,null),e([r()],z.prototype,`hasUnsupportedError`,null),e([r()],z.prototype,`_extrusionHeights`,null),e([r()],z.prototype,`_polygonRenderInfo`,null),z=e([i(`esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementVisualization`)],z);function B(e,t,n){if(!t||!e)return null;let r=x(t.value,t.unit,n),i=_(r);return v(e,t,r,i)}class V{constructor(e,t,n,r){this.segment=e,this.previous=t,this.next=n,this.isCut=r,this._isOccluded=!1,this._n1=p(),this._n2=p();let i=l(H,u(H,e.endRenderSpace,e.startRenderSpace));l(this._n1,d(this._n1,i,l(U,u(U,t.startRenderSpace,e.startRenderSpace)))),l(this._n2,d(this._n2,i,l(U,u(U,e.startRenderSpace,n.startRenderSpace)))),this._isConvex=o.normalize(w(this._n1,this._n2,i))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){u(H,this.segment.startRenderSpace,e.eye);let t=f(this._n1,H)<0,n=f(this._n2,H)<0,r=this._isOccluded;return this._isOccluded=this._isConvex?t&&n:t||n,this._isOccluded!==r}}const H=p(),U=p();export{z as VolumeMeasurementVisualization};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{transpose as e}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{length as n,distance as r,lerp as i,copy as a,subtract as o,transformMat3 as s,scale as c,cross as l,dot as u,add as d,normalize as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p,clone as m,UNIT_Y as h,UNIT_X as g,UNIT_Z as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{lerp as v}from"../../../../core/mathUtils.js";import{angle as y,slerp as b}from"../../support/mathUtils.js";class x{get pitch(){return this._pitch}get yaw(){return this._yaw}get distance(){return this._distance}get fov(){return this._fov}get size(){return this._size}constructor(e){this.viewingMode=e,this.center=p(),this._pitch=0,this._yaw=0,this._distance=0,this.direction=m(j),this._fov=55,this._size=1}pixelsPerPanAtZoom(e){return this._size/2/(this._zoomToPanScale*e)}zoomAtPixelsPerPan(e){return this._size/2/(this._zoomToPanScale*e)}pixelsPerRotate(){let e=Math.max(Math.cos(Math.abs(this._pitch)),.5);return this._size/2/e}compareTo(e,t){if(this.viewingMode===1){let r=(n(this.center)+n(e.center))/2;t.pan=y(this.center,e.center)*r}else t.pan=r(this.center,e.center);let i=Math.abs(e._yaw-this._yaw);i>=Math.PI&&(i=2*Math.PI-i);let a=Math.abs(e._pitch-this._pitch);t.rotate=Math.max(i,a),t.fov=e.fov-this.fov,t.sourceZoom=this._distance,t.targetZoom=e._distance}interpolate(e,t,n){this.viewingMode===1?b(e.center,t.center,n.pan,this.center):i(this.center,e.center,t.center,n.pan),this._distance=isFinite(t.distance)?v(e.distance,t.distance+n.zoomOffset,n.zoom):e.distance,this._pitch=v(e.pitch,t.pitch,n.rotate);let r=e._yaw,a=t._yaw;Math.abs(a-r)>=Math.PI&&(r+=(r<a?1:-1)*2*Math.PI),this._yaw=v(r,a,n.rotate),this._fov=v(e.fov,t.fov,n.fov)}copyFrom(e){a(this.center,e.center),this._pitch=e.pitch,this._yaw=e.yaw,this._distance=e.distance,a(this.direction,e.direction),this._size=e.size,this._fov=e.fov,this._zoomToPanScale=Math.atan(.5*this._fov),this.viewingMode=e.viewingMode}copyFromRenderCamera(e){let t=this._lookAtOrientation(e.center,N);a(this.center,e.center),o(D,e.center,e.eye),s(D,D,t),s(O,e.up,t),this._distance=n(D),this._distance!==0&&(D[0]/=this._distance,D[1]/=this._distance,D[2]/=this._distance),this._pitch=S(D),this._yaw=C(D,O),this._size=Math.sqrt(e.width*e.width+e.height*e.height),this._fov=e.fov,this._zoomToPanScale=Math.atan(.5*this._fov)}copyToRenderCamera(t){let n=this._lookAtOrientation(this.center,N);e(n,n),this._axisAngleVec3(M,this._pitch-Math.PI/2,j,D),this._axisAngleVec3(A,this._yaw,D,D),this._axisAngleVec3(M,this._pitch-Math.PI/2,A,O),this._axisAngleVec3(A,this._yaw,O,O),c(D,D,this._distance),s(D,D,n),s(O,O,n),t.center=this.center,t.eye=o(D,this.center,D),t.up=O,t.fov=this._fov}_axisAngleVec3(e,t,n,r){let i=Math.cos(t),a=Math.sin(t);return c(w,n,i),l(T,e,n),c(T,T,a),c(E,e,(1-i)*u(e,n)),d(r,d(r,w,T),E)}_lookAtOrientation(e,n=t()){return this._upAtLookAt(e,E),l(w,this.direction,E),f(w,w),w[0]===0&&w[1]===0&&w[2]===0&&a(w,M),l(T,E,w),f(T,T),n[0]=w[0],n[1]=T[0],n[2]=E[0],n[3]=w[1],n[4]=T[1],n[5]=E[1],n[6]=w[2],n[7]=T[2],n[8]=E[2],n}_upAtLookAt(e,t){return this.viewingMode===2?a(t,A):f(t,e)}}function S(e){return Math.PI-y(A,e)}function C(e,t){let n=k;return Math.abs(t[2])<.5?(a(n,t),e[2]>0&&c(n,n,-1)):a(n,e),l(T,n,A),f(T,T),y(M,T,A)}const w=p(),T=p(),E=p(),D=p(),O=p(),k=p(),A=_,j=h,M=g,N=t();export{x as Camera};
2
+ import{transpose as e}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{length as n,distance as r,lerp as i,copy as a,subtract as o,transformMat3 as s,scale as c,cross as l,dot as u,add as d,normalize as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p,clone as m,UNIT_Y as h,UNIT_X as g,UNIT_Z as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{lerp as v}from"../../../../core/mathUtils.js";import{angle as y,slerp as b}from"../../support/mathUtils.js";class x{get pitch(){return this._pitch}get yaw(){return this._yaw}get distance(){return this._distance}get fov(){return this._fov}get size(){return this._size}constructor(e){this.isGlobal=e,this.center=p(),this._pitch=0,this._yaw=0,this._distance=0,this.direction=m(j),this._fov=55,this._size=1}pixelsPerPanAtZoom(e){return this._size/2/(this._zoomToPanScale*e)}zoomAtPixelsPerPan(e){return this._size/2/(this._zoomToPanScale*e)}pixelsPerRotate(){let e=Math.max(Math.cos(Math.abs(this._pitch)),.5);return this._size/2/e}compareTo(e,t){if(this.isGlobal){let r=(n(this.center)+n(e.center))/2;t.pan=y(this.center,e.center)*r}else t.pan=r(this.center,e.center);let i=Math.abs(e._yaw-this._yaw);i>=Math.PI&&(i=2*Math.PI-i);let a=Math.abs(e._pitch-this._pitch);t.rotate=Math.max(i,a),t.fov=e.fov-this.fov,t.sourceZoom=this._distance,t.targetZoom=e._distance}interpolate(e,t,n){this.isGlobal?b(e.center,t.center,n.pan,this.center):i(this.center,e.center,t.center,n.pan),this._distance=isFinite(t.distance)?v(e.distance,t.distance+n.zoomOffset,n.zoom):e.distance,this._pitch=v(e.pitch,t.pitch,n.rotate);let r=e._yaw,a=t._yaw;Math.abs(a-r)>=Math.PI&&(r+=(r<a?1:-1)*2*Math.PI),this._yaw=v(r,a,n.rotate),this._fov=v(e.fov,t.fov,n.fov)}copyFrom(e){a(this.center,e.center),this._pitch=e.pitch,this._yaw=e.yaw,this._distance=e.distance,a(this.direction,e.direction),this._size=e.size,this._fov=e.fov,this._zoomToPanScale=Math.atan(.5*this._fov),this.isGlobal=e.isGlobal}copyFromRenderCamera(e){let t=this._lookAtOrientation(e.center,N);a(this.center,e.center),o(D,e.center,e.eye),s(D,D,t),s(O,e.up,t),this._distance=n(D),this._distance!==0&&(D[0]/=this._distance,D[1]/=this._distance,D[2]/=this._distance),this._pitch=S(D),this._yaw=C(D,O),this._size=Math.sqrt(e.width*e.width+e.height*e.height),this._fov=e.fov,this._zoomToPanScale=Math.atan(.5*this._fov)}copyToRenderCamera(t){let n=this._lookAtOrientation(this.center,N);e(n,n),this._axisAngleVec3(M,this._pitch-Math.PI/2,j,D),this._axisAngleVec3(A,this._yaw,D,D),this._axisAngleVec3(M,this._pitch-Math.PI/2,A,O),this._axisAngleVec3(A,this._yaw,O,O),c(D,D,this._distance),s(D,D,n),s(O,O,n),t.center=this.center,t.eye=o(D,this.center,D),t.up=O,t.fov=this._fov}_axisAngleVec3(e,t,n,r){let i=Math.cos(t),a=Math.sin(t);return c(w,n,i),l(T,e,n),c(T,T,a),c(E,e,(1-i)*u(e,n)),d(r,d(r,w,T),E)}_lookAtOrientation(e,n=t()){return this._upAtLookAt(e,E),l(w,this.direction,E),f(w,w),w[0]===0&&w[1]===0&&w[2]===0&&a(w,M),l(T,E,w),f(T,T),n[0]=w[0],n[1]=T[0],n[2]=E[0],n[3]=w[1],n[4]=T[1],n[5]=E[1],n[6]=w[2],n[7]=T[2],n[8]=E[2],n}_upAtLookAt(e,t){return this.isGlobal?f(t,e):a(t,A)}}function S(e){return Math.PI-y(A,e)}function C(e,t){let n=k;return Math.abs(t[2])<.5?(a(n,t),e[2]>0&&c(n,n,-1)):a(n,e),l(T,n,A),f(T,T),y(M,T,A)}const w=p(),T=p(),E=p(),D=p(),O=p(),k=p(),A=_,j=h,M=g,N=t();export{x as Camera};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{fromRotation as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as n,transformMat4 as r,scale as i,add as a,squaredLength as o,distance as s,dot as c,normalize as l,length as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{acosClamped as f,clamp as p,asinClamped as m,deg2rad as h}from"../../../../core/mathUtils.js";import{getReferenceEllipsoid as g}from"../../../../geometry/ellipsoidUtils.js";import{Sphere as _}from"../../../../geometry/support/sphere.js";import{viewAngle as v}from"../../state/utils/viewUtils.js";import{defaultConstraintOptions as y,hasConstraintType as b,adjustRangeForInteraction as x}from"./common.js";function S(t,o,s,c=!0){W.eyeCenterDistance=0,W.requiresTwoSteps=!1;let l=C(t,o,s,y,W);if(l===0)return!1;switch(e(R,-l,o.viewRight),s.tiltMode){case 1:r(L,o.viewForward,R),i(L,L,W.eyeCenterDistance),o.center=a(z,o.eye,L);break;case 0:n(L,o.center,o.eye),r(L,L,R),o.eye=n(z,o.center,L);break;default:s.tiltMode}return o.up=r(z,o.up,R),W.requiresTwoSteps&&c?S(t,o,s,!1):!0}function C(e,t,n,r=y,i){if(!e.state.constraints.tilt)return 0;let a=Math.min(t.relativeElevation*V,t.distance),o=e.state.constraints.tilt(a,H);return F(e,n,o),r.interactionType===2&&b(r.selection,2)&&I(e,r.interactionStartCamera,o),n.tiltMode===1||r.tiltMode===1?T(e,t,o,i):w(e,t,o)}function w(e,t,n){let r=v(e.renderCoordsHelper,t.center,t.eye),i=r-p(r,n.min,n.max);return A(i)?i:0}function T(e,t,n,r){switch(r&&(r.requiresTwoSteps=!1),e.viewingMode){case`global`:return D(e,t,n,r);case`local`:return E(e,t,n,r)}}function E(e,t,n,r){let i=v(e.renderCoordsHelper,t.center,t.eye),a=p(i,n.min,n.max),o=i-a;if(!A(o))return 0;if(r){let n=Math.abs(e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude),i=e.renderCoordsHelper.getAltitude(t.eye)-n,o=Math.max(Math.cos(a),1e-4);r.eyeCenterDistance=Math.abs(o)>1e-4?i/o:t.distance}return o}function D(e,t,n,r){let i=O(e,t,U),a=p(i.tiltAtCenter,n.min,n.max);if(!A(i.tiltAtCenter-a))return 0;let o,s;return i.centerIsOnSurface?(o=j(i),s=N(i,o)):(o=i.constraints.clampTilt(i.distance,i.tiltAtCenter),r&&o<Math.PI/2&&(r.requiresTwoSteps=!0,o=Math.PI/2-1e-5),s=P(i,o)),r&&(r.eyeCenterDistance=M(i,o)),s}function O(e,t,n){let r=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,i=r+g(e.spatialReference).radius,a=e.renderCoordsHelper.intersectManifold(t.ray,r,z);return n.distance=Math.min(t.relativeElevation*V,t.distance),n.centerIsOnSurface=!1,a==null?e.state.isLocal?n.tiltAtCenter=v(e.renderCoordsHelper,t.center,t.eye):(k.radius=i,k.closestPointOnSilhouette(t.ray,z),n.distance=Math.min(t.relativeElevation*V,s(t.eye,z)),n.tiltAtCenter=f(-c(t.viewForward,l(z,z)))):(n.distance=Math.min(t.relativeElevation*V,s(t.eye,a)),n.tiltAtCenter=v(e.renderCoordsHelper,a,t.eye),n.centerIsOnSurface=!0),n.radius=i,n.eyeRadius=u(t.eye),n.constraints=e.state.constraints,n}const k=new _;function A(e){return Math.abs(e)>1e-9}function j(e){let{constraints:t,distance:n,tiltAtCenter:r}=e,i=r,a=t.clampTilt(n,r),o=M(e,a);if(t.clampTilt(o,r)===a)return a;let s=0;for(;s<10&&A(a-i);){let n=(i+a)/2,r=M(e,n);A(t.clampTilt(r,n)-n)?i=n:a=n,s++}return a}function M(e,t){if(!e.centerIsOnSurface)return e.distance;let n=Math.PI-p(t,0,Math.PI),r=m(e.radius/e.eyeRadius*Math.sin(n)),i=Math.PI-n-r,a=Math.sin(i)/Math.sin(n);if(e.eyeRadius<e.radius&&a>1){let t=Math.PI-r,i=Math.PI-n-t;return Math.sin(i)/Math.sin(n)*e.eyeRadius}return a*e.eyeRadius}function N(e,t){let n=m(e.radius/e.eyeRadius*Math.sin(e.tiltAtCenter)),r=m(e.radius/e.eyeRadius*Math.sin(t));return e.eyeRadius>e.radius?n-r:r-n}function P(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function F(e,t,n){if(t.interactionType===0)return;let{interactionStartCamera:r,interactionFactor:i}=t;if(!r)return;let{min:a,max:o}=n,s=C(e,r,y,t),c=s===0?0:v(e.renderCoordsHelper,r.center,r.eye);n.min=a,n.max=o,t.interactionType===2?(b(t.selection,2)&&I(e,r,n),x(s,c,!0,i,B,n)):x(s,c,!1,i,B,n)}function I(e,t,n){let r=e.state.constraints;if(e.state.isLocal||!r.altitude||!t)return;let i=o(t.center),a=Math.sqrt(i),s=t.distance,c=g(e.spatialReference).radius,l=r.altitude.min+c,u=r.altitude.max+c,d=(l*l-s*s-i)/(-2*a*s),p=(u*u-s*s-i)/(-2*a*s);n.min=Math.max(n.min,Math.min(Math.PI-f(p),n.max)),n.max=Math.min(n.max,Math.PI-f(d))}const L=d(),R=t(),z=d(),B=h(5),V=30,H={min:0,max:0},U={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,distance:0,tiltAtCenter:0},W={eyeCenterDistance:0,requiresTwoSteps:!1};export{S as applyTiltConstraint,C as getTiltConstraintError};
2
+ import{fromRotation as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as n,transformMat4 as r,scale as i,add as a,squaredLength as o,distance as s,dot as c,normalize as l,length as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{acosClamped as f,clamp as p,asinClamped as m,deg2rad as h}from"../../../../core/mathUtils.js";import{getReferenceEllipsoid as g}from"../../../../geometry/ellipsoidUtils.js";import{Sphere as _}from"../../../../geometry/support/sphere.js";import{viewAngle as v}from"../../state/utils/viewUtils.js";import{defaultConstraintOptions as y,hasConstraintType as b,adjustRangeForInteraction as x}from"./common.js";function S(t,o,s,c=!0){W.eyeCenterDistance=0,W.requiresTwoSteps=!1;let l=C(t,o,s,y,W);if(l===0)return!1;switch(e(R,-l,o.viewRight),s.tiltMode){case 1:r(L,o.viewForward,R),i(L,L,W.eyeCenterDistance),o.center=a(z,o.eye,L);break;case 0:n(L,o.center,o.eye),r(L,L,R),o.eye=n(z,o.center,L);break;default:s.tiltMode}return o.up=r(z,o.up,R),W.requiresTwoSteps&&c?S(t,o,s,!1):!0}function C(e,t,n,r=y,i){if(!e.state.constraints.tilt)return 0;let a=Math.min(t.relativeElevation*V,t.distance),o=e.state.constraints.tilt(a,H);return F(e,n,o),r.interactionType===2&&b(r.selection,2)&&I(e,r.interactionStartCamera,o),n.tiltMode===1||r.tiltMode===1?T(e,t,o,i):w(e,t,o)}function w(e,t,n){let r=v(e.renderCoordsHelper,t.center,t.eye),i=r-p(r,n.min,n.max);return A(i)?i:0}function T(e,t,n,r){return r&&(r.requiresTwoSteps=!1),e.state.isGlobal?D(e,t,n,r):E(e,t,n,r)}function E(e,t,n,r){let i=v(e.renderCoordsHelper,t.center,t.eye),a=p(i,n.min,n.max),o=i-a;if(!A(o))return 0;if(r){let n=Math.abs(e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude),i=e.renderCoordsHelper.getAltitude(t.eye)-n,o=Math.max(Math.cos(a),1e-4);r.eyeCenterDistance=Math.abs(o)>1e-4?i/o:t.distance}return o}function D(e,t,n,r){let i=O(e,t,U),a=p(i.tiltAtCenter,n.min,n.max);if(!A(i.tiltAtCenter-a))return 0;let o,s;return i.centerIsOnSurface?(o=j(i),s=N(i,o)):(o=i.constraints.clampTilt(i.distance,i.tiltAtCenter),r&&o<Math.PI/2&&(r.requiresTwoSteps=!0,o=Math.PI/2-1e-5),s=P(i,o)),r&&(r.eyeCenterDistance=M(i,o)),s}function O(e,t,n){let r=e.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,i=r+g(e.spatialReference).radius,a=e.renderCoordsHelper.intersectManifold(t.ray,r,z);return n.distance=Math.min(t.relativeElevation*V,t.distance),n.centerIsOnSurface=!1,a==null?e.state.isLocal?n.tiltAtCenter=v(e.renderCoordsHelper,t.center,t.eye):(k.radius=i,k.closestPointOnSilhouette(t.ray,z),n.distance=Math.min(t.relativeElevation*V,s(t.eye,z)),n.tiltAtCenter=f(-c(t.viewForward,l(z,z)))):(n.distance=Math.min(t.relativeElevation*V,s(t.eye,a)),n.tiltAtCenter=v(e.renderCoordsHelper,a,t.eye),n.centerIsOnSurface=!0),n.radius=i,n.eyeRadius=u(t.eye),n.constraints=e.state.constraints,n}const k=new _;function A(e){return Math.abs(e)>1e-9}function j(e){let{constraints:t,distance:n,tiltAtCenter:r}=e,i=r,a=t.clampTilt(n,r),o=M(e,a);if(t.clampTilt(o,r)===a)return a;let s=0;for(;s<10&&A(a-i);){let n=(i+a)/2,r=M(e,n);A(t.clampTilt(r,n)-n)?i=n:a=n,s++}return a}function M(e,t){if(!e.centerIsOnSurface)return e.distance;let n=Math.PI-p(t,0,Math.PI),r=m(e.radius/e.eyeRadius*Math.sin(n)),i=Math.PI-n-r,a=Math.sin(i)/Math.sin(n);if(e.eyeRadius<e.radius&&a>1){let t=Math.PI-r,i=Math.PI-n-t;return Math.sin(i)/Math.sin(n)*e.eyeRadius}return a*e.eyeRadius}function N(e,t){let n=m(e.radius/e.eyeRadius*Math.sin(e.tiltAtCenter)),r=m(e.radius/e.eyeRadius*Math.sin(t));return e.eyeRadius>e.radius?n-r:r-n}function P(e,t){return e.tiltAtCenter-Math.PI/2-(t-Math.PI/2)}function F(e,t,n){if(t.interactionType===0)return;let{interactionStartCamera:r,interactionFactor:i}=t;if(!r)return;let{min:a,max:o}=n,s=C(e,r,y,t),c=s===0?0:v(e.renderCoordsHelper,r.center,r.eye);n.min=a,n.max=o,t.interactionType===2?(b(t.selection,2)&&I(e,r,n),x(s,c,!0,i,B,n)):x(s,c,!1,i,B,n)}function I(e,t,n){let r=e.state.constraints;if(e.state.isLocal||!r.altitude||!t)return;let i=o(t.center),a=Math.sqrt(i),s=t.distance,c=g(e.spatialReference).radius,l=r.altitude.min+c,u=r.altitude.max+c,d=(l*l-s*s-i)/(-2*a*s),p=(u*u-s*s-i)/(-2*a*s);n.min=Math.max(n.min,Math.min(Math.PI-f(p),n.max)),n.max=Math.min(n.max,Math.PI-f(d))}const L=d(),R=t(),z=d(),B=h(5),V=30,H={min:0,max:0},U={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,distance:0,tiltAtCenter:0},W={eyeCenterDistance:0,requiresTwoSteps:!1};export{S as applyTiltConstraint,C as getTiltConstraintError};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{add as e,subtract as t}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as n,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{inOutCubic as i}from"../../animation/easing.js";import{applyAltitudeConstraint as a,getAltitudeConstraintError as o}from"./constraintUtils/altitude.js";import{hasConstraintType as s}from"./constraintUtils/common.js";import{ConstraintOptions as c}from"./constraintUtils/ConstraintOptions.js";import{applyDistanceConstraint as l,getDistanceConstraintError as u}from"./constraintUtils/distance.js";import{applySurfaceCollisionConstraint as d}from"./constraintUtils/surfaceCollision.js";import{applyTiltConstraint as f,getTiltConstraintError as p}from"./constraintUtils/tilt.js";function m(e,t,n=x,r=t,i=null){r!==t&&r.copyFrom(t),r.computeUp(e.state.viewingMode);let a=!1;for(let t=0;t<S;t++){let t=0;for(let i of b)if(s(n.selection,i.type)){let o=Math.abs(i.error(e,r,n));i.apply(e,r,n)&&(a=!0,t+=o)}if(t===0)break}i?.copyFrom(r);let o=s(n.selection,8),c=h(n.interactionType,e);return o&&d(e,null,r,c)&&(a=!0),a&&r.computeUp(e.state.viewingMode),a}function h(e,t){switch(e){case 4:case 6:return 1;case 5:return t.state.isGlobal?2:1;default:return 0}}function g(e){let t=Math.min(1,e/150);return i(t)}function _(e,t,n){return p(e,t,n)*t.distance}const v=r();function y(r,i,a){let o=n(i.eye);m(r,i,a),i.center=e(v,i.center,t(v,i.eye,o))}const b=[{type:1,error:_,apply:f},{type:2,error:o,apply:a},{type:4,error:u,apply:l}],x=new c,S=5;export{m as applyAll,y as applyConstraintsAndUpdateCenterRenderCamera,g as pixelDistanceToInteractionFactor};
2
+ import{add as e,subtract as t}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as n,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{inOutCubic as i}from"../../animation/easing.js";import{applyAltitudeConstraint as a,getAltitudeConstraintError as o}from"./constraintUtils/altitude.js";import{hasConstraintType as s}from"./constraintUtils/common.js";import{ConstraintOptions as c}from"./constraintUtils/ConstraintOptions.js";import{applyDistanceConstraint as l,getDistanceConstraintError as u}from"./constraintUtils/distance.js";import{applySurfaceCollisionConstraint as d}from"./constraintUtils/surfaceCollision.js";import{applyTiltConstraint as f,getTiltConstraintError as p}from"./constraintUtils/tilt.js";function m(e,t,n=x,r=t,i=null){r!==t&&r.copyFrom(t),r.computeUp(e.state.isGlobal);let a=!1;for(let t=0;t<S;t++){let t=0;for(let i of b)if(s(n.selection,i.type)){let o=Math.abs(i.error(e,r,n));i.apply(e,r,n)&&(a=!0,t+=o)}if(t===0)break}i?.copyFrom(r);let o=s(n.selection,8),c=h(n.interactionType,e);return o&&d(e,null,r,c)&&(a=!0),a&&r.computeUp(e.state.isGlobal),a}function h(e,t){switch(e){case 4:case 6:return 1;case 5:return t.state.isGlobal?2:1;default:return 0}}function g(e){let t=Math.min(1,e/150);return i(t)}function _(e,t,n){return p(e,t,n)*t.distance}const v=r();function y(r,i,a){let o=n(i.eye);m(r,i,a),i.center=e(v,i.center,t(v,i.eye,o))}const b=[{type:1,error:_,apply:f},{type:2,error:o,apply:a},{type:4,error:u,apply:l}],x=new c,S=5;export{m as applyAll,y as applyConstraintsAndUpdateCenterRenderCamera,g as pixelDistanceToInteractionFactor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{copy as e,squaredDistance as t,scale as n,subtract as r,add as i,length as a,dot as o,distance as s}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as u}from"../../../geometry/support/aaBoundingRect.js";import{scaleToDistanceAt as d}from"../support/cameraScaleUtils.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function p(e,t,n,r){return e.renderCoordsHelper.fromRenderCoords(t.eye,S,r)!=null&&u(n,S)}function m(e,t){return e.elevationProvider?e.elevationProvider.getElevation(t[0],t[1],t[2],e.renderCoordsHelper.spatialReference,`ground`)??0:0}function h(a,o,s,c,l){let u=a.state.camera.clone();if(o&&s&&c&&(u.eye=o,u.center=s,u.up=c),l){let e=d(a,u,l);i(C,u.eye,n(C,u.viewForward,e))}else v(a,u.ray,C)||e(C,u.center);let f=a.state.constraints,p=f.minimumPoiDistance;if(t(u.eye,C)<p){let t=f.collision.enabled;e(w,u.viewForward),n(w,w,p),t?u.eye=r(S,C,w):i(C,u.eye,w);let o=a.renderCoordsHelper,s=o.getAltitude(u.eye),c=f.collision.elevationMargin;t&&s<c&&(r(w,C,u.eye),u.eye=o.setAltitude(S,c,u.eye),i(C,u.eye,w))}return u.center=C,u}function g(e,t,n){let{origin:r,direction:i}=t;if(a(r)<e)return!0;let c=-o(i,r)/a(i);return c<0||c>=s(n,r)}function _(e,n,r){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;let i=m(e,n),a=e.stateManager.constraintsManager.nearFarHeuristic.computeFarDistance(n,i,e.stage.renderer.sceneDepthRange.value.far),o=a*a;return t(n,r)>o}function v(e,t,n){let r=b[e.viewingMode];r||(r=new f(e.state.viewingMode),r.options.backfacesTerrain=!e.state.isGlobal,r.options.invisibleTerrain=!0,b[e.viewingMode]=r);let{isGlobal:i}=e.state,a=i?l(e.spatialReference).radius:0;return e.sceneIntersectionHelper.intersectRay(t,r,n)&&!_(e,t.origin,n)&&(!i||g(a,r.ray,n))?!0:!e.renderCoordsHelper.intersectManifold(t,0,n)||_(e,t.origin,n)||i&&!g(a,r.ray,n)?i?y(t,n,a):!1:!0}function y(e,t,r){let s=o(e.origin,e.origin)-r*r,c=s>0?Math.sqrt(s)/3:1;return n(t,e.direction,c/a(e.direction)),i(t,t,e.origin),!0}let b={};function x(){b={}}const S=c(),C=c(),w=c();export{h as cameraOnContentAlongViewDirection,x as cleanupIntersectionUtils,p as eyeWithinExtent,m as surfaceElevationBelowRenderLocation};
2
+ import{copy as e,squaredDistance as t,scale as n,subtract as r,add as i,length as a,dot as o,distance as s}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../geometry/ellipsoidUtils.js";import{containsPoint as u}from"../../../geometry/support/aaBoundingRect.js";import{scaleToDistanceAt as d}from"../support/cameraScaleUtils.js";import{Intersector as f}from"../webgl-engine/lib/Intersector.js";function p(e,t,n,r){return e.renderCoordsHelper.fromRenderCoords(t.eye,S,r)!=null&&u(n,S)}function m(e,t){return e.elevationProvider?e.elevationProvider.getElevation(t[0],t[1],t[2],e.renderCoordsHelper.spatialReference,`ground`)??0:0}function h(a,o,s,c,l){let u=a.state.camera.clone();if(o&&s&&c&&(u.eye=o,u.center=s,u.up=c),l){let e=d(a,u,l);i(C,u.eye,n(C,u.viewForward,e))}else v(a,u.ray,C)||e(C,u.center);let f=a.state.constraints,p=f.minimumPoiDistance;if(t(u.eye,C)<p){let t=f.collision.enabled;e(w,u.viewForward),n(w,w,p),t?u.eye=r(S,C,w):i(C,u.eye,w);let o=a.renderCoordsHelper,s=o.getAltitude(u.eye),c=f.collision.elevationMargin;t&&s<c&&(r(w,C,u.eye),u.eye=o.setAltitude(S,c,u.eye),i(C,u.eye,w))}return u.center=C,u}function g(e,t,n){let{origin:r,direction:i}=t;if(a(r)<e)return!0;let c=-o(i,r)/a(i);return c<0||c>=s(n,r)}function _(e,n,r){if(!e.state.isGlobal||!e.stateManager.constraintsManager)return!1;let i=m(e,n),a=e.stateManager.constraintsManager.nearFarHeuristic.computeFarDistance(n,i,e.stage.renderer.sceneDepthRange.value.far),o=a*a;return t(n,r)>o}function v(e,t,n){let r=b[+e.state.isGlobal];r||(r=new f(e.state.isGlobal),r.options.backfacesTerrain=!e.state.isGlobal,r.options.invisibleTerrain=!0,b[+e.state.isGlobal]=r);let{isGlobal:i}=e.state,a=i?l(e.spatialReference).radius:0;return e.sceneIntersectionHelper.intersectRay(t,r,n)&&!_(e,t.origin,n)&&(!i||g(a,r.ray,n))?!0:!e.renderCoordsHelper.intersectManifold(t,0,n)||_(e,t.origin,n)||i&&!g(a,r.ray,n)?i?y(t,n,a):!1:!0}function y(e,t,r){let s=o(e.origin,e.origin)-r*r,c=s>0?Math.sqrt(s)/3:1;return n(t,e.direction,c/a(e.direction)),i(t,t,e.origin),!0}const b=[];function x(){b.length=0}const S=c(),C=c(),w=c();export{h as cameraOnContentAlongViewDirection,x as cleanupIntersectionUtils,p as eyeWithinExtent,m as surfaceElevationBelowRenderLocation};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../../core/Evented.js";import{length as i,equals as a,copy as o,scale as s,lerp as c}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as l,create as u,fromValues as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{watch as f,sync as p,syncAndInitial as m,when as h}from"../../../core/reactiveUtils.js";import{isEarth as g,getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{projectPointToVector as v}from"../../../geometry/projection/projectPointToVector.js";import{isLoadedOrLoadFor as y}from"../../../geometry/projectionUtils.js";import b from"../../../geometry/SpatialReference.js";import{getGCSForPlanet as x}from"../../../geometry/support/planetGCSUtils.js";import{positionToTimezoneInfo as S}from"../support/earthUtils.js";import{ColorAndIntensity as C,computeShadowsEnabled as w,computeColorAndIntensity as T,computeVirtualLightDirection as E}from"../support/sunUtils.js";import{MainLight as D,AmbientLight as O,FillLight as k}from"../webgl-engine/lighting/Lightsources.js";import{heightLimit as A}from"./weather.js";let j=class extends r{constructor(){super(),this._view=null,this._tmpLightParameters=new C,this._defaultLightParameters=new C,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey=`viewHandles`,this._trackingEnabled=!1,this._mainLight=new D,this._ambientLight=new O,this._moonLight=new k,this.shadowsAvailable=!1,this._resetReferencePosition()}destroy(){this.disconnectView()}get updating(){return!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.stage?.renderer?.weatherFader!=null&&this._view.environment.atmosphereEnabled&&this._view.state.isGlobal&&g(this._view.spatialReference)}get _weatherAvailable(){let e=this._view;return e!=null&&this.weatherEnabled&&i(e.state.camera.eye)-_(e.spatialReference).radius<=A}get weather(){return this._weatherAvailable?this._view?.environment.weather:null}_modifyShadowsAvailable(){if(this._view==null)return;let e=this.referencePositionGeographic,t=e==null||w(e[2],this._view.state.viewingMode);this.shadowsAvailable=this._view.environment.lighting.directShadowsEnabled&&t}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){let e=this._view?.stateManager?.camera?.position?.spatialReference??b.WGS84,t=x(e);return y(e,t)}connectView(e){this._view=e,this.addHandles([f(()=>e.environment.lighting,e=>this._updateLightingHandler(e),p),f(()=>e.environment.lighting.type===`virtual`?null:e.environment.lighting.date,e=>this._lightingDateHandler(e),p),f(()=>e.environment.lighting.directShadowsEnabled,()=>this._modifyShadowsAvailable(),p),f(()=>e.spatialReference,()=>this._resetReferencePosition(!0),p),f(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),p),f(()=>this._weatherAvailable,t=>e.environment.setWeatherAvailable(t),m),f(()=>e.viewingMode,()=>this._resetReferencePosition(!0),m),f(()=>e.environment.lighting.type!==`virtual`&&e.environment.lighting.cameraTrackingEnabled,e=>this._updateCameraTracking(e),m),f(()=>e.state.camera,()=>this._cameraHandler(),m),h(()=>this._canProjectCameraPosition,()=>this._resetReferencePosition(!0),p)],this._viewHandlesKey),this._modifyShadowsAvailable(),this._updateLighting(),this._cameraHandler(),this.notifyChange(`updating`)}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition()}_updateLightingHandler(e){this._updateCameraTracking(e.type!==`virtual`&&e.cameraTrackingEnabled),this._lightingDateHandler(e.type===`virtual`?null:e.date),this._modifyShadowsAvailable()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{if(!this._view)return;let e=this._view.environment.lighting;e?.type!==`virtual`&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){if(!this._view)return;let t=this._view.environment.lighting;if(t?.type===`virtual`)this._updateLighting();else if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),this._referencePositionGeographic!=null)){let e=S(this._referencePositionGeographic,this._tmpTz);e!=null&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}_preupdateTracking(e){this._view&&!this._trackingEnabled&&this._view.environment.lighting.type!==`virtual`&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){let t=this._view;if(!t||!t.ready)return;let n=t.stateManager.camera;if(!n)return;let r=n.position,i=r.spatialReference??b.WGS84,s=x(i);if(v(r,P,s,F))this._referencePositionGeographic?a(this._referencePositionGeographic,P)||(o(this._referencePositionGeographic,P),this.notifyChange(`referencePositionGeographic`)):this._referencePositionGeographic=l(P),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e);else{if(this._referencePositionGeographic==null)return;this._referencePositionGeographic=null,this._updateLighting()}}_updateLighting(e,t=0){let n=this._view;if(!n)return;let{lighting:r}=n.environment,i=r.type===`virtual`,a=this._referencePositionGeographic,l=a==null?this._defaultLightParameters:this._tmpLightParameters;if(a){e??=i?null:r.date;let t=this.weather?.type??`disabled`;T(e,a,n.state.viewingMode,t,n.state.camera,l)}else i&&E(n.state.camera,n.state.viewingMode,l.direct.directionToLightSource);let u=this._mainLight,d=l.direct;s(u.intensity,d.color,d.intensity*Math.PI),o(u.direction,d.directionToLightSource),u.specularStrength=l.specularStrength,u.environmentStrength=l.environmentStrength;let f=this._ambientLight;s(f.intensity,l.ambient.color,l.ambient.intensity);let p=this._moonLight;c(p.intensity,M,N,l.globalFactor);let m=(1-.5*l.globalFactor)*(1-.4*l.noonFactor*(1-l.globalFactor));s(p.intensity,p.intensity,m),o(p.direction,d.directionToLightSource),n.stage.renderer.updateLighting([u,f,p],l.noonFactor,l.globalFactor,this.weather?t:0),this._modifyShadowsAvailable()}_autoUpdateTimezone(e,t=null){if(!this._view||this._view.environment.lighting.type===`virtual`||!this._view.environment.lighting.cameraTrackingEnabled||e==null)return!1;let n=this._tmpDate;n.setTime((t||this._view.environment.lighting.date).getTime());let r=S(e,this._tmpTz);if(r==null)return!1;let i=this._view.environment.lighting.positionTimezoneInfo;if(!i.autoUpdated)i=r;else if(i.hours===r.hours&&i.minutes===r.minutes&&i.seconds===r.seconds)return!1;let a=n.getUTCHours()-(r.hours-i.hours),o=n.getUTCMinutes()-(r.minutes-i.minutes),s=n.getUTCSeconds()-(r.seconds-i.seconds);return n.setUTCHours(a),n.setUTCMinutes(o),n.setUTCSeconds(s),!t&&this._view.environment.lighting.autoUpdate(n,r)}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}};e([t()],j.prototype,`_view`,void 0),e([t({type:Boolean,readOnly:!0})],j.prototype,`updating`,null),e([t()],j.prototype,`weatherEnabled`,null),e([t()],j.prototype,`_weatherAvailable`,null),e([t()],j.prototype,`shadowsAvailable`,void 0),e([t()],j.prototype,`referencePositionGeographic`,null),e([t()],j.prototype,`_referencePositionGeographic`,void 0),e([t()],j.prototype,`_canProjectCameraPosition`,null),j=e([n(`esri.views.3d.environment.EnvironmentView`)],j);const M=d(.22,.22,.33),N=d(.22,.22,.22),P=u(),F={zConversionDisabled:!0};export{j as EnvironmentView};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../../core/Evented.js";import{length as i,equals as a,copy as o,scale as s,lerp as c}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as l,create as u,fromValues as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{watch as f,sync as p,syncAndInitial as m,when as h}from"../../../core/reactiveUtils.js";import{isEarth as g,getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{projectPointToVector as v}from"../../../geometry/projection/projectPointToVector.js";import{isLoadedOrLoadFor as y}from"../../../geometry/projectionUtils.js";import b from"../../../geometry/SpatialReference.js";import{getGCSForPlanet as x}from"../../../geometry/support/planetGCSUtils.js";import{positionToTimezoneInfo as S}from"../support/earthUtils.js";import{ColorAndIntensity as C,areShadowsEnabled as w,computeColorAndIntensity as T,computeVirtualLightDirection as E}from"../support/sunUtils.js";import{MainLight as D,AmbientLight as O,FillLight as k}from"../webgl-engine/lighting/Lightsources.js";import{heightLimit as A}from"./weather.js";let j=class extends r{constructor(){super(),this._view=null,this._tmpLightParameters=new C,this._defaultLightParameters=new C,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey=`viewHandles`,this._trackingEnabled=!1,this._mainLight=new D,this._ambientLight=new O,this._moonLight=new k,this.shadowsAvailable=!1,this._resetReferencePosition()}destroy(){this.disconnectView()}get updating(){return!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.stage?.renderer?.weatherFader!=null&&this._view.environment.atmosphereEnabled&&this._view.state.isGlobal&&g(this._view.spatialReference)}get _weatherAvailable(){let e=this._view;return e!=null&&this.weatherEnabled&&i(e.state.camera.eye)-_(e.spatialReference).radius<=A}get weather(){return this._weatherAvailable?this._view?.environment.weather:null}_modifyShadowsAvailable(){if(this._view==null)return;let e=this.referencePositionGeographic,t=e==null||w(e[2],this._view.state.isGlobal);this.shadowsAvailable=this._view.environment.lighting.directShadowsEnabled&&t}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){let e=this._view?.stateManager?.camera?.position?.spatialReference??b.WGS84,t=x(e);return y(e,t)}connectView(e){this._view=e,this.addHandles([f(()=>e.environment.lighting,e=>this._updateLightingHandler(e),p),f(()=>e.environment.lighting.type===`virtual`?null:e.environment.lighting.date,e=>this._lightingDateHandler(e),p),f(()=>e.environment.lighting.directShadowsEnabled,()=>this._modifyShadowsAvailable(),p),f(()=>e.spatialReference,()=>this._resetReferencePosition(!0),p),f(()=>[e.environment.weather.type,this.weatherEnabled],()=>this._updateLighting(null,1),p),f(()=>this._weatherAvailable,t=>e.environment.setWeatherAvailable(t),m),f(()=>e.state.isGlobal,()=>this._resetReferencePosition(!0),m),f(()=>e.environment.lighting.type!==`virtual`&&e.environment.lighting.cameraTrackingEnabled,e=>this._updateCameraTracking(e),m),f(()=>e.state.camera,()=>this._cameraHandler(),m),h(()=>this._canProjectCameraPosition,()=>this._resetReferencePosition(!0),p)],this._viewHandlesKey),this._modifyShadowsAvailable(),this._updateLighting(),this._cameraHandler(),this.notifyChange(`updating`)}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition()}_updateLightingHandler(e){this._updateCameraTracking(e.type!==`virtual`&&e.cameraTrackingEnabled),this._lightingDateHandler(e.type===`virtual`?null:e.date),this._modifyShadowsAvailable()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{if(!this._view)return;let e=this._view.environment.lighting;e?.type!==`virtual`&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){if(!this._view)return;let t=this._view.environment.lighting;if(t?.type===`virtual`)this._updateLighting();else if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),this._referencePositionGeographic!=null)){let e=S(this._referencePositionGeographic,this._tmpTz);e!=null&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}_preupdateTracking(e){this._view&&!this._trackingEnabled&&this._view.environment.lighting.type!==`virtual`&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){let t=this._view;if(!t||!t.ready)return;let n=t.stateManager.camera;if(!n)return;let r=n.position,i=r.spatialReference??b.WGS84,s=x(i);if(v(r,P,s,F))this._referencePositionGeographic?a(this._referencePositionGeographic,P)||(o(this._referencePositionGeographic,P),this.notifyChange(`referencePositionGeographic`)):this._referencePositionGeographic=l(P),this._autoUpdateTimezone(this._referencePositionGeographic,e)||this._updateLighting(e);else{if(this._referencePositionGeographic==null)return;this._referencePositionGeographic=null,this._updateLighting()}}_updateLighting(e,t=0){let n=this._view;if(!n)return;let{lighting:r}=n.environment,i=r.type===`virtual`,a=this._referencePositionGeographic,l=a==null?this._defaultLightParameters:this._tmpLightParameters;if(a){e??=i?null:r.date;let t=this.weather?.type??`disabled`;T(e,a,n.state.isGlobal,t,n.state.camera,l)}else i&&E(n.state.camera,n.state.isGlobal,l.direct.directionToLightSource);let u=this._mainLight,d=l.direct;s(u.intensity,d.color,d.intensity*Math.PI),o(u.direction,d.directionToLightSource),u.specularStrength=l.specularStrength,u.environmentStrength=l.environmentStrength;let f=this._ambientLight;s(f.intensity,l.ambient.color,l.ambient.intensity);let p=this._moonLight;c(p.intensity,M,N,l.globalFactor);let m=(1-.5*l.globalFactor)*(1-.4*l.noonFactor*(1-l.globalFactor));s(p.intensity,p.intensity,m),o(p.direction,d.directionToLightSource),n.stage.renderer.updateLighting([u,f,p],l.noonFactor,l.globalFactor,this.weather?t:0),this._modifyShadowsAvailable()}_autoUpdateTimezone(e,t=null){if(!this._view||this._view.environment.lighting.type===`virtual`||!this._view.environment.lighting.cameraTrackingEnabled||e==null)return!1;let n=this._tmpDate;n.setTime((t||this._view.environment.lighting.date).getTime());let r=S(e,this._tmpTz);if(r==null)return!1;let i=this._view.environment.lighting.positionTimezoneInfo;if(!i.autoUpdated)i=r;else if(i.hours===r.hours&&i.minutes===r.minutes&&i.seconds===r.seconds)return!1;let a=n.getUTCHours()-(r.hours-i.hours),o=n.getUTCMinutes()-(r.minutes-i.minutes),s=n.getUTCSeconds()-(r.seconds-i.seconds);return n.setUTCHours(a),n.setUTCMinutes(o),n.setUTCSeconds(s),!t&&this._view.environment.lighting.autoUpdate(n,r)}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}};e([t()],j.prototype,`_view`,void 0),e([t({type:Boolean,readOnly:!0})],j.prototype,`updating`,null),e([t()],j.prototype,`weatherEnabled`,null),e([t()],j.prototype,`_weatherAvailable`,null),e([t()],j.prototype,`shadowsAvailable`,void 0),e([t()],j.prototype,`referencePositionGeographic`,null),e([t()],j.prototype,`_referencePositionGeographic`,void 0),e([t()],j.prototype,`_canProjectCameraPosition`,null),j=e([n(`esri.views.3d.environment.EnvironmentView`)],j);const M=d(.22,.22,.33),N=d(.22,.22,.22),P=u(),F={zConversionDisabled:!0};export{j as EnvironmentView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{create as e}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isPromiseLike as n}from"../../core/promiseUtils.js";import{convertToSpatialReferenceUnit as r,convertFromSpatialReferenceUnit as i}from"../../core/units.js";import{getReferenceEllipsoid as a}from"../../geometry/ellipsoidUtils.js";import{execute as o}from"../../geometry/operators/gx/operatorDensify.js";import{fromPolygon as s,toPolygon as c}from"../../geometry/operators/support/apiConverter.js";import{computeTranslationToOriginAndRotation as l}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{project as u}from"../../geometry/projectionUtils.js";import{t as d}from"../../chunks/vec3.js";import{earth as f}from"../../geometry/support/Ellipsoid.js";import{extrudePolygon as p}from"./layers/graphics/extrudePolygon.js";import{computeCentroid as m}from"./layers/graphics/graphicUtils.js";import{StencilGeometry as h,StencilGeometryWithOrigin as g}from"./StencilGeometry.js";import{polygonToRenderInfoElevationAligned as _}from"./support/renderInfoUtils/polygon.js";function v(e,t,v){let C=t.renderCoordsHelper,w=C.viewingMode===1,T=t.spatialReference,E=a(T).radius/f.radius,D=5e5*E,O=r(D,`meters`,T,!0);w||C.worldUpAtPosition([0,0,0],b);let k=T.equals(e.spatialReference)?e:u(e,T),A=Math.max(k.extent.width,k.extent.height),j=i(A,T,`meters`,!0),M=Math.max(j*5,2e4*E),N=y(k,M,w?E/10:E),P=m(N);if(P==null)return null;let F=s(N),I=o(F,O,0,0),L=c(I,T);if(L==null)return null;let R=_(L,t.elevationProvider,C,v,{outlineOutput:`tessellated-indices`});if(n(R))return R;if(R==null||R.polygonIndexCount===0)return null;l(T,[P.x,P.y,0],x,C.spatialReference),S[12]=-x[12],S[13]=-x[13],S[14]=-x[14];let z=p(R,{height:M,worldUp:b,spherical:w,requireElevation:!1,requireNormals:!1,requireSizes:!1});if(z==null)return null;d(z.vertices,z.vertices,S);let B=new h(z.vertices,z.bottomIndices,z.indices,M);return new g(B,[x[12],x[13],x[14]])}function y(e,t,n){let r=-12e5*n,i=Math.max(-t/2,r),a=e.rings.map(e=>e.map(e=>[e[0],e[1],i])),o=e.clone();return o.rings=a,o.hasZ=!0,o}const b=t(),x=e(),S=e();export{v as polygonToVolume};
2
+ import{create as e}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isPromiseLike as n}from"../../core/promiseUtils.js";import{convertToSpatialReferenceUnit as r,convertFromSpatialReferenceUnit as i}from"../../core/units.js";import{getReferenceEllipsoid as a}from"../../geometry/ellipsoidUtils.js";import{execute as o}from"../../geometry/operators/gx/operatorDensify.js";import{fromPolygon as s,toPolygon as c}from"../../geometry/operators/support/apiConverter.js";import{computeTranslationToOriginAndRotation as l}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{project as u}from"../../geometry/projectionUtils.js";import{t as d}from"../../chunks/vec3.js";import{earth as f}from"../../geometry/support/Ellipsoid.js";import{extrudePolygon as p}from"./layers/graphics/extrudePolygon.js";import{computeCentroid as m}from"./layers/graphics/graphicUtils.js";import{StencilGeometry as h,StencilGeometryWithOrigin as g}from"./StencilGeometry.js";import{polygonToRenderInfoElevationAligned as _}from"./support/renderInfoUtils/polygon.js";function v(e,t,v){let C=t.renderCoordsHelper,w=C.isGlobal,T=t.spatialReference,E=a(T).radius/f.radius,D=5e5*E,O=r(D,`meters`,T,!0);w||C.worldUpAtPosition([0,0,0],b);let k=T.equals(e.spatialReference)?e:u(e,T),A=Math.max(k.extent.width,k.extent.height),j=i(A,T,`meters`,!0),M=Math.max(j*5,2e4*E),N=y(k,M,w?E/10:E),P=m(N);if(P==null)return null;let F=s(N),I=o(F,O,0,0),L=c(I,T);if(L==null)return null;let R=_(L,t.elevationProvider,C,v,{outlineOutput:`tessellated-indices`});if(n(R))return R;if(R==null||R.polygonIndexCount===0)return null;l(T,[P.x,P.y,0],x,C.spatialReference),S[12]=-x[12],S[13]=-x[13],S[14]=-x[14];let z=p(R,{height:M,worldUp:b,spherical:w,requireElevation:!1,requireNormals:!1,requireSizes:!1});if(z==null)return null;d(z.vertices,z.vertices,S);let B=new h(z.vertices,z.bottomIndices,z.indices,M);return new g(B,[x[12],x[13],x[14]])}function y(e,t,n){let r=-12e5*n,i=Math.max(-t/2,r),a=e.rings.map(e=>e.map(e=>[e[0],e[1],i])),o=e.clone();return o.rings=a,o.hasZ=!0,o}const b=t(),x=e(),S=e();export{v as polygonToVolume};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../../../../../core/has.js";import{eventMatchesPointerActions as e}from"../../../../input/handlers/support.js";import{InputHandler as t}from"../../../../input/InputHandler.js";import{GroundNavigationController as n}from"../../../state/controllers/GroundNavigationController.js";import{PinchAndPanControllerGlobal as r}from"../../../state/controllers/PinchAndPanControllerGlobal.js";import{groundNavigationConstants as i}from"../../../state/utils/groundNavigationUtils.js";class a extends t{constructor(e,t,n){super(!0),this._view=e,this.pointerActions=t,this._modifiers=n,this._lastEndTimestamp=0,this._lastTimestamp=0,this.registerIncoming(`drag`,n,e=>this._handleDrag(e))}_handleDrag(t){if(t.data.pointers.size===1&&!e(t.data,this.pointerActions))return;let n=t.timestamp-this._lastEndTimestamp,r=this._momentum&&this._momentum.running&&n<40;switch(t.data.action){case`start`:case`update`:if(r)break;!this._controller||!this._controller.running?this._startController(t):t.data.timestamp-this._lastTimestamp>2&&(this._controller.update(t.data),this._lastTimestamp=t.timestamp);break;case`end`:case`removed`:this._endController(t,!0);break;case`added`:this._endController(t,!1),this._startController(t)}t.stopPropagation()}_endController(e,t){if(this._controller?.running){this._lastEndTimestamp=e.timestamp;let n=this._controller.end(e.data);t&&n&&(this._momentum=n,this._view.state.switchCameraController(this._momentum))}this._controller=null}_startController(e){this._controller=this._createController(),this._view.state.switchCameraController(this._controller),this._controller.begin(e.data),this._lastTimestamp=e.timestamp}_createController(){return this._view.viewingMode===`global`&&this._view.state.camera.relativeElevation>i.maxElevation?new r({view:this._view}):new n({view:this._view})}get test(){}}export{a as GroundNavigation};
2
+ import"../../../../../core/has.js";import{eventMatchesPointerActions as e}from"../../../../input/handlers/support.js";import{InputHandler as t}from"../../../../input/InputHandler.js";import{GroundNavigationController as n}from"../../../state/controllers/GroundNavigationController.js";import{PinchAndPanControllerGlobal as r}from"../../../state/controllers/PinchAndPanControllerGlobal.js";import{groundNavigationConstants as i}from"../../../state/utils/groundNavigationUtils.js";class a extends t{constructor(e,t,n){super(!0),this._view=e,this.pointerActions=t,this._modifiers=n,this._lastEndTimestamp=0,this._lastTimestamp=0,this.registerIncoming(`drag`,n,e=>this._handleDrag(e))}_handleDrag(t){if(t.data.pointers.size===1&&!e(t.data,this.pointerActions))return;let n=t.timestamp-this._lastEndTimestamp,r=this._momentum&&this._momentum.running&&n<40;switch(t.data.action){case`start`:case`update`:if(r)break;!this._controller||!this._controller.running?this._startController(t):t.data.timestamp-this._lastTimestamp>2&&(this._controller.update(t.data),this._lastTimestamp=t.timestamp);break;case`end`:case`removed`:this._endController(t,!0);break;case`added`:this._endController(t,!1),this._startController(t)}t.stopPropagation()}_endController(e,t){if(this._controller?.running){this._lastEndTimestamp=e.timestamp;let n=this._controller.end(e.data);t&&n&&(this._momentum=n,this._view.state.switchCameraController(this._momentum))}this._controller=null}_startController(e){this._controller=this._createController(),this._view.state.switchCameraController(this._controller),this._controller.begin(e.data),this._lastTimestamp=e.timestamp}_createController(){return this._view.state.isGlobal&&this._view.state.camera.relativeElevation>i.maxElevation?new r({view:this._view}):new n({view:this._view})}get test(){}}export{a as GroundNavigation};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{exactEquals as e,getTranslation as t}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{exactEquals as n}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Object3D as i}from"../webgl-engine/lib/Object3D.js";import{Manipulator3DBase as a,createPreciseManipulatorOrigin as o}from"./Manipulator3DBase.js";class s extends a{constructor(e){super(e.view),this.type=0,Object.assign(this,e)}createEngineObject(e){return new i({castShadow:!1,geometries:[e.geometry]})}updateEngineObjectTransform(t,n){this.usePreciseLocalOrigin?this._updateObjectTransformAndLocalOrigin(t,n):e(t.transformation,n)||(t.transformation=n)}_updateObjectTransformAndLocalOrigin(r,i){let a=t(c,i);if(r.geometries.every(({localOrigin:e})=>e!=null&&n(e.vec3,a))&&e(r.transformation,i))return;let s=o(a);for(let e of r.geometries)e.localOrigin=s;r.transformation=i}}const c=r();export{s as Manipulator3D};
2
+ import{exactEquals as e,getTranslation as t}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{exactEquals as n}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Object3D as i}from"../webgl-engine/lib/Object3D.js";import{Manipulator3DBase as a,createPreciseManipulatorOrigin as o}from"./Manipulator3DBase.js";class s extends a{constructor(e){super(e.view),this.type=0,Object.assign(this,e)}createEngineObject(e){return new i({castShadows:!1,geometries:[e.geometry]})}updateEngineObjectTransform(t,n){this.usePreciseLocalOrigin?this._updateObjectTransformAndLocalOrigin(t,n):e(t.transformation,n)||(t.transformation=n)}_updateObjectTransformAndLocalOrigin(r,i){let a=t(c,i);if(r.geometries.every(({localOrigin:e})=>e!=null&&n(e.vec3,a))&&e(r.transformation,i))return;let s=o(a);for(let e of r.geometries)e.localOrigin=s;r.transformation=i}}const c=r();export{s as Manipulator3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{EventEmitter as e}from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import"../../../core/has.js";import{create as n,ZEROS as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromMat4 as i}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as o,set as s,multiply as c,identity as l}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as d}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{add as f,transformMat3 as p,transformMat4 as m,scale as h,copy as g,squaredDistance as _,set as v,subtract as y}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{deg2rad as b}from"../../../core/mathUtils.js";import{destroyMaybe as ee}from"../../../core/maybe.js";import{createRenderScreenPointArray3 as te,createScreenPointArray as x,screenPointObjectToArray as S,castRenderScreenPointArray as C}from"../../../core/screenUtils.js";import{generateUID as ne}from"../../../core/uid.js";import{getReferenceEllipsoid as re}from"../../../geometry/ellipsoidUtils.js";import w from"../../../geometry/Point.js";import{computeENUToPCPFLocalRotation as T}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as E}from"../../../geometry/projection/projectors.js";import{canProjectWithoutEngine as ie,projectPoint as ae}from"../../../geometry/projectionUtils.js";import{distance2 as oe,fromPoints as D,closestRayDistance2 as O,create as se}from"../../../geometry/support/lineSegment.js";import{fromPositionAndNormal as k,intersectRay as A,create as ce}from"../../../geometry/support/plane.js";import{create as le}from"../../../geometry/support/ray.js";import{sv3d as j}from"../../../geometry/support/vectorStacks.js";import{clonePoint as M}from"../../../layers/graphics/hydratedFeatures.js";import{hydratedSpatialReference as ue}from"../../../layers/graphics/hydratedSpatialReference.js";import{getElevationOffset as N}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as P}from"../support/ElevationProvider.js";import{containsElevationUpdatePoint as F}from"../support/elevationUpdateExtentUtils.js";import{fromScreen as I}from"../support/geometryUtils/ray.js";import{fromValues as L}from"../webgl-engine/lib/LocalOriginFactory.js";import{WebGLLayer as R}from"../webgl-engine/lib/WebGLLayer.js";class z{constructor(t){this.view=t,this.metadata=void 0,this._elevation={offset:0,override:null},this.collisionType={type:`point`},this.collisionPriority=0,this._renderObjects=[],this.autoScaleRenderObjects=!0,this.usePreciseLocalOrigin=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=u(),this._worldFrame=null,this._renderLocation=n(),this._renderLocationDirty=!0,this._location=new w({x:0,y:0,z:0}),this._elevationAlignedLocation=new w,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=0,this._focused=!1,this.events=new e,this._screenLocation={screenPointArray:x(),renderScreenPointArray:te(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=t.spatialReference}destroy(){this._applyObjectTransform=me,this._removeResourcesFromStage(),this._engineResources=null,this.view=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,this._noDisplayCount===1&&this._updateEngineObject(),t(()=>{this._noDisplayCount--,this._noDisplayCount===0&&this._updateEngineObject()})}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){B(e)&&(this._screenLocationDirty=!0),o(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||=u(),V(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&=null),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){M(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit(`location-update`,{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty&&(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation()),this._elevationAlignedLocation}set elevationAlignedLocation(e){M(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit(`location-update`,{location:this._location})}_updateElevationAlignedLocation(){let e=this._elevation.override==null?this.location.z||0:this._elevation.override;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=ue(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit(`select-changed`,{action:e?`select`:`deselect`}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit(`focus-changed`,{action:e===!0?`focus`:`unfocus`}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;let e=this.view.state.camera;this._screenLocation.pixelSize=e.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let t=B(this._modelTransform),n;if(t){let e=this._calculateModelTransformOffset(pe);n=f(e,e,this.renderLocation)}else n=this.renderLocation;e.projectToRenderScreen(n,this._screenLocation.renderScreenPointArray),e.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(e,t){if(!this.available)return null;let n=this.view.state.camera,a=S(e,de),o=this._getCollisionRadius(t),s=this.collisionPriority*-1;switch(this.collisionType.type){case`point`:if(d(this.screenLocation.screenPointArray,a)<o*o)return this.screenLocation.renderScreenPointArray[2]+s;break;case`line`:{let e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(t,K),i=o*this.screenLocation.pixelSize,c=I(n,a,W);if(c==null)return null;for(let t of e){if(t.length===0)continue;let e=m(J,t[0],r);for(let a=1;a<t.length;a++){let o=m(Y,t[a],r),l=O(D(e,o,U),c);if(l!=null&&l<i*i){let t=f(j.get(),e,o);h(t,t,.5);let r=C(j.get());if(n.projectToRenderScreen(t,r))return r[2]+s}g(e,o)}}break}case`disc`:{let e=this.collisionType.direction,t=this.collisionType.offset??r,c=this._getWorldToScreenObjectScale(),l=this._calculateObjectTransform(c,K),u=o*this.screenLocation.pixelSize,d=I(n,a,W);if(d==null)return null;let f=i(G,l),h=p(Z,e,f),g=m(Q,t,l);k(g,h,q);let v=X;if(A(q,d,v)&&_(v,g)<u*u)return this.screenLocation.renderScreenPointArray[2]+s;break}case`ribbon`:{let{paths:e,direction:t}=this.collisionType,r=this._getWorldToScreenObjectScale(),c=this._calculateObjectTransform(r,K),l=o*n.computeScreenPixelSizeAt(this.renderLocation),u=I(n,a,W);if(u==null)return null;let d=i(G,c),_=p(Z,t,d),v=this._calculateModelTransformPosition(Q);k(v,_,q);let y=X;if(!A(q,u,y))break;for(let t of e){if(t.length===0)continue;let e=m(J,t[0],c);for(let r=1;r<t.length;r++){let i=m(Y,t[r],c),a=oe(D(e,i,U),y);if(a!=null&&a<l*l){let t=f(j.get(),e,i);h(t,t,.5);let r=C(j.get());if(n.projectToRenderScreen(t,r))return r[2]+s}g(e,i)}}break}default:this.collisionType}return null}attach(e={manipulator3D:{}}){let t=this._stage;if(!t)return;let n=e.manipulator3D;n.engineLayerId==null?(this._engineLayer=new R(t,{pickable:!1,updatePolicy:1}),n.engineLayerId=this._engineLayer.id):t?.getLayer&&(this._engineLayer=t.getLayer(n.engineLayerId)),n.engineLayerReferences=(n.engineLayerReferences||0)+1,this._attached=!0,this._updateEngineObject(),ie(this._location.spatialReference,this.view.spatialReference)||(this.location=new w({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){let t=e.manipulator3D;t.engineLayerReferences--;let n=t.engineLayerReferences===0;this._removeResourcesFromStage(),n&&(t.engineLayerId=null,ee(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._attached=!1}onViewChange(){this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){ae(this.location,$,e.spatialReference)&&F(e.extent,$.x,$.y,e.spatialReference)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(this.elevationInfo==null)return;let e=null,t=0,n=N(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case`on-the-ground`:e=P(this.view.elevationProvider,this.location,`ground`)??0;break;case`relative-to-ground`:t=(P(this.view.elevationProvider,this.location,`ground`)??0)+n;break;case`relative-to-scene`:t=(P(this.view.elevationProvider,this.location,`scene`)??0)+n;break;case`absolute-height`:t=n}(t!==this._elevation.offset||e!==this._elevation.override)&&(this._elevation.offset=t,this._elevation.override=e)}_updateEngineObject(){if(!this._attached)return;if(!this.available){this._removeResourcesFromStage();return}let e=this._getWorldToScreenObjectScale(),t=K,n=this.autoScaleRenderObjects===!0?this._getFocusedSize(this._radius,this.focused):1;this._calculateObjectTransform(n*e,t);let{objectsByState:r}=this._ensureEngineResources(),i=(this.focused?2:1)|(this.selected?8:4),a=this._noDisplayCount>0;for(let{stateMask:e,resources:n}of r){if(a){for(let{object:e}of n)e.visible=!1;continue}let r=!!(e&15),o=!!(e&65520),s=!r||(i&e)===(e&15),c=!o||(this.state&e)===(e&65520);if(s&&c)for(let{object:e,renderObject:r}of n)e.visible=!0,this.updateEngineObjectTransform(e,t,r);else for(let{object:e}of n)e.visible=!1}}_ensureEngineResources(){if(this._engineResources==null){let e=this._engineLayer,t=new Map;this._renderObjects.forEach(e=>{let n=this.createEngineObject(e),r=t.get(e.stateMask)??[];r.push({object:n,renderObject:e}),t.set(e.stateMask,r)});let n=Array.from(t,([e,t])=>({stateMask:e,resources:t}));this._engineResources={objectsByState:n,layer:e}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){let e=this._stage;if(this._engineResourcesAddedToStage||this._engineResources==null||!e)return;let{objectsByState:t,layer:n}=this._engineResources;t.forEach(({resources:e})=>n.addMany(e.map(({object:e})=>e))),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){let e=this._stage;if(!this._engineResourcesAddedToStage||this._engineResources==null||!e)return;let{objectsByState:t,layer:n}=this._engineResources;t.forEach(({resources:e})=>n.removeMany(e.map(({object:e})=>e))),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*(e===`touch`?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){let t=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(t,fe);return v(e,n[12],n[13],n[14])}_calculateModelTransformOffset(e){let t=this._calculateModelTransformPosition(e);return y(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return s(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&c(t,t,this._worldFrame),c(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,this._applyObjectTransform?.(t),t}get test(){}}function B(e){return e[12]!==0||e[13]!==0||e[14]!==0}function V(e,t,n){switch(e.viewingMode){case`local`:return l(n),!0;case`global`:{let r=re(e.renderCoordsHelper.spatialReference);return E(t,0,J,0,r.radius),T(b(J[0]),b(J[1]),n),!0}}}function H(e){return L(e[0],e[1],e[2],`manipulator-${ne()}`)}const de=x(),U=se(),W=le(),G=a(),fe=u(),K=u(),q=ce(),J=n(),Y=n(),X=n(),Z=n(),Q=n(),pe=n(),$=new w({x:0,y:0,z:0,spatialReference:null}),me=()=>{};export{z as Manipulator3DBase,H as createPreciseManipulatorOrigin};
2
+ import{EventEmitter as e}from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import"../../../core/has.js";import{create as n,ZEROS as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromMat4 as i}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as o,set as s,multiply as c,identity as l}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as d}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{add as f,transformMat3 as p,transformMat4 as m,scale as h,copy as g,squaredDistance as _,set as v,subtract as y}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{deg2rad as b}from"../../../core/mathUtils.js";import{destroyMaybe as ee}from"../../../core/maybe.js";import{createRenderScreenPointArray3 as te,createScreenPointArray as x,screenPointObjectToArray as S,castRenderScreenPointArray as C}from"../../../core/screenUtils.js";import{generateUID as ne}from"../../../core/uid.js";import{getReferenceEllipsoid as re}from"../../../geometry/ellipsoidUtils.js";import w from"../../../geometry/Point.js";import{computeENUToPCPFLocalRotation as T}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as E}from"../../../geometry/projection/projectors.js";import{canProjectWithoutEngine as ie,projectPoint as ae}from"../../../geometry/projectionUtils.js";import{distance2 as oe,fromPoints as D,closestRayDistance2 as O,create as se}from"../../../geometry/support/lineSegment.js";import{fromPositionAndNormal as k,intersectRay as A,create as ce}from"../../../geometry/support/plane.js";import{create as le}from"../../../geometry/support/ray.js";import{sv3d as j}from"../../../geometry/support/vectorStacks.js";import{clonePoint as M}from"../../../layers/graphics/hydratedFeatures.js";import{hydratedSpatialReference as ue}from"../../../layers/graphics/hydratedSpatialReference.js";import{getElevationOffset as N}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as P}from"../support/ElevationProvider.js";import{containsElevationUpdatePoint as F}from"../support/elevationUpdateExtentUtils.js";import{fromScreen as I}from"../support/geometryUtils/ray.js";import{fromValues as L}from"../webgl-engine/lib/LocalOriginFactory.js";import{WebGLLayer as R}from"../webgl-engine/lib/WebGLLayer.js";class z{constructor(t){this.view=t,this.metadata=void 0,this._elevation={offset:0,override:null},this.collisionType={type:`point`},this.collisionPriority=0,this._renderObjects=[],this.autoScaleRenderObjects=!0,this.usePreciseLocalOrigin=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=u(),this._worldFrame=null,this._renderLocation=n(),this._renderLocationDirty=!0,this._location=new w({x:0,y:0,z:0}),this._elevationAlignedLocation=new w,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=0,this._focused=!1,this.events=new e,this._screenLocation={screenPointArray:x(),renderScreenPointArray:te(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=t.spatialReference}destroy(){this._applyObjectTransform=me,this._removeResourcesFromStage(),this._engineResources=null,this.view=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,this._noDisplayCount===1&&this._updateEngineObject(),t(()=>{this._noDisplayCount--,this._noDisplayCount===0&&this._updateEngineObject()})}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){B(e)&&(this._screenLocationDirty=!0),o(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||=u(),V(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&=null),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){M(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit(`location-update`,{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty&&(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation()),this._elevationAlignedLocation}set elevationAlignedLocation(e){M(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit(`location-update`,{location:this._location})}_updateElevationAlignedLocation(){let e=this._elevation.override==null?this.location.z||0:this._elevation.override;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=ue(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit(`select-changed`,{action:e?`select`:`deselect`}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit(`focus-changed`,{action:e===!0?`focus`:`unfocus`}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;let e=this.view.state.camera;this._screenLocation.pixelSize=e.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let t=B(this._modelTransform),n;if(t){let e=this._calculateModelTransformOffset(pe);n=f(e,e,this.renderLocation)}else n=this.renderLocation;e.projectToRenderScreen(n,this._screenLocation.renderScreenPointArray),e.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(e,t){if(!this.available)return null;let n=this.view.state.camera,a=S(e,de),o=this._getCollisionRadius(t),s=this.collisionPriority*-1;switch(this.collisionType.type){case`point`:if(d(this.screenLocation.screenPointArray,a)<o*o)return this.screenLocation.renderScreenPointArray[2]+s;break;case`line`:{let e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(t,K),i=o*this.screenLocation.pixelSize,c=I(n,a,W);if(c==null)return null;for(let t of e){if(t.length===0)continue;let e=m(J,t[0],r);for(let a=1;a<t.length;a++){let o=m(Y,t[a],r),l=O(D(e,o,U),c);if(l!=null&&l<i*i){let t=f(j.get(),e,o);h(t,t,.5);let r=C(j.get());if(n.projectToRenderScreen(t,r))return r[2]+s}g(e,o)}}break}case`disc`:{let e=this.collisionType.direction,t=this.collisionType.offset??r,c=this._getWorldToScreenObjectScale(),l=this._calculateObjectTransform(c,K),u=o*this.screenLocation.pixelSize,d=I(n,a,W);if(d==null)return null;let f=i(G,l),h=p(Z,e,f),g=m(Q,t,l);k(g,h,q);let v=X;if(A(q,d,v)&&_(v,g)<u*u)return this.screenLocation.renderScreenPointArray[2]+s;break}case`ribbon`:{let{paths:e,direction:t}=this.collisionType,r=this._getWorldToScreenObjectScale(),c=this._calculateObjectTransform(r,K),l=o*n.computeScreenPixelSizeAt(this.renderLocation),u=I(n,a,W);if(u==null)return null;let d=i(G,c),_=p(Z,t,d),v=this._calculateModelTransformPosition(Q);k(v,_,q);let y=X;if(!A(q,u,y))break;for(let t of e){if(t.length===0)continue;let e=m(J,t[0],c);for(let r=1;r<t.length;r++){let i=m(Y,t[r],c),a=oe(D(e,i,U),y);if(a!=null&&a<l*l){let t=f(j.get(),e,i);h(t,t,.5);let r=C(j.get());if(n.projectToRenderScreen(t,r))return r[2]+s}g(e,i)}}break}default:this.collisionType}return null}attach(e={manipulator3D:{}}){let t=this._stage;if(!t)return;let n=e.manipulator3D;n.engineLayerId==null?(this._engineLayer=new R(t,{pickable:!1,updatePolicy:1}),n.engineLayerId=this._engineLayer.id):t?.getLayer&&(this._engineLayer=t.getLayer(n.engineLayerId)),n.engineLayerReferences=(n.engineLayerReferences||0)+1,this._attached=!0,this._updateEngineObject(),ie(this._location.spatialReference,this.view.spatialReference)||(this.location=new w({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){let t=e.manipulator3D;t.engineLayerReferences--;let n=t.engineLayerReferences===0;this._removeResourcesFromStage(),n&&(t.engineLayerId=null,ee(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._attached=!1}onViewChange(){this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){ae(this.location,$,e.spatialReference)&&F(e.extent,$.x,$.y,e.spatialReference)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(this.elevationInfo==null)return;let e=null,t=0,n=N(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case`on-the-ground`:e=P(this.view.elevationProvider,this.location,`ground`)??0;break;case`relative-to-ground`:t=(P(this.view.elevationProvider,this.location,`ground`)??0)+n;break;case`relative-to-scene`:t=(P(this.view.elevationProvider,this.location,`scene`)??0)+n;break;case`absolute-height`:t=n}(t!==this._elevation.offset||e!==this._elevation.override)&&(this._elevation.offset=t,this._elevation.override=e)}_updateEngineObject(){if(!this._attached)return;if(!this.available){this._removeResourcesFromStage();return}let e=this._getWorldToScreenObjectScale(),t=K,n=this.autoScaleRenderObjects===!0?this._getFocusedSize(this._radius,this.focused):1;this._calculateObjectTransform(n*e,t);let{objectsByState:r}=this._ensureEngineResources(),i=(this.focused?2:1)|(this.selected?8:4),a=this._noDisplayCount>0;for(let{stateMask:e,resources:n}of r){if(a){for(let{object:e}of n)e.visible=!1;continue}let r=!!(e&15),o=!!(e&65520),s=!r||(i&e)===(e&15),c=!o||(this.state&e)===(e&65520);if(s&&c)for(let{object:e,renderObject:r}of n)e.visible=!0,this.updateEngineObjectTransform(e,t,r);else for(let{object:e}of n)e.visible=!1}}_ensureEngineResources(){if(this._engineResources==null){let e=this._engineLayer,t=new Map;this._renderObjects.forEach(e=>{let n=this.createEngineObject(e),r=t.get(e.stateMask)??[];r.push({object:n,renderObject:e}),t.set(e.stateMask,r)});let n=Array.from(t,([e,t])=>({stateMask:e,resources:t}));this._engineResources={objectsByState:n,layer:e}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){let e=this._stage;if(this._engineResourcesAddedToStage||this._engineResources==null||!e)return;let{objectsByState:t,layer:n}=this._engineResources;t.forEach(({resources:e})=>n.addMany(e.map(({object:e})=>e))),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){let e=this._stage;if(!this._engineResourcesAddedToStage||this._engineResources==null||!e)return;let{objectsByState:t,layer:n}=this._engineResources;t.forEach(({resources:e})=>n.removeMany(e.map(({object:e})=>e))),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*(e===`touch`?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){let t=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(t,fe);return v(e,n[12],n[13],n[14])}_calculateModelTransformOffset(e){let t=this._calculateModelTransformPosition(e);return y(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return s(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&c(t,t,this._worldFrame),c(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,this._applyObjectTransform?.(t),t}get test(){}}function B(e){return e[12]!==0||e[13]!==0||e[14]!==0}function V(e,t,n){if(e.state.isGlobal){let r=re(e.renderCoordsHelper.spatialReference);E(t,0,J,0,r.radius),T(b(J[0]),b(J[1]),n)}else l(n)}function H(e){return L(e[0],e[1],e[2],`manipulator-${ne()}`)}const de=x(),U=se(),W=le(),G=a(),fe=u(),K=u(),q=ce(),J=n(),Y=n(),X=n(),Z=n(),Q=n(),pe=n(),$=new w({x:0,y:0,z:0,spatialReference:null}),me=()=>{};export{z as Manipulator3DBase,H as createPreciseManipulatorOrigin};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../../../core/Evented.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{UpdatingHandles as o}from"../../../../core/support/UpdatingHandles.js";import{ringNeedsClosure as s,closeRings as c}from"../../../../geometry/support/coordsUtils.js";import{getGraphicEffectiveElevationInfo as l}from"../../../../support/elevationInfoUtils.js";import{EditGeometryOperations as u}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{GraphicManipulator as d}from"../../../interactive/GraphicManipulator.js";import{GraphicState as f}from"../../layers/graphics/GraphicState.js";import{getGraphicAttachmentOrigin as p}from"../manipulatorUtils.js";import{createGraphicGeometryUndoRecord as m}from"./undoRecords.js";const h=Symbol();let g=class extends r{get operations(){return this._operations}get updating(){return this._updatingHandles.updating}get elevationInfo(){return l(this.graphic)}get visible(){return this._graphicState.displaying}get isDraped(){return this._graphicState.isDraped}get origin(){return p(this.view,this.graphic)}constructor(e){super(e),this._updatingHandles=new o}destroy(){this._operations=i(this._operations),this._updatingHandles.destroy()}initialize(){this._graphicState=new f({graphic:this.graphic}),this._graphicState.on(`changed`,()=>this.emit(`committed`)),this.addHandles(this.view.trackGraphicState(this._graphicState)),this.addHandles(this._updatingHandles.add(()=>this.graphic.geometry,e=>{let t=this._operations?.data.geometry;if(e!==t){if(!e||e?.type===`multipoint`||e?.type===`extent`)i(this._operations),this.removeHandles(h),this._operations=null;else if(e.type===`polygon`&&e.rings.some(s)&&(e=e.clone(),c(e)),this._operations?.trySetGeometry(e))this.emit(`modified-externally`);else{i(this._operations),this.removeHandles(h);let t=u.fromGeometry(e,this.view.state.viewingMode);this._operations=t,this.addHandles(t.data.on(`change`,()=>this.graphic.geometry=t.data.geometry),h)}}},a))}createManipulator(e){return new d({view:this.view,graphic:this.graphic,...e})}maskOccludee(){return this.view.maskOccludee(this.graphic)}endInteraction(){this.graphic.geometry?.type===`mesh`&&this.graphic.notifyMeshTransformChanged()}toMap(e){return this.view.toMap(e,{include:[this.graphic]})}createUndoRecord(){let{graphic:{geometry:e}}=this;return m(e)}};e([t({constructOnly:!0})],g.prototype,`view`,void 0),e([t({constructOnly:!0})],g.prototype,`graphic`,void 0),e([t()],g.prototype,`_operations`,void 0),e([t()],g.prototype,`operations`,null),e([t()],g.prototype,`updating`,null),g=e([n(`esri.views.3d.interactive.editingTools.ManipulatedObject3DGraphic`)],g);export{g as ManipulatedObject3DGraphic};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{EventedAccessor as r}from"../../../../core/Evented.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{UpdatingHandles as o}from"../../../../core/support/UpdatingHandles.js";import{ringNeedsClosure as s,closeRings as c}from"../../../../geometry/support/coordsUtils.js";import{getGraphicEffectiveElevationInfo as l}from"../../../../support/elevationInfoUtils.js";import{EditGeometryOperations as u}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{GraphicManipulator as d}from"../../../interactive/GraphicManipulator.js";import{GraphicState as f}from"../../layers/graphics/GraphicState.js";import{getGraphicAttachmentOrigin as p}from"../manipulatorUtils.js";import{createGraphicGeometryUndoRecord as m}from"./undoRecords.js";const h=Symbol();let g=class extends r{get operations(){return this._operations}get updating(){return this._updatingHandles.updating}get elevationInfo(){return l(this.graphic)}get visible(){return this._graphicState.displaying}get isDraped(){return this._graphicState.isDraped}get origin(){return p(this.view,this.graphic)}constructor(e){super(e),this._updatingHandles=new o}destroy(){this._operations=i(this._operations),this._updatingHandles.destroy()}initialize(){this._graphicState=new f({graphic:this.graphic}),this._graphicState.on(`changed`,()=>this.emit(`committed`)),this.addHandles(this.view.trackGraphicState(this._graphicState)),this.addHandles(this._updatingHandles.add(()=>this.graphic.geometry,e=>{let t=this._operations?.data.geometry;if(e!==t){if(!e||e?.type===`multipoint`||e?.type===`extent`)i(this._operations),this.removeHandles(h),this._operations=null;else if(e.type===`polygon`&&e.rings.some(s)&&(e=e.clone(),c(e)),this._operations?.trySetGeometry(e))this.emit(`modified-externally`);else{i(this._operations),this.removeHandles(h);let t=u.fromGeometry(e,this.view.state.isGlobal);this._operations=t,this.addHandles(t.data.on(`change`,()=>this.graphic.geometry=t.data.geometry),h)}}},a))}createManipulator(e){return new d({view:this.view,graphic:this.graphic,...e})}maskOccludee(){return this.view.maskOccludee(this.graphic)}endInteraction(){this.graphic.geometry?.type===`mesh`&&this.graphic.notifyMeshTransformChanged()}toMap(e){return this.view.toMap(e,{include:[this.graphic]})}createUndoRecord(){let{graphic:{geometry:e}}=this;return m(e)}};e([t({constructOnly:!0})],g.prototype,`view`,void 0),e([t({constructOnly:!0})],g.prototype,`graphic`,void 0),e([t()],g.prototype,`_operations`,void 0),e([t()],g.prototype,`operations`,null),e([t()],g.prototype,`updating`,null),g=e([n(`esri.views.3d.interactive.editingTools.ManipulatedObject3DGraphic`)],g);export{g as ManipulatedObject3DGraphic};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as t,subtract as n,length as r,copy as i,dot as a,scale as o,add as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createScreenPointArray as l,screenPointObjectToArray as u,castScreenPointArray as d}from"../../../../core/screenUtils.js";import f from"../../../../geometry/Point.js";import{projectPoint as p}from"../../../../geometry/projectionUtils.js";import{intersectRay as m,create as h,getNormal as g,fromPositionAndNormal as _}from"../../../../geometry/support/plane.js";import{create as v,closestPoints as y}from"../../../../geometry/support/ray.js";import{projectPoint as b}from"../../../../geometry/support/vector.js";import{sv2d as x}from"../../../../geometry/support/vectorStacks.js";import{getZForElevationMode as S}from"../../../../support/elevationInfoUtils.js";import{EventPipeline as C}from"../../../interactive/dragEventPipeline.js";import{fromScreen as w}from"../../support/geometryUtils/ray.js";import{Intersector as T}from"../../webgl-engine/lib/Intersector.js";import{terrainId as E}from"../../webgl-engine/lib/verticalOffsetUtils.js";function D(e,t){return k(e,()=>t)}function O(e){return k(e,e=>e.plane)}function k(e,t){let n=c(),r=c(),i=!1;return a=>{let o=t(a);if(a.action===`start`){let t=u(a.screenStart,d(x.get())),r=w(e.state.camera,t,W);r!=null&&(i=m(o,r,n))}if(!i)return null;let s=u(a.screenEnd,d(x.get())),c=w(e.state.camera,s,W);return c==null?null:m(o,c,r)?{...a,renderStart:n,renderEnd:r,plane:o,ray:c}:null}}function A(e,t,n=0,r=null,i=null){let a=null;return o=>{if(o.action===`start`&&(a=e.sceneIntersectionHelper.intersectElevationFromScreen(l(o.screenStart.x,o.screenStart.y),t,n,i),a!=null&&r!=null&&!p(a,a,r))||a==null)return null;let s=e.sceneIntersectionHelper.intersectElevationFromScreen(l(o.screenEnd.x,o.screenEnd.y),t,n,i);return s==null||r!=null&&!p(s,s,r)?null:{...o,mapStart:a,mapEnd:s}}}function j(e,t,n,r=null,i=null){return A(e,n,S(t,e,n),r,i)}function M(e,t,n,r){let i=n.toMap(e.screenStart);return i==null?null:j(t,i,n.elevationInfo,r)}function N(e,t,n,r){let i=t.clone();return t=>{let a=e.toMap(t.screenEnd,{excludeLabels:!0});return a==null||(a.z=S(a,e,n),!p(a,a,r))?null:{...t,mapStart:i,mapEnd:a}}}function P(e,r){let i=H,a=U,o=h();e.renderCoordsHelper.worldUpAtPosition(r,i);let s=t(g(o),i,n(a,r,e.state.camera.eye));return t(s,s,i),_(r,s,o)}function F(e,t,n){let r=null,i=new C;return i.next(D(e,P(e,t))).next(I(e,t)).next(R(e,n)).next(e=>{e.mapEnd.x=e.mapStart.x,e.mapEnd.y=e.mapStart.y,r=e}),e=>(r=null,i.execute(e),r)}function I(e,t){let l=c(),u=r(t);e.renderCoordsHelper.worldUpAtPosition(t,l);let d=c(),f=c(),p=i=>(n(i,i,t),b(l,i,i),e.viewingMode===`global`&&r(i)*Math.sign(a(l,i))<-u+.001&&n(i,o(i,l,.001),t),s(i,i,t),i);return e=>(e.renderStart=p(i(d,e.renderStart)),e.renderEnd=p(i(f,e.renderEnd)),e)}function L(e,t){let n=n=>{let r=u(n,d(V)),i=w(e.state.camera,r,W);return i==null?null:y(t,i,H,U)?.[0]};return e=>{let t=n(e.screenStart);if(t==null)return null;let r=n(e.screenEnd);return r==null?null:{...e,renderStart:t,renderEnd:r}}}function R(e,t){let n=e.renderCoordsHelper;return e=>{let r=n.fromRenderCoords(e.renderStart,new f({spatialReference:t})),i=n.fromRenderCoords(e.renderEnd,new f({spatialReference:t}));return r!=null&&i!=null?{...e,mapStart:r,mapEnd:i}:null}}function z(e){let t=null;return n=>{switch(n.action){case`start`:t=e.disableDisplay();break;case`end`:case`cancel`:t!=null&&(t.remove(),t=null)}return n}}function B(e,t=null){let n=new T(e.state.viewingMode);n.options.selectionMode=!0,n.options.store=0,n.options.hud=!1;let r=l(),i={requiresGroundFeedback:!0,enableDraped:!0,exclude:new Set},a=c(),o=t??e.spatialReference,s=t=>{e.map.ground&&e.map.ground.opacity<1?i.exclude.add(E):i.exclude.delete(E),e.sceneIntersectionHelper.intersectIntersectorScreen(u(t,r),n,i);let s=n.results.min,c;if(s.getIntersectionPoint(a))c=s.intersector===7?0:1;else if(n.results.ground.getIntersectionPoint(a))c=0;else return null;return{location:e.renderCoordsHelper.fromRenderCoords(a,new f({spatialReference:o})),surfaceType:c}},d;return e=>{if(e.action===`start`){let t=s(e.screenStart);d=t==null?null:t.location}if(d==null)return null;let t=s(e.screenEnd);return t?.location==null?null:{...e,mapStart:d,mapEnd:t.location,surfaceType:t.surfaceType}}}const V=e(),H=c(),U=c(),W=v();export{R as convertToMapCoordinates,z as hideManipulatorWhileDragging,I as projectToWorldUp,B as screenToMap3D,N as screenToMapAtSceneSurface,j as screenToMapXYAtLocation,M as screenToMapXYForManipulatedObject,D as screenToRenderPlane,O as screenToRenderPlaneFromEvent,L as screenToRenderRay,F as screenToZConstrained};
2
+ import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as t,subtract as n,length as r,copy as i,dot as a,scale as o,add as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{createScreenPointArray as l,screenPointObjectToArray as u,castScreenPointArray as d}from"../../../../core/screenUtils.js";import f from"../../../../geometry/Point.js";import{projectPoint as p}from"../../../../geometry/projectionUtils.js";import{intersectRay as m,create as h,getNormal as g,fromPositionAndNormal as _}from"../../../../geometry/support/plane.js";import{create as v,closestPoints as y}from"../../../../geometry/support/ray.js";import{projectPoint as b}from"../../../../geometry/support/vector.js";import{sv2d as x}from"../../../../geometry/support/vectorStacks.js";import{getZForElevationMode as S}from"../../../../support/elevationInfoUtils.js";import{EventPipeline as C}from"../../../interactive/dragEventPipeline.js";import{fromScreen as w}from"../../support/geometryUtils/ray.js";import{Intersector as T}from"../../webgl-engine/lib/Intersector.js";import{terrainId as E}from"../../webgl-engine/lib/verticalOffsetUtils.js";function D(e,t){return k(e,()=>t)}function O(e){return k(e,e=>e.plane)}function k(e,t){let n=c(),r=c(),i=!1;return a=>{let o=t(a);if(a.action===`start`){let t=u(a.screenStart,d(x.get())),r=w(e.state.camera,t,W);r!=null&&(i=m(o,r,n))}if(!i)return null;let s=u(a.screenEnd,d(x.get())),c=w(e.state.camera,s,W);return c==null?null:m(o,c,r)?{...a,renderStart:n,renderEnd:r,plane:o,ray:c}:null}}function A(e,t,n=0,r=null,i=null){let a=null;return o=>{if(o.action===`start`&&(a=e.sceneIntersectionHelper.intersectElevationFromScreen(l(o.screenStart.x,o.screenStart.y),t,n,i),a!=null&&r!=null&&!p(a,a,r))||a==null)return null;let s=e.sceneIntersectionHelper.intersectElevationFromScreen(l(o.screenEnd.x,o.screenEnd.y),t,n,i);return s==null||r!=null&&!p(s,s,r)?null:{...o,mapStart:a,mapEnd:s}}}function j(e,t,n,r=null,i=null){return A(e,n,S(t,e,n),r,i)}function M(e,t,n,r){let i=n.toMap(e.screenStart);return i==null?null:j(t,i,n.elevationInfo,r)}function N(e,t,n,r){let i=t.clone();return t=>{let a=e.toMap(t.screenEnd,{excludeLabels:!0});return a==null||(a.z=S(a,e,n),!p(a,a,r))?null:{...t,mapStart:i,mapEnd:a}}}function P(e,r){let i=H,a=U,o=h();e.renderCoordsHelper.worldUpAtPosition(r,i);let s=t(g(o),i,n(a,r,e.state.camera.eye));return t(s,s,i),_(r,s,o)}function F(e,t,n){let r=null,i=new C;return i.next(D(e,P(e,t))).next(I(e,t)).next(R(e,n)).next(e=>{e.mapEnd.x=e.mapStart.x,e.mapEnd.y=e.mapStart.y,r=e}),e=>(r=null,i.execute(e),r)}function I(e,t){let l=c(),u=r(t);e.renderCoordsHelper.worldUpAtPosition(t,l);let d=c(),f=c(),p=i=>(n(i,i,t),b(l,i,i),e.state.isGlobal&&r(i)*Math.sign(a(l,i))<-u+.001&&n(i,o(i,l,.001),t),s(i,i,t),i);return e=>(e.renderStart=p(i(d,e.renderStart)),e.renderEnd=p(i(f,e.renderEnd)),e)}function L(e,t){let n=n=>{let r=u(n,d(V)),i=w(e.state.camera,r,W);return i==null?null:y(t,i,H,U)?.[0]};return e=>{let t=n(e.screenStart);if(t==null)return null;let r=n(e.screenEnd);return r==null?null:{...e,renderStart:t,renderEnd:r}}}function R(e,t){let n=e.renderCoordsHelper;return e=>{let r=n.fromRenderCoords(e.renderStart,new f({spatialReference:t})),i=n.fromRenderCoords(e.renderEnd,new f({spatialReference:t}));return r!=null&&i!=null?{...e,mapStart:r,mapEnd:i}:null}}function z(e){let t=null;return n=>{switch(n.action){case`start`:t=e.disableDisplay();break;case`end`:case`cancel`:t!=null&&(t.remove(),t=null)}return n}}function B(e,t=null){let n=new T(e.state.isGlobal);n.options.selectionMode=!0,n.options.store=0,n.options.hud=!1;let r=l(),i={requiresGroundFeedback:!0,enableDraped:!0,exclude:new Set},a=c(),o=t??e.spatialReference,s=t=>{e.map.ground&&e.map.ground.opacity<1?i.exclude.add(E):i.exclude.delete(E),e.sceneIntersectionHelper.intersectIntersectorScreen(u(t,r),n,i);let s=n.results.min,c;if(s.getIntersectionPoint(a))c=s.intersector===7?0:1;else if(n.results.ground.getIntersectionPoint(a))c=0;else return null;return{location:e.renderCoordsHelper.fromRenderCoords(a,new f({spatialReference:o})),surfaceType:c}},d;return e=>{if(e.action===`start`){let t=s(e.screenStart);d=t==null?null:t.location}if(d==null)return null;let t=s(e.screenEnd);return t?.location==null?null:{...e,mapStart:d,mapEnd:t.location,surfaceType:t.surfaceType}}}const V=e(),H=c(),U=c(),W=v();export{R as convertToMapCoordinates,z as hideManipulatorWhileDragging,I as projectToWorldUp,B as screenToMap3D,N as screenToMapAtSceneSurface,j as screenToMapXYAtLocation,M as screenToMapXYForManipulatedObject,D as screenToRenderPlane,O as screenToRenderPlaneFromEvent,L as screenToRenderRay,F as screenToZConstrained};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- const e=128,t=70,n=80,r=.02,i=54,a=100,o=47,s=160,c=.5,l=24,u=9,d=190,f=213,p=60,m=23,h=Math.PI*5/12,g=Math.PI*1/3,_=10,v=.2,y=30,b=53,x=.2,S=.3,C=200,w=3,T=1e6;export{T as alignArrowsScaleThreshold,n as discCollisionRadius,r as discHeight,t as discRadius,o as discRadiusSmall,a as discTranslateArrowOffset,i as discTranslateArrowSize,_ as dragThresholdPx,e as geometrySegments,u as indicatorThickness,d as innerIndicatorRadius,f as outerIndicatorRadius,c as ringHeight,C as ringIndicatorDelayMs,s as ringRadius,w as ringResetAnimationSpeedFactor,l as ringThickness,h as rotateIndicatorArcLength,v as rotateIndicatorArrowPlacementPercentage,p as rotateIndicatorArrowTipLength,m as rotateIndicatorArrowTipRadius,S as rotateIndicatorDirectionBuffer,g as scaleIndicatorArcLength,x as scaleIndicatorDirectionBuffer,y as scaleIndicatorOffset1,b as scaleIndicatorOffset2};
2
+ const e=128,t=70,n=80,r=.02,i=54,a=100,o=47,s=160,c=.5,l=24,u=9,d=190,f=213,p=60,m=23,h=Math.PI*5/12,g=Math.PI/3,_=10,v=.2,y=30,b=53,x=.2,S=.3,C=200,w=3,T=1e6;export{T as alignArrowsScaleThreshold,n as discCollisionRadius,r as discHeight,t as discRadius,o as discRadiusSmall,a as discTranslateArrowOffset,i as discTranslateArrowSize,_ as dragThresholdPx,e as geometrySegments,u as indicatorThickness,d as innerIndicatorRadius,f as outerIndicatorRadius,c as ringHeight,C as ringIndicatorDelayMs,s as ringRadius,w as ringResetAnimationSpeedFactor,l as ringThickness,h as rotateIndicatorArcLength,v as rotateIndicatorArrowPlacementPercentage,p as rotateIndicatorArrowTipLength,m as rotateIndicatorArrowTipRadius,S as rotateIndicatorDirectionBuffer,g as scaleIndicatorArcLength,x as scaleIndicatorDirectionBuffer,y as scaleIndicatorOffset1,b as scaleIndicatorOffset2};
@@ -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{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{isSome as i}from"../../../../../core/arrayUtils.js";import{destroyHandle as a}from"../../../../../core/handleUtils.js";import{initial as o}from"../../../../../core/reactiveUtils.js";import{UpdatingHandles as s}from"../../../../../core/support/UpdatingHandles.js";import c from"../../../../../geometry/Point.js";import l from"../../../../../geometry/Polygon.js";import{initializeProjection as u,project as d}from"../../../../../geometry/projectionUtils.js";import{EditGeometry as f}from"../../../../interactive/editGeometry/EditGeometry.js";import{ControlPointOperations as p}from"./ControlPointOperations.js";let m=class extends t{get operations(){return this._operations}get updating(){return this._updatingHandles.updating}constructor(e){super(e),this._updatingHandles=new s}initialize(){this.addHandles([a(this._updatingHandles),this._updatingHandles.add(()=>{let e=this.element.georeference;return e?.type===`control-points`?e.controlPoints:null},e=>this._elementControlPointsChanged(e),o)])}_elementControlPointsChanged(e){let t=e?.map(({mapPoint:e})=>e).filter(i),n=this.view.spatialReference;this._updatingHandles.consumePromise(this._whenProjected(t,n,e=>{if(!e){this._replaceOperations(null);return}let{_operations:t}=this,r=e.map(({x:e,y:t})=>[e,t]);r.push(r[0].slice());let i=new l({rings:[r],spatialReference:n});if(t?.trySetGeometry(i)){this.onModifiedExternally();return}let a=this.view.state.viewingMode;this._replaceOperations(new p(f.fromGeometry(i,a),a,e=>this._operationsGeometryChanged(e)))}))}_operationsGeometryChanged(e){let{element:{georeference:t},_operations:n}=this;if(!n||!t||t.type!==`control-points`||!t.controlPoints)return;let r=n.data.geometry,a=t.controlPoints.map(({mapPoint:e})=>e).filter(i),o=+!!n.data.parts[0].isClosed();if(r.rings[0]?.length-o!==a.length)return;let s=r.rings[0].map(([e,t])=>new c({x:e,y:t,spatialReference:r.spatialReference}));s.length-=o;let l=a.map(({spatialReference:e})=>e);this._updatingHandles.consumePromise(this._whenProjected(s,l,t=>this._updateElementControlPoints(t,e)))}_updateElementControlPoints(e,t){let{georeference:n}=this.element;if(!n||!e||n.type!==`control-points`||n.controlPoints?.length!==e?.length)return;let r=n.controlPoints;if(r?.length===e.length)for(let i=0;i<r.length;i++)t&&(r[i].sourcePoint=n.toSource(e[i])),r[i].mapPoint=e[i]}async _whenProjected(e,t,n){if(!e){n(e);return}let{_operations:r,element:{georeference:i}}=this,a=e.map(({spatialReference:e})=>e),o=Array.isArray(t)?t:Array(a.length).fill(t);await u(Array.from(a).map((e,t)=>({source:e,dest:o[t]})));let s=e.map((e,t)=>d(e,o[t]));r===this._operations&&i===this.element.georeference&&n(s)}_replaceOperations(e){this._operations&&(this.removeHandles(this._operations),this._operations.destroy()),this._operations=e}};e([n({constructOnly:!0})],m.prototype,`view`,void 0),e([n({constructOnly:!0})],m.prototype,`layer`,void 0),e([n({constructOnly:!0})],m.prototype,`element`,void 0),e([n({constructOnly:!0})],m.prototype,`onModifiedExternally`,void 0),e([n()],m.prototype,`_operations`,void 0),e([n()],m.prototype,`operations`,null),e([n()],m.prototype,`updating`,null),m=e([r(`esri.views.3d.interactive.editingTools.media.MediaElementControllerControlPoints`)],m);export{m as MediaElementControllerControlPoints};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{isSome as i}from"../../../../../core/arrayUtils.js";import{destroyHandle as a}from"../../../../../core/handleUtils.js";import{initial as o}from"../../../../../core/reactiveUtils.js";import{UpdatingHandles as s}from"../../../../../core/support/UpdatingHandles.js";import c from"../../../../../geometry/Point.js";import l from"../../../../../geometry/Polygon.js";import{initializeProjection as u,project as d}from"../../../../../geometry/projectionUtils.js";import{EditGeometry as f}from"../../../../interactive/editGeometry/EditGeometry.js";import{ControlPointOperations as p}from"./ControlPointOperations.js";let m=class extends t{get operations(){return this._operations}get updating(){return this._updatingHandles.updating}constructor(e){super(e),this._updatingHandles=new s}initialize(){this.addHandles([a(this._updatingHandles),this._updatingHandles.add(()=>{let e=this.element.georeference;return e?.type===`control-points`?e.controlPoints:null},e=>this._elementControlPointsChanged(e),o)])}_elementControlPointsChanged(e){let t=e?.map(({mapPoint:e})=>e).filter(i),n=this.view.spatialReference;this._updatingHandles.consumePromise(this._whenProjected(t,n,e=>{if(!e){this._replaceOperations(null);return}let{_operations:t}=this,r=e.map(({x:e,y:t})=>[e,t]);r.push(r[0].slice());let i=new l({rings:[r],spatialReference:n});if(t?.trySetGeometry(i)){this.onModifiedExternally();return}let a=this.view.state.isGlobal;this._replaceOperations(new p(f.fromGeometry(i,a),a,e=>this._operationsGeometryChanged(e)))}))}_operationsGeometryChanged(e){let{element:{georeference:t},_operations:n}=this;if(!n||!t||t.type!==`control-points`||!t.controlPoints)return;let r=n.data.geometry,a=t.controlPoints.map(({mapPoint:e})=>e).filter(i),o=+!!n.data.parts[0].isClosed();if(r.rings[0]?.length-o!==a.length)return;let s=r.rings[0].map(([e,t])=>new c({x:e,y:t,spatialReference:r.spatialReference}));s.length-=o;let l=a.map(({spatialReference:e})=>e);this._updatingHandles.consumePromise(this._whenProjected(s,l,t=>this._updateElementControlPoints(t,e)))}_updateElementControlPoints(e,t){let{georeference:n}=this.element;if(!n||!e||n.type!==`control-points`||n.controlPoints?.length!==e?.length)return;let r=n.controlPoints;if(r?.length===e.length)for(let i=0;i<r.length;i++)t&&(r[i].sourcePoint=n.toSource(e[i])),r[i].mapPoint=e[i]}async _whenProjected(e,t,n){if(!e){n(e);return}let{_operations:r,element:{georeference:i}}=this,a=e.map(({spatialReference:e})=>e),o=Array.isArray(t)?t:Array(a.length).fill(t);await u(Array.from(a).map((e,t)=>({source:e,dest:o[t]})));let s=e.map((e,t)=>d(e,o[t]));r===this._operations&&i===this.element.georeference&&n(s)}_replaceOperations(e){this._operations&&(this.removeHandles(this._operations),this._operations.destroy()),this._operations=e}};e([n({constructOnly:!0})],m.prototype,`view`,void 0),e([n({constructOnly:!0})],m.prototype,`layer`,void 0),e([n({constructOnly:!0})],m.prototype,`element`,void 0),e([n({constructOnly:!0})],m.prototype,`onModifiedExternally`,void 0),e([n()],m.prototype,`_operations`,void 0),e([n()],m.prototype,`operations`,null),e([n()],m.prototype,`updating`,null),m=e([r(`esri.views.3d.interactive.editingTools.media.MediaElementControllerControlPoints`)],m);export{m as MediaElementControllerControlPoints};
@@ -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{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{destroyHandle as i}from"../../../../../core/handleUtils.js";import{initial as a}from"../../../../../core/reactiveUtils.js";import{UpdatingHandles as o}from"../../../../../core/support/UpdatingHandles.js";import{projectAsync as s}from"../../../../../geometry/projectionUtils.js";import{EditGeometryOperations as c}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let l=class extends t{get operations(){return this._operations}get updating(){return this._updatingHandles.updating}constructor(e){super(e),this._updatingHandles=new o}initialize(){this.addHandles([i(this._updatingHandles),this._updatingHandles.add(()=>this.element.georeference?.coords,e=>this._elementCoordinatesChanged(e),a)])}_elementCoordinatesChanged(e){this._updatedElementCoordinates!==e&&this._updatingHandles.consumePromise(this._whenProjected(e,this.view.spatialReference,e=>{if(!e){this._replaceOperations(null);return}let{_operations:t}=this;t?.trySetGeometry(e)?this.onModifiedExternally():this._replaceOperations(c.fromGeometry(e,this.view.state.viewingMode))}))}_operationsGeometryChanged(){let{element:{georeference:e},_operations:t}=this;if(!t||!e)return;let n=t.data.geometry;if(!e.coords){this._updateElementCoordinates(n);return}let r=e.coords.spatialReference;this._updatingHandles.consumePromise(this._whenProjected(n,r,e=>this._updateElementCoordinates(e)))}_updateElementCoordinates(e){let{georeference:t}=this.element;t&&(t.coords=e,this._updatedElementCoordinates=t.coords)}async _whenProjected(e,t,n){if(!e){n(e);return}let{_operations:r,element:{georeference:i}}=this,a=await s(e,t);r===this._operations&&i===this.element.georeference&&n(a)}_replaceOperations(e){this._operations&&(this.removeHandles(this._operations),this._operations.destroy()),this._operations=e,e&&this.addHandles(e.data.on(`change`,()=>this._operationsGeometryChanged()),e),this.onModifiedExternally()}};e([n({constructOnly:!0})],l.prototype,`view`,void 0),e([n({constructOnly:!0})],l.prototype,`layer`,void 0),e([n({constructOnly:!0})],l.prototype,`element`,void 0),e([n({constructOnly:!0})],l.prototype,`onModifiedExternally`,void 0),e([n()],l.prototype,`_operations`,void 0),e([n()],l.prototype,`operations`,null),e([n()],l.prototype,`updating`,null),l=e([r(`esri.views.3d.interactive.editingTools.media.MediaElementControllerShape`)],l);export{l as MediaElementControllerShape};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{destroyHandle as i}from"../../../../../core/handleUtils.js";import{initial as a}from"../../../../../core/reactiveUtils.js";import{UpdatingHandles as o}from"../../../../../core/support/UpdatingHandles.js";import{projectAsync as s}from"../../../../../geometry/projectionUtils.js";import{EditGeometryOperations as c}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let l=class extends t{get operations(){return this._operations}get updating(){return this._updatingHandles.updating}constructor(e){super(e),this._updatingHandles=new o}initialize(){this.addHandles([i(this._updatingHandles),this._updatingHandles.add(()=>this.element.georeference?.coords,e=>this._elementCoordinatesChanged(e),a)])}_elementCoordinatesChanged(e){this._updatedElementCoordinates!==e&&this._updatingHandles.consumePromise(this._whenProjected(e,this.view.spatialReference,e=>{if(!e){this._replaceOperations(null);return}let{_operations:t}=this;t?.trySetGeometry(e)?this.onModifiedExternally():this._replaceOperations(c.fromGeometry(e,this.view.state.isGlobal))}))}_operationsGeometryChanged(){let{element:{georeference:e},_operations:t}=this;if(!t||!e)return;let n=t.data.geometry;if(!e.coords){this._updateElementCoordinates(n);return}let r=e.coords.spatialReference;this._updatingHandles.consumePromise(this._whenProjected(n,r,e=>this._updateElementCoordinates(e)))}_updateElementCoordinates(e){let{georeference:t}=this.element;t&&(t.coords=e,this._updatedElementCoordinates=t.coords)}async _whenProjected(e,t,n){if(!e){n(e);return}let{_operations:r,element:{georeference:i}}=this,a=await s(e,t);r===this._operations&&i===this.element.georeference&&n(a)}_replaceOperations(e){this._operations&&(this.removeHandles(this._operations),this._operations.destroy()),this._operations=e,e&&this.addHandles(e.data.on(`change`,()=>this._operationsGeometryChanged()),e),this.onModifiedExternally()}};e([n({constructOnly:!0})],l.prototype,`view`,void 0),e([n({constructOnly:!0})],l.prototype,`layer`,void 0),e([n({constructOnly:!0})],l.prototype,`element`,void 0),e([n({constructOnly:!0})],l.prototype,`onModifiedExternally`,void 0),e([n()],l.prototype,`_operations`,void 0),e([n()],l.prototype,`operations`,null),e([n()],l.prototype,`updating`,null),l=e([r(`esri.views.3d.interactive.editingTools.media.MediaElementControllerShape`)],l);export{l as MediaElementControllerShape};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as r}from"../../../../../core/accessorSupport/ensureType.js";import{isSome as i}from"../../../../../core/arrayUtils.js";import a from"../../../../../core/Collection.js";import{EventEmitter as o}from"../../../../../core/Evented.js";import{makeHandle as s}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as c}from"../../../../../core/maybe.js";import{debounce as l}from"../../../../../core/promiseUtils.js";import{scale as u,zeroMeters as d}from"../../../../../core/quantity.js";import{watch as f,initial as p,syncAndInitial as ee}from"../../../../../core/reactiveUtils.js";import{UpdatingHandles as te}from"../../../../../core/support/UpdatingHandles.js";import m from"../../../../../geometry/Point.js";import{makeDehydratedPoint as h}from"../../../../../layers/graphics/dehydratedPoint.js";import{dragManipulatedObjectMany as g,resetManipulatedObjectMany as _,sceneSnappingAtProjectedLocation as v}from"../../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as y}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{InteractiveToolBase as b}from"../../../../interactive/InteractiveToolBase.js";import x from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as S}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as C}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{MovePointTooltipInfo as ne}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as w}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as T}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as E}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{makeTooltip as D,enterInputModeIfAvailable as O}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{verticalSignedDistanceBetweenPoints as k}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as A}from"../../../../support/GeometryWorkerHandle.js";import{createElevationUpdateHandle as j}from"../../../support/elevationUpdateUtils.js";import{SnappingVisualizer3D as M}from"../../SnappingVisualizer3D.js";import{OutlineVisualElement as N}from"../../visualElements/OutlineVisualElement.js";import{orientation as P}from"../geometryUtils.js";import{manipulatedObjectGeometry as F,supportsElevationMode as I}from"../manipulatedObjectUtils.js";import{discRadius as L}from"../manipulations/config.js";import{MoveManipulation as R}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as re}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as z}from"../manipulations/MoveXYObjectManipulation.js";import{canMoveZOperations as B}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as V}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as H}from"../tooltipUtils3D.js";import{createVisualElements as U}from"../visualElementUtils.js";import{isSupportedObject as W}from"./isSupportedObject.js";class G{constructor(e){this.objects=e,this.type=`move-start`}}class K{constructor(e,t,n){this.dx=e,this.dy=t,this.objects=n,this.type=`move`}}class q{constructor(e){this.objects=e,this.type=`move-stop`}}class J{constructor(e){this.objects=e,this.type=`hold`}}const Y=Symbol(`manipulators`),X=Symbol(`tooltips`),Z=Symbol(`move-manipulator-display`);let Q=class extends b{get _infos(){return Array.from(this._infosByType.values())}constructor(e){super(e),this._infosByType=new Map,this.events=new o,this.objects=new a,this.enableVisualElements=!0,this.enableZ=!0,this.manipulatorRadius=null,this.toolOptions=new x,this.type=`move-3d`,this._measurementWorker=new A({preloadGeodetic:!0}),this._ownedTooltip=null,this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new te,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=l(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){let{view:e}=this;this.tooltip??=this._ownedTooltip=D(()=>({view:e,options:this.toolOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,e=>{e.removed.forEach(e=>this.removeHandles(e)),this._updateObjectInfos(e),this._setupObjectUpdateHandles(e.added),this._refreshManipulators(),this._connectTooltips()}));let t=this.objects.toArray();this._updateObjectInfos({added:t,removed:[]}),this._setupObjectUpdateHandles(t),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this._ownedTooltip=c(this._ownedTooltip),this._moveManipulation=c(this._moveManipulation),this._set(`view`,null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(e){if(this.destroyed||O(e,this.tooltip))return;let t=this.firstGrabbedManipulator;if(e.type===`hold`&&t!=null){let e=this._getActiveObjectInfos(this._infos,t).map(({object:e})=>e);this.events.emit(`hold`,new J(e))}return super.onInputEvent(e)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){let{objects:e}=this;if(e.length!==1)return!1;let t=F(e.at(0))?.type;return t===`point`||t===`mesh`}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:e,removed:t}){for(let t of e){if(W(t)!==0)continue;let e=new ie(t);this._infosByType.set(t,e)}for(let e of t)this._infosByType.delete(e)}_setupObjectUpdateHandles(e){for(let t of e){let e=this._infosByType.get(t);this.addHandles(V(e.object),t),I(t)&&this.addHandles(f(()=>{let{mode:e,unit:n,offset:r}=t.elevationInfo;return[e,n,r]},()=>this._refreshManipulators()),t)}}_refreshManipulators(){if(this.removeHandles(Y),this.removeHandles(Z),this._moveManipulation=c(this._moveManipulation),this.manipulators.removeAll(),this._infosByType.size===0)return;let e=this._infos;this._createManipulators(e),this._createVisualElements(e),this._updateMoveManipulation(e)}_createManipulators(e){for(let t of e){let n=t.object;t.manipulationXY=new z({tool:this,view:this.view,object:n}),t.manipulationXY.forEachManipulator(e=>{this.addHandles([e.events.on(`immediate-click`,e=>{this.events.emit(`immediate-click`,{...e,object:n}),e.stopPropagation()}),e.events.on(`grab-changed`,({action:e})=>{e===`start`?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],Y)}),this.addHandles(t.manipulationXY.createDragPipeline((t,n,r,i)=>this._buildDragEventPipeline(e,0,t,n,r,i)),Y)}this._createMoveManipulation(e)}_updateMoveManipulatorDisplay(){let e=this._infos.some(e=>e.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!e),this.removeHandles(Z),e&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),Z)}_createMoveManipulation(e){let t=new R({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:this.manipulatorRadius??(e.length===1?R.radiusForSymbol(e[0].object.graphic?.symbol):L)});this._moveManipulation=t,t.elevationInfo={mode:`absolute-height`,offset:0},t.forEachManipulator(e=>{this.addHandles(e.events.on(`immediate-click`,n=>{let r=this.objects.at(0);!t.zManipulation.hasManipulator(e)&&this.objects.length===1&&r&&this.events.emit(`immediate-click`,{...n,object:r}),n.stopPropagation()}),Y)});let n=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._showTooltip(e):this._hideTooltip()}),t.events.on(`grab-changed`,()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=d)})],Y)};this._moveManipulation.xyManipulation.forEachManipulator(n(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(n(1)),this._moveManipulation.zManipulation.forEachManipulator(n(2));let r=()=>this._updateMoveManipulation(e);for(let t of e){this.addHandles([t.object.on(`committed`,r),this._updatingHandles.add(()=>t.object.visible,r)],Y);let n=Symbol();this.addHandles(this._updatingHandles.add(()=>t.object.isDraped,r=>{this._updateMoveManipulation(e),this.removeHandles(n),r&&this.addHandles(j({view:this.view,geometry:()=>t.object.graphic?.geometry,elevationInfo:t.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(e)}),n)},p),Y),this.addHandles(s(()=>this.removeHandles(n)),Y)}let i=e[e.length-1];this.addHandles(i.object.on(`committed`,()=>this._updateMoveManipulationAngle(i)),Y);let{object:a}=i,{operations:o}=a;if(o){let n=a.graphic;this.addHandles(t.createDragPipeline((t,n,r,i,a)=>this._buildDragEventPipeline(e,t,n,r,i,a),a.elevationInfo,o.data.spatialReference,n),Y)}this._updateMoveManipulationAngle(i)}_createVisualElements(e){if(this.enableVisualElements)for(let t of e){let n=t.object,r=U({view:this.view,object:n,forEachManipulator:e=>{t.manipulationXY?.forEachManipulator(e),this._moveManipulation?.forEachManipulator(e)},onManipulatorsChanged:()=>s()});r!=null&&(t.geometryRepresentation=r.visualElement,t.geometryRepresentation instanceof N&&this.addHandles([t.geometryRepresentation.events.on(`attachment-origin-changed`,()=>{t.object.isDraped||this._updateMoveManipulation(e)}),this._updatingHandles.add(()=>t.object.isDraped,()=>this._updateMoveManipulation(e))],Y),this.addHandles(r,Y))}}_updateMoveManipulationAngle(e){this._moveManipulation&&(this._moveManipulation.angle=P(F(e.object)))}_updateMoveManipulation(e){let t=h(0,0,0,this.view.spatialReference),n=0,r=!1,i=this._moveManipulation;if(i){for(let i of e){if(!i.object.visible)continue;this.enableZ&&B(i.object.operations,i.object.elevationInfo)&&(r=!0);let e=i.geometryRepresentation instanceof N&&!i.object.isDraped?i.geometryRepresentation.attachmentOrigin:i.object.origin;if(e!=null){let{x:r,y:i,z:a}=e;t.x+=r,t.y+=i,a&&(t.z??=0,t.z+=a),n++}}n>0?(t.x/=n,t.y/=n,t.z??=0,t.z/=n,i.location=t,i.xyManipulation.available=!0,i.xyAxisManipulation.available=!0,i.zManipulation.available=r):i.available=!1}}_buildDragEventPipeline(e,t,n,r,i,a){let o=[],s=[],c=null,l=null,u=()=>{for(let e of o)e.dragging=!1;o.length=0,s.length=0,c=null,l=null,this._updateMoveManipulatorDisplay()};if(e.length===1&&t===0){let t=e[0].object;({steps:r,cancel:i}=this._buildSnappingPipelineSteps(t,t.elevationInfo,r,i,a))}return i=i.next(e=>l?.(e)).next(()=>(s.length&&this.events.emit(`move-stop`,new q(s)),this.destroyed||u(),null)),r=r.next(t=>{if(t.action===`start`){o.length=0,s.length=0;for(let t of this._getActiveObjectInfos(e,n))o.push(t),s.push(t.object),t.dragging=!0;if(s.length!==0&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),c=g(s),l=_(s),this._emitRecordUndo(),this.events.emit(`move-start`,new G(s)),this.destroyed))return null}return s.length===0?null:t}).next(e=>c?.(e)).next(e=>(this._updateMoveTooltip(t,e),e)).next(e=>{switch(e.action){case`start`:case`update`:if(e.translationX||e.translationY||e.translationZ){let t=this.view.toScreen(e.mapStart),n=this.view.toScreen(e.mapEnd);if(!t||!n)return null;let r=n.x-t.x,i=n.y-t.y;if(this.events.emit(`move`,new K(r,i,s)),this.destroyed)return null}break;case`end`:if(this.events.emit(`move-stop`,new q(s)),this.destroyed)return null;u()}return null}),{steps:r,cancel:i}}_getActiveObjectInfos(e,t){return e.filter(e=>!e.dragging&&(e.manipulationXY?.hasManipulator(t)||!e.manipulationXY?.grabbing))}_connectTooltips(){this.removeHandles(X),this._latestTooltipInfo=null;let e;if(this._shouldShowMovePointTooltip){let t=this.objects.at(0),{events:n}=this;this._movePointTooltipInfo??=new ne({viewType:this.view.type,toolOptions:this.toolOptions});let r={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),n.emit(`move-start`,new G([t]))},onMove:()=>n.emit(`move`,new K(0,0,[t])),onMoveStop:()=>n.emit(`move-stop`,new q([t])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};e=H(this.tooltip,t,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:r,onRecordUndo:e=>n.emit(`record-undo`,{updates:[e]})}))}else e=this._updatingHandles.add(()=>this.toolOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,e=>{this.tooltip.info=e},ee);this.addHandles(e,X)}_showTooltip(e){this._shouldShowMovePointTooltip||this._updateMoveTooltip(e)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(e,t){if(this._shouldShowMovePointTooltip||this.objects.length===0)return;let{toolOptions:n}=this;switch(e){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new w({toolOptions:n}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,t,(e,t)=>this._measurementWorker.autoDistance2DBetweenPoints($(e),$(t))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new T({toolOptions:n}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,t,async(e,n)=>u(await this._measurementWorker.autoDistance2DBetweenPoints($(e),$(n)),re(t))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new E({toolOptions:n}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,t,k))}this._latestTooltipInfo.toolOptions=n}async _updateMoveTooltipDistanceAsync(e,t,n){if(t!=null&&t.action!==`end`){let{mapStart:r,mapEnd:i}=t;e.distance=await n(r,i)??d}else e.distance=d}_emitRecordUndo(){let e=this.objects.toArray().map(e=>e.createUndoRecord?.()).filter(i);e.length>0&&this.events.emit(`record-undo`,{updates:e})}_buildSnappingPipelineSteps(e,t,n,r,i){let a=F(e);if(a==null||a.type!==`point`&&a.type!==`mesh`)return{steps:n,cancel:r};let o=(a.type===`point`?a:a.origin).clone(),s=new S({elevationInfo:t,pointer:i,editGeometryOperations:y.fromGeometry(o,this.view.state.viewingMode),visualizer:new M,excludeFeature:e.graphic}),c=this.snappingManager,{snappingStep:l,cancelSnapping:u}=C({snappingContext:s,snappingManager:c,updatingHandles:this._updatingHandles,useZ:!1});return r=r.next(u),n=n.next(e=>{let t=s.coordinateHelper.pointToVector(o);return{...e,snapOrigin:t}}).next(v(this.view,t)).next(...l),{steps:n,cancel:r}}get test(){}};e([t({constructOnly:!0,nonNullable:!0})],Q.prototype,`view`,void 0),e([t()],Q.prototype,`objects`,void 0),e([t({constructOnly:!0,nonNullable:!0})],Q.prototype,`enableVisualElements`,void 0),e([t({constructOnly:!0,nonNullable:!0})],Q.prototype,`enableZ`,void 0),e([t({constructOnly:!0})],Q.prototype,`manipulatorRadius`,void 0),e([t({constructOnly:!0,type:x})],Q.prototype,`toolOptions`,void 0),e([t({constructOnly:!0})],Q.prototype,`snappingManager`,void 0),e([t()],Q.prototype,`type`,void 0),e([t()],Q.prototype,`updating`,null),e([t()],Q.prototype,`tooltip`,void 0),e([t()],Q.prototype,`_ownedTooltip`,void 0),e([t()],Q.prototype,`_latestTooltipInfo`,void 0),e([t()],Q.prototype,`_shouldShowMovePointTooltip`,null),e([t()],Q.prototype,`activeTooltipInfo`,null),Q=e([n(`esri.views.3d.interactive.editingTools.move.MoveTool3D`)],Q);const $=r(m);class ie{constructor(e){this.object=e,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{J as HoldEvent,K as MoveEvent,G as MoveStartEvent,q as MoveStopEvent,Q as MoveTool3D};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as r}from"../../../../../core/accessorSupport/ensureType.js";import{isSome as i}from"../../../../../core/arrayUtils.js";import a from"../../../../../core/Collection.js";import{EventEmitter as o}from"../../../../../core/Evented.js";import{makeHandle as s}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as c}from"../../../../../core/maybe.js";import{debounce as l}from"../../../../../core/promiseUtils.js";import{scale as u,zeroMeters as d}from"../../../../../core/quantity.js";import{watch as f,initial as p,syncAndInitial as ee}from"../../../../../core/reactiveUtils.js";import{UpdatingHandles as te}from"../../../../../core/support/UpdatingHandles.js";import m from"../../../../../geometry/Point.js";import{makeDehydratedPoint as h}from"../../../../../layers/graphics/dehydratedPoint.js";import{dragManipulatedObjectMany as g,resetManipulatedObjectMany as _,sceneSnappingAtProjectedLocation as v}from"../../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as y}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{InteractiveToolBase as b}from"../../../../interactive/InteractiveToolBase.js";import x from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as S}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as C}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{MovePointTooltipInfo as ne}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as w}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as T}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as E}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{makeTooltip as D,enterInputModeIfAvailable as O}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{verticalSignedDistanceBetweenPoints as k}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as A}from"../../../../support/GeometryWorkerHandle.js";import{createElevationUpdateHandle as j}from"../../../support/elevationUpdateUtils.js";import{SnappingVisualizer3D as M}from"../../SnappingVisualizer3D.js";import{OutlineVisualElement as N}from"../../visualElements/OutlineVisualElement.js";import{orientation as P}from"../geometryUtils.js";import{manipulatedObjectGeometry as F,supportsElevationMode as I}from"../manipulatedObjectUtils.js";import{discRadius as L}from"../manipulations/config.js";import{MoveManipulation as R}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as re}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as z}from"../manipulations/MoveXYObjectManipulation.js";import{canMoveZOperations as B}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as V}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as H}from"../tooltipUtils3D.js";import{createVisualElements as U}from"../visualElementUtils.js";import{isSupportedObject as W}from"./isSupportedObject.js";class G{constructor(e){this.objects=e,this.type=`move-start`}}class K{constructor(e,t,n){this.dx=e,this.dy=t,this.objects=n,this.type=`move`}}class q{constructor(e){this.objects=e,this.type=`move-stop`}}class J{constructor(e){this.objects=e,this.type=`hold`}}const Y=Symbol(`manipulators`),X=Symbol(`tooltips`),Z=Symbol(`move-manipulator-display`);let Q=class extends b{get _infos(){return Array.from(this._infosByType.values())}constructor(e){super(e),this._infosByType=new Map,this.events=new o,this.objects=new a,this.enableVisualElements=!0,this.enableZ=!0,this.manipulatorRadius=null,this.toolOptions=new x,this.type=`move-3d`,this._measurementWorker=new A({preloadGeodetic:!0}),this._ownedTooltip=null,this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new te,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=l(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){let{view:e}=this;this.tooltip??=this._ownedTooltip=D(()=>({view:e,options:this.toolOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,e=>{e.removed.forEach(e=>this.removeHandles(e)),this._updateObjectInfos(e),this._setupObjectUpdateHandles(e.added),this._refreshManipulators(),this._connectTooltips()}));let t=this.objects.toArray();this._updateObjectInfos({added:t,removed:[]}),this._setupObjectUpdateHandles(t),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this._ownedTooltip=c(this._ownedTooltip),this._moveManipulation=c(this._moveManipulation),this._set(`view`,null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(e){if(this.destroyed||O(e,this.tooltip))return;let t=this.firstGrabbedManipulator;if(e.type===`hold`&&t!=null){let e=this._getActiveObjectInfos(this._infos,t).map(({object:e})=>e);this.events.emit(`hold`,new J(e))}return super.onInputEvent(e)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){let{objects:e}=this;if(e.length!==1)return!1;let t=F(e.at(0))?.type;return t===`point`||t===`mesh`}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:e,removed:t}){for(let t of e){if(W(t)!==0)continue;let e=new ie(t);this._infosByType.set(t,e)}for(let e of t)this._infosByType.delete(e)}_setupObjectUpdateHandles(e){for(let t of e){let e=this._infosByType.get(t);this.addHandles(V(e.object),t),I(t)&&this.addHandles(f(()=>{let{mode:e,unit:n,offset:r}=t.elevationInfo;return[e,n,r]},()=>this._refreshManipulators()),t)}}_refreshManipulators(){if(this.removeHandles(Y),this.removeHandles(Z),this._moveManipulation=c(this._moveManipulation),this.manipulators.removeAll(),this._infosByType.size===0)return;let e=this._infos;this._createManipulators(e),this._createVisualElements(e),this._updateMoveManipulation(e)}_createManipulators(e){for(let t of e){let n=t.object;t.manipulationXY=new z({tool:this,view:this.view,object:n}),t.manipulationXY.forEachManipulator(e=>{this.addHandles([e.events.on(`immediate-click`,e=>{this.events.emit(`immediate-click`,{...e,object:n}),e.stopPropagation()}),e.events.on(`grab-changed`,({action:e})=>{e===`start`?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],Y)}),this.addHandles(t.manipulationXY.createDragPipeline((t,n,r,i)=>this._buildDragEventPipeline(e,0,t,n,r,i)),Y)}this._createMoveManipulation(e)}_updateMoveManipulatorDisplay(){let e=this._infos.some(e=>e.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!e),this.removeHandles(Z),e&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),Z)}_createMoveManipulation(e){let t=new R({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:this.manipulatorRadius??(e.length===1?R.radiusForSymbol(e[0].object.graphic?.symbol):L)});this._moveManipulation=t,t.elevationInfo={mode:`absolute-height`,offset:0},t.forEachManipulator(e=>{this.addHandles(e.events.on(`immediate-click`,n=>{let r=this.objects.at(0);!t.zManipulation.hasManipulator(e)&&this.objects.length===1&&r&&this.events.emit(`immediate-click`,{...n,object:r}),n.stopPropagation()}),Y)});let n=e=>t=>{this.addHandles([t.events.on(`focus-changed`,({action:t})=>{t===`focus`?this._showTooltip(e):this._hideTooltip()}),t.events.on(`grab-changed`,()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=d)})],Y)};this._moveManipulation.xyManipulation.forEachManipulator(n(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(n(1)),this._moveManipulation.zManipulation.forEachManipulator(n(2));let r=()=>this._updateMoveManipulation(e);for(let t of e){this.addHandles([t.object.on(`committed`,r),this._updatingHandles.add(()=>t.object.visible,r)],Y);let n=Symbol();this.addHandles(this._updatingHandles.add(()=>t.object.isDraped,r=>{this._updateMoveManipulation(e),this.removeHandles(n),r&&this.addHandles(j({view:this.view,geometry:()=>t.object.graphic?.geometry,elevationInfo:t.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(e)}),n)},p),Y),this.addHandles(s(()=>this.removeHandles(n)),Y)}let i=e[e.length-1];this.addHandles(i.object.on(`committed`,()=>this._updateMoveManipulationAngle(i)),Y);let{object:a}=i,{operations:o}=a;if(o){let n=a.graphic;this.addHandles(t.createDragPipeline((t,n,r,i,a)=>this._buildDragEventPipeline(e,t,n,r,i,a),a.elevationInfo,o.data.spatialReference,n),Y)}this._updateMoveManipulationAngle(i)}_createVisualElements(e){if(this.enableVisualElements)for(let t of e){let n=t.object,r=U({view:this.view,object:n,forEachManipulator:e=>{t.manipulationXY?.forEachManipulator(e),this._moveManipulation?.forEachManipulator(e)},onManipulatorsChanged:()=>s()});r!=null&&(t.geometryRepresentation=r.visualElement,t.geometryRepresentation instanceof N&&this.addHandles([t.geometryRepresentation.events.on(`attachment-origin-changed`,()=>{t.object.isDraped||this._updateMoveManipulation(e)}),this._updatingHandles.add(()=>t.object.isDraped,()=>this._updateMoveManipulation(e))],Y),this.addHandles(r,Y))}}_updateMoveManipulationAngle(e){this._moveManipulation&&(this._moveManipulation.angle=P(F(e.object)))}_updateMoveManipulation(e){let t=h(0,0,0,this.view.spatialReference),n=0,r=!1,i=this._moveManipulation;if(i){for(let i of e){if(!i.object.visible)continue;this.enableZ&&B(i.object.operations,i.object.elevationInfo)&&(r=!0);let e=i.geometryRepresentation instanceof N&&!i.object.isDraped?i.geometryRepresentation.attachmentOrigin:i.object.origin;if(e!=null){let{x:r,y:i,z:a}=e;t.x+=r,t.y+=i,a&&(t.z??=0,t.z+=a),n++}}n>0?(t.x/=n,t.y/=n,t.z??=0,t.z/=n,i.location=t,i.xyManipulation.available=!0,i.xyAxisManipulation.available=!0,i.zManipulation.available=r):i.available=!1}}_buildDragEventPipeline(e,t,n,r,i,a){let o=[],s=[],c=null,l=null,u=()=>{for(let e of o)e.dragging=!1;o.length=0,s.length=0,c=null,l=null,this._updateMoveManipulatorDisplay()};if(e.length===1&&t===0){let t=e[0].object;({steps:r,cancel:i}=this._buildSnappingPipelineSteps(t,t.elevationInfo,r,i,a))}return i=i.next(e=>l?.(e)).next(()=>(s.length&&this.events.emit(`move-stop`,new q(s)),this.destroyed||u(),null)),r=r.next(t=>{if(t.action===`start`){o.length=0,s.length=0;for(let t of this._getActiveObjectInfos(e,n))o.push(t),s.push(t.object),t.dragging=!0;if(s.length!==0&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),c=g(s),l=_(s),this._emitRecordUndo(),this.events.emit(`move-start`,new G(s)),this.destroyed))return null}return s.length===0?null:t}).next(e=>c?.(e)).next(e=>(this._updateMoveTooltip(t,e),e)).next(e=>{switch(e.action){case`start`:case`update`:if(e.translationX||e.translationY||e.translationZ){let t=this.view.toScreen(e.mapStart),n=this.view.toScreen(e.mapEnd);if(!t||!n)return null;let r=n.x-t.x,i=n.y-t.y;if(this.events.emit(`move`,new K(r,i,s)),this.destroyed)return null}break;case`end`:if(this.events.emit(`move-stop`,new q(s)),this.destroyed)return null;u()}return null}),{steps:r,cancel:i}}_getActiveObjectInfos(e,t){return e.filter(e=>!e.dragging&&(e.manipulationXY?.hasManipulator(t)||!e.manipulationXY?.grabbing))}_connectTooltips(){this.removeHandles(X),this._latestTooltipInfo=null;let e;if(this._shouldShowMovePointTooltip){let t=this.objects.at(0),{events:n}=this;this._movePointTooltipInfo??=new ne({viewType:this.view.type,toolOptions:this.toolOptions});let r={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),n.emit(`move-start`,new G([t]))},onMove:()=>n.emit(`move`,new K(0,0,[t])),onMoveStop:()=>n.emit(`move-stop`,new q([t])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};e=H(this.tooltip,t,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:r,onRecordUndo:e=>n.emit(`record-undo`,{updates:[e]})}))}else e=this._updatingHandles.add(()=>this.toolOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,e=>{this.tooltip.info=e},ee);this.addHandles(e,X)}_showTooltip(e){this._shouldShowMovePointTooltip||this._updateMoveTooltip(e)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(e,t){if(this._shouldShowMovePointTooltip||this.objects.length===0)return;let{toolOptions:n}=this;switch(e){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new w({toolOptions:n}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,t,(e,t)=>this._measurementWorker.autoDistance2DBetweenPoints($(e),$(t))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new T({toolOptions:n}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,t,async(e,n)=>u(await this._measurementWorker.autoDistance2DBetweenPoints($(e),$(n)),re(t))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new E({toolOptions:n}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,t,k))}this._latestTooltipInfo.toolOptions=n}async _updateMoveTooltipDistanceAsync(e,t,n){if(t!=null&&t.action!==`end`){let{mapStart:r,mapEnd:i}=t;e.distance=await n(r,i)??d}else e.distance=d}_emitRecordUndo(){let e=this.objects.toArray().map(e=>e.createUndoRecord?.()).filter(i);e.length>0&&this.events.emit(`record-undo`,{updates:e})}_buildSnappingPipelineSteps(e,t,n,r,i){let a=F(e);if(a==null||a.type!==`point`&&a.type!==`mesh`)return{steps:n,cancel:r};let o=(a.type===`point`?a:a.origin).clone(),s=new S({elevationInfo:t,pointer:i,editGeometryOperations:y.fromGeometry(o,this.view.state.isGlobal),visualizer:new M,excludeFeature:e.graphic}),c=this.snappingManager,{snappingStep:l,cancelSnapping:u}=C({snappingContext:s,snappingManager:c,updatingHandles:this._updatingHandles,useZ:!1});return r=r.next(u),n=n.next(e=>{let t=s.coordinateHelper.pointToVector(o);return{...e,snapOrigin:t}}).next(v(this.view,t)).next(...l),{steps:n,cancel:r}}get test(){}};e([t({constructOnly:!0,nonNullable:!0})],Q.prototype,`view`,void 0),e([t()],Q.prototype,`objects`,void 0),e([t({constructOnly:!0,nonNullable:!0})],Q.prototype,`enableVisualElements`,void 0),e([t({constructOnly:!0,nonNullable:!0})],Q.prototype,`enableZ`,void 0),e([t({constructOnly:!0})],Q.prototype,`manipulatorRadius`,void 0),e([t({constructOnly:!0,type:x})],Q.prototype,`toolOptions`,void 0),e([t({constructOnly:!0})],Q.prototype,`snappingManager`,void 0),e([t()],Q.prototype,`type`,void 0),e([t()],Q.prototype,`updating`,null),e([t()],Q.prototype,`tooltip`,void 0),e([t()],Q.prototype,`_ownedTooltip`,void 0),e([t()],Q.prototype,`_latestTooltipInfo`,void 0),e([t()],Q.prototype,`_shouldShowMovePointTooltip`,null),e([t()],Q.prototype,`activeTooltipInfo`,null),Q=e([n(`esri.views.3d.interactive.editingTools.move.MoveTool3D`)],Q);const $=r(m);class ie{constructor(e){this.object=e,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{J as HoldEvent,K as MoveEvent,G as MoveStartEvent,q as MoveStopEvent,Q as MoveTool3D};
@@ -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{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{deg2rad as i,rad2deg as a}from"../../../../../core/mathUtils.js";import{when as o,sync as s}from"../../../../../core/reactiveUtils.js";import{axis as c,angle as l}from"../../../../../geometry/support/axisAngleDegrees.js";import{manipulatedObjectGeometry as u}from"../manipulatedObjectUtils.js";let d=class extends t{constructor(e){super(e),this._interactionState=null}initialize(){this.addHandles([o(()=>{let e=this._interactionState;return e&&e.angle!==e.previousAngle?{interactionState:e,angle:e.state.angle}:null},({interactionState:e})=>{this._updateMeshRotation(e)},s),o(()=>{let e=this._interactionState;return e&&e.scale!==e.previousScale?{interactionState:e,scale:e.state.scale}:null},({interactionState:e})=>{this._updateMeshSize(e)},s)])}get geometry(){let e=u(this.object);return e?.type===`mesh`?e:null}get initialAngle(){return this._interactionState?.initialAngle??0}get angle(){let e=this.geometry?.transform;if(e==null)return this._interactionState?.angle??0;let t=c(e.rotation)[2];return Math.abs(t)>1-1e-6?i(l(e.rotation))*Math.sign(t):0}get angleClockwise(){return-this.angle}get relativeAngle(){return this.angle-this.initialAngle}get relativeAngleClockwise(){return-this.relativeAngle}get scale(){return this._interactionState?.scale??1}startInteraction(){let e=new f({angle:this.angle});this._interactionState=e;let t=()=>{this._interactionState=null};return{state:e,done:t,cancel:()=>{e.cancel(),t()}}}createUndoRecord(){return this.object.createUndoRecord()}_updateMeshRotation(e){let{geometry:t}=this;if(t==null)return;let{angle:n,previousAngle:r}=e;e.previousAngle=n;let i=a(n-r);t.rotate(0,0,i)}_updateMeshSize(e){let{geometry:t}=this;if(t==null)return;let{scale:n,previousScale:r}=e;e.previousScale=n;let i=n/r;t.scale(i)}};e([n({constructOnly:!0})],d.prototype,`object`,void 0),e([n()],d.prototype,`geometry`,null),e([n({constructOnly:!0})],d.prototype,`viewingMode`,void 0),e([n()],d.prototype,`initialAngle`,null),e([n()],d.prototype,`angle`,null),e([n()],d.prototype,`angleClockwise`,null),e([n()],d.prototype,`relativeAngle`,null),e([n()],d.prototype,`relativeAngleClockwise`,null),e([n()],d.prototype,`scale`,null),e([n()],d.prototype,`_interactionState`,void 0),d=e([r(`esri.views.3d.interactive.editingTools.transform.ScaleRotateMeshAdapter`)],d);let f=class extends t{get state(){let{angle:e,scale:t}=this;return{angle:e,scale:t}}constructor(e){super(e),this.angle=0,this.initialAngle=0,this.previousAngle=0,this.previousScale=1,this.scale=1,this.initialAngle=e.angle,this.previousAngle=e.angle}cancel(){this.angle=this.initialAngle,this.scale=1}};e([n()],f.prototype,`angle`,void 0),e([n()],f.prototype,`initialAngle`,void 0),e([n()],f.prototype,`previousAngle`,void 0),e([n()],f.prototype,`previousScale`,void 0),e([n()],f.prototype,`scale`,void 0),e([n()],f.prototype,`state`,null),f=e([r(`esri.views.3d.interactive.editingTools.transform.ScaleRotateMeshAdapter.InteractionState`)],f);export{d as ScaleRotateMeshAdapter};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{deg2rad as i,rad2deg as a}from"../../../../../core/mathUtils.js";import{when as o,sync as s}from"../../../../../core/reactiveUtils.js";import{axis as c,angle as l}from"../../../../../geometry/support/axisAngleDegrees.js";import{manipulatedObjectGeometry as u}from"../manipulatedObjectUtils.js";let d=class extends t{constructor(e){super(e),this._interactionState=null}initialize(){this.addHandles([o(()=>{let e=this._interactionState;return e&&e.angle!==e.previousAngle?{interactionState:e,angle:e.state.angle}:null},({interactionState:e})=>{this._updateMeshRotation(e)},s),o(()=>{let e=this._interactionState;return e&&e.scale!==e.previousScale?{interactionState:e,scale:e.state.scale}:null},({interactionState:e})=>{this._updateMeshSize(e)},s)])}get geometry(){let e=u(this.object);return e?.type===`mesh`?e:null}get initialAngle(){return this._interactionState?.initialAngle??0}get angle(){let e=this.geometry?.transform;if(e==null)return this._interactionState?.angle??0;let t=c(e.rotation)[2];return Math.abs(t)>1-1e-6?i(l(e.rotation))*Math.sign(t):0}get angleClockwise(){return-this.angle}get relativeAngle(){return this.angle-this.initialAngle}get relativeAngleClockwise(){return-this.relativeAngle}get scale(){return this._interactionState?.scale??1}startInteraction(){let e=new f({angle:this.angle});this._interactionState=e;let t=()=>{this._interactionState=null};return{state:e,done:t,cancel:()=>{e.cancel(),t()}}}createUndoRecord(){return this.object.createUndoRecord()}_updateMeshRotation(e){let{geometry:t}=this;if(t==null)return;let{angle:n,previousAngle:r}=e;e.previousAngle=n;let i=a(n-r);t.rotate(0,0,i)}_updateMeshSize(e){let{geometry:t}=this;if(t==null)return;let{scale:n,previousScale:r}=e;e.previousScale=n;let i=n/r;t.scale(i)}};e([n({constructOnly:!0})],d.prototype,`object`,void 0),e([n({constructOnly:!0})],d.prototype,`isGlobal`,void 0),e([n()],d.prototype,`geometry`,null),e([n()],d.prototype,`initialAngle`,null),e([n()],d.prototype,`angle`,null),e([n()],d.prototype,`angleClockwise`,null),e([n()],d.prototype,`relativeAngle`,null),e([n()],d.prototype,`relativeAngleClockwise`,null),e([n()],d.prototype,`scale`,null),e([n()],d.prototype,`_interactionState`,void 0),d=e([r(`esri.views.3d.interactive.editingTools.transform.ScaleRotateMeshAdapter`)],d);let f=class extends t{get state(){let{angle:e,scale:t}=this;return{angle:e,scale:t}}constructor(e){super(e),this.angle=0,this.initialAngle=0,this.previousAngle=0,this.previousScale=1,this.scale=1,this.initialAngle=e.angle,this.previousAngle=e.angle}cancel(){this.angle=this.initialAngle,this.scale=1}};e([n()],f.prototype,`angle`,void 0),e([n()],f.prototype,`initialAngle`,void 0),e([n()],f.prototype,`previousAngle`,void 0),e([n()],f.prototype,`previousScale`,void 0),e([n()],f.prototype,`scale`,void 0),e([n()],f.prototype,`state`,null),f=e([r(`esri.views.3d.interactive.editingTools.transform.ScaleRotateMeshAdapter.InteractionState`)],f);export{d as ScaleRotateMeshAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{isSome as r}from"../../../../../core/arrayUtils.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{UpdatingHandles as s}from"../../../../../core/support/UpdatingHandles.js";import c from"../../../../../geometry/Point.js";import{sceneSnappingAtProjectedLocation as l}from"../../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as u}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{InteractiveToolBase as d}from"../../../../interactive/InteractiveToolBase.js";import f from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as p}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as m}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{TransformMeshTooltipInfo as h}from"../../../../interactive/tooltip/infos/TransformMeshTooltipInfo.js";import{TransformPointTooltipInfo as g}from"../../../../interactive/tooltip/infos/TransformPointTooltipInfo.js";import{makeTooltip as _,enterInputModeIfAvailable as v}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{Manipulator3D as y}from"../../Manipulator3D.js";import{placeAtObject as b}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as x}from"../../SnappingVisualizer3D.js";import{manipulatedObjectGeometry as S}from"../manipulatedObjectUtils.js";import{alignArrowsScaleThreshold as C}from"../manipulations/config.js";import{MoveManipulation as w}from"../manipulations/MoveManipulation.js";import{canMoveZOperations as T}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as E}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as D}from"../tooltipUtils3D.js";import{createVisualElements as O}from"../visualElementUtils.js";import{ScaleRotateMeshAdapter as k}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as A}from"./ScaleRotateObjectSymbol3DAdapter.js";import{ScaleRotateTransform as j}from"./ScaleRotateTransform.js";let M=class extends d{constructor(e){super(e),this.events=new i,this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.toolOptions=new f,this.type=`transform-3d`,this._updatingHandles=new s,this._scaleRotate=null}initialize(){let{events:e,object:t,view:n}=this;this.tooltip=_(()=>({view:n,options:this.toolOptions.tooltips})),this._moveManipulation=new w({tool:this,view:n,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&T(t.operations,t.elevationInfo),radius:w.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(t=>this.addHandles(t.events.on(`immediate-click`,t=>{e.emit(`immediate-click`,{...t,object:this.object}),t.stopPropagation()})));let i=t.elevationInfo;if(this._moveManipulation.elevationInfo=i,this.addHandles(E(t)),this._moveManipulation.createManipulatedObjectDragPipeline((e,r,a,o,s)=>{if(e===0){let{snappingStep:e,cancelSnapping:r}=m({snappingContext:new p({elevationInfo:i,pointer:s,editGeometryOperations:u.fromGeometry(new c({spatialReference:t.operations?.data.spatialReference}),n.state.viewingMode),visualizer:new x,excludeFeature:t.graphic}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!1});o=o.next(r),a=a.next(l(this.view,i)).next(...e)}return{steps:a,cancel:o}},t,t=>{let{action:n,object:r,dxScreen:i,dyScreen:a}=t,o={object:r,dxScreen:i,dyScreen:a};switch(n){case`start`:this._emitRecordUndo(),e.emit(`translate-start`,o);break;case`update`:e.emit(`translate`,o);break;case`end`:e.emit(`translate-stop`,o)}}),this._moveManipulation.angle=this._scaleRotate==null?0:this._scaleRotate.angle,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.addHandles(this._updatingHandles.add(()=>this._scaleRotateAdapter.angle,()=>this._updateMoveAngle())),this.enableScaling||this.enableRotation){let e=this.enableScaling&&this.enableRotation?null:this.enableScaling?`scale`:`rotate`;this._scaleRotate=new j({tool:this,mode:e,adapter:this._scaleRotateAdapter,toolOptions:this.toolOptions}),this.addHandles(this._scaleRotate.events.on(`scale-changed`,()=>this._onScaleChanged()))}this.addHandles([O({view:this.view,object:t,forEachManipulator:e=>this._forEachManipulator(e),onManipulatorsChanged:()=>a()}),t.on(`committed`,()=>this._onGeometryChanged()),this._hideManipulatorsForObjectState(),this._updatingHandles.add(()=>n.scale,()=>this._updateMoveAngle())].filter(r)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator(e=>{e instanceof y&&this.addHandles(e.events.on(`grab-changed`,()=>this._updateManipulatorsForGrabState()))});let o=n?.type,{toolOptions:s}=this;this._meshTooltipInfo=new h({viewType:o,toolOptions:s}),this._pointTooltipInfo=new g({viewType:o,toolOptions:s});let d={object:t,dxScreen:0,dyScreen:0},f={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit(`translate-start`,{...d})},onMove:()=>e.emit(`translate`,{...d}),onMoveStop:()=>e.emit(`translate-stop`,{...d}),onRotateStart:n=>{this._emitRecordUndo(),e.emit(`rotate-start`,{object:t,angle:n})},onRotate:n=>e.emit(`rotate`,{object:t,angle:n}),onRotateStop:n=>e.emit(`rotate-stop`,{object:t,angle:n}),onScaleStart:(n,r)=>{this._emitRecordUndo(),e.emit(`scale-start`,{object:t,xScale:n,yScale:r})},onScale:(n,r)=>e.emit(`scale`,{object:t,xScale:n,yScale:r}),onScaleStop:(n,r)=>e.emit(`scale-stop`,{object:t,xScale:n,yScale:r})};this.addHandles(D(this.tooltip,this.object,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this.activeTooltipInfo,callbacks:f,scaleRotateTransform:this._scaleRotate}))),this.finishToolCreation()}destroy(){this.tooltip.destroy(),this._moveManipulation.destroy(),this._scaleRotate=o(this._scaleRotate),this._scaleRotateAdapter=o(this._scaleRotateAdapter),this._updatingHandles.destroy(),this._set(`view`,null),this._set(`object`,null)}onInputEvent(e){if(!this.destroyed&&!v(e,this.tooltip))return super.onInputEvent(e)}_updateManipulatorsForGrabState(){if(this._scaleRotate==null)return;this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing;let e=null;this._moveManipulation.grabbing?e=this._scaleRotate.disableDisplay():this._scaleRotate.grabbing&&(e=this._moveManipulation.hideManipulators()),this.removeHandles(N),e&&this.addHandles(e,N)}_createScaleRotateAdapter(){return S(this.object)?.type===`mesh`?new k({object:this.object,viewingMode:this.view.state.viewingMode}):new A({graphic:this.object.graphic,sizeFilter:e=>this._enforceNonZeroSize(e),findLayerView:()=>this.view.allLayerViews.find(e=>e.layer===this.object.graphic?.layer),sizeAxis:this.toolOptions?.tooltips?.visualVariables?.size?.axis??null})}_forEachManipulator(e){this._moveManipulation?.forEachManipulator(e),this._scaleRotate?.forEachManipulator(e)}_hideManipulatorsForObjectState(){return this._updatingHandles.add(()=>this.object.visible,e=>{this._forEachManipulator(t=>t.available=e),this._moveManipulation.zManipulation.available=e&&this.enableZ&&T(this.object.operations,this.object.elevationInfo)})}_emitRecordUndo(){this.events.emit(`record-undo`,{updates:[this.object.createUndoRecord()]})}set snapToScene(e){this._moveManipulation&&(this._moveManipulation.snapToScene=e),this._set(`snapToScene`,e)}get updating(){return this._updatingHandles.updating||!!this._scaleRotate?.updating||!!this.snappingManager?.updating}get activeTooltipInfo(){return S(this.object)?.type===`mesh`?this._meshTooltipInfo:this._pointTooltipInfo}set location(e){this._moveManipulation.location=e,this._scaleRotate&&(this._scaleRotate.location=e)}set elevationAlignedLocation(e){this._moveManipulation.elevationAlignedLocation=e,this._scaleRotate&&(this._scaleRotate.elevationAlignedLocation=e)}reset(){}onActivate(){this.tooltip.hidden=!this.internallyEditable}onEditableChange(){this.internallyEditable||(this.tooltip.hidden=!0,this.tooltip.exitInputMode({focusOnView:!1}))}onHide(){this._scaleRotate?.cancelActiveAnimation()}_onScaleChanged(){this._scaleRotate!=null&&(this._moveManipulation.displayScale=this._scaleRotate.getScale())}_updateMoveAngle(){let{view:e}=this,t=e.state.viewingMode===2||e.scale<C;this._moveManipulation.angle=t?this._scaleRotateAdapter.angle:0}_onGeometryChanged(){b(this,this.object)}_enforceNonZeroSize(e){return e||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}get test(){}};e([t({constructOnly:!0,nonNullable:!0})],M.prototype,`view`,void 0),e([t({constructOnly:!0,nonNullable:!0})],M.prototype,`object`,void 0),e([t({constructOnly:!0,nonNullable:!0})],M.prototype,`enableZ`,void 0),e([t()],M.prototype,`enableRotation`,void 0),e([t()],M.prototype,`enableScaling`,void 0),e([t({constructOnly:!0,type:f})],M.prototype,`toolOptions`,void 0),e([t({value:!1})],M.prototype,`snapToScene`,null),e([t({constructOnly:!0})],M.prototype,`snappingManager`,void 0),e([t({readOnly:!0})],M.prototype,`type`,void 0),e([t({readOnly:!0})],M.prototype,`updating`,null),e([t()],M.prototype,`activeTooltipInfo`,null),M=e([n(`esri.views.3d.interactive.editingTools.transform.TransformTool3D`)],M);const N=Symbol();export{M as TransformTool3D};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{isSome as r}from"../../../../../core/arrayUtils.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{UpdatingHandles as s}from"../../../../../core/support/UpdatingHandles.js";import c from"../../../../../geometry/Point.js";import{sceneSnappingAtProjectedLocation as l}from"../../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as u}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{InteractiveToolBase as d}from"../../../../interactive/InteractiveToolBase.js";import f from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as p}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as m}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{TransformMeshTooltipInfo as h}from"../../../../interactive/tooltip/infos/TransformMeshTooltipInfo.js";import{TransformPointTooltipInfo as g}from"../../../../interactive/tooltip/infos/TransformPointTooltipInfo.js";import{makeTooltip as _,enterInputModeIfAvailable as v}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{Manipulator3D as y}from"../../Manipulator3D.js";import{placeAtObject as b}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as x}from"../../SnappingVisualizer3D.js";import{manipulatedObjectGeometry as S}from"../manipulatedObjectUtils.js";import{alignArrowsScaleThreshold as C}from"../manipulations/config.js";import{MoveManipulation as w}from"../manipulations/MoveManipulation.js";import{canMoveZOperations as T}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as E}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as D}from"../tooltipUtils3D.js";import{createVisualElements as O}from"../visualElementUtils.js";import{ScaleRotateMeshAdapter as k}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as A}from"./ScaleRotateObjectSymbol3DAdapter.js";import{ScaleRotateTransform as j}from"./ScaleRotateTransform.js";let M=class extends d{constructor(e){super(e),this.events=new i,this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.toolOptions=new f,this.type=`transform-3d`,this._updatingHandles=new s,this._scaleRotate=null}initialize(){let{events:e,object:t,view:n}=this;this.tooltip=_(()=>({view:n,options:this.toolOptions.tooltips})),this._moveManipulation=new w({tool:this,view:n,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&T(t.operations,t.elevationInfo),radius:w.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(t=>this.addHandles(t.events.on(`immediate-click`,t=>{e.emit(`immediate-click`,{...t,object:this.object}),t.stopPropagation()})));let i=t.elevationInfo;if(this._moveManipulation.elevationInfo=i,this.addHandles(E(t)),this._moveManipulation.createManipulatedObjectDragPipeline((e,r,a,o,s)=>{if(e===0){let{snappingStep:e,cancelSnapping:r}=m({snappingContext:new p({elevationInfo:i,pointer:s,editGeometryOperations:u.fromGeometry(new c({spatialReference:t.operations?.data.spatialReference}),n.state.isGlobal),visualizer:new x,excludeFeature:t.graphic}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!1});o=o.next(r),a=a.next(l(this.view,i)).next(...e)}return{steps:a,cancel:o}},t,t=>{let{action:n,object:r,dxScreen:i,dyScreen:a}=t,o={object:r,dxScreen:i,dyScreen:a};switch(n){case`start`:this._emitRecordUndo(),e.emit(`translate-start`,o);break;case`update`:e.emit(`translate`,o);break;case`end`:e.emit(`translate-stop`,o)}}),this._moveManipulation.angle=this._scaleRotate==null?0:this._scaleRotate.angle,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.addHandles(this._updatingHandles.add(()=>this._scaleRotateAdapter.angle,()=>this._updateMoveAngle())),this.enableScaling||this.enableRotation){let e=this.enableScaling&&this.enableRotation?null:this.enableScaling?`scale`:`rotate`;this._scaleRotate=new j({tool:this,mode:e,adapter:this._scaleRotateAdapter,toolOptions:this.toolOptions}),this.addHandles(this._scaleRotate.events.on(`scale-changed`,()=>this._onScaleChanged()))}this.addHandles([O({view:this.view,object:t,forEachManipulator:e=>this._forEachManipulator(e),onManipulatorsChanged:()=>a()}),t.on(`committed`,()=>this._onGeometryChanged()),this._hideManipulatorsForObjectState(),this._updatingHandles.add(()=>n.scale,()=>this._updateMoveAngle())].filter(r)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator(e=>{e instanceof y&&this.addHandles(e.events.on(`grab-changed`,()=>this._updateManipulatorsForGrabState()))});let o=n?.type,{toolOptions:s}=this;this._meshTooltipInfo=new h({viewType:o,toolOptions:s}),this._pointTooltipInfo=new g({viewType:o,toolOptions:s});let d={object:t,dxScreen:0,dyScreen:0},f={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit(`translate-start`,{...d})},onMove:()=>e.emit(`translate`,{...d}),onMoveStop:()=>e.emit(`translate-stop`,{...d}),onRotateStart:n=>{this._emitRecordUndo(),e.emit(`rotate-start`,{object:t,angle:n})},onRotate:n=>e.emit(`rotate`,{object:t,angle:n}),onRotateStop:n=>e.emit(`rotate-stop`,{object:t,angle:n}),onScaleStart:(n,r)=>{this._emitRecordUndo(),e.emit(`scale-start`,{object:t,xScale:n,yScale:r})},onScale:(n,r)=>e.emit(`scale`,{object:t,xScale:n,yScale:r}),onScaleStop:(n,r)=>e.emit(`scale-stop`,{object:t,xScale:n,yScale:r})};this.addHandles(D(this.tooltip,this.object,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this.activeTooltipInfo,callbacks:f,scaleRotateTransform:this._scaleRotate}))),this.finishToolCreation()}destroy(){this.tooltip.destroy(),this._moveManipulation.destroy(),this._scaleRotate=o(this._scaleRotate),this._scaleRotateAdapter=o(this._scaleRotateAdapter),this._updatingHandles.destroy(),this._set(`view`,null),this._set(`object`,null)}onInputEvent(e){if(!this.destroyed&&!v(e,this.tooltip))return super.onInputEvent(e)}_updateManipulatorsForGrabState(){if(this._scaleRotate==null)return;this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing;let e=null;this._moveManipulation.grabbing?e=this._scaleRotate.disableDisplay():this._scaleRotate.grabbing&&(e=this._moveManipulation.hideManipulators()),this.removeHandles(N),e&&this.addHandles(e,N)}_createScaleRotateAdapter(){return S(this.object)?.type===`mesh`?new k({object:this.object,isGlobal:this.view.state.isGlobal}):new A({graphic:this.object.graphic,sizeFilter:e=>this._enforceNonZeroSize(e),findLayerView:()=>this.view.allLayerViews.find(e=>e.layer===this.object.graphic?.layer),sizeAxis:this.toolOptions?.tooltips?.visualVariables?.size?.axis??null})}_forEachManipulator(e){this._moveManipulation?.forEachManipulator(e),this._scaleRotate?.forEachManipulator(e)}_hideManipulatorsForObjectState(){return this._updatingHandles.add(()=>this.object.visible,e=>{this._forEachManipulator(t=>t.available=e),this._moveManipulation.zManipulation.available=e&&this.enableZ&&T(this.object.operations,this.object.elevationInfo)})}_emitRecordUndo(){this.events.emit(`record-undo`,{updates:[this.object.createUndoRecord()]})}set snapToScene(e){this._moveManipulation&&(this._moveManipulation.snapToScene=e),this._set(`snapToScene`,e)}get updating(){return this._updatingHandles.updating||!!this._scaleRotate?.updating||!!this.snappingManager?.updating}get activeTooltipInfo(){return S(this.object)?.type===`mesh`?this._meshTooltipInfo:this._pointTooltipInfo}set location(e){this._moveManipulation.location=e,this._scaleRotate&&(this._scaleRotate.location=e)}set elevationAlignedLocation(e){this._moveManipulation.elevationAlignedLocation=e,this._scaleRotate&&(this._scaleRotate.elevationAlignedLocation=e)}reset(){}onActivate(){this.tooltip.hidden=!this.internallyEditable}onEditableChange(){this.internallyEditable||(this.tooltip.hidden=!0,this.tooltip.exitInputMode({focusOnView:!1}))}onHide(){this._scaleRotate?.cancelActiveAnimation()}_onScaleChanged(){this._scaleRotate!=null&&(this._moveManipulation.displayScale=this._scaleRotate.getScale())}_updateMoveAngle(){let{view:e}=this,t=e.state.isLocal||e.scale<C;this._moveManipulation.angle=t?this._scaleRotateAdapter.angle:0}_onGeometryChanged(){b(this,this.object)}_enforceNonZeroSize(e){return e||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}get test(){}};e([t({constructOnly:!0,nonNullable:!0})],M.prototype,`view`,void 0),e([t({constructOnly:!0,nonNullable:!0})],M.prototype,`object`,void 0),e([t({constructOnly:!0,nonNullable:!0})],M.prototype,`enableZ`,void 0),e([t()],M.prototype,`enableRotation`,void 0),e([t()],M.prototype,`enableScaling`,void 0),e([t({constructOnly:!0,type:f})],M.prototype,`toolOptions`,void 0),e([t({value:!1})],M.prototype,`snapToScene`,null),e([t({constructOnly:!0})],M.prototype,`snappingManager`,void 0),e([t({readOnly:!0})],M.prototype,`type`,void 0),e([t({readOnly:!0})],M.prototype,`updating`,null),e([t()],M.prototype,`activeTooltipInfo`,null),M=e([n(`esri.views.3d.interactive.editingTools.transform.TransformTool3D`)],M);const N=Symbol();export{M as TransformTool3D};