@arcgis/core 5.2.0-next.120 → 5.2.0-next.122

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 (534) hide show
  1. package/Ground.js +1 -1
  2. package/arcade/containerUtils.js +1 -1
  3. package/arcade/functions/feature.js +1 -1
  4. package/arcade/functions/featuresetstring.js +1 -1
  5. package/arcade/languageUtils.js +1 -1
  6. package/arcgisGlobal.d.ts +9 -0
  7. package/assets/components/assets/icon/addCellAbove16.json +1 -0
  8. package/assets/components/assets/icon/addCellAbove24.json +1 -0
  9. package/assets/components/assets/icon/addCellAbove32.json +1 -0
  10. package/assets/components/assets/icon/addCellBelow16.json +1 -0
  11. package/assets/components/assets/icon/addCellBelow24.json +1 -0
  12. package/assets/components/assets/icon/addCellBelow32.json +1 -0
  13. package/assets/components/assets/icon/linkedChart16.json +1 -0
  14. package/assets/components/assets/icon/linkedChart24.json +1 -0
  15. package/assets/components/assets/icon/linkedChart32.json +1 -0
  16. package/assets/components/assets/icon/polygonFromFeature16.json +1 -0
  17. package/assets/components/assets/icon/polygonFromFeature24.json +1 -0
  18. package/assets/components/assets/icon/polygonFromFeature32.json +1 -0
  19. package/assets/esri/core/workers/RemoteClient.js +1 -1
  20. package/assets/esri/core/workers/chunks/0148cb611bf7c8c5fe8a.js +1 -0
  21. package/assets/esri/core/workers/chunks/025da54eef112d7e8f66.js +1 -0
  22. package/assets/esri/core/workers/chunks/033debcbf6b3683dc4fe.js +2 -0
  23. package/assets/esri/core/workers/chunks/064445e6f9512817ac87.js +2 -0
  24. package/assets/esri/core/workers/chunks/{304462b049116f59accc.js → 09676cfa99b90fe0cc63.js} +1 -1
  25. package/assets/esri/core/workers/chunks/0aadee0437fa061e4ff5.js +1 -0
  26. package/assets/esri/core/workers/chunks/{deb5b1d772ca407654d4.js → 0acc754907395e83bbc6.js} +1 -1
  27. package/assets/esri/core/workers/chunks/1302bf9718747cd9fdd9.js +1 -0
  28. package/assets/esri/core/workers/chunks/{956432c9d45940983bc2.js → 1b42d163ef22e3565bb7.js} +1 -1
  29. package/assets/esri/core/workers/chunks/1b551ef3d84d9c1e93f9.js +1 -0
  30. package/assets/esri/core/workers/chunks/1c38ce72160d5a4e4b3d.js +1 -0
  31. package/assets/esri/core/workers/chunks/1c3b087fbf2d102376fc.js +1 -0
  32. package/assets/esri/core/workers/chunks/{e18b8646c7378213b618.js → 1e46703cb566c25458ad.js} +1 -1
  33. package/assets/esri/core/workers/chunks/1f135269aea3931e11b2.js +1 -0
  34. package/assets/esri/core/workers/chunks/{ea9e770efc85594e4dd2.js → 216d8cb86548e92a8196.js} +1 -1
  35. package/assets/esri/core/workers/chunks/23279303cd7698314c56.js +1 -0
  36. package/assets/esri/core/workers/chunks/{4bf2cc4d092601ff2b86.js → 24673aac70d6c949b6fa.js} +1 -1
  37. package/assets/esri/core/workers/chunks/24cf91aeab53a897e951.js +1 -0
  38. package/assets/esri/core/workers/chunks/26bc509a031788bfa678.js +1 -0
  39. package/assets/esri/core/workers/chunks/{d629708bf23da24ee523.js → 298f234f11a10c5120a2.js} +1 -1
  40. package/assets/esri/core/workers/chunks/29ae19206bbeb480be0f.js +1 -0
  41. package/assets/esri/core/workers/chunks/2ae6deade655fdbc28de.js +1 -0
  42. package/assets/esri/core/workers/chunks/{37cf4ca2083cd3b6002e.js → 2c7bb5c9751524687002.js} +1 -1
  43. package/assets/esri/core/workers/chunks/2c8957f9c7610805208c.js +1 -0
  44. package/assets/esri/core/workers/chunks/{dc1944a7601b518a9c48.js → 2ca49fb4590cc34a02bd.js} +1 -1
  45. package/assets/esri/core/workers/chunks/2d592c935571de80a2e2.js +1 -0
  46. package/assets/esri/core/workers/chunks/{a917a1df8270860dc514.js → 2f52ad525744b8793d49.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{f890359d972cce54459e.js → 2f829321bfbd3bacd64f.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{6efc5873747b9cd44fb9.js → 323451ef52d0c2805f1d.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{7232fc11b23777b6be94.js → 369012c032ea6882607c.js} +1 -1
  50. package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +1 -0
  51. package/assets/esri/core/workers/chunks/38890ac5917942374ab8.js +1 -0
  52. package/assets/esri/core/workers/chunks/3e33d953e41b281a120b.js +1 -0
  53. package/assets/esri/core/workers/chunks/3e52351e06d85bf9bedd.js +1 -0
  54. package/assets/esri/core/workers/chunks/{9f760dc4492a03e0504c.js → 45d87af48a21644590c2.js} +1 -1
  55. package/assets/esri/core/workers/chunks/462fd57af8ed7921d6ba.js +1 -0
  56. package/assets/esri/core/workers/chunks/463d69f596d1d34ef275.js +2 -0
  57. package/assets/esri/core/workers/chunks/475906b079f4f1ddacf2.js +1 -0
  58. package/assets/esri/core/workers/chunks/48a2f68e06a2e90b77d0.js +1 -0
  59. package/assets/esri/core/workers/chunks/49affbed22e201f7c32b.js +1 -0
  60. package/assets/esri/core/workers/chunks/{b6ca73c1384f07b30b74.js → 4bb8432d99a39733368f.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{cb983f65995e57fff7a1.js → 4f58e0322707f63f5bf2.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{8f0ecf4d06ec7b67d4ed.js → 52744dfd430cd0c0edfb.js} +1 -1
  63. package/assets/esri/core/workers/chunks/58a17fb3c0dd07c63d57.js +2 -0
  64. package/assets/esri/core/workers/chunks/5993db944b9e7825e0bc.js +1 -0
  65. package/assets/esri/core/workers/chunks/{b0058619e0363002ad86.js → 59cd139712d919e6a738.js} +1 -1
  66. package/assets/esri/core/workers/chunks/59d5247ac4075b024244.js +1 -0
  67. package/assets/esri/core/workers/chunks/5b9f3c4f65412c66316f.js +1 -0
  68. package/assets/esri/core/workers/chunks/{be3421ffb5b391bca02e.js → 5d35e0c2665f5e625ee9.js} +1 -1
  69. package/assets/esri/core/workers/chunks/5e70bfb9d6235a87b87a.js +1 -0
  70. package/assets/esri/core/workers/chunks/6006bd8a5ed945fa2776.js +1 -0
  71. package/assets/esri/core/workers/chunks/618927cfcb93dd1d92fd.js +1 -0
  72. package/assets/esri/core/workers/chunks/6709d24867d275b33d24.js +1 -0
  73. package/assets/esri/core/workers/chunks/68e24fa3f564c2a5c9fd.js +1 -0
  74. package/assets/esri/core/workers/chunks/{6ab7bb3834841834f839.js → 724ea2e2843e6dac0a90.js} +1 -1
  75. package/assets/esri/core/workers/chunks/7441d121f00ce747c08e.js +1 -0
  76. package/assets/esri/core/workers/chunks/{090c9c2dbf92f2cac0b8.js → 770ca70d363184e39d60.js} +1 -1
  77. package/assets/esri/core/workers/chunks/781fa83e8063b8f685dc.js +1 -0
  78. package/assets/esri/core/workers/chunks/78c1b75b1a8937eaa3cd.js +1 -0
  79. package/assets/esri/core/workers/chunks/793b072519ded0dc6f34.js +1 -0
  80. package/assets/esri/core/workers/chunks/7994fce5f36963aadc51.js +1 -0
  81. package/assets/esri/core/workers/chunks/7adee504107cb9ad8563.js +1 -0
  82. package/assets/esri/core/workers/chunks/7efc45858ebd3fd3302e.js +1 -0
  83. package/assets/esri/core/workers/chunks/7ff536284942c5284a16.js +1 -0
  84. package/assets/esri/core/workers/chunks/813dd84933b407c8fe86.js +1 -0
  85. package/assets/esri/core/workers/chunks/83c7c4218bc6ba2f16ee.js +1 -0
  86. package/assets/esri/core/workers/chunks/8daeac785af725c3ebdf.js +1 -0
  87. package/assets/esri/core/workers/chunks/{3ab25279aaa30f035038.js → 8daed13400d9e63e65ae.js} +1 -1
  88. package/assets/esri/core/workers/chunks/9020bd7a0e488d55ef14.js +1 -0
  89. package/assets/esri/core/workers/chunks/92f35b2c3c5f13778308.js +1 -0
  90. package/assets/esri/core/workers/chunks/97cd4145c016cf379120.js +1 -0
  91. package/assets/esri/core/workers/chunks/{cf7c06702babd6fa88b4.js → 9af36ee6a0df224859bc.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{452d069ba7ad6759b558.js → 9c46c7f00d42f5c02b26.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{32fc7d1db4b311f6b880.js → 9e5b30b907102bc0c201.js} +1 -1
  94. package/assets/esri/core/workers/chunks/a3ab53b534e2872131be.js +1 -0
  95. package/assets/esri/core/workers/chunks/{f18ee2eaa96d103627a6.js → aa6b2cc8f6f5627891c1.js} +1 -1
  96. package/assets/esri/core/workers/chunks/ac7af417ebf7721d7400.js +1 -0
  97. package/assets/esri/core/workers/chunks/aed479c14d93955f4798.js +1 -0
  98. package/assets/esri/core/workers/chunks/{60c61f34733063730386.js → b013b70e40dfb6ce013e.js} +1 -1
  99. package/assets/esri/core/workers/chunks/b22de8bf4a4a739bc36d.js +1 -0
  100. package/assets/esri/core/workers/chunks/b39cd78d2d97bef9909e.js +1 -0
  101. package/assets/esri/core/workers/chunks/b5f50955c1eee55b67d1.js +1 -0
  102. package/assets/esri/core/workers/chunks/b688e6463a651779a016.js +1 -0
  103. package/assets/esri/core/workers/chunks/bb5ed2a796a45c41b0b4.js +1 -0
  104. package/assets/esri/core/workers/chunks/bdf012e591a8476db467.js +1 -0
  105. package/assets/esri/core/workers/chunks/{daf7b647bd960d8bad56.js → be52c319a0a81ce1ba36.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{066b7f6866d602f963e0.js → c3008b20cb5fd38bd900.js} +1 -1
  107. package/assets/esri/core/workers/chunks/{22e85819e23202a8ba90.js → c39ebd8d469f1e8bb61e.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{7f2ac03efaa4a4898ba2.js → c3b96d1d43afccd23e45.js} +2 -2
  109. package/assets/esri/core/workers/chunks/{89edaa1ffa566908ebca.js → ca5a4f62b09cc8579dc0.js} +1 -1
  110. package/assets/esri/core/workers/chunks/ce08e3369641da0d7a27.js +2 -0
  111. package/assets/esri/core/workers/chunks/ce1ccf9ec90b786591e5.js +1 -0
  112. package/assets/esri/core/workers/chunks/cf0bed7ae27021fd7b05.js +1 -0
  113. package/assets/esri/core/workers/chunks/cf6f671823fa6c2a9a5e.js +1 -0
  114. package/assets/esri/core/workers/chunks/d25210574168ead2f813.js +1 -0
  115. package/assets/esri/core/workers/chunks/d3378c479052d566317c.js +1 -0
  116. package/assets/esri/core/workers/chunks/{1742dbc6a827cfda471b.js → d3d48401462ef3bf0ad9.js} +1 -1
  117. package/assets/esri/core/workers/chunks/d3ef23923424ad8c5048.js +1 -0
  118. package/assets/esri/core/workers/chunks/{46388b86d1b10e6121bd.js → d507d7d7a7282fc38e8d.js} +1 -1
  119. package/assets/esri/core/workers/chunks/dc0816f064be576a2fa6.js +1 -0
  120. package/assets/esri/core/workers/chunks/{862e1acd80c4e43831dc.js → dc923e50958b68a50014.js} +1 -1
  121. package/assets/esri/core/workers/chunks/dd4ecf81250cc001d040.js +1 -0
  122. package/assets/esri/core/workers/chunks/e10fe4c77b8dc4492092.js +1 -0
  123. package/assets/esri/core/workers/chunks/e4e1db4e9e5f13167401.js +1 -0
  124. package/assets/esri/core/workers/chunks/e5ee64e2fb5bfcb716d8.js +1 -0
  125. package/assets/esri/core/workers/chunks/{e755075ac2e02e881fad.js → e6637f9176566382ed3e.js} +1 -1
  126. package/assets/esri/core/workers/chunks/e6dc68c4bd8eddb168d1.js +1 -0
  127. package/assets/esri/core/workers/chunks/eb780f2dafa14f776166.js +1 -0
  128. package/assets/esri/core/workers/chunks/{723478607badcde5706b.js → eb7f45736c852725b0bb.js} +150 -118
  129. package/assets/esri/core/workers/chunks/ed31ec586b754241474d.js +1 -0
  130. package/assets/esri/core/workers/chunks/f38d11be766043413659.js +1 -0
  131. package/assets/esri/core/workers/chunks/{98a5327fd96d9542b39f.js → f90cad9f007a11154c0d.js} +1 -1
  132. package/assets/esri/libs/pdfjs/pdf.worker.mjs +63075 -0
  133. package/assets/esri/libs/pdfjs/wasm/jbig2.wasm +0 -0
  134. package/assets/esri/libs/pdfjs/wasm/openjpeg.wasm +0 -0
  135. package/assets/esri/libs/pdfjs/wasm/qcms_bg.wasm +0 -0
  136. package/assets/esri/libs/pdfjs/wasm/quickjs-eval.wasm +0 -0
  137. package/assets/esri/themes/dark/main.css +1 -1
  138. package/assets/esri/themes/light/main.css +1 -1
  139. package/assets/esri/themes/light/view.css +1 -1
  140. package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.en.json +1 -1
  141. package/basemaps/BasemapCollection.d.ts +148 -0
  142. package/basemaps/BasemapCollection.js +2 -0
  143. package/basemaps/BasemapsSource.d.ts +39 -0
  144. package/basemaps/BasemapsSource.js +2 -0
  145. package/basemaps/LocalBasemapsSource.d.ts +55 -0
  146. package/basemaps/LocalBasemapsSource.js +2 -0
  147. package/basemaps/PortalBasemapsSource.d.ts +98 -0
  148. package/basemaps/PortalBasemapsSource.js +2 -0
  149. package/basemaps/support/BasemapItem.d.ts +74 -0
  150. package/basemaps/support/BasemapItem.js +2 -0
  151. package/basemaps/support/basemapCompatibilityUtils.js +2 -0
  152. package/basemaps/types.d.ts +42 -0
  153. package/chunks/CheckerBoard.glsl.js +1 -1
  154. package/chunks/CloudsComposition.glsl.js +2 -2
  155. package/chunks/ColorMaterial.glsl.js +1 -1
  156. package/chunks/Component.glsl.js +11 -11
  157. package/chunks/DeepSky.glsl.js +1 -1
  158. package/chunks/DefaultMaterial.glsl.js +4 -4
  159. package/chunks/EdgeShader.glsl.js +1 -1
  160. package/chunks/FocusArea.glsl.js +1 -1
  161. package/chunks/GaussianSplat.glsl.js +9 -9
  162. package/chunks/GlobalIllumination.glsl.js +42 -13
  163. package/chunks/GlobalIlluminationBlur.glsl.js +1 -1
  164. package/chunks/HUDMaterial.glsl.js +1 -1
  165. package/chunks/ImageMaterial.glsl.js +1 -1
  166. package/chunks/LineCallout.glsl.js +1 -1
  167. package/chunks/LineMarker.glsl.js +97 -89
  168. package/chunks/NativeLine.glsl.js +1 -1
  169. package/chunks/Path.glsl.js +8 -7
  170. package/chunks/Pattern.glsl.js +1 -1
  171. package/chunks/PointRenderer.glsl.js +1 -1
  172. package/chunks/RealisticTree.glsl.js +4 -4
  173. package/chunks/RibbonLine.glsl.js +58 -56
  174. package/chunks/ShadowCastAccumulate.glsl.js +3 -3
  175. package/chunks/ShadowHighlight.glsl.js +4 -4
  176. package/chunks/ShadowHighlightBuffer.glsl.js +3 -3
  177. package/chunks/Terrain.glsl.js +12 -14
  178. package/chunks/Viewshed.glsl.js +1 -1
  179. package/chunks/Water.glsl.js +3 -3
  180. package/chunks/languageUtils.js +1 -1
  181. package/config.js +1 -1
  182. package/core/Accessor.d.ts +10 -0
  183. package/core/arrayUtils.js +1 -1
  184. package/core/workers/registry.js +1 -1
  185. package/geometry/support/geometryUtils.js +1 -1
  186. package/geometry/support/heightModelInfoUtils.js +1 -1
  187. package/geometry/support/meshUtils/elevation.js +1 -1
  188. package/kernel.js +1 -1
  189. package/layers/CSVLayer.js +1 -1
  190. package/layers/GeoJSONLayer.d.ts +1 -1
  191. package/layers/GeoJSONLayer.js +1 -1
  192. package/layers/GeospatialPDFLayer.d.ts +40 -0
  193. package/layers/GeospatialPDFLayer.js +2 -0
  194. package/layers/IntegratedMeshLayer.js +1 -1
  195. package/layers/OGCFeatureLayer.js +1 -1
  196. package/layers/StreamLayer.js +1 -1
  197. package/layers/geospatialPDF/GeospatialPDFFrame.js +2 -0
  198. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +5 -0
  199. package/layers/geospatialPDF/GeospatialPDFParserUtils.js +2 -0
  200. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +2 -0
  201. package/layers/geospatialPDF/LGIDictMapFrame.js +2 -0
  202. package/layers/geospatialPDF/Projection.js +2 -0
  203. package/layers/geospatialPDF/ViewportMeasureFrame.js +2 -0
  204. package/layers/geospatialPDF/renderExtentUtils.js +2 -0
  205. package/layers/geospatialPDF/sharedUtils.js +2 -0
  206. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  207. package/layers/mixins/ArcGISImageService.js +1 -1
  208. package/layers/mixins/FeatureLayerBase.js +1 -1
  209. package/layers/raster/datasets/GeospatialPDFRaster.js +2 -0
  210. package/layers/support/ElevationQuery.js +1 -1
  211. package/layers/support/LabelClass.d.ts +13 -4
  212. package/layers/support/LabelClass.js +1 -1
  213. package/layers/support/commonProperties.js +1 -1
  214. package/layers/support/layersLoader.js +1 -1
  215. package/layers/types.d.ts +1 -1
  216. package/legend/ActiveLayerInfo.d.ts +130 -0
  217. package/legend/ActiveLayerInfo.js +2 -0
  218. package/legend/LegendContent.d.ts +118 -0
  219. package/legend/LegendContent.js +2 -0
  220. package/legend/support/clusterUtils.js +2 -0
  221. package/legend/support/colorRampUtils.js +2 -0
  222. package/legend/support/heatmapRampUtils.js +2 -0
  223. package/legend/support/relationshipRampUtils.js +2 -0
  224. package/legend/support/sizeRampUtils.js +2 -0
  225. package/legend/support/utils.js +2 -0
  226. package/legend/types.d.ts +403 -0
  227. package/libs/i3s/I3SModule.js +1 -1
  228. package/package.json +7 -7
  229. package/portal/PortalItem.js +1 -1
  230. package/portal/support/portalLayers.js +1 -1
  231. package/support/revision.js +1 -1
  232. package/support/userTypeGuards/isBasemapsSource.js +2 -0
  233. package/symbols/cim/CIMOperators.js +1 -1
  234. package/symbols/cim/callouts/effects/BackgroundCallout.js +2 -0
  235. package/symbols/cim/callouts/effects/BalloonCallout.js +2 -0
  236. package/symbols/cim/callouts/effects/PointSymbolCallout.js +2 -0
  237. package/symbols/cim/callouts/effects/SimpleLineCallout.js +2 -0
  238. package/symbols/cim/callouts/effects/calloutUtils.js +2 -0
  239. package/symbols/cim/cimAnalyzer.js +1 -1
  240. package/symbols/cim/utils.js +1 -1
  241. package/symbols/support/typeUtils.js +1 -1
  242. package/views/2d/LabelManager.js +1 -1
  243. package/views/2d/engine/AFeatureContainer.js +1 -1
  244. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  245. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  246. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  247. package/views/2d/engine/webgl/GlyphWorker.js +1 -1
  248. package/views/2d/engine/webgl/TileCpuState.js +1 -1
  249. package/views/2d/engine/webgl/TileGpuState.js +1 -1
  250. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  251. package/views/2d/engine/webgl/collisions/LabelStore.js +2 -0
  252. package/views/2d/engine/webgl/cpuMapped/CpuBuffer.js +1 -1
  253. package/views/2d/engine/webgl/cpuMapped/CpuMeshData.js +1 -1
  254. package/views/2d/engine/webgl/cpuMapped/GpuMeshState.js +1 -1
  255. package/views/2d/engine/webgl/definitions.js +1 -1
  256. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  257. package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
  258. package/views/2d/engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js +2 -0
  259. package/views/2d/engine/webgl/mesh/factories/FeatureMeshFactory.js +1 -1
  260. package/views/2d/engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js +2 -0
  261. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  262. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  263. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  264. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  265. package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
  266. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueInstance.js +1 -1
  267. package/views/2d/engine/webgl/shaderGraph/techniques/TestDisplayObject.js +1 -1
  268. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
  269. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  270. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
  271. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  272. package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
  273. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  274. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  275. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  276. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  277. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  278. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
  279. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  280. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  281. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  282. package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
  283. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  284. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  285. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/CalloutMeshWriterPolicy.js +2 -0
  286. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  287. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js +2 -0
  288. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack.js +1 -1
  289. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/dataViewUtils.js +1 -1
  290. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
  291. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  292. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
  293. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
  294. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
  295. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  296. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  297. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  298. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  299. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  300. package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
  301. package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
  302. package/views/2d/engine/webgl/util/IntervalMatcher.js +1 -1
  303. package/views/2d/engine/webgl/util/LabelMatcher.js +1 -1
  304. package/views/2d/engine/webgl/util/MapMatcher.js +1 -1
  305. package/views/2d/engine/webgl/util/Matcher.js +1 -1
  306. package/views/2d/engine/webgl/util/MatcherContext.js +1 -1
  307. package/views/2d/input/MapViewInputManager.js +1 -1
  308. package/views/2d/input/handlers/KeyPan.js +1 -1
  309. package/views/2d/input/handlers/KeyRotate.js +1 -1
  310. package/views/2d/layerViewModuleImportUtils.js +1 -1
  311. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  312. package/views/2d/layers/GeospatialPDFLayerView2D.js +2 -0
  313. package/views/2d/layers/MediaLayerView2D.js +1 -1
  314. package/views/2d/layers/TileLayerView2D.js +1 -1
  315. package/views/2d/layers/features/FeatureContainer.js +1 -1
  316. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  317. package/views/2d/layers/features/RenderState.js +1 -1
  318. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  319. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  320. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  321. package/views/2d/layers/graphics/AGraphicContainer.js +1 -1
  322. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  323. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  324. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  325. package/views/2d/layers/support/annodime/MatcherGeometryOverride.js +1 -1
  326. package/views/2d/layers/support/annodime/PrivateMatcherGeometryOverrideEffect.js +1 -1
  327. package/views/2d/layers/support/annodime/annotationGraphic.js +1 -1
  328. package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
  329. package/views/2d/layers/support/annodime/debugUtils.js +1 -1
  330. package/views/2d/layers/support/annodime/virtualFields.js +1 -1
  331. package/views/2d/types.d.ts +2 -0
  332. package/views/3d/GroundView3D.js +1 -1
  333. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  334. package/views/3d/input/SceneInputManager.js +1 -1
  335. package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
  336. package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +2 -0
  337. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  338. package/views/3d/layerViewModuleImportUtils.js +1 -1
  339. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  340. package/views/3d/layers/GeospatialPDFLayerView3D.js +2 -0
  341. package/views/3d/layers/I3SMeshView3D.js +1 -1
  342. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  343. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  344. package/views/3d/layers/LayerView3D.js +1 -1
  345. package/views/3d/layers/SceneLayerWorker.js +1 -1
  346. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  347. package/views/3d/layers/i3s/Intersector.js +1 -1
  348. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  349. package/views/3d/support/GroundAndIMSurface.js +1 -1
  350. package/views/3d/support/MemoryController.js +1 -1
  351. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  352. package/views/3d/support/hitTest.js +1 -1
  353. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  354. package/views/3d/types.d.ts +2 -0
  355. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  356. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  357. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +1 -3
  358. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  359. package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +1 -1
  360. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +8 -8
  361. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +6 -6
  362. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
  363. package/views/3d/webgl-engine/core/shaderLibrary/forwardLinearDepthToReadShadow.glsl.js +4 -0
  364. package/views/3d/webgl-engine/core/shaderLibrary/{ForwardLinearDepthToWriteShadowMap.glsl.js → forwardLinearDepthToWriteShadow.glsl.js} +5 -5
  365. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +8 -6
  366. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +2 -2
  367. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +1 -1
  368. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +1 -1
  369. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +3 -4
  370. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +2 -2
  371. package/views/3d/webgl-engine/core/shaderLibrary/shading/readFragmentShadow.glsl.js +5 -0
  372. package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +24 -0
  373. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +1 -1
  374. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +6 -6
  375. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  376. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
  377. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  378. package/views/3d/webgl-engine/effects/focusArea/FocusArea.js +1 -1
  379. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  380. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  381. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.glsl.js +1 -1
  382. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.glsl.js +1 -1
  383. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  384. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
  385. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastAccumulate.glsl.js +1 -1
  386. package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
  387. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  388. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  389. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  390. package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
  391. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  392. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  393. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  394. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  395. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  396. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  397. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  398. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +1 -1
  399. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  400. package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +1 -1
  401. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  402. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  403. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  404. package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -1
  405. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  406. package/views/3d/webgl-engine/shaders/{AnimatedLine.glsl.js → animatedAlpha.glsl.js} +11 -17
  407. package/views/SceneView.d.ts +31 -0
  408. package/views/SceneView.js +1 -1
  409. package/views/ToolViewManager.js +1 -1
  410. package/views/VideoView.js +1 -1
  411. package/views/View.d.ts +35 -0
  412. package/views/View.js +1 -1
  413. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  414. package/views/analysis/ElevationProfile/elevationProfileQuerySourceUtils.js +1 -1
  415. package/views/interactive/options/ViewOptions.d.ts +98 -0
  416. package/views/interactive/options/ViewOptions.js +2 -0
  417. package/views/interactive/support/Units.d.ts +10 -2
  418. package/views/interactive/support/Units.js +1 -1
  419. package/views/layers/FeatureLikeLayerView.d.ts +27 -5
  420. package/views/layers/GraphicsLayerView.d.ts +25 -2
  421. package/views/layers/ImageryTileLayerView.js +1 -1
  422. package/views/selection/types.d.ts +1 -1
  423. package/views/support/DefaultsFromMap.js +1 -1
  424. package/views/types.d.ts +9 -3
  425. package/widgets/BasemapGallery/BasemapGalleryViewModel.d.ts +3 -0
  426. package/widgets/BasemapGallery/support/BasemapGalleryItem.d.ts +3 -0
  427. package/widgets/BasemapGallery/support/LocalBasemapsSource.d.ts +2 -0
  428. package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +2 -0
  429. package/widgets/BasemapGallery/types.d.ts +6 -1
  430. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +2 -0
  431. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  432. package/widgets/Editor/EditorViewModel.d.ts +2 -1
  433. package/widgets/Editor/EditorViewModel.js +1 -1
  434. package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
  435. package/widgets/Editor.d.ts +2 -1
  436. package/widgets/Editor.js +1 -1
  437. package/widgets/ElevationProfile/ElevationProfileLineGround.js +1 -1
  438. package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.d.ts +1 -0
  439. package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
  440. package/widgets/HistogramRangeSlider.js +1 -1
  441. package/widgets/Legend/LegendViewModel.d.ts +1 -0
  442. package/widgets/Legend/LegendViewModel.js +1 -1
  443. package/widgets/Legend/styles/card/CardView.d.ts +1 -0
  444. package/widgets/Legend/styles/card/CardView.js +1 -1
  445. package/widgets/Legend/styles/classic/ClassicView.d.ts +1 -0
  446. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  447. package/widgets/Legend/support/ActiveLayerInfo.d.ts +2 -0
  448. package/widgets/Legend.js +1 -1
  449. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +8 -2
  450. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  451. package/widgets/support/SelectionToolbar/VisibleElements.d.ts +8 -1
  452. package/widgets/support/SelectionToolbar/VisibleElements.js +1 -1
  453. package/widgets/support/SelectionToolbar.d.ts +7 -1
  454. package/widgets/support/SelectionToolbar.js +1 -1
  455. package/assets/esri/core/workers/chunks/01ca17092545d72be7b6.js +0 -1
  456. package/assets/esri/core/workers/chunks/03918a862455191a8910.js +0 -1
  457. package/assets/esri/core/workers/chunks/0b727d7bf3e36e146725.js +0 -1
  458. package/assets/esri/core/workers/chunks/0bd067a5c0bac96caeb5.js +0 -1
  459. package/assets/esri/core/workers/chunks/0ff13f7a18b0123d253e.js +0 -1
  460. package/assets/esri/core/workers/chunks/114bc14c49176f64a2c5.js +0 -1
  461. package/assets/esri/core/workers/chunks/1630913399384030d0b9.js +0 -1
  462. package/assets/esri/core/workers/chunks/173417fe995e9bfc49d8.js +0 -1
  463. package/assets/esri/core/workers/chunks/1a39335aa2dce6d564d9.js +0 -1
  464. package/assets/esri/core/workers/chunks/25bb07d3c32b16a08813.js +0 -1
  465. package/assets/esri/core/workers/chunks/25cc6d7178a52f2f46b7.js +0 -1
  466. package/assets/esri/core/workers/chunks/2cf571d968118b6bdde0.js +0 -1
  467. package/assets/esri/core/workers/chunks/2e999b05ce179dd9fa08.js +0 -1
  468. package/assets/esri/core/workers/chunks/354912041363502c6a89.js +0 -1
  469. package/assets/esri/core/workers/chunks/36792b8a85e88044cb49.js +0 -1
  470. package/assets/esri/core/workers/chunks/3acc1299c1382c3b034d.js +0 -1
  471. package/assets/esri/core/workers/chunks/430802108b63194b7ddd.js +0 -2
  472. package/assets/esri/core/workers/chunks/43436c7ccc6baefc885d.js +0 -1
  473. package/assets/esri/core/workers/chunks/4396ef5ab3eb9e9a7df2.js +0 -1
  474. package/assets/esri/core/workers/chunks/445b0ca1b70730c9a2e6.js +0 -1
  475. package/assets/esri/core/workers/chunks/48d3da636be15581fd7d.js +0 -1
  476. package/assets/esri/core/workers/chunks/49e8ff5ed079a9e3be4b.js +0 -1
  477. package/assets/esri/core/workers/chunks/4efe5827a5c61db3b19d.js +0 -2
  478. package/assets/esri/core/workers/chunks/501df20cdd09384f6ee2.js +0 -1
  479. package/assets/esri/core/workers/chunks/50ae209237f104735a30.js +0 -1
  480. package/assets/esri/core/workers/chunks/54f9062526c2002b7fd7.js +0 -1
  481. package/assets/esri/core/workers/chunks/56b7ac280bf0be938c14.js +0 -1
  482. package/assets/esri/core/workers/chunks/5938d5f6e37f49867d5a.js +0 -1
  483. package/assets/esri/core/workers/chunks/61bcbafd676804ce3e1d.js +0 -1
  484. package/assets/esri/core/workers/chunks/63f7141c71f29dbe8270.js +0 -1
  485. package/assets/esri/core/workers/chunks/70347d25968975126fa7.js +0 -1
  486. package/assets/esri/core/workers/chunks/726ca458b98bb4334431.js +0 -1
  487. package/assets/esri/core/workers/chunks/75410a4de76e67ed5da4.js +0 -1
  488. package/assets/esri/core/workers/chunks/85780f4fa4b5509f864e.js +0 -1
  489. package/assets/esri/core/workers/chunks/862754d2d659528fe884.js +0 -1
  490. package/assets/esri/core/workers/chunks/8628c027198982baed7c.js +0 -1
  491. package/assets/esri/core/workers/chunks/8675ab3c4dec2f13b9c6.js +0 -1
  492. package/assets/esri/core/workers/chunks/8c521caf050a486b6548.js +0 -1
  493. package/assets/esri/core/workers/chunks/8ce14dd209462f88b163.js +0 -1
  494. package/assets/esri/core/workers/chunks/917dec9c004218c58950.js +0 -1
  495. package/assets/esri/core/workers/chunks/91f451b98e0f696043df.js +0 -1
  496. package/assets/esri/core/workers/chunks/9d92e6f0beed9a8580fa.js +0 -1
  497. package/assets/esri/core/workers/chunks/a42505b978d54d36d3b6.js +0 -1
  498. package/assets/esri/core/workers/chunks/a6d4132a16c51323a38a.js +0 -1
  499. package/assets/esri/core/workers/chunks/a86a4e550a92f770d6d5.js +0 -1
  500. package/assets/esri/core/workers/chunks/add834f867900a7091d2.js +0 -1
  501. package/assets/esri/core/workers/chunks/b45ebb1b64ee7314375e.js +0 -1
  502. package/assets/esri/core/workers/chunks/b56c5883a5468b18b122.js +0 -1
  503. package/assets/esri/core/workers/chunks/b5a102cf9f4377fb9842.js +0 -1
  504. package/assets/esri/core/workers/chunks/b6409d89914030d5854a.js +0 -1
  505. package/assets/esri/core/workers/chunks/baa8bce361a2677533ec.js +0 -1
  506. package/assets/esri/core/workers/chunks/c118b88a7c4359e68d9b.js +0 -1
  507. package/assets/esri/core/workers/chunks/c5e288d57bacb8451e2d.js +0 -2
  508. package/assets/esri/core/workers/chunks/ce3fb992f6c6ae7378a3.js +0 -1
  509. package/assets/esri/core/workers/chunks/ceda1e08c9ff26248db0.js +0 -1
  510. package/assets/esri/core/workers/chunks/cf1106eda10f3cccb1bd.js +0 -1
  511. package/assets/esri/core/workers/chunks/cfd8317ecd2e63af7c40.js +0 -1
  512. package/assets/esri/core/workers/chunks/d5e3f8e5b8d2576d3cb3.js +0 -2
  513. package/assets/esri/core/workers/chunks/d6130cd8a20d24dd9d3c.js +0 -1
  514. package/assets/esri/core/workers/chunks/da5b3421a984cb94fd58.js +0 -1
  515. package/assets/esri/core/workers/chunks/da6583e8d88441a1c02a.js +0 -1
  516. package/assets/esri/core/workers/chunks/ddb5d29a8998d0a76fd4.js +0 -1
  517. package/assets/esri/core/workers/chunks/de8a3a0796bd115426c0.js +0 -1
  518. package/assets/esri/core/workers/chunks/e52f30dfb7c82491a7f2.js +0 -1
  519. package/assets/esri/core/workers/chunks/e707534a700a2de687ca.js +0 -1
  520. package/assets/esri/core/workers/chunks/e88eee4c2fc4229c2a8b.js +0 -1
  521. package/assets/esri/core/workers/chunks/f465fb26541372fdc908.js +0 -2
  522. package/assets/esri/core/workers/chunks/f5423006fb07db7dd6ee.js +0 -1
  523. package/assets/esri/core/workers/chunks/f75e57d3e02f9828b049.js +0 -1
  524. package/assets/esri/core/workers/chunks/f774e5b94710ccee1af0.js +0 -1
  525. package/assets/esri/core/workers/chunks/fdad31bbe8aee68a6eaf.js +0 -1
  526. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToReadShadowMap.glsl.js +0 -4
  527. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +0 -18
  528. package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +0 -4
  529. /package/assets/esri/core/workers/chunks/{430802108b63194b7ddd.js.LICENSE.txt → 033debcbf6b3683dc4fe.js.LICENSE.txt} +0 -0
  530. /package/assets/esri/core/workers/chunks/{4efe5827a5c61db3b19d.js.LICENSE.txt → 064445e6f9512817ac87.js.LICENSE.txt} +0 -0
  531. /package/assets/esri/core/workers/chunks/{c5e288d57bacb8451e2d.js.LICENSE.txt → 463d69f596d1d34ef275.js.LICENSE.txt} +0 -0
  532. /package/assets/esri/core/workers/chunks/{d5e3f8e5b8d2576d3cb3.js.LICENSE.txt → 58a17fb3c0dd07c63d57.js.LICENSE.txt} +0 -0
  533. /package/assets/esri/core/workers/chunks/{7f2ac03efaa4a4898ba2.js.LICENSE.txt → c3b96d1d43afccd23e45.js.LICENSE.txt} +0 -0
  534. /package/assets/esri/core/workers/chunks/{f465fb26541372fdc908.js.LICENSE.txt → ce08e3369641da0d7a27.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,when as l,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{createScreenPoint as p,screenPointObjectToArray as u}from"../../../../core/screenUtils.js";import{property as c,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as _,fromScaling as v,multiply as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{dot as y,length as P,copy as w,scale as f,add as g,transformMat4 as M,normalize as V,set as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as T,create as D}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as k,ZEROS as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as E}from"../../../../core/support/UpdatingHandles.js";import{c as S,a as H,n as C,f as j}from"../../../../chunks/boundedPlane.js";import{signedDistance as R,create as z,intersectRay as O,getNormal as G}from"../../../../geometry/support/plane.js";import{create as U}from"../../../../geometry/support/ray.js";import{sv3d as I,sm4d as K,sv2d as A}from"../../../../geometry/support/vectorStacks.js";import{getSliceableContainer as F}from"../../../../graphic/getSliceableContainer.js";import{getRotateHeadingTexture as B,getTiltRotateTexture as L}from"../images/Factory.js";import{getOutlineColor as q,planeColor as N}from"./settings.js";import{pointerMoveTimerMs as J,planePreviewOutlineWidth as Q,forceVerticalModifier as W,forceHorizontalModifier as X,previewFadeDurationSeconds as Y,previewFadeDotThreshold as Z,initialDepthOffsetFrac as $}from"./sliceToolConfig.js";import{createGridVisualElement as tt,createOutlineVisualElement as et,planeToShape as it,createRotatePlane as at,resizePlane as st,calculatePlaneHalfSize as nt,createPlane as rt,DidPointerMoveRecentlyFlag as lt,calculateBoundedPlaneTranslateRotate as ot,updateShiftRestartHandle as ht,updateRotateHeadingHandle as pt,updateRotateTiltHandle as ut,updateResizeHandle as ct,createShiftPlane as dt}from"./sliceToolUtils.js";import{calculateInputRotationTransform as _t}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as vt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ResizeManipulator as mt}from"../../interactive/manipulators/ResizeManipulator.js";import{RotateManipulator as yt}from"../../interactive/manipulators/RotateManipulator.js";import{ShiftManipulator as Pt}from"../../interactive/manipulators/ShiftManipulator.js";import{fromScreenNormalized as wt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as ft}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as gt}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as Mt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as Vt}from"../../../support/screenUtils.js";var bt;let Tt=class extends ft{static{bt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.multiTouchEnabled=!1,this.removeIncompleteOnCancel=!1,this._mode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=J,this._prevPointerMoveTimeout=null,this._updatingHandles=new E,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=S(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=p(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=Mt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&H(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new Pt(this.view,1);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",i=>{this._onShiftGrab(i),t(e)})]);const i=!this.view.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new yt(this.view,(t,e)=>B(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",e=>{this._onRotateHeadingGrab(e),t(a)})]);const s=new yt(this.view,(t,e)=>L(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",e=>{this._onRotateTiltGrab(e),t(s)})]),this.resizeManipulators=this._resizeHandles.map((e,i)=>{const a=new mt(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",e=>{this._onResizeGrab(e,i),t(a)})]),a}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=tt(this.view),this._previewPlaneOutlineVisualElement=et(this.view),this._previewPlaneOutlineVisualElement.width=Q,this.addHandles(n(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),r)),this.addHandles([l(()=>"sliced"===this.state,()=>{this.finishToolCreation(),this.stop()},o),this._updatingHandles.add(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement),this._updatingHandles.destroy()}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this.active&&(this._placingSlicePlane||"exclude"===this.mode)?"crosshair":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get updating(){return this._updatingHandles.updating}get mode(){return this._mode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _placingSlicePlane(){return this.active&&!this.inputState&&"place"===this._mode}start(t){this._finishToolCreationIfValid(),this._mode=t,this.active||(this.view.activeTool=this)}stop(){this.active&&(this.view.activeTool=null)}onActivate(){this._finishToolCreationIfValid(),"none"===this._mode&&null==this.analysisViewData.plane&&(this._mode="place")}onDeactivate(){this._mode="none",this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-move":this._onPointerMove(t);break;case"immediate-click":if(!xt(t))return;"exclude"===this._mode?t.defer(async()=>{await this._onClickExcludeLayer(t)&&t.stopPropagation()}):this._onClickPlacePlane(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Vt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onClickPlacePlane(t){if(!this._placingSlicePlane)return!1;const i=Vt(t),a=S();return!!this._pickPlane(i,!1,this._activeKeyModifiers,a)&&(H(a,this._startPlane),this.analysis.shape=it(a,this.view,this.view.spatialReference,new e),this.stop(),!0)}async _onClickExcludeLayer(t){if("exclude"!==this.mode)return!1;const e=await this.view.hitTest(Vt(t)),i=e.results.at(0);if(i){const t=("graphic"===i.type?F(i.graphic.origin)??i.graphic.sourceLayer??null:null)??i.layer;t&&"subtype-sublayer"!==t.type&&this.analysis.excludedLayers.push(t)}else e.ground.layer?this.analysis.excludedLayers.push(e.ground.layer):this.analysis.excludeGroundSurface=!0;return this.stop(),!0}_onKeyDown(t){return(t.key===W||t.key===X)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==W&&t.key!==X||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=wt(this.view.state.camera,t.screenPoint,St);H(this.analysisViewData.plane,this._startPlane),this.inputState=kt(e,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return gt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?H(this.analysisViewData.plane,S()):null;e.next(vt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(y(C(this.analysisViewData.plane),e.ray.direction)/P(e.ray.direction)))/i,1),s=-R(this._startPlane.plane,e.renderEnd),n=-R(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=w(I.get(),this._startPlane.origin),i=w(I.get(),C(this._startPlane));f(i,i,-t.depth),g(i,i,e);const a=j(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,S());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=at(this.analysisViewData.plane,this.view.renderCoordsHelper,1,z()),i=wt(this.view.state.camera,t.screenPoint,St),a=D();O(e,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return gt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?H(this.analysisViewData.plane,S()):null;e.next(vt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=at(this.analysisViewData.plane,this.view.renderCoordsHelper,2,z()),i=wt(this.view.state.camera,t.screenPoint,St),a=D();O(e,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return gt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?H(this.analysisViewData.plane,S()):null;e.next(vt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=G(t.rotatePlane),a=_t(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=_(K.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=M(I.get(),this._startPlane.basis1,e),a=M(I.get(),this._startPlane.basis2,e),s=j(this.analysisViewData.plane.origin,i,a,S());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=wt(this.view.state.camera,t.screenPoint,St),a=I.get();O(this.analysisViewData.plane.plane,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:T(a)})}_createResizeDragPipeline(t){return gt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=H(this.analysisViewData.plane,S());e.next(vt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next(()=>{this._updateBoundedPlane(s)})})}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=st(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,H(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){if("exclude"===this.mode)return;let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(this.active){const a=null!=i?i:S();if(i=null!=i?H(i,Et):null,this._pickPlane(t,!0,e,a)){const t=Z;let e=!1;null!=i&&(e=y(G(i.plane),G(a.plane))<t||y(V(I.get(),i.basis1),V(I.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=h({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*Y),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=u(t,A.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=I.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(I.get()),l=this.view.state.camera;y(r,l.viewForward)>0&&f(r,r,-1);const o=nt(n,l),h=(e?1:-1)*o*$,p=f(I.get(),r,h);g(p,p,n);const u=this.analysis.tiltEnabled?3:0,c=i[W]?2:i[X]?1:u;return rt(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=lt,this.rotateHeadingManipulator.state|=lt,this.rotateTiltManipulator.state|=lt,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~lt,this.rotateHeadingManipulator.state&=~lt,this.rotateTiltManipulator.state&=~lt},this._pointerMoveTimerMs)}_updateManipulators(){if(bt.disableEngineLayers)return;let t,e,i=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=this._previewPlane??t,i=!1;else{if(null==this._previewPlane)return this._setManipulatorVisibility(!1),void this._setPreviewPlaneVisibility(!1);e=t=this._previewPlane,i=!0}if(this._setManipulatorVisibility(!i),!i){const e=ot(t,K.get());ht(this.shiftManipulator,e,t,this.view.state.camera),pt(this.rotateHeadingManipulator,e,t,this.view.renderCoordsHelper),ut(this.rotateTiltManipulator,e,t),this.resizeManipulators.forEach((i,a)=>ct(i,this._resizeHandles[a],e,t))}this._setPreviewPlaneVisibility(i||"place"===this._mode),this._updatePreviewPlaneTransform(e),this._updateMaterials()}_setManipulatorVisibility(t){this.shiftManipulator.available=t,this.rotateHeadingManipulator.available=t,this.rotateTiltManipulator.available=t&&this.analysis.tiltEnabled,this.resizeManipulators.forEach(e=>e.available=t)}_updatePreviewPlaneTransform(t){const e=ot(t,K.get()),i=b(I.get(),P(t.basis1),P(t.basis2),1),a=v(K.get(),i),s=m(a,e,a);this._previewPlaneOutlineVisualElement.transform=s,this._previewPlaneGridVisualElement.transform=s}_setPreviewPlaneVisibility(t){const e=this._previewPlaneOutlineVisualElement,i=this._previewPlaneGridVisualElement;t&&(e.attached=!0,i.attached=!0),e.visible=t,i.visible=t}_updateMaterials(){const t=q(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=k(N);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=x}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach(e=>{e.interactive=e===t})}_finishToolCreationIfValid(){this.analysis.valid&&this.finishToolCreation()}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};t([c()],Tt.prototype,"_clock",void 0),t([c({constructOnly:!0})],Tt.prototype,"view",void 0),t([c()],Tt.prototype,"analysisViewData",void 0),t([c({readOnly:!0})],Tt.prototype,"state",null),t([c({readOnly:!0})],Tt.prototype,"cursor",null),t([c()],Tt.prototype,"analysis",null),t([c()],Tt.prototype,"multiTouchEnabled",void 0),t([c()],Tt.prototype,"removeIncompleteOnCancel",void 0),t([c()],Tt.prototype,"updating",null),t([c()],Tt.prototype,"_mode",void 0),t([c()],Tt.prototype,"mode",null),t([c({value:null})],Tt.prototype,"inputState",null),t([c()],Tt.prototype,"_placingSlicePlane",null),Tt=bt=t([d("esri.views.3d.analysis.Slice.SliceTool")],Tt);const Dt=Tt;function kt(t,e,i){const a=dt(e,C(i),t.direction,z()),s=D();return O(a,t,s)?{type:"shift",shiftPlane:a,depth:0,startPoint:s}:null}function xt(t){return"mouse"!==t.pointerType||0===t.button}const Et=S(),St=U();export{Dt as default};
2
+ import{__decorate as t}from"tslib";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,when as l,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{createScreenPoint as p,screenPointObjectToArray as u}from"../../../../core/screenUtils.js";import{property as c,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as _,fromScaling as v,multiply as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{dot as y,length as P,copy as w,scale as g,add as f,transformMat4 as M,normalize as V,set as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as T,create as D}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as k,ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as x}from"../../../../core/support/UpdatingHandles.js";import{c as E,a as H,n as C,f as j}from"../../../../chunks/boundedPlane.js";import{signedDistance as R,create as z,intersectRay as O,getNormal as G}from"../../../../geometry/support/plane.js";import{create as U}from"../../../../geometry/support/ray.js";import{sv3d as I,sm4d as K,sv2d as A}from"../../../../geometry/support/vectorStacks.js";import{getSliceableContainer as F}from"../../../../graphic/getSliceableContainer.js";import{getRotateHeadingTexture as B,getTiltRotateTexture as L}from"../images/Factory.js";import{getOutlineColor as q,planeColor as N}from"./settings.js";import{pointerMoveTimerMs as J,planePreviewOutlineWidth as Q,forceVerticalModifier as W,forceHorizontalModifier as X,previewFadeDurationSeconds as Y,previewFadeDotThreshold as Z,initialDepthOffsetFrac as $}from"./sliceToolConfig.js";import{createGridVisualElement as tt,createOutlineVisualElement as et,planeToShape as it,createRotatePlane as at,resizePlane as st,calculatePlaneHalfSize as nt,createPlane as rt,DidPointerMoveRecentlyFlag as lt,calculateBoundedPlaneTranslateRotate as ot,updateShiftRestartHandle as ht,updateRotateHeadingHandle as pt,updateRotateTiltHandle as ut,updateResizeHandle as ct,createShiftPlane as dt}from"./sliceToolUtils.js";import{calculateInputRotationTransform as _t}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as vt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ResizeManipulator as mt}from"../../interactive/manipulators/ResizeManipulator.js";import{RotateManipulator as yt}from"../../interactive/manipulators/RotateManipulator.js";import{ShiftManipulator as Pt}from"../../interactive/manipulators/ShiftManipulator.js";import{fromScreenNormalized as wt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as gt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as ft}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as Mt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as Vt}from"../../../support/screenUtils.js";var bt;let Tt=class extends gt{static{bt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.multiTouchEnabled=!1,this.removeIncompleteOnCancel=!1,this._mode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=J,this._prevPointerMoveTimeout=null,this._updatingHandles=new x,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=E(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=p(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=Mt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&H(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new Pt(this.view,1);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",i=>{this._onShiftGrab(i),t(e)})]);const i=!this.view.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new yt(this.view,(t,e)=>B(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",e=>{this._onRotateHeadingGrab(e),t(a)})]);const s=new yt(this.view,(t,e)=>L(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",e=>{this._onRotateTiltGrab(e),t(s)})]),this.resizeManipulators=this._resizeHandles.map((e,i)=>{const a=new mt(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",e=>{this._onResizeGrab(e,i),t(a)})]),a}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=tt(this.view),this._previewPlaneOutlineVisualElement=et(this.view),this._previewPlaneOutlineVisualElement.width=Q,this.addHandles(n(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),r)),this.addHandles([l(()=>"sliced"===this.state,()=>{this.finishToolCreation(),this.stop()},o),this._updatingHandles.add(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement),this._updatingHandles.destroy()}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this.active&&(this._placingSlicePlane||"exclude"===this.mode)?"crosshair":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get updating(){return this._updatingHandles.updating}get mode(){return this._mode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _placingSlicePlane(){return this.active&&!this.inputState&&"place"===this._mode}start(t){this._finishToolCreationIfValid(),this._mode=t,this.active||(this.view.activeTool=this)}stop(){this.active&&(this.view.activeTool=null)}onActivate(){this._finishToolCreationIfValid(),"none"===this._mode&&null==this.analysisViewData.plane&&(this._mode="place")}onDeactivate(){this._mode="none",this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-move":this._onPointerMove(t);break;case"immediate-click":if(!St(t))return;"exclude"===this._mode?t.defer(async()=>{await this._onClickExcludeLayer(t)&&t.stopPropagation()}):this._onClickPlacePlane(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Vt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onClickPlacePlane(t){if(!this._placingSlicePlane)return!1;const i=Vt(t),a=E();return!!this._pickPlane(i,!1,this._activeKeyModifiers,a)&&(H(a,this._startPlane),this.analysis.shape=it(a,this.view,this.view.spatialReference,new e),this.stop(),!0)}async _onClickExcludeLayer(t){if("exclude"!==this.mode)return!1;const e=await this.view.hitTest(Vt(t)),i=e.results.at(0);if(i){const t=("graphic"===i.type?F(i.graphic.origin)??i.graphic.sourceLayer??null:null)??i.layer;t&&"subtype-sublayer"!==t.type&&this.analysis.excludedLayers.push(t)}else e.ground.layer?this.analysis.excludedLayers.push(e.ground.layer):this.analysis.excludeGroundSurface=!0;return this.stop(),!0}_onKeyDown(t){return!(!this._placingSlicePlane||t.key!==W&&t.key!==X)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(!this._placingSlicePlane||t.key!==W&&t.key!==X||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=wt(this.view.state.camera,t.screenPoint,Et);H(this.analysisViewData.plane,this._startPlane),this.inputState=kt(e,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?H(this.analysisViewData.plane,E()):null;e.next(vt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(y(C(this.analysisViewData.plane),e.ray.direction)/P(e.ray.direction)))/i,1),s=-R(this._startPlane.plane,e.renderEnd),n=-R(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=w(I.get(),this._startPlane.origin),i=w(I.get(),C(this._startPlane));g(i,i,-t.depth),f(i,i,e);const a=j(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,E());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=at(this.analysisViewData.plane,this.view.renderCoordsHelper,1,z()),i=wt(this.view.state.camera,t.screenPoint,Et),a=D();O(e,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?H(this.analysisViewData.plane,E()):null;e.next(vt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=at(this.analysisViewData.plane,this.view.renderCoordsHelper,2,z()),i=wt(this.view.state.camera,t.screenPoint,Et),a=D();O(e,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?H(this.analysisViewData.plane,E()):null;e.next(vt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=G(t.rotatePlane),a=_t(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=_(K.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=M(I.get(),this._startPlane.basis1,e),a=M(I.get(),this._startPlane.basis2,e),s=j(this.analysisViewData.plane.origin,i,a,E());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=wt(this.view.state.camera,t.screenPoint,Et),a=I.get();O(this.analysisViewData.plane.plane,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:T(a)})}_createResizeDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=H(this.analysisViewData.plane,E());e.next(vt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next(()=>{this._updateBoundedPlane(s)})})}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=st(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,H(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){if("exclude"===this.mode)return;let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(this.active){const a=null!=i?i:E();if(i=null!=i?H(i,xt):null,this._pickPlane(t,!0,e,a)){const t=Z;let e=!1;null!=i&&(e=y(G(i.plane),G(a.plane))<t||y(V(I.get(),i.basis1),V(I.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=h({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*Y),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=u(t,A.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=I.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(I.get()),l=this.view.state.camera;y(r,l.viewForward)>0&&g(r,r,-1);const o=nt(n,l),h=(e?1:-1)*o*$,p=g(I.get(),r,h);f(p,p,n);const u=this.analysis.tiltEnabled?3:0,c=i[W]?2:i[X]?1:u;return rt(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=lt,this.rotateHeadingManipulator.state|=lt,this.rotateTiltManipulator.state|=lt,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~lt,this.rotateHeadingManipulator.state&=~lt,this.rotateTiltManipulator.state&=~lt},this._pointerMoveTimerMs)}_updateManipulators(){if(bt.disableEngineLayers)return;let t,e,i=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=this._previewPlane??t,i=!1;else{if(null==this._previewPlane)return this._setManipulatorVisibility(!1),void this._setPreviewPlaneVisibility(!1);e=t=this._previewPlane,i=!0}if(this._setManipulatorVisibility(!i),!i){const e=ot(t,K.get());ht(this.shiftManipulator,e,t,this.view.state.camera),pt(this.rotateHeadingManipulator,e,t,this.view.renderCoordsHelper),ut(this.rotateTiltManipulator,e,t),this.resizeManipulators.forEach((i,a)=>ct(i,this._resizeHandles[a],e,t))}this._setPreviewPlaneVisibility(i||"place"===this._mode),this._updatePreviewPlaneTransform(e),this._updateMaterials()}_setManipulatorVisibility(t){this.shiftManipulator.available=t,this.rotateHeadingManipulator.available=t,this.rotateTiltManipulator.available=t&&this.analysis.tiltEnabled,this.resizeManipulators.forEach(e=>e.available=t)}_updatePreviewPlaneTransform(t){const e=ot(t,K.get()),i=b(I.get(),P(t.basis1),P(t.basis2),1),a=v(K.get(),i),s=m(a,e,a);this._previewPlaneOutlineVisualElement.transform=s,this._previewPlaneGridVisualElement.transform=s}_setPreviewPlaneVisibility(t){const e=this._previewPlaneOutlineVisualElement,i=this._previewPlaneGridVisualElement;t&&(e.attached=!0,i.attached=!0),e.visible=t,i.visible=t}_updateMaterials(){const t=q(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=k(N);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=S}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach(e=>{e.interactive=e===t})}_finishToolCreationIfValid(){this.analysis.valid&&this.finishToolCreation()}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};t([c()],Tt.prototype,"_clock",void 0),t([c({constructOnly:!0})],Tt.prototype,"view",void 0),t([c()],Tt.prototype,"analysisViewData",void 0),t([c({readOnly:!0})],Tt.prototype,"state",null),t([c({readOnly:!0})],Tt.prototype,"cursor",null),t([c()],Tt.prototype,"analysis",null),t([c()],Tt.prototype,"multiTouchEnabled",void 0),t([c()],Tt.prototype,"removeIncompleteOnCancel",void 0),t([c()],Tt.prototype,"updating",null),t([c()],Tt.prototype,"_mode",void 0),t([c()],Tt.prototype,"mode",null),t([c({value:null})],Tt.prototype,"inputState",null),t([c()],Tt.prototype,"_placingSlicePlane",null),Tt=bt=t([d("esri.views.3d.analysis.Slice.SliceTool")],Tt);const Dt=Tt;function kt(t,e,i){const a=dt(e,C(i),t.direction,z()),s=D();return O(a,t,s)?{type:"shift",shiftPlane:a,depth:0,startPoint:s}:null}function St(t){return"mouse"!==t.pointerType||0===t.button}const xt=E(),Et=U();export{Dt as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import o from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as e}from"../../../core/maybe.js";import{watch as r,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{DragZoomBox as g}from"./handlers/DragZoomBox.js";import{GamepadNavigation as h}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as l}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as u}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as c}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as v}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as w}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as f}from"./handlers/TwoFingerTilt.js";import{GroundNavigation as _}from"./handlers/ground/GroundNavigation.js";import{BrowserEventSource as y}from"../../input/BrowserEventSource.js";import{InputManager as D,ViewEventPriorities as j}from"../../input/InputManager.js";import{PreventContextMenu as N}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as P}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as A}from"../../input/handlers/support.js";import{Drag as M}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as b}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as R}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as T}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as k}from"../../input/recognizers/VerticalTwoFingerDrag.js";const I="modeDependentNavigation";let S=class extends o{constructor(){super(...arguments),this.mode="default",this._keys={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"]},modifier:["b","B"],zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]},precisionPanModifier:"Alt",coarsePanModifier:"Shift"},this._updateMode=({mode:t,dragPrimary:o,dragSecondary:e,dragTertiary:r})=>{"pro"===t&&(e="zoom",r="pan"===o?"rotate":"pan");const i={dragPrimary:o,dragSecondary:e,dragTertiary:r};this._modeDragPan&&(this._modeDragPan.pointerActions=A("pan",i)),this._modeGroundNavigation&&(this._modeGroundNavigation.pointerActions=A("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=A("rotate",i)),this._modeGroundNavigationDragRotate&&(this._modeGroundNavigationDragRotate.pointerActions=A("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=A("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(t){const{actionMap:o}=this.view.navigation;o.dragPrimary=t,o.dragSecondary="pan"===t?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeGroundNavigation=null,this._modeDragRotate=null,this._modeGroundNavigationDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=e(this._inputManager),this._source=e(this._source)}connect(){const t=this.view;this._source=new y(this.view.surface,t.input);const o=[new b,new R,new T,new M(this.view.navigation),new k],e=new D({eventSource:this._source,recognizers:o});this._inputManager=e,e.installHandlers("prevent-context-menu",[new N],j.INTERNAL),e.installHandlers("prevent-touch-text-selection-gesture",[new P(this.view)],j.INTERNAL),this._modeDragPan=new v(t,["primary"]),this._modeDragRotate=new m(t,["secondary"],0),this._modeDragZoom=new p(t,["tertiary"],this._keys.fov),this._modeKeyboardNavigation=new l(t,this._keys);const a=[new w(t),new d(t),new h(t),new u(t,this._keys.fov),new c(t),new g(t),new m(t,["primary"],1,this._keys.modifier),new _(t,["secondary"],this._keys.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new f(t)];this._modeGroundNavigation=new _(t,["primary"]),this._modeGroundNavigationDragRotate=new m(t,["secondary"],1);const s=[this._modeGroundNavigation,new u(t,this._keys.fov),new _(t,["tertiary"]),this._modeGroundNavigationDragRotate,this._modeKeyboardNavigation];this.view.viewEvents.connect(e),this.addHandles([r(()=>this.view.navigation.mode,t=>{switch(e.hasHandlers(I)&&e.uninstallHandlers(I),t.type){case"default":e.installHandlers(I,a,j.INTERNAL);break;case"ground":e.installHandlers(I,s,j.INTERNAL)}},{initial:!0}),r(()=>this.view.navigation?.browserTouchPanEnabled,t=>{this._source.browserTouchPanningEnabled=!t},i),r(()=>{const{actionMap:t}=this.view.navigation,{dragPrimary:o,dragSecondary:e,dragTertiary:r}=t;return{mode:this.mode,dragPrimary:o,dragSecondary:e,dragTertiary:r}},this._updateMode,n)])}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}get test(){}};t([a()],S.prototype,"view",void 0),t([a({type:["default","pro"]})],S.prototype,"mode",void 0),t([a({readOnly:!0})],S.prototype,"updating",null),t([a()],S.prototype,"latestPointerInfo",null),t([a()],S.prototype,"latestPenInfo",null),t([a()],S.prototype,"multiTouchActive",null),t([a()],S.prototype,"_inputManager",void 0),S=t([s("esri.views.3d.input.SceneInputManager")],S);const G=S;export{G as default};
2
+ import{__decorate as t}from"tslib";import o from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as e}from"../../../core/maybe.js";import{watch as r,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as s}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{DragZoomBox as g}from"./handlers/DragZoomBox.js";import{GamepadNavigation as h}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as l}from"./handlers/KeyboardNavigation.js";import{MouseWheelFov as u}from"./handlers/MouseWheelFov.js";import{MouseWheelZoom as c}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as v}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as w}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as f}from"./handlers/TwoFingerTilt.js";import{GroundDoubleClickMove as _}from"./handlers/ground/GroundDoubleClickMove.js";import{GroundNavigation as y}from"./handlers/ground/GroundNavigation.js";import{BrowserEventSource as D}from"../../input/BrowserEventSource.js";import{InputManager as j,ViewEventPriorities as N}from"../../input/InputManager.js";import{PreventContextMenu as P}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as A}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as M}from"../../input/handlers/support.js";import{Drag as b}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as R}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as T}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as k}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as I}from"../../input/recognizers/VerticalTwoFingerDrag.js";const S="modeDependentNavigation";let G=class extends o{constructor(){super(...arguments),this.mode="default",this._keys={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"]},modifier:["b","B"],zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]},precisionPanModifier:"Alt",coarsePanModifier:"Shift"},this._updateMode=({mode:t,dragPrimary:o,dragSecondary:e,dragTertiary:r})=>{"pro"===t&&(e="zoom",r="pan"===o?"rotate":"pan");const i={dragPrimary:o,dragSecondary:e,dragTertiary:r};this._modeDragPan&&(this._modeDragPan.pointerActions=M("pan",i)),this._modeGroundNavigation&&(this._modeGroundNavigation.pointerActions=M("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=M("rotate",i)),this._modeGroundNavigationDragRotate&&(this._modeGroundNavigationDragRotate.pointerActions=M("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=M("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(t){const{actionMap:o}=this.view.navigation;o.dragPrimary=t,o.dragSecondary="pan"===t?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeGroundNavigation=null,this._modeDragRotate=null,this._modeGroundNavigationDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=e(this._inputManager),this._source=e(this._source)}connect(){const t=this.view;this._source=new D(this.view.surface,t.input);const o=[new R,new T,new k,new b(this.view.navigation),new I],e=new j({eventSource:this._source,recognizers:o});this._inputManager=e,e.installHandlers("prevent-context-menu",[new P],N.INTERNAL),e.installHandlers("prevent-touch-text-selection-gesture",[new A(this.view)],N.INTERNAL),this._modeDragPan=new v(t,["primary"]),this._modeDragRotate=new m(t,["secondary"],0),this._modeDragZoom=new p(t,["tertiary"],this._keys.fov),this._modeKeyboardNavigation=new l(t,this._keys);const a=[new w(t),new d(t),new h(t),new u(t,this._keys.fov),new c(t),new g(t),new m(t,["primary"],1,this._keys.modifier),new y(t,["secondary"],this._keys.modifier),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new f(t)];this._modeGroundNavigation=new y(t,["primary"]),this._modeGroundNavigationDragRotate=new m(t,["secondary"],1);const s=[this._modeGroundNavigation,new u(t,this._keys.fov),new y(t,["tertiary"]),this._modeGroundNavigationDragRotate,this._modeKeyboardNavigation,new _(t)];this.view.viewEvents.connect(e),this.addHandles([r(()=>this.view.navigation.mode,t=>{switch(e.hasHandlers(S)&&e.uninstallHandlers(S),t.type){case"default":e.installHandlers(S,a,N.INTERNAL);break;case"ground":e.installHandlers(S,s,N.INTERNAL)}},{initial:!0}),r(()=>this.view.navigation?.browserTouchPanEnabled,t=>{this._source.browserTouchPanningEnabled=!t},i),r(()=>{const{actionMap:t}=this.view.navigation,{dragPrimary:o,dragSecondary:e,dragTertiary:r}=t;return{mode:this.mode,dragPrimary:o,dragSecondary:e,dragTertiary:r}},this._updateMode,n)])}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}get test(){}};t([a()],G.prototype,"view",void 0),t([a({type:["default","pro"]})],G.prototype,"mode",void 0),t([a({readOnly:!0})],G.prototype,"updating",null),t([a()],G.prototype,"latestPointerInfo",null),t([a()],G.prototype,"latestPenInfo",null),t([a()],G.prototype,"multiTouchActive",null),t([a()],G.prototype,"_inputManager",void 0),G=t([s("esri.views.3d.input.SceneInputManager")],G);const z=G;export{z as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GamepadKeyboardController as e}from"../../state/controllers/GamepadKeyboardController.js";import{InputHandler as i}from"../../../input/InputHandler.js";import{onVisibilityChange as t}from"../../../input/VisibilityChange.js";class a extends i{constructor(e,i){super(!0),this._view=e,this._keyToDirection=new Map,this._keyToAction=new Map,this._precisionPanModifierKeys=new Set,this._coarsePanModifierKeys=new Set,this._stickyKeyTimeoutHandle=void 0,this._stickyKeyDuration=200,this._addKeysMapping(i),this.registerIncoming("key-down",null,e=>this._handleKeyDown(e)),this.registerIncoming("key-up",null,e=>this._handleKeyUp(e)),this.registerIncoming("blur",null,()=>this._handleStop()),this._visibilityHandle=t(e=>e?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}setStickyKeyDuration(e){this._stickyKeyDuration=e}_addKeysMapping(e){this._addKeyMapping(e.pan.left,0),this._addKeyMapping(e.pan.right,1),this._addKeyMapping(e.pan.forward,2),this._addKeyMapping(e.pan.backward,3),this._addKeyMapping(e.pan.up,4),this._addKeyMapping(e.pan.down,5),this._addKeyMapping(e.lookAround.headingLeft,6),this._addKeyMapping(e.lookAround.headingRight,7),this._addKeyMapping(e.lookAround.tiltUp,8),this._addKeyMapping(e.lookAround.tiltDown,9),this._addKeyMapping(e.zoom.zoomIn,10),this._addKeyMapping(e.zoom.zoomOut,11),this._addKeyAction(e.reset.heading,()=>this._resetHeading()),this._addKeyAction(e.reset.tilt,()=>this._resetTilt());for(const i of this._eachKey(e.precisionPanModifier))this._precisionPanModifierKeys.add(i);for(const i of this._eachKey(e.coarsePanModifier))this._coarsePanModifierKeys.add(i)}_addKeyMapping(e,i){for(const t of this._eachKey(e))this._keyToDirection.set(t,i)}*_eachKey(e){"string"==typeof e?yield e:yield*e}_addKeyAction(e,i){for(const t of this._eachKey(e))this._keyToAction.set(t,i)}_handleKeyDown(i){if(i.data.native.ctrlKey||i.data.native.metaKey)return;if(this._precisionPanModifierKeys.has(i.data.key))return void this._updatePrecisionPanState(!0);if(this._coarsePanModifierKeys.has(i.data.key))return void this._updateCoarsePanState(!0);const t=this._keyToAction.get(i.data.key);if(null!=t)return i.stopPropagation(),void t();const a=this._keyToDirection.get(i.data.key);if(null!=a&&(this._cameraControllerKeyboard&&this._cameraControllerKeyboard.running||(this._cameraControllerKeyboard=new e({view:this._view}),this._view.state.switchCameraController(this._cameraControllerKeyboard)),this._cameraControllerKeyboard.running)){if(i.stopPropagation(),this._cameraControllerKeyboard.setPrecisionPanEnabled(this._isPrecisionPanModifierActive(i.modifiers)),this._cameraControllerKeyboard.setCoarsePanEnabled(this._isCoarsePanModifierActive(i.modifiers)),this._cameraControllerKeyboard.directionActive(a))return;if(this._cameraControllerKeyboard.activateDirection(a),this._cameraControllerKeyboard.countActiveDirections()>1||!this._isPanning(a))return;this._stickyKeyDuration>0&&(this._stickyKeyTimeoutHandle=setTimeout(()=>{this._stickyKeyTimeoutHandle=void 0,null!=this._stickyDirection&&void 0!==this._stickyDirection&&(this._cameraControllerKeyboard?.deactivateDirection(this._stickyDirection),this._stickyDirection=void 0)},this._stickyKeyDuration))}}_handleStop(){this._cameraControllerKeyboard?.running&&(this._cameraControllerKeyboard.finishController(),this._cameraControllerKeyboard=null)}_handleKeyUp(e){if(e.data.native.ctrlKey||e.data.native.metaKey||!this._cameraControllerKeyboard?.running)return;if(this._precisionPanModifierKeys.has(e.data.key))return void this._updatePrecisionPanState(!1);if(this._coarsePanModifierKeys.has(e.data.key))return void this._updateCoarsePanState(!1);const i=this._keyToDirection.get(e.data.key);if(null==i)return;this._cameraControllerKeyboard.setPrecisionPanEnabled(this._isPrecisionPanModifierActive(e.modifiers)),this._cameraControllerKeyboard.setCoarsePanEnabled(this._isCoarsePanModifierActive(e.modifiers)),e.stopPropagation();const t=void 0===this._stickyKeyTimeoutHandle;void 0===this._stickyKeyTimeoutHandle||1!==this._cameraControllerKeyboard?.countActiveDirections()?(this._cameraControllerKeyboard?.deactivateDirection(i),t&&(this._stickyDirection=void 0)):this._stickyDirection=i}_isPanning(e){return e<=3}_isPrecisionPanModifierActive(e){return this._precisionPanModifierKeys.values().some(i=>e.has(i))}_isCoarsePanModifierActive(e){return this._coarsePanModifierKeys.values().some(i=>e.has(i))}_hasActivePanDirection(){return!!this._cameraControllerKeyboard&&(this._cameraControllerKeyboard.directionActive(0)||this._cameraControllerKeyboard.directionActive(1)||this._cameraControllerKeyboard.directionActive(2)||this._cameraControllerKeyboard.directionActive(3))}_updatePrecisionPanState(e){this._cameraControllerKeyboard?.running&&(e?this._cameraControllerKeyboard.setPrecisionPanEnabled(this._hasActivePanDirection()):this._cameraControllerKeyboard.setPrecisionPanEnabled(!1))}_updateCoarsePanState(e){this._cameraControllerKeyboard?.running&&(e?this._cameraControllerKeyboard.setCoarsePanEnabled(this._hasActivePanDirection()):this._cameraControllerKeyboard.setCoarsePanEnabled(!1))}_resetHeading(){this._view.goTo({heading:0}).catch(()=>{})}_resetTilt(){this._view.goTo({tilt:0}).catch(()=>{})}}export{a as KeyboardNavigation};
2
+ import{GamepadKeyboardController as e}from"../../state/controllers/GamepadKeyboardController.js";import{InputHandler as i}from"../../../input/InputHandler.js";import{onVisibilityChange as t}from"../../../input/VisibilityChange.js";class o extends i{constructor(e,i){super(!0),this._view=e,this._keyToDirection=new Map,this._keyToAction=new Map,this._precisionPanModifierKeys=new Set,this._coarsePanModifierKeys=new Set,this._stickyKeyTimeoutHandle=void 0,this._stickyKeyDuration=200,this._addKeysMapping(i),this.registerIncoming("key-down",null,e=>this._handleKeyDown(e)),this.registerIncoming("key-up",null,e=>this._handleKeyUp(e)),this.registerIncoming("blur",null,()=>this._handleStop()),this._visibilityHandle=t(e=>e?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}setStickyKeyDuration(e){this._stickyKeyDuration=e}_addKeysMapping(e){this._addKeyMapping(e.pan.left,0),this._addKeyMapping(e.pan.right,1),this._addKeyMapping(e.pan.forward,2),this._addKeyMapping(e.pan.backward,3),this._addKeyMapping(e.pan.up,4),this._addKeyMapping(e.pan.down,5),this._addKeyMapping(e.lookAround.headingLeft,6),this._addKeyMapping(e.lookAround.headingRight,7),this._addKeyMapping(e.lookAround.tiltUp,8),this._addKeyMapping(e.lookAround.tiltDown,9),this._addKeyMapping(e.zoom.zoomIn,10),this._addKeyMapping(e.zoom.zoomOut,11),this._addKeyAction(e.reset.heading,()=>this._resetHeading()),this._addKeyAction(e.reset.tilt,()=>this._resetTilt());for(const i of this._eachKey(e.precisionPanModifier))this._precisionPanModifierKeys.add(i);for(const i of this._eachKey(e.coarsePanModifier))this._coarsePanModifierKeys.add(i)}_addKeyMapping(e,i){for(const t of this._eachKey(e))this._keyToDirection.set(t,i)}*_eachKey(e){"string"==typeof e?yield e:yield*e}_addKeyAction(e,i){for(const t of this._eachKey(e))this._keyToAction.set(t,i)}_handleKeyDown(i){if(i.data.native.ctrlKey||i.data.native.metaKey)return;const t=this._keyToAction.get(i.data.key);if(null!=t)return i.stopPropagation(),void t();const o=this._keyToDirection.get(i.data.key);if(null!=o){if(this._cameraControllerKeyboard&&this._cameraControllerKeyboard.running||(this._cameraControllerKeyboard=new e({view:this._view}),this._view.state.switchCameraController(this._cameraControllerKeyboard)),this._updatePanModifiers(i),this._cameraControllerKeyboard.running){if(i.stopPropagation(),this._cameraControllerKeyboard.directionActive(o))return;if(this._cameraControllerKeyboard.activateDirection(o),this._cameraControllerKeyboard.countActiveDirections()>1||!this._isPanning(o))return;this._stickyKeyDuration>0&&(this._stickyKeyTimeoutHandle=setTimeout(()=>{this._stickyKeyTimeoutHandle=void 0,null!=this._stickyDirection&&void 0!==this._stickyDirection&&(this._cameraControllerKeyboard?.deactivateDirection(this._stickyDirection),this._stickyDirection=void 0)},this._stickyKeyDuration))}}else this._cameraControllerKeyboard?.running&&this._updatePanModifiers(i)}_handleStop(){this._cameraControllerKeyboard?.running&&(this._cameraControllerKeyboard.finishController(),this._cameraControllerKeyboard=null)}_handleKeyUp(e){if(e.data.native.ctrlKey||e.data.native.metaKey||!this._cameraControllerKeyboard?.running)return;this._updatePanModifiers(e);const i=this._keyToDirection.get(e.data.key);if(null==i)return;e.stopPropagation();const t=void 0===this._stickyKeyTimeoutHandle;void 0===this._stickyKeyTimeoutHandle||1!==this._cameraControllerKeyboard?.countActiveDirections()?(this._cameraControllerKeyboard?.deactivateDirection(i),t&&(this._stickyDirection=void 0)):this._stickyDirection=i}_isPanning(e){return e<=3}_updatePanModifiers(e){this._cameraControllerKeyboard?.setPrecisionPanEnabled(this._eventMatchesKeys(e,this._precisionPanModifierKeys)),this._cameraControllerKeyboard?.setCoarsePanEnabled(this._eventMatchesKeys(e,this._coarsePanModifierKeys))}_eventMatchesKeys(e,i){return"key-down"===e.type&&i.has(e.data.key)||i.values().some(i=>e.modifiers.has(i))}_resetHeading(){this._view.goTo({heading:0}).catch(()=>{})}_resetTilt(){this._view.goTo({tilt:0}).catch(()=>{})}}export{o as KeyboardNavigation};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{createScreenPointArray as t}from"../../../../../core/screenUtils.js";import{copy as e,subtract as i,length as o,scaleAndAdd as r,add as s}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as a}from"../../../../../geometry/ellipsoidUtils.js";import{fromRenderCamera as m}from"../../../webgl.js";import{pickPointAndInitSphere as c}from"../../../state/utils/navigationUtils.js";import{OffsetCorrectionController as l}from"../../../state/utils/OffsetCorrectionController.js";import p from"../../../webgl/RenderCamera.js";import{InputHandler as h}from"../../../../input/InputHandler.js";import{eventMatchesPointerAction as f}from"../../../../input/handlers/support.js";const _=.99,g=2,u=1e3,d=500;class v extends h{constructor(t,e){super(!0),this._view=t,this._tmpTranslation=n(),this._tmpTargetLocation=n(),this._tmpCenterOffset=n(),this.registerIncoming("double-click",e,t=>this._handleDoubleClick(t)),this._offsetCorrectionController=new l(this._view)}_handleDoubleClick(t){if("ground"!==this._view.navigation.mode.type)return;const{data:e}=t;f(e,"primary")&&(this._move(t),t.stopPropagation())}async _move(n){const l=this._view.state.camera,h=(new p).copyFrom(l),f=t(n.data.x,n.data.y);if(this._view.state.isGlobal){const t=c(this._view,this._view.state.camera,f,a(this._view.spatialReference).radius,1,{});if(null==t.scenePickPoint||!t.hasGeometryIntersection)return;e(this._tmpTargetLocation,t.scenePickPoint)}else{if(!this._view.sceneIntersectionHelper.intersectScreenFreePointFallback(f,this._tmpTargetLocation,{}))return}i(this._tmpTranslation,this._tmpTargetLocation,l.eye);const v=o(this._tmpTranslation),w=Math.min(_,Math.max(v-g,0)/v);r(this._tmpTargetLocation,l.eye,this._tmpTranslation,w),i(this._tmpCenterOffset,h.center,h.eye),h.eye=this._tmpTargetLocation,h.center=s(this._tmpCenterOffset,this._tmpTargetLocation,this._tmpCenterOffset),this._offsetCorrectionController.immediatelyCorrectGroundElevation(h,u),await this._view.goTo(m(this._view,h),{liftOffDisabled:!0,duration:d})}}export{v as GroundDoubleClickMove};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{debounce as a}from"../../../../../core/promiseUtils.js";import{scale as l,zeroMeters as r}from"../../../../../core/quantity.js";import{initial as p,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as d}from"../../../../../core/accessorSupport/ensureType.js";import{UpdatingHandles as m}from"../../../../../core/support/UpdatingHandles.js";import v from"../../../../../geometry/Point.js";import{makeDehydratedPoint as f}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as _}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{orientation as M}from"../geometryUtils.js";import{manipulatedObjectGeometry as y}from"../manipulatedObjectUtils.js";import{canMoveZOperations as b}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as j}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as T}from"../tooltipUtils3D.js";import{createVisualElements as w}from"../visualElementUtils.js";import{discRadius as I}from"../manipulations/config.js";import{MoveManipulation as H}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as S}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as O}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as D}from"./isSupportedObject.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as x}from"../../../support/elevationUpdateUtils.js";import{dragManipulatedObjectMany as P,resetManipulatedObjectMany as U}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as A}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as R}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import z from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as k}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as X}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Y,enterInputModeIfAvailable as B}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as C}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as V}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as G}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as F}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as W}from"../../../../support/GeometryWorkerHandle.js";class N{constructor(t){this.objects=t,this.type="move-start"}}class q{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class L{constructor(t){this.objects=t,this.type="move-stop"}}class J{constructor(t){this.objects=t,this.type="hold"}}const K=Symbol("manipulators"),Q=Symbol("tooltips"),$=Symbol("move-manipulator-display");let tt=class extends A{get _infos(){return Array.from(this._infosByType.values())}constructor(t){super(t),this._infosByType=new Map,this.events=new i,this.objects=new e,this.enableVisualElements=!0,this.enableZ=!0,this.manipulatorRadius=null,this.toolOptions=new z,this.type="move-3d",this._measurementWorker=new W({preloadGeodetic:!0}),this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new m,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=a(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){const{view:t}=this;this.tooltip=Y(()=>({view:t,options:this.toolOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,t=>{t.removed.forEach(t=>this.removeHandles(t)),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators(),this._connectTooltips()}));const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(t){if(this.destroyed)return;if(B(t,this.tooltip))return;const o=this.firstGrabbedManipulator;if("hold"===t.type&&null!=o){const t=this._getActiveObjectInfos(this._infos,o).map(({object:t})=>t);this.events.emit("hold",new J(t))}return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=y(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(0!==D(e))continue;const t=new et(e);this._infosByType.set(e,t)}for(const e of o)this._infosByType.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infosByType.get(o);this.addHandles(j(t.object),o)}}_refreshManipulators(){if(this.removeHandles(K),this.removeHandles($),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infosByType.size)return;const t=this._infos;this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new O({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator(t=>{this.addHandles([t.events.on("immediate-click",t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()}),t.events.on("grab-changed",({action:t})=>{"start"===t?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],K)}),this.addHandles(o.manipulationXY.createDragPipeline((o,e,i,n)=>this._buildDragEventPipeline(t,0,o,e,i,n)),K)}this._createMoveManipulation(t)}_updateMoveManipulatorDisplay(){const t=this._infos.some(t=>t.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!t),this.removeHandles($),t&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),$)}_createMoveManipulation(t){const o=new H({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:this.manipulatorRadius??(1===t.length?H.radiusForSymbol(t[0].object.graphic?.symbol):I)});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator(t=>{this.addHandles(t.events.on("immediate-click",e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()}),K)});const e=t=>o=>{this.addHandles([o.events.on("focus-changed",({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()}),o.events.on("grab-changed",()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=r)})],K)};this._moveManipulation.xyManipulation.forEachManipulator(e(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(1)),this._moveManipulation.zManipulation.forEachManipulator(e(2));const i=()=>this._updateMoveManipulation(t);for(const r of t){this.addHandles([r.object.on("committed",i),this._updatingHandles.add(()=>r.object.visible,i)],K);const o=Symbol();this.addHandles(this._updatingHandles.add(()=>r.object.isDraped,e=>{this._updateMoveManipulation(t),this.removeHandles(o),e&&this.addHandles(x({view:this.view,geometry:r.object.graphic?.geometry,elevationInfo:r.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(t)}),o)},p),K),this.addHandles(n(()=>this.removeHandles(o)),K)}const s=t[t.length-1];this.addHandles(s.object.on("committed",()=>this._updateMoveManipulationAngle(s)),K);const{object:a}=s,{operations:l}=a;if(l){const e=a.graphic;this.addHandles(o.createDragPipeline((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s),a.elevationInfo,l.data.spatialReference,e),K)}this._updateMoveManipulationAngle(s)}_createVisualElements(t){if(this.enableVisualElements)for(const o of t){const e=o.object,i=w({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof E&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",()=>{o.object.isDraped||this._updateMoveManipulation(t)}),this._updatingHandles.add(()=>o.object.isDraped,()=>this._updateMoveManipulation(t))],K),this.addHandles(i,K))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=M(y(t.object)))}_updateMoveManipulation(t){const o=f(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&b(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof E&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let r=null,p=null;const h=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,r=null,p=null,this._updateMoveManipulatorDisplay()};if(1===t.length&&0===o){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next(t=>p?.(t)).next(()=>(l.length&&this.events.emit("move-stop",new L(l)),this.destroyed||h(),null)),{steps:i=i.next(o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of this._getActiveObjectInfos(t,e))a.push(o),l.push(o.object),o.dragging=!0;if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),r=P(l),p=U(l),this._emitRecordUndo(),this.events.emit("move-start",new N(l)),this.destroyed))return null}return 0!==l.length?o:null}).next(t=>r?.(t)).next(t=>(this._updateMoveTooltip(o,t),t)).next(t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new q(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new L(l)),this.destroyed)return null;h()}return null}),cancel:n}}_getActiveObjectInfos(t,o){return t.filter(t=>!t.dragging&&(t.manipulationXY?.hasManipulator(o)||!t.manipulationXY?.grabbing))}_connectTooltips(){let t;if(this.removeHandles(Q),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new C({viewType:this.view.type,toolOptions:this.toolOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new N([o]))},onMove:()=>e.emit("move",new q(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new L([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=T(this.tooltip,o,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i}))}else t=this._updatingHandles.add(()=>this.toolOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,t=>{this.tooltip.info=t},h);this.addHandles(t,Q)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{toolOptions:e}=this;switch(t){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new V({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,(t,o)=>this._measurementWorker.autoDistance2DBetweenPoints(ot(t),ot(o))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new G({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,async(t,e)=>l(await this._measurementWorker.autoDistance2DBetweenPoints(ot(t),ot(e)),S(o))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new Z({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,F))}this._latestTooltipInfo.toolOptions=e}async _updateMoveTooltipDistanceAsync(t,o,e){if(null!=o&&"end"!==o.action){const{mapStart:i,mapEnd:n}=o,s=await e(i,n);t.distance=s??r}else t.distance=r}_emitRecordUndo(){const t=this.objects.toArray().map(t=>t.createUndoRecord?.()).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=y(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new k({elevationInfo:o,pointer:n,editGeometryOperations:R.fromGeometry(a,this.view.state.viewingMode),visualizer:new g,excludeFeature:t.graphic}),r=this.snappingManager,{snappingStep:p,cancelSnapping:h}=X({snappingContext:l,snappingManager:r,updatingHandles:this._updatingHandles});return i=i.next(h),{steps:e=e.next(o=>{a.z=_(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}}).next(...p),cancel:i}}get test(){}};t([c({constructOnly:!0,nonNullable:!0})],tt.prototype,"view",void 0),t([c()],tt.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],tt.prototype,"enableVisualElements",void 0),t([c({constructOnly:!0,nonNullable:!0})],tt.prototype,"enableZ",void 0),t([c({constructOnly:!0})],tt.prototype,"manipulatorRadius",void 0),t([c({constructOnly:!0,type:z})],tt.prototype,"toolOptions",void 0),t([c({constructOnly:!0})],tt.prototype,"snappingManager",void 0),t([c()],tt.prototype,"type",void 0),t([c()],tt.prototype,"updating",null),t([c()],tt.prototype,"_latestTooltipInfo",void 0),t([c()],tt.prototype,"_shouldShowMovePointTooltip",null),t([c()],tt.prototype,"activeTooltipInfo",null),tt=t([u("esri.views.3d.interactive.editingTools.move.MoveTool3D")],tt);const ot=d(v);class et{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{J as HoldEvent,q as MoveEvent,N as MoveStartEvent,L as MoveStopEvent,tt as MoveTool3D};
2
+ import{__decorate as t}from"tslib";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{debounce as a}from"../../../../../core/promiseUtils.js";import{scale as l,zeroMeters as r}from"../../../../../core/quantity.js";import{initial as p,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{property as c,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{ensureType as u}from"../../../../../core/accessorSupport/ensureType.js";import{UpdatingHandles as m}from"../../../../../core/support/UpdatingHandles.js";import v from"../../../../../geometry/Point.js";import{makeDehydratedPoint as f}from"../../../../../layers/graphics/dehydratedPoint.js";import{SnappingVisualizer3D as _}from"../../SnappingVisualizer3D.js";import{orientation as g}from"../geometryUtils.js";import{manipulatedObjectGeometry as M}from"../manipulatedObjectUtils.js";import{canMoveZOperations as y}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as b}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as j}from"../tooltipUtils3D.js";import{createVisualElements as T}from"../visualElementUtils.js";import{discRadius as w}from"../manipulations/config.js";import{MoveManipulation as I}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as H}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as S}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as O}from"./isSupportedObject.js";import{OutlineVisualElement as D}from"../../visualElements/OutlineVisualElement.js";import{createElevationUpdateHandle as E}from"../../../support/elevationUpdateUtils.js";import{dragManipulatedObjectMany as x,resetManipulatedObjectMany as P}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as U}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as A}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import R from"../../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as k}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as z}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as X,enterInputModeIfAvailable as Y}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as B}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as C}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as V}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as G}from"../../../../support/euclideanLengthMeasurementUtils.js";import{GeometryWorkerHandle as F}from"../../../../support/GeometryWorkerHandle.js";class W{constructor(t){this.objects=t,this.type="move-start"}}class N{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class q{constructor(t){this.objects=t,this.type="move-stop"}}class L{constructor(t){this.objects=t,this.type="hold"}}const J=Symbol("manipulators"),K=Symbol("tooltips"),Q=Symbol("move-manipulator-display");let $=class extends U{get _infos(){return Array.from(this._infosByType.values())}constructor(t){super(t),this._infosByType=new Map,this.events=new i,this.objects=new e,this.enableVisualElements=!0,this.enableZ=!0,this.manipulatorRadius=null,this.toolOptions=new R,this.type="move-3d",this._measurementWorker=new F({preloadGeodetic:!0}),this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new m,this._moveManipulation=null,this._updateMoveTooltipDistanceDebounced=a(this._updateMoveTooltipDistanceAsync.bind(this))}initialize(){const{view:t}=this;this.tooltip=X(()=>({view:t,options:this.toolOptions.tooltips})),this.addHandles(this._updatingHandles.addOnCollectionChange(()=>this.objects,t=>{t.removed.forEach(t=>this.removeHandles(t)),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators(),this._connectTooltips()}));const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy(),this._measurementWorker.destroy()}onInputEvent(t){if(this.destroyed)return;if(Y(t,this.tooltip))return;const o=this.firstGrabbedManipulator;if("hold"===t.type&&null!=o){const t=this._getActiveObjectInfos(this._infos,o).map(({object:t})=>t);this.events.emit("hold",new L(t))}return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating||!!this.snappingManager?.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=M(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(0!==O(e))continue;const t=new ot(e);this._infosByType.set(e,t)}for(const e of o)this._infosByType.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infosByType.get(o);this.addHandles(b(t.object),o)}}_refreshManipulators(){if(this.removeHandles(J),this.removeHandles(Q),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infosByType.size)return;const t=this._infos;this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new S({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator(t=>{this.addHandles([t.events.on("immediate-click",t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()}),t.events.on("grab-changed",({action:t})=>{"start"===t?this._showTooltip(0):this._hideTooltip(),this._updateMoveManipulatorDisplay()})],J)}),this.addHandles(o.manipulationXY.createDragPipeline((o,e,i,n)=>this._buildDragEventPipeline(t,0,o,e,i,n)),J)}this._createMoveManipulation(t)}_updateMoveManipulatorDisplay(){const t=this._infos.some(t=>t.manipulationXY?.grabbing);this._moveManipulation&&(this._moveManipulation.interactive=!t),this.removeHandles(Q),t&&this._moveManipulation&&this.addHandles(this._moveManipulation.hideManipulators(),Q)}_createMoveManipulation(t){const o=new I({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:this.manipulatorRadius??(1===t.length?I.radiusForSymbol(t[0].object.graphic?.symbol):w)});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator(t=>{this.addHandles(t.events.on("immediate-click",e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()}),J)});const e=t=>o=>{this.addHandles([o.events.on("focus-changed",({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()}),o.events.on("grab-changed",()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=r)})],J)};this._moveManipulation.xyManipulation.forEachManipulator(e(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(1)),this._moveManipulation.zManipulation.forEachManipulator(e(2));const i=()=>this._updateMoveManipulation(t);for(const r of t){this.addHandles([r.object.on("committed",i),this._updatingHandles.add(()=>r.object.visible,i)],J);const o=Symbol();this.addHandles(this._updatingHandles.add(()=>r.object.isDraped,e=>{this._updateMoveManipulation(t),this.removeHandles(o),e&&this.addHandles(E({view:this.view,geometry:r.object.graphic?.geometry,elevationInfo:r.object.elevationInfo,onElevationChanges:()=>this._updateMoveManipulation(t)}),o)},p),J),this.addHandles(n(()=>this.removeHandles(o)),J)}const s=t[t.length-1];this.addHandles(s.object.on("committed",()=>this._updateMoveManipulationAngle(s)),J);const{object:a}=s,{operations:l}=a;if(l){const e=a.graphic;this.addHandles(o.createDragPipeline((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s),a.elevationInfo,l.data.spatialReference,e),J)}this._updateMoveManipulationAngle(s)}_createVisualElements(t){if(this.enableVisualElements)for(const o of t){const e=o.object,i=T({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof D&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",()=>{o.object.isDraped||this._updateMoveManipulation(t)}),this._updatingHandles.add(()=>o.object.isDraped,()=>this._updateMoveManipulation(t))],J),this.addHandles(i,J))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=g(M(t.object)))}_updateMoveManipulation(t){const o=f(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&y(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof D&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let r=null,p=null;const h=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,r=null,p=null,this._updateMoveManipulatorDisplay()};if(1===t.length&&0===o){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next(t=>p?.(t)).next(()=>(l.length&&this.events.emit("move-stop",new q(l)),this.destroyed||h(),null)),{steps:i=i.next(o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of this._getActiveObjectInfos(t,e))a.push(o),l.push(o.object),o.dragging=!0;if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),r=x(l),p=P(l),this._emitRecordUndo(),this.events.emit("move-start",new W(l)),this.destroyed))return null}return 0!==l.length?o:null}).next(t=>r?.(t)).next(t=>(this._updateMoveTooltip(o,t),t)).next(t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new N(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new q(l)),this.destroyed)return null;h()}return null}),cancel:n}}_getActiveObjectInfos(t,o){return t.filter(t=>!t.dragging&&(t.manipulationXY?.hasManipulator(o)||!t.manipulationXY?.grabbing))}_connectTooltips(){let t;if(this.removeHandles(K),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new B({viewType:this.view.type,toolOptions:this.toolOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new W([o]))},onMove:()=>e.emit("move",new N(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new q([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=j(this.tooltip,o,()=>({toolOptions:this.toolOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i}))}else t=this._updatingHandles.add(()=>this.toolOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,t=>{this.tooltip.info=t},h);this.addHandles(t,K)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{toolOptions:e}=this;switch(t){case 0:this._latestTooltipInfo=this._translateTooltipInfo??=new C({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,(t,o)=>this._measurementWorker.autoDistance2DBetweenPoints(tt(t),tt(o))));break;case 1:this._latestTooltipInfo=this._translateXYTooltipInfo??=new V({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,async(t,e)=>l(await this._measurementWorker.autoDistance2DBetweenPoints(tt(t),tt(e)),H(o))));break;case 2:this._latestTooltipInfo=this._translateZTooltipInfo??=new Z({toolOptions:e}),this._updatingHandles.consumePromise(this._updateMoveTooltipDistanceDebounced(this._latestTooltipInfo,o,G))}this._latestTooltipInfo.toolOptions=e}async _updateMoveTooltipDistanceAsync(t,o,e){if(null!=o&&"end"!==o.action){const{mapStart:i,mapEnd:n}=o,s=await e(i,n);t.distance=s??r}else t.distance=r}_emitRecordUndo(){const t=this.objects.toArray().map(t=>t.createUndoRecord?.()).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=M(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new k({elevationInfo:o,pointer:n,editGeometryOperations:A.fromGeometry(a,this.view.state.viewingMode),visualizer:new _,excludeFeature:t.graphic}),r=this.snappingManager,{snappingStep:p,cancelSnapping:h}=z({snappingContext:l,snappingManager:r,updatingHandles:this._updatingHandles,useZ:"on-the-ground"!==o.mode});return i=i.next(h),{steps:e=e.next(t=>({...t,snapOrigin:l.coordinateHelper.pointToVector(a)})).next(...p),cancel:i}}get test(){}};t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"view",void 0),t([c()],$.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"enableVisualElements",void 0),t([c({constructOnly:!0,nonNullable:!0})],$.prototype,"enableZ",void 0),t([c({constructOnly:!0})],$.prototype,"manipulatorRadius",void 0),t([c({constructOnly:!0,type:R})],$.prototype,"toolOptions",void 0),t([c({constructOnly:!0})],$.prototype,"snappingManager",void 0),t([c()],$.prototype,"type",void 0),t([c()],$.prototype,"updating",null),t([c()],$.prototype,"_latestTooltipInfo",void 0),t([c()],$.prototype,"_shouldShowMovePointTooltip",null),t([c()],$.prototype,"activeTooltipInfo",null),$=t([d("esri.views.3d.interactive.editingTools.move.MoveTool3D")],$);const tt=u(v);class ot{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}export{L as HoldEvent,N as MoveEvent,W as MoveStartEvent,q as MoveStopEvent,$ as MoveTool3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../core/Error.js";const r=()=>import("./layers/TileLayerView3D.js"),a=()=>import("./layers/ElevationLayerView3D.js"),i={"base-dynamic":()=>import("./layers/BaseDynamicLayerView3D.js"),"base-elevation":a,"base-tile":r,"bing-maps":r,"building-scene":()=>import("./layers/BuildingSceneLayerView3D.js"),catalog:()=>import("./layers/CatalogLayerView3D.js"),"catalog-dynamic-group":()=>import("./layers/CatalogDynamicGroupLayerView3D.js"),"catalog-footprint":()=>import("./layers/CatalogFootprintLayerView3D.js"),csv:()=>import("./layers/CSVLayerView3D.js"),dimension:()=>import("./layers/DimensionLayerView3D.js"),elevation:a,feature:()=>import("./layers/FeatureLayerView3D.js"),"gaussian-splat":()=>import("./layers/GaussianSplatLayerView3D.js"),geojson:()=>import("./layers/GeoJSONLayerView3D.js"),graphics:()=>import("./layers/GraphicsLayerView3D.js"),group:()=>import("./layers/GroupLayerView3D.js"),imagery:()=>import("./layers/ImageryLayerView3D.js"),"integrated-mesh":()=>import("./layers/IntegratedMeshLayerView3D.js"),"integrated-mesh-3dtiles":()=>import("./layers/IntegratedMesh3DTilesLayerView3D.js"),"line-of-sight":()=>import("./layers/LineOfSightLayerView3D.js"),"map-image":()=>import("./layers/MapImageLayerView3D.js"),media:()=>import("./layers/MediaLayerView3D.js"),"ogc-feature":()=>import("./layers/OGCFeatureLayerView3D.js"),"open-street-map":r,"oriented-imagery":()=>import("./layers/FeatureLayerView3D.js"),"point-cloud":()=>import("./layers/PointCloudLayerView3D.js"),viewshed:()=>import("./layers/ViewshedLayerView3D.js"),voxel:()=>import("./layers/VoxelLayerView3D.js"),route:()=>import("./layers/RouteLayerView3D.js"),scene:e=>null==e.profile||"mesh-pyramids"===e.profile?import("./layers/SceneLayerView3D.js"):import("./layers/SceneLayerGraphicsView3D.js"),stream:()=>import("./layers/StreamLayerView3D.js"),tile:r,"imagery-tile":()=>import("./layers/ImageryTileLayerView3D.js"),"vector-tile":()=>import("./layers/VectorTileLayerView3D.js"),wcs:()=>import("./layers/ImageryTileLayerView3D.js"),"web-tile":r,wfs:()=>import("./layers/WFSLayerView3D.js"),wms:()=>import("./layers/WMSLayerView3D.js"),wmts:()=>import("./layers/WMTSLayerView3D.js"),"annotation-feature":null,"geo-rss":null,kml:null,"knowledge-graph-sublayer":null,"knowledge-graph":null,"link-chart":null,"map-notes":null,parquet:null,"subtype-group":null,unknown:null,unsupported:null,video:null,"dimension-feature":null};function s(r){const a=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",i=a.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${i}:view-not-supported`,`${a} is not supported in 3D`)}const t=new Map,l={hasLayerViewModule:e=>null!=i[e.type],importLayerView:e=>{const r=o(e),a=t.get(r);if(a)return a;const l=i[e.type];if(null==l)throw s(e);const y=l(e);return t.set(r,y),y}};function o(e){return"scene"===e.type?`${e.type}-${e.profile}`:e.type}export{l as layerView3DImporter};
2
+ import e from"../../core/Error.js";const r=()=>import("./layers/TileLayerView3D.js"),a=()=>import("./layers/ElevationLayerView3D.js"),i={"base-dynamic":()=>import("./layers/BaseDynamicLayerView3D.js"),"base-elevation":a,"base-tile":r,"bing-maps":r,"building-scene":()=>import("./layers/BuildingSceneLayerView3D.js"),catalog:()=>import("./layers/CatalogLayerView3D.js"),"catalog-dynamic-group":()=>import("./layers/CatalogDynamicGroupLayerView3D.js"),"catalog-footprint":()=>import("./layers/CatalogFootprintLayerView3D.js"),csv:()=>import("./layers/CSVLayerView3D.js"),dimension:()=>import("./layers/DimensionLayerView3D.js"),elevation:a,feature:()=>import("./layers/FeatureLayerView3D.js"),"gaussian-splat":()=>import("./layers/GaussianSplatLayerView3D.js"),"geospatial-pdf":()=>import("./layers/GeospatialPDFLayerView3D.js"),geojson:()=>import("./layers/GeoJSONLayerView3D.js"),graphics:()=>import("./layers/GraphicsLayerView3D.js"),group:()=>import("./layers/GroupLayerView3D.js"),imagery:()=>import("./layers/ImageryLayerView3D.js"),"integrated-mesh":()=>import("./layers/IntegratedMeshLayerView3D.js"),"integrated-mesh-3dtiles":()=>import("./layers/IntegratedMesh3DTilesLayerView3D.js"),"line-of-sight":()=>import("./layers/LineOfSightLayerView3D.js"),"map-image":()=>import("./layers/MapImageLayerView3D.js"),media:()=>import("./layers/MediaLayerView3D.js"),"ogc-feature":()=>import("./layers/OGCFeatureLayerView3D.js"),"open-street-map":r,"oriented-imagery":()=>import("./layers/FeatureLayerView3D.js"),"point-cloud":()=>import("./layers/PointCloudLayerView3D.js"),viewshed:()=>import("./layers/ViewshedLayerView3D.js"),voxel:()=>import("./layers/VoxelLayerView3D.js"),route:()=>import("./layers/RouteLayerView3D.js"),scene:e=>null==e.profile||"mesh-pyramids"===e.profile?import("./layers/SceneLayerView3D.js"):import("./layers/SceneLayerGraphicsView3D.js"),stream:()=>import("./layers/StreamLayerView3D.js"),tile:r,"imagery-tile":()=>import("./layers/ImageryTileLayerView3D.js"),"vector-tile":()=>import("./layers/VectorTileLayerView3D.js"),wcs:()=>import("./layers/ImageryTileLayerView3D.js"),"web-tile":r,wfs:()=>import("./layers/WFSLayerView3D.js"),wms:()=>import("./layers/WMSLayerView3D.js"),wmts:()=>import("./layers/WMTSLayerView3D.js"),"annotation-feature":null,"geo-rss":null,kml:null,"knowledge-graph-sublayer":null,"knowledge-graph":null,"link-chart":null,"map-notes":null,parquet:null,"subtype-group":null,unknown:null,unsupported:null,video:null,"dimension-feature":null};function s(r){const a=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",i=a.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${i}:view-not-supported`,`${a} is not supported in 3D`)}const t=new Map,l={hasLayerViewModule:e=>null!=i[e.type],importLayerView:e=>{const r=o(e),a=t.get(r);if(a)return a;const l=i[e.type];if(null==l)throw s(e);const y=l(e);return t.set(r,y),y}};function o(e){return"scene"===e.type?`${e.type}-${e.profile}`:e.type}export{l as layerView3DImporter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as i,removeMaybe as s,destroyMaybe as a}from"../../../core/maybe.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{watch as n,whenOnce as l,initial as o}from"../../../core/reactiveUtils.js";import{isUint32Array as h}from"../../../core/typedArrayUtil.js";import{unitFromRESTJSON as d,convertUnit as u}from"../../../core/units.js";import{property as c,subclass as p}from"../../../core/accessorSupport/decorators.js";import{fromValues as m}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import g from"../../../geometry/HeightModelInfo.js";import{create as _}from"../../../geometry/support/aaBoundingBox.js";import{isCompatible as y}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as w,isWebMercator as b,equals as v,isGeographic as S}from"../../../geometry/support/spatialReferenceUtils.js";import C from"../../../geometry/support/WKIDUnitConversion.js";import{validateEntity3D as M,makeCacheKey as T,getHeightModelInfoFromVCS as I}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as x}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as H}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as P}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as A}from"./LayerView3D.js";import{addLayerViewToWasm as F,getLyr3DWasm as R,removeLayerViewFromWasm as V}from"./Lyr3DWasm.js";import{LayerElevationProvider as j}from"./i3s/LayerElevationProvider.js";import{ElevationRange as E}from"../support/ElevationRange.js";import{projectToBoundingBox as G}from"../support/extentUtils.js";import{Obb as U}from"../support/orientedBoundingBox.js";import{splatPageSizeInU32 as D,gaussiansPerPage as B,packedGaussianSizeInU32 as O,splatAtlasTextureWidth as z}from"../support/gaussianSplatting/GaussianSplatAtlasPages.js";import{GaussianSplatDataStore as L}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as k}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as q}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTile as W}from"../support/gaussianSplatting/GaussianTile.js";import{GaussianSplatDepthRenderer as $}from"../webgl-engine/lib/GaussianSplatDepthRenderer.js";import{GaussianSplatRenderer as N}from"../webgl-engine/lib/GaussianSplatRenderer.js";import{GaussianSplatShadows as X}from"../webgl-engine/lib/GaussianSplatShadows.js";import Z from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as K,isInEffectiveScaleRange as Y}from"../../support/layerViewUtils.js";import{TaskPriority as J}from"../../support/Scheduler.js";var Q;const ee=()=>t.getLogger("esri.views.3d.layers.GaussianSplatLayerView3D"),te=3,ie=te*te,se=255,ae=(()=>{const e=new Int16Array(se+1);e[0]=-255;for(let t=1;t<e.length;t++)e[t]=Math.round(16*Math.log(t/se));return e})();let re=class extends(A(Z)){static{Q=this}static{this.createRenderableBatchSize=64}static{this.uploadBatchPageCount=16}constructor(e){super(e),this.type="gaussian-splat-3d",this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._pageBuffer=new Uint32Array(D*Q.uploadBatchPageCount),this._tmpTilesWithChangedVisibility=new Array,this._renderablesBeingCreated=new Set,this._currentLyr3dVisibilityChange=0,this._tileFadeInsAwaitingInitialSort=new Map,this._tileFadeOutsAwaitingInitialSort=new Map,this._fadeDurationPerVisibilityChange=new Map,this._tmpSortedTileHandles=new Set,this._createRenderableAbortController=new AbortController,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer);const t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(J.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;const e=_();return G(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderer?.clippingBox??null}initialize(){const{view:e}=this;this.addHandles([n(()=>e.qualitySettings.fadeDuration,e=>{this.data&&(this.fadeHelper.onFadeDurationChanged(e),this.updateFadingTexture())})]),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;const{signal:t}=this._initializationController;if(await l(()=>e?.defaultsFromMap.heightModelInfoReady,t),r(t),!this._canProjectWithoutEngine())throw K("layer",this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._wasmLayerId=await F(this,t),r(t),this._renderer=new N({view:e,layerView:this}),this.data=new L(this._renderer,(e,t)=>this._onSortComplete(e,t),()=>this._freeInvisibleTiles()),this._shadows=new X({view:e,layerView:this}),this.fadeHelper=new k(this),this._prepassDepthRenderer=new $({view:e,layerView:this});const i=new q(this);this._intersectionHandler=i,e.sceneIntersectionHelper.addIntersectionHandler(i),this._elevationProvider=new j({view:e,layerElevationSource:this,intersectionHandler:i}),e.elevationProvider.register(2,this._elevationProvider),this.addHandles([n(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),n(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),o)]),this._suspendedHandle=n(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),o),this.addHandles([n(()=>this._clippingBox,e=>{this._renderer&&(this._renderer.clippingBox=e)},o),n(()=>this.maximumGaussianCount,e=>this._wasm?.setMaximumGaussianSplatCount(Math.min(e,this.data.textureAtlas.maximumSupportedVisibleGaussians)),o)]),this._initializationController=null}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}updateFadingTexture(){this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}get _wasm(){return R(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return x(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new E(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return Y(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy");const{entity3d:t}=e;if(!M(t))throw new Error("entity3D not valid");const i=t.desc.geometry.prims[t.validPrimitiveIndices[0]].atrbs[0],s=t.assets[i.assetId];if(!s)throw new Error("entity3D not valid");const a=s.count;if(0===a)return ee().warnOnce("encountered tile with zero Gaussians"),()=>({memUsageBytes:0,numGaussians:0});let r=null;if("U32"!==s.dataType||!h(s.data))throw new Error("unexpected GaussianSplat Entity3D asset.data format");r=s.data;const n=this.extractHeader(r),l=2.048,o=n.tileOrigin.x*l,d=n.tileOrigin.y*l,u=n.tileOrigin.z*l,c=t.desc,p=c.obb.quaternion,g=new U(c.obb.center,c.obb.halfSize,m(...p)),_=this.view.state.isGlobal,y=_?f(this.view.spatialReference).radius:0,w={handle:e.handle,bufferView:r,totalGaussians:a,packedHeader:n.packedHeader,tileOrigin:{x:o,y:d,z:u},invPosScale:n.invPosScale,obb:g,origin:{x:g.centerX,y:g.centerY,z:g.centerZ},isGlobal:_,ellipsoidRadius:y};let b;this._renderablesBeingCreated.add(e.handle);try{b=await this._frameTask.scheduleGenerator(e=>this._createRenderableTask(w,e),this._createRenderableAbortController.signal)}catch(v){throw this._renderablesBeingCreated.delete(e.handle),v}return this._renderablesBeingCreated.delete(e.handle),()=>b}*_createRenderableTask(e,t){const{handle:i,bufferView:s,totalGaussians:a,packedHeader:r,tileOrigin:n,invPosScale:l,obb:o,origin:h,isGlobal:d,ellipsoidRadius:u}=e,c=n.x,p=n.y,m=n.z,f=h.x,g=h.y,_=h.z,y=new Float32Array(3*a),w=new Uint32Array(a),b=new Uint32Array(a),v=new Array,S=Math.ceil(a/B);let C=1/0,M=-1/0,T=1/0,I=-1/0,x=0,H=-1,P=0,A=0;for(let E=0;E<a;E++){const e=E*O,i=s[e],a=s[e+1],r=s[e+2],n=s[e+3],o=16383&a,h=a>>>14&16383,u=a>>>28&15|(1023&r)<<4,v=n>>>24,S=ae[v],F=(r>>>10&255)+S,R=(r>>>18&255)+S,V=(r>>>26&63|(3&n)<<6)+S,j=F>0?F:0,G=R>0?R:0,U=V>0?V:0,D=j|G<<8|U<<16,B=Math.max(j,G,U),z=o*l+c,L=h*l+p,k=u*l+m;if(y[x]=z-f,y[x+1]=L-g,y[x+2]=k-_,d){const e=z*z+L*L+k*k;T=Math.min(T,e),I=Math.max(I,e)}else C=Math.min(C,k),M=Math.max(M,k);w[E]=i,b[E]=D,B>H&&(H=B),v>P&&(P=v),x+=3,A++,A===Q.createRenderableBatchSize&&(A=0,t.madeProgress()&&(t=yield))}A>0&&t.madeProgress()&&(t=yield),d&&(C=Math.sqrt(T)-u,M=Math.sqrt(I)-u);const F=this._extractGaussianSplatMbsRadiusSquared(H),{fullExtent:R}=this.layer;R?.hasZ&&R.zmax&&R.zmin&&(C=Math.max(C,R.zmin),M=Math.min(M,R.zmax));const V=new E(C,M),j=this.data.textureAtlas,G=this.data.headerTexture;try{for(let e=0;e<S;e+=Q.uploadBatchPageCount){const i=Math.min(S,e+Q.uploadBatchPageCount);for(let t=e;t<i;t++){let e=j.allocatePage();if(null===e&&(this._freeInvisibleTiles(),e=j.allocatePage()),null===e)throw new Error("ran out of gaussian splat memory");v.push(e)}for(let t=e;t<i;){const e=v[t];let n=t+1;for(;n<i&&v[n]===v[n-1]+1;)n++;const l=n-t,o=a-t*B,h=Math.min(o,l*B),d=t*D,u=h*O;this._pageBuffer.set(s.subarray(d,d+u));const c=e*B,p=c%z,m=Math.floor(c/z);j.update(p,m,this._pageBuffer,l),G.update(e,r,l),t=n}t.madeProgress()&&(t=yield)}}catch(L){throw j.freePages(v),L}const U=new W(i,o,v,y,w,b,a,F,P/se,V);return this._tileHandles.set(i,U),this._cacheTileMemory+=U.usedMemory,this._memCache.put(`${U.handle}`,U),{memUsageBytes:U.usedMemory,numGaussians:a}}_extractGaussianSplatMbsRadiusSquared(e){return Math.exp(e/8-20)*ie}freeRenderable(e){this._tileFadeInsAwaitingInitialSort.delete(e),this._tileFadeOutsAwaitingInitialSort.delete(e);const t=this.data?.textureAtlas;let i=!1;const s=this._tileHandles.get(e);if(s){0!==s.lifecycleState?(i=!0,this.fadeHelper.onTileDiscarded(s),this._usedTileMemory-=s.usedMemory,this._intersectionHandler.removeTile(s)):this._cacheTileMemory-=s.usedMemory,t&&s.pageIds.forEach(e=>t.freePage(e)),this.freeObject(s),this._tileHandles.delete(e)}i&&this.updateGaussians()}freeObject(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(e.length,t=>{for(const{obb:i}of e)if(!t(i))break})}setRenderableVisibility(e,t,i){const s=this._currentLyr3dVisibilityChange+1,a=this.fadeHelper.updateFadeDuration();this._fadeDurationPerVisibilityChange.set(s,a);let r=!1;for(let n=0;n<i;n++){const i=this._tileHandles.get(e[n]);if(!i)continue;const l=t[n]?this._prepareTileFadeIn(i,s,a):this._prepareTileFadeOut(i,s);r||=l}r?(this._currentLyr3dVisibilityChange=s,this.updateGaussians()):this._fadeDurationPerVisibilityChange.delete(s)}_prepareTileFadeIn(e,t,i){const s=this._tileFadeOutsAwaitingInitialSort.delete(e.handle);return 2===e.lifecycleState?(this.fadeHelper.fadeTile(e,0,i),!1):this._tileFadeInsAwaitingInitialSort.get(e.handle)!==t?(0===e.lifecycleState&&this._popTileFromCache(e),e.lifecycleState=1,this._tileFadeInsAwaitingInitialSort.set(e.handle,t),!0):s}_prepareTileFadeOut(e,t){const i=this._tileFadeInsAwaitingInitialSort.delete(e.handle);return i&&1===e.lifecycleState&&(this.moveTileToCache(e),e.lifecycleState=0),2!==e.lifecycleState?i:this._tileFadeOutsAwaitingInitialSort.get(e.handle)!==t?(this._tileFadeOutsAwaitingInitialSort.set(e.handle,t),!0):i}_onSortComplete(e,t){const i=this._tmpTilesWithChangedVisibility;i.length=0;const s=this._tmpSortedTileHandles;s.clear();for(let r=0;r<e.length;r++){const t=e[r];s.add(t.handle)}this._triggerFadeIns(t,s,i);const a=this._triggerFadeOuts(t,i);s.clear(),i.length>0&&this.notifyTileObbsChanged(i),a&&this.updateGaussians(),this._cleanupVisibilityChangeFadeDurations(t)}_triggerFadeIns(e,t,i){for(const[s,a]of this._tileFadeInsAwaitingInitialSort){if(a>e||!t.has(s))continue;const r=this._tileHandles.get(s);if(!r){this._tileFadeInsAwaitingInitialSort.delete(s);continue}const n=this._getFadeDurationForPendingVisibilityChange(a),l=0===r.lifecycleState;2!==r.lifecycleState&&(r.lifecycleState=2,l&&this._popTileFromCache(r),i.push(r)),this.fadeHelper.fadeTile(r,0,n),this._tileFadeInsAwaitingInitialSort.delete(s)}}_triggerFadeOuts(e,t){let i=!1;for(const[s,a]of this._tileFadeOutsAwaitingInitialSort){if(a>e)continue;const r=this._tileHandles.get(s);if(r){const e=2===r.lifecycleState,s=this._getFadeDurationForPendingVisibilityChange(a);this.fadeHelper.fadeTile(r,1,s),e&&0===r.lifecycleState&&(t.push(r),i=!0)}this._tileFadeOutsAwaitingInitialSort.delete(s)}return i}_getFadeDurationForPendingVisibilityChange(e){return this._fadeDurationPerVisibilityChange.get(e)??this.fadeHelper.baseFadeDuration}_cleanupVisibilityChangeFadeDurations(e){if(0!==this._fadeDurationPerVisibilityChange.size)for(const t of this._fadeDurationPerVisibilityChange.keys())t<=e&&this._fadeDurationPerVisibilityChange.delete(t)}_popTileFromCache(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(T(e.handle))}moveTileToCache(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(T(e.handle),e)}destroy(){this._initializationController=i(this._initializationController),this._createRenderableAbortController.abort(),V(this),this._suspendedHandle&&(this._suspendedHandle=s(this._suspendedHandle)),this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(this._tileHandles.size,e=>{for(const{obb:t}of this._tileHandles.values())if(!e(t))break}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._shadows=a(this._shadows),this._prepassDepthRenderer=a(this._prepassDepthRenderer),this._renderer=a(this._renderer),this._memCache.destroy(),this.data=a(this.data)}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if(w(this.view.renderSpatialReference)||b(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&v(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(115700===this.layer.esriCrsSpatialReference.vcsWkid)return!1;let e=I(this.layer.esriCrsSpatialReference);if(!e){const t=this.layer.esriCrsSpatialReference;let i="meters";!S(t)&&t.wkid&&-1!==t.wkid&&(i=d(C.units[C[t.wkid]])),i&&(e=new g({heightModel:"gravity-related-height",heightUnit:i}))}const t=this.view.heightModelInfo;return this._useEsriCrs=0===y(e,t,!1),this._useEsriCrs&&(e&&(this._metersPerVCSUnit=u(1,e.heightUnit,"meters")),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}_elevationInfoChanged(e){if(e?.offset)if(this._useEsriCrs){const t=H(e?.unit)/this._metersPerVCSUnit,i=e?.offset??0;this._wasm?.setLayerOffset(this,i*t)}else this._wasm?.setLayerOffset(this,x(e));else this._wasm?.setLayerOffset(this,0)}_slicePlaneEnabledChanged(e){this._renderer&&(this._renderer.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateGaussians(){const e=new Array;for(const t of this._tileHandles.values())0!==t.lifecycleState&&e.push(t);this.data.updateGaussianVisibility(e,this._currentLyr3dVisibilityChange),this.notifyChange("updating")}get maximumGaussianCount(){return this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*this.view.quality}set maximumGaussianCount(e){this._set("maximumGaussianCount",e)}_freeInvisibleTiles(){for(const e of this._tileHandles.values())0!==e.lifecycleState||this._renderablesBeingCreated.has(e.handle)||this._deleteTile(e)}extractHeader(e){const t=e.length-4,i=this.reinterpretU32AsFloat(e[t]),s=this.reinterpretU32AsFloat(e[t+1]),a=this.reinterpretU32AsFloat(e[t+2]),r=1/(1<<(255&e[t+3]));return{packedHeader:e.subarray(t,t+4),tileOrigin:{x:i,y:s,z:a},invPosScale:r}}_deleteTile(e){this._renderablesBeingCreated.has(e.handle)||this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(i=>{0===i.lifecycleState?t++:e++});const i=this.data?.textureAtlasMemory??0,s=this.data?.headerTextureMemory??0,a=this.data?.orderTextureMemory??0,r=this.data?.fadingTextureMemory??0,n=this.data?.sortBufferMemory??0;return new P(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,i,s,a,r,n)}get test(){}};e([c()],re.prototype,"layer",void 0),e([c({readOnly:!0})],re.prototype,"_clippingBox",null),e([c()],re.prototype,"elevationOffset",null),e([c({readOnly:!0})],re.prototype,"visibleAtCurrentScale",null),e([c()],re.prototype,"fullExtentInLocalViewSpatialReference",void 0),e([c()],re.prototype,"maximumGaussianCount",null),re=Q=e([p("esri.views.3d.layers.GaussianSplatLayerView3D")],re);const ne=re;export{ne as default};
2
+ import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as i,removeMaybe as s,destroyMaybe as a}from"../../../core/maybe.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{watch as n,whenOnce as l,initial as o}from"../../../core/reactiveUtils.js";import{isUint32Array as h}from"../../../core/typedArrayUtil.js";import{unitFromRESTJSON as d,convertUnit as u}from"../../../core/units.js";import{property as c,subclass as p}from"../../../core/accessorSupport/decorators.js";import{fromValues as m}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{getReferenceEllipsoid as f}from"../../../geometry/ellipsoidUtils.js";import g from"../../../geometry/HeightModelInfo.js";import{create as _}from"../../../geometry/support/aaBoundingBox.js";import{isCompatible as y}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as w,isWebMercator as b,equals as v,isGeographic as S}from"../../../geometry/support/spatialReferenceUtils.js";import C from"../../../geometry/support/WKIDUnitConversion.js";import{validateEntity3D as M,makeCacheKey as T,getHeightModelInfoFromVCS as I}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as x}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as H}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as P}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as A}from"./LayerView3D.js";import{addLayerViewToWasm as F,getLyr3DWasm as R,removeLayerViewFromWasm as V}from"./Lyr3DWasm.js";import{LayerElevationProvider as j}from"./i3s/LayerElevationProvider.js";import{ElevationRange as E}from"../support/ElevationRange.js";import{projectToBoundingBox as G}from"../support/extentUtils.js";import{Obb as U}from"../support/orientedBoundingBox.js";import{splatPageSizeInU32 as D,gaussiansPerPage as B,packedGaussianSizeInU32 as O,splatAtlasTextureWidth as z}from"../support/gaussianSplatting/GaussianSplatAtlasPages.js";import{GaussianSplatDataStore as L}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as k}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as q}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTile as W}from"../support/gaussianSplatting/GaussianTile.js";import{GaussianSplatDepthRenderer as $}from"../webgl-engine/lib/GaussianSplatDepthRenderer.js";import{GaussianSplatRenderer as N}from"../webgl-engine/lib/GaussianSplatRenderer.js";import{GaussianSplatShadows as X}from"../webgl-engine/lib/GaussianSplatShadows.js";import Z from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as K,isInEffectiveScaleRange as Y}from"../../support/layerViewUtils.js";import{TaskPriority as J}from"../../support/Scheduler.js";var Q;const ee=()=>t.getLogger("esri.views.3d.layers.GaussianSplatLayerView3D"),te=3,ie=te*te,se=255,ae=(()=>{const e=new Int16Array(se+1);e[0]=-255;for(let t=1;t<e.length;t++)e[t]=Math.round(16*Math.log(t/se));return e})();let re=class extends(A(Z)){static{Q=this}static{this.createRenderableBatchSize=64}static{this.uploadBatchPageCount=16}constructor(e){super(e),this.type="gaussian-splat-3d",this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._pageBuffer=new Uint32Array(D*Q.uploadBatchPageCount),this._tmpTilesWithChangedVisibility=new Array,this._renderablesBeingCreated=new Set,this._currentLyr3dVisibilityChange=0,this._tileFadeInsAwaitingInitialSort=new Map,this._tileFadeOutsAwaitingInitialSort=new Map,this._fadeDurationPerVisibilityChange=new Map,this._tmpSortedTileHandles=new Set,this._createRenderableAbortController=new AbortController,this.skipHeightModelInfoValidation=!0,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer);const t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(J.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;const e=_();return G(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderer?.clippingBox??null}initialize(){const{view:e}=this;this.addHandles([n(()=>e.qualitySettings.fadeDuration,e=>{this.data&&(this.fadeHelper.onFadeDurationChanged(e),this.updateFadingTexture())})]),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;const{signal:t}=this._initializationController;if(await l(()=>e?.defaultsFromMap.heightModelInfoReady,t),r(t),!this._canProjectWithoutEngine())throw K("layer",this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._wasmLayerId=await F(this,t),r(t),this._renderer=new N({view:e,layerView:this}),this.data=new L(this._renderer,(e,t)=>this._onSortComplete(e,t),()=>this._freeInvisibleTiles()),this._shadows=new X({view:e,layerView:this}),this.fadeHelper=new k(this),this._prepassDepthRenderer=new $({view:e,layerView:this});const i=new q(this);this._intersectionHandler=i,e.sceneIntersectionHelper.addIntersectionHandler(i),this._elevationProvider=new j({view:e,layerElevationSource:this,intersectionHandler:i}),e.elevationProvider.register(2,this._elevationProvider),this.addHandles([n(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),n(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),o)]),this._suspendedHandle=n(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),o),this.addHandles([n(()=>this._clippingBox,e=>{this._renderer&&(this._renderer.clippingBox=e)},o),n(()=>this.maximumGaussianCount,e=>this._wasm?.setMaximumGaussianSplatCount(Math.min(e,this.data.textureAtlas.maximumSupportedVisibleGaussians)),o)]),this._initializationController=null}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}updateFadingTexture(){this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}get _wasm(){return R(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return x(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new E(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return Y(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy");const{entity3d:t}=e;if(!M(t))throw new Error("entity3D not valid");const i=t.desc.geometry.prims[t.validPrimitiveIndices[0]].atrbs[0],s=t.assets[i.assetId];if(!s)throw new Error("entity3D not valid");const a=s.count;if(0===a)return ee().warnOnce("encountered tile with zero Gaussians"),()=>({memUsageBytes:0,numGaussians:0});let r=null;if("U32"!==s.dataType||!h(s.data))throw new Error("unexpected GaussianSplat Entity3D asset.data format");r=s.data;const n=this.extractHeader(r),l=2.048,o=n.tileOrigin.x*l,d=n.tileOrigin.y*l,u=n.tileOrigin.z*l,c=t.desc,p=c.obb.quaternion,g=new U(c.obb.center,c.obb.halfSize,m(...p)),_=this.view.state.isGlobal,y=_?f(this.view.spatialReference).radius:0,w={handle:e.handle,bufferView:r,totalGaussians:a,packedHeader:n.packedHeader,tileOrigin:{x:o,y:d,z:u},invPosScale:n.invPosScale,obb:g,origin:{x:g.centerX,y:g.centerY,z:g.centerZ},isGlobal:_,ellipsoidRadius:y};let b;this._renderablesBeingCreated.add(e.handle);try{b=await this._frameTask.scheduleGenerator(e=>this._createRenderableTask(w,e),this._createRenderableAbortController.signal)}catch(v){throw this._renderablesBeingCreated.delete(e.handle),v}return this._renderablesBeingCreated.delete(e.handle),()=>b}*_createRenderableTask(e,t){const{handle:i,bufferView:s,totalGaussians:a,packedHeader:r,tileOrigin:n,invPosScale:l,obb:o,origin:h,isGlobal:d,ellipsoidRadius:u}=e,c=n.x,p=n.y,m=n.z,f=h.x,g=h.y,_=h.z,y=new Float32Array(3*a),w=new Uint32Array(a),b=new Uint32Array(a),v=new Array,S=Math.ceil(a/B);let C=1/0,M=-1/0,T=1/0,I=-1/0,x=0,H=-1,P=0,A=0;for(let E=0;E<a;E++){const e=E*O,i=s[e],a=s[e+1],r=s[e+2],n=s[e+3],o=16383&a,h=a>>>14&16383,u=a>>>28&15|(1023&r)<<4,v=n>>>24,S=ae[v],F=(r>>>10&255)+S,R=(r>>>18&255)+S,V=(r>>>26&63|(3&n)<<6)+S,j=F>0?F:0,G=R>0?R:0,U=V>0?V:0,D=j|G<<8|U<<16,B=Math.max(j,G,U),z=o*l+c,L=h*l+p,k=u*l+m;if(y[x]=z-f,y[x+1]=L-g,y[x+2]=k-_,d){const e=z*z+L*L+k*k;T=Math.min(T,e),I=Math.max(I,e)}else C=Math.min(C,k),M=Math.max(M,k);w[E]=i,b[E]=D,B>H&&(H=B),v>P&&(P=v),x+=3,A++,A===Q.createRenderableBatchSize&&(A=0,t.madeProgress()&&(t=yield))}A>0&&t.madeProgress()&&(t=yield),d&&(C=Math.sqrt(T)-u,M=Math.sqrt(I)-u);const F=this._extractGaussianSplatMbsRadiusSquared(H),{fullExtent:R}=this.layer;R?.hasZ&&R.zmax&&R.zmin&&(C=Math.max(C,R.zmin),M=Math.min(M,R.zmax));const V=new E(C,M),j=this.data.textureAtlas,G=this.data.headerTexture;try{for(let e=0;e<S;e+=Q.uploadBatchPageCount){const i=Math.min(S,e+Q.uploadBatchPageCount);for(let t=e;t<i;t++){let e=j.allocatePage();if(null===e&&(this._freeInvisibleTiles(),e=j.allocatePage()),null===e)throw new Error("ran out of gaussian splat memory");v.push(e)}for(let t=e;t<i;){const e=v[t];let n=t+1;for(;n<i&&v[n]===v[n-1]+1;)n++;const l=n-t,o=a-t*B,h=Math.min(o,l*B),d=t*D,u=h*O;this._pageBuffer.set(s.subarray(d,d+u));const c=e*B,p=c%z,m=Math.floor(c/z);j.update(p,m,this._pageBuffer,l),G.update(e,r,l),t=n}t.madeProgress()&&(t=yield)}}catch(L){throw j.freePages(v),L}const U=new W(i,o,v,y,w,b,a,F,P/se,V);return this._tileHandles.set(i,U),this._cacheTileMemory+=U.usedMemory,this._memCache.put(`${U.handle}`,U),{memUsageBytes:U.usedMemory,numGaussians:a}}_extractGaussianSplatMbsRadiusSquared(e){return Math.exp(e/8-20)*ie}freeRenderable(e){this._tileFadeInsAwaitingInitialSort.delete(e),this._tileFadeOutsAwaitingInitialSort.delete(e);const t=this.data?.textureAtlas;let i=!1;const s=this._tileHandles.get(e);if(s){0!==s.lifecycleState?(i=!0,this.fadeHelper.onTileDiscarded(s),this._usedTileMemory-=s.usedMemory,this._intersectionHandler.removeTile(s)):this._cacheTileMemory-=s.usedMemory,t&&s.pageIds.forEach(e=>t.freePage(e)),this.freeObject(s),this._tileHandles.delete(e)}i&&this.updateGaussians()}freeObject(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(e.length,t=>{for(const{obb:i}of e)if(!t(i))break})}setRenderableVisibility(e,t,i){const s=this._currentLyr3dVisibilityChange+1,a=this.fadeHelper.updateFadeDuration();this._fadeDurationPerVisibilityChange.set(s,a);let r=!1;for(let n=0;n<i;n++){const i=this._tileHandles.get(e[n]);if(!i)continue;const l=t[n]?this._prepareTileFadeIn(i,s,a):this._prepareTileFadeOut(i,s);r||=l}r?(this._currentLyr3dVisibilityChange=s,this.updateGaussians()):this._fadeDurationPerVisibilityChange.delete(s)}_prepareTileFadeIn(e,t,i){const s=this._tileFadeOutsAwaitingInitialSort.delete(e.handle);return 2===e.lifecycleState?(this.fadeHelper.fadeTile(e,0,i),!1):this._tileFadeInsAwaitingInitialSort.get(e.handle)!==t?(0===e.lifecycleState&&this._popTileFromCache(e),e.lifecycleState=1,this._tileFadeInsAwaitingInitialSort.set(e.handle,t),!0):s}_prepareTileFadeOut(e,t){const i=this._tileFadeInsAwaitingInitialSort.delete(e.handle);return i&&1===e.lifecycleState&&(this.moveTileToCache(e),e.lifecycleState=0),2!==e.lifecycleState?i:this._tileFadeOutsAwaitingInitialSort.get(e.handle)!==t?(this._tileFadeOutsAwaitingInitialSort.set(e.handle,t),!0):i}_onSortComplete(e,t){const i=this._tmpTilesWithChangedVisibility;i.length=0;const s=this._tmpSortedTileHandles;s.clear();for(let r=0;r<e.length;r++){const t=e[r];s.add(t.handle)}this._triggerFadeIns(t,s,i);const a=this._triggerFadeOuts(t,i);s.clear(),i.length>0&&this.notifyTileObbsChanged(i),a&&this.updateGaussians(),this._cleanupVisibilityChangeFadeDurations(t)}_triggerFadeIns(e,t,i){for(const[s,a]of this._tileFadeInsAwaitingInitialSort){if(a>e||!t.has(s))continue;const r=this._tileHandles.get(s);if(!r){this._tileFadeInsAwaitingInitialSort.delete(s);continue}const n=this._getFadeDurationForPendingVisibilityChange(a),l=0===r.lifecycleState;2!==r.lifecycleState&&(r.lifecycleState=2,l&&this._popTileFromCache(r),i.push(r)),this.fadeHelper.fadeTile(r,0,n),this._tileFadeInsAwaitingInitialSort.delete(s)}}_triggerFadeOuts(e,t){let i=!1;for(const[s,a]of this._tileFadeOutsAwaitingInitialSort){if(a>e)continue;const r=this._tileHandles.get(s);if(r){const e=2===r.lifecycleState,s=this._getFadeDurationForPendingVisibilityChange(a);this.fadeHelper.fadeTile(r,1,s),e&&0===r.lifecycleState&&(t.push(r),i=!0)}this._tileFadeOutsAwaitingInitialSort.delete(s)}return i}_getFadeDurationForPendingVisibilityChange(e){return this._fadeDurationPerVisibilityChange.get(e)??this.fadeHelper.baseFadeDuration}_cleanupVisibilityChangeFadeDurations(e){if(0!==this._fadeDurationPerVisibilityChange.size)for(const t of this._fadeDurationPerVisibilityChange.keys())t<=e&&this._fadeDurationPerVisibilityChange.delete(t)}_popTileFromCache(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(T(e.handle))}moveTileToCache(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(T(e.handle),e)}destroy(){this._initializationController=i(this._initializationController),this._createRenderableAbortController.abort(),V(this),this._suspendedHandle&&(this._suspendedHandle=s(this._suspendedHandle)),this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(this._tileHandles.size,e=>{for(const{obb:t}of this._tileHandles.values())if(!e(t))break}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._shadows=a(this._shadows),this._prepassDepthRenderer=a(this._prepassDepthRenderer),this._renderer=a(this._renderer),this._memCache.destroy(),this.data=a(this.data)}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if(w(this.view.renderSpatialReference)||b(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&v(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(115700===this.layer.esriCrsSpatialReference.vcsWkid)return!1;let e=I(this.layer.esriCrsSpatialReference);if(!e){const t=this.layer.esriCrsSpatialReference;let i="meters";!S(t)&&t.wkid&&-1!==t.wkid&&(i=d(C.units[C[t.wkid]])),i&&(e=new g({heightModel:"gravity-related-height",heightUnit:i}))}const t=this.view.heightModelInfo;return this._useEsriCrs=0===y(e,t,!1),this._useEsriCrs&&(e&&(this._metersPerVCSUnit=u(1,e.heightUnit,"meters")),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}_elevationInfoChanged(e){if(e?.offset)if(this._useEsriCrs){const t=H(e?.unit)/this._metersPerVCSUnit,i=e?.offset??0;this._wasm?.setLayerOffset(this,i*t)}else this._wasm?.setLayerOffset(this,x(e));else this._wasm?.setLayerOffset(this,0)}_slicePlaneEnabledChanged(e){this._renderer&&(this._renderer.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateGaussians(){const e=new Array;for(const t of this._tileHandles.values())0!==t.lifecycleState&&e.push(t);this.data.updateGaussianVisibility(e,this._currentLyr3dVisibilityChange),this.notifyChange("updating")}get maximumGaussianCount(){return this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*this.view.quality}set maximumGaussianCount(e){this._set("maximumGaussianCount",e)}_freeInvisibleTiles(){for(const e of this._tileHandles.values())0!==e.lifecycleState||this._renderablesBeingCreated.has(e.handle)||this._deleteTile(e)}extractHeader(e){const t=e.length-4,i=this.reinterpretU32AsFloat(e[t]),s=this.reinterpretU32AsFloat(e[t+1]),a=this.reinterpretU32AsFloat(e[t+2]),r=1/(1<<(255&e[t+3]));return{packedHeader:e.subarray(t,t+4),tileOrigin:{x:i,y:s,z:a},invPosScale:r}}_deleteTile(e){this._renderablesBeingCreated.has(e.handle)||this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(i=>{0===i.lifecycleState?t++:e++});const i=this.data?.textureAtlasMemory??0,s=this.data?.headerTextureMemory??0,a=this.data?.orderTextureMemory??0,r=this.data?.fadingTextureMemory??0,n=this.data?.sortBufferMemory??0;return new P(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,i,s,a,r,n)}get test(){}};e([c()],re.prototype,"layer",void 0),e([c({readOnly:!0})],re.prototype,"_clippingBox",null),e([c()],re.prototype,"elevationOffset",null),e([c({readOnly:!0})],re.prototype,"visibleAtCurrentScale",null),e([c()],re.prototype,"fullExtentInLocalViewSpatialReference",void 0),e([c()],re.prototype,"maximumGaussianCount",null),re=Q=e([p("esri.views.3d.layers.GaussianSplatLayerView3D")],re);const ne=re;export{ne as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{whenOnce as r,watch as i,sync as s}from"../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../core/accessorSupport/decorators.js";import{computeSrcResolutions as n,projectDatasetExtent as o}from"../../../layers/raster/functions/rasterProjectionHelper.js";import{LayerView3D as c}from"./LayerView3D.js";import{TiledLayerView3D as m}from"./TiledLayerView3D.js";import{RasterTile as h}from"../terrain/RasterTile.js";import{emptyTile as d}from"../terrain/TerrainData.js";import p from"../../layers/ImageryTileLayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";let u=class extends(y(m(c(p)))){constructor(){super(...arguments),this._srcResolutions=[],this.type="imagery-tile-3d",this.ignoresMemoryFactor=!1,this.unloadedMemory=0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=r(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme;this.tileInfo=e.toTileInfo(),this._srcResolutions=n(this.layer.serviceRasterInfo,this.tileInfo),this.addHandles([i(()=>[this.layer.interpolation,this.layer.clippedToNeatline],()=>this._updatingHandles.addPromise(this.doRefresh()),s)])});this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage()}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get imageFormatIsOpaque(){return!1}get hasMixedImageFormats(){return!1}get dataLevelRange(){const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,r=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,r)}get visibleAtCurrentScale(){return this.tilesVisibleAtCurrentScale()}_getFullExtent(){return o(this.layer.serviceRasterInfo,this.view.groundView?.spatialReference??this.view.spatialReference)}async fetchTile(e,r){const i=this.tileInfo,s={tileInfo:i,requestRawData:this._canSymbolizeInWebGL(),signal:r.signal,srcResolution:this._srcResolutions[e[0]],noClip:!1},{layer:a}=this,[l,n,o]=e,c=await a.fetchTile(l,n,o,s);if(c instanceof HTMLImageElement||c instanceof ImageBitmap)throw new t("layerview:unexpected-tile-data","Expected fetchTile to return raster data, but received an image element. This may indicate a problem with the layer's fetchTile implementation.");const m=c?.pixelBlock;if(null==m)return d;const p=new h([l,n,o],m,i.size[0],i.size[1]);return p.transformGrid=c.transformGrid,p.interpolation=a.interpolation,p}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.groundView?.spatialReference?this.view.groundView.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.getRawDisplayBandIds()}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}async doRefresh(){this.suspended||this.emit("data-changed")}isUpdating(){return!1}_canSymbolizeInWebGL(){return!0}get usedMemory(){return 0}};e([a()],u.prototype,"fullExtent",null),e([a({readOnly:!0})],u.prototype,"imageFormatIsOpaque",null),e([a({readOnly:!0})],u.prototype,"hasMixedImageFormats",null),e([a({readOnly:!0})],u.prototype,"dataLevelRange",null),e([a({readOnly:!0})],u.prototype,"visibleAtCurrentScale",null),u=e([l("esri.views.3d.layers.GeospatialPDFLayerView3D")],u);const f=u;export{f as default};