@arcgis/core 5.2.0-next.26 → 5.2.0-next.28

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 (344) hide show
  1. package/WebLinkChart.js +1 -1
  2. package/arcade/Dictionary.js +1 -1
  3. package/arcade/Feature.js +1 -1
  4. package/arcade/Pixel.js +1 -1
  5. package/arcade/deepClone.js +1 -1
  6. package/arcade/featureset/support/FeatureSet.js +1 -1
  7. package/arcade/functions/geometry.js +1 -1
  8. package/arcade/languageUtils.js +1 -1
  9. package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
  10. package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
  11. package/assets/esri/core/workers/RemoteClient.js +1 -1
  12. package/assets/esri/core/workers/chunks/0d3c9112ae07fa4a97d6.js +1 -0
  13. package/assets/esri/core/workers/chunks/{75df436e6e9773bdcfc2.js → 11f47a012dd8881e3d55.js} +18 -18
  14. package/assets/esri/core/workers/chunks/{5ee887fc6e1e0e70e02f.js → 1664434dc7a67c8ce453.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1837f97f720d255a1694.js +1 -0
  16. package/assets/esri/core/workers/chunks/1849f72f23b434e6c78d.js +1 -0
  17. package/assets/esri/core/workers/chunks/1893a4b344aa9b57aa8d.js +1 -0
  18. package/assets/esri/core/workers/chunks/209460f8aae3f9f8c9b8.js +1 -0
  19. package/assets/esri/core/workers/chunks/{316a3d5c7842b445e29e.js → 24704e70d1ce01ca4081.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{8ba3e0462a9bdaae5f40.js → 25fd4d5d3af887536b3b.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{bf9eca7dd107bdb06614.js → 2665337e1b665e7e2b70.js} +1 -1
  22. package/assets/esri/core/workers/chunks/29a7321fd069253c2521.js +1 -0
  23. package/assets/esri/core/workers/chunks/{31c4128b23968575feca.js → 31d92ba9089617aa59ab.js} +1 -1
  24. package/assets/esri/core/workers/chunks/390f2beee8e3f2a302e4.js +1 -0
  25. package/assets/esri/core/workers/chunks/3eee32db0e9a5086b9a8.js +1 -0
  26. package/assets/esri/core/workers/chunks/{511b9c12a7479d39dac0.js → 409bc7d69b95f7a1634c.js} +1 -1
  27. package/assets/esri/core/workers/chunks/47d88e1b003c4519b7b6.js +1 -0
  28. package/assets/esri/core/workers/chunks/4ba4fd8fa31169760fee.js +261 -0
  29. package/assets/esri/core/workers/chunks/{268ee59800e64baa9682.js → 4be0c64bbf2449d57ea5.js} +1 -1
  30. package/assets/esri/core/workers/chunks/4fc32e60e63a9c8429b9.js +1 -0
  31. package/assets/esri/core/workers/chunks/{e8e7cd26c43f231cdea2.js → 5189413a83faf3480e29.js} +1 -1
  32. package/assets/esri/core/workers/chunks/5260f623438bd84f2caa.js +1 -0
  33. package/assets/esri/core/workers/chunks/5363c622a0571134cadd.js +1 -0
  34. package/assets/esri/core/workers/chunks/{88b08b386926ec889573.js → 548842f8ba9224b15ee4.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{30298f84bd414f9dea64.js → 5728d8440aca205e4f53.js} +1 -1
  36. package/assets/esri/core/workers/chunks/5c63b38160c7d063b8af.js +1 -0
  37. package/assets/esri/core/workers/chunks/6183a26837dc087663ad.js +1 -0
  38. package/assets/esri/core/workers/chunks/654a6dc13ff5be88c8b9.js +1 -0
  39. package/assets/esri/core/workers/chunks/{1f03e34520746e432719.js → 67f44cab103d4411dcc5.js} +1 -1
  40. package/assets/esri/core/workers/chunks/697e0ce10d77b90d4fee.js +1 -0
  41. package/assets/esri/core/workers/chunks/{8f93e6fc11a158d4f1ee.js → 7335a762412bc8c15a2f.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{b2b342b06d502fc61ea5.js → 76789f46b2c65d219cf9.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{fae147d03ed723ab234d.js → 78f68f7534716956f5bc.js} +1 -1
  44. package/assets/esri/core/workers/chunks/7b290ac2e8a567ecae4a.js +1 -0
  45. package/assets/esri/core/workers/chunks/7c344c339743295d11d7.js +1 -0
  46. package/assets/esri/core/workers/chunks/7f1babbb7ead78201ab3.js +1 -0
  47. package/assets/esri/core/workers/chunks/{dadf85890961bcc205eb.js → 7fcf4f3b9131c7516524.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{292498a9c7d462d215c6.js → 86e61841df12dbe20a19.js} +1 -1
  49. package/assets/esri/core/workers/chunks/8980767c5b626e4dc3b9.js +1 -0
  50. package/assets/esri/core/workers/chunks/8aba35305368234c94f8.js +1 -0
  51. package/assets/esri/core/workers/chunks/{d670e134348954ce465d.js → 8b452383ba972b638a0c.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{a3ecde3794a7db3cf283.js → 8d90bef1091204fba0f1.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{a18cb809dd56c5537b3b.js → 8dbf9b1d8bb6817b19c1.js} +1 -1
  54. package/assets/esri/core/workers/chunks/8f16a358ed83d2264415.js +1 -0
  55. package/assets/esri/core/workers/chunks/{a454df829a72ab02c860.js → 8fd63cb38036f331a803.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{bbcad2fde838819ffc7b.js → 906f4c0fa8135e6c2f03.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{502464c4eab7667f6566.js → 937e347d130d469518ce.js} +1 -1
  58. package/assets/esri/core/workers/chunks/9508fa53da5f92a0ab70.js +30 -0
  59. package/assets/esri/core/workers/chunks/989937c120bdd676ec1e.js +1 -0
  60. package/assets/esri/core/workers/chunks/9ba705a6ddabca0f77b1.js +1 -0
  61. package/assets/esri/core/workers/chunks/9dcb2cbf89dcb7558432.js +1 -0
  62. package/assets/esri/core/workers/chunks/a2357aae79bfbb91f125.js +1 -0
  63. package/assets/esri/core/workers/chunks/a3ca0649edb646da0918.js +1 -0
  64. package/assets/esri/core/workers/chunks/a9db775210ebeee41738.js +1 -0
  65. package/assets/esri/core/workers/chunks/acbc14395c31f6da509e.js +1 -0
  66. package/assets/esri/core/workers/chunks/{8bd4c43c34aacf3b07da.js → b10f36658aa77bc3a6cf.js} +1 -1
  67. package/assets/esri/core/workers/chunks/b18b6bb85e52b03b85e3.js +680 -0
  68. package/assets/esri/core/workers/chunks/b7458bd3a2f590f32111.js +1 -0
  69. package/assets/esri/core/workers/chunks/b87aca8ad281870ae970.js +1 -0
  70. package/assets/esri/core/workers/chunks/{790462ab5f21491a4f75.js → c193b4a175a544c4fcd6.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{d374cb2d17a2d11c500f.js → c46500cc95a84e2a5f7a.js} +1 -1
  72. package/assets/esri/core/workers/chunks/c8b7ffc5cb3f1493129e.js +1 -0
  73. package/assets/esri/core/workers/chunks/cc46261e01a985df5aab.js +1 -0
  74. package/assets/esri/core/workers/chunks/{d41eed41916ed0422059.js → d07261f3fb67b9a99369.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{2d6d01913096f7cb5ff8.js → d25c37f169577a33db46.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{04070767356c12026369.js → d61294dcc3ba41060d44.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{f3d331da3c61af5c5a2f.js → d8ae5b61b5ae71f4796c.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{7dec8c453fdee1968d12.js → db279d5d9c7deec554bb.js} +1 -1
  79. package/assets/esri/core/workers/chunks/e181d0f5562878b3dc01.js +1 -0
  80. package/assets/esri/core/workers/chunks/{7dbaa089c7472825b80c.js → e38d1ba15babc238b151.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{d07068c44d560e4ce02e.js → e5d2fab228d54b18a8a8.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{a533d066cac26124c5ce.js → e84c13ac59e5381b77e2.js} +1 -1
  83. package/assets/esri/core/workers/chunks/ef5d11581a98fb333ad2.js +1 -0
  84. package/assets/esri/core/workers/chunks/f1d211904d5a1de93cb3.js +1 -0
  85. package/assets/esri/core/workers/chunks/{353c67da4b25c29360db.js → f5125925f83c979edde7.js} +2 -2
  86. package/assets/esri/core/workers/chunks/{928b18e13e015330d44b.js → f68b84df093f2894210b.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{3a35779cae6a11cde51b.js → f74b6952c888d92e479e.js} +1 -1
  88. package/assets/esri/core/workers/chunks/f847a4846c427f671455.js +1 -0
  89. package/assets/esri/core/workers/chunks/{66392ff750c28064040a.js → fe20683f442294eb111b.js} +1 -1
  90. package/assets/esri/images/portal/gaussiansplatlayer16.png +0 -0
  91. package/assets/esri/images/portal/knowledgegraphlayer16.png +0 -0
  92. package/assets/esri/images/portal/propresentation16.png +0 -0
  93. package/assets/esri/images/portal/urbanproject16.png +0 -0
  94. package/assets/esri/images/support/loading-throb.gif +0 -0
  95. package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
  96. package/assets/esri/libs/basisu/basis_encoder.wasm +0 -0
  97. package/assets/esri/libs/dxtEncoder/dxt_encoder.wasm +0 -0
  98. package/assets/esri/themes/base/colors/scss/variables.scss +131 -131
  99. package/assets/esri/themes/base/colors/scss/variables_dark.scss +131 -133
  100. package/assets/esri/themes/base/icons/style.scss +4 -5
  101. package/assets/esri/themes/base/icons/variables.scss +0 -0
  102. package/assets/esri/themes/base/images/files/archive-32.svg +0 -0
  103. package/assets/esri/themes/base/images/files/cad-32.svg +0 -0
  104. package/assets/esri/themes/base/images/files/code-32.svg +0 -0
  105. package/assets/esri/themes/base/images/files/csv-32.svg +0 -0
  106. package/assets/esri/themes/base/images/files/excel-32.svg +0 -0
  107. package/assets/esri/themes/base/images/files/generic-32.svg +0 -0
  108. package/assets/esri/themes/base/images/files/gpx-32.svg +0 -0
  109. package/assets/esri/themes/base/images/files/image-32.svg +0 -0
  110. package/assets/esri/themes/base/images/files/pdf-32.svg +0 -0
  111. package/assets/esri/themes/base/images/files/report-32.svg +0 -0
  112. package/assets/esri/themes/base/images/files/sound-32.svg +0 -0
  113. package/assets/esri/themes/base/images/files/text-32.svg +0 -0
  114. package/assets/esri/themes/base/images/files/video-32.svg +0 -0
  115. package/assets/esri/themes/base/images/files/word-32.svg +0 -0
  116. package/assets/esri/themes/base/images/files/zip-32.svg +0 -0
  117. package/assets/esri/themes/base/images/loading-throb.gif +0 -0
  118. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +24 -0
  119. package/assets/esri/themes/base/widgets/_Bookmarks.scss +0 -0
  120. package/assets/esri/themes/dark/main.css +1 -1
  121. package/assets/esri/themes/light/main.css +1 -1
  122. package/assets/esri/themes/light/view.css +1 -1
  123. package/chunks/OITBlend.glsl.js +1 -1
  124. package/chunks/languageUtils.js +1 -1
  125. package/config.js +1 -1
  126. package/core/Loadable.js +1 -1
  127. package/core/colorUtils.js +1 -1
  128. package/core/has.js +1 -1
  129. package/core/workers/WorkerHandle.js +1 -1
  130. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  131. package/geometry/Mesh.js +1 -1
  132. package/geometry/support/meshUtils/loadExternal.js +1 -1
  133. package/identity/OAuthCredential.js +1 -1
  134. package/kernel.js +1 -1
  135. package/layers/AnnotationFeatureLayer.d.ts +2 -2
  136. package/layers/AnnotationFeatureLayer.js +1 -1
  137. package/layers/LinkChartLayer.js +1 -1
  138. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  139. package/layers/ParquetLayer.js +1 -1
  140. package/layers/PointCloudLayer.js +1 -1
  141. package/layers/SceneLayer.js +1 -1
  142. package/layers/VoxelWasmPerSceneView.js +1 -1
  143. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  144. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  145. package/layers/graphics/editingSupport.js +1 -1
  146. package/layers/graphics/sources/MemorySource.js +1 -1
  147. package/layers/graphics/sources/ParquetSource.js +1 -1
  148. package/layers/mixins/EditBusLayer.js +1 -1
  149. package/layers/mixins/SceneService.js +1 -1
  150. package/layers/support/KMLSublayer.js +1 -1
  151. package/layers/support/ParquetFilesData.js +1 -1
  152. package/layers/support/TitleCreator.js +1 -1
  153. package/layers/video/VideoController.js +1 -1
  154. package/package.json +4 -4
  155. package/rest/knowledgeGraph/ReplicaDefinition.d.ts +62 -6
  156. package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
  157. package/support/ArcadeExpression.js +1 -1
  158. package/support/basemapUtils.js +1 -1
  159. package/support/revision.js +1 -1
  160. package/versionManagement/VersionManagementService.js +1 -1
  161. package/versionManagement/VersionManager.js +1 -1
  162. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  163. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
  164. package/views/2d/engine/ParentChildStage.js +1 -1
  165. package/views/2d/engine/Stage.js +1 -1
  166. package/views/2d/engine/ThrottledCanvas.js +2 -0
  167. package/views/2d/engine/webgl/Profiler.js +1 -1
  168. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  169. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  170. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  171. package/views/2d/layers/LayerView2D.js +1 -1
  172. package/views/2d/layers/MediaLayerView2D.js +1 -1
  173. package/views/2d/layers/TileLayerView2D.js +1 -1
  174. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  175. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  176. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  177. package/views/2d/layers/features/layerAdapters/featureLayerAdapterUtils.js +2 -0
  178. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  179. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  180. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  181. package/views/3d/camera/constraintUtils.js +1 -1
  182. package/views/3d/glTF/internal/Resource.js +1 -1
  183. package/views/3d/glTF/loader.js +1 -1
  184. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  185. package/views/3d/layers/I3SMeshView3D.js +1 -1
  186. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  187. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  188. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  189. package/views/3d/layers/graphics/DrivenProperties.js +2 -0
  190. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  191. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  192. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  193. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  194. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  195. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  196. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  197. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  198. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  199. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  200. package/views/3d/state/GoToOperation.js +1 -1
  201. package/views/3d/state/SurfaceCollisionConstraint.js +1 -1
  202. package/views/3d/state/ViewState.js +1 -1
  203. package/views/3d/state/ViewStateManager.js +1 -1
  204. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  205. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  206. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  207. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  208. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  209. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  210. package/views/3d/terrain/OverlayRenderer.js +1 -1
  211. package/views/3d/terrain/TerrainRenderer.js +1 -1
  212. package/views/3d/terrain/TerrainSurface.js +1 -1
  213. package/views/3d/webgl/ManagedFBO.js +1 -1
  214. package/views/3d/webgl/RenderCamera.js +1 -1
  215. package/views/3d/webgl/RenderNode.js +1 -1
  216. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  217. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  218. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  219. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  220. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  221. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  222. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  223. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  224. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  225. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  226. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  227. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  228. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  229. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  230. package/views/3d/webgl-engine/effects/transparency/OITBlendTechniqueConfiguration.js +1 -1
  231. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  232. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  233. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  234. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  235. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  236. package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
  237. package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
  238. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  239. package/views/3d/webgl-engine/lib/PolygonIntersectionResults.js +2 -0
  240. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  241. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  242. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  243. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  244. package/views/3d/webgl-engine/lib/screenPolygonIntersectionUtils.js +2 -0
  245. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  246. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  247. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  248. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  249. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  250. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  251. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  252. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  253. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  254. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  255. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  256. package/views/3d/webgl-engine/materials/renderers/IndexLayout.js +1 -1
  257. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  258. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  259. package/views/3d/webgl.js +1 -1
  260. package/views/VideoView.js +1 -1
  261. package/views/View2D.js +1 -1
  262. package/views/Viewport2DBaseMixin.js +1 -1
  263. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  264. package/views/draw/support/editingSessionUtils.js +1 -1
  265. package/views/popupAdapter.js +1 -1
  266. package/views/support/Scheduler.js +1 -1
  267. package/views/webgl/BufferObject.js +1 -1
  268. package/widgets/BasemapGallery/support/PortalBasemapsSource.js +1 -1
  269. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  270. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  271. package/widgets/BatchAttributeForm/css.js +1 -1
  272. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  273. package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
  274. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  275. package/widgets/BatchAttributeForm.js +1 -1
  276. package/widgets/Directions/DirectionsViewModel.js +1 -1
  277. package/widgets/Directions.js +1 -1
  278. package/widgets/Editor/EditorViewModel.d.ts +1 -1
  279. package/widgets/Editor.d.ts +11 -1
  280. package/widgets/Editor.js +1 -1
  281. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  282. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  283. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  284. package/widgets/FeatureTable.js +1 -1
  285. package/widgets/Features/FeaturesViewModel.js +1 -1
  286. package/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.js +1 -1
  287. package/widgets/Locate/LocateViewModel.js +1 -1
  288. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  289. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  290. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  291. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  292. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  293. package/widgets/OrientedImageryViewer/support/MediaPrefetcher.js +1 -1
  294. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  295. package/widgets/Print/PrintViewModel.js +1 -1
  296. package/widgets/Print.js +1 -1
  297. package/widgets/TableList/ListItem.js +1 -1
  298. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  299. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  300. package/widgets/Widget.js +1 -1
  301. package/widgets/support/geolocationUtils.js +1 -1
  302. package/widgets/support/tests.js +1 -1
  303. package/assets/esri/core/workers/chunks/073ee52705ea326fecfb.js +0 -1
  304. package/assets/esri/core/workers/chunks/0e81b6aa64d5491870b2.js +0 -1
  305. package/assets/esri/core/workers/chunks/10112bf4b385f1955a3d.js +0 -1
  306. package/assets/esri/core/workers/chunks/126a8c26618425790804.js +0 -1
  307. package/assets/esri/core/workers/chunks/15fd30908d5db7f7136e.js +0 -261
  308. package/assets/esri/core/workers/chunks/1b5001bdfeecf78c33ce.js +0 -1
  309. package/assets/esri/core/workers/chunks/1cb1f125dccbf8c8cac9.js +0 -1
  310. package/assets/esri/core/workers/chunks/1d2609ce6220b5af5526.js +0 -1
  311. package/assets/esri/core/workers/chunks/2e7b83c8ba78cb06d611.js +0 -1
  312. package/assets/esri/core/workers/chunks/2ed81f1e490cb7e73405.js +0 -1
  313. package/assets/esri/core/workers/chunks/32f26757e36704923286.js +0 -1
  314. package/assets/esri/core/workers/chunks/33e86dd1a54e447fa0e3.js +0 -1
  315. package/assets/esri/core/workers/chunks/3529afab0c2444275d91.js +0 -1
  316. package/assets/esri/core/workers/chunks/36b904912cea1744d1c6.js +0 -1
  317. package/assets/esri/core/workers/chunks/3b4fc67f6cb7393fbd97.js +0 -1
  318. package/assets/esri/core/workers/chunks/3df5394b17e9659ecb8f.js +0 -1
  319. package/assets/esri/core/workers/chunks/4adfe7f8a8efe2cd8e80.js +0 -1
  320. package/assets/esri/core/workers/chunks/5b654e0dc901a7f06a9f.js +0 -1
  321. package/assets/esri/core/workers/chunks/6849282c4a5cd733779d.js +0 -1
  322. package/assets/esri/core/workers/chunks/6adc17e6e287a365ad8d.js +0 -1
  323. package/assets/esri/core/workers/chunks/7e23de8d9b2d938808f6.js +0 -1
  324. package/assets/esri/core/workers/chunks/831455798b177678720c.js +0 -1
  325. package/assets/esri/core/workers/chunks/856cf872d29eeaf11a71.js +0 -1
  326. package/assets/esri/core/workers/chunks/8ca88cfc0b9f84dc5832.js +0 -1
  327. package/assets/esri/core/workers/chunks/8f25d91ea7b99597124e.js +0 -1
  328. package/assets/esri/core/workers/chunks/93b40245378ced43ca08.js +0 -1
  329. package/assets/esri/core/workers/chunks/9434c76ad39c936dba90.js +0 -1
  330. package/assets/esri/core/workers/chunks/98dfe31e8ed9b522eaff.js +0 -1
  331. package/assets/esri/core/workers/chunks/a40ede4d3375184f21fe.js +0 -1
  332. package/assets/esri/core/workers/chunks/a8310f55de4749f973d0.js +0 -1
  333. package/assets/esri/core/workers/chunks/af96cbc4fb7bef726635.js +0 -1
  334. package/assets/esri/core/workers/chunks/affc972757798b6db002.js +0 -1
  335. package/assets/esri/core/workers/chunks/b419fd36337e76e2d4a3.js +0 -680
  336. package/assets/esri/core/workers/chunks/b91a15522692781560b4.js +0 -30
  337. package/assets/esri/core/workers/chunks/c9ce408675dae6a0edd1.js +0 -1
  338. package/assets/esri/core/workers/chunks/e73bb7c8de7412d9975c.js +0 -1
  339. package/assets/esri/core/workers/chunks/f23351a04643c464be84.js +0 -1
  340. package/assets/esri/core/workers/chunks/f2a268c69f2a5566381b.js +0 -1
  341. package/assets/esri/core/workers/chunks/f93facf47aba9b128fcc.js +0 -1
  342. package/views/2d/engine/ManagedCanvas.js +0 -2
  343. package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +0 -2
  344. /package/assets/esri/core/workers/chunks/{353c67da4b25c29360db.js.LICENSE.txt → f5125925f83c979edde7.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../core/has.js";import"../../../../core/Logger.js";import{trackAccess as n}from"../../../../core/accessorSupport/tracking.js";import{SimpleObservable as t}from"../../../../core/accessorSupport/tracking/SimpleObservable.js";import{e}from"../../../../chunks/earcut.js";import{loadLibtessF64 as o,isLibtessF64Loaded as i,triangulateIndexedF64 as s}from"../../../../geometry/libtess.js";import{isClockwise as r}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as u,doubleSubArray as l,concatDoubleArrays as c}from"../../../../geometry/support/DoubleArray.js";import{compactMeshIndices as g,newIndexArray as h,concatIndexArrays as f}from"../../../../geometry/support/Indices.js";import{leastSignificantAxis as p}from"../../../../geometry/support/polygonUtils.js";const d=1e-5,a={method:"auto",projectionAxis:void 0,outlines:void 0};function m(n,t){const{hasZ:e,ccwRingsAsHoles:o,spatialReference:i}=t,s=t.axis??x(n,e,i),r=n.length,c=[],g=[],h=[],f=[],p=n.reduce((n,t)=>n+t.length,0);let d=0;const a=u(3*p);let m=0;const L=o&&n[0]&&y(n[0],e,s);for(let u=r-1;u>=0;u--){const t=n[u],i=S(t,e);if(i<3){i>1&&f.push(t);continue}const r=!!o&&y(t,e,s);if(L?!r:r)c[d++]=t;else{let n=t.length;for(let t=0;t<d;++t)n+=c[t].length;const o={index:m,pathLengths:new Array(d+1),count:n,holeIndices:new Array(d)};o.pathLengths[0]=t.length,t.length>0&&h.push({index:m,count:t.length}),m=k(t,a,m,t.length,e,L);for(let t=0;t<d;++t){const n=c[t];o.holeIndices[t]=m,o.pathLengths[t+1]=n.length,n.length>0&&h.push({index:m,count:n.length}),m=k(n,a,m,n.length,e,L)}d=0,o.count>0&&g.push(o)}}const j=m;for(const u of f)h.push({index:m,count:u.length}),m=k(u,a,m,u.length,e,L);return{positions:3*m===a.length?a:l(a,0,3*m),polygonVertexCount:j,polygons:g,outlines:h}}function x(n,t,e){if(!t)return 2;const o=n.map(n=>{const o=S(n,t);return o<3?2:p(n,o,e)}),i=o[0];return o.every(n=>n===i)?i:2}function y(n,t,e){if(!t)return!r(n);if(n.length<3)return!1;switch(e){case 0:return!r(n,1,2);case 1:return!r(n,0,2);case 2:return!r(n,0,1)}}const L=new t;function j(t,e){const o=v(t,e);if(o.succeeded)return o;return"libtess-not-loaded"===o.message?(n(L),I()):o}async function I(){try{await o(),L.notify()}catch(n){throw n}}function v(n,t){const e={method:t?.method??a.method,projectionAxis:t?.projectionAxis??a.projectionAxis,outlines:t?.outlines??a.outlines},{projectionAxis:o}=e,i=null!=o&&2!==o;i&&b(n.positions,o,2);const s=R(n,e);if(i){const t=s.succeeded?s.positions:null;null!=t&&t!==n.positions&&b(t,2,o),b(n.positions,2,o)}return s}function R(n,t){if("libtess"===t.method)return A(n,t);const o=Array();let i=0;for(const u of n.polygons){const s=O(n.positions,u),r=(u.holeIndices??[]).map(n=>n-u.index),l=r.length>0?r:null,c=e(s,l,3),g=e.deviation(s,r,3,c);if("auto"===t.method&&g>d)return A(n,t);for(let n=0;n<c.length;n++)o.push(c[n]+u.index);i=Math.max(i,g)}const{outlineIndexBuffer:s,outlineRingLengths:r}=null!=t.outlines?w(t.outlines,n.positions):{outlineIndexBuffer:void 0,outlineRingLengths:void 0};return{succeeded:!0,positions:n.positions,indices:g(o),outlineIndexBuffer:s,outlineRingLengths:r,vertexCount:n.positions.length/3,method:"earcut",deviation:i}}function A(n,t){if(!i())return V("libtess-not-loaded");const e=null!=t.outlines,{positions:o,mergedPathLengths:r}=U(n),{vertices:u,indices:l,outlineIndices:c,outlineRingLengths:g}=s(o,r,3,e);if(u.length%3!=0)return V("positions-not-multiple-of-3");const{positions:h,outlineIndexBuffer:f,mergedOutlineRingLengths:p}=e?B(n,t.outlines,u,c,g):{positions:u,outlineIndexBuffer:void 0,mergedOutlineRingLengths:void 0};return{succeeded:!0,positions:h,indices:l,outlineIndexBuffer:f,outlineRingLengths:p,vertexCount:h.length/3,method:"libtess"}}function B(n,t,e,o,i){const s=n.polygonVertexCount,r=t?.filter(n=>n.index>=s)??[];if(0===r.length)return{positions:e,outlineIndexBuffer:o,mergedOutlineRingLengths:i};const u=3*s,g=l(n.positions,u,n.positions.length-u),h=c(e,g),p=e.length/3,d=r.map(n=>({index:p+n.index-s,count:n.count})),{outlineIndexBuffer:a,outlineRingLengths:m}=w(d,h);return{positions:h,outlineIndexBuffer:f(o,a,h.length/3),mergedOutlineRingLengths:f(i,m,i.length+m.length)}}function b(n,t,e){for(let o=0;o<n.length;o+=3){const i=n[o+t];n[o+t]=n[o+e],n[o+e]=i}}function w(n,t){const e=h(n.length);let o=0;for(let r=0;r<n.length;r++){const i=n[r],s=i.count;if(s<=0){e[r]=0;continue}const u=3*i.index,l=3*(i.index+s-1),c=s>1&&t[u]===t[l]&&t[u+1]===t[l+1]&&t[u+2]===t[l+2]?s-1:s,g=c>0?c+1:0;e[r]=g,o+=g}const i=h(o,t.length/3);let s=0;for(let r=0;r<n.length;r++){const t=e[r];if(0===t)continue;const o=n[r].index,u=t-1;for(let n=0;n<u;n++)i[s++]=o+n;i[s++]=o}return{outlineIndexBuffer:i,outlineRingLengths:e}}function C(n){const t=n.reduce((n,t)=>n+t.pathLengths.length,0),e=new Array(t);let o=0;for(let i=0;i<n.length;i++){const t=n[i].pathLengths;for(let n=0;n<t.length;n++)e[o++]=t[n]}return e}function O(n,{index:t,count:e}){return l(n,3*t,3*e)}function k(n,t,e,o,i,s){let r=s?n.length-1:0;const u=s?-1:1;e*=3;for(let l=0;l<o;++l){const o=n[r];t[e++]=o[0],t[e++]=o[1],t[e++]=i&&null!=o[2]?o[2]:0,r+=u}return e/3}function P(n,t){const e=n.length;if(e<2)return!1;const o=n[0],i=n[e-1];return o[0]===i[0]&&o[1]===i[1]&&(!t||o[2]===i[2])}function S(n,t){return P(n,t)?n.length-1:n.length}function V(n){return{succeeded:!1,message:n}}function U(n){const t=C(n.polygons),e=3*n.polygonVertexCount;return e===n.positions.length?{positions:n.positions,mergedPathLengths:t}:{positions:l(n.positions,0,e),mergedPathLengths:t}}export{x as axisFromRings,y as isCounterClockwise,I as load,m as ringsToOutlinedTessellationInfo,v as tessellate,j as tessellateOrLoad};
2
+ import"../../../../core/has.js";import"../../../../core/Logger.js";import{trackAccess as n}from"../../../../core/accessorSupport/tracking.js";import{SimpleObservable as t}from"../../../../core/accessorSupport/tracking/SimpleObservable.js";import{e}from"../../../../chunks/earcut.js";import{loadLibtessF64 as o,isLibtessF64Loaded as i,triangulateIndexedF64 as s}from"../../../../geometry/libtess.js";import{isClockwise as r}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as u,doubleSubArray as l,concatDoubleArrays as c}from"../../../../geometry/support/DoubleArray.js";import{compactMeshIndices as g,newIndexArray as h,concatIndexArrays as f}from"../../../../geometry/support/Indices.js";import{leastSignificantAxis as p}from"../../../../geometry/support/polygonUtils.js";const d=1e-5,a={method:"auto",projectionAxis:void 0,outlines:void 0,owner:void 0};function m(n,t){const{hasZ:e,ccwRingsAsHoles:o,spatialReference:i}=t,s=t.axis??x(n,e,i),r=n.length,c=[],g=[],h=[],f=[],p=n.reduce((n,t)=>n+t.length,0);let d=0;const a=u(3*p);let m=0;const L=o&&n[0]&&y(n[0],e,s);for(let u=r-1;u>=0;u--){const t=n[u],i=H(t,e);if(i<3){i>1&&f.push(t);continue}const r=!!o&&y(t,e,s);if(L?!r:r)c[d++]=t;else{let n=t.length;for(let t=0;t<d;++t)n+=c[t].length;const o={index:m,pathLengths:new Array(d+1),count:n,holeIndices:new Array(d)};o.pathLengths[0]=t.length,t.length>0&&h.push({index:m,count:t.length}),m=U(t,a,m,t.length,e,L);for(let t=0;t<d;++t){const n=c[t];o.holeIndices[t]=m,o.pathLengths[t+1]=n.length,n.length>0&&h.push({index:m,count:n.length}),m=U(n,a,m,n.length,e,L)}d=0,o.count>0&&g.push(o)}}const w=m;for(const u of f)h.push({index:m,count:u.length}),m=U(u,a,m,u.length,e,L);return{positions:3*m===a.length?a:l(a,0,3*m),polygonVertexCount:w,polygons:g,outlines:h}}function x(n,t,e){if(!t)return 2;const o=n.map(n=>{const o=H(n,t);return o<3?2:p(n,o,e)}),i=o[0];return o.every(n=>n===i)?i:2}function y(n,t,e){if(!t)return!r(n);if(n.length<3)return!1;switch(e){case 0:return!r(n,1,2);case 1:return!r(n,0,2);case 2:return!r(n,0,1)}}const L=new t;function w(t,e){const o=v(t,e);if(o.succeeded)return o;return"libtess-not-loaded"===o.message?(n(L),j()):o}async function j(){try{await o(),L.notify()}catch(n){throw n}}function v(n,t){const e={method:t?.method??a.method,projectionAxis:t?.projectionAxis??a.projectionAxis,outlines:t?.outlines??a.outlines,owner:t?.owner??a.owner},{projectionAxis:o}=e,i=null!=o&&2!==o;i&&k(n.positions,o,2);const s=I(n,e);if(i){const t=s.succeeded?s.positions:null;null!=t&&t!==n.positions&&k(t,2,o),k(n.positions,2,o)}return s}function I(n,t){if("libtess"===t.method)return C(n,t);const o=b(n,t),i=Array();let s=0;for(const l of n.polygons){const r=P(n.positions,l),u=(l.holeIndices??[]).map(n=>n-l.index),c=u.length>0?u:null,g=e(r,c,3),h=e.deviation(r,u,3,g);if(o&&h>d)return C(n,t);for(let n=0;n<g.length;n++)i.push(g[n]+l.index);s=Math.max(s,h)}const{outlineIndexBuffer:r,outlineRingLengths:u}=null!=t.outlines?S(t.outlines,n.positions):{outlineIndexBuffer:void 0,outlineRingLengths:void 0};return{succeeded:!0,positions:n.positions,indices:g(i),outlineIndexBuffer:r,outlineRingLengths:u,vertexCount:n.positions.length/3,method:"earcut",deviation:s}}const R=250;let A=new WeakSet;const B=1e4;function b(n,t){const e=null!=t.owner&&A.has(t.owner),o=B;return"auto"===t.method&&!(e&&n.polygonVertexCount>=o)}function C(n,t){if(!i())return M("libtess-not-loaded");const e=null!=t.outlines,{positions:o,mergedPathLengths:r}=W(n),u=performance.now(),{vertices:l,indices:c,outlineIndices:g,outlineRingLengths:h}=s(o,r,3,e),f=performance.now()-u,p=R;if(null!=t.owner&&f>p&&A.add(t.owner),l.length%3!=0)return M("positions-not-multiple-of-3");const{positions:d,outlineIndexBuffer:a,mergedOutlineRingLengths:m}=e?O(n,t.outlines,l,g,h):{positions:l,outlineIndexBuffer:void 0,mergedOutlineRingLengths:void 0};return{succeeded:!0,positions:d,indices:c,outlineIndexBuffer:a,outlineRingLengths:m,vertexCount:d.length/3,method:"libtess"}}function O(n,t,e,o,i){const s=n.polygonVertexCount,r=t?.filter(n=>n.index>=s)??[];if(0===r.length)return{positions:e,outlineIndexBuffer:o,mergedOutlineRingLengths:i};const u=3*s,g=l(n.positions,u,n.positions.length-u),h=c(e,g),p=e.length/3,d=r.map(n=>({index:p+n.index-s,count:n.count})),{outlineIndexBuffer:a,outlineRingLengths:m}=S(d,h);return{positions:h,outlineIndexBuffer:f(o,a,h.length/3),mergedOutlineRingLengths:f(i,m,i.length+m.length)}}function k(n,t,e){for(let o=0;o<n.length;o+=3){const i=n[o+t];n[o+t]=n[o+e],n[o+e]=i}}function S(n,t){const e=h(n.length);let o=0;for(let r=0;r<n.length;r++){const i=n[r],s=i.count;if(s<=0){e[r]=0;continue}const u=3*i.index,l=3*(i.index+s-1),c=s>1&&t[u]===t[l]&&t[u+1]===t[l+1]&&t[u+2]===t[l+2]?s-1:s,g=c>0?c+1:0;e[r]=g,o+=g}const i=h(o,t.length/3);let s=0;for(let r=0;r<n.length;r++){const t=e[r];if(0===t)continue;const o=n[r].index,u=t-1;for(let n=0;n<u;n++)i[s++]=o+n;i[s++]=o}return{outlineIndexBuffer:i,outlineRingLengths:e}}function V(n){const t=n.reduce((n,t)=>n+t.pathLengths.length,0),e=new Array(t);let o=0;for(let i=0;i<n.length;i++){const t=n[i].pathLengths;for(let n=0;n<t.length;n++)e[o++]=t[n]}return e}function P(n,{index:t,count:e}){return l(n,3*t,3*e)}function U(n,t,e,o,i,s){let r=s?n.length-1:0;const u=s?-1:1;e*=3;for(let l=0;l<o;++l){const o=n[r];t[e++]=o[0],t[e++]=o[1],t[e++]=i&&null!=o[2]?o[2]:0,r+=u}return e/3}function D(n,t){const e=n.length;if(e<2)return!1;const o=n[0],i=n[e-1];return o[0]===i[0]&&o[1]===i[1]&&(!t||o[2]===i[2])}function H(n,t){return D(n,t)?n.length-1:n.length}function M(n){return{succeeded:!1,message:n}}function W(n){const t=V(n.polygons),e=3*n.polygonVertexCount;return e===n.positions.length?{positions:n.positions,mergedPathLengths:t}:{positions:l(n.positions,0,e),mergedPathLengths:t}}const Z=void 0;export{x as axisFromRings,y as isCounterClockwise,j as load,m as ringsToOutlinedTessellationInfo,v as tessellate,w as tessellateOrLoad,Z as tessellationTestHooks};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{I3sTarget as e}from"./Intersector.js";import{IntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{MeshIntersectionOptions as n}from"../../webgl-engine/lib/RayIntersections.js";import{getVerticalOffsetI3S as i}from"../../webgl-engine/lib/verticalOffsetUtils.js";class r{constructor(e){this.type=2,this._needVerticalOffset=!1,this.layerViewUid=e.layerViewUid,this.sublayerId=e.sublayerId,this._collection=e.collection,this._traverseNodeHierarchy=e.traverseNodeHierarchy,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isGround=e.isGround}updateElevationAlignState(e,t){this._needVerticalOffset=e&&1===t}intersect(r,l,o,c,a,d){const u=2===r.options.store,b=r.ray.direction;let f=e=>e,h=e=>e;const y=i(r.verticalOffset??(this._needVerticalOffset?0:null));null!=r.verticalOffset&&null!=y&&(f=e=>y.applyToMbs(e),h=e=>y.applyToObb(e));const{results:m,tolerance:p}=r,R=new n(p,d,r.options.normalRequired),g=(n,i)=>{if(0===n.childrenLoaded)return!1;const a=n.serviceObbInRenderSR?.isValid?n.serviceObbInRenderSR:null;if(a&&!h(a).intersectRay(o,b,p))return!1;const{serviceMbsInRenderSRElevationAdjusted:d}=n;return!i||!a&&d.isValid&&!s(f(d),o,b,p)||null!=n.geometryObbInRenderSR&&!h(n.geometryObbInRenderSR).intersectRay(o,b,p)||this._collection.intersect(i,o,c,y,R,(i,s,a,d)=>{if(s<0||null!=l&&!l(o,c,s))return;const b=t=>{const r=new e(this.layerViewUid,this.sublayerId,n.index,i,d);t.set(this.type,r,s,a)};if(this.isGround&&(null==m.ground.distance||s<m.ground.distance)&&b(m.ground),!r.options.isFiltered&&((null==m.min.distance||s<m.min.distance)&&b(m.min),(null==m.max.distance||s>m.max.distance)&&b(m.max),u)){const e=new t(r.ray);b(e),r.results.all.push(e)}}),!0};this._traverseNodeHierarchy(g)}}function s(e,t,n,i=0){const r=e.radius+i,s=t[0]-e.center[0],l=t[1]-e.center[1],o=t[2]-e.center[2],[c,a,d]=n,u=c*s+a*l+d*o;return u*u-(c*c+a*a+d*d)*(s*s+l*l+o*o-r*r)>=0}export{r as I3SIntersectionHandler};
2
+ import{I3sTarget as e}from"./Intersector.js";import{IntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{MeshIntersectionOptions as n}from"../../webgl-engine/lib/RayIntersections.js";import{getVerticalOffsetI3S as i}from"../../webgl-engine/lib/verticalOffsetUtils.js";class r{constructor(e){this.type=2,this._needVerticalOffset=!1,this.layerViewUid=e.layerViewUid,this.sublayerId=e.sublayerId,this._collection=e.collection,this._traverseNodeHierarchy=e.traverseNodeHierarchy,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isGround=e.isGround}updateElevationAlignState(e,t){this._needVerticalOffset=e&&1===t}intersectRay(r,l,o,a,c,d){const u=2===r.options.store,b=r.ray.direction;let y=e=>e,f=e=>e;const h=i(r.verticalOffset??(this._needVerticalOffset?0:null));null!=r.verticalOffset&&null!=h&&(y=e=>h.applyToMbs(e),f=e=>h.applyToObb(e));const{results:m,tolerance:R}=r,p=new n(R,d,r.options.normalRequired),g=(n,i)=>{if(0===n.childrenLoaded)return!1;const c=n.serviceObbInRenderSR?.isValid?n.serviceObbInRenderSR:null;if(c&&!f(c).intersectRay(o,b,R))return!1;const{serviceMbsInRenderSRElevationAdjusted:d}=n;return!i||!c&&d.isValid&&!s(y(d),o,b,R)||null!=n.geometryObbInRenderSR&&!f(n.geometryObbInRenderSR).intersectRay(o,b,R)||this._collection.intersectRay(i,o,a,h,p,(i,s,c,d)=>{if(s<0||null!=l&&!l(o,a,s))return;const b=t=>{const r=new e(this.layerViewUid,this.sublayerId,n.index,i,d);t.set(this.type,r,s,c)};if(this.isGround&&(null==m.ground.distance||s<m.ground.distance)&&b(m.ground),!r.options.isFiltered&&((null==m.min.distance||s<m.min.distance)&&b(m.min),(null==m.max.distance||s>m.max.distance)&&b(m.max),u)){const e=new t(r.ray);b(e),r.results.all.push(e)}}),!0};this._traverseNodeHierarchy(g)}}function s(e,t,n,i=0){const r=e.radius+i,s=t[0]-e.center[0],l=t[1]-e.center[1],o=t[2]-e.center[2],[a,c,d]=n,u=a*s+c*l+d*o;return u*u-(a*a+c*c+d*d)*(s*s+l*l+o*o-r*r)>=0}export{r as I3SIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import r from"../../../../core/Logger.js";import{property as i,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{fromQuat as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{set as l,transformMat4 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBoundingSphere as p}from"../../../../geometry/projection/projectBoundingSphere.js";import{empty as h,expand as u}from"../../../../geometry/support/aaBoundingRect.js";import{Sphere as f}from"../../../../geometry/support/sphere.js";import{ElevationRange as v}from"../../support/ElevationRange.js";import{ElevationUpdateEvent as d}from"../../terrain/ElevationUpdateEvent.js";import{Intersector as g}from"../../webgl-engine/lib/Intersector.js";let E=class extends t{constructor(e){super(e),this._tmpEvent=new d,this._renderCoordsHelper=e.view.renderCoordsHelper,this._renderSR=this._renderCoordsHelper.spatialReference,this._layerElevationSource=e.layerElevationSource}initialize(){this._intersector=new g(this.view.state.viewingMode),this._intersector.options.store=0,this._intersector.options.normalRequired=!1,this._tmpEvent.context=this.intersectionHandler.isGround?"ground":"scene"}get spatialReference(){return this.view?.elevationProvider?.spatialReference}getElevation(e,t,i,n){const o=this._renderCoordsHelper,s=l(R,e,t,i);if(!o.toRenderCoords(s,n,s))return r.getLogger(this).error("could not project point to compute elevation"),null;const{layerElevationSource:a,_intersector:c,intersectionHandler:m}=this,p=a.fullExtent,h=null!=p&&Number.isFinite(p.xmin)&&Number.isFinite(p.xmax)&&Number.isFinite(p.ymin)&&Number.isFinite(p.ymax)&&Number.isFinite(p.zmin)&&Number.isFinite(p.zmax)?new v(p.zmin,p.zmax):a.elevationRange;if(null==h)return null;const u=a.elevationOffset,f=h.minElevation+u,d=h.maxElevation+u,g=o.setAltitude(y,d,s),E=o.setAltitude(j,f,s);return c.reset(g,E,this.view.state.camera),m.intersect(c,null,g,E,null,!0),c.results.min.getIntersectionPoint(s)?o.getAltitude(s):null}getElevations(e,t,r){const{groundSpatialReference:i}=this.view;for(let n=0;n<t;++n){const t=3*n,o=e[t],s=e[t+1];r(n,this.getElevation(o,s,0,i))}}getSphereElevationRange(e,t){return p(e,t,_,this._renderSR),this._layerElevationSource.getElevationRange(_)}getRootElevationRange(){const e=this.layerElevationSource.fullExtent;return e?.hasZ?new v(e.zmin,e.zmax):null}notifyObjectsChanged(e){this.spatialReference&&(this._computeLayerExtent(t=>{for(const r of e)t(r)},this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}notifyObjectsChangedFunctional(e){this.spatialReference&&(this._computeLayerExtent(e,this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}notifyObjectChanged(e){this.spatialReference&&(this._computeObjectExtent(e,this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}_computeObjectExtent(e,t){h(t),this._expandExtent(e,t)}_computeLayerExtent(e,t){h(t),e(e=>{this._expandExtent(e,t)})}_expandExtent(e,t){const r=this.spatialReference;if(null==r)return;if(null==e)return;o(x,e.getQuaternion(b)),x[12]=e.centerX,x[13]=e.centerY,x[14]=e.centerZ;const{halfSizeX:i,halfSizeY:n,halfSizeZ:s}=e;for(let o=0;o<8;++o)R[0]=1&o?i:-i,R[1]=2&o?n:-n,R[2]=4&o?s:-s,c(R,R,x),this._renderCoordsHelper.fromRenderCoords(R,R,r),u(t,R,t);for(let o=0;o<2;++o)R[0]=0,R[1]=0,R[2]=0===o?s:-s,c(R,R,x),this._renderCoordsHelper.fromRenderCoords(R,R,r),u(t,R,t)}};e([i({constructOnly:!0})],E.prototype,"layerElevationSource",void 0),e([i({constructOnly:!0})],E.prototype,"intersectionHandler",void 0),e([i({constructOnly:!0})],E.prototype,"view",void 0),e([i()],E.prototype,"spatialReference",null),E=e([n("esri.views.3d.layers.i3s.LayerElevationProvider")],E);const x=s(),_=new f,R=m(),y=m(),j=m(),b=a();export{E as LayerElevationProvider};
2
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import r from"../../../../core/Logger.js";import{property as i,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{fromQuat as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{set as l,transformMat4 as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBoundingSphere as p}from"../../../../geometry/projection/projectBoundingSphere.js";import{empty as h,expand as u}from"../../../../geometry/support/aaBoundingRect.js";import{Sphere as f}from"../../../../geometry/support/sphere.js";import{ElevationRange as v}from"../../support/ElevationRange.js";import{ElevationUpdateEvent as d}from"../../terrain/ElevationUpdateEvent.js";import{Intersector as g}from"../../webgl-engine/lib/Intersector.js";let E=class extends t{constructor(e){super(e),this._tmpEvent=new d,this._renderCoordsHelper=e.view.renderCoordsHelper,this._renderSR=this._renderCoordsHelper.spatialReference,this._layerElevationSource=e.layerElevationSource}initialize(){this._intersector=new g(this.view.state.viewingMode),this._intersector.options.store=0,this._intersector.options.normalRequired=!1,this._tmpEvent.context=this.intersectionHandler.isGround?"ground":"scene"}get spatialReference(){return this.view?.elevationProvider?.spatialReference}getElevation(e,t,i,n){const o=this._renderCoordsHelper,s=l(R,e,t,i);if(!o.toRenderCoords(s,n,s))return r.getLogger(this).error("could not project point to compute elevation"),null;const{layerElevationSource:a,_intersector:c,intersectionHandler:m}=this,p=a.fullExtent,h=null!=p&&Number.isFinite(p.xmin)&&Number.isFinite(p.xmax)&&Number.isFinite(p.ymin)&&Number.isFinite(p.ymax)&&Number.isFinite(p.zmin)&&Number.isFinite(p.zmax)?new v(p.zmin,p.zmax):a.elevationRange;if(null==h)return null;const u=a.elevationOffset,f=h.minElevation+u,d=h.maxElevation+u,g=o.setAltitude(y,d,s),E=o.setAltitude(j,f,s);return c.reset(g,E,this.view.state.camera),m.intersectRay(c,null,g,E,null,!0),c.results.min.getIntersectionPoint(s)?o.getAltitude(s):null}getElevations(e,t,r){const{groundSpatialReference:i}=this.view;for(let n=0;n<t;++n){const t=3*n,o=e[t],s=e[t+1];r(n,this.getElevation(o,s,0,i))}}getSphereElevationRange(e,t){return p(e,t,_,this._renderSR),this._layerElevationSource.getElevationRange(_)}getRootElevationRange(){const e=this.layerElevationSource.fullExtent;return e?.hasZ?new v(e.zmin,e.zmax):null}notifyObjectsChanged(e){this.spatialReference&&(this._computeLayerExtent(t=>{for(const r of e)t(r)},this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}notifyObjectsChangedFunctional(e){this.spatialReference&&(this._computeLayerExtent(e,this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}notifyObjectChanged(e){this.spatialReference&&(this._computeObjectExtent(e,this._tmpEvent.extent),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}_computeObjectExtent(e,t){h(t),this._expandExtent(e,t)}_computeLayerExtent(e,t){h(t),e(e=>{this._expandExtent(e,t)})}_expandExtent(e,t){const r=this.spatialReference;if(null==r)return;if(null==e)return;o(x,e.getQuaternion(b)),x[12]=e.centerX,x[13]=e.centerY,x[14]=e.centerZ;const{halfSizeX:i,halfSizeY:n,halfSizeZ:s}=e;for(let o=0;o<8;++o)R[0]=1&o?i:-i,R[1]=2&o?n:-n,R[2]=4&o?s:-s,c(R,R,x),this._renderCoordsHelper.fromRenderCoords(R,R,r),u(t,R,t);for(let o=0;o<2;++o)R[0]=0,R[1]=0,R[2]=0===o?s:-s,c(R,R,x),this._renderCoordsHelper.fromRenderCoords(R,R,r),u(t,R,t)}};e([i({constructOnly:!0})],E.prototype,"layerElevationSource",void 0),e([i({constructOnly:!0})],E.prototype,"intersectionHandler",void 0),e([i({constructOnly:!0})],E.prototype,"view",void 0),e([i()],E.prototype,"spatialReference",null),E=e([n("esri.views.3d.layers.i3s.LayerElevationProvider")],E);const x=s(),_=new f,R=m(),y=m(),j=m(),b=a();export{E as LayerElevationProvider};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{disposeMaybe as s}from"../../../../core/maybe.js";import t from"../../../../core/PooledArray.js";import{property as i,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{subtract as n,length as o,scale as a,negate as h,dot as l,squaredLength as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as u}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as g,offset as p,contains as m,containsPoint as _,set as f,positiveInfinity as P,equals as x}from"../../../../geometry/support/aaBoundingBox.js";import{create as b}from"../../../../geometry/support/plane.js";import{fromPoints as S}from"../../../../geometry/support/ray.js";import{Sphere as R}from"../../../../geometry/support/sphere.js";import{PclTarget as w}from"./Intersector.js";import{PointCloudHighlights as z}from"./PointCloudHighlights.js";import{isColor as y,isHighlight as v,isDepth as j}from"../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as q}from"../../webgl-engine/effects/RenderPlugin.js";import{IntersectorResult as H}from"../../webgl-engine/lib/IntersectorResult.js";import{VertexArrayObject as O}from"../../webgl-engine/lib/VertexArrayObject.js";import{P as A,g as E}from"../../../../chunks/PointRenderer.glsl.js";import{PointRendererTechnique as F,positionsLayout as I,colorsLayout as B}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{PointRendererTechniqueConfiguration as M}from"../../webgl-engine/shaders/PointRendererTechniqueConfiguration.js";import{PrimitiveType as N}from"../../../webgl/enums.js";import{VertexBuffer as V}from"../../../webgl/VertexBuffer.js";let T=class extends q{constructor(e){super(e),this.type=6,this.isGround=!1,this._passParameters=new A,this._highlights=new z({forEachNode:e=>this.forEachNode(e),addHighlights:(e,s,t)=>this._addHighlights(e,s,t),removeHighlight:(e,s)=>this._removeHighlight(e,s)}),this.produces=new Map([[2,e=>y(e)||v(e)&&!this._highlights.empty],[3,e=>j(e)]]),this.point=c(),this.intersectionRayDir=c(),this.intersectionPlane=b(),this.nodeOriginOffset=c(),this.nodeBoundingBox=g(),this.layerViewUid="",this._slicePlaneEnabled=!1,this._configuration=new M,this._nodes=new t,this._highlightsInOrder=null}destroy(){this._nodes.prune()}hasHighlight(e){return this._highlights.has(e)}initializeRenderContext(e){this._context=e,e.requestRender()}uninitializeRenderContext(){}intersect(e,s,t,i){const{point:r,intersectionRayDir:f,nodeOriginOffset:P,intersectionPlane:x,layerViewUid:b,nodeBoundingBox:z}=this,y=S(t,i),v=e.camera.perScreenPixelRatio/2,j=e.camera.near;n(f,i,t);const q=1/o(f);a(f,f,q);const O=c();h(O,f),u(x,f[0],f[1],f[2],-l(f,t));const A=new D,E=new D,F=new Array,I=g(this._passParameters.clipBox);p(I,-t[0],-t[1],-t[2],I),this._nodes.forAll(o=>{const{isLeaf:a,coordinates:h}=o,c=o.splatSize*this._passParameters.scaleFactor;let{min:u,max:g}=o.obb.signedDistanceRangePlane(x);u-=U(c,u+j,this._passParameters,v,a),g-=U(c,g+j,this._passParameters,v,a);const S=g<0,w=null!=A.dist&&null!=E.dist&&A.dist<u*q&&E.dist>g*q;if(S||w)return;const H=C(c,g+j,this._passParameters,v,a);if(!new R(o.obb.getCenter(L),o.obb.radius+H).intersectRay(y))return;if(!o.obb.intersectRay(t,f,H))return;const B=H*H;o.obb.toAaBoundingBox(z),p(z,-t[0],-t[1],-t[2],z);const M=!m(I,z);n(P,o.origin,t);const N=h.length/3;for(let n=0;n<N;n++){const u=3*n;if(r[0]=P[0]+h[u],r[1]=P[1]+h[u+1],r[2]=P[2]+h[u+2],M&&!_(I,r))continue;const g=l(r,f),p=g*g,m=d(r)-p;if(m>B)continue;let x=g+j;const S=U(c,x,this._passParameters,v,a);if(g-S<0)continue;x-=S;const R=C(c,x,this._passParameters,v,a);if(m>R*R)continue;const w=(g-S)*q,z=e=>(e.point=e.point?W(o,n,e.point):W(o,n),e.dist=w,e.normal=O,e.node=o,e.pointId=n,e.layerViewUid=b,e);if((null==A.dist||w<A.dist)&&(null==s||s(t,i,w))&&z(A),0!==e.options.store&&(null==E.dist||w>E.dist)&&(null==s||s(t,i,w))&&z(E),2===e.options.store&&(null==s||s(t,i,w))){const e=new D;F.push(z(e))}}});const B=e=>{const{layerViewUid:s,node:t,pointId:i}=e;return new w(e.point,s,i,()=>this.createGraphic(t,i,e.point))},M=(e,s)=>{const t=B(s);e.set(this.type,t,s.dist,s.normal)};if(G(A)){const s=e.results.min;(null==s.distance||A.dist<s.distance)&&M(s,A)}if(G(E)&&0!==e.options.store){const s=e.results.max;(null==s.distance||E.dist>s.distance)&&M(s,E)}if(2===e.options.store)for(const n of F){const s=new H(y);M(s,n),e.results.all.push(s)}}acquireTechniques(e){const s=10===e.output;return 0!==this._nodes.length&&(y(e.output)||j(e.output)&&3===e.bind.slot||s)?(this._nodes.forAll(s=>this._initNode(e,s)),this._configuration.drawScreenSize=this._passParameters.drawScreenSpace,this._configuration.useFixedSizes=this._passParameters.useFixedSizes,this._configuration.hasSlicePlane=this._slicePlaneEnabled,this._configuration.hasOccludees=e.bind.hasOccludees,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasHighlightMixTexture=s&&null!=e.bind.highlightMixTexture,this._configuration.output=e.output,this._configuration.hasEmission=e.bind.hasEmission,this._context.techniques.get(F,this._configuration)):null}render(e,s){const{rctx:t,bind:i,output:r}=e,n=t.bindTechnique(s,i,this._passParameters),o=10===r,a=i.highlight?.name??null;o&&!a||(o&&i.highlights!==this._highlightsInOrder&&this._updateResolvedHighlights(i.highlights),this._nodes.forAll(s=>{const r=o?s.resolvedHighlightRanges.get(a):null;0===s.coordinates.length||null==s.vao||o&&null==r||(n.assertCompatibleVertexAttributeLocations(s.vao),n.bindDraw(i,this._passParameters,s),t.bindVAO(s.vao),o?this._renderHighlightFragments(e,r):t.drawArrays(N.POINTS,0,s.coordinates.length/3))}))}_renderHighlightFragments(e,s){const{rctx:t}=e;for(let i=0;i<s.length;i+=2)t.drawArrays(N.POINTS,s[i],s[i+1])}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){f(this._passParameters.clipBox,e||P)}get _clippingEnabled(){return!x(this._passParameters.clipBox,P,(e,s)=>e===s)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),e.clearHighlights(),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let t=null;return this._nodes.filterInPlace(i=>i.id!==e||(t=i,i.vao=s(i.vao),this._highlights.nodeRemoved(i),!1)),this._requestRender(),t}forEachNode(e){this._nodes.forEach(e)}removeAll(){this._nodes.forAll(e=>e.vao=s(e.vao)),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e,s){return this._highlights.add(e,s)}_addHighlights(e,s,t){for(const i of s)e.addHighlight(i,t);this._highlightsInOrder&&e.updateResolvedHighlights(this._highlightsInOrder),this._requestRender()}_removeHighlight(e,s){e.removeHighlight(s),this._highlightsInOrder&&e.updateResolvedHighlights(this._highlightsInOrder),this._requestRender()}_initNode(e,s){s.vao??=new O(e.rctx,new Map([["positions",new V(e.rctx,I,s.coordinates)],["colors",new V(e.rctx,B,s.rgb)]]))}_requestRender(){this._context&&this._context.requestRender()}_updateResolvedHighlights(e){this._highlightsInOrder=e,this._nodes.forAll(s=>s.updateResolvedHighlights(e))}};function C(e,s,t,i,r){if(t.drawScreenSpace)return t.fixedSize*s*i;const n=E(r)*s*i;return t.useFixedSizes?Math.min(t.fixedSize/2,n):t.screenMinSize>0?Math.min(Math.max(t.screenMinSize*s*i,e/2),n):Math.min(e/2,n)}function U(e,s,t,i,r){return t.drawScreenSpace?0:C(e,s,t,i,r)}function W(e,s,t=c()){return t[0]=e.origin[0]+e.coordinates[3*s],t[1]=e.origin[1]+e.coordinates[3*s+1],t[2]=e.origin[2]+e.coordinates[3*s+2],t}e([i({constructOnly:!0})],T.prototype,"createGraphic",void 0),T=e([r("esri.views.3d.layers.i3s.PointCloudRenderer")],T);class D{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}function G(e){return null!=e.dist&&null!=e.point&&null!=e.pointId&&null!=e.node}const L=c();export{T as PointCloudRenderer};
2
+ import{__decorate as e}from"tslib";import{disposeMaybe as s}from"../../../../core/maybe.js";import t from"../../../../core/PooledArray.js";import{property as i,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{subtract as n,length as o,scale as a,negate as h,dot as l,squaredLength as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as u}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as g,offset as p,contains as m,containsPoint as _,set as f,positiveInfinity as P,equals as x}from"../../../../geometry/support/aaBoundingBox.js";import{create as b}from"../../../../geometry/support/plane.js";import{fromPoints as R}from"../../../../geometry/support/ray.js";import{Sphere as S}from"../../../../geometry/support/sphere.js";import{PclTarget as w}from"./Intersector.js";import{PointCloudHighlights as z}from"./PointCloudHighlights.js";import{isColor as y,isHighlight as v,isDepth as j}from"../../webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as q}from"../../webgl-engine/effects/RenderPlugin.js";import{IntersectorResult as H}from"../../webgl-engine/lib/IntersectorResult.js";import{VertexArrayObject as O}from"../../webgl-engine/lib/VertexArrayObject.js";import{P as A,g as E}from"../../../../chunks/PointRenderer.glsl.js";import{PointRendererTechnique as F,positionsLayout as I,colorsLayout as B}from"../../webgl-engine/shaders/PointRendererTechnique.js";import{PointRendererTechniqueConfiguration as M}from"../../webgl-engine/shaders/PointRendererTechniqueConfiguration.js";import{PrimitiveType as N}from"../../../webgl/enums.js";import{VertexBuffer as V}from"../../../webgl/VertexBuffer.js";let T=class extends q{constructor(e){super(e),this.type=6,this.isGround=!1,this._passParameters=new A,this._highlights=new z({forEachNode:e=>this.forEachNode(e),addHighlights:(e,s,t)=>this._addHighlights(e,s,t),removeHighlight:(e,s)=>this._removeHighlight(e,s)}),this.produces=new Map([[2,e=>y(e)||v(e)&&!this._highlights.empty],[3,e=>j(e)]]),this.point=c(),this.intersectionRayDir=c(),this.intersectionPlane=b(),this.nodeOriginOffset=c(),this.nodeBoundingBox=g(),this.layerViewUid="",this._slicePlaneEnabled=!1,this._configuration=new M,this._nodes=new t,this._highlightsInOrder=null}destroy(){this._nodes.prune()}hasHighlight(e){return this._highlights.has(e)}initializeRenderContext(e){this._context=e,e.requestRender()}uninitializeRenderContext(){}intersectRay(e,s,t,i){const{point:r,intersectionRayDir:f,nodeOriginOffset:P,intersectionPlane:x,layerViewUid:b,nodeBoundingBox:z}=this,y=R(t,i),v=e.camera.perScreenPixelRatio/2,j=e.camera.near;n(f,i,t);const q=1/o(f);a(f,f,q);const O=c();h(O,f),u(x,f[0],f[1],f[2],-l(f,t));const A=new D,E=new D,F=new Array,I=g(this._passParameters.clipBox);p(I,-t[0],-t[1],-t[2],I),this._nodes.forAll(o=>{const{isLeaf:a,coordinates:h}=o,c=o.splatSize*this._passParameters.scaleFactor;let{min:u,max:g}=o.obb.signedDistanceRangePlane(x);u-=U(c,u+j,this._passParameters,v,a),g-=U(c,g+j,this._passParameters,v,a);const R=g<0,w=null!=A.dist&&null!=E.dist&&A.dist<u*q&&E.dist>g*q;if(R||w)return;const H=C(c,g+j,this._passParameters,v,a);if(!new S(o.obb.getCenter(L),o.obb.radius+H).intersectRay(y))return;if(!o.obb.intersectRay(t,f,H))return;const B=H*H;o.obb.toAaBoundingBox(z),p(z,-t[0],-t[1],-t[2],z);const M=!m(I,z);n(P,o.origin,t);const N=h.length/3;for(let n=0;n<N;n++){const u=3*n;if(r[0]=P[0]+h[u],r[1]=P[1]+h[u+1],r[2]=P[2]+h[u+2],M&&!_(I,r))continue;const g=l(r,f),p=g*g,m=d(r)-p;if(m>B)continue;let x=g+j;const R=U(c,x,this._passParameters,v,a);if(g-R<0)continue;x-=R;const S=C(c,x,this._passParameters,v,a);if(m>S*S)continue;const w=(g-R)*q,z=e=>(e.point=e.point?W(o,n,e.point):W(o,n),e.dist=w,e.normal=O,e.node=o,e.pointId=n,e.layerViewUid=b,e);if((null==A.dist||w<A.dist)&&(null==s||s(t,i,w))&&z(A),0!==e.options.store&&(null==E.dist||w>E.dist)&&(null==s||s(t,i,w))&&z(E),2===e.options.store&&(null==s||s(t,i,w))){const e=new D;F.push(z(e))}}});const B=e=>{const{layerViewUid:s,node:t,pointId:i}=e;return new w(e.point,s,i,()=>this.createGraphic(t,i,e.point))},M=(e,s)=>{const t=B(s);e.set(this.type,t,s.dist,s.normal)};if(G(A)){const s=e.results.min;(null==s.distance||A.dist<s.distance)&&M(s,A)}if(G(E)&&0!==e.options.store){const s=e.results.max;(null==s.distance||E.dist>s.distance)&&M(s,E)}if(2===e.options.store)for(const n of F){const s=new H(y);M(s,n),e.results.all.push(s)}}acquireTechniques(e){const s=10===e.output;return 0!==this._nodes.length&&(y(e.output)||j(e.output)&&3===e.bind.slot||s)?(this._nodes.forAll(s=>this._initNode(e,s)),this._configuration.drawScreenSize=this._passParameters.drawScreenSpace,this._configuration.useFixedSizes=this._passParameters.useFixedSizes,this._configuration.hasSlicePlane=this._slicePlaneEnabled,this._configuration.hasOccludees=e.bind.hasOccludees,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasHighlightMixTexture=s&&null!=e.bind.highlightMixTexture,this._configuration.output=e.output,this._configuration.hasEmission=e.bind.hasEmission,this._context.techniques.get(F,this._configuration)):null}render(e,s){const{rctx:t,bind:i,output:r}=e,n=t.bindTechnique(s,i,this._passParameters),o=10===r,a=i.highlight?.name??null;o&&!a||(o&&i.highlights!==this._highlightsInOrder&&this._updateResolvedHighlights(i.highlights),this._nodes.forAll(s=>{const r=o?s.resolvedHighlightRanges.get(a):null;0===s.coordinates.length||null==s.vao||o&&null==r||(n.assertCompatibleVertexAttributeLocations(s.vao),n.bindDraw(i,this._passParameters,s),t.bindVAO(s.vao),o?this._renderHighlightFragments(e,r):t.drawArrays(N.POINTS,0,s.coordinates.length/3))}))}_renderHighlightFragments(e,s){const{rctx:t}=e;for(let i=0;i<s.length;i+=2)t.drawArrays(N.POINTS,s[i],s[i+1])}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){f(this._passParameters.clipBox,e||P)}get _clippingEnabled(){return!x(this._passParameters.clipBox,P,(e,s)=>e===s)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),e.clearHighlights(),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let t=null;return this._nodes.filterInPlace(i=>i.id!==e||(t=i,i.vao=s(i.vao),this._highlights.nodeRemoved(i),!1)),this._requestRender(),t}forEachNode(e){this._nodes.forEach(e)}removeAll(){this._nodes.forAll(e=>e.vao=s(e.vao)),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e,s){return this._highlights.add(e,s)}_addHighlights(e,s,t){for(const i of s)e.addHighlight(i,t);this._highlightsInOrder&&e.updateResolvedHighlights(this._highlightsInOrder),this._requestRender()}_removeHighlight(e,s){e.removeHighlight(s),this._highlightsInOrder&&e.updateResolvedHighlights(this._highlightsInOrder),this._requestRender()}_initNode(e,s){s.vao??=new O(e.rctx,new Map([["positions",new V(e.rctx,I,s.coordinates)],["colors",new V(e.rctx,B,s.rgb)]]))}_requestRender(){this._context&&this._context.requestRender()}_updateResolvedHighlights(e){this._highlightsInOrder=e,this._nodes.forAll(s=>s.updateResolvedHighlights(e))}};function C(e,s,t,i,r){if(t.drawScreenSpace)return t.fixedSize*s*i;const n=E(r)*s*i;return t.useFixedSizes?Math.min(t.fixedSize/2,n):t.screenMinSize>0?Math.min(Math.max(t.screenMinSize*s*i,e/2),n):Math.min(e/2,n)}function U(e,s,t,i,r){return t.drawScreenSpace?0:C(e,s,t,i,r)}function W(e,s,t=c()){return t[0]=e.origin[0]+e.coordinates[3*s],t[1]=e.origin[1]+e.coordinates[3*s+1],t[2]=e.origin[2]+e.coordinates[3*s+2],t}e([i({constructOnly:!0})],T.prototype,"createGraphic",void 0),T=e([r("esri.views.3d.layers.i3s.PointCloudRenderer")],T);class D{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}function G(e){return null!=e.dist&&null!=e.point&&null!=e.pointId&&null!=e.node}const L=c();export{T as PointCloudRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{project as t}from"../../../../geometry/projectionUtils.js";import{fromExtent as i}from"../../../../geometry/support/aaBoundingRect.js";import{Tiles3DTarget as n}from"../i3s/Intersector.js";import{createTileBVH as r}from"./Tiles3DBVH.js";import{ElevationRange as s}from"../../support/ElevationRange.js";import{IntersectorResult as o}from"../../webgl-engine/lib/IntersectorResult.js";import{MeshIntersectionOptions as l,computeInvDir as a,intersectAabbInvDir as c}from"../../webgl-engine/lib/RayIntersections.js";class d{constructor(e){this.layerView=e,this.type=8,this.slicePlaneEnabled=!1,this.isGround=!0,this.layerViewUid=e.uid;const n=e.view.viewingMode,s=(e.useEsriCrs?e.fullExtentInLocalViewSpatialReference:e.layer.fullExtent?t(e.layer.fullExtent,e.view.renderSpatialReference):void 0)??e.view.extent,o=i(s);this._bvh=r(n,o)}destroy(){this._bvh.destroy()}addTile(e){this._bvh.addTile(e)}removeTile(e){this._bvh.removeTile(e)}intersect(e,t,i,r,s,d){if(e.options.filteredLayerViewUids.includes(this.layerView.uid))return;const{results:m,tolerance:p}=e,h=2===e.options.store,{componentObjectCollection:f}=this.layerView.view.stage.renderView,g=new l(p,d,e.options.normalRequired),w=a(i,r,u),v=(s,l,a)=>{if(l<0)return;if(null!=t&&!t(i,r,l))return;const c=e=>{const t=new n(this.layerView.uid);e.set(this.type,t,l,a)};if(this.isGround&&(null==m.ground.distance||l<m.ground.distance)&&c(m.ground),!e.options.isFiltered&&((null==m.min.distance||l<m.min.distance)&&c(m.min),(null==m.max.distance||l>m.max.distance)&&c(m.max),h)){const t=new o(e.ray);c(t),e.results.all.push(t)}};this._bvh.forEachTileIntersectingRay(i,r,e=>{const{componentObjects:t}=e;for(const n of t)c(n.aabbInWorldCoordinates,i,w,0)&&f.intersect(n,i,r,null,g,v)},d)}getElevationRange(e){return this._bvh.getElevationRangeIntersectingSphere(e)??new s(0,0)}}const u=e();export{d as Tiles3DMeshIntersectionHandler};
2
+ import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{project as t}from"../../../../geometry/projectionUtils.js";import{fromExtent as i}from"../../../../geometry/support/aaBoundingRect.js";import{Tiles3DTarget as n}from"../i3s/Intersector.js";import{createTileBVH as r}from"./Tiles3DBVH.js";import{ElevationRange as s}from"../../support/ElevationRange.js";import{IntersectorResult as o}from"../../webgl-engine/lib/IntersectorResult.js";import{MeshIntersectionOptions as l,computeInvDir as a,intersectAabbInvDir as c}from"../../webgl-engine/lib/RayIntersections.js";class d{constructor(e){this.layerView=e,this.type=8,this.slicePlaneEnabled=!1,this.isGround=!0,this.layerViewUid=e.uid;const n=e.view.viewingMode,s=(e.useEsriCrs?e.fullExtentInLocalViewSpatialReference:e.layer.fullExtent?t(e.layer.fullExtent,e.view.renderSpatialReference):void 0)??e.view.extent,o=i(s);this._bvh=r(n,o)}destroy(){this._bvh.destroy()}addTile(e){this._bvh.addTile(e)}removeTile(e){this._bvh.removeTile(e)}intersectRay(e,t,i,r,s,d){if(e.options.filteredLayerViewUids.includes(this.layerView.uid))return;const{results:m,tolerance:p}=e,h=2===e.options.store,{componentObjectCollection:f}=this.layerView.view.stage.renderView,g=new l(p,d,e.options.normalRequired),w=a(i,r,u),y=(s,l,a)=>{if(l<0)return;if(null!=t&&!t(i,r,l))return;const c=e=>{const t=new n(this.layerView.uid);e.set(this.type,t,l,a)};if(this.isGround&&(null==m.ground.distance||l<m.ground.distance)&&c(m.ground),!e.options.isFiltered&&((null==m.min.distance||l<m.min.distance)&&c(m.min),(null==m.max.distance||l>m.max.distance)&&c(m.max),h)){const t=new o(e.ray);c(t),e.results.all.push(t)}};this._bvh.forEachTileIntersectingRay(i,r,e=>{const{componentObjects:t}=e;for(const n of t)c(n.aabbInWorldCoordinates,i,w,0)&&f.intersectRay(n,i,r,null,g,y)},d)}getElevationRange(e){return this._bvh.getElevationRangeIntersectingSphere(e)??new s(0,0)}}const u=e();export{d as Tiles3DMeshIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import e from"../../../core/Error.js";import{onAbort as n,createAbortError as a}from"../../../core/promiseUtils.js";import{whenOnce as r}from"../../../core/reactiveUtils.js";import{toRenderCameraWithScale as o}from"../webgl.js";import{applyAll as s}from"../camera/constraintUtils.js";import{isPointToPointAnimationController as l,PointToPointAnimationController as h}from"./controllers/PointToPointAnimationController.js";import{SurfaceCollisionCorrectionController as c}from"./controllers/SurfaceCollisionCorrectionController.js";import{create as m}from"../support/viewpointUtils.js";class w{constructor(t,i,e){this._target=t,this._options=i,this.view=e,this.state="pending",this._animationController=null,this.promise=new Promise((t,i)=>{this._resolveCallback=t,this._rejectCallback=i;const e=new AbortController;null!=this._options.signal&&n(this._options.signal,()=>this.abort()),this._abortController=e,this._waitForReady()})}_resolve(t){if("finished"!==this.state)return this.state="finished",this._resolveCallback(t)}_reject(t){if("finished"!==this.state)return this.state="finished",this._rejectCallback(t)}abort(t=!1){if(this._abortController.abort(),"wait-for-animation-finish"===this.state)!t&&null!=this._animationController&&this.view.state.cameraController===this._animationController&&this._animationController.running&&this._animationController.stopController();this._reject(a())}async _waitForReady(){if(this.state="wait-for-ready",!this.view.ready)try{await r(()=>this.view.ready,this._abortController.signal)}catch(t){return this._reject(t)}this._createViewPoint()}async _createViewPoint(){if("finished"!==this.state){this.state="wait-for-viewpoint",this._animationController=this._options.animate?this._getAnimationController():null;try{const t=await m(this.view,this._target,this._abortController.signal);if("finished"===this.state)return;const i=t?this._getCameraFromViewpoint(t):null;if(null==i)return;if(this._options.animate){if(null==this._animationController)return;this._startAnimation(i,this._animationController)}else this.view.stateManager.setStateCamera(i.camera,{applyConstraints:!i.isFullySpecified,positionAndOrientationOnly:!0,doNotCancelGoToOperation:!0}),this._resolve()}catch(t){this._reject(t)}}}_getCameraFromViewpoint(n){const a=this._target instanceof i,r=this._target instanceof t,s=!!(a&&this._target.camera||r||"position"in this._target&&void 0!==this._target.position?.z||Array.isArray(this._target)&&void 0!==this._target[2]),l=n.camera;if(null==l)return null;if(!this.view.stateManager.isCompatible(l)){const t=l.position,i=t&&t.spatialReference,n=i?i.wkid:"none",a=this.view.spatialReference?.wkid;return this._reject(new e("GotoAnimation:incompatible-spatialreference",`Resulting camera has an incompatible spatial reference (camera: ${n}, view: ${a})`,{camera:l})),null}const h=o(this.view,l,n.scale);return null==h?(this._reject(new e("GotoAnimation:invalid-camera","Resulting camera is invalid")),null):{viewpoint:n,camera:h,isFullySpecified:s}}_startAnimation(t,i){this.state="wait-for-animation-finish";const n=i.viewAnimation;if(null==n)return void this._reject(new e("GotoAnimation:missing-animation","Unreachable code in view.stateManager"));if(n.update(t.viewpoint,"running"),!i.running||null==i.viewAnimation||i.viewAnimation.target!==t.viewpoint||this.view.state.cameraController!==i)return this.abort();let a;t.isFullySpecified?a=new c({view:this.view,desiredCamera:t.camera}):s(this.view,t.camera),i.begin(t.camera,this._options);const r=()=>{const e=this.view.state.cameraController;a&&(e&&e.running?l(e)&&null!=e.viewAnimation&&e.viewAnimation.target===t.viewpoint&&(this.view.state.cameraController=a):null!=i.viewAnimation&&i.viewAnimation.target===t.viewpoint&&4===i.state&&(this.view.state.cameraController=a))},o=t=>{if(null!=this.view.state)switch(i.state){case 4:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this._resolve()}break;case 0:case 1:case 2:case 3:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this._reject(t)}}};n.when(r,t=>o(t)),i.asyncResult={resolve:()=>o(),reject:t=>o(t)}}_getAnimationController(){let t=null,i=null;const n=this.view.state.cameraController;return l(n)&&(n.updateStateFromViewAnimation(),n.running&&(t=n,i=t.viewAnimation)),null==t&&(t=new h({view:this.view,mode:"animation"}),i=t.viewAnimation,this.view.state.switchCameraController(t),1===t.state)?(i?.stop(),this._reject(new e("GotoAnimation:goto-cannot-interrupt","Cannot start an animation while interacting")),null):t}}export{w as GoToOperation};
2
+ import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import e from"../../../core/Error.js";import{onAbort as n,createAbortError as a}from"../../../core/promiseUtils.js";import{whenOnce as o}from"../../../core/reactiveUtils.js";import{toRenderCameraWithScale as r}from"../webgl.js";import{applyAll as s}from"../camera/constraintUtils.js";import{isPointToPointAnimationController as l,PointToPointAnimationController as c}from"./controllers/PointToPointAnimationController.js";import{create as h}from"../support/viewpointUtils.js";class m{constructor(t,i,e){this._target=t,this._options=i,this.view=e,this.state="pending",this._animationController=null,this.promise=new Promise((t,i)=>{this._resolveCallback=t,this._rejectCallback=i;const e=new AbortController;null!=this._options.signal&&n(this._options.signal,()=>this.abort()),this._abortController=e,this._waitForReady()})}_resolve(t){if("finished"!==this.state)return this.state="finished",this._resolveCallback(t)}_reject(t){if("finished"!==this.state)return this.state="finished",this._rejectCallback(t)}abort(t=!1){if(this._abortController.abort(),"wait-for-animation-finish"===this.state)!t&&null!=this._animationController&&this.view.state.cameraController===this._animationController&&this._animationController.running&&this._animationController.stopController();this._reject(a())}async _waitForReady(){if(this.state="wait-for-ready",!this.view.ready)try{await o(()=>this.view.ready,this._abortController.signal)}catch(t){return this._reject(t)}this._createViewPoint()}async _createViewPoint(){if("finished"!==this.state){this.state="wait-for-viewpoint",this._animationController=this._options.animate?this._getAnimationController():null;try{const t=await h(this.view,this._target,this._abortController.signal);if("finished"===this.state)return;const i=t?this._getCameraFromViewpoint(t):null;if(null==i)return;if(this._options.animate){if(null==this._animationController)return;this._startAnimation(i,this._animationController)}else this.view.stateManager.setStateCamera(i.camera,{applyConstraints:!i.isFullySpecified,positionAndOrientationOnly:!0,doNotCancelGoToOperation:!0}),this._resolve()}catch(t){this._reject(t)}}}_getCameraFromViewpoint(n){const a=this._target instanceof i,o=this._target instanceof t,s=!!(a&&this._target.camera||o),l=n.camera;if(null==l)return null;if(!this.view.stateManager.isCompatible(l)){const t=l.position,i=t&&t.spatialReference,n=i?i.wkid:"none",a=this.view.spatialReference?.wkid;return this._reject(new e("GotoAnimation:incompatible-spatialreference",`Resulting camera has an incompatible spatial reference (camera: ${n}, view: ${a})`,{camera:l})),null}const c=r(this.view,l,n.scale);return null==c?(this._reject(new e("GotoAnimation:invalid-camera","Resulting camera is invalid")),null):{viewpoint:n,camera:c,isFullySpecified:s}}_startAnimation(t,i){this.state="wait-for-animation-finish";const n=i.viewAnimation;if(null==n)return void this._reject(new e("GotoAnimation:missing-animation","Unreachable code in view.stateManager"));if(n.update(t.viewpoint,"running"),!i.running||null==i.viewAnimation||i.viewAnimation.target!==t.viewpoint||this.view.state.cameraController!==i)return this.abort();t.isFullySpecified||s(this.view,t.camera),i.begin(t.camera,this._options);const a=t=>{if(null!=this.view.state)switch(i.state){case 4:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this._resolve()}break;case 0:case 1:case 2:case 3:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this._reject(t)}}};i.asyncResult={resolve:()=>a(),reject:t=>a(t)}}_getAnimationController(){let t=null,i=null;const n=this.view.state.cameraController;return l(n)&&(n.updateStateFromViewAnimation(),n.running&&(t=n,i=t.viewAnimation)),null==t&&(t=new c({view:this.view,mode:"animation"}),i=t.viewAnimation,this.view.state.switchCameraController(t),1===t.state)?(i?.stop(),this._reject(new e("GotoAnimation:goto-cannot-interrupt","Cannot start an animation while interacting")),null):t}}export{m as GoToOperation};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{eyeWithinExtent as a}from"../camera/intersectionUtils.js";import{applySurfaceCollisionConstraint as o}from"../camera/constraintUtils/surfaceCollision.js";let s=class extends t{constructor(e){super(e)}initialize(){this.addHandles(this.view.elevationProvider.on("elevation-change",e=>this._handleElevationChangeEvent(e)))}_handleElevationChangeEvent(e){if(this.view.state.cameraController||"ground"!==e.context)return;const t=this.view.state.camera;null!=e.spatialReference&&a(this.view,t,e.extent,e.spatialReference)&&this._applyToCurrentCamera()}_applyToCurrentCamera(){this.view.state.updateCamera(e=>o(this.view,e,1))}};e([r({constructOnly:!0})],s.prototype,"view",void 0),s=e([i("esri.views.3d.state.SurfaceCollisionConstraint")],s);export{s as SurfaceCollisionConstraint};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as a,subclass as r}from"../../../core/accessorSupport/decorators.js";import{eyeWithinExtent as s}from"../camera/intersectionUtils.js";import{applySurfaceCollisionConstraint as i}from"../camera/constraintUtils/surfaceCollision.js";let o=class extends t{constructor(e){super(e),this._sourceCamera=null}initialize(){this.addHandles(this.view.elevationProvider.on("elevation-change",e=>this._handleElevationChangeEvent(e)))}setSourceCamera(e){this._sourceCamera=e.clone()}_handleElevationChangeEvent(e){!this.view.state.cameraController&&"ground"===e.context&&this.view.state.constraints.collision.enabled&&null!=e.spatialReference&&s(this.view,this._sourceCamera||this.view.state.camera,e.extent,e.spatialReference)&&this._applyToCurrentCamera()}_applyToCurrentCamera(){this.view.state.updateCamera(e=>{i(this.view,this._sourceCamera||this.view.state.camera,e,1)})}};e([a({constructOnly:!0})],o.prototype,"view",void 0),o=e([r("esri.views.3d.state.SurfaceCollisionConstraint")],o);export{o as SurfaceCollisionConstraint};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{prefersReducedMotion as t}from"../../../core/a11yUtils.js";import r from"../../../core/Accessor.js";import{EventEmitter as o}from"../../../core/Evented.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{when as i}from"../../../core/reactiveUtils.js";import{property as n,subclass as s}from"../../../core/accessorSupport/decorators.js";import{afterDispatch as l}from"../../../core/accessorSupport/watch.js";import{fromValues as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import m from"../../ViewAnimation.js";import{viewingModeFromString as h}from"../../ViewingMode.js";import{Constraints as d}from"./Constraints.js";import{HUDOccludedFragmentOpacity as u}from"./HUDOccludedFragmentOpacity.js";import{AnimationController as g}from"./controllers/AnimationController.js";import y from"../webgl/RenderCamera.js";import{DepthRange as C}from"../webgl-engine/lib/DepthRange.js";import{maximumHighlights as f}from"../../support/HighlightDefaults.js";import{PropertiesPool as w}from"../../support/PropertiesPool.js";let v=class extends r{constructor(e){super(e),this._propertiesPool=new w({camera:()=>new y},this),this._lastSeenCameraProjectionValues=new y,this.mode=0,this._cssCamera=new y,this._camera=new y,this.rasterPixelRatio=1,this.contentPixelRatio=1,this.constraints=new d({state:this}),this.events=new o,this.fading=!1,this._cameraChanged=!1,this._updateQueue=new Array,this._processingUpdates=!1}reset(){this.cameraController=null,this._propertiesPool.destroy(),this._propertiesPool=new w({camera:()=>new y},this)}destroy(){this.cameraController=null,this._propertiesPool=a(this._propertiesPool)}createInitialCamera(){if(1===this.viewingMode){const e=c(this.spatialReference).radius;this.camera=new y({eye:p(4*e,0,0),center:p(e,0,0),up:p(0,0,1)})}else this.camera=new y({eye:p(0,0,100),center:p(0,0,0),up:p(0,1,0)})}get animation(){return this.cameraController instanceof g&&null!=this.cameraController.viewAnimation?this.cameraController.viewAnimation:null}get cssCamera(){const e=this._cssCamera.copyFrom(this.camera),{height:t,width:r,pixelRatio:o}=this.camera;return e.pixelRatio=1,e.height=Math.round(t/o),e.width=Math.round(r/o),e}get camera(){return this._camera}set camera(e){e!==O&&O.copyFrom(e),O.computeUp(this.viewingMode),this.events.emit("before-camera-change",{camera:O});const t=this._camera;if(j(this._lastSeenCameraProjectionValues,O)&&(this._lastSeenCameraProjectionValues.copyFrom(O),this.events.emit("camera-projection-changed",this._lastSeenCameraProjectionValues)),!t.equals(O)&&(this._camera=this._propertiesPool.get("camera").copyFrom(O),this._cameraChanged=!t.almostEquals(O),this._cameraChanged)){const e=l(()=>{this._cameraChanged=!1,e.remove()})}}get pixelRatio(){return this.camera.pixelRatio}get alignPixelEnabled(){return this.pixelRatio===this.rasterPixelRatio&&2===this.mode}get updating(){return 2!==this.mode}get contentCamera(){return this._contentCamera??this.camera}set contentCamera(e){if(null==e)return void(this._contentCamera=null);const t=e.clone();this.events.emit("before-camera-change",{camera:t,sceneDepthRange:C.Infinite}),this._contentCamera=t}get fixedContentCamera(){return null!=this._contentCamera}get isGlobal(){return 1===this.viewingMode}get isLocal(){return 2===this.viewingMode}get viewingMode(){return h(this.view.viewingMode)}get spatialReference(){return this.view.spatialReference}ensureOccludedFragmentOpacity(){return this.occludedFragmentOpacity??=new u({requestRender:()=>this.view.stage?.renderView.requestRender(2)}),this.occludedFragmentOpacity}get highlights(){const e=this.view.highlights.items.slice(0,f);for(let t=0;t<e.length;){const r=e[t],o=e.findIndex(e=>e.name===r.name);o>=0&&t>o?e.splice(t,1):++t}return e}get highlightOrderMap(){return new Map(this.highlights.map(({name:e},t)=>[e,t]))}get animationsEnabled(){return this.view.animationsEnabled&&!t()}get navigating(){return!!this.cameraController?.isInteractive}get stationary(){return!this._cameraChanged&&!this.navigating}get cameraController(){return this._get("cameraController")}set cameraController(e){this.stopActiveCameraController()?(this.removeHandles(x),this.cameraController?.destroy(),e&&(this.addHandles(i(()=>4===e.state||3===e.state,()=>{this.updateCamera(t=>e.onControllerEnd(t)),this.cameraController===e&&(this._set("cameraController",null),e.destroy())},{sync:!0,once:!0}),x),e.onControllerStart(this.camera)),this._set("cameraController",e)):e&&(e.state=1)}switchCameraController(e){this.cameraController=e}stopActiveCameraController(){return!this.cameraController||this.cameraController.stopController()}updateCamera(e){this._updateQueue.push(e),this._processUpdateQueue()}_processUpdateQueue(){if(0===this._updateQueue.length||this._processingUpdates)return;this._processingUpdates=!0;const e=this._updateQueue.shift();O.copyFrom(this.camera),e(O),this.camera=O,this._processingUpdates=!1,this._processUpdateQueue()}static cleanupViewstate(){O=new y}};e([n({constructOnly:!0})],v.prototype,"view",void 0),e([n()],v.prototype,"mode",void 0),e([n({readOnly:!0,type:m})],v.prototype,"animation",null),e([n({type:y})],v.prototype,"cssCamera",null),e([n()],v.prototype,"_cssCamera",void 0),e([n({type:y})],v.prototype,"camera",null),e([n()],v.prototype,"_camera",void 0),e([n({readOnly:!0})],v.prototype,"pixelRatio",null),e([n()],v.prototype,"rasterPixelRatio",void 0),e([n()],v.prototype,"contentPixelRatio",void 0),e([n({readOnly:!0})],v.prototype,"alignPixelEnabled",null),e([n({readOnly:!0})],v.prototype,"updating",null),e([n({})],v.prototype,"_contentCamera",void 0),e([n({type:y})],v.prototype,"contentCamera",null),e([n({readOnly:!0})],v.prototype,"fixedContentCamera",null),e([n({readOnly:!0})],v.prototype,"events",void 0),e([n({readOnly:!0})],v.prototype,"isGlobal",null),e([n({readOnly:!0})],v.prototype,"isLocal",null),e([n({readOnly:!0})],v.prototype,"viewingMode",null),e([n()],v.prototype,"occludedFragmentOpacity",void 0),e([n({readOnly:!0})],v.prototype,"highlights",null),e([n({readOnly:!0})],v.prototype,"highlightOrderMap",null),e([n({readOnly:!0})],v.prototype,"navigating",null),e([n()],v.prototype,"fading",void 0),e([n({readOnly:!0})],v.prototype,"stationary",null),e([n()],v.prototype,"_cameraChanged",void 0),e([n()],v.prototype,"cameraController",null),v=e([s("esri.views.3d.state.ViewState")],v);const _=v;function j(e,t){return e.fov!==t.fov||(e.fullViewport[0]!==t.fullViewport[0]||e.fullViewport[1]!==t.fullViewport[1]||e.fullViewport[2]!==t.fullViewport[2]||e.fullViewport[3]!==t.fullViewport[3]||(e.padding[0]!==t.padding[0]||e.padding[1]!==t.padding[1]||e.padding[2]!==t.padding[2]||e.padding[3]!==t.padding[3]))}let O=new y;const x="ViewStateHandles";export{_ as default};
2
+ import{__decorate as e}from"tslib";import{prefersReducedMotion as t}from"../../../core/a11yUtils.js";import r from"../../../core/Accessor.js";import{EventEmitter as o}from"../../../core/Evented.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{when as i}from"../../../core/reactiveUtils.js";import{property as n,subclass as s}from"../../../core/accessorSupport/decorators.js";import{afterDispatch as l}from"../../../core/accessorSupport/watch.js";import{fromValues as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import m from"../../ViewAnimation.js";import{viewingModeFromString as h}from"../../ViewingMode.js";import{applySurfaceCollisionConstraint as d}from"../camera/constraintUtils/surfaceCollision.js";import{Constraints as u}from"./Constraints.js";import{HUDOccludedFragmentOpacity as g}from"./HUDOccludedFragmentOpacity.js";import{AnimationController as y}from"./controllers/AnimationController.js";import C from"../webgl/RenderCamera.js";import{DepthRange as w}from"../webgl-engine/lib/DepthRange.js";import{maximumHighlights as f}from"../../support/HighlightDefaults.js";import{PropertiesPool as v}from"../../support/PropertiesPool.js";let _=class extends r{constructor(e){super(e),this._propertiesPool=new v({camera:()=>new C},this),this._lastSeenCameraProjectionValues=new C,this.mode=0,this._cssCamera=new C,this._camera=new C,this.rasterPixelRatio=1,this.contentPixelRatio=1,this.constraints=new u({state:this}),this.events=new o,this.fading=!1,this._cameraChanged=!1,this._updateQueue=new Array,this._processingUpdates=!1}reset(){this.cameraController=null,this._propertiesPool.destroy(),this._propertiesPool=new v({camera:()=>new C},this)}destroy(){this.cameraController=null,this._propertiesPool=a(this._propertiesPool)}createInitialCamera(){if(1===this.viewingMode){const e=c(this.spatialReference).radius;this.camera=new C({eye:p(4*e,0,0),center:p(e,0,0),up:p(0,0,1)})}else this.camera=new C({eye:p(0,0,100),center:p(0,0,0),up:p(0,1,0)})}get animation(){return this.cameraController instanceof y&&null!=this.cameraController.viewAnimation?this.cameraController.viewAnimation:null}get cssCamera(){const e=this._cssCamera.copyFrom(this.camera),{height:t,width:r,pixelRatio:o}=this.camera;return e.pixelRatio=1,e.height=Math.round(t/o),e.width=Math.round(r/o),e}get camera(){return this._camera}set camera(e){e!==x&&x.copyFrom(e),x.computeUp(this.viewingMode),this.events.emit("before-camera-change",{camera:x});const t=this._camera;if(O(this._lastSeenCameraProjectionValues,x)&&(this._lastSeenCameraProjectionValues.copyFrom(x),this.events.emit("camera-projection-changed",this._lastSeenCameraProjectionValues)),!t.equals(x)&&(this._camera=this._propertiesPool.get("camera").copyFrom(x),this._cameraChanged=!t.almostEquals(x),this._cameraChanged)){const e=l(()=>{this._cameraChanged=!1,e.remove()})}}get pixelRatio(){return this.camera.pixelRatio}get alignPixelEnabled(){return this.pixelRatio===this.rasterPixelRatio&&2===this.mode}get updating(){return 2!==this.mode}get contentCamera(){return this._contentCamera??this.camera}set contentCamera(e){if(null==e)return void(this._contentCamera=null);const t=e.clone();this.events.emit("before-camera-change",{camera:t,sceneDepthRange:w.Infinite}),this._contentCamera=t}get fixedContentCamera(){return null!=this._contentCamera}get isGlobal(){return 1===this.viewingMode}get isLocal(){return 2===this.viewingMode}get viewingMode(){return h(this.view.viewingMode)}get spatialReference(){return this.view.spatialReference}ensureOccludedFragmentOpacity(){return this.occludedFragmentOpacity??=new g({requestRender:()=>this.view.stage?.renderView.requestRender(2)}),this.occludedFragmentOpacity}get highlights(){const e=this.view.highlights.items.slice(0,f);for(let t=0;t<e.length;){const r=e[t],o=e.findIndex(e=>e.name===r.name);o>=0&&t>o?e.splice(t,1):++t}return e}get highlightOrderMap(){return new Map(this.highlights.map(({name:e},t)=>[e,t]))}get animationsEnabled(){return this.view.animationsEnabled&&!t()}get navigating(){return!!this.cameraController?.isInteractive}get stationary(){return!this._cameraChanged&&!this.navigating}get cameraController(){return this._get("cameraController")}set cameraController(e){this.stopActiveCameraController()?(this.removeHandles(P),this.cameraController?.destroy(),e&&(this.addHandles(i(()=>4===e.state||3===e.state,()=>{this.updateCamera(t=>{e.onControllerEnd(t),this.view.stateManager?.setCollisionSourceCamera(t),d(this.view,null,t,1)}),this.cameraController===e&&(this._set("cameraController",null),e.destroy())},{sync:!0,once:!0}),P),e.onControllerStart(this.camera),this.view.stateManager?.setCollisionSourceCamera(this.camera)),this._set("cameraController",e)):e&&(e.state=1)}switchCameraController(e){this.cameraController=e}stopActiveCameraController(){return!this.cameraController||this.cameraController.stopController()}updateCamera(e){this._updateQueue.push(e),this._processUpdateQueue()}_processUpdateQueue(){if(0===this._updateQueue.length||this._processingUpdates)return;this._processingUpdates=!0;const e=this._updateQueue.shift();x.copyFrom(this.camera),e(x),this.camera=x,this._processingUpdates=!1,this._processUpdateQueue()}static cleanupViewstate(){x=new C}};e([n({constructOnly:!0})],_.prototype,"view",void 0),e([n()],_.prototype,"mode",void 0),e([n({readOnly:!0,type:m})],_.prototype,"animation",null),e([n({type:C})],_.prototype,"cssCamera",null),e([n()],_.prototype,"_cssCamera",void 0),e([n({type:C})],_.prototype,"camera",null),e([n()],_.prototype,"_camera",void 0),e([n({readOnly:!0})],_.prototype,"pixelRatio",null),e([n()],_.prototype,"rasterPixelRatio",void 0),e([n()],_.prototype,"contentPixelRatio",void 0),e([n({readOnly:!0})],_.prototype,"alignPixelEnabled",null),e([n({readOnly:!0})],_.prototype,"updating",null),e([n({})],_.prototype,"_contentCamera",void 0),e([n({type:C})],_.prototype,"contentCamera",null),e([n({readOnly:!0})],_.prototype,"fixedContentCamera",null),e([n({readOnly:!0})],_.prototype,"events",void 0),e([n({readOnly:!0})],_.prototype,"isGlobal",null),e([n({readOnly:!0})],_.prototype,"isLocal",null),e([n({readOnly:!0})],_.prototype,"viewingMode",null),e([n()],_.prototype,"occludedFragmentOpacity",void 0),e([n({readOnly:!0})],_.prototype,"highlights",null),e([n({readOnly:!0})],_.prototype,"highlightOrderMap",null),e([n({readOnly:!0})],_.prototype,"navigating",null),e([n()],_.prototype,"fading",void 0),e([n({readOnly:!0})],_.prototype,"stationary",null),e([n()],_.prototype,"_cameraChanged",void 0),e([n()],_.prototype,"cameraController",null),_=e([s("esri.views.3d.state.ViewState")],_);const j=_;function O(e,t){return e.fov!==t.fov||(e.fullViewport[0]!==t.fullViewport[0]||e.fullViewport[1]!==t.fullViewport[1]||e.fullViewport[2]!==t.fullViewport[2]||e.fullViewport[3]!==t.fullViewport[3]||(e.padding[0]!==t.padding[0]||e.padding[1]!==t.padding[1]||e.padding[2]!==t.padding[2]||e.padding[3]!==t.padding[3]))}let x=new C;const P="ViewStateHandles";export{j as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import r from"../../../core/Accessor.js";import a from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{on as n,watch as o,sync as h,when as l}from"../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../core/scheduling.js";import{createScreenPoint as p}from"../../../core/screenUtils.js";import{Milliseconds as m}from"../../../core/time.js";import{property as d,subclass as v}from"../../../core/accessorSupport/decorators.js";import{runUntracked as u}from"../../../core/accessorSupport/tracking.js";import{squaredDistance as w}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as _}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import y from"../../../geometry/Extent.js";import C from"../../../geometry/Point.js";import x from"../../../geometry/Polygon.js";import{isLoadedOrLoadFor as R,requiresLoad as S}from"../../../geometry/projectionUtils.js";import{fromRenderCamera as P,toRenderCamera as O}from"../webgl.js";import{applyAll as b}from"../camera/constraintUtils.js";import{cameraOnContentAlongViewDirection as T,surfaceElevationBelowRenderLocation as j}from"../camera/intersectionUtils.js";import{ConstraintsManager as z}from"./ConstraintsManager.js";import{Frustum as M}from"./Frustum.js";import{GoToOperation as I}from"./GoToOperation.js";import{SurfaceCollisionCorrectionController as H}from"./controllers/SurfaceCollisionCorrectionController.js";import{toArea as V,toExtent as B,applyTiltAdjustToScale as L,scaleToZoom as D,fromExtentSync as E,getObserverForPointAtDistanceSync as U,viewScaleToCameraDistance as k,zoomToScale as A}from"../support/cameraUtils.js";import{fromCamera as F,toCameraSync as N}from"../support/viewpointUtils.js";import G from"../webgl/RenderCamera.js";import{PropertiesPool as q}from"../../support/PropertiesPool.js";import{ensureAttachmentMaxSize as W}from"../../webgl/FramebufferObject.js";let Z=class extends r{constructor(e){super(e),this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._idleTimeout=re,this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:e=>this._devicePixelRatioOverride=e,getDevicePixelRatioOverride:()=>this._devicePixelRatioOverride,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return null!=this.renderState},get idleTimeoutEnabled(){return this.viewStateManager._idleTimeout>0},set idleTimeoutEnabled(e){this.viewStateManager._idleTimeout=e?re:0}},this._propertiesPool=new q({frustum:()=>new M(null)},this),this._cameraSetByUser=!1,this._gotoOperation=null,this._cameraChangeTime=0,this._tmpCanvasSize=new J}initialize(){this._cameraChangeTime=performance.now(),this.addHandles([n(()=>this.view.state.events,"before-camera-change",({camera:e})=>e&&this._updateElevation(e)),o(()=>this.view.state?.camera,(e,t)=>this._cameraChangedHandler(e,t),h)]),l(()=>this.view.state?.camera,e=>this._updateElevation(e),{once:!0,sync:!0}),this.addHandles([c({prepare:e=>this._prepareFrame(e.time)}),o(()=>this.view.state.cameraController,()=>{this._cameraSetByUser=!0,this.removeHandles(te)}),n(()=>this.view.state.events,"camera-projection-changed",()=>this.notifyChange("scale"))])}destroy(){this.exit(),this._propertiesPool=s(this._propertiesPool)}get camera(){const e=this._get("camera");if(!this.ready)return e;const{view:t}=this,i=t.state.camera;return u(()=>{const r=P(t,i,Y);return r&&e&&r.equals(e)?e:r.clone()})}set camera(e){if(this._updatePropertyBeforeReady("camera",e))return;this.view.elevationProvider.enableCache(!0);const t=O(this.view,e);t?this.setStateCamera(t,{applyConstraints:!1})||a.getLogger(this).warnOnce("#camera=","There is a currently active camera controller that has priority."):a.getLogger(this).error("#camera=","Invalid camera",e),this.view.elevationProvider.enableCache(!1)}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const{view:t}=this,i=t.state.contentCamera;return u(()=>{const r=P(t,i,Y);return r&&e&&r.equals(e)?e:r.clone()})}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const t=O(this.view,e);this.view.state.contentCamera=null!=t?t:null}installContentCameraReset(e){if(this.removeHandles(ie),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const t=this.zoom,i=this.view.state.camera.distance**2,r=g(this.view.state.camera.center),a=e.sticky?this.contentCamera.clone():null;return this.addHandles([o(()=>this.contentCamera,()=>{e.sticky||(this.removeHandles(ie),this.test.contentCameraResetState.clear())}),o(()=>this.zoom,e=>{void 0!==e&&void 0!==t&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(e-t)/2),Math.abs(e-t)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a))}),o(()=>this.view.state.camera,e=>{const t=w(r,e.center);this.test.contentCameraResetState.set("camera.center",t/i),t>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)})],ie),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():a.getLogger(this).error("#center=","Invalid center",e):a.getLogger(this).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#center=","Center may not be null or undefined"))}get visibleArea(){if(!this.ready){const e=this._get("extent");return e?x.fromExtent(e):null}return V(this.view,this.view.pointsOfInterest.focus.renderLocation)}get extent(){if(!this.ready)return this._get("extent");const e=this.view,t=B(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return null!=t?t:this._get("extent")}set extent(e){this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#extent=","Invalid extent",e):a.getLogger(this).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this._propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get constraintsManager(){return this._constraintsManager}get _initialViewpoint(){const e=this.view.map;return e&&"initialViewProperties"in e?e.initialViewProperties?.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(!this.ready)return this._get("scale");const e=this.view.basemapTerrain.tilingScheme,t=this.view.pointsOfInterest.cameraOnSurface.scale;return e&&t?L(this.view,t,this.view.state.contentCamera,e):this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,t=e.padding,i=e.pixelRatio,r=this._get("padding"),a=Math.round(t[0]/i),s=Math.round(t[1]/i),n=Math.round(t[2]/i),o=Math.round(t[3]/i);return null!=r&&r.top===a&&r.right===s&&r.bottom===n&&r.left===o?r:{top:a,right:s,bottom:n,left:o}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,ee),this.view.state.updateCamera(e=>e.padding=ee))}_paddingToArray(e,t,i){e?_(i,e.top||0,e.right||0,e.bottom||0,e.left||0):_(i,0,0,0,0);for(let r=0;r<4;r++)i[r]=Math.round(i[r]*t)}get screenCenter(){const e=this.padding;return p((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?F(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){if(!this._updatePropertyBeforeReady("viewpoint",e))if(e){if(!this.isCompatible(e)){const t=null!=e.camera?e.camera.position:e.targetGeometry,i=null!=t&&t.spatialReference;return void a.getLogger(this).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(i?i.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e)}this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||a.getLogger(this).error("#viewpoint=","Invalid viewpoint",e)}else a.getLogger(this).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?D(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||void 0===e||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#zoom=","Invalid zoom",e)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;const e=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio),t=(this._useDevicePixelResolution()?this._windowDevicePixelRatio:e)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*t),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*t);const i=this.view.stage.renderView.renderingContext?.parameters.maxTextureSize;return i&&W(this._tmpCanvasSize,i),this._tmpCanvasSize.pixelRatio=this._tmpCanvasSize.width>0?this._tmpCanvasSize.width/this.view.surface.clientWidth*.5+this._tmpCanvasSize.height/this.view.surface.clientHeight*.5:t,this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)),this._tmpCanvasSize}get _rasterPixelRatio(){return null!=this._devicePixelRatioOverride?this._devicePixelRatioOverride:this._useDevicePixelResolution(2)?this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}_useDevicePixelResolution(e){return this.view?.stage?.renderer.isFeatureEnabled(8,e)??!1}preinit(e){return!(this._isOverridden("center")&&!R(this.center.spatialReference,e))&&(!(this._isOverridden("camera")&&!R(this.camera.position.spatialReference,e))&&(!(this._isOverridden("extent")&&!R(this.extent.spatialReference,e))&&!!(!this._isOverridden("viewpoint")||R(this.viewpoint.targetGeometry?.spatialReference,e)&&R(this.viewpoint.camera?.position?.spatialReference,e))))}init(){this._constraintsManager=new z({view:this.view}),this._prepareFrame(m(0));const e=this._getInitialProperties();this._cameraSetByUser=!1,this._set("ready",!0);for(const t of e)this.set(t.name,t.value);if(!this._cameraSetByUser){const e=this._initialViewpoint||this.view.initialExtent;e&&this.isCompatible(e)?this._setInitialView(e):2===this.view.state.viewingMode&&this.addHandles(l(()=>this.view.groundView.ready,()=>{this.removeHandles(te),this._setInitialView(this.view.dataExtent)},{once:!0,initial:!0}),te)}}exit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles(te),this._constraintsManager=s(this._constraintsManager))}async goTo(e,t){return t={animate:this.view.state.animationsEnabled,...t},null!=this._gotoOperation&&this._gotoOperation.abort(t.animate),this._gotoOperation=new I(e,t,this.view),this.view.resourceController.scheduler.stopFrame(),this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(T(this.view),{applyConstraints:!1})}step(e){const t=this.view.state?.cameraController;t?.stepController&&this.view.state.updateCamera(i=>t.stepController(e,i))}_cancelGoToOperation(){null!=this._gotoOperation&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const e=new Set,t=[];for(const{propertyName:i,overrides:r}of Q){const a=e.has(i),s=this._isOverridden(i);!a&&s&&t.push({name:i,value:this._get(i)}),this._clearOverride(i),(a||s)&&r.forEach(t=>e.add(t))}return t}_setInitialView(e){if(null==e||this._cameraSetByUser)return;if(e instanceof t)return void this.setStateCamera(O(this.view,e),{applyConstraints:!1});if(e instanceof i){if(e.targetGeometry instanceof y){const t=E(this.view,e.targetGeometry,0,.5,0);return void(null!=t&&this.setStateCamera(O(this.view,t),{applyConstraints:!0}))}const t={applyConstraints:!e.camera},i=this._viewpointToCamera(e);return void this.setStateCamera(i,t)}const r=E(this.view,e,0,.5,0);null!=r&&this.setStateCamera(O(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,t){return!this.ready&&(this._override(e,t),t&&K.has(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return null!=e&&(e instanceof i?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof t?this.isCompatible(e.position):e.spatialReference&&!S(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=X){return this._cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,t,i=$){const{heading:r,tilt:a}=this._getPreservingHeadingTilt(),s=U(this.view,r,a,e,t,1);return null==s?null:(i.copyFrom(this.view.state.camera),i.eye=s.eye,i.center=s.center,i.up=s.up,i)}_centerToCamera(e){let t;if(e.hasZ)t=this.view.state.camera.distance;else{const{centerOnContent:e}=this.view.pointsOfInterest;e.runTask(),t=e.distance}return this._centerPointAtDistanceToCamera(e,t)}_extentToCamera(e){const{heading:t,tilt:i}=this._getPreservingHeadingTilt(),r=E(this.view,e,t,i,1,Y);return r?O(this.view,r):null}_scaleToCamera(e){if(null==e)return null;const t=this.view,i=t.pointsOfInterest.centerOnContent;i.runTask();const r=i.renderLocation,a=t.pointsOfInterest.cameraOnSurface.renderLocation,s=k(t,e,r,a);return this._centerPointAtDistanceToCamera(r,s)}_zoomToCamera(e){return this._scaleToCamera(A(this.view,e))}_viewpointToCamera(e){return O(this.view,N(this.view,e))}setStateCamera(e,t){return!(null==e||!this.view.state.stopActiveCameraController())&&(this._cameraSetByUser=!0,t.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera(i=>{t.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up,i.fov=e.fov):i.copyFrom(e),t.applyConstraints&&b(this.view,i)}),t.applyConstraints||(this.view.state.cameraController=new H({view:this.view,desiredCamera:e})),!0)}_prepareFrame(e){const{surface:t,canvas:i,stage:r}=this.view;if(!t||!i||!r||r.destroyed||r.destroying)return;this._windowDevicePixelRatio=window.devicePixelRatio;const a=this._computeCanvasSize();if(0!==a.width&&0!==a.height&&(i.width===a.width&&i.height===a.height||(i.width=a.width,i.height=a.height),this.view.state)){const t=this.view.state.camera;t.fullWidth===a.width&&t.fullHeight===a.height&&t.pixelRatio===a.pixelRatio||($.copyFrom(t),$.pixelRatio!==a.pixelRatio&&(this._paddingToArray(this.padding,a.pixelRatio,ee),$.padding=ee),$.fullWidth=a.width,$.fullHeight=a.height,$.pixelRatio=a.pixelRatio,this.view.state.camera=$),this._updateState(),this.view.state.occludedFragmentOpacity?.update(this.view,this.view.state.mode,e)}}_updateElevation(e){const t=this.view.renderCoordsHelper?.getAltitude(e.eye)??0,i=this.view.basemapTerrain?.spatialReference,r=i?j(this.view,e.eye):0;e.relativeElevation=t-r}_updateState(){null!=this.test.renderState?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=0:this.view.interacting?this.view.state.mode=1:(0===this.view.state.mode&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime<this._idleTimeout?this.view.state.mode=1:this.view.state.mode=2),this.view.state.rasterPixelRatio=this._rasterPixelRatio}_cameraChangedHandler(e,t){e&&t&&e.almostEquals(t)||(this._cameraChangeTime=performance.now(),this._updateState())}};e([d({type:t})],Z.prototype,"camera",null),e([d({type:t})],Z.prototype,"contentCamera",null),e([d({type:C})],Z.prototype,"center",null),e([d()],Z.prototype,"visibleArea",null),e([d({type:y})],Z.prototype,"extent",null),e([d({readOnly:!0})],Z.prototype,"frustum",null),e([d()],Z.prototype,"_constraintsManager",void 0),e([d({readOnly:!0})],Z.prototype,"constraintsManager",null),e([d()],Z.prototype,"_initialViewpoint",null),e([d({readOnly:!0})],Z.prototype,"hasInitialView",null),e([d({readOnly:!0,type:Boolean})],Z.prototype,"ready",void 0),e([d({type:Number})],Z.prototype,"scale",null),e([d()],Z.prototype,"padding",null),e([d({readOnly:!0})],Z.prototype,"screenCenter",null),e([d({constructOnly:!0})],Z.prototype,"view",void 0),e([d({type:i})],Z.prototype,"viewpoint",null),e([d({type:Number})],Z.prototype,"zoom",null),e([d({readOnly:!0})],Z.prototype,"_rasterPixelRatio",null),e([d({readOnly:!0})],Z.prototype,"_useDevicePixelResolution",null),e([d()],Z.prototype,"_windowDevicePixelRatio",void 0),e([d()],Z.prototype,"_devicePixelRatioOverride",void 0),Z=e([v("esri.views.3d.state.ViewStateManager")],Z);class J{constructor(){this.width=0,this.height=0,this.pixelRatio=1}}const K=new Set(["camera","viewpoint","extent","scale","center","zoom"]),Q=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],X={heading:0,tilt:0};let Y=new t,$=new G;const ee=f(),te="pending-initial-view",ie="content-camera-reset",re=300,ae=100;function se(){Y=new t,$=new G}export{Z as ViewStateManager,se as cleanupViewStateManager,ae as interactingTimeout};
2
+ import{__decorate as e}from"tslib";import t from"../../../Camera.js";import i from"../../../Viewpoint.js";import r from"../../../core/Accessor.js";import a from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{on as n,watch as o,sync as h,when as l}from"../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../core/scheduling.js";import{createScreenPoint as p}from"../../../core/screenUtils.js";import{Milliseconds as m}from"../../../core/time.js";import{property as d,subclass as v}from"../../../core/accessorSupport/decorators.js";import{runUntracked as u}from"../../../core/accessorSupport/tracking.js";import{squaredDistance as w}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{fromArray as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as _}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import y from"../../../geometry/Extent.js";import C from"../../../geometry/Point.js";import x from"../../../geometry/Polygon.js";import{isLoadedOrLoadFor as R,requiresLoad as S}from"../../../geometry/projectionUtils.js";import{fromRenderCamera as P,toRenderCamera as O}from"../webgl.js";import{applyAll as b}from"../camera/constraintUtils.js";import{cameraOnContentAlongViewDirection as T,surfaceElevationBelowRenderLocation as j}from"../camera/intersectionUtils.js";import{ConstraintsManager as z}from"./ConstraintsManager.js";import{Frustum as M}from"./Frustum.js";import{GoToOperation as I}from"./GoToOperation.js";import{toArea as H,toExtent as V,applyTiltAdjustToScale as B,scaleToZoom as L,fromExtentSync as D,getObserverForPointAtDistanceSync as E,viewScaleToCameraDistance as U,zoomToScale as k}from"../support/cameraUtils.js";import{fromCamera as A,toCameraSync as F}from"../support/viewpointUtils.js";import N from"../webgl/RenderCamera.js";import{PropertiesPool as G}from"../../support/PropertiesPool.js";import{ensureAttachmentMaxSize as q}from"../../webgl/FramebufferObject.js";let W=class extends r{constructor(e){super(e),this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._idleTimeout=ie,this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:e=>this._devicePixelRatioOverride=e,getDevicePixelRatioOverride:()=>this._devicePixelRatioOverride,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return null!=this.renderState},get idleTimeoutEnabled(){return this.viewStateManager._idleTimeout>0},set idleTimeoutEnabled(e){this.viewStateManager._idleTimeout=e?ie:0}},this._propertiesPool=new G({frustum:()=>new M(null)},this),this._cameraSetByUser=!1,this._gotoOperation=null,this._cameraChangeTime=0,this._tmpCanvasSize=new Z}initialize(){this._cameraChangeTime=performance.now(),this.addHandles([n(()=>this.view.state.events,"before-camera-change",({camera:e})=>e&&this._updateElevation(e)),o(()=>this.view.state?.camera,(e,t)=>this._cameraChangedHandler(e,t),h)]),l(()=>this.view.state?.camera,e=>this._updateElevation(e),{once:!0,sync:!0}),this.addHandles([c({prepare:e=>this._prepareFrame(e.time)}),o(()=>this.view.state.cameraController,()=>{this._cameraSetByUser=!0,this.removeHandles(ee)}),n(()=>this.view.state.events,"camera-projection-changed",()=>this.notifyChange("scale"))])}destroy(){this.exit(),this._propertiesPool=s(this._propertiesPool)}get camera(){const e=this._get("camera");if(!this.ready)return e;const{view:t}=this,i=t.state.camera;return u(()=>{const r=P(t,i,X);return r&&e&&r.equals(e)?e:r.clone()})}set camera(e){if(this._updatePropertyBeforeReady("camera",e))return;this.view.elevationProvider.enableCache(!0);const t=O(this.view,e);t?this.setStateCamera(t,{applyConstraints:!1})||a.getLogger(this).warnOnce("#camera=","There is a currently active camera controller that has priority."):a.getLogger(this).error("#camera=","Invalid camera",e),this.view.elevationProvider.enableCache(!1)}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const{view:t}=this,i=t.state.contentCamera;return u(()=>{const r=P(t,i,X);return r&&e&&r.equals(e)?e:r.clone()})}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const t=O(this.view,e);this.view.state.contentCamera=null!=t?t:null}installContentCameraReset(e){if(this.removeHandles(te),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const t=this.zoom,i=this.view.state.camera.distance**2,r=g(this.view.state.camera.center),a=e.sticky?this.contentCamera.clone():null;return this.addHandles([o(()=>this.contentCamera,()=>{e.sticky||(this.removeHandles(te),this.test.contentCameraResetState.clear())}),o(()=>this.zoom,e=>{void 0!==e&&void 0!==t&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(e-t)/2),Math.abs(e-t)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a))}),o(()=>this.view.state.camera,e=>{const t=w(r,e.center);this.test.contentCameraResetState.set("camera.center",t/i),t>i?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=a)})],te),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():a.getLogger(this).error("#center=","Invalid center",e):a.getLogger(this).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#center=","Center may not be null or undefined"))}get visibleArea(){if(!this.ready){const e=this._get("extent");return e?x.fromExtent(e):null}return H(this.view,this.view.pointsOfInterest.focus.renderLocation)}get extent(){if(!this.ready)return this._get("extent");const e=this.view,t=V(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return null!=t?t:this._get("extent")}set extent(e){this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#extent=","Invalid extent",e):a.getLogger(this).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e):a.getLogger(this).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this._propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get constraintsManager(){return this._constraintsManager}get _initialViewpoint(){const e=this.view.map;return e&&"initialViewProperties"in e?e.initialViewProperties?.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(!this.ready)return this._get("scale");const e=this.view.basemapTerrain.tilingScheme,t=this.view.pointsOfInterest.cameraOnSurface.scale;return e&&t?B(this.view,t,this.view.state.contentCamera,e):this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,t=e.padding,i=e.pixelRatio,r=this._get("padding"),a=Math.round(t[0]/i),s=Math.round(t[1]/i),n=Math.round(t[2]/i),o=Math.round(t[3]/i);return null!=r&&r.top===a&&r.right===s&&r.bottom===n&&r.left===o?r:{top:a,right:s,bottom:n,left:o}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,$),this.view.state.updateCamera(e=>e.padding=$))}_paddingToArray(e,t,i){e?_(i,e.top||0,e.right||0,e.bottom||0,e.left||0):_(i,0,0,0,0);for(let r=0;r<4;r++)i[r]=Math.round(i[r]*t)}get screenCenter(){const e=this.padding;return p((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?A(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){if(!this._updatePropertyBeforeReady("viewpoint",e))if(e){if(!this.isCompatible(e)){const t=null!=e.camera?e.camera.position:e.targetGeometry,i=null!=t&&t.spatialReference;return void a.getLogger(this).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(i?i.wkid:"none")+", view: "+this.view.spatialReference?.wkid+")",e)}this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||a.getLogger(this).error("#viewpoint=","Invalid viewpoint",e)}else a.getLogger(this).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?L(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||void 0===e||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||a.getLogger(this).error("#zoom=","Invalid zoom",e)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;const e=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio),t=(this._useDevicePixelResolution()?this._windowDevicePixelRatio:e)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*t),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*t);const i=this.view.stage.renderView.renderingContext?.parameters.maxTextureSize;return i&&q(this._tmpCanvasSize,i),this._tmpCanvasSize.pixelRatio=this._tmpCanvasSize.width>0?this._tmpCanvasSize.width/this.view.surface.clientWidth*.5+this._tmpCanvasSize.height/this.view.surface.clientHeight*.5:t,this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)),this._tmpCanvasSize}get _rasterPixelRatio(){return null!=this._devicePixelRatioOverride?this._devicePixelRatioOverride:this._useDevicePixelResolution(2)?this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}_useDevicePixelResolution(e){return this.view?.stage?.renderer.isFeatureEnabled(8,e)??!1}preinit(e){return!(this._isOverridden("center")&&!R(this.center.spatialReference,e))&&(!(this._isOverridden("camera")&&!R(this.camera.position.spatialReference,e))&&(!(this._isOverridden("extent")&&!R(this.extent.spatialReference,e))&&!!(!this._isOverridden("viewpoint")||R(this.viewpoint.targetGeometry?.spatialReference,e)&&R(this.viewpoint.camera?.position?.spatialReference,e))))}init(){this._constraintsManager=new z({view:this.view}),this._prepareFrame(m(0));const e=this._getInitialProperties();this._cameraSetByUser=!1,this._set("ready",!0);for(const t of e)this.set(t.name,t.value);if(!this._cameraSetByUser){const e=this._initialViewpoint||this.view.initialExtent;e&&this.isCompatible(e)?this._setInitialView(e):2===this.view.state.viewingMode&&this.addHandles(l(()=>this.view.groundView.ready,()=>{this.removeHandles(ee),this._setInitialView(this.view.dataExtent)},{once:!0,initial:!0}),ee)}}exit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles(ee),this._constraintsManager=s(this._constraintsManager))}async goTo(e,t){return t={animate:this.view.state.animationsEnabled,...t},null!=this._gotoOperation&&this._gotoOperation.abort(t.animate),this._gotoOperation=new I(e,t,this.view),this.view.resourceController.scheduler.stopFrame(),this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(T(this.view),{applyConstraints:!1})}step(e){const t=this.view.state?.cameraController;t?.stepController&&this.view.state.updateCamera(i=>t.stepController(e,i))}_cancelGoToOperation(){null!=this._gotoOperation&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const e=new Set,t=[];for(const{propertyName:i,overrides:r}of K){const a=e.has(i),s=this._isOverridden(i);!a&&s&&t.push({name:i,value:this._get(i)}),this._clearOverride(i),(a||s)&&r.forEach(t=>e.add(t))}return t}_setInitialView(e){if(null==e||this._cameraSetByUser)return;if(e instanceof t)return void this.setStateCamera(O(this.view,e),{applyConstraints:!1});if(e instanceof i){if(e.targetGeometry instanceof y){const t=D(this.view,e.targetGeometry,0,.5,0);return void(null!=t&&this.setStateCamera(O(this.view,t),{applyConstraints:!0}))}const t={applyConstraints:!e.camera},i=this._viewpointToCamera(e);return void this.setStateCamera(i,t)}const r=D(this.view,e,0,.5,0);null!=r&&this.setStateCamera(O(this.view,r),{applyConstraints:!0})}_updatePropertyBeforeReady(e,t){return!this.ready&&(this._override(e,t),t&&J.has(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return null!=e&&(e instanceof i?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof t?this.isCompatible(e.position):e.spatialReference&&!S(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=Q){return this._cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,t,i=Y){const{heading:r,tilt:a}=this._getPreservingHeadingTilt(),s=E(this.view,r,a,e,t,1);return null==s?null:(i.copyFrom(this.view.state.camera),i.eye=s.eye,i.center=s.center,i.up=s.up,i)}_centerToCamera(e){let t;if(e.hasZ)t=this.view.state.camera.distance;else{const{centerOnContent:e}=this.view.pointsOfInterest;e.runTask(),t=e.distance}return this._centerPointAtDistanceToCamera(e,t)}_extentToCamera(e){const{heading:t,tilt:i}=this._getPreservingHeadingTilt(),r=D(this.view,e,t,i,1,X);return r?O(this.view,r):null}_scaleToCamera(e){if(null==e)return null;const t=this.view,i=t.pointsOfInterest.centerOnContent;i.runTask();const r=i.renderLocation,a=t.pointsOfInterest.cameraOnSurface.renderLocation,s=U(t,e,r,a);return this._centerPointAtDistanceToCamera(r,s)}_zoomToCamera(e){return this._scaleToCamera(k(this.view,e))}_viewpointToCamera(e){return O(this.view,F(this.view,e))}setStateCamera(e,t){return!(null==e||!this.view.state.stopActiveCameraController())&&(this._cameraSetByUser=!0,t.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera(i=>{t.positionAndOrientationOnly?(i.eye=e.eye,i.center=e.center,i.up=e.up,i.fov=e.fov):i.copyFrom(e),t.applyConstraints&&b(this.view,i),this.setCollisionSourceCamera(i)}),!0)}setCollisionSourceCamera(e){this._constraintsManager?.surfaceCollisionConstraint.setSourceCamera(e)}_prepareFrame(e){const{surface:t,canvas:i,stage:r}=this.view;if(!t||!i||!r||r.destroyed||r.destroying)return;this._windowDevicePixelRatio=window.devicePixelRatio;const a=this._computeCanvasSize();if(0!==a.width&&0!==a.height&&(i.width===a.width&&i.height===a.height||(i.width=a.width,i.height=a.height),this.view.state)){const t=this.view.state.camera;t.fullWidth===a.width&&t.fullHeight===a.height&&t.pixelRatio===a.pixelRatio||(Y.copyFrom(t),Y.pixelRatio!==a.pixelRatio&&(this._paddingToArray(this.padding,a.pixelRatio,$),Y.padding=$),Y.fullWidth=a.width,Y.fullHeight=a.height,Y.pixelRatio=a.pixelRatio,this.view.state.camera=Y),this._updateState(),this.view.state.occludedFragmentOpacity?.update(this.view,this.view.state.mode,e)}}_updateElevation(e){const t=this.view.renderCoordsHelper?.getAltitude(e.eye)??0,i=this.view.basemapTerrain?.spatialReference,r=i?j(this.view,e.eye):0;e.relativeElevation=t-r}_updateState(){null!=this.test.renderState?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=0:this.view.interacting?this.view.state.mode=1:(0===this.view.state.mode&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTime<this._idleTimeout?this.view.state.mode=1:this.view.state.mode=2),this.view.state.rasterPixelRatio=this._rasterPixelRatio}_cameraChangedHandler(e,t){e&&t&&e.almostEquals(t)||(this._cameraChangeTime=performance.now(),this._updateState())}};e([d({type:t})],W.prototype,"camera",null),e([d({type:t})],W.prototype,"contentCamera",null),e([d({type:C})],W.prototype,"center",null),e([d()],W.prototype,"visibleArea",null),e([d({type:y})],W.prototype,"extent",null),e([d({readOnly:!0})],W.prototype,"frustum",null),e([d()],W.prototype,"_constraintsManager",void 0),e([d({readOnly:!0})],W.prototype,"constraintsManager",null),e([d()],W.prototype,"_initialViewpoint",null),e([d({readOnly:!0})],W.prototype,"hasInitialView",null),e([d({readOnly:!0,type:Boolean})],W.prototype,"ready",void 0),e([d({type:Number})],W.prototype,"scale",null),e([d()],W.prototype,"padding",null),e([d({readOnly:!0})],W.prototype,"screenCenter",null),e([d({constructOnly:!0})],W.prototype,"view",void 0),e([d({type:i})],W.prototype,"viewpoint",null),e([d({type:Number})],W.prototype,"zoom",null),e([d({readOnly:!0})],W.prototype,"_rasterPixelRatio",null),e([d({readOnly:!0})],W.prototype,"_useDevicePixelResolution",null),e([d()],W.prototype,"_windowDevicePixelRatio",void 0),e([d()],W.prototype,"_devicePixelRatioOverride",void 0),W=e([v("esri.views.3d.state.ViewStateManager")],W);class Z{constructor(){this.width=0,this.height=0,this.pixelRatio=1}}const J=new Set(["camera","viewpoint","extent","scale","center","zoom"]),K=[{propertyName:"camera",overrides:["viewpoint"]},{propertyName:"viewpoint",overrides:["extent"]},{propertyName:"extent",overrides:["center","scale"]},{propertyName:"center",overrides:[]},{propertyName:"scale",overrides:["zoom"]},{propertyName:"zoom",overrides:[]},{propertyName:"padding",overrides:[]}],Q={heading:0,tilt:0};let X=new t,Y=new N;const $=f(),ee="pending-initial-view",te="content-camera-reset",ie=300,re=100;function ae(){X=new t,Y=new N}export{W as ViewStateManager,ae as cleanupViewStateManager,re as interactingTimeout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as i}from"tslib";import{property as t,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import o from"../../../ViewAnimation.js";import{Animation as s}from"../../animation/pointToPoint/Animation.js";import{AnimationController as r}from"./AnimationController.js";import a from"../../webgl/RenderCamera.js";import{Intersector as m}from"../../webgl-engine/lib/Intersector.js";import{EasingFunctions as c}from"../../../animation/easing.js";let l=class extends r{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(i){super(i),this.type="point-to-point",this.mode="interaction"}initialize(){this.animation=new s(this.view.state.viewingMode),this.viewAnimation="interaction"===this.mode?null:new o}get isInteractive(){return"interaction"===this.mode}begin(i,t){this.stepController=(i,t)=>{this.animation.step(i,t),this.animation.finished&&this.finishController()};const n=this.animationSettings(t);p.copyFrom(this.view.state.camera);const e=new m(this.view.state.viewingMode);this._intersectionHelper.intersectRay(p.ray,e,h)&&(p.center=h),this.animation.update(p,i,n),this.animation.finished&&this.finish()}finish(){this.animation.currentTime=this.animation.time,super.finish()}onControllerEnd(i){this.stepController&&(this.animation.cameraAt(this.animation.currentTime/this.animation.time,i),this.animation.currentTime=this.animation.time),super.onControllerEnd(i),this.stepController=void 0}animationSettings(i={}){return{apex:{maximumDistance:this.view.state.constraints.clampAltitude(1/0)/6,ascensionFactor:void 0,descensionFactor:void 0},...i,easing:"string"==typeof i.easing?c[i.easing]:i.easing}}};i([t({constructOnly:!0})],l.prototype,"mode",void 0),i([t({readOnly:!0})],l.prototype,"isInteractive",null),l=i([n("esri.views.3d.state.controllers.PointToPointAnimationController")],l);let p=new a;const h=e();function d(){p=new a}function u(i){return null!=i&&"type"in i&&"point-to-point"===i.type}export{l as PointToPointAnimationController,d as cleanupPointToPointAnimationController,u as isPointToPointAnimationController};
2
+ import{__decorate as t}from"tslib";import{property as i,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import o from"../../../ViewAnimation.js";import{Animation as r}from"../../animation/pointToPoint/Animation.js";import{AnimationController as s}from"./AnimationController.js";import a from"../../webgl/RenderCamera.js";import{Intersector as m}from"../../webgl-engine/lib/Intersector.js";import{EasingFunctions as c}from"../../../animation/easing.js";let l=class extends s{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(t){super(t),this.type="point-to-point",this.mode="interaction",this._target=null}initialize(){this.animation=new r(this.view.state.viewingMode),this.viewAnimation="interaction"===this.mode?null:new o}get isInteractive(){return"interaction"===this.mode}begin(t,i){this._target=t.clone(),this.stepController=(t,i)=>{this.animation.step(t,i),this.animation.finished&&this.finishController()};const n=this.animationSettings(i);h.copyFrom(this.view.state.camera);const e=new m(this.view.state.viewingMode);this._intersectionHelper.intersectRay(h.ray,e,p)&&(h.center=p),this.animation.update(h,t,n),this.animation.finished&&this.finish()}finish(){this.animation.currentTime=this.animation.time,super.finish()}onControllerEnd(t){if(this.stepController){this.animation.currentTime/this.animation.time>=1&&this._target?t.copyFrom(this._target):this.animation.cameraAt(this.animation.currentTime/this.animation.time,t),this.animation.currentTime=this.animation.time}super.onControllerEnd(t),this.stepController=void 0}animationSettings(t={}){return{apex:{maximumDistance:this.view.state.constraints.clampAltitude(1/0)/6,ascensionFactor:void 0,descensionFactor:void 0},...t,easing:"string"==typeof t.easing?c[t.easing]:t.easing}}};t([i({constructOnly:!0})],l.prototype,"mode",void 0),t([i({readOnly:!0})],l.prototype,"isInteractive",null),l=t([n("esri.views.3d.state.controllers.PointToPointAnimationController")],l);let h=new a;const p=e();function u(){h=new a}function d(t){return null!=t&&"type"in t&&"point-to-point"===t.type}export{l as PointToPointAnimationController,u as cleanupPointToPointAnimationController,d as isPointToPointAnimationController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{subclass as e}from"../../../../core/accessorSupport/decorators.js";import{copy as s,distance as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{normalize as o,subtract as h,length as c,scale as m,add as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as l}from"../../../../geometry/ellipsoidUtils.js";import{create as u,fromPoints as P}from"../../../../geometry/support/axisAngle.js";import{Sphere as y}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as C,applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as d}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as f}from"../../camera/constraintUtils/surfaceCollision.js";import{InteractiveController as v}from"./InteractiveController.js";import{normalizeCoordinate as R,pickPointAndInitSphere as w,excludeTerrain as D,inferNavigationMode as k,zoomPivotDistanceClamp as j,getTiltScaleFactor as A,pivotSearchAreaSize as b,distanceComparisonTolerance as x,sphereOrPlanePointFromScreenPoint as M,applyRotation as O,maxZoomPivotDistanceModifier as U}from"../utils/navigationUtils.js";import{fromScreenAtEye as z}from"../../support/geometryUtils/ray.js";const H=12;let B=class extends v{constructor(){super(...arguments),this._pickPoint=_(),this._tmpP0=a(),this._panAxisAngle=u(),this._tmpRayDir=_(),this._tmpRayDirPick=_(),this._targetOnSphere=_(),this._navigationMode=1,this._tmpRay={origin:_(),direction:_()},this.dragBeginPoint=r(),this._normalizedAnchorPoint=a(),this._constraintOptions=new d(7,1,0,this.startCamera),this._sphere=new y,this._hasPickPoint=!1}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;s(this.dragBeginPoint,t),R(this.startCamera,t,this._normalizedAnchorPoint);const r=l(this.view.spatialReference),e=w(this._intersectionHelper,this.startCamera,t,r.radius,0,this.view.basemapTerrain.invisible?D:{});if(this._navigationMode=k(this.startCamera,t,this.view.renderCoordsHelper,this.view.viewingMode),1===this._navigationMode)this._hasPickPoint=!!e.scenePickPoint,this._pickPoint=e.scenePickPoint??this._pickPoint,this._sphere=e.sphere;else{let r;z(this.startCamera,t,this._tmpRay),o(this._tmpRay.direction,this._tmpRay.direction),null!=e.scenePickPoint&&(h(this._tmpRayDirPick,this.startCamera.eye,e.scenePickPoint),r=c(this._tmpRayDirPick));const s=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,F);const n=i(A(F,this._tmpRay.direction,U)*s,j[0],j[1]),a=this.view.stage.renderView.getMinimalDepthForArea(null,t[0],t[1],this.view.state.camera,b);let _=null!=a?a:n;null!=r&&(_=Math.min(_,r)),this._hasPickPoint=!0,m(this._tmpRay.direction,this._tmpRay.direction,_),p(this._pickPoint,this._tmpRay.origin,this._tmpRay.direction)}}update(t){if(this.running){if(this.currentCamera.eye=this.startCamera.eye,this.currentCamera.center=this.startCamera.center,this.currentCamera.up=this.startCamera.up,1===this._navigationMode){h(this._tmpRayDir,this.currentCamera.center,this.currentCamera.eye);const i=c(this._tmpRayDir);R(this.currentCamera,t,this._tmpP0);const r=(this._normalizedAnchorPoint[1]-this._tmpP0[1])*H;let e=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&e<s&&(e=s),Math.abs(i-e)<x)return;if(this._hasPickPoint&&e<i){const t=1-(1-e/i)*(1-this._sphere.radius/c(this.currentCamera.center));this.currentCamera.center=m(S,this.currentCamera.center,t)}m(this._tmpRayDir,this._tmpRayDir,-e/i),this.currentCamera.eye=p(S,this.currentCamera.center,this._tmpRayDir),this._constraintOptions.interactionFactor=C(n(this.dragBeginPoint,t)),g(this.view,this.currentCamera,this._constraintOptions),this._hasPickPoint&&(M(this._sphere,this.currentCamera,this.dragBeginPoint,this._targetOnSphere),P(this._pickPoint,this._targetOnSphere,this._panAxisAngle),O(this.currentCamera,this._sphere.center,this._panAxisAngle))}else{const i=c(this._tmpRay.direction);R(this.currentCamera,t,this._tmpP0);const r=(this._normalizedAnchorPoint[1]-this._tmpP0[1])*H;let e=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&e<s&&(e=s),Math.abs(i-e)<x)return;m(this._tmpRayDir,this._tmpRay.direction,1-e/i),this.currentCamera.eye=p(S,this.currentCamera.eye,this._tmpRayDir),this.currentCamera.center=p(S,this.currentCamera.center,this._tmpRayDir),o(this._tmpRayDir,this._tmpRayDir),this._constraintOptions.interactionDirection=this._tmpRayDir,g(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}f(this.view,this.currentCamera),this.commitCamera()}}finish(){this.running&&this.finishController()}};B=t([e("esri.views.3d.state.controllers.ZoomControllerGlobal")],B);const S=_(),F=_();export{B as ZoomControllerGlobal};
2
+ import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{subclass as e}from"../../../../core/accessorSupport/decorators.js";import{copy as s,distance as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{normalize as o,subtract as h,length as c,scale as m,add as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import{create as u,fromPoints as P}from"../../../../geometry/support/axisAngle.js";import{Sphere as y}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as C,applyAll as g}from"../../camera/constraintUtils.js";import{ConstraintOptions as d}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as f}from"../../camera/constraintUtils/surfaceCollision.js";import{InteractiveController as v}from"./InteractiveController.js";import{normalizeCoordinate as R,pickPointAndInitSphere as w,excludeTerrain as D,inferNavigationMode as k,zoomPivotDistanceClamp as j,getTiltScaleFactor as A,pivotSearchAreaSize as b,distanceComparisonTolerance as x,sphereOrPlanePointFromScreenPoint as M,applyRotation as O,maxZoomPivotDistanceModifier as U}from"../utils/navigationUtils.js";import{fromScreenAtEye as z}from"../../support/geometryUtils/ray.js";const H=12;let B=class extends v{constructor(){super(...arguments),this._pickPoint=l(),this._tmpP0=a(),this._panAxisAngle=u(),this._tmpRayDir=l(),this._tmpRayDirPick=l(),this._targetOnSphere=l(),this._navigationMode=1,this._tmpRay={origin:l(),direction:l()},this.dragBeginPoint=r(),this._normalizedAnchorPoint=a(),this._constraintOptions=new d(7,1,0,this.startCamera),this._sphere=new y,this._hasPickPoint=!1}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(t){if(!this.running)return;s(this.dragBeginPoint,t),R(this.startCamera,t,this._normalizedAnchorPoint);const r=_(this.view.spatialReference),e=w(this._intersectionHelper,this.startCamera,t,r.radius,0,this.view.basemapTerrain.invisible?D:{});if(this._navigationMode=k(this.startCamera,t,this.view.renderCoordsHelper,this.view.viewingMode),1===this._navigationMode)this._hasPickPoint=!!e.scenePickPoint,this._pickPoint=e.scenePickPoint??this._pickPoint,this._sphere=e.sphere;else{let r;z(this.startCamera,t,this._tmpRay),o(this._tmpRay.direction,this._tmpRay.direction),null!=e.scenePickPoint&&(h(this._tmpRayDirPick,this.startCamera.eye,e.scenePickPoint),r=c(this._tmpRayDirPick));const s=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,F);const n=i(A(F,this._tmpRay.direction,U)*s,j[0],j[1]),a=this.view.stage.renderView.getMinimalDepthForArea(null,t[0],t[1],this.view.state.camera,b);let l=null!=a?a:n;null!=r&&(l=Math.min(l,r)),this._hasPickPoint=!0,m(this._tmpRay.direction,this._tmpRay.direction,l),p(this._pickPoint,this._tmpRay.origin,this._tmpRay.direction)}}update(t){if(this.running){if(this.currentCamera.eye=this.startCamera.eye,this.currentCamera.center=this.startCamera.center,this.currentCamera.up=this.startCamera.up,1===this._navigationMode){h(this._tmpRayDir,this.currentCamera.center,this.currentCamera.eye);const i=c(this._tmpRayDir);R(this.currentCamera,t,this._tmpP0);const r=(this._normalizedAnchorPoint[1]-this._tmpP0[1])*H;let e=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&e<s&&(e=s),Math.abs(i-e)<x)return;if(this._hasPickPoint&&e<i){const t=1-(1-e/i)*(1-this._sphere.radius/c(this.currentCamera.center));this.currentCamera.center=m(S,this.currentCamera.center,t)}m(this._tmpRayDir,this._tmpRayDir,-e/i),this.currentCamera.eye=p(S,this.currentCamera.center,this._tmpRayDir),this._constraintOptions.interactionFactor=C(n(this.dragBeginPoint,t)),g(this.view,this.currentCamera,this._constraintOptions),this._hasPickPoint&&(M(this._sphere,this.currentCamera,this.dragBeginPoint,this._targetOnSphere),P(this._pickPoint,this._targetOnSphere,this._panAxisAngle),O(this.currentCamera,this._sphere.center,this._panAxisAngle))}else{const i=c(this._tmpRay.direction);R(this.currentCamera,t,this._tmpP0);const r=(this._normalizedAnchorPoint[1]-this._tmpP0[1])*H;let e=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&e<s&&(e=s),Math.abs(i-e)<x)return;m(this._tmpRayDir,this._tmpRay.direction,1-e/i),this.currentCamera.eye=p(S,this.currentCamera.eye,this._tmpRayDir),this.currentCamera.center=p(S,this.currentCamera.center,this._tmpRayDir),o(this._tmpRayDir,this._tmpRayDir),this._constraintOptions.interactionDirection=this._tmpRayDir,g(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}f(this.view,null,this.currentCamera),this.commitCamera()}}finish(){this.running&&this.finishController()}};B=t([e("esri.views.3d.state.controllers.ZoomControllerGlobal")],B);const S=l(),F=l();export{B as ZoomControllerGlobal};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{copy as s,normalize as o,scale as a,length as n,subtract as m,add as h,squaredDistance as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import{create as l}from"../../../../geometry/support/ray.js";import{Sphere as y}from"../../../../geometry/support/sphere.js";import{applyAll as d}from"../../camera/constraintUtils.js";import{ConstraintOptions as w}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as g}from"../../camera/constraintUtils/surfaceCollision.js";import{PointToPointAnimationController as f}from"./PointToPointAnimationController.js";import{excludeTerrain as u,isHitOnSamePlanetSide as D,inferNavigationMode as C,zoomStepDistanceClamp as v,getTiltScaleFactor as R,maxZoomStepDistanceModifier as j,distanceComparisonTolerance as b,panToPosition as M}from"../utils/navigationUtils.js";import{fromScreenAtEye as z}from"../../support/geometryUtils/ray.js";import{intersectScreen as O}from"../../support/geometryUtils/sphere.js";import V from"../../webgl/RenderCamera.js";import{Intersector as U}from"../../webgl-engine/lib/Intersector.js";import{outExpo as L}from"../../../animation/easing.js";const S=.6,x=4,F=60;let H=class extends f{constructor(){super(...arguments),this._zoomLocation=c(),this._tmpCamera=new V,this._tmpViewDir=c(),this._tmpRayDir=l(),this._targetOnSphere=c(),this._tmpCenter=c(),this._beginCamera=new V,this._constraintOptions=new w(7,1,null,this._beginCamera),this._sphere=new y}initialize(){this._intersector=new U(this.view.state.viewingMode)}step(t,i){if(!this.running)return;const e=this.view.state;this.animation.finished?this._beginCamera.copyFrom(e.camera):this.animation.cameraAt(1,this._beginCamera);let r=!1,o=!1;this._intersectionHelper.intersectScreen(i,this._zoomLocation,0===this.view.map.ground.opacity?u:{})&&D(e.camera.eye,this._zoomLocation,_(this.view.spatialReference).radius)&&(r=t>0,o=!0),this._tmpCamera.copyFrom(e.camera),r?this._intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this._intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:s(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,t,i,o),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:L}}_updateCamera(t,e,r,s){const c=C(t,r,this.view.renderCoordsHelper,this.view.viewingMode),_=Math.abs(this.view.camera.position.z),l=this._zoomLocation;o(P,t.eye),a(P,P,-1),z(t,r,this._tmpRayDir),o(this._tmpRayDir.direction,this._tmpRayDir.direction);const y=i(R(P,this._tmpRayDir.direction,j)*_,v[0],v[1]);if(1===c){let i=S**e;this._sphere.radius=n(l),m(this._tmpViewDir,t.center,t.eye);const s=Math.min(n(this._tmpViewDir),y);let o=s*i;if(i<=1&&o<x&&(o=x,i=o/s),Math.abs(s-o)<b)return;const c=n(t.center);if(this._sphere.radius!==c){const e=this._sphere.radius+i*(c-this._sphere.radius);t.center=a(A,t.center,e/c)}a(this._tmpViewDir,this._tmpViewDir,-i),t.eye=h(A,t.center,this._tmpViewDir),d(this.view,t,this._constraintOptions),p(l,t.center)>1e-12&&O(this._sphere,t,r,this._targetOnSphere)&&M(this._sphere,t,l,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let i=S**Math.abs(e);const p=e>0?1:-1;m(this._tmpViewDir,l,t.eye);const c=n(this._tmpViewDir),_=this.view.stage.renderView.getMinimalDepthForArea(null,r[0],r[1],this.view.state.camera,F);let w=null!=_?_:y;s&&e>0&&(w=Math.min(w,c)),a(this._tmpRayDir.direction,this._tmpRayDir.direction,w),h(l,this._tmpRayDir.origin,this._tmpRayDir.direction);let g=w*i;const f=Math.max(x,1.01*t.nearFar[0]);if(e>0&&g<f&&(g=f,i=g/w),Math.abs(w-g)<b)return;a(this._tmpRayDir.direction,this._tmpRayDir.direction,p*(1-i)),t.eye=h(A,t.eye,this._tmpRayDir.direction),t.center=h(A,t.center,this._tmpRayDir.direction),o(this._tmpRayDir.direction,this._tmpRayDir.direction),this._constraintOptions.interactionDirection=this._tmpRayDir.direction,d(this.view,t,this._constraintOptions),this._constraintOptions.interactionDirection=null}g(this.view,t)}};H=t([r("esri.views.3d.state.controllers.ZoomStepControllerGlobal")],H);const A=c(),P=c();export{H as ZoomStepControllerGlobal};
2
+ import{__decorate as t}from"tslib";import{clamp as i}from"../../../../core/mathUtils.js";import{Milliseconds as e}from"../../../../core/time.js";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{copy as s,normalize as o,scale as a,length as n,subtract as m,add as h,squaredDistance as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import{create as l}from"../../../../geometry/support/ray.js";import{Sphere as y}from"../../../../geometry/support/sphere.js";import{applyAll as d}from"../../camera/constraintUtils.js";import{ConstraintOptions as w}from"../../camera/constraintUtils/ConstraintOptions.js";import{applySurfaceCollisionConstraint as g}from"../../camera/constraintUtils/surfaceCollision.js";import{PointToPointAnimationController as f}from"./PointToPointAnimationController.js";import{excludeTerrain as u,isHitOnSamePlanetSide as D,inferNavigationMode as C,zoomStepDistanceClamp as v,getTiltScaleFactor as R,maxZoomStepDistanceModifier as j,distanceComparisonTolerance as b,panToPosition as M}from"../utils/navigationUtils.js";import{fromScreenAtEye as z}from"../../support/geometryUtils/ray.js";import{intersectScreen as O}from"../../support/geometryUtils/sphere.js";import V from"../../webgl/RenderCamera.js";import{Intersector as U}from"../../webgl-engine/lib/Intersector.js";import{outExpo as L}from"../../../animation/easing.js";const S=.6,x=4,F=60;let H=class extends f{constructor(){super(...arguments),this._zoomLocation=c(),this._tmpCamera=new V,this._tmpViewDir=c(),this._tmpRayDir=l(),this._targetOnSphere=c(),this._tmpCenter=c(),this._beginCamera=new V,this._constraintOptions=new w(7,1,null,this._beginCamera),this._sphere=new y}initialize(){this._intersector=new U(this.view.state.viewingMode)}step(t,i){if(!this.running)return;const e=this.view.state;this.animation.finished?this._beginCamera.copyFrom(e.camera):this.animation.cameraAt(1,this._beginCamera);let r=!1,o=!1;this._intersectionHelper.intersectScreen(i,this._zoomLocation,0===this.view.map.ground.opacity?u:{})&&D(e.camera.eye,this._zoomLocation,_(this.view.spatialReference).radius)&&(r=t>0,o=!0),this._tmpCamera.copyFrom(e.camera),r?this._intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this._intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:s(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,t,i,o),this.begin(this._tmpCamera)}animationSettings(){return{duration:e(600),easing:L}}_updateCamera(t,e,r,s){const c=C(t,r,this.view.renderCoordsHelper,this.view.viewingMode),_=Math.abs(this.view.camera.position.z),l=this._zoomLocation;o(P,t.eye),a(P,P,-1),z(t,r,this._tmpRayDir),o(this._tmpRayDir.direction,this._tmpRayDir.direction);const y=i(R(P,this._tmpRayDir.direction,j)*_,v[0],v[1]);if(1===c){let i=S**e;this._sphere.radius=n(l),m(this._tmpViewDir,t.center,t.eye);const s=Math.min(n(this._tmpViewDir),y);let o=s*i;if(i<=1&&o<x&&(o=x,i=o/s),Math.abs(s-o)<b)return;const c=n(t.center);if(this._sphere.radius!==c){const e=this._sphere.radius+i*(c-this._sphere.radius);t.center=a(A,t.center,e/c)}a(this._tmpViewDir,this._tmpViewDir,-i),t.eye=h(A,t.center,this._tmpViewDir),d(this.view,t,this._constraintOptions),p(l,t.center)>1e-12&&O(this._sphere,t,r,this._targetOnSphere)&&M(this._sphere,t,l,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let i=S**Math.abs(e);const p=e>0?1:-1;m(this._tmpViewDir,l,t.eye);const c=n(this._tmpViewDir),_=this.view.stage.renderView.getMinimalDepthForArea(null,r[0],r[1],this.view.state.camera,F);let w=null!=_?_:y;s&&e>0&&(w=Math.min(w,c)),a(this._tmpRayDir.direction,this._tmpRayDir.direction,w),h(l,this._tmpRayDir.origin,this._tmpRayDir.direction);let g=w*i;const f=Math.max(x,1.01*t.nearFar[0]);if(e>0&&g<f&&(g=f,i=g/w),Math.abs(w-g)<b)return;a(this._tmpRayDir.direction,this._tmpRayDir.direction,p*(1-i)),t.eye=h(A,t.eye,this._tmpRayDir.direction),t.center=h(A,t.center,this._tmpRayDir.direction),o(this._tmpRayDir.direction,this._tmpRayDir.direction),this._constraintOptions.interactionDirection=this._tmpRayDir.direction,d(this.view,t,this._constraintOptions),this._constraintOptions.interactionDirection=null}g(this.view,null,t)}};H=t([r("esri.views.3d.state.controllers.ZoomStepControllerGlobal")],H);const A=c(),P=c();export{H as ZoomStepControllerGlobal};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as t,createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/units.js";import{add as i,normalize as s,dot as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,copy as c,negativeInfinity as u}from"../../../../geometry/support/aaBoundingRect.js";import{create as d}from"../../../../geometry/support/ray.js";import{sv3d as p}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as h}from"../../../../support/elevationInfoUtils.js";import{computeMapPointFromVec3d as y}from"../../support/hitTest.js";import{fromRenderAtEye as m,fromScreen as g}from"../../support/geometryUtils/ray.js";import{defaultTolerance as f,Intersector as _}from"../../webgl-engine/lib/Intersector.js";import{isValidIntersectorResult as R}from"../../webgl-engine/lib/IntersectorResult.js";import{sliceFilterPredicate as w}from"../../webgl-engine/lib/intersectorUtils.js";class b{constructor(t,r,n){this.viewingMode=t,this._forEachLayer=r,this._view=n,this._externalIntersectionHandlers=new e,this._tolerance=f,this._tmpRay=d(),this._tmpRegion=a(),this._validateHUDIntersector=new _(this.viewingMode),this._validateHUDIntersector.options.hud=!1}destroy(){this._externalIntersectionHandlers.prune()}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),j(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,j(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,n){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,n),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,n=.5){return e.getRenderCenter(L,r,n),L[0]+=.0466,L[1]-=.0123,m(e,L,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,r)}intersectToolIntersectorScreen(e,t,r){const n=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(n,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,r);const n=t.results.min;!!this._view.basemapTerrain&&this._view.basemapTerrain.opaque||R(n)&&7!==n.intersector||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,r))}setTolerance(e=f){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>7===e.type?1:7===t.type?-1:0)}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort((e,t)=>7===e.type?1:7===t.type?-1:0)}_getPickRay(e,t){const r=this._view.state.camera;return g(r,e,t)}_intersectRayFreePointLocal(e,t){return 2!==this.viewingMode||null==e||i(t,e.origin,s(p.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,n=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,n)}_intersectElevation(e,r,l=0,a=null){if(null==e)return null;const c=this._view,{renderCoordsHelper:u}=c,d=n(c.spatialReference),m=null!=r?r.mode:"absolute-height",g=h(r)/d,f=("on-the-ground"!==m?g+l:0)*d/u.unitInMeters,{camera:R}=c.state;if("absolute-height"===m){const t=u?.getAltitude(R.eye),r=o(s(U,e.direction),u.worldUpAtPosition(R.eye,H));if(t<f&&r<0||t>=f&&r>0)return null;if(u.intersectInfiniteManifold(e,f,U)){const e=y(c,U);return e.z??=0,e.z-=g,e}return null}const b=R.projectToRenderScreen(e.origin,t(p.get())),v=new x(null,this._forEachLayer),I=c.slice.plane,j=I?w(I):null,P=new _(this.viewingMode);P.options.store=0,P.options.verticalOffset=f,P.options.normalRequired=!1;const L=e.origin,M=i(p.get(),L,e.direction);P.reset(L,M,R),P.point=b;let k=null;if(a&&"type"in a&&"graphics"===a.type){const e=c.allLayerViews.find(e=>e.layer===a)?.uid;k=e?t=>t.layerViewUid===e:null}else a&&(k=e=>e.graphicUid!==a.uid);switch(m){case"relative-to-scene":{const e=e=>(!k||k(e))&&!!e.lastValidElevationBB;P.intersect(v.layers,b,this._tolerance,null,e),this._externalIntersectionHandlers.forAll(e=>{if(2===e.type||7===e.type||8===e.type){const t=e.slicePlaneEnabled?j:null;e.intersect(P,t,P.rayBegin,P.rayEnd,b,!1)}});break}case"on-the-ground":case"relative-to-ground":this._externalIntersectionHandlers.forAll(e=>{if(e.isGround){const t=e.slicePlaneEnabled?j:null;e.intersect(P,t,P.rayBegin,P.rayEnd,b,!1)}})}if(P.results.min.getIntersectionPoint(U)){const e=y(c,U);return e.z=l,e}return null}computeIntersection(e,r,n,s){if(null==e)return;const o=this._view.state.camera,l=o.projectToRenderScreen(e.origin,t(p.get())),a=new x(s,this._forEachLayer);r.options.selectOpaqueTerrainOnly=!s||!("include"in s||"exclude"in s);const c=e.origin,u=i(p.get(),e.origin,e.direction);r.reset(c,u,o),r.intersect(a.layers,l,this._tolerance);const d=this._view.slice.plane,h=null!=d?w(d):null;r.intersect(a.sliceableLayers,l,this._tolerance,h);const y=s&&(s.requiresGroundFeedback||s.enableDraped);this._externalIntersectionHandlers.forAll(e=>{const t=e.layerViewUid,i=e.sublayerId,s=Array.isArray(t),o=s?t:[t];s&&(r.options.filteredLayerViewUids=[]);let d=!1;for(const n of o)a.filterLayerViewUid(n,i)?d=!0:s&&r.options.filteredLayerViewUids.push(n);if(r.options.isFiltered=!d,e.isGround&&y||!r.options.isFiltered){const t=e.slicePlaneEnabled?h:null;e.intersect(r,t,c,u,l,n)}});const m=p.get(),g=this._view,f=g.basemapTerrain;if(s&&s.enableDraped&&null!=f.spatialReference&&r.results.ground.getIntersectionPoint(m)){const e=g.overlayManager.renderer,t=g.renderCoordsHelper.spatialReference,n=p.get();g.renderCoordsHelper.fromRenderCoords(m,n,f.spatialReference),n[2]=g.elevationProvider?.getElevation(m[0],m[1],m[2],t,"ground")??0,e.intersect(r,n,r.results.ground,e=>a.filterRenderGeometry(e))}r.sortResults(),this._processHUDResults(r)}_processHUDResults(e){const t=e.results.hud;c(this._tmpRegion,u);const r=new Array,n=this._tmpRegion,i=e=>{r.push(new v(e))};e.sortResults(t.all),null!=t.min.distance&&i(t.min);for(const a of t.all)t.min.target.object!==a.target.object&&t.max.target.object!==a.target.object&&i(a);if(null!=t.max.distance&&t.max.target.object!==t.min.target.object&&i(t.max),!r.length)return;n[0]===n[2]&&(n[2]+=1),n[1]===n[3]&&(n[3]+=1);let s=!0;const o=null==e.results.max.distance;let l=0;for(const a of r)s&&(e.results.min.copy(a.result),s=!1),o&&e.results.max.copy(a.result),2===e.options.store&&e.results.all.splice(l++,0,a.result)}}class v{constructor(e){this.result=e,this.screenPoint=r()}}let I;function j(e){return I&&I.viewingMode===e||(I=new _(e)),I}class x{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){const{include:r,exclude:n}=this;if(null==e)return null==r&&null==n;const i=r instanceof Map?r.get(e)??!1:r?.has(e),s=n instanceof Map?n.get(e)??!1:n?.has(e);return(null==i||("boolean"==typeof i?i:null!=t&&i.has(t)))&&(null==s||!("boolean"==typeof s?s:null!=t&&s.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function P(e){return"object"==typeof e&&"intersect"in e}const U=l(),H=l(),L=r();export{b as SceneIntersectionHelper,P as isIntersectionHandler};
2
+ import e from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as t,createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as i}from"../../../../core/units.js";import{add as n,normalize as s,dot as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,copy as c,negativeInfinity as d}from"../../../../geometry/support/aaBoundingRect.js";import{create as u}from"../../../../geometry/support/ray.js";import{sv3d as y}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as h}from"../../../../support/elevationInfoUtils.js";import{computeMapPointFromVec3d as p}from"../../support/hitTest.js";import{fromRenderAtEye as g,fromScreen as f}from"../../support/geometryUtils/ray.js";import{defaultTolerance as m,Intersector as _}from"../../webgl-engine/lib/Intersector.js";import{RayIntersectionQuery as w}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as R}from"../../webgl-engine/lib/IntersectorResult.js";import{sliceFilterPredicate as I}from"../../webgl-engine/lib/intersectorUtils.js";import{prepareScreenPolygonIntersectionQuery as P}from"../../webgl-engine/lib/screenPolygonIntersectionUtils.js";import{TaskPriority as b}from"../../../support/Scheduler.js";class v{constructor(t,r,i){this.viewingMode=t,this._forEachLayer=r,this._view=i,this._externalIntersectionHandlers=new e,this._tolerance=m,this._tmpRay=u(),this._tmpRegion=a(),this._validateHUDIntersector=new _(this.viewingMode),this._validateHUDIntersector.options.hud=!1,this._screenPolygonIntersectionTask=this._view.resourceController.scheduler.registerTask(b.SCREEN_POLYGON_INTERSECTION)}destroy(){this._screenPolygonIntersectionTask.remove(),this._externalIntersectionHandlers.prune()}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),H(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,H(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,i){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,i),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,i=.5){return e.getRenderCenter(T,r,i),T[0]+=.0466,T[1]-=.0123,g(e,T,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,r)}async intersectIntersectorScreenPolygon(e,t,r){t.polygonResults.init();const i=this._view.state.camera,n=await P(i,e);null!=n&&await this._screenPolygonIntersectionTask.scheduleGenerator(()=>this._intersectIntersectorScreenPolygon(i,t,n,r))}*_intersectIntersectorScreenPolygon(e,t,r,i){const n=new x(i,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!i||!("include"in i||"exclude"in i),t.camera=e,t.point=null,t.filterPredicate=null,yield*t.intersectScreenPolygon(n.layers,r);const s=this._view.slice.plane,o=s?I(s):null;yield*t.intersectScreenPolygon(n.sliceableLayers,r,o),yield*this._intersectPolygonHandlersGenerator(t,n,r,o),t.polygonResults.sortResults()}intersectToolIntersectorScreen(e,t,r){const i=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(i,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,r);const i=t.results.min;!!this._view.basemapTerrain&&this._view.basemapTerrain.opaque||R(i)&&7!==i.intersector||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,r))}setTolerance(e=m){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>7===e.type?1:7===t.type?-1:0)}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort((e,t)=>7===e.type?1:7===t.type?-1:0)}_getPickRay(e,t){const r=this._view.state.camera;return f(r,e,t)}_intersectRayFreePointLocal(e,t){return 2!==this.viewingMode||null==e||n(t,e.origin,s(y.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,i=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,i)}_intersectElevation(e,r,n=0,l=null){if(null==e)return null;const a=this._view,{renderCoordsHelper:c}=a,d=i(a.spatialReference),u=null!=r?r.mode:"absolute-height",g=h(r)/d,f=("on-the-ground"!==u?g+n:0)*d/c.unitInMeters,{camera:m}=a.state;if("absolute-height"===u){const t=c?.getAltitude(m.eye),r=o(s(V,e.direction),c.worldUpAtPosition(m.eye,S));if(t<f&&r<0||t>=f&&r>0)return null;if(c.intersectInfiniteManifold(e,f,V)){const e=p(a,V);return e.z??=0,e.z-=g,e}return null}const w=m.projectToRenderScreen(e.origin,t(y.get())),R=new x(null,this._forEachLayer),P=a.slice.plane,b=P?I(P):null,v=new _(this.viewingMode);v.options.store=0,v.options.verticalOffset=f,v.options.normalRequired=!1;const U=this._createRayIntersectionQuery(e,w,!1);v.reset(U.beginPoint,U.endPoint,m),v.point=w;let j=null;if(l&&"type"in l&&"graphics"===l.type){const e=a.allLayerViews.find(e=>e.layer===l)?.uid;j=e?t=>t.layerViewUid===e:null}else l&&(j=e=>e.graphicUid!==l.uid);switch(u){case"relative-to-scene":{const e=e=>(!j||j(e))&&!!e.lastValidElevationBB;v.intersect(R.layers,U.screenPoint,this._tolerance,null,e),this._intersectRayHandlers(v,R,U,b,!1,e=>2===e.type||7===e.type||8===e.type,!1);break}case"on-the-ground":case"relative-to-ground":this._intersectRayHandlers(v,R,U,b,!1,e=>e.isGround,!1)}if(v.results.min.getIntersectionPoint(V)){const e=p(a,V);return e.z=n,e}return null}computeIntersection(e,r,i,n){if(null==e)return;const s=this._view.state.camera,o=s.projectToRenderScreen(e.origin,t(y.get())),l=new x(n,this._forEachLayer);r.options.selectOpaqueTerrainOnly=!n||!("include"in n||"exclude"in n);const a=this._createRayIntersectionQuery(e,o,i);r.reset(a.beginPoint,a.endPoint,s),r.intersect(l.layers,a.screenPoint,this._tolerance);const c=this._view.slice.plane,d=c?I(c):null;r.intersect(l.sliceableLayers,a.screenPoint,this._tolerance,d);const u=n&&(n.requiresGroundFeedback||n.enableDraped);this._intersectRayHandlers(r,l,a,d,!!u);const h=y.get(),p=this._view,g=p.basemapTerrain;if(n&&n.enableDraped&&null!=g.spatialReference&&r.results.ground.getIntersectionPoint(h)){const e=p.overlayManager.renderer,t=p.renderCoordsHelper.spatialReference,i=y.get();p.renderCoordsHelper.fromRenderCoords(h,i,g.spatialReference),i[2]=p.elevationProvider?.getElevation(h[0],h[1],h[2],t,"ground")??0,e.intersectRay(r,i,r.results.ground,e=>l.filterRenderGeometry(e))}r.sortResults(),this._processHUDResults(r)}_processHUDResults(e){const t=e.results.hud;c(this._tmpRegion,d);const r=new Array,i=this._tmpRegion,n=e=>{r.push(new U(e))};e.sortResults(t.all),null!=t.min.distance&&n(t.min);for(const a of t.all)t.min.target.object!==a.target.object&&t.max.target.object!==a.target.object&&n(a);if(null!=t.max.distance&&t.max.target.object!==t.min.target.object&&n(t.max),!r.length)return;i[0]===i[2]&&(i[2]+=1),i[1]===i[3]&&(i[3]+=1);let s=!0;const o=null==e.results.max.distance;let l=0;for(const a of r)s&&(e.results.min.copy(a.result),s=!1),o&&e.results.max.copy(a.result),2===e.options.store&&e.results.all.splice(l++,0,a.result)}_createRayIntersectionQuery(e,t,r){return new w(e.origin,n(l(),e.origin,e.direction),t,r)}_intersectRayHandlers(e,t,r,i,n,s=()=>!0,o=!0){const{options:l}=e,a=l.isFiltered,c=l.filteredLayerViewUids;for(const{handler:d,filterPredicate:u,isFiltered:y,filteredLayerViewUids:h}of this._getFilteredIntersectionHandlers(t,i,s,o))(!y||d.isGround&&n)&&(l.isFiltered=y,l.filteredLayerViewUids=h,d.intersectRay(e,u,e.rayBegin,e.rayEnd,r.screenPoint,r.isVerticalRay));l.isFiltered=a,l.filteredLayerViewUids=c}*_intersectPolygonHandlersGenerator(e,t,r,i,n=()=>!0,s=!0){const{options:o}=e,l=o.isFiltered,a=o.filteredLayerViewUids;for(const{handler:c,filterPredicate:d,isFiltered:u,filteredLayerViewUids:y}of this._getFilteredIntersectionHandlers(t,i,n,s))u||null==c.intersectScreenPolygon||(o.isFiltered=u,o.filteredLayerViewUids=y,yield*c.intersectScreenPolygon(e,d,r));o.isFiltered=l,o.filteredLayerViewUids=a}*_getFilteredIntersectionHandlers(e,t,r=()=>!0,i=!0){for(const n of this._externalIntersectionHandlers){if(!r(n))continue;let s=!1;const o=[];if(i){const t=n.layerViewUid,r=n.sublayerId,i=Array.isArray(t),l=i?t:[t];let a=!1;for(const n of l)e.filterLayerViewUid(n,r)?a=!0:i&&o.push(n);s=!a}yield new j(n,n.slicePlaneEnabled?t:null,s,o)}}}class U{constructor(e){this.result=e,this.screenPoint=r()}}class j{constructor(e,t,r,i){this.handler=e,this.filterPredicate=t,this.isFiltered=r,this.filteredLayerViewUids=i}}let L;function H(e){return L&&L.viewingMode===e||(L=new _(e)),L}class x{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){const{include:r,exclude:i}=this;if(null==e)return null==r&&null==i;const n=r instanceof Map?r.get(e)??!1:r?.has(e),s=i instanceof Map?i.get(e)??!1:i?.has(e);return(null==n||("boolean"==typeof n?n:null!=t&&n.has(t)))&&(null==s||!("boolean"==typeof s?s:null!=t&&s.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function F(e){return"object"==typeof e&&null!=e&&"intersectRay"in e}const V=l(),S=l(),T=r();export{v as SceneIntersectionHelper,F as isIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{subtract as t,length as i,scale as e,negate as n,dot as s,transformQuatValues as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as l}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{project as a}from"../../../../geometry/projectionUtils.js";import{intersects as c,contains as u}from"../../../../geometry/support/aaBoundingBox.js";import{fromExtent as d}from"../../../../geometry/support/aaBoundingRect.js";import{create as p}from"../../../../geometry/support/plane.js";import{fromPoints as f}from"../../../../geometry/support/ray.js";import{GaussianSplatTarget as h}from"../../layers/i3s/Intersector.js";import{createTileBVH as m}from"../../layers/support/Tiles3DBVH.js";import{ElevationRange as y}from"../ElevationRange.js";import{IntersectorResult as g}from"../../webgl-engine/lib/IntersectorResult.js";class w{constructor(t){this.layerView=t,this.type=0,this.slicePlaneEnabled=!1,this.isGround=!1,this._ellipsoidLocalRayOrigin=r(),this._ellipsoidLocalRayDir=r(),this.intersectionNormal=r(),this.intersectionRayDir=r(),this.intersectionPlane=p(),this.layerViewUid=t.uid;const i=t.view.viewingMode,e=(t.useEsriCrs?t.fullExtentInLocalViewSpatialReference:t.layer.fullExtent?a(t.layer.fullExtent,t.view.renderSpatialReference):void 0)??t.view.extent,n=d(e);this._bvh=m(i,n)}destroy(){this._bvh.destroy()}addTile(t){this._bvh.addTile(t)}removeTile(t){this._bvh.removeTile(t)}intersect(o,a,d,p,m,y){const{intersectionRayDir:w,intersectionPlane:R,layerViewUid:x,intersectionNormal:_}=this,j=f(d,p);t(w,p,d);const M=1/i(w);e(w,w,M),n(_,w),l(R,w[0],w[1],w[2],-s(w,d));const E=new v,S=new v,D=o.options.store,V=0===D,k=2===D,q=1===D||k,T=k?new Array:null,B=(t,i,e,n,s,o,l,a)=>{const c=t.point??(t.point=r());c[0]=e,c[1]=n,c[2]=s,t.dist=i,t.normal=_;const u=t.outwardDirection??(t.outwardDirection=r()),d=o*o+l*l+a*a;if(d>0){const t=1/Math.sqrt(d);u[0]=o*t,u[1]=l*t,u[2]=a*t}else u[0]=_[0],u[1]=_[1],u[2]=_[2];return t.layerViewUid=x,t},P=d[0],U=d[1],I=d[2],L=w[0],G=w[1],O=w[2],C=this.layerView.clippingBox,A=t=>{const{relativePositions:i,packedRotations:e,packedOpacityScaledScales:n,gaussianCount:s,obb:o,maxSplatMbsRadiusSquared:r}=t,l=o.centerX,c=o.centerY,u=o.centerZ;let f=-1;const h=C[0],m=C[1],y=C[2],g=C[3],w=C[4],b=C[5];for(let R=0,x=0;R<s;R++,x+=3){const t=i[x]+l,s=i[x+1]+c,o=i[x+2]+u;if(t<h||s<m||o<y||t>g||s>w||o>b)continue;const _=t-P,j=s-U,D=o-I,C=_*L+j*G+D*O;if(C<0&&C*C>r)continue;const A=C<0?0:C;if(_*_+j*j+D*D-A*A>r)continue;if(V&&null!=E.dist){f<0&&(f=Math.sqrt(r));if(Math.max(C-f,0)*M>=E.dist)continue}const N=this._intersectGaussianEllipsoid(_,j,D,L,G,O,e[R],n[R]);if(N<0)continue;const X=N*M;if(null!=a&&!a(d,p,X))continue;const Y=null==E.dist||X<E.dist,Z=q&&(null==S.dist||X>S.dist);if(!Y&&!Z&&!k)continue;const F=L*N,H=G*N,Q=O*N,z=P+F,J=U+H,K=I+Q,W=F-_,$=H-j,tt=Q-D;if(Y&&B(E,X,z,J,K,W,$,tt),Z&&B(S,X,z,J,K,W,$,tt),k){const t=new v;T.push(B(t,X,z,J,K,W,$,tt))}}},N=t=>{const{relativePositions:i,packedRotations:e,packedOpacityScaledScales:n,gaussianCount:s,obb:o,maxSplatMbsRadiusSquared:r}=t,l=o.centerX,c=o.centerY,u=o.centerZ;let f=-1;const h=P-l,m=U-c,y=I-u;for(let g=0,w=0;g<s;g++,w+=3){const t=i[w]-h,s=i[w+1]-m,o=i[w+2]-y,l=t*L+s*G+o*O;if(l<0&&l*l>r)continue;const c=l<0?0:l;if(t*t+s*s+o*o-c*c>r)continue;if(V&&null!=E.dist){f<0&&(f=Math.sqrt(r));if(Math.max(l-f,0)*M>=E.dist)continue}const u=this._intersectGaussianEllipsoid(t,s,o,L,G,O,e[g],n[g]);if(u<0)continue;const b=u*M;if(null!=a&&!a(d,p,b))continue;const R=null==E.dist||b<E.dist,x=q&&(null==S.dist||b>S.dist);if(!R&&!x&&!k)continue;const _=L*u,j=G*u,D=O*u,C=P+_,A=U+j,N=I+D,X=_-t,Y=j-s,Z=D-o;if(R&&B(E,b,C,A,N,X,Y,Z),x&&B(S,b,C,A,N,X,Y,Z),k){const t=new v;T.push(B(t,b,C,A,N,X,Y,Z))}}},X=(t,i)=>{const{min:e,max:n}=t.obb.signedDistanceRangePlane(R);if(n<0)return;const s=e*M;if(!(V&&null!=E.dist&&E.dist<s)){if(null!=E.dist&&null!=S.dist){const t=n*M;if(E.dist<s&&S.dist>t)return}i?A(t):N(t)}},Y=t=>{X(t,!1)},Z=t=>{const i=t.boundingBox;c(i,C)&&X(t,!u(C,i))};this._bvh.forEachTileIntersectingRay(d,p,null!=C?Z:Y,y);const F=(t,i)=>{const{layerViewUid:e}=i,n=new h(i.point,i.outwardDirection,e);t.set(0,n,i.dist,i.normal)};if(b(E)){const t=o.results.min;(null==t.distance||E.dist<t.distance)&&F(t,E)}if(b(S)&&q){const t=o.results.max;(null==t.distance||S.dist>t.distance)&&F(t,S)}if(k&&T?.length)for(const t of T){const i=new g(j);F(i,t),o.results.all.push(i)}}_intersectGaussianEllipsoid(t,i,e,n,s,r,l,a){const c=l>>>30,u=1023&l,d=l>>>10&1023,p=l>>>20&1023,f=(u&R)*x*(1-2*(u>>>9&1)),h=(d&R)*x*(1-2*(d>>>9&1)),m=(p&R)*x*(1-2*(p>>>9&1));let y,g,w,b;const v=f*f+h*h+m*m,j=Math.sqrt(Math.max(0,1-v));switch(c){case 0:y=j,g=m,w=h,b=f;break;case 1:y=m,g=j,w=h,b=f;break;case 2:y=m,g=h,w=j,b=f;break;default:y=m,g=h,w=f,b=j}const E=this._ellipsoidLocalRayOrigin;E[0]=-t,E[1]=-i,E[2]=-e,o(E,E,-y,-g,-w,b);const S=this._ellipsoidLocalRayDir;S[0]=n,S[1]=s,S[2]=r,o(S,S,-y,-g,-w,b);const D=M[255&a],V=M[a>>>8&255],k=M[a>>>16],q=E[0]*D,T=E[1]*V,B=E[2]*k,P=q*q+T*T+B*B;if(P<=1)return 0;const U=S[0]*D,I=S[1]*V,L=S[2]*k,G=U*U+I*I+L*L,O=q*U+T*I+B*L;if(O>0)return _;const C=O*O-G*(P-1);return C<0?_:(-O-Math.sqrt(C))/G}getElevationRange(t){return this._bvh.getElevationRangeIntersectingSphere(t)??new y(0,0)}}function b(t){return null!=t.dist&&null!=t.point}class v{constructor(){this.point=null,this.dist=null,this.normal=null,this.outwardDirection=null,this.layerViewUid=""}}const R=511,x=Math.SQRT1_2/R,_=-1,j=3,M=(()=>{const t=new Float64Array(256);for(let i=0;i<t.length;i++)t[i]=Math.exp(10-i/16)/j;return t})();export{w as GaussianSplatIntersectionHandler};
2
+ import{subtract as t,length as i,scale as e,negate as n,dot as s,transformQuatValues as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as l}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{project as a}from"../../../../geometry/projectionUtils.js";import{intersects as c,contains as u}from"../../../../geometry/support/aaBoundingBox.js";import{fromExtent as d}from"../../../../geometry/support/aaBoundingRect.js";import{create as p}from"../../../../geometry/support/plane.js";import{fromPoints as f}from"../../../../geometry/support/ray.js";import{GaussianSplatTarget as h}from"../../layers/i3s/Intersector.js";import{createTileBVH as m}from"../../layers/support/Tiles3DBVH.js";import{ElevationRange as y}from"../ElevationRange.js";import{IntersectorResult as g}from"../../webgl-engine/lib/IntersectorResult.js";class w{constructor(t){this.layerView=t,this.type=0,this.slicePlaneEnabled=!1,this.isGround=!1,this._ellipsoidLocalRayOrigin=r(),this._ellipsoidLocalRayDir=r(),this.intersectionNormal=r(),this.intersectionRayDir=r(),this.intersectionPlane=p(),this.layerViewUid=t.uid;const i=t.view.viewingMode,e=(t.useEsriCrs?t.fullExtentInLocalViewSpatialReference:t.layer.fullExtent?a(t.layer.fullExtent,t.view.renderSpatialReference):void 0)??t.view.extent,n=d(e);this._bvh=m(i,n)}destroy(){this._bvh.destroy()}addTile(t){this._bvh.addTile(t)}removeTile(t){this._bvh.removeTile(t)}intersectRay(o,a,d,p,m,y){const{intersectionRayDir:w,intersectionPlane:R,layerViewUid:x,intersectionNormal:_}=this,j=f(d,p);t(w,p,d);const M=1/i(w);e(w,w,M),n(_,w),l(R,w[0],w[1],w[2],-s(w,d));const E=new v,S=new v,D=o.options.store,V=0===D,k=2===D,q=1===D||k,T=k?new Array:null,B=(t,i,e,n,s,o,l,a)=>{const c=t.point??(t.point=r());c[0]=e,c[1]=n,c[2]=s,t.dist=i,t.normal=_;const u=t.outwardDirection??(t.outwardDirection=r()),d=o*o+l*l+a*a;if(d>0){const t=1/Math.sqrt(d);u[0]=o*t,u[1]=l*t,u[2]=a*t}else u[0]=_[0],u[1]=_[1],u[2]=_[2];return t.layerViewUid=x,t},P=d[0],U=d[1],I=d[2],L=w[0],G=w[1],O=w[2],C=this.layerView.clippingBox,A=t=>{const{relativePositions:i,packedRotations:e,packedOpacityScaledScales:n,gaussianCount:s,obb:o,maxSplatMbsRadiusSquared:r}=t,l=o.centerX,c=o.centerY,u=o.centerZ;let f=-1;const h=C[0],m=C[1],y=C[2],g=C[3],w=C[4],b=C[5];for(let R=0,x=0;R<s;R++,x+=3){const t=i[x]+l,s=i[x+1]+c,o=i[x+2]+u;if(t<h||s<m||o<y||t>g||s>w||o>b)continue;const _=t-P,j=s-U,D=o-I,C=_*L+j*G+D*O;if(C<0&&C*C>r)continue;const A=C<0?0:C;if(_*_+j*j+D*D-A*A>r)continue;if(V&&null!=E.dist){f<0&&(f=Math.sqrt(r));if(Math.max(C-f,0)*M>=E.dist)continue}const N=this._intersectGaussianEllipsoid(_,j,D,L,G,O,e[R],n[R]);if(N<0)continue;const X=N*M;if(null!=a&&!a(d,p,X))continue;const Y=null==E.dist||X<E.dist,Z=q&&(null==S.dist||X>S.dist);if(!Y&&!Z&&!k)continue;const F=L*N,H=G*N,Q=O*N,z=P+F,J=U+H,K=I+Q,W=F-_,$=H-j,tt=Q-D;if(Y&&B(E,X,z,J,K,W,$,tt),Z&&B(S,X,z,J,K,W,$,tt),k){const t=new v;T.push(B(t,X,z,J,K,W,$,tt))}}},N=t=>{const{relativePositions:i,packedRotations:e,packedOpacityScaledScales:n,gaussianCount:s,obb:o,maxSplatMbsRadiusSquared:r}=t,l=o.centerX,c=o.centerY,u=o.centerZ;let f=-1;const h=P-l,m=U-c,y=I-u;for(let g=0,w=0;g<s;g++,w+=3){const t=i[w]-h,s=i[w+1]-m,o=i[w+2]-y,l=t*L+s*G+o*O;if(l<0&&l*l>r)continue;const c=l<0?0:l;if(t*t+s*s+o*o-c*c>r)continue;if(V&&null!=E.dist){f<0&&(f=Math.sqrt(r));if(Math.max(l-f,0)*M>=E.dist)continue}const u=this._intersectGaussianEllipsoid(t,s,o,L,G,O,e[g],n[g]);if(u<0)continue;const b=u*M;if(null!=a&&!a(d,p,b))continue;const R=null==E.dist||b<E.dist,x=q&&(null==S.dist||b>S.dist);if(!R&&!x&&!k)continue;const _=L*u,j=G*u,D=O*u,C=P+_,A=U+j,N=I+D,X=_-t,Y=j-s,Z=D-o;if(R&&B(E,b,C,A,N,X,Y,Z),x&&B(S,b,C,A,N,X,Y,Z),k){const t=new v;T.push(B(t,b,C,A,N,X,Y,Z))}}},X=(t,i)=>{const{min:e,max:n}=t.obb.signedDistanceRangePlane(R);if(n<0)return;const s=e*M;if(!(V&&null!=E.dist&&E.dist<s)){if(null!=E.dist&&null!=S.dist){const t=n*M;if(E.dist<s&&S.dist>t)return}i?A(t):N(t)}},Y=t=>{X(t,!1)},Z=t=>{const i=t.boundingBox;c(i,C)&&X(t,!u(C,i))};this._bvh.forEachTileIntersectingRay(d,p,null!=C?Z:Y,y);const F=(t,i)=>{const{layerViewUid:e}=i,n=new h(i.point,i.outwardDirection,e);t.set(0,n,i.dist,i.normal)};if(b(E)){const t=o.results.min;(null==t.distance||E.dist<t.distance)&&F(t,E)}if(b(S)&&q){const t=o.results.max;(null==t.distance||S.dist>t.distance)&&F(t,S)}if(k&&T?.length)for(const t of T){const i=new g(j);F(i,t),o.results.all.push(i)}}_intersectGaussianEllipsoid(t,i,e,n,s,r,l,a){const c=l>>>30,u=1023&l,d=l>>>10&1023,p=l>>>20&1023,f=(u&R)*x*(1-2*(u>>>9&1)),h=(d&R)*x*(1-2*(d>>>9&1)),m=(p&R)*x*(1-2*(p>>>9&1));let y,g,w,b;const v=f*f+h*h+m*m,j=Math.sqrt(Math.max(0,1-v));switch(c){case 0:y=j,g=m,w=h,b=f;break;case 1:y=m,g=j,w=h,b=f;break;case 2:y=m,g=h,w=j,b=f;break;default:y=m,g=h,w=f,b=j}const E=this._ellipsoidLocalRayOrigin;E[0]=-t,E[1]=-i,E[2]=-e,o(E,E,-y,-g,-w,b);const S=this._ellipsoidLocalRayDir;S[0]=n,S[1]=s,S[2]=r,o(S,S,-y,-g,-w,b);const D=M[255&a],V=M[a>>>8&255],k=M[a>>>16],q=E[0]*D,T=E[1]*V,B=E[2]*k,P=q*q+T*T+B*B;if(P<=1)return 0;const U=S[0]*D,I=S[1]*V,L=S[2]*k,G=U*U+I*I+L*L,O=q*U+T*I+B*L;if(O>0)return _;const C=O*O-G*(P-1);return C<0?_:(-O-Math.sqrt(C))/G}getElevationRange(t){return this._bvh.getElevationRangeIntersectingSphere(t)??new y(0,0)}}function b(t){return null!=t.dist&&null!=t.point}class v{constructor(){this.point=null,this.dist=null,this.normal=null,this.outwardDirection=null,this.layerViewUid=""}}const R=511,x=Math.SQRT1_2/R,_=-1,j=3,M=(()=>{const t=new Float64Array(256);for(let i=0;i<t.length;i++)t[i]=Math.exp(10-i/16)/j;return t})();export{w as GaussianSplatIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isPromiseLike as e}from"../../../../core/promiseUtils.js";import{projectBuffer as t}from"../../../../geometry/projection/projectBuffer.js";import{doubleSubArray as n,newDoubleArray as s}from"../../../../geometry/support/DoubleArray.js";import{applyPerVertexElevationAlignment as o}from"../../layers/graphics/elevationAlignmentUtils.js";import{axisFromRings as i,ringsToOutlinedTessellationInfo as r,tessellateOrLoad as l,load as u}from"../../layers/graphics/tessellationUtils.js";import{drapedZ as c}from"../../terrain/OverlayRenderer.js";async function a(){return u()}class p{constructor(e,t,n,s){this.positions=e,this.polygonIndices=t,this.outline=n,this.projectionSuccess=s,this.count=e.length/3}get vertexCount(){return this.positions.length/3}get polygonIndexCount(){return this.polygonIndices.length}get outlineIndexCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let n=0;n<e.outlineIndices.length;n++)t+=A(e.outlineIndices[n]);return t}get outlineSegmentCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let n=0;n<e.outlineIndices.length;n++){t+=A(e.outlineIndices[n])}return t}}class d extends p{}class f extends p{}class h extends p{constructor(e,t,n,s,o,i){super(e,n,s,o),this.mapPositions=t,this.sampledElevation=i}}function g(t,n){const s=R(t,n);return e(s)?null:s}function m(t,n,s,o,i){const r=j(t,n,s,o,i);return e(r)?null:r}function x(t,n){const s=v(t,n);return e(s)?null:s}function R(t,n){const{projectIfNearlyVertical:s=!1,outlineOutput:o="none",method:u}=n??{},c="tessellated-indices"===o,a=i(t.rings,!!t.hasZ,t.spatialReference),p=r(t.rings,{hasZ:!!t.hasZ,ccwRingsAsHoles:!0,spatialReference:t.spatialReference,axis:a}),d=l(p,{projectionAxis:s?a:void 0,outlines:c?p.outlines:void 0,method:u});if(e(d))return d;if(!d.succeeded)return null;let h={output:"none"};if("vertex-data"===o){const e=d.positions!==p.positions?p.positions:p.positions.slice();h={output:"vertex-data",outlines:y(p.outlines,e)}}else"tessellated-indices"===o&&(h=I(d));return new f(d.positions,d.indices,h,!0)}function v(n,s){const{drapedSpatialReference:o,projectIfNearlyVertical:u=!1,outlineOutput:a="none",method:p}=s,f=i(n.rings,!1,n.spatialReference),h=r(n.rings,{hasZ:!1,ccwRingsAsHoles:!0,spatialReference:n.spatialReference,axis:f}),g="none"!==a,m=t(h.positions,n.spatialReference,0,h.positions,o,0),x=l(h,{projectionAxis:u?f:void 0,outlines:g?h.outlines:void 0,method:p});if(e(x))return x;if(!x.succeeded)return null;const{positions:R,indices:v}=x;for(let e=2;e<R.length;e+=3)R[e]=c;let j={output:"none"};if("vertex-data"===a){if(R!==h.positions)for(let t=2;t<h.positions.length;t+=3)h.positions[t]=c;const e=R!==h.positions?h.positions:h.positions.slice();j={output:"vertex-data",outlines:y(h.outlines,e)}}else"tessellated-indices"===a&&(j=I(x));return new d(R,v,j,m)}function j(t,n,u,c,a){const{projectIfNearlyVertical:p=!1,outlineOutput:d="none",method:f}=a??{},g="none"!==d,m=!!t.hasZ&&"on-the-ground"!==c.mode,x=i(t.rings,m,t.spatialReference),R=r(t.rings,{hasZ:m,ccwRingsAsHoles:!0,spatialReference:t.spatialReference,axis:x}),v=l(R,{projectionAxis:p?x:void 0,outlines:g?R.outlines:void 0,method:f});if(e(v))return v;if(!v.succeeded)return null;const{positions:j,vertexCount:y}=v,A=s(j.length),Z=o(j,t.spatialReference,0,A,0,j,0,y,n,u,c);let C={output:"none"};"vertex-data"===d?C={output:"vertex-data",outlines:w(v,A)}:"tessellated-indices"===d&&(C=I(v));const O=null!=Z;return new h(j,A,v.indices,C,O,Z)}function y(e,t,s=null){return e.filter(({count:e})=>e>1).map(({index:e,count:o})=>{const i=3*e,r=3*o;return null!=s?new C(e,o,n(t,i,r),n(s,i,r)):new Z(e,o,n(t,i,r))})}function I(e){const{outlineIndexBuffer:t,outlineRingLengths:n}=e;if(null==t||null==n)return{output:"none"};const s=new Array(n.length);let o=0;for(let i=0;i<n.length;i++){const e=n[i],r=t.slice(o,o+e);s[i]=r,o+=e}return{output:"tessellated-indices",outlineIndices:s}}function w(e,t){const{outlineIndexBuffer:o,outlineRingLengths:i,positions:r}=e;if(null==o||null==i)return[];let l=0;for(let n=0;n<i.length;n++)l+=i[n]-1;const u=s(3*l),c=s(3*l),a=new Array;let p=0,d=0;for(let s=0;s<i.length;s++){const e=i[s],l=e-1;for(let n=0;n<l;n++){const e=3*o[p+n],s=3*(d+n);u[s]=r[e],u[s+1]=r[e+1],u[s+2]=r[e+2],c[s]=t[e],c[s+1]=t[e+1],c[s+2]=t[e+2]}a.push(new C(d,l,n(u,3*d,3*l),n(c,3*d,3*l))),p+=e,d+=l}return a}function A(e,t=0,n=e.length){return n>1&&e[t]===e[t+n-1]?n-1:n}class Z{constructor(e,t,n){this.index=e,this.count=t,this.position=n}}class C extends Z{constructor(e,t,n,s){super(e,t,n),this.mapPositions=s}}export{C as OutlineVertexData,Z as OutlineVertexDataDraped,p as PolygonRenderInfoBase,d as PolygonRenderInfoDraped,h as PolygonRenderInfoElevationAligned,f as PolygonRenderInfoNotElevationAligned,a as loadTessellationUtils,v as polygonToRenderInfoDraped,j as polygonToRenderInfoElevationAligned,R as polygonToRenderInfoNotElevationAligned,x as preloadedPolygonToRenderInfoDraped,m as preloadedPolygonToRenderInfoElevationAligned,g as preloadedPolygonToRenderInfoNotElevationAligned,I as splitOutlineIndexRings,w as tessellatedOutlineIndicesToVertexData};
2
+ import{isPromiseLike as e}from"../../../../core/promiseUtils.js";import{projectBuffer as t}from"../../../../geometry/projection/projectBuffer.js";import{doubleSubArray as n,newDoubleArray as o}from"../../../../geometry/support/DoubleArray.js";import{applyPerVertexElevationAlignment as s}from"../../layers/graphics/elevationAlignmentUtils.js";import{axisFromRings as i,ringsToOutlinedTessellationInfo as r,tessellateOrLoad as l,load as u}from"../../layers/graphics/tessellationUtils.js";import{drapedZ as c}from"../../terrain/OverlayRenderer.js";async function a(){return u()}class p{constructor(e,t,n,o){this.positions=e,this.polygonIndices=t,this.outline=n,this.projectionSuccess=o,this.count=e.length/3}get vertexCount(){return this.positions.length/3}get polygonIndexCount(){return this.polygonIndices.length}get outlineIndexCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let n=0;n<e.outlineIndices.length;n++)t+=A(e.outlineIndices[n]);return t}get outlineSegmentCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let n=0;n<e.outlineIndices.length;n++){t+=A(e.outlineIndices[n])}return t}}class d extends p{}class f extends p{}class h extends p{constructor(e,t,n,o,s,i){super(e,n,o,s),this.mapPositions=t,this.sampledElevation=i}}function g(t,n){const o=R(t,n);return e(o)?null:o}function m(t,n,o,s,i){const r=w(t,n,o,s,i);return e(r)?null:r}function x(t,n){const o=v(t,n);return e(o)?null:o}function R(t,n){const{projectIfNearlyVertical:o=!1,outlineOutput:s="none",method:u,owner:c}=n??{},a="tessellated-indices"===s,p=i(t.rings,!!t.hasZ,t.spatialReference),d=r(t.rings,{hasZ:!!t.hasZ,ccwRingsAsHoles:!0,spatialReference:t.spatialReference,axis:p}),h=l(d,{projectionAxis:o?p:void 0,outlines:a?d.outlines:void 0,method:u,owner:c});if(e(h))return h;if(!h.succeeded)return null;let g={output:"none"};if("vertex-data"===s){const e=h.positions!==d.positions?d.positions:d.positions.slice();g={output:"vertex-data",outlines:j(d.outlines,e)}}else"tessellated-indices"===s&&(g=y(h));return new f(h.positions,h.indices,g,!0)}function v(n,o){const{drapedSpatialReference:s,projectIfNearlyVertical:u=!1,outlineOutput:a="none",method:p,owner:f}=o,h=i(n.rings,!1,n.spatialReference),g=r(n.rings,{hasZ:!1,ccwRingsAsHoles:!0,spatialReference:n.spatialReference,axis:h}),m="none"!==a,x=t(g.positions,n.spatialReference,0,g.positions,s,0),R=l(g,{projectionAxis:u?h:void 0,outlines:m?g.outlines:void 0,method:p,owner:f});if(e(R))return R;if(!R.succeeded)return null;const{positions:v,indices:w}=R;for(let e=2;e<v.length;e+=3)v[e]=c;let I={output:"none"};if("vertex-data"===a){if(v!==g.positions)for(let t=2;t<g.positions.length;t+=3)g.positions[t]=c;const e=v!==g.positions?g.positions:g.positions.slice();I={output:"vertex-data",outlines:j(g.outlines,e)}}else"tessellated-indices"===a&&(I=y(R));return new d(v,w,I,x)}function w(t,n,u,c,a){const{projectIfNearlyVertical:p=!1,outlineOutput:d="none",method:f,owner:g}=a??{},m="none"!==d,x=!!t.hasZ&&"on-the-ground"!==c.mode,R=i(t.rings,x,t.spatialReference),v=r(t.rings,{hasZ:x,ccwRingsAsHoles:!0,spatialReference:t.spatialReference,axis:R}),w=l(v,{projectionAxis:p?R:void 0,outlines:m?v.outlines:void 0,method:f,owner:g});if(e(w))return w;if(!w.succeeded)return null;const{positions:j,vertexCount:A}=w,Z=o(j.length),C=s(j,t.spatialReference,0,Z,0,j,0,A,n,u,c);let O={output:"none"};"vertex-data"===d?O={output:"vertex-data",outlines:I(w,Z)}:"tessellated-indices"===d&&(O=y(w));const B=null!=C;return new h(j,Z,w.indices,O,B,C)}function j(e,t,o=null){return e.filter(({count:e})=>e>1).map(({index:e,count:s})=>{const i=3*e,r=3*s;return null!=o?new C(e,s,n(t,i,r),n(o,i,r)):new Z(e,s,n(t,i,r))})}function y(e){const{outlineIndexBuffer:t,outlineRingLengths:n}=e;if(null==t||null==n)return{output:"none"};const o=new Array(n.length);let s=0;for(let i=0;i<n.length;i++){const e=n[i],r=t.slice(s,s+e);o[i]=r,s+=e}return{output:"tessellated-indices",outlineIndices:o}}function I(e,t){const{outlineIndexBuffer:s,outlineRingLengths:i,positions:r}=e;if(null==s||null==i)return[];let l=0;for(let n=0;n<i.length;n++)l+=i[n]-1;const u=o(3*l),c=o(3*l),a=new Array;let p=0,d=0;for(let o=0;o<i.length;o++){const e=i[o],l=e-1;for(let n=0;n<l;n++){const e=3*s[p+n],o=3*(d+n);u[o]=r[e],u[o+1]=r[e+1],u[o+2]=r[e+2],c[o]=t[e],c[o+1]=t[e+1],c[o+2]=t[e+2]}a.push(new C(d,l,n(u,3*d,3*l),n(c,3*d,3*l))),p+=e,d+=l}return a}function A(e,t=0,n=e.length){return n>1&&e[t]===e[t+n-1]?n-1:n}class Z{constructor(e,t,n){this.index=e,this.count=t,this.position=n}}class C extends Z{constructor(e,t,n,o){super(e,t,n),this.mapPositions=o}}export{C as OutlineVertexData,Z as OutlineVertexDataDraped,p as PolygonRenderInfoBase,d as PolygonRenderInfoDraped,h as PolygonRenderInfoElevationAligned,f as PolygonRenderInfoNotElevationAligned,a as loadTessellationUtils,v as polygonToRenderInfoDraped,w as polygonToRenderInfoElevationAligned,R as polygonToRenderInfoNotElevationAligned,x as preloadedPolygonToRenderInfoDraped,m as preloadedPolygonToRenderInfoElevationAligned,g as preloadedPolygonToRenderInfoNotElevationAligned,y as splitOutlineIndexRings,I as tessellatedOutlineIndicesToVertexData};