@arcgis/core 4.34.0-next.61 → 4.34.0-next.64

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 (263) hide show
  1. package/AggregateGraphic.js +1 -1
  2. package/Graphic.js +1 -1
  3. package/TrackGraphic.js +1 -1
  4. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.js +1 -1
  5. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  6. package/applications/Components/actionUtils.d.ts +3 -0
  7. package/applications/Components/actionUtils.js +5 -0
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/{5de7c2a80bd9c81cefe2.js → 070b29cba896f46537f9.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{8c0e11f781607239749d.js → 0a36df6fdab95785d1ce.js} +1 -1
  11. package/assets/esri/core/workers/chunks/0b01c87db77246632ad9.js +1 -0
  12. package/assets/esri/core/workers/chunks/0b24a6c06d1becbb6815.js +1 -0
  13. package/assets/esri/core/workers/chunks/0cdf6b51f2a63f348530.js +1 -0
  14. package/assets/esri/core/workers/chunks/10ec10ca361842efce92.js +1 -0
  15. package/assets/esri/core/workers/chunks/{bdc18ef9cdc8242f014e.js → 1143313f2f6f34deaad7.js} +1 -1
  16. package/assets/esri/core/workers/chunks/226833d408eb1225e168.js +1 -0
  17. package/assets/esri/core/workers/chunks/2394ac65d64e50399d76.js +1 -0
  18. package/assets/esri/core/workers/chunks/33718ea851645d9078d1.js +1 -0
  19. package/assets/esri/core/workers/chunks/{69fbe363bb130fdd8146.js → 3d6f07e04f77cc0a7506.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{db7678104b18534482e3.js → 426232091caf8608e5f1.js} +1 -1
  21. package/assets/esri/core/workers/chunks/47febd4de836a33b51b1.js +1 -0
  22. package/assets/esri/core/workers/chunks/487afbf352d12c745430.js +1 -0
  23. package/assets/esri/core/workers/chunks/{3fd09a7c05583a57a317.js → 5d12862042b6bf9f9d54.js} +1 -1
  24. package/assets/esri/core/workers/chunks/5d65987f2c1b5c56a799.js +1 -0
  25. package/assets/esri/core/workers/chunks/5de07f7a09eb9f3ab666.js +1 -0
  26. package/assets/esri/core/workers/chunks/{ba0c7339fa19cc7cbde7.js → 5e1d6704ee0aa41b1d06.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{4ac127cefa3aa5e93e78.js → 657b01a6df8dc46c5209.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{71b222089f5e9dcee474.js → 6a1b652ccbf58ac44658.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{4050ddb580d364d9e205.js → 6ab435423acb0ed0b1c7.js} +1 -1
  30. package/assets/esri/core/workers/chunks/7b7f5028a488bb9c10f4.js +1 -0
  31. package/assets/esri/core/workers/chunks/{d83bdc13c3cad3eee7be.js → 7c3a1958990de095d3a1.js} +1 -1
  32. package/assets/esri/core/workers/chunks/808cfed7022e3846d5b2.js +1 -0
  33. package/assets/esri/core/workers/chunks/{b68b54be3d67595a9446.js → 861a6d6fe7958df36aa1.js} +35 -34
  34. package/assets/esri/core/workers/chunks/8bd5a0ff7dcf1067bf53.js +1 -0
  35. package/assets/esri/core/workers/chunks/{f462a138912e5379b6a7.js → 904c116c6b093e0e970c.js} +1 -1
  36. package/assets/esri/core/workers/chunks/99b20eef2893047fac10.js +1 -0
  37. package/assets/esri/core/workers/chunks/a16b471c3706ee37f9b6.js +1 -0
  38. package/assets/esri/core/workers/chunks/{bb2ab663e3e5597f2104.js → a1bd4eecca1e3272bffb.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{8005ae652361f506bc5f.js → a29fb90226bd08157bd1.js} +1 -1
  40. package/assets/esri/core/workers/chunks/a596d6ccb6103e594031.js +1 -0
  41. package/assets/esri/core/workers/chunks/a5e6359fadbd699b1c8e.js +1 -0
  42. package/assets/esri/core/workers/chunks/a7f3cdd9a249ef4572ce.js +1 -0
  43. package/assets/esri/core/workers/chunks/{d2bdd52d2291306a4e47.js → a80d769b0ed025f0df64.js} +1 -1
  44. package/assets/esri/core/workers/chunks/a987731d1b5449d8fb0c.js +1 -0
  45. package/assets/esri/core/workers/chunks/af83dddddbfe25194527.js +1 -0
  46. package/assets/esri/core/workers/chunks/{4d8d942fbd6750bb7567.js → b057e6d593c1607cae61.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{d707538b150d79050336.js → b1f1a26e7a2ef5b783ee.js} +1 -1
  48. package/assets/esri/core/workers/chunks/c337c1a2dbc452780dd7.js +1 -0
  49. package/assets/esri/core/workers/chunks/{a35a439f053d1fe0541b.js → c601bbdafdee5074b04f.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{d7ce68667bb355ef8e5d.js → c7a386ac90e58eb71935.js} +1 -1
  51. package/assets/esri/core/workers/chunks/c8694a27e2cf28b010e8.js +1 -0
  52. package/assets/esri/core/workers/chunks/cf69f6afeaf1229e032c.js +1 -0
  53. package/assets/esri/core/workers/chunks/d1e8220dcae1d01d3c35.js +1 -0
  54. package/assets/esri/core/workers/chunks/e12e8d69c05c182b6a69.js +1 -0
  55. package/assets/esri/core/workers/chunks/{220c8d6338f236298720.js → e6457ac25c0829ee039c.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{c77a97c723b8c17df186.js → e72aee3f857aa473822c.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{8374d87176486c1fc90e.js → eadac757f74470b89a36.js} +1 -1
  58. package/assets/esri/core/workers/chunks/f542bdc994a5ea3aa9d1.js +1 -0
  59. package/assets/esri/core/workers/chunks/{7c23be93d394f1bee941.js → f6107f844f4feed42828.js} +1 -1
  60. package/assets/esri/core/workers/chunks/f76774781865cb1411b0.js +1 -0
  61. package/assets/esri/core/workers/chunks/fd04df45cdcc6ff52554.js +1 -0
  62. package/assets/esri/layers/support/rasterFormats/qb3-wasm.wasm +0 -0
  63. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  64. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  65. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  66. package/chunks/BloomComposition.glsl.js +6 -5
  67. package/chunks/Fog.glsl.js +20 -13
  68. package/chunks/GaussianSplat.glsl.js +7 -0
  69. package/chunks/GaussianSplatComposition.glsl.js +7 -0
  70. package/chunks/GaussianSplatDepthComposition.glsl.js +11 -0
  71. package/chunks/RealisticTree.glsl.js +29 -28
  72. package/chunks/lyr3DMain.js +1 -1
  73. package/chunks/lyr3DWorker.js +1 -1
  74. package/chunks/qb3-wasm.js +5 -0
  75. package/chunks/vxlLayer.js +1 -1
  76. package/config.js +1 -1
  77. package/core/Collection.js +1 -1
  78. package/core/has.js +1 -1
  79. package/geometry/ellipsoidUtils.js +1 -1
  80. package/geometry/operators/geodeticUtilsOperator.d.ts +6 -0
  81. package/geometry/support/heightModelInfoUtils.js +1 -1
  82. package/graphic/AggregateGraphicOrigin.js +5 -0
  83. package/graphic/CSVGraphicOrigin.js +1 -1
  84. package/graphic/CatalogGraphicOrigin.js +1 -1
  85. package/graphic/FeatureGraphicOrigin.js +1 -1
  86. package/graphic/GeoJSONGraphicOrigin.js +1 -1
  87. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  88. package/graphic/OGCFeatureGraphicOrigin.js +1 -1
  89. package/graphic/OrientedImageryGraphicOrigin.js +1 -1
  90. package/graphic/ParquetGraphicOrigin.js +1 -1
  91. package/graphic/StreamGraphicOrigin.js +1 -1
  92. package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
  93. package/graphic/TrackGraphicOrigin.js +5 -0
  94. package/graphic/WFSGraphicOrigin.js +1 -1
  95. package/graphic/getPopupProvider.js +5 -0
  96. package/interfaces.d.ts +869 -38
  97. package/kernel.js +1 -1
  98. package/layers/GaussianSplatLayer.js +1 -1
  99. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  100. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  101. package/layers/VoxelWasmPerSceneView.js +1 -1
  102. package/layers/knowledgeGraph/nodeMovementUtils.js +1 -1
  103. package/layers/mixins/FeatureReductionLayer.js +1 -1
  104. package/layers/mixins/TrackableLayer.js +1 -1
  105. package/layers/support/GaussianSplatAtlasPageAllocator.js +5 -0
  106. package/layers/support/gaussianSplatUtils.js +5 -0
  107. package/layers/support/rasterDatasets/MRFRaster.js +1 -1
  108. package/layers/support/rasterFormats/Qb3.js +5 -0
  109. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  110. package/layers/support/tiles3DUtils.js +5 -0
  111. package/layers/video/VideoController.js +1 -1
  112. package/package.json +2 -2
  113. package/rest/knowledgeGraph/GraphApplyEditsResult.js +1 -1
  114. package/rest/knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js +1 -1
  115. package/rest/knowledgeGraphService.js +1 -1
  116. package/rest/lastMileDelivery/enums.js +5 -0
  117. package/rest/lastMileDelivery.d.ts +10 -0
  118. package/rest/lastMileDelivery.js +5 -0
  119. package/rest/route/utils.js +1 -1
  120. package/rest/support/JobInfo.js +1 -1
  121. package/rest/support/LastMileDeliveryParameters.d.ts +4 -0
  122. package/rest/support/LastMileDeliveryParameters.js +5 -0
  123. package/support/revision.js +1 -1
  124. package/symbols/IconSymbol3DLayer.js +1 -1
  125. package/symbols/TextSymbol3DLayer.js +1 -1
  126. package/symbols/patterns/StylePattern3D.js +1 -1
  127. package/symbols/patterns/styles.js +1 -1
  128. package/symbols/support/IconSymbol3DLayerResource.js +1 -1
  129. package/symbols/support/OccludedVisibility.js +5 -0
  130. package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
  131. package/symbols/support/Symbol3DIconOutline.js +1 -1
  132. package/unionTypes.d.ts +3 -0
  133. package/views/2d/analysis/AnalysisView2D.js +5 -0
  134. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +4 -0
  135. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +5 -0
  136. package/views/2d/analysis/analysisViewModuleImportUtils.js +5 -0
  137. package/views/2d/engine/webgl/Painter.js +1 -1
  138. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  139. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +5 -0
  140. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsDiffShader.js +5 -0
  141. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsMinMaxSumShader.js +5 -0
  142. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsStdDevShader.js +5 -0
  143. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsSumOfSquaredDiffShader.js +5 -0
  144. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  146. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  147. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  148. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  149. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  150. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  151. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  152. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  153. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  154. package/views/3d/analysis/AnalysisView3D.js +1 -1
  155. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  156. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  157. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  158. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +1 -1
  159. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +1 -1
  160. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization.js +5 -0
  161. package/views/3d/analysis/ElevationProfile/ElevationProfileSceneLineComputation.js +1 -1
  162. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +1 -1
  163. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  164. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  165. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  166. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  167. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  168. package/views/3d/analysis/analysisViewModuleImportUtils.js +5 -0
  169. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  170. package/views/3d/environment/Fog.glsl.js +1 -1
  171. package/views/3d/environment/Fog.js +1 -1
  172. package/views/3d/environment/FogTechniqueConfiguration.js +5 -0
  173. package/views/3d/environment/Precipitation.js +1 -1
  174. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  175. package/views/3d/layers/GraphicsView3D.js +1 -1
  176. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  177. package/views/3d/layers/{IntegratedMesh3DTilesViewPerformanceInfo.js → Lyr3DViewPerformanceInfo.js} +1 -1
  178. package/views/3d/layers/Lyr3DWasm.js +1 -1
  179. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  180. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  181. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  182. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  183. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  184. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  185. package/views/3d/layers/graphics/Labeler.js +1 -1
  186. package/views/3d/layers/support/LayerViewAnalysisViewManager.js +1 -1
  187. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  188. package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
  189. package/views/3d/support/QualitySettings.js +1 -1
  190. package/views/3d/support/pointsOfInterest/ContentGeometryUpdates.js +1 -1
  191. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  192. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  193. package/views/3d/webgl-engine/core/shaderLibrary/util/ComputeCovariance.glsl.js +40 -0
  194. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +59 -0
  195. package/views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js +23 -0
  196. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  197. package/views/3d/webgl-engine/effects/bloom/BloomComposition.glsl.js +1 -1
  198. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +1 -1
  199. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  200. package/views/3d/webgl-engine/effects/weather/SnowCover.glsl.js +4 -4
  201. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  202. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +5 -0
  203. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  204. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  205. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  206. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  207. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +5 -0
  208. package/views/3d/webgl-engine/shaders/GaussianSplatComposition.glsl.js +5 -0
  209. package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechnique.js +5 -0
  210. package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechniqueConfiguration.js +5 -0
  211. package/views/3d/webgl-engine/shaders/GaussianSplatDepthComposition.glsl.js +5 -0
  212. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +5 -0
  213. package/views/3d/webgl-engine/shaders/GaussianSplatDepthTechnique.js +5 -0
  214. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +5 -0
  215. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +5 -0
  216. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  217. package/views/SceneView.js +1 -1
  218. package/views/VideoView.js +1 -1
  219. package/views/View2D.js +1 -1
  220. package/views/analysis/AnalysisView.js +5 -0
  221. package/views/analysis/ElevationProfile/ElevationProfileInputLineComputation.js +1 -1
  222. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  223. package/views/analysis/ElevationProfile/ElevationProfileTool.js +5 -0
  224. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  225. package/views/layers/FeatureLayerView.js +1 -1
  226. package/views/support/AnalysisViewManager.js +1 -1
  227. package/views/webgl/FramebufferObject.js +1 -1
  228. package/widgets/CoordinateConversion/support/Format.js +1 -1
  229. package/widgets/Locate/LocateViewModel.js +1 -1
  230. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  231. package/widgets/Popup/actionUtils.js +1 -1
  232. package/assets/esri/core/workers/chunks/08d420cd7cfa19a10fa4.js +0 -1
  233. package/assets/esri/core/workers/chunks/17abab49db1813d3e192.js +0 -1
  234. package/assets/esri/core/workers/chunks/182383fd00008606bfaa.js +0 -1
  235. package/assets/esri/core/workers/chunks/188feb2bcbf8e48e3163.js +0 -1
  236. package/assets/esri/core/workers/chunks/232c76f122b1f519e099.js +0 -1
  237. package/assets/esri/core/workers/chunks/3124a8516e815efec973.js +0 -1
  238. package/assets/esri/core/workers/chunks/3461701a15be46603c56.js +0 -1
  239. package/assets/esri/core/workers/chunks/36acf191a2d48560c796.js +0 -1
  240. package/assets/esri/core/workers/chunks/40e1fbfbf3f3979b3713.js +0 -1
  241. package/assets/esri/core/workers/chunks/4b1daffa97fd90a554a0.js +0 -1
  242. package/assets/esri/core/workers/chunks/4b68783e8d1415d0a171.js +0 -1
  243. package/assets/esri/core/workers/chunks/5915f5ba9064097aee79.js +0 -1
  244. package/assets/esri/core/workers/chunks/5e1afea05b624b315d9f.js +0 -1
  245. package/assets/esri/core/workers/chunks/5ed7e139c72cd2b3ddba.js +0 -1
  246. package/assets/esri/core/workers/chunks/63f3e46bfa820436161c.js +0 -1
  247. package/assets/esri/core/workers/chunks/702d2c668dedf83421ca.js +0 -1
  248. package/assets/esri/core/workers/chunks/7b2ec80dca0fdb0442cf.js +0 -1
  249. package/assets/esri/core/workers/chunks/7b9178c3826f9ef52a00.js +0 -1
  250. package/assets/esri/core/workers/chunks/9a20390602126995f831.js +0 -1
  251. package/assets/esri/core/workers/chunks/a2150baf0661e2f28011.js +0 -1
  252. package/assets/esri/core/workers/chunks/a532614aa65fb52dee7b.js +0 -1
  253. package/assets/esri/core/workers/chunks/abededd48e0ea6cfec01.js +0 -1
  254. package/assets/esri/core/workers/chunks/ae1cb4c65d72217ae4d4.js +0 -1
  255. package/assets/esri/core/workers/chunks/c1c6202f7bef24b5db26.js +0 -1
  256. package/assets/esri/core/workers/chunks/c75b0243e5bb84738419.js +0 -1
  257. package/assets/esri/core/workers/chunks/d47c3431c501d77b1779.js +0 -1
  258. package/assets/esri/core/workers/chunks/f6d91256c4e5f8a0d5c0.js +0 -1
  259. package/assets/esri/core/workers/chunks/f711aeba1a2c184ddb43.js +0 -1
  260. package/graphic/isPopupProviderGraphicOrigin.js +0 -5
  261. package/views/2d/analysisViewModuleImportUtils.js +0 -5
  262. package/views/3d/analysis/ElevationProfile/ElevationProfileLinesVisualization.js +0 -5
  263. package/views/3d/analysisViewModuleImportUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{forEach as s,result as i}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import l from"../../../../core/Logger.js";import{disposeMaybe as a,abortMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as o,isAbortError as n}from"../../../../core/promiseUtils.js";import{watch as c}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as b}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{hydrateGraphic as p}from"../../../../layers/graphics/hydratedFeatures.js";import{createLabelFunction as d}from"../../../../layers/support/labelFormatUtils.js";import{hasCalloutSupport as y}from"../../../../symbols/callouts/calloutUtils.js";import{make as g}from"./Graphics3DCalloutSymbolLayerFactory.js";import{LineCalloutCreationContext as f,LineCalloutSymbolLayerRenderingInfo as m}from"./Graphics3DLineCalloutSymbolLayer.js";import{getGraphics3DSymbol as C}from"./graphicSymbolUtils.js";import{LabelInfo as x}from"./LabelInfo.js";import{LabelParameters as _}from"./LabelParameters.js";import{horizontalPlacementFromAnchor as L,verticalPlacementFromAnchor as v,textRenderAlignmentFromHorizontalPlacement as G}from"./placementUtils.js";import{placePointOnGeometry as w}from"./pointUtils.js";import{TextRenderer as D}from"../../webgl-engine/lib/TextRenderer.js";import{TextRenderParameters as A}from"../../webgl-engine/lib/TextRenderParameters.js";import{TextTextureAtlas as T}from"../../webgl-engine/lib/TextTextureAtlas.js";import{WebGLLayer as I}from"../../webgl-engine/lib/WebGLLayer.js";import{hasLayerBasedScaleVisibility as S,isInEffectiveScaleRange as R}from"../../../support/layerViewUtils.js";import{TaskPriority as P}from"../../../support/Scheduler.js";import{Yield as j}from"../../../support/Yield.js";class V{constructor(e,t){this.labelingContext=e,this.graphics3DGraphic=t,this.hasGraphics3DResources=!1,this.visible=!1,this.textureAtlasHandles=[],this.textInitialized=!1,this.textRenderers=new Array,this.textLabelPlacements=new Array}}class O{constructor(e,t,s,i,l){this.labelClass=e,this.graphics3DSymbol=t,this.graphics3DCalloutSymbolLayer=s,this.textRenderParameters=i,this.labelFunction=l,this.calloutSymbolLayerIndex=0,this.graphics=new Map,this.scaleVisibility=null}}class z{constructor(e,t,s,i,l,a,r,o){this.layer=t,this.graphics3DCore=s,this.scaleVisibility=i,this.emptySymbolLabelSupported=l,this.elevationInfoOverride=a,this.disablePlacement=r,this.active=o,this.labelClassAbortController=new AbortController,this._labelClassContexts=new Array,this.graphics=new Map,this.labelsToInitialize=new Map,this.stageLayer=new I(e,{pickable:!0},s.owner.layerViewUid)}destroy(){this.stageLayer.destroy()}get labelClassContexts(){return this._labelClassContexts}setLabelClassContext(e,t){this._labelClassContexts[e]=t}resetLabelClassContext(){this._labelClassContexts.length=0}}let E=class extends t{constructor(e){super(e),this._hudMaterials=new Map,this._calloutMaterials=new Map,this._dirty=!1,this._labels=new Map,this._labelingContexts=new Array}setup(){this.dispose(),this.addHandles([c(()=>this.view.state?.camera,()=>this.setDirty()),c(()=>this.view.state?.rasterPixelRatio,()=>this._resetAllLabels()),c(()=>this.view.focusAreasView?.polygons,()=>this._updateFocus()),this.view.resourceController.scheduler.registerTask(P.LABELER,this)]),S()&&this.addHandles(c(()=>this.view.scale,()=>this._updateScaleVisibility())),this._textTextureAtlas=new T({view:this.view})}dispose(){this.removeAllHandles(),this._textTextureAtlas=a(this._textTextureAtlas),this._hudMaterials.clear(),this._calloutMaterials.clear(),this._labelingContexts.length=0,this._labels.clear()}destroy(){this.dispose(),B.graphic=null,B.renderingInfo=null,B.layer=null}_updateFocus(){this._labelingContexts.forEach(e=>{e.graphics.forEach(t=>{if(0===t.labelLayers.length)return;const s=w(t.graphic.geometry);if(null==s)return;const i=this.view.focusAreasView?.containsGeometry(s)??!0;t.labelLayers.forEach(s=>{s.stageObject.geometries.some(e=>e.material.parameters.isFocused!==i)&&(this._removeGraphic(e,t),this._addGraphic(e,t),this.setDirty())})})})}_activateLabelingContext(e){e.graphics.forEach((t,s)=>{const i=new V(e,t);this._labels.set(s,i),e.labelsToInitialize.set(s,i),t.setVisibilityFlag(16,1,!0)}),e.active=!0}_deactivateLabelingContext(e){e.graphics.forEach((e,t)=>{e.setVisibilityFlag(16,1,!1),this.setLabelGraphicVisibility(e,!1),e.clearLabelGraphics(),this._labels.delete(t)}),e.active=!1}_addLabelTextureToAtlas(e){if(this._textTextureAtlas)for(const t of e.graphics3DGraphic.labelLayers){if(!t.labelClass)continue;const s=e.textRenderers[t.labelClassContextIndex];s&&(e.textureAtlasHandles.push(this._textTextureAtlas.addText(s,e=>M(t.stageObject,e))),F(t.stageObject,s))}}_removeLabelTextureFromAtlas(e){e.textureAtlasHandles.forEach(e=>e.remove()),e.textureAtlasHandles.length=0}get readyToRun(){return this.view.ready&&(this._dirty||this.deconflictor.readyToRun)}runTask(e){return this._updateLabels(e),!this._dirty&&this.deconflictor.readyToRun&&this.deconflictor.runTask(e),j}_updateLabels(e){if(this._dirty){this._dirty=!1;for(const t of this._labelingContexts)if(t.active)if(H(t))this._dirty=!0;else if(U(t.labelClassContexts)){if(null===t.labelClassContexts){this._deactivateLabelingContext(t);continue}this._createLabelClassContext(t),this._dirty=!0}else for(const[s,i]of t.labelsToInitialize)if(this._ensureGraphics3DResources(i)&&(this._labels.set(s,i),this.deconflictor.setDirty(),e.madeProgress()),(i.visible&&i.textInitialized||!i.visible&&i.hasGraphics3DResources)&&(t.labelsToInitialize.delete(s),e.madeProgress()),e.done){this._dirty=!0;break}this._dirty||this.notifyChange("updating")}}async _createLabelClassContextAsync(e){const t=e.labelClassAbortController?.signal;e.layer.when&&await e.layer.when(),o(t),e.scaleVisibility?.updateScaleRangeActive();const a=e.graphics3DCore,r=a.layer,n=r.labelingInfo?.filter(e=>!!e.symbol);if(!n||0===n.length)return;let c=!1;await s(n,async(s,r)=>{const n=s.symbol,h=C(a.getOrCreateGraphics3DSymbol(n));if(null==h)return void l.getLogger(this).error("Failed to create Graphics3DSymbol for label");await h.load(),o(t);let b=null;y(n)&&n.hasVisibleCallout()&&(b=g(n,a.symbolCreationContext),await b.load(),o(t));const u=await i(d(s,e.layer.fieldsIndex,this.view.spatialReference));if(o(t),!0===u.ok){const i=await this._createTextRenderParameters(h.symbol);o(t);const l=new O(s,h,b,i,u.value);this._updateLabelClassContextVisibility(l),e.setLabelClassContext(r,l)}else l.getLogger(this).error(`Label expression failed to evaluate: ${u.error}`),c=!0}),o(t)}async _createLabelClassContext(e){return null==e.labelClassPromise&&(e.labelClassPromise=this._createLabelClassContextAsync(e).catch(t=>{if(n(t))throw t;e.resetLabelClassContext()}).then(()=>{e.labelClassAbortController=null,this.notifyChange("updating")}).catch(()=>{}),this.notifyChange("updating")),e.labelClassPromise}async _createTextRenderParameters(e){const t=e.symbolLayers.at(0);return"text"!==t?.type?null:A.fromSymbol(t,this.view.state.rasterPixelRatio)}_destroyLabelClassContext(e){for(const s of e.labelClassContexts)--s.graphics3DSymbol.referenced;const t=e.labelClassAbortController;e.labelClassAbortController=new AbortController,r(t),e.resetLabelClassContext(),e.labelClassPromise=null,this.notifyChange("updating")}_createTextSymbolGraphic(e,t,s,i,l,a){if(!this._textTextureAtlas)return null;const r=new _(s,L(s.anchor),v(s.anchor),e.text,u(e.displayWidth,e.displayHeight));return B.graphic=t,B.layer=i,B.renderingInfo=null,l.createLabel(B,r,this._hudMaterials,this._textTextureAtlas,()=>a.placement?.elevationOffset??null)}_createLineCalloutGraphic(e,t,s,i,l){B.graphic=e,B.layer=l;const a=i.screenOffset[0];return B.renderingInfo=new m(null,t,i.translation,i.centerOffset,a,i.centerOffsetUnits,i.elevationOffset),s.createGraphics3DGraphic(B,this._calloutMaterials)}_ensureGraphics3DResources(e){if(e.hasGraphics3DResources)return!1;const t=e.graphics3DGraphic;if(t.destroyed)return!1;this._ensureTextTextureResources(e);const s=e.labelingContext,i=s.labelClassContexts;if(U(i)||!s.emptySymbolLabelSupported&&0===t.layers.length)return!1;let l=!1;const a=t.graphic,r=s.layer,o=W(s.layer);for(let n=0;n<i.length;n++){const c=e.textRenderers[n],h=e.textLabelPlacements[n];if(null==c||null==h)continue;const b=i[n],u=b.graphics3DSymbol,p=k(u),d=u.symbolLayers[0];if(!d)continue;d.setElevationInfoOverride(s.elevationInfoOverride);const y=new x(t,p,b.labelClass),g=this._createTextSymbolGraphic(c,a,h,r,d,y);if(null==g)return!1;g.labelClass=b.labelClass,g.labelClassContextIndex=n,t.addLabelGraphic(g,s.stageLayer),this.deconflictor.setPriority(t,b.textRenderParameters?.definition.size??0),t.setVisibilityFlag(16,1,o),t.setVisibilityFlag(16,2,b.scaleVisibility??!0),t.setVisibilityFlag(16,8,!1),S()&&b.graphics.set(a.uid,t),l=!0;const f=b.graphics3DCalloutSymbolLayer;if(f&&h.hasLabelVerticalOffset){f.setElevationInfoOverride(s.elevationInfoOverride);const e=this._createLineCalloutGraphic(a,p,f,h,r);null!=e&&(b.calloutSymbolLayerIndex=t.labelLayers.length,t.addLabelGraphic(e,s.stageLayer))}break}return l&&s.scaleVisibility?.updateGraphicLabelScaleVisibility(t),e.hasGraphics3DResources=!0,!0}_destroyGraphics3DResources(e){const t=e.labelingContext.labelClassContexts;for(const s of e.graphics3DGraphic.labelLayers){if(null==s.labelClass)continue;const e=t[s.labelClassContextIndex].graphics3DSymbol.symbolLayers[0];e?.onRemoveGraphic(s)}e.graphics3DGraphic.clearLabelGraphics(),e.hasGraphics3DResources=!1}_ensureTextTextureResources(e){if(e.textInitialized)return;const t=e.labelingContext,s=t.labelClassContexts;if(U(s))return;const i=e.graphics3DGraphic.graphic;for(let a=0;a<s.length;a++){const r=s[a];if(e.textRenderers[a]=null,e.textLabelPlacements[a]=null,null==r?.textRenderParameters)continue;const o=r.labelFunction;let n;if("arcade"===o.type)try{const e=o.needsHydrationToEvaluate()?p(i,t.layer,null):i;n=o.evaluate(e)}catch(l){n=null}else n=o.evaluate(i);if(null==n||""===n||/^\s+$/.test(n))continue;const c=r.graphics3DSymbol;if(!c.symbolLayers[0])continue;const h=e.graphics3DGraphic,b="label-3d"===c.symbol?.type?c.symbol:null,u=r.labelClass,d=t.disablePlacement,y=new x(h,b,u,d).placement;if(null==y)continue;const g=L(y.anchor),f=G(g);e.textRenderers[a]=new D(n,f,r.textRenderParameters,T.maxSize),e.textLabelPlacements[a]=y}e.textInitialized=!0}_destroyTextTextureResources(e){e.textInitialized=!1,e.textRenderers.length=0,e.textLabelPlacements.length=0}_addGraphic(e,t){const s=t.graphic.uid;if(e.graphics.set(s,t),e.active){const i=new V(e,t);this._labels.set(s,i),e.labelsToInitialize.set(s,i)}this.setDirty(),this.deconflictor.setDirty()}_updateGraphicGeometry(e,t){const s=t.graphic.uid,i=this._labels.get(s);if(!i)return!0;for(const l of i.graphics3DGraphic.labelLayers){if(null==l.labelClass)continue;if(!e.labelClassContexts[l.labelClassContextIndex].graphics3DSymbol.symbolLayers[0].updateGeometry(l,t.graphic.geometry))return!1}return this.setDirty(),this.deconflictor.setDirty(),!0}_removeGraphic(e,t){const s=t.graphic.uid,i=this._labels.get(s);e.graphics.delete(s),e.labelClassContexts.forEach(e=>e.graphics.delete(s)),i&&(this._destroyGraphic(i,s),e.labelsToInitialize.delete(s),this.setDirty(),this.deconflictor.setDirty())}_destroyGraphic(e,t){this._labels.delete(t),e.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(e),this._destroyTextTextureResources(e),e.hasGraphics3DResources&&this._destroyGraphics3DResources(e)}async _labelingInfoChange(e,t){if(!t)return this._visibilityInfoChange(e),this._resetLabels(e),this._createLabelClassContext(e);for(const s of t){const t=e.graphics.get(s);t&&(this._removeGraphic(e,t),this._addGraphic(e,t))}}_globalPropertyChanged(e,t){for(const s of t.labelClassContexts){const i=new Map;t.graphics.forEach(e=>i.set(e.graphic.uid,e));const l=e=>e.labelLayers[0];if(s.graphics3DSymbol.symbolLayers[0].globalPropertyChanged(e,i,l),s.graphics3DCalloutSymbolLayer){const t=e=>e.labelLayers[s.calloutSymbolLayerIndex];s.graphics3DCalloutSymbolLayer.globalPropertyChanged(e,i,t)}}}_visibilityInfoChange(e){const t=W(e.layer);t&&!e.active&&this._activateLabelingContext(e),!t&&e.active&&this._deactivateLabelingContext(e),this.setDirty()}_resetAllLabels(){for(const e of this._labelingContexts)this._resetLabels(e)}_resetLabels(e){e.graphics.forEach((t,s)=>{const i=this._labels.get(s);i&&(this._destroyGraphic(i,s),i.visible=!1,e.labelsToInitialize.set(s,i))}),this._destroyLabelClassContext(e),this.setDirty(),this.deconflictor.setDirty()}_findLabelingContext(e){for(const t of this._labelingContexts)if(t.graphics3DCore===e)return t;return null}addGraphicsOwner(e,t,s){const i=s?.emptySymbolLabelSupported||!1,l=s?.elevationInfoOverride||null,a=s?.disablePlacement||null;if(this._findLabelingContext(e))return;const r=e.layer,o=new z(this.view.stage,r,e,t,i,l,a,W(r));return this._labelingContexts.push(o),this.setDirty(),{addGraphic:e=>this._addGraphic(o,e),removeGraphic:e=>this._removeGraphic(o,e),updateGraphicGeometry:e=>this._updateGraphicGeometry(o,e),layerLabelsEnabled:()=>W(o.layer),labelingInfoChange:e=>this._labelingInfoChange(o,e),elevationInfoChange:()=>this._globalPropertyChanged("elevationInfo",o),slicePlaneEnabledChange:()=>this._globalPropertyChanged("slicePlaneEnabled",o),visibilityInfoChange:()=>this._visibilityInfoChange(o),reset:()=>this._resetLabels(o),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty()}}_removeGraphicsOwner(e){const t=this._findLabelingContext(e);if(!t)return;const s=this._labelingContexts.indexOf(t);this._labelingContexts.splice(s,1),t.graphics.forEach(e=>this._removeGraphic(t,e)),t.destroy(),this.setDirty()}_updateScaleVisibility(){for(const e of this._labelingContexts)if(e.active&&!H(e))for(const t of e.labelClassContexts)this._updateLabelClassContextVisibility(t)}_updateLabelClassContextVisibility(e){if(!S())return;const{labelClass:t,graphics:s}=e,i={minScale:t.minScale,maxScale:t.maxScale},l=R(i,this.view.scale),a=null==e.scaleVisibility||e.scaleVisibility!==l;e.scaleVisibility=l,a&&s.size&&(s.forEach(e=>e.setVisibilityFlag(16,2,l)),this.deconflictor.setDirty(),this.setDirty())}setLabelGraphicVisibility(e,t){const s=e.graphic.uid,i=this._labels.get(s);i&&i.visible!==t&&(t&&!i.textureAtlasHandles.length?(this._addLabelTextureToAtlas(i),i.textInitialized||i.labelingContext.labelsToInitialize.set(s,i)):!t&&i.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(i),i.visible=t,this.setDirty())}setDirty(){!this._dirty&&this._labelingContexts.length>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._dirty||this._textTextureAtlas?.updating||this.deconflictor.updating||this._labelingContexts.some(e=>H(e))}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;const e=this._labelingContexts.length>0?this._labelingContexts.reduce((e,t)=>e+(H(t)?0:1),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?0:.1)+.1*e+.5*this.deconflictor.updatingProgress}get usedMemory(){return this._textTextureAtlas?.usedMemory??0}get test(){}};function F(e,t){e.geometries[0].setAttributeData("size",[t.displayWidth,t.displayHeight]),e.geometryVertexAttributeUpdated(e.geometries[0],"size")}function M(e,t){e.geometries[0].setAttributeData("uvi",t),e.geometryVertexAttributeUpdated(e.geometries[0],"uvi",!0)}function H(e){return!!e.labelClassPromise&&!!e.labelClassAbortController}function U(e){return!e||0===e.length}function k(e){return"label-3d"===e.symbol?.type?e.symbol:null}function W(e){return!!e.labelsVisible&&!!e.labelingInfo?.some(e=>!!e.symbol)}e([h({constructOnly:!0})],E.prototype,"view",void 0),e([h({constructOnly:!0})],E.prototype,"deconflictor",void 0),e([h()],E.prototype,"_textTextureAtlas",void 0),e([h({type:Boolean,readOnly:!0})],E.prototype,"updating",null),E=e([b("esri.views.3d.layers.graphics.Labeler")],E);const B=new f(null,null,null);export{E as Labeler,W as areLabelsVisible};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{forEach as s,result as i}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import a from"../../../../core/Logger.js";import{disposeMaybe as l,abortMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as o,isAbortError as n}from"../../../../core/promiseUtils.js";import c from"../../../../core/Queue.js";import{watch as h}from"../../../../core/reactiveUtils.js";import{property as b}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{hydrateGraphic as d}from"../../../../layers/graphics/hydratedFeatures.js";import{createLabelFunction as y}from"../../../../layers/support/labelFormatUtils.js";import{hasCalloutSupport as g}from"../../../../symbols/callouts/calloutUtils.js";import{make as f}from"./Graphics3DCalloutSymbolLayerFactory.js";import{LineCalloutCreationContext as m,LineCalloutSymbolLayerRenderingInfo as C}from"./Graphics3DLineCalloutSymbolLayer.js";import{getGraphics3DSymbol as x}from"./graphicSymbolUtils.js";import{LabelInfo as _}from"./LabelInfo.js";import{LabelParameters as L}from"./LabelParameters.js";import{horizontalPlacementFromAnchor as v,verticalPlacementFromAnchor as G,textRenderAlignmentFromHorizontalPlacement as w}from"./placementUtils.js";import{placePointOnGeometry as A}from"./pointUtils.js";import{TextRenderer as D}from"../../webgl-engine/lib/TextRenderer.js";import{TextRenderParameters as T}from"../../webgl-engine/lib/TextRenderParameters.js";import{TextTextureAtlas as I}from"../../webgl-engine/lib/TextTextureAtlas.js";import{WebGLLayer as S}from"../../webgl-engine/lib/WebGLLayer.js";import{hasLayerBasedScaleVisibility as R,isInEffectiveScaleRange as P}from"../../../support/layerViewUtils.js";import{TaskPriority as j}from"../../../support/Scheduler.js";import{Yield as V}from"../../../support/Yield.js";class O{constructor(e,t){this.labelingContext=e,this.graphics3DGraphic=t,this.hasGraphics3DResources=!1,this.visible=!1,this.textureAtlasHandles=[],this.textInitialized=!1,this.textRenderers=new Array,this.textLabelPlacements=new Array}}class F{constructor(e,t,s,i,a){this.labelClass=e,this.graphics3DSymbol=t,this.graphics3DCalloutSymbolLayer=s,this.textRenderParameters=i,this.labelFunction=a,this.calloutSymbolLayerIndex=0,this.graphics=new Map,this.scaleVisibility=null}}class z{constructor(e,t,s,i,a,l,r,o){this.layer=t,this.graphics3DCore=s,this.scaleVisibility=i,this.emptySymbolLabelSupported=a,this.elevationInfoOverride=l,this.disablePlacement=r,this.active=o,this.labelClassAbortController=new AbortController,this._labelClassContexts=new Array,this.graphics=new Map,this.labelsToInitialize=new Map,this.stageLayer=new S(e,{pickable:!0},s.owner.layerViewUid)}destroy(){this.stageLayer.destroy()}get labelClassContexts(){return this._labelClassContexts}setLabelClassContext(e,t){this._labelClassContexts[e]=t}resetLabelClassContext(){this._labelClassContexts.length=0}}let E=class extends t{constructor(e){super(e),this._hudMaterials=new Map,this._calloutMaterials=new Map,this._dirty=!1,this._focusAreasLabelsQueue=new c,this._labels=new Map,this._labelingContexts=new Array}setup(){this.dispose(),this.addHandles([h(()=>this.view.state?.camera,()=>this.setDirty()),h(()=>this.view.state?.rasterPixelRatio,()=>this._resetAllLabels()),h(()=>this.view.focusAreasView?.polygons,()=>this._updateFocus()),this.view.resourceController.scheduler.registerTask(j.LABELER,this)]),R()&&this.addHandles(h(()=>this.view.scale,()=>this._updateScaleVisibility())),this._textTextureAtlas=new I({view:this.view})}dispose(){this.removeAllHandles(),this._textTextureAtlas=l(this._textTextureAtlas),this._hudMaterials.clear(),this._calloutMaterials.clear(),this._labelingContexts.length=0,this._labels.clear()}destroy(){this.dispose(),B.graphic=null,B.renderingInfo=null,B.layer=null}_updateFocus(){this._focusAreasLabelsQueue.clear(),this._labelingContexts.forEach(e=>{e.graphics.forEach(t=>{this._focusAreasLabelsQueue.push({graphic3DGraphic:t,labelingContext:e})})})}_activateLabelingContext(e){e.graphics.forEach((t,s)=>{const i=new O(e,t);this._labels.set(s,i),e.labelsToInitialize.set(s,i),t.setVisibilityFlag(16,1,!0)}),e.active=!0}_deactivateLabelingContext(e){e.graphics.forEach((e,t)=>{e.setVisibilityFlag(16,1,!1),this.setLabelGraphicVisibility(e,!1),e.clearLabelGraphics(),this._labels.delete(t)}),e.active=!1}_addLabelTextureToAtlas(e){if(this._textTextureAtlas)for(const t of e.graphics3DGraphic.labelLayers){if(!t.labelClass)continue;const s=e.textRenderers[t.labelClassContextIndex];s&&(e.textureAtlasHandles.push(this._textTextureAtlas.addText(s,e=>U(t.stageObject,e))),M(t.stageObject,s))}}_removeLabelTextureFromAtlas(e){e.textureAtlasHandles.forEach(e=>e.remove()),e.textureAtlasHandles.length=0}get readyToRun(){return this.view.ready&&(this._dirty||this.deconflictor.readyToRun||this._focusAreasLabelsQueue.length>0)}runTask(e){return this._updateLabels(e),this._applyFocusAreasUpdates(e),!this._dirty&&this.deconflictor.readyToRun&&this.deconflictor.runTask(e),V}_updateLabels(e){if(this._dirty){this._dirty=!1;for(const t of this._labelingContexts)if(t.active)if(H(t))this._dirty=!0;else if(Q(t.labelClassContexts)){if(null===t.labelClassContexts){this._deactivateLabelingContext(t);continue}this._createLabelClassContext(t),this._dirty=!0}else for(const[s,i]of t.labelsToInitialize)if(this._ensureGraphics3DResources(i)&&(this._labels.set(s,i),this.deconflictor.setDirty(),e.madeProgress()),(i.visible&&i.textInitialized||!i.visible&&i.hasGraphics3DResources)&&(t.labelsToInitialize.delete(s),e.madeProgress()),e.done){this._dirty=!0;break}this._dirty||this.notifyChange("updating")}}_applyFocusAreasUpdates(e){for(;this._focusAreasLabelsQueue.length>0&&!e.done;){e.madeProgress();const{graphic3DGraphic:t,labelingContext:s}=this._focusAreasLabelsQueue.pop();if(0===t.labelLayers.length)return;if(!s.active)continue;const i=A(t.graphic.geometry);if(null==i)return;const a=this.view.focusAreasView?.containsGeometry(i)??!0;t.labelLayers.forEach(e=>{e.stageObject.geometries.some(e=>e.material.parameters.isFocused!==a)&&(this._removeGraphic(s,t),this._addGraphic(s,t),this.setDirty())})}0===this._focusAreasLabelsQueue.length&&this.notifyChange("readyToRun")}async _createLabelClassContextAsync(e){const t=e.labelClassAbortController?.signal;e.layer.when&&await e.layer.when(),o(t),e.scaleVisibility?.updateScaleRangeActive();const l=e.graphics3DCore,r=l.layer,n=r.labelingInfo?.filter(e=>!!e.symbol);if(!n||0===n.length)return;let c=!1;await s(n,async(s,r)=>{const n=s.symbol,h=x(l.getOrCreateGraphics3DSymbol(n));if(null==h)return void a.getLogger(this).error("Failed to create Graphics3DSymbol for label");await h.load(),o(t);let b=null;g(n)&&n.hasVisibleCallout()&&(b=f(n,l.symbolCreationContext),await b.load(),o(t));const u=await i(y(s,e.layer.fieldsIndex,this.view.spatialReference));if(o(t),!0===u.ok){const i=await this._createTextRenderParameters(h.symbol);o(t);const a=new F(s,h,b,i,u.value);this._updateLabelClassContextVisibility(a),e.setLabelClassContext(r,a)}else a.getLogger(this).error(`Label expression failed to evaluate: ${u.error}`),c=!0}),o(t)}async _createLabelClassContext(e){return null==e.labelClassPromise&&(e.labelClassPromise=this._createLabelClassContextAsync(e).catch(t=>{if(n(t))throw t;e.resetLabelClassContext()}).then(()=>{e.labelClassAbortController=null,this.notifyChange("updating")}).catch(()=>{}),this.notifyChange("updating")),e.labelClassPromise}async _createTextRenderParameters(e){const t=e.symbolLayers.at(0);return"text"!==t?.type?null:T.fromSymbol(t,this.view.state.rasterPixelRatio)}_destroyLabelClassContext(e){for(const s of e.labelClassContexts)--s.graphics3DSymbol.referenced;const t=e.labelClassAbortController;e.labelClassAbortController=new AbortController,r(t),e.resetLabelClassContext(),e.labelClassPromise=null,this.notifyChange("updating")}_createTextSymbolGraphic(e,t,s,i,a,l){if(!this._textTextureAtlas)return null;const r=new L(s,v(s.anchor),G(s.anchor),e.text,p(e.displayWidth,e.displayHeight));return B.graphic=t,B.layer=i,B.renderingInfo=null,a.createLabel(B,r,this._hudMaterials,this._textTextureAtlas,()=>l.placement?.elevationOffset??null)}_createLineCalloutGraphic(e,t,s,i,a){B.graphic=e,B.layer=a;const l=i.screenOffset[0];return B.renderingInfo=new C(null,t,i.translation,i.centerOffset,l,i.centerOffsetUnits,i.elevationOffset),s.createGraphics3DGraphic(B,this._calloutMaterials)}_ensureGraphics3DResources(e){if(e.hasGraphics3DResources)return!1;const t=e.graphics3DGraphic;if(t.destroyed)return!1;this._ensureTextTextureResources(e);const s=e.labelingContext,i=s.labelClassContexts;if(Q(i)||!s.emptySymbolLabelSupported&&0===t.layers.length)return!1;let a=!1;const l=t.graphic,r=s.layer,o=W(s.layer);for(let n=0;n<i.length;n++){const c=e.textRenderers[n],h=e.textLabelPlacements[n];if(null==c||null==h)continue;const b=i[n],u=b.graphics3DSymbol,p=k(u),d=u.symbolLayers[0];if(!d)continue;d.setElevationInfoOverride(s.elevationInfoOverride);const y=new _(t,p,b.labelClass),g=this._createTextSymbolGraphic(c,l,h,r,d,y);if(null==g)return!1;g.labelClass=b.labelClass,g.labelClassContextIndex=n,t.addLabelGraphic(g,s.stageLayer),this.deconflictor.setPriority(t,b.textRenderParameters?.definition.size??0),t.setVisibilityFlag(16,1,o),t.setVisibilityFlag(16,2,b.scaleVisibility??!0),t.setVisibilityFlag(16,8,!1),R()&&b.graphics.set(l.uid,t),a=!0;const f=b.graphics3DCalloutSymbolLayer;if(f&&h.hasLabelVerticalOffset){f.setElevationInfoOverride(s.elevationInfoOverride);const e=this._createLineCalloutGraphic(l,p,f,h,r);null!=e&&(b.calloutSymbolLayerIndex=t.labelLayers.length,t.addLabelGraphic(e,s.stageLayer))}break}return a&&s.scaleVisibility?.updateGraphicLabelScaleVisibility(t),e.hasGraphics3DResources=!0,!0}_destroyGraphics3DResources(e){const t=e.labelingContext.labelClassContexts;for(const s of e.graphics3DGraphic.labelLayers){if(null==s.labelClass)continue;const e=t[s.labelClassContextIndex].graphics3DSymbol.symbolLayers[0];e?.onRemoveGraphic(s)}e.graphics3DGraphic.clearLabelGraphics(),e.hasGraphics3DResources=!1}_ensureTextTextureResources(e){if(e.textInitialized)return;const t=e.labelingContext,s=t.labelClassContexts;if(Q(s))return;const i=e.graphics3DGraphic.graphic;for(let l=0;l<s.length;l++){const r=s[l];if(e.textRenderers[l]=null,e.textLabelPlacements[l]=null,null==r?.textRenderParameters)continue;const o=r.labelFunction;let n;if("arcade"===o.type)try{const e=o.needsHydrationToEvaluate()?d(i,t.layer,null):i;n=o.evaluate(e)}catch(a){n=null}else n=o.evaluate(i);if(null==n||""===n||/^\s+$/.test(n))continue;const c=r.graphics3DSymbol;if(!c.symbolLayers[0])continue;const h=e.graphics3DGraphic,b="label-3d"===c.symbol?.type?c.symbol:null,u=r.labelClass,p=t.disablePlacement,y=new _(h,b,u,p).placement;if(null==y)continue;const g=v(y.anchor),f=w(g);e.textRenderers[l]=new D(n,f,r.textRenderParameters,I.maxSize),e.textLabelPlacements[l]=y}e.textInitialized=!0}_destroyTextTextureResources(e){e.textInitialized=!1,e.textRenderers.length=0,e.textLabelPlacements.length=0}_addGraphic(e,t){const s=t.graphic.uid;if(e.graphics.set(s,t),e.active){const i=new O(e,t);this._labels.set(s,i),e.labelsToInitialize.set(s,i)}this.setDirty(),this.deconflictor.setDirty()}_updateGraphicGeometry(e,t){const s=t.graphic.uid,i=this._labels.get(s);if(!i)return!0;for(const a of i.graphics3DGraphic.labelLayers){if(null==a.labelClass)continue;if(!e.labelClassContexts[a.labelClassContextIndex].graphics3DSymbol.symbolLayers[0].updateGeometry(a,t.graphic.geometry))return!1}return this.setDirty(),this.deconflictor.setDirty(),!0}_removeGraphic(e,t){const s=t.graphic.uid,i=this._labels.get(s);e.graphics.delete(s),e.labelClassContexts.forEach(e=>e.graphics.delete(s)),i&&(this._destroyGraphic(i,s),e.labelsToInitialize.delete(s),this.setDirty(),this.deconflictor.setDirty())}_destroyGraphic(e,t){this._labels.delete(t),e.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(e),this._destroyTextTextureResources(e),e.hasGraphics3DResources&&this._destroyGraphics3DResources(e)}async _labelingInfoChange(e,t){if(!t)return this._visibilityInfoChange(e),this._resetLabels(e),this._createLabelClassContext(e);for(const s of t){const t=e.graphics.get(s);t&&(this._removeGraphic(e,t),this._addGraphic(e,t))}}_globalPropertyChanged(e,t){for(const s of t.labelClassContexts){const i=new Map;t.graphics.forEach(e=>i.set(e.graphic.uid,e));const a=e=>e.labelLayers[0];if(s.graphics3DSymbol.symbolLayers[0].globalPropertyChanged(e,i,a),s.graphics3DCalloutSymbolLayer){const t=e=>e.labelLayers[s.calloutSymbolLayerIndex];s.graphics3DCalloutSymbolLayer.globalPropertyChanged(e,i,t)}}}_visibilityInfoChange(e){const t=W(e.layer);t&&!e.active&&this._activateLabelingContext(e),!t&&e.active&&this._deactivateLabelingContext(e),this.setDirty()}_resetAllLabels(){for(const e of this._labelingContexts)this._resetLabels(e)}_resetLabels(e){e.graphics.forEach((t,s)=>{const i=this._labels.get(s);i&&(this._destroyGraphic(i,s),i.visible=!1,e.labelsToInitialize.set(s,i))}),this._destroyLabelClassContext(e),this.setDirty(),this.deconflictor.setDirty()}_findLabelingContext(e){for(const t of this._labelingContexts)if(t.graphics3DCore===e)return t;return null}addGraphicsOwner(e,t,s){const i=s?.emptySymbolLabelSupported||!1,a=s?.elevationInfoOverride||null,l=s?.disablePlacement||null;if(this._findLabelingContext(e))return;const r=e.layer,o=new z(this.view.stage,r,e,t,i,a,l,W(r));return this._labelingContexts.push(o),this.setDirty(),{addGraphic:e=>this._addGraphic(o,e),removeGraphic:e=>this._removeGraphic(o,e),updateGraphicGeometry:e=>this._updateGraphicGeometry(o,e),layerLabelsEnabled:()=>W(o.layer),labelingInfoChange:e=>this._labelingInfoChange(o,e),elevationInfoChange:()=>this._globalPropertyChanged("elevationInfo",o),slicePlaneEnabledChange:()=>this._globalPropertyChanged("slicePlaneEnabled",o),visibilityInfoChange:()=>this._visibilityInfoChange(o),reset:()=>this._resetLabels(o),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty()}}_removeGraphicsOwner(e){const t=this._findLabelingContext(e);if(!t)return;const s=this._labelingContexts.indexOf(t);this._labelingContexts.splice(s,1),t.graphics.forEach(e=>this._removeGraphic(t,e)),t.destroy(),this.setDirty()}_updateScaleVisibility(){for(const e of this._labelingContexts)if(e.active&&!H(e))for(const t of e.labelClassContexts)this._updateLabelClassContextVisibility(t)}_updateLabelClassContextVisibility(e){if(!R())return;const{labelClass:t,graphics:s}=e,i={minScale:t.minScale,maxScale:t.maxScale},a=P(i,this.view.scale),l=null==e.scaleVisibility||e.scaleVisibility!==a;e.scaleVisibility=a,l&&s.size&&(s.forEach(e=>e.setVisibilityFlag(16,2,a)),this.deconflictor.setDirty(),this.setDirty())}setLabelGraphicVisibility(e,t){const s=e.graphic.uid,i=this._labels.get(s);i&&i.visible!==t&&(t&&!i.textureAtlasHandles.length?(this._addLabelTextureToAtlas(i),i.textInitialized||i.labelingContext.labelsToInitialize.set(s,i)):!t&&i.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(i),i.visible=t,this.setDirty())}setDirty(){!this._dirty&&this._labelingContexts.length>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._dirty||this._textTextureAtlas?.updating||this.deconflictor.updating||this._labelingContexts.some(e=>H(e))||this._focusAreasLabelsQueue.length>0}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;const e=this._labelingContexts.length>0?this._labelingContexts.reduce((e,t)=>e+(H(t)?0:1),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?0:.1)+.1*e+.5*this.deconflictor.updatingProgress}get usedMemory(){return this._textTextureAtlas?.usedMemory??0}get test(){}};function M(e,t){e.geometries[0].setAttributeData("size",[t.displayWidth,t.displayHeight]),e.geometryVertexAttributeUpdated(e.geometries[0],"size")}function U(e,t){e.geometries[0].setAttributeData("uvi",t),e.geometryVertexAttributeUpdated(e.geometries[0],"uvi",!0)}function H(e){return!!e.labelClassPromise&&!!e.labelClassAbortController}function Q(e){return!e||0===e.length}function k(e){return"label-3d"===e.symbol?.type?e.symbol:null}function W(e){return!!e.labelsVisible&&!!e.labelingInfo?.some(e=>!!e.symbol)}e([b({constructOnly:!0})],E.prototype,"view",void 0),e([b({constructOnly:!0})],E.prototype,"deconflictor",void 0),e([b()],E.prototype,"_textTextureAtlas",void 0),e([b({type:Boolean,readOnly:!0})],E.prototype,"updating",null),E=e([u("esri.views.3d.layers.graphics.Labeler")],E);const B=new m(null,null,null);export{E as Labeler,W as areLabelsVisible};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as s}from"tslib";import e from"../../../../core/Accessor.js";import{createTask as i}from"../../../../core/asyncUtils.js";import a from"../../../../core/Error.js";import{abortMaybe as t,destroyMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as n,isAborted as o}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as y}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as w}from"../../../../core/accessorSupport/decorators/subclass.js";let h=class extends e{get updating(){return null!=this._createAnalysisViewTask||null!=this.analysisView&&this.analysisView.updating}constructor(s){super(s),this._analysisModule=null,this._emitOnView=(s,e)=>this.parent.view.emit(s,e)}initialize(){this.addHandles(l(()=>this.getAnalysis(),s=>this._createAnalysisView(s),y))}destroy(){this._destroyAnalysisView()}async whenAnalysisView(){if(null!=this.analysisView)return this.analysisView;if(null!=this._createAnalysisViewTask)return this._createAnalysisViewTask.promise;throw new a("layerview:no-analysisview-for-analysis","The analysis has not been set on the layer of this layer view")}_createAnalysisView(s){const e=this._createAnalysisViewTask?.promise;if(this._destroyAnalysisView(),!s)return;const a=i(async i=>{try{await Promise.allSettled([e]);const a=await this._createAnalysisViewPromise(s,i);return n(i),this.analysisView=a,this._emitOnView("analysis-view-create",{analysis:s,analysisView:a}),a}catch(t){throw this._emitOnView("analysis-view-create-error",{analysis:s,error:t}),t}finally{this._createAnalysisViewTask===a&&(this._createAnalysisViewTask=null)}});this._createAnalysisViewTask=a}_destroyAnalysisView(){const s=this.getAnalysis();this._createAnalysisViewTask=t(this._createAnalysisViewTask);const{analysisView:e}=this;e&&(this.analysisView=r(e),this._emitOnView("analysis-view-destroy",{analysis:s,analysisView:e}))}async _createAnalysisViewPromise(s,e){let i,t=this._analysisModule;const r=e=>{if(!o(e))return;i?.destroy();const t=this.getAnalysis();throw new a("layerview:no-analysisview-for-analysis",null!=t&&s!==t?"The analysis changed before the analysis view could be created":"The analysis has not been added to the layer of this layer view",{analysis:s})};return t||(t=await this.loadAnalysisViewModule(),r(e),this._analysisModule=t),i=new t.default({analysis:s,parent:this.parent,view:this.parent.view}),await i.when(),r(e),i}};s([c({constructOnly:!0})],h.prototype,"getAnalysis",void 0),s([c({constructOnly:!0})],h.prototype,"loadAnalysisViewModule",void 0),s([c({constructOnly:!0})],h.prototype,"parent",void 0),s([c()],h.prototype,"analysisView",void 0),s([c()],h.prototype,"_createAnalysisViewTask",void 0),s([c()],h.prototype,"updating",null),s([c()],h.prototype,"_analysisModule",void 0),h=s([w("esri.views.3d.layers.support.LayerViewAnalysisViewManager")],h);export{h as LayerViewAnalysisViewManager};
5
+ import{__decorate as s}from"tslib";import i from"../../../../core/Accessor.js";import{createTask as e}from"../../../../core/asyncUtils.js";import a from"../../../../core/Error.js";import{abortMaybe as t,destroyMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as n,isAborted as o}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as y}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as w}from"../../../../core/accessorSupport/decorators/subclass.js";let h=class extends i{get updating(){return null!=this._createAnalysisViewTask||null!=this.analysisView&&this.analysisView.updating}constructor(s){super(s),this._analysisModule=null,this._emitOnView=(s,i)=>this.parent.view.emit(s,i)}initialize(){this.addHandles(l(()=>this.getAnalysis(),s=>this._createAnalysisView(s),y))}destroy(){this._destroyAnalysisView()}async whenAnalysisView(){if(null!=this.analysisView)return this.analysisView;if(null!=this._createAnalysisViewTask)return this._createAnalysisViewTask.promise;throw new a("layerview:no-analysisview-for-analysis","The analysis is not set on the layer of this layer view")}_createAnalysisView(s){const i=this._createAnalysisViewTask?.promise;if(this._destroyAnalysisView(),!s)return;const a=e(async e=>{try{await Promise.allSettled([i]);const a=await this._createAnalysisViewPromise(s,e);return n(e),this.analysisView=a,this._emitOnView("analysis-view-create",{analysis:s,analysisView:a}),a}catch(t){throw this._emitOnView("analysis-view-create-error",{analysis:s,error:t}),t}finally{this._createAnalysisViewTask===a&&(this._createAnalysisViewTask=null)}});this._createAnalysisViewTask=a}_destroyAnalysisView(){const s=this.getAnalysis();this._createAnalysisViewTask=t(this._createAnalysisViewTask);const{analysisView:i}=this;i&&(this.analysisView=r(i),this._emitOnView("analysis-view-destroy",{analysis:s,analysisView:i}))}async _createAnalysisViewPromise(s,i){let e,t=this._analysisModule;const r=i=>{if(!o(i))return;e?.destroy();const t=this.getAnalysis();throw new a("layerview:no-analysisview-for-analysis",null!=t&&s!==t?"The analysis changed before the analysis view could be created":"The analysis is not set on the layer of this layer view",{analysis:s})};return t||(t=await this.loadAnalysisViewModule(),r(i),this._analysisModule=t),e=new t.default({analysis:s,parent:this.parent,view:this.parent.view}),await e.when(),r(i),e}};s([c({constructOnly:!0})],h.prototype,"getAnalysis",void 0),s([c({constructOnly:!0})],h.prototype,"loadAnalysisViewModule",void 0),s([c({constructOnly:!0})],h.prototype,"parent",void 0),s([c()],h.prototype,"analysisView",void 0),s([c()],h.prototype,"_createAnalysisViewTask",void 0),s([c()],h.prototype,"updating",null),s([c()],h.prototype,"_analysisModule",void 0),h=s([w("esri.views.3d.layers.support.LayerViewAnalysisViewManager")],h);export{h as LayerViewAnalysisViewManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as n}from"../../../geometry/support/aaBoundingBox.js";class e{constructor(t){this.newSortOrder=t}}let a=t(),r=t();const o=n();let s=null,l=null;const i=10,c=20,h=.25;function f(t){let n=!1;for(let e=0;e<t.length;e+=3){const a=t[e],r=t[e+1],s=t[e+2];n?(o[0]=Math.min(o[0],a),o[3]=Math.max(o[3],a),o[1]=Math.min(o[1],r),o[4]=Math.max(o[4],r),o[2]=Math.min(o[2],s),o[5]=Math.max(o[5],s)):(o[0]=o[3]=a,o[1]=o[4]=r,o[2]=o[5]=s,n=!0)}n||(o[0]=o[3]=0,o[1]=o[4]=0,o[2]=o[5]=0)}function u(t,n){s?.length!==t&&(s=new Uint32Array(t)),l&&l.length===1+(1<<n)?l.fill(0):l=new Uint32Array(1+(1<<n))}function m(t,n,e){const a=e[0],r=e[1],f=e[2],m=t.length/3,M=Math.max(i,Math.min(c,Math.round(Math.log2(m/h)))),g=1+(1<<M);u(m,M);let b=0,x=0;for(let s=0;s<8;++s){const t=(1&s?o[0]:o[3])*a+(2&s?o[1]:o[4])*r+(4&s?o[2]:o[5])*f;0===s?b=x=t:(b=Math.min(b,t),x=Math.max(x,t))}const w=x-b;if(w<1e-6)for(let o=0;o<m;++o)s[o]=0,l[0]++;else{const n=(1<<M)/w;for(let e=0,o=0;e<m;++e){const i=(t[o++]*a+t[o++]*r+t[o++]*f-b)*n>>>0;s[e]=i,l[i]++}}for(let o=1;o<g;o++)l[o]+=l[o-1];for(let o=0;o<m;o++){const t=s[o];n[--l[t]]=o}}async function M(t){const{cameraPosition:n,cameraDirection:o,gaussianCenters:s,sortOrder:l}=t;if(0===s.length||0===l.length||l.length!==s.length/3)return{result:new e(l)};const i=.001;return Math.abs(n[0]-a[0])>i||Math.abs(n[1]-a[1])>i||Math.abs(n[2]-a[2])>i||Math.abs(o[0]-r[0])>i||Math.abs(o[1]-r[1])>i||Math.abs(o[2]-r[2])>i?(a=n,r=n,f(s),m(s,l,o),{result:new e(l),transferList:[l.buffer]}):{result:new e(l),transferList:[l.buffer]}}function g(){s=null,l=null}export{e as SplatSortWorkerOutput,g as destroy,M as sortCentersRelativeToCamera};
5
+ class t{constructor(t,n){this.distances=t,this.sortOrderIndices=n}}class n{constructor(t,n){this.distances=t,this.sortedOrderIndices=n}}let e=null,s=null;const r=10,l=20,o=.25;function c(t,n){e?.length!==t&&(e=new Uint32Array(t)),s&&s.length===1+(1<<n)?s.fill(0):s=new Uint32Array(1+(1<<n))}function i(t,n){const i=t.length,a=Math.max(r,Math.min(l,Math.round(Math.log2(i/o)))),f=1+(1<<a);c(i,a);let h=t[0],u=t[0];for(let e=0;e<t.length;e++)h=Math.min(h,t[e]),u=Math.max(u,t[e]);const d=u-h;if(d<1e-6)for(let r=0;r<i;++r)e[r]=0,s[0]++;else{const n=(1<<a)/d;for(let r=0;r<i;r++){const l=(t[r]-h)*n>>>0;e[r]=l,s[l]++}}for(let e=1;e<f;e++)s[e]+=s[e-1];for(let r=0;r<i;r++){const t=e[r];n[--s[t]]=r}}async function a(t){const{distances:e,sortOrderIndices:s}=t;return 0===e.length||0===s.length||i(e,s),{result:new n(e,s),transferList:[e.buffer,s.buffer]}}function f(){e=null,s=null}export{t as SplatSortWorkerInput,n as SplatSortWorkerOutput,f as destroy,a as sort};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{WorkerHandle as e}from"../../../core/workers/WorkerHandle.js";class r extends e{constructor(e){super("GaussianSplatSortWorker","sortCentersRelativeToCamera",{sortCentersRelativeToCamera:e=>[e.gaussianCenters.buffer,e.sortOrder.buffer]},e)}sortCentersRelativeToCamera(e,r){return this.invokeMethod("sortCentersRelativeToCamera",e,r)}async destroyWorkerAndSelf(){await this.broadcast({},"destroy"),this.destroy()}}export{r as GaussianSplatSortWorkerHandle};
5
+ import{WorkerHandle as r}from"../../../core/workers/WorkerHandle.js";class s extends r{constructor(r){super("GaussianSplatSortWorker","sort",{sort:r=>[r.distances.buffer,r.sortOrderIndices.buffer]},r)}sort(r,s){return this.invokeMethod("sort",r,s)}async destroyWorkerAndSelf(){await this.broadcast({},"destroy"),this.destroy()}}export{s as GaussianSplatSortWorkerHandle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{Milliseconds as o}from"../../../core/time.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";let r=class extends e{constructor(){super(...arguments),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};t([i()],r.prototype,"minTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxNumberOfDrawCalls",void 0),t([i()],r.prototype,"maxTotalNumberOfVertices",void 0),t([i()],r.prototype,"snapshotAvailable",void 0),t([i()],r.prototype,"polygonLodFactor",void 0),t([i()],r.prototype,"polylineLodFactor",void 0),t([i()],r.prototype,"skipHighSymbolLods",void 0),r=t([s("esri.views.3d.support.QualitySettings.Graphics3DSettings")],r);let p=class extends e{constructor(){super(...arguments),this.lodFactor=1}};t([i()],p.prototype,"lodFactor",void 0),p=t([s("esri.views.3d.support.QualitySettings.LoDFactorSettings")],p);let a=class extends e{constructor(){super(...arguments),this.object=new p,this.point=new p,this.integratedMesh=new p,this.pointCloud=new p}};t([i({type:p})],a.prototype,"object",void 0),t([i({type:p})],a.prototype,"point",void 0),t([i({type:p})],a.prototype,"integratedMesh",void 0),t([i({type:p})],a.prototype,"pointCloud",void 0),a=t([s("esri.views.3d.support.QualitySettings.SceneServiceSettings")],a);let l=class extends e{constructor(){super(...arguments),this.lodBias=0,this.angledSplitBias=1,this.vtlContentZoom=1,this.elevationLevelDelta=3,this.reduceTileLevelDifferences=!0}};t([i()],l.prototype,"lodBias",void 0),t([i()],l.prototype,"angledSplitBias",void 0),t([i()],l.prototype,"vtlContentZoom",void 0),t([i()],l.prototype,"elevationLevelDelta",void 0),t([i()],l.prototype,"reduceTileLevelDifferences",void 0),l=t([s("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],l);let d=class extends e{constructor(){super(...arguments),this.pixelRatio=1,this.maxTotalNumberOfFeatures=5e4}};t([i()],d.prototype,"pixelRatio",void 0),t([i()],d.prototype,"maxTotalNumberOfFeatures",void 0),d=t([s("esri.views.3d.support.QualitySettings.HeatmapSettings")],d);let n=class extends e{constructor(){super(...arguments),this.graphics3D=new r,this.sceneService=new a,this.tiledSurface=new l,this.heatmap=new d,this.fadeDuration=o(400),this.antialiasingEnabled=!0,this.physicallyBasedRenderingEnabled=!1,this.highQualityTransparency=!0,this.highResolutionAtmosphere=!1,this.reflections=!1,this.ambientOcclusion=!1,this.bloom=!1,this.maxTexturePixels=1/0,this.memoryLimit=750,this.additionalCacheMemory=0,this.frameRate=void 0,this.maximumPixelRatio=1/0}};t([i({type:r})],n.prototype,"graphics3D",void 0),t([i({type:a})],n.prototype,"sceneService",void 0),t([i({type:l})],n.prototype,"tiledSurface",void 0),t([i({type:d})],n.prototype,"heatmap",void 0),t([i()],n.prototype,"fadeDuration",void 0),t([i()],n.prototype,"antialiasingEnabled",void 0),t([i()],n.prototype,"physicallyBasedRenderingEnabled",void 0),t([i()],n.prototype,"highQualityTransparency",void 0),t([i()],n.prototype,"highResolutionAtmosphere",void 0),t([i()],n.prototype,"reflections",void 0),t([i()],n.prototype,"ambientOcclusion",void 0),t([i()],n.prototype,"bloom",void 0),t([i()],n.prototype,"maxTexturePixels",void 0),t([i()],n.prototype,"memoryLimit",void 0),t([i()],n.prototype,"additionalCacheMemory",void 0),t([i()],n.prototype,"frameRate",void 0),t([i()],n.prototype,"maximumPixelRatio",void 0),n=t([s("esri.views.3d.support.QualitySettings")],n);const c=n;export{c as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{Milliseconds as o}from"../../../core/time.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";let r=class extends e{constructor(){super(...arguments),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1}};t([i()],r.prototype,"minTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxTotalNumberOfFeatures",void 0),t([i()],r.prototype,"maxNumberOfDrawCalls",void 0),t([i()],r.prototype,"maxTotalNumberOfVertices",void 0),t([i()],r.prototype,"snapshotAvailable",void 0),t([i()],r.prototype,"polygonLodFactor",void 0),t([i()],r.prototype,"polylineLodFactor",void 0),t([i()],r.prototype,"skipHighSymbolLods",void 0),r=t([s("esri.views.3d.support.QualitySettings.Graphics3DSettings")],r);let p=class extends e{constructor(){super(...arguments),this.lodFactor=1}};t([i()],p.prototype,"lodFactor",void 0),p=t([s("esri.views.3d.support.QualitySettings.LoDFactorSettings")],p);let a=class extends e{constructor(){super(...arguments),this.object=new p,this.point=new p,this.integratedMesh=new p,this.pointCloud=new p}};t([i({type:p})],a.prototype,"object",void 0),t([i({type:p})],a.prototype,"point",void 0),t([i({type:p})],a.prototype,"integratedMesh",void 0),t([i({type:p})],a.prototype,"pointCloud",void 0),a=t([s("esri.views.3d.support.QualitySettings.SceneServiceSettings")],a);let l=class extends e{constructor(){super(...arguments),this.lodBias=0,this.angledSplitBias=1,this.vtlContentZoom=1,this.elevationLevelDelta=3,this.reduceTileLevelDifferences=!0}};t([i()],l.prototype,"lodBias",void 0),t([i()],l.prototype,"angledSplitBias",void 0),t([i()],l.prototype,"vtlContentZoom",void 0),t([i()],l.prototype,"elevationLevelDelta",void 0),t([i()],l.prototype,"reduceTileLevelDifferences",void 0),l=t([s("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],l);let d=class extends e{constructor(){super(...arguments),this.pixelRatio=1,this.maxTotalNumberOfFeatures=5e4}};t([i()],d.prototype,"pixelRatio",void 0),t([i()],d.prototype,"maxTotalNumberOfFeatures",void 0),d=t([s("esri.views.3d.support.QualitySettings.HeatmapSettings")],d);let n=class extends e{constructor(){super(...arguments),this.graphics3D=new r,this.sceneService=new a,this.tiledSurface=new l,this.heatmap=new d,this.fadeDuration=o(400),this.antialiasingEnabled=!0,this.physicallyBasedRenderingEnabled=!1,this.highQualityTransparency=!0,this.highResolutionAtmosphere=!1,this.reflections=!1,this.ambientOcclusion=!1,this.glow=!0,this.maxTexturePixels=1/0,this.memoryLimit=750,this.additionalCacheMemory=0,this.frameRate=void 0,this.maximumPixelRatio=1/0}};t([i({type:r})],n.prototype,"graphics3D",void 0),t([i({type:a})],n.prototype,"sceneService",void 0),t([i({type:l})],n.prototype,"tiledSurface",void 0),t([i({type:d})],n.prototype,"heatmap",void 0),t([i()],n.prototype,"fadeDuration",void 0),t([i()],n.prototype,"antialiasingEnabled",void 0),t([i()],n.prototype,"physicallyBasedRenderingEnabled",void 0),t([i()],n.prototype,"highQualityTransparency",void 0),t([i()],n.prototype,"highResolutionAtmosphere",void 0),t([i()],n.prototype,"reflections",void 0),t([i()],n.prototype,"ambientOcclusion",void 0),t([i()],n.prototype,"glow",void 0),t([i()],n.prototype,"maxTexturePixels",void 0),t([i()],n.prototype,"memoryLimit",void 0),t([i()],n.prototype,"additionalCacheMemory",void 0),t([i()],n.prototype,"frameRate",void 0),t([i()],n.prototype,"maximumPixelRatio",void 0),n=t([s("esri.views.3d.support.QualitySettings")],n);const c=n;export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{EventEmitter as e}from"../../../../core/Evented.js";import{mapCollection as t}from"../../../../core/mapCollectionUtils.js";class s{constructor(s){this.events=new e,this._handles=t(()=>s,e=>e.on("visible-geometry-changed",e=>this.events.emit("request-update",e)))}destroy(){this._handles.destroy()}}export{s as ContentGeometryUpdates};
5
+ import{EventEmitter as e}from"../../../../core/Evented.js";import t from"../../../../core/Handles.js";import{destroyHandle as s}from"../../../../core/handleUtils.js";import{mapCollection as o}from"../../../../core/mapCollectionUtils.js";import{on as r}from"../../../../core/reactiveUtils.js";class i{constructor(i,n){this._handles=new t,this.events=new e,this._handles.add([s(o(()=>i,e=>e.on("visible-geometry-changed",e=>this.events.emit("request-update",e)))),r(n,"visible-geometry-changed",()=>this.events.emit("request-update"))])}destroy(){this._handles.destroy()}}export{i as ContentGeometryUpdates};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{watch as r,when as s,on as n,sync as i,initial as o}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{f as u,q as d,c as h}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{create as l}from"../../../../geometry/support/ray.js";import{debugFlags as _}from"../debugFlags.js";import{DebugPoint as m}from"../debugUtils.js";import{fromRenderAtEye as C}from"../geometryUtils/ray.js";import{CameraOnSurface as g}from"./CameraOnSurface.js";import{CenterOnSurface as y}from"./CenterOnSurface.js";import{ContentGeometryUpdates as O}from"./ContentGeometryUpdates.js";import{Focus as A}from"./Focus.js";import{StableSurfaceCenter as w}from"./StableSurfaceCenter.js";import{SurfaceGeometryUpdates as S}from"./SurfaceGeometryUpdates.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";import{terrainId as I}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{PropertiesPool as b}from"../../../support/PropertiesPool.js";import{TaskPriority as R}from"../../../support/Scheduler.js";let P=class extends t{constructor(e){super(e),this.renderPointOfView=p(),this._pois=new Array,this._updatingHandles=new f,this._debugCenters=null,this._tmpRay=l(),this._centerRayDirty=!0,this._surfaceAltitudeAtCenter=0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenter=0,this._contentAltitudeAtCenterDirty=!0,this._propertiesPool=new b({renderPointOfView:()=>p()},this),this._contentIntersector=new v(e.view.state.viewingMode),this._surfaceIntersector=new v(e.view.state.viewingMode),this._surfaceIntersector.options.invisibleTerrain=!1,this._surfaceIntersector.options.store=0}initialize(){const{state:e,basemapTerrain:t,renderCoordsHelper:a,map:c}=this.view,u=()=>this._estimateSurfaceAltitudeAtCenter(),d=this.view.resourceController.scheduler,h=t?.elevationQueryCache,p={state:e,scheduler:d,surface:t,renderCoordsHelper:a};this._set("centerOnSurfaceInfrequent",new y({...p,task:R.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:u})),this._set("centerOnSurfaceFrequent",new y({...p,task:R.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:u})),this._set("centerOnContent",new y({...p,task:R.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:()=>this._estimateContentAltitudeAtCenter()})),this._set("cameraOnSurface",new g({...p,cache:h,task:R.POINT_OF_INTEREST_INFREQUENT,map:c})),this._set("surfaceGeometryUpdates",new S({...p,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set("contentGeometryUpdates",new O(this.view.allLayerViews)),this._set("surfaceOrigin",new w({cache:h,view:this.view})),this._set("focus",new A({state:e,scheduler:d,surface:t,renderCoordsHelper:a,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(e,t)=>this._estimateSurfaceIntersectionAtRenderPoint(e,this.view.state.contentCamera,t)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus),this.addHandles([r(()=>e.contentCamera,e=>this._cameraChanged(e),i),this._updatingHandles.add(()=>t.extent,()=>this._updateCenterPointsOfInterest()),this._updatingHandles.add(()=>this.view.map?.ground?.navigationConstraint?.type,e=>{this._surfaceIntersector.options.backfacesTerrain="none"===e},o),s(()=>!t.updating,()=>this._updateCenterPointsOfInterest(),i),n(()=>this.surfaceGeometryUpdates.events,"request-update",()=>this._updateCenterPointsOfInterest()),n(()=>this.contentGeometryUpdates.events,"request-update",()=>this._updateCenterOnContent()),this._updatingHandles.add(()=>_.SHOW_POI,e=>this._setDebug(e),o)]),this._cameraChanged(this.view.state.contentCamera);for(const r of this._pois)r.runTask()}destroy(){this._setDebug(!1),this._propertiesPool.destroy();for(const e of this._pois)e.destroy();this._pois.length=0,this.surfaceOrigin.destroy(),this._updatingHandles.destroy(),this._set("centerOnSurfaceInfrequent",null),this._set("centerOnSurfaceFrequent",null),this._set("centerOnContent",null),this._set("cameraOnSurface",null),this._set("surfaceGeometryUpdates",null),this._set("contentGeometryUpdates",null),this._set("surfaceOrigin",null),this._set("focus",null)}get updating(){return!(!this.surfaceGeometryUpdates?.updating&&!this._pois.some(e=>e.updating))||this._updatingHandles.updating}get _centerRay(){return this._centerRayDirty&&(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),this._centerRayDirty=!1),this._centerRayCached}_estimateContentAltitudeAtCenter(){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;this._contentAltitudeAtCenterDirty=!1;const e=this._centerRay;return null==e||(this.view.sceneIntersectionHelper.intersectRay(e,this._contentIntersector,j,H)?this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(j):this._contentAltitudeAtCenter=this._estimateSurfaceAltitudeAtCenter()),this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(){if(!this.view.basemapTerrain)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;this._surfaceAltitudeAtCenterDirty=!1;const e=this._centerRay;if(null==e)return this._surfaceAltitudeAtCenter;const t=e.origin,r=u(j,e.origin,e.direction);return this._surfaceIntersector.resetWithRay(e,this.view.state.contentCamera),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,t,r),this._surfaceIntersector.results.min.getIntersectionPoint(j)&&(this._surfaceAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(j)),this._surfaceAltitudeAtCenter}_estimateSurfaceIntersectionAtRenderPoint(e,t,r){const s=C(t,e,T);if(null==s)return null;const n=s.origin,i=u(j,s.origin,s.direction);return this._surfaceIntersector.resetWithRay(s,t),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,n,i),this._surfaceIntersector.results.min.getIntersectionPoint(r)?r:null}_cameraChanged(e){this._updateCenterPointsOfInterest();const t=e.eye;d(this.renderPointOfView,t)||this._set("renderPointOfView",h(this._propertiesPool.get("renderPointOfView"),t))}_updateCenterPointsOfInterest(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0;for(const e of this._pois)e.updateRenderLocation()}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)return this._debugCenters?.forEach(e=>e.hide()),void this.removeHandles("debug");if(!this._debugCenters){this._debugCenters=new Map;const e=this.view.graphics;this._debugCenters.set(this.centerOnContent,new m(e,"red","CenterOnContent")),this._debugCenters.set(this.centerOnSurfaceFrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.centerOnSurfaceInfrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.cameraOnSurface,new m(e,"blue","CameraOnSurface")),this._debugCenters.set(this.focus,new m(e,"green","Focus"))}for(const t of this._pois)this.addHandles(this._updatingHandles.add(()=>t.renderLocation,e=>this._debugCenters?.get(t)?.show(e,t.renderCoordsHelper.spatialReference),o),"debug")}get test(){}};e([a()],P.prototype,"centerOnContent",void 0),e([a()],P.prototype,"centerOnSurfaceFrequent",void 0),e([a()],P.prototype,"centerOnSurfaceInfrequent",void 0),e([a()],P.prototype,"cameraOnSurface",void 0),e([a()],P.prototype,"focus",void 0),e([a()],P.prototype,"renderPointOfView",void 0),e([a()],P.prototype,"surfaceOrigin",void 0),e([a()],P.prototype,"contentGeometryUpdates",void 0),e([a()],P.prototype,"surfaceGeometryUpdates",void 0),e([a({constructOnly:!0})],P.prototype,"view",void 0),e([a()],P.prototype,"updating",null),P=e([c("esri.views.3d.support.pointsOfInterest.PointsOfInterest")],P);const j=p(),T=l(),H={exclude:new Set([I])};export{P as PointsOfInterest};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{watch as r,when as s,on as n,sync as i,initial as o}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{f as u,q as d,c as h}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{create as l}from"../../../../geometry/support/ray.js";import{debugFlags as _}from"../debugFlags.js";import{DebugPoint as m}from"../debugUtils.js";import{fromRenderAtEye as C}from"../geometryUtils/ray.js";import{CameraOnSurface as g}from"./CameraOnSurface.js";import{CenterOnSurface as y}from"./CenterOnSurface.js";import{ContentGeometryUpdates as O}from"./ContentGeometryUpdates.js";import{Focus as A}from"./Focus.js";import{StableSurfaceCenter as w}from"./StableSurfaceCenter.js";import{SurfaceGeometryUpdates as S}from"./SurfaceGeometryUpdates.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";import{terrainId as I}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{PropertiesPool as b}from"../../../support/PropertiesPool.js";import{TaskPriority as R}from"../../../support/Scheduler.js";let P=class extends t{constructor(e){super(e),this.renderPointOfView=p(),this._pois=new Array,this._updatingHandles=new f,this._debugCenters=null,this._tmpRay=l(),this._centerRayDirty=!0,this._surfaceAltitudeAtCenter=0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenter=0,this._contentAltitudeAtCenterDirty=!0,this._propertiesPool=new b({renderPointOfView:()=>p()},this),this._contentIntersector=new v(e.view.state.viewingMode),this._surfaceIntersector=new v(e.view.state.viewingMode),this._surfaceIntersector.options.invisibleTerrain=!1,this._surfaceIntersector.options.store=0}initialize(){const{state:e,basemapTerrain:t,renderCoordsHelper:a,map:c}=this.view,u=()=>this._estimateSurfaceAltitudeAtCenter(),d=this.view.resourceController.scheduler,h=t?.elevationQueryCache,p={state:e,scheduler:d,surface:t,renderCoordsHelper:a};this._set("centerOnSurfaceInfrequent",new y({...p,task:R.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:u})),this._set("centerOnSurfaceFrequent",new y({...p,task:R.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:u})),this._set("centerOnContent",new y({...p,task:R.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:()=>this._estimateContentAltitudeAtCenter()})),this._set("cameraOnSurface",new g({...p,cache:h,task:R.POINT_OF_INTEREST_INFREQUENT,map:c})),this._set("surfaceGeometryUpdates",new S({...p,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set("contentGeometryUpdates",new O(this.view.allLayerViews,()=>this.view.graphicsView)),this._set("surfaceOrigin",new w({cache:h,view:this.view})),this._set("focus",new A({state:e,scheduler:d,surface:t,renderCoordsHelper:a,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(e,t)=>this._estimateSurfaceIntersectionAtRenderPoint(e,this.view.state.contentCamera,t)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus),this.addHandles([r(()=>e.contentCamera,e=>this._cameraChanged(e),i),this._updatingHandles.add(()=>t.extent,()=>this._updateCenterPointsOfInterest()),this._updatingHandles.add(()=>this.view.map?.ground?.navigationConstraint?.type,e=>{this._surfaceIntersector.options.backfacesTerrain="none"===e},o),s(()=>!t.updating,()=>this._updateCenterPointsOfInterest(),i),n(()=>this.surfaceGeometryUpdates.events,"request-update",()=>this._updateCenterPointsOfInterest()),n(()=>this.contentGeometryUpdates.events,"request-update",()=>this._updateCenterOnContent()),this._updatingHandles.add(()=>_.SHOW_POI,e=>this._setDebug(e),o)]),this._cameraChanged(this.view.state.contentCamera);for(const r of this._pois)r.runTask()}destroy(){this._setDebug(!1),this._propertiesPool.destroy();for(const e of this._pois)e.destroy();this._pois.length=0,this.surfaceOrigin.destroy(),this._updatingHandles.destroy(),this._set("centerOnSurfaceInfrequent",null),this._set("centerOnSurfaceFrequent",null),this._set("centerOnContent",null),this._set("cameraOnSurface",null),this._set("surfaceGeometryUpdates",null),this._set("contentGeometryUpdates",null),this._set("surfaceOrigin",null),this._set("focus",null)}get updating(){return!(!this.surfaceGeometryUpdates?.updating&&!this._pois.some(e=>e.updating))||this._updatingHandles.updating}get _centerRay(){return this._centerRayDirty&&(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),this._centerRayDirty=!1),this._centerRayCached}_estimateContentAltitudeAtCenter(){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;this._contentAltitudeAtCenterDirty=!1;const e=this._centerRay;return null==e||(this.view.sceneIntersectionHelper.intersectRay(e,this._contentIntersector,j,H)?this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(j):this._contentAltitudeAtCenter=this._estimateSurfaceAltitudeAtCenter()),this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(){if(!this.view.basemapTerrain)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;this._surfaceAltitudeAtCenterDirty=!1;const e=this._centerRay;if(null==e)return this._surfaceAltitudeAtCenter;const t=e.origin,r=u(j,e.origin,e.direction);return this._surfaceIntersector.resetWithRay(e,this.view.state.contentCamera),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,t,r),this._surfaceIntersector.results.min.getIntersectionPoint(j)&&(this._surfaceAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(j)),this._surfaceAltitudeAtCenter}_estimateSurfaceIntersectionAtRenderPoint(e,t,r){const s=C(t,e,T);if(null==s)return null;const n=s.origin,i=u(j,s.origin,s.direction);return this._surfaceIntersector.resetWithRay(s,t),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,n,i),this._surfaceIntersector.results.min.getIntersectionPoint(r)?r:null}_cameraChanged(e){this._updateCenterPointsOfInterest();const t=e.eye;d(this.renderPointOfView,t)||this._set("renderPointOfView",h(this._propertiesPool.get("renderPointOfView"),t))}_updateCenterPointsOfInterest(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0;for(const e of this._pois)e.updateRenderLocation()}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)return this._debugCenters?.forEach(e=>e.hide()),void this.removeHandles("debug");if(!this._debugCenters){this._debugCenters=new Map;const e=this.view.graphics;this._debugCenters.set(this.centerOnContent,new m(e,"red","CenterOnContent")),this._debugCenters.set(this.centerOnSurfaceFrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.centerOnSurfaceInfrequent,new m(e,"red","CenterOnSurface")),this._debugCenters.set(this.cameraOnSurface,new m(e,"blue","CameraOnSurface")),this._debugCenters.set(this.focus,new m(e,"green","Focus"))}for(const t of this._pois)this.addHandles(this._updatingHandles.add(()=>t.renderLocation,e=>this._debugCenters?.get(t)?.show(e,t.renderCoordsHelper.spatialReference),o),"debug")}get test(){}};e([a()],P.prototype,"centerOnContent",void 0),e([a()],P.prototype,"centerOnSurfaceFrequent",void 0),e([a()],P.prototype,"centerOnSurfaceInfrequent",void 0),e([a()],P.prototype,"cameraOnSurface",void 0),e([a()],P.prototype,"focus",void 0),e([a()],P.prototype,"renderPointOfView",void 0),e([a()],P.prototype,"surfaceOrigin",void 0),e([a()],P.prototype,"contentGeometryUpdates",void 0),e([a()],P.prototype,"surfaceGeometryUpdates",void 0),e([a({constructOnly:!0})],P.prototype,"view",void 0),e([a()],P.prototype,"updating",null),P=e([c("esri.views.3d.support.pointsOfInterest.PointsOfInterest")],P);const j=p(),T=l(),H={exclude:new Set([I])};export{P as PointsOfInterest};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{invert as t,transpose as s}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{q as o,I as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as n}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ComponentTechnique as c}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as p}from"./ComponentTechniqueConfiguration.js";import{parameter as d,parameterBlock as m,MaterialBase as v,MaterialParameterBlock as g}from"../../../core/material/MaterialBase.js";import{isColorEmission as x}from"../../../core/shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as f}from"../../../core/util/TwoVectorPosition.js";import{advancedMRRFactors as M}from"../../../materials/pbrUtils.js";import{defaultHighlightName as b}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as y}from"../../../../../../webscene/support/AlphaCutoff.js";class T extends v{constructor(e,o){super(),this.toMapSpace=o,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=M,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=0,this.commonMaterialParameters=new S,this.componentParameters=new O,this.objectOpacity=1,this.textureAlphaCutoff=y,this.alphaDiscardMode=1,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=1,this.hasOccludees=!1;const i=new f(e.position),l=r(e.rotationScale);t(l,l),s(l,l),this.transformNormalGlobalFromModel=l,this.transformWorldFromModelTL=i.low,this.transformWorldFromModelTH=i.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get _hasEmissiveBase(){return null!=this.emissionTexture||!o(this.emissiveBaseColor,l)}get _hasEmissiveStrength(){return 2!==this.componentParameters.emissiveOverride}get hasEmissions(){return this._hasEmissiveStrength&&(this._hasEmissiveBase||2!==this.componentParameters.emissiveSourceOverride)}get texture(){return this.baseColorTexture?.glTexture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.glTexture}get textureEmissive(){return this.emissionTexture?.glTexture}get textureOcclusion(){return this.occlusionTexture?.glTexture}get textureNormal(){return this.normalTexture?.glTexture}acquireTechnique(e,t,s,r){const o=new p(e.context.spherical);o.renderOccluded=9===s.slot,o.hasVertexColors=r.hasVertexColors,o.hasNormals=r.hasNormals,o.textureCoordinateType=r.textureCoordinateType,o.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,o.hasOcclusionTexture=null!=this.occlusionTexture,o.hasNormalTexture=null!=this.normalTexture,o.oitPass=0===t.identifier&&null!=s.oitPass?s.oitPass:0,o.terrainDepthTest=0===t.identifier&&s.terrainDepthTest,o.cullAboveTerrain=0===t.identifier&&s.cullAboveTerrain,o.ellipsoidMode=this.ellipsoidMode,o.componentData=this.componentParameters.type,o.cullFace=this.commonMaterialParameters.cullFace,o.doubleSidedMode=this.commonMaterialParameters.doubleSided?1:0,o.hasColorTexture=null!=this.baseColorTexture;const i=this._computeWhichMaterialPass();o.blendingEnabled=1===i||2===i,o.alphaDiscardMode=this.alphaDiscardMode,o.integratedMeshMode=this.isIntegratedMesh?D(s)?P(s)?3:2:1:0,o.hasPolygonOffset=this.polygonOffsetEnabled,o.pbrMode=3===o.integratedMeshMode?4:this.usePBR?this.hasParametersFromSource?r.shadeNormals&&this.isIntegratedMesh?0:2:1:0;const a=1===this.componentParameters.emissiveSourceOverride,l=2===this.componentParameters.emissiveSourceOverride,n=null!=this.emissionTexture;if(o.emissionSource=this.hasEmissions?this._hasEmissiveBase&&1===o.pbrMode?l?n?4:2:a?n?5:7:6:a?7:6:0,o.shadeNormals=r.shadeNormals,o.normalType=o.hasNormals?1:2,o.hasSlicePlane=null!=s.slicePlane&&this.commonMaterialParameters.hasSlicePlane,o.receiveAmbientOcclusion=o.hasOccludees=o.receiveShadows=o.screenSpaceReflections=o.cloudReflections=o.hasHighlightMixTexture=!1,1===t.identifier)o.output=4,o.vertexDiscardMode=0;else if(3===t.identifier)o.output=7,o.vertexDiscardMode=0;else if(2===t.identifier)o.output=9,o.vertexDiscardMode=0,o.hasHighlightMixTexture=null!=s.highlightMixTexture;else{switch(o.vertexDiscardMode=2===i?t.transparent?2:1:0,o.hasBloom=x(t.output),o.output=t.output,t.output){case 0:case 1:o.receiveAmbientOcclusion=r.applySSAO&&null!=s.ssao?.getTexture(),o.hasOccludees=s.hasOccludees,o.receiveShadows=s.shadowMap.ready,o.screenSpaceReflections=null!=s.ssr.lastFrameColor,o.cloudReflections=null!=s.clouds.data?.cubeMap?.colorTexture;break;case 10:o.olidColor=!0}o.snowCover=s.snowCover}const h=e.get(c,o);return this._setClean(),h}submit(e,t,s){if(this.objectOpacity<=0)return;const{componentData:r,renderable:o}=s,{geometry:i}=o,a=o.meta.cameraDepthSquared;r.updateHighlights(t.highlights);const{geometryRanges:l,highlightRangesMap:n,shadowmapRanges:h}=r;switch(this._computeWhichMaterialPass()){case 0:e.opaque.submitDraw(this,i,l,a);break;case 1:e.transparent.submitDraw(this,i,l,a);break;case 2:e.opaque.submitDraw(this,i,l,a),e.transparent.submitDraw(this,i,l,a);break;case 3:e.integratedMesh.submitDraw(this,i,l,a),j(t)&&e.occludedGround.submitDraw(this,i,l,a),C(t)&&e.highlightIntegratedMesh.submitDraw(this,i,l,a);break;case 4:e.transparentIntegratedMesh.submitDraw(this,i,l,a)}if(2!==this.componentParameters.castShadows){if(null!=n)for(const t of n)t[0]===b&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=h&&e.defaultShadowMap.submitDraw(this,i,h,a),e.shadowMap.submitDraw(this,i,l,a)}if(null!=n)for(const u of n)e.highlight.submitDraw(this,i,u[1],a,u[0]);t.viewshedEnabled&&e.viewshedShadowMap.submitDraw(this,i,l,a)}_computeWhichMaterialPass(){if(this.isIntegratedMesh&&this.objectOpacity>=1)return 3;if(this.isIntegratedMesh&&this.objectOpacity<1)return 4;if(this.objectOpacity<1)return 1;if(0===this.componentParameters.opaqueOverride)return 0;if(this.baseColor[3]<1||0===this.alphaDiscardMode||3===this.alphaDiscardMode)return 1;switch(this.componentParameters.transparent){case 2:return 0;case 0:return 1;case 1:return 2}}}e([d({vectorOps:n})],T.prototype,"baseColor",void 0),e([d()],T.prototype,"usePBR",void 0),e([d()],T.prototype,"hasParametersFromSource",void 0),e([d({vectorOps:i})],T.prototype,"mrrFactors",void 0),e([d({dispose:!0})],T.prototype,"baseColorTexture",void 0),e([d({dispose:!0})],T.prototype,"metallicRoughnessTexture",void 0),e([d({dispose:!0})],T.prototype,"normalTexture",void 0),e([d({dispose:!0})],T.prototype,"occlusionTexture",void 0),e([d({dispose:!0})],T.prototype,"emissionTexture",void 0),e([d({vectorOps:i})],T.prototype,"emissiveBaseColor",void 0),e([d()],T.prototype,"emissiveStrength",void 0),e([m()],T.prototype,"commonMaterialParameters",void 0),e([m()],T.prototype,"componentParameters",void 0),e([d()],T.prototype,"objectOpacity",void 0),e([d()],T.prototype,"textureAlphaCutoff",void 0),e([d()],T.prototype,"alphaDiscardMode",void 0),e([d()],T.prototype,"isIntegratedMesh",void 0),e([d()],T.prototype,"polygonOffsetEnabled",void 0),e([d()],T.prototype,"ellipsoidMode",void 0),e([d()],T.prototype,"hasOccludees",void 0);class S extends g{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=2,this.hasSlicePlane=!0}}e([d()],S.prototype,"doubleSided",void 0),e([d()],S.prototype,"cullFace",void 0),e([d()],S.prototype,"hasSlicePlane",void 0);class O extends g{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=1,this.emissiveStrength=0,this.emissiveSource=0,this.castShadows=0}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}get visible(){return this.externalColor[3]>0?0:2}get type(){return 0}}e([d({vectorOps:n})],O.prototype,"externalColor",void 0),e([d()],O.prototype,"externalColorMixMode",void 0),e([d()],O.prototype,"emissiveStrength",void 0),e([d()],O.prototype,"emissiveSource",void 0),e([d()],O.prototype,"castShadows",void 0);class w extends g{constructor(){super(...arguments),this.texture=null,this.transparent=2,this.opaqueOverride=2,this.emissiveOverride=2,this.emissiveSourceOverride=2,this.castShadows=2}get type(){return 1}}function C(e){return null!=e.overlay?.getTexture(2)}function P(e){return null!=e.overlay?.getTexture(3)}function D(e){return null!=e.overlay?.getTexture(1)}function j(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}e([d()],w.prototype,"texture",void 0),e([d()],w.prototype,"transparent",void 0),e([d()],w.prototype,"opaqueOverride",void 0),e([d()],w.prototype,"emissiveOverride",void 0),e([d()],w.prototype,"emissiveSourceOverride",void 0),e([d()],w.prototype,"castShadows",void 0);export{S as CommonMaterialParameters,T as ComponentMaterial,O as ComponentParametersUniform,w as ComponentParametersVarying};
5
+ import{__decorate as e}from"tslib";import{invert as t,transpose as s}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{q as o,I as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as n}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ComponentTechnique as c}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as p}from"./ComponentTechniqueConfiguration.js";import{parameter as d,parameterBlock as m,MaterialBase as v,MaterialParameterBlock as g}from"../../../core/material/MaterialBase.js";import{isColorEmission as x}from"../../../core/shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as f}from"../../../core/util/TwoVectorPosition.js";import{advancedMRRFactors as M}from"../../../materials/pbrUtils.js";import{defaultHighlightName as b}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as y}from"../../../../../../webscene/support/AlphaCutoff.js";class T extends v{constructor(e,o){super(),this.toMapSpace=o,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=M,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=0,this.commonMaterialParameters=new S,this.componentParameters=new O,this.objectOpacity=1,this.textureAlphaCutoff=y,this.alphaDiscardMode=1,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=1,this.hasOccludees=!1;const i=new f(e.position),l=r(e.rotationScale);t(l,l),s(l,l),this.transformNormalGlobalFromModel=l,this.transformWorldFromModelTL=i.low,this.transformWorldFromModelTH=i.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get _hasEmissiveBase(){return null!=this.emissionTexture||!o(this.emissiveBaseColor,l)}get _hasEmissiveStrength(){return 2!==this.componentParameters.emissiveOverride}get hasEmissions(){return this._hasEmissiveStrength&&(this._hasEmissiveBase||2!==this.componentParameters.emissiveSourceOverride)}get texture(){return this.baseColorTexture?.glTexture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.glTexture}get textureEmissive(){return this.emissionTexture?.glTexture}get textureOcclusion(){return this.occlusionTexture?.glTexture}get textureNormal(){return this.normalTexture?.glTexture}acquireTechnique(e,t,s,r){const o=new p(e.context.spherical);o.renderOccluded=9===s.slot,o.hasVertexColors=r.hasVertexColors,o.hasNormals=r.hasNormals,o.textureCoordinateType=r.textureCoordinateType,o.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,o.hasOcclusionTexture=null!=this.occlusionTexture,o.hasNormalTexture=null!=this.normalTexture,o.oitPass=0===t.identifier&&null!=s.oitPass?s.oitPass:0,o.terrainDepthTest=0===t.identifier&&s.terrainDepthTest,o.cullAboveTerrain=0===t.identifier&&s.cullAboveTerrain,o.ellipsoidMode=this.ellipsoidMode,o.componentData=this.componentParameters.type,o.cullFace=this.commonMaterialParameters.cullFace,o.doubleSidedMode=this.commonMaterialParameters.doubleSided?1:0,o.hasColorTexture=null!=this.baseColorTexture;const i=this._computeWhichMaterialPass();o.blendingEnabled=1===i||2===i,o.alphaDiscardMode=this.alphaDiscardMode,o.integratedMeshMode=this.isIntegratedMesh?D(s)?P(s)?3:2:1:0,o.hasPolygonOffset=this.polygonOffsetEnabled,o.pbrMode=3===o.integratedMeshMode?4:this.usePBR?this.hasParametersFromSource?r.shadeNormals&&this.isIntegratedMesh?0:2:1:0;const a=1===this.componentParameters.emissiveSourceOverride,l=2===this.componentParameters.emissiveSourceOverride,n=null!=this.emissionTexture;if(o.emissionSource=this.hasEmissions?this._hasEmissiveBase&&1===o.pbrMode?l?n?4:2:a?n?5:7:6:a?7:6:0,o.shadeNormals=r.shadeNormals,o.normalType=o.hasNormals?1:2,o.hasSlicePlane=null!=s.slicePlane&&this.commonMaterialParameters.hasSlicePlane,o.receiveAmbientOcclusion=o.hasOccludees=o.receiveShadows=o.screenSpaceReflections=o.cloudReflections=o.hasHighlightMixTexture=!1,1===t.identifier)o.output=4,o.vertexDiscardMode=0;else if(3===t.identifier)o.output=7,o.vertexDiscardMode=0;else if(2===t.identifier)o.output=9,o.vertexDiscardMode=0,o.hasHighlightMixTexture=null!=s.highlightMixTexture;else{switch(o.vertexDiscardMode=2===i?t.transparent?2:1:0,o.hasBloom=x(t.output),o.output=t.output,t.output){case 0:case 1:o.receiveAmbientOcclusion=r.applySSAO&&null!=s.ssao?.getTexture(),o.hasOccludees=s.hasOccludees,o.receiveShadows=s.shadowMap.ready,o.screenSpaceReflections=null!=s.ssr.lastFrameColor,o.cloudReflections=null!=s.clouds.data?.cubeMap?.colorTexture;break;case 10:o.olidColor=!0}o.snowCover=s.snowCover>0}const h=e.get(c,o);return this._setClean(),h}submit(e,t,s){if(this.objectOpacity<=0)return;const{componentData:r,renderable:o}=s,{geometry:i}=o,a=o.meta.cameraDepthSquared;r.updateHighlights(t.highlights);const{geometryRanges:l,highlightRangesMap:n,shadowmapRanges:h}=r;switch(this._computeWhichMaterialPass()){case 0:e.opaque.submitDraw(this,i,l,a);break;case 1:e.transparent.submitDraw(this,i,l,a);break;case 2:e.opaque.submitDraw(this,i,l,a),e.transparent.submitDraw(this,i,l,a);break;case 3:e.integratedMesh.submitDraw(this,i,l,a),j(t)&&e.occludedGround.submitDraw(this,i,l,a),C(t)&&e.highlightIntegratedMesh.submitDraw(this,i,l,a);break;case 4:e.transparentIntegratedMesh.submitDraw(this,i,l,a)}if(2!==this.componentParameters.castShadows){if(null!=n)for(const t of n)t[0]===b&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=h&&e.defaultShadowMap.submitDraw(this,i,h,a),e.shadowMap.submitDraw(this,i,l,a)}if(null!=n)for(const u of n)e.highlight.submitDraw(this,i,u[1],a,u[0]);t.viewshedEnabled&&e.viewshedShadowMap.submitDraw(this,i,l,a)}_computeWhichMaterialPass(){if(this.isIntegratedMesh&&this.objectOpacity>=1)return 3;if(this.isIntegratedMesh&&this.objectOpacity<1)return 4;if(this.objectOpacity<1)return 1;if(0===this.componentParameters.opaqueOverride)return 0;if(this.baseColor[3]<1||0===this.alphaDiscardMode||3===this.alphaDiscardMode)return 1;switch(this.componentParameters.transparent){case 2:return 0;case 0:return 1;case 1:return 2}}}e([d({vectorOps:n})],T.prototype,"baseColor",void 0),e([d()],T.prototype,"usePBR",void 0),e([d()],T.prototype,"hasParametersFromSource",void 0),e([d({vectorOps:i})],T.prototype,"mrrFactors",void 0),e([d({dispose:!0})],T.prototype,"baseColorTexture",void 0),e([d({dispose:!0})],T.prototype,"metallicRoughnessTexture",void 0),e([d({dispose:!0})],T.prototype,"normalTexture",void 0),e([d({dispose:!0})],T.prototype,"occlusionTexture",void 0),e([d({dispose:!0})],T.prototype,"emissionTexture",void 0),e([d({vectorOps:i})],T.prototype,"emissiveBaseColor",void 0),e([d()],T.prototype,"emissiveStrength",void 0),e([m()],T.prototype,"commonMaterialParameters",void 0),e([m()],T.prototype,"componentParameters",void 0),e([d()],T.prototype,"objectOpacity",void 0),e([d()],T.prototype,"textureAlphaCutoff",void 0),e([d()],T.prototype,"alphaDiscardMode",void 0),e([d()],T.prototype,"isIntegratedMesh",void 0),e([d()],T.prototype,"polygonOffsetEnabled",void 0),e([d()],T.prototype,"ellipsoidMode",void 0),e([d()],T.prototype,"hasOccludees",void 0);class S extends g{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=2,this.hasSlicePlane=!0}}e([d()],S.prototype,"doubleSided",void 0),e([d()],S.prototype,"cullFace",void 0),e([d()],S.prototype,"hasSlicePlane",void 0);class O extends g{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=1,this.emissiveStrength=0,this.emissiveSource=0,this.castShadows=0}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}get visible(){return this.externalColor[3]>0?0:2}get type(){return 0}}e([d({vectorOps:n})],O.prototype,"externalColor",void 0),e([d()],O.prototype,"externalColorMixMode",void 0),e([d()],O.prototype,"emissiveStrength",void 0),e([d()],O.prototype,"emissiveSource",void 0),e([d()],O.prototype,"castShadows",void 0);class w extends g{constructor(){super(...arguments),this.texture=null,this.transparent=2,this.opaqueOverride=2,this.emissiveOverride=2,this.emissiveSourceOverride=2,this.castShadows=2}get type(){return 1}}function C(e){return null!=e.overlay?.getTexture(2)}function P(e){return null!=e.overlay?.getTexture(3)}function D(e){return null!=e.overlay?.getTexture(1)}function j(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}e([d()],w.prototype,"texture",void 0),e([d()],w.prototype,"transparent",void 0),e([d()],w.prototype,"opaqueOverride",void 0),e([d()],w.prototype,"emissiveOverride",void 0),e([d()],w.prototype,"emissiveSourceOverride",void 0),e([d()],w.prototype,"castShadows",void 0);export{S as CommonMaterialParameters,T as ComponentMaterial,O as ComponentParametersUniform,w as ComponentParametersVarying};
@@ -0,0 +1,40 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{glsl as a}from"../../shaderModules/glsl.js";function c(c){c.code.add(a`void computeCovariance3D(in mat3 rotation, in vec3 scale, out vec3 covarianceA, out vec3 covarianceB) {
6
+ mat3 scaleMatrix = mat3(
7
+ vec3(scale.x, 0.0, 0.0),
8
+ vec3(0.0, scale.y, 0.0),
9
+ vec3(0.0, 0.0, scale.z)
10
+ );
11
+ mat3 M = scaleMatrix * rotation;
12
+ mat3 covariance3D = transpose(M) * M;
13
+ covarianceA = vec3(covariance3D[0][0], covariance3D[0][1], covariance3D[0][2]);
14
+ covarianceB = vec3(covariance3D[1][1], covariance3D[1][2], covariance3D[2][2]);
15
+ }
16
+ vec3 computeCovariance2D(vec3 center, float focalLength, vec2 tanFov, float[6] cov3D, mat4 view) {
17
+ vec4 viewSpacePoint = vec4(center, 1);
18
+ vec2 max = 1.3 * tanFov;
19
+ vec2 normalized = viewSpacePoint.xy / viewSpacePoint.z;
20
+ viewSpacePoint.xy = clamp(normalized, -max, max) * viewSpacePoint.z;
21
+ float invZ = 1.0 / viewSpacePoint.z;
22
+ float invZSquared = invZ * invZ;
23
+ mat3 projectionJacobian = mat3(
24
+ focalLength * invZ, 0.0, -(focalLength * viewSpacePoint.x) * invZSquared,
25
+ 0.0, focalLength * invZ, -(focalLength * viewSpacePoint.y) * invZSquared,
26
+ 0.0, 0.0, 0.0
27
+ );
28
+ mat3 worldToView = transpose(mat3(view));
29
+ mat3 T = worldToView * projectionJacobian;
30
+ mat3 covariance3D = mat3(
31
+ cov3D[0], cov3D[1], cov3D[2],
32
+ cov3D[1], cov3D[3], cov3D[4],
33
+ cov3D[2], cov3D[4], cov3D[5]
34
+ );
35
+ mat3 covariance2D = transpose(T) * transpose(covariance3D) * T;
36
+ const float regularization = 0.3;
37
+ covariance2D[0][0] += regularization;
38
+ covariance2D[1][1] += regularization;
39
+ return vec3(covariance2D[0][0], covariance2D[0][1], covariance2D[1][1]);
40
+ }`)}export{c as ComputeCovariance};
@@ -0,0 +1,59 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{glsl as a}from"../../shaderModules/glsl.js";function e(e){e.code.add(a`vec4 unpackColor(uvec4 packedGaussian) {
6
+ vec4 color;
7
+ color.r = float((packedGaussian.w >> 1u) & 0xfeu);
8
+ color.g = float((packedGaussian.w >> 9u) & 0xffu);
9
+ color.b = float((packedGaussian.w >> 16u) & 0xfeu);
10
+ color.a = float((packedGaussian.w >> 24u) & 0xffu);
11
+ return color / 255.0;
12
+ }`),e.code.add(a`vec3 unpackScale(uvec4 packedGaussian) {
13
+ uint sx = (packedGaussian.z >> 10u) & 0xffu;
14
+ uint sy = (packedGaussian.z >> 18u) & 0xffu;
15
+ uint szLow = (packedGaussian.z >> 26u) & 0x3fu;
16
+ uint szHigh = packedGaussian.a & 0x3u;
17
+ uint sz = szLow | (szHigh << 6u);
18
+ return exp(vec3(sx, sy, sz) / 16.0 - 10.0);
19
+ }`),e.code.add(a`const uint MASK_9_BITS = 0x1FFu;
20
+ const float SQRT_HALF = 0.7071067811865476;
21
+ const ivec3 COMPONENT_ORDER[4] = ivec3[4](
22
+ ivec3(3, 2, 1),
23
+ ivec3(3, 2, 0),
24
+ ivec3(3, 1, 0),
25
+ ivec3(2, 1, 0)
26
+ );
27
+ vec4 unpackQuaternion(uvec4 packedGaussian) {
28
+ uint packedRotation = packedGaussian.x;
29
+ uint largestComponent = packedRotation >> 30u;
30
+ vec4 quaternion = vec4(0.0);
31
+ float sumSquares = 0.0;
32
+ uint bitfield = packedRotation;
33
+ for (int j = 0; j < 3; ++j) {
34
+ int index = COMPONENT_ORDER[int(largestComponent)][j];
35
+ uint magnitude = bitfield & MASK_9_BITS;
36
+ uint signBit = (bitfield >> 9u) & 1u;
37
+ bitfield = bitfield >> 10u;
38
+ float value = SQRT_HALF * float(magnitude) / float(MASK_9_BITS);
39
+ quaternion[index] = signBit == 1u ? -value : value;
40
+ sumSquares += value * value;
41
+ }
42
+ quaternion[int(largestComponent)] = sqrt(1.0 - sumSquares);
43
+ return quaternion;
44
+ }`),e.code.add(a`vec3 unpackTileOriginRelativePosition(uvec4 packedGaussian) {
45
+ uint packedPositionLow = packedGaussian.y;
46
+ uint packedPositionHigh = packedGaussian.z;
47
+ uint x = packedPositionLow & 0x3FFFu;
48
+ uint y = (packedPositionLow >> 14u) & 0x3FFFu;
49
+ uint zLow = (packedPositionLow >> 28u) & 0xFu;
50
+ uint zHigh = packedPositionHigh & 0x3FFu;
51
+ uint z = zLow | (zHigh << 4u);
52
+ return vec3(float(x), float(y), float(z));
53
+ }`),e.code.add(a`vec3 unpackCameraRelativeGaussianPosition(uvec4 packedHeader, highp vec3 position, vec3 cameraPosition, vec3 cameraPos8k, vec3 cameraDelta) {
54
+ vec3 tileOrigin = uintBitsToFloat(packedHeader.xyz);
55
+ float invPosScale = 1.0 / exp2(float(packedHeader.w & 0xffu));
56
+ vec3 delta = tileOrigin.xyz - cameraPos8k;
57
+ vec3 cameraRelativePosition = position.xyz * invPosScale + delta * 2.048 - cameraDelta;
58
+ return cameraRelativePosition;
59
+ }`)}export{e as GaussianSplatUnpacking};
@@ -0,0 +1,23 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{glsl as x}from"../../shaderModules/glsl.js";function y(y){y.code.add(x`mat3 quaternionToRotationMatrix(vec4 q) {
6
+ float x2 = q.x + q.x;
7
+ float y2 = q.y + q.y;
8
+ float z2 = q.z + q.z;
9
+ float xx = x2 * q.x;
10
+ float yy = y2 * q.y;
11
+ float zz = z2 * q.z;
12
+ float xy = x2 * q.y;
13
+ float xz = x2 * q.z;
14
+ float yz = y2 * q.z;
15
+ float wx = x2 * q.w;
16
+ float wy = y2 * q.w;
17
+ float wz = z2 * q.w;
18
+ return mat3(
19
+ 1.0 - (yy + zz), xy - wz, xz + wy,
20
+ xy + wz, 1.0 - (xx + zz), yz - wx,
21
+ xz - wy, yz + wx, 1.0 - (xx + yy)
22
+ );
23
+ }`)}export{y as QuaternionToRotationMatrix};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{C as e}from"../../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as t}from"../../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as i}from"../../shaders/CompositingTechniqueConfiguration.js";class r{constructor(r,s=0){this._techniques=r,this._parameters=new e,this._configuration=new i,this._configuration.blitMode=s,r.precompile(t,this._configuration)}blit(e,i,r,s){e.bindFramebuffer(r.fbo),e.setClearColor(0,0,0,1),e.clear(16384),this._parameters.texture=i.getTexture();const o=this._techniques.get(t,this._configuration);e.bindTechnique(o,s,this._parameters),e.screen.draw()}blend(e,i,r,s,o=1){this._configuration.hasOpacityFactor=o<1;const n=this._techniques.get(t,this._configuration);return!!n.compiled&&(e.bindFramebuffer(r.fbo),this._parameters.texture=i.getTexture(),this._parameters.opacity=o,e.bindTechnique(n,s,this._parameters),e.screen.draw(),!0)}}export{r as Blit};
5
+ import{C as e}from"../../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as t}from"../../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as i}from"../../shaders/CompositingTechniqueConfiguration.js";class r{constructor(r,s=0){this._techniques=r,this._parameters=new e,this._configuration=new i,this._configuration.blitMode=s,r.precompile(t,this._configuration)}blit(e,t,i,r){this.blitTexture(e,t.getTexture(),i,r)}blitTexture(e,i,r,s){e.bindFramebuffer(r.fbo),e.setClearColor(0,0,0,1),e.clear(16384),this._parameters.texture=i;const o=this._techniques.get(t,this._configuration);e.bindTechnique(o,s,this._parameters),e.screen.draw()}blend(e,i,r,s,o=1){this._configuration.hasOpacityFactor=o<1;const n=this._techniques.get(t,this._configuration);return!!n.compiled&&(e.bindFramebuffer(r.fbo),this._parameters.texture=i.getTexture(),this._parameters.opacity=o,e.bindTechnique(n,s,this._parameters),e.screen.draw(),!0)}}export{r as Blit};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/FloatsPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/IntegerPassUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./BloomPresets.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{B as BloomCompositionPassParameters,b as build,d as defaultCompositionParameters}from"../../../../../chunks/BloomComposition.glsl.js";
5
+ import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatsPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/IntegerPassUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./BloomPresets.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{B as BloomCompositionPassParameters,b as build,d as defaultCompositionParameters}from"../../../../../chunks/BloomComposition.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as r}from"../../../../../chunks/BloomComposition.glsl.js";import{Pos2Locations as i}from"../../lib/DefaultVertexBufferLayouts.js";import{makePipelineState as s,defaultColorWrite as t}from"../../../../webgl/renderState.js";class l extends o{constructor(o,s){super(o,s,new e(r,()=>import("./BloomComposition.glsl.js")),i)}initializePipeline(){return s({colorWrite:t})}}export{l as BloomCompositionTechnique};
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as o}from"../../../../../chunks/BloomComposition.glsl.js";import{Pos2Locations as s}from"../../lib/DefaultVertexBufferLayouts.js";import{ColorAttachment0 as i,ColorAttachment1 as t}from"../../../../webgl/enums.js";import{makePipelineState as m,defaultColorWrite as l}from"../../../../webgl/renderState.js";class a extends r{constructor(r,i){super(r,i,new e(o,()=>import("./BloomComposition.glsl.js")),s)}initializePipeline(){return m({colorWrite:l,drawBuffers:{buffers:[i,t]}})}}export{a as BloomCompositionTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as o,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{InternalRenderCategory as a}from"../../../webgl.js";import{TransparentEnvironment as n}from"../TransparentEnvironment.js";import{B as m}from"../../../../../chunks/BloomBlur.glsl.js";import{BloomBlurTechnique as l}from"./BloomBlurTechnique.js";import{BloomBlurTechniqueConfiguration as h}from"./BloomBlurTechniqueConfiguration.js";import{B as c}from"../../../../../chunks/BloomComposition.glsl.js";import{BloomCompositionTechnique as u}from"./BloomCompositionTechnique.js";import{BloomCompositionTechniqueConfiguration as p}from"./BloomCompositionTechniqueConfiguration.js";import{blurRadiusPresets as d,lodFactorsPresets as b,normalizePreset as g}from"./BloomPresets.glsl.js";import{ColorAttachment1 as _,DepthStencilAttachment as f}from"../../../../webgl/enums.js";let P=class extends n{constructor(e){super(e),this.consumes={required:[a.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=a.TRANSPARENT_ENVIRONMENT,this._blurHorizontalConfiguration=new h,this._blurVerticalConfiguration=new h,this._compositionConfiguration=new p,this._compositionParameters=new c,this._blurParameters=new m,this._blurScale=3.06,this._glowEnabled=!1,this._bloomResults=new Array;e.view.stage.renderView.techniques.precompile(u,this._compositionConfiguration)}initialize(){this.addHandles([o(()=>this._updateFogParameters(),()=>{},r),o(()=>this.view.qualitySettings.bloom,e=>{this._glowEnabled=e,this.precompile(),this.requestRender(1)},r)])}_updateFogParameters(){const e=this.view.environment.weather;if("sunny"===e.type||"cloudy"===e.type)this._blurParameters.blurRadius=d[e.type];else{const o="foggy"===e.type?e.fogStrength:e.precipitation;this._blurParameters.blurRadius=t(d.cloudy,d[e.type],o)}this._compositionParameters.lodFactors=b[e.type].far,this._compositionParameters.lodFactorsFront=b[e.type].near,this.requestRender(1)}precompile(){this._glowEnabled&&(this.techniques.precompile(l,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.bloomStage=1,this.techniques.precompile(l,this._blurVerticalConfiguration)),this._compositionConfiguration.blurEnabled=this._glowEnabled,this.techniques.precompile(u,this._compositionConfiguration)}render(e){const t=e.find(({name:e})=>e===a.TRANSPARENT_ENVIRONMENT),o=t.getAttachment(_)?.attachment;if(!o)return t;if(!this._glowEnabled){const e=this.techniques.get(u,this._compositionConfiguration);if(!e.compiled)return this.requestRender(1),t;const r=t.getTexture(),i=this.fboCache,{fullWidth:s,fullHeight:a}=this.bindParameters.camera,n=this.renderingContext,m=i.acquire(r.descriptor.width,r.descriptor.height,this.produces);return this._prepareFBO(m,s,a),this._compositionParameters.color=r,this._compositionParameters.emission=o,n.bindTechnique(e,this.bindParameters,this._compositionParameters),n.screen.draw(),m.attachDepth(t.getAttachment(f)),m.attachColor(t.getAttachment(_),_),m}const r=this.techniques.get(l,this._blurHorizontalConfiguration),i=this.techniques.get(l,this._blurVerticalConfiguration),s=this.techniques.get(u,this._compositionConfiguration);if(!r.compiled||!i.compiled||!s.compiled)return this.requestRender(1),t;const n=t.getTexture(),m=this.fboCache,{fullWidth:h,fullHeight:c}=this.bindParameters.camera,p=this.renderingContext;let d=o,b=Math.ceil(h/2),g=Math.ceil(c/2);const P=5,T=this._blurParameters.blurRadius;for(let a=0;a<P;a++){const e=m.acquire(b,g,"bloomHorizontal",8);this._blurParameters.color=d,this._prepareFBO(e,b,g),p.bindTechnique(r,this.bindParameters,this._blurParameters),p.screen.draw();const t=m.acquire(b,g,"bloomVertical",8);this._blurParameters.color=e.getTexture(),this._prepareFBO(t,b,g),p.bindTechnique(i,this.bindParameters,this._blurParameters),p.screen.draw(),e.release(),this._bloomResults[a]=t,b=Math.ceil(b/2),g=Math.ceil(g/2),d=this._bloomResults[a].getTexture(),this._blurParameters.blurRadius*=this._blurScale}this._blurParameters.blurRadius=T,this._compositionParameters.color=n,this._compositionParameters.emission=o,this._compositionParameters.bloomTexture0=this._bloomResults[0].getTexture(),this._compositionParameters.bloomTexture1=this._bloomResults[1].getTexture(),this._compositionParameters.bloomTexture2=this._bloomResults[2].getTexture(),this._compositionParameters.bloomTexture3=this._bloomResults[3].getTexture(),this._compositionParameters.bloomTexture4=this._bloomResults[4].getTexture();const R=m.acquire(n.descriptor.width,n.descriptor.height,this.produces);return this._prepareFBO(R,h,c),p.bindTechnique(s,this.bindParameters,this._compositionParameters),p.screen.draw(),this._bloomResults.forEach(e=>e.release()),R.attachDepth(t.getAttachment(f)),R.attachColor(t.getAttachment(_),_),R}_prepareFBO(e,t,o){const r=this.renderingContext;r.bindFramebuffer(e.fbo),r.setViewport(0,0,t,o),r.setClearColor(0,0,0,0),r.clear(16384)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setLodFactors:e=>{this._compositionParameters.lodFactors=g(e)},toggleTonemapping:e=>{this._compositionConfiguration.tonemappingEnabled=e,this.requestRender(1)}}}};e([i()],P.prototype,"consumes",void 0),e([i()],P.prototype,"produces",void 0),P=e([s("esri.views.3d.webgl-engine.effects.bloom.BloomRenderNode")],P);export{P as BloomRenderNode};
5
+ import{__decorate as e}from"tslib";import{lerp as t}from"../../../../../core/mathUtils.js";import{watch as o,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as a}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{InternalRenderCategory as n}from"../../../webgl.js";import{TransparentEnvironment as m}from"../TransparentEnvironment.js";import{B as l}from"../../../../../chunks/BloomBlur.glsl.js";import{BloomBlurTechnique as c}from"./BloomBlurTechnique.js";import{BloomBlurTechniqueConfiguration as h}from"./BloomBlurTechniqueConfiguration.js";import{B as u}from"../../../../../chunks/BloomComposition.glsl.js";import{BloomCompositionTechnique as p}from"./BloomCompositionTechnique.js";import{BloomCompositionTechniqueConfiguration as d}from"./BloomCompositionTechniqueConfiguration.js";import{blurRadiusPresets as b,lodFactorsPresets as g,normalizePreset as _}from"./BloomPresets.glsl.js";import{ColorAttachment1 as f,DepthStencilAttachment as P}from"../../../../webgl/enums.js";let T=class extends m{constructor(e){super(e),this.consumes={required:[n.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=n.TRANSPARENT_ENVIRONMENT,this._blurHorizontalConfiguration=new h,this._blurVerticalConfiguration=new h,this._compositionConfiguration=new d,this._compositionParameters=new u,this._blurParameters=new l,this._blurScale=3.06,this._glowEnabled=!1,this._bloomResults=new Array;e.view.stage.renderView.techniques.precompile(p,this._compositionConfiguration)}initialize(){this.addHandles([o(()=>this._updateFogParameters(),()=>{},r),o(()=>this.view.qualitySettings.glow,e=>{this._glowEnabled=e,this.precompile(),this.requestRender(1)},r)])}_updateFogParameters(){const e=this.view.environment.weather;if("sunny"===e.type||"cloudy"===e.type)this._blurParameters.blurRadius=b[e.type];else{const o="foggy"===e.type?e.fogStrength:e.precipitation;this._blurParameters.blurRadius=t(b.cloudy,b[e.type],o)}this._compositionParameters.lodFactors=g[e.type].far,this._compositionParameters.lodFactorsFront=g[e.type].near,this.requestRender(1)}precompile(){this._glowEnabled&&(this.techniques.precompile(c,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.bloomStage=1,this.techniques.precompile(c,this._blurVerticalConfiguration)),this._compositionConfiguration.blurEnabled=this._glowEnabled,this.techniques.precompile(p,this._compositionConfiguration)}render(e){const t=e.find(({name:e})=>e===n.TRANSPARENT_ENVIRONMENT),o=t.getAttachment(f)?.attachment;if(!o)return t;const r=t.getAttachment(P);if(!this._glowEnabled){const e=this.techniques.get(p,this._compositionConfiguration);if(!e.compiled)return this.requestRender(1),t;const i=t.getTexture(),s=this.fboCache,{fullWidth:a,fullHeight:n}=this.bindParameters.camera,m=this.renderingContext,l=s.acquire(i.descriptor.width,i.descriptor.height,this.produces);return this._prepareFBO(l,a,n),this._compositionParameters.color=i,this._compositionParameters.emission=o,m.bindTechnique(e,this.bindParameters,this._compositionParameters),m.screen.draw(),l.attachDepth(r),l.attachColor(t.getAttachment(f),f),l}const i=this.techniques.get(c,this._blurHorizontalConfiguration),s=this.techniques.get(c,this._blurVerticalConfiguration),a=this.techniques.get(p,this._compositionConfiguration);if(!i.compiled||!s.compiled||!a.compiled)return this.requestRender(1),t;const m=t.getTexture(),l=this.fboCache,{fullWidth:h,fullHeight:u}=this.bindParameters.camera,d=this.renderingContext;let b=o,g=Math.ceil(h/2),_=Math.ceil(u/2);const T=5,R=this._blurParameters.blurRadius;for(let n=0;n<T;n++){const e=l.acquire(g,_,"bloomHorizontal",8);this._blurParameters.color=b,this._prepareFBO(e,g,_),d.bindTechnique(i,this.bindParameters,this._blurParameters),d.screen.draw();const t=l.acquire(g,_,"bloomVertical",8);this._blurParameters.color=e.getTexture(),this._prepareFBO(t,g,_),d.bindTechnique(s,this.bindParameters,this._blurParameters),d.screen.draw(),e.release(),this._bloomResults[n]=t,g=Math.ceil(g/2),_=Math.ceil(_/2),b=this._bloomResults[n].getTexture(),this._blurParameters.blurRadius*=this._blurScale}this._blurParameters.blurRadius=R,this._compositionParameters.color=m,this._compositionParameters.emission=o,this._compositionParameters.bloomTexture0=this._bloomResults[0].getTexture(),this._compositionParameters.bloomTexture1=this._bloomResults[1].getTexture(),this._compositionParameters.bloomTexture2=this._bloomResults[2].getTexture(),this._compositionParameters.bloomTexture3=this._bloomResults[3].getTexture(),this._compositionParameters.bloomTexture4=this._bloomResults[4].getTexture();const C=l.acquire(m.descriptor.width,m.descriptor.height,this.produces);return C.acquireColor(f,8,"emissive bloom"),this._prepareFBO(C,h,u,!0),d.bindTechnique(a,this.bindParameters,this._compositionParameters),d.screen.draw(),this._bloomResults.forEach(e=>e.release()),C.attachDepth(r),C}_prepareFBO(e,t,o,r=!1){const i=this.renderingContext;i.bindFramebuffer(e.fbo),i.setViewport(0,0,t,o),i.setClearColor(0,0,0,0),i.clear(16384),r&&i.clearBuffer(1,a)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setLodFactors:e=>{this._compositionParameters.lodFactors=_(e)},toggleTonemapping:e=>{this._compositionConfiguration.tonemappingEnabled=e,this.requestRender(1)}}}};e([i()],T.prototype,"consumes",void 0),e([i()],T.prototype,"produces",void 0),T=e([s("esri.views.3d.webgl-engine.effects.bloom.BloomRenderNode")],T);export{T as BloomRenderNode};
@@ -2,11 +2,11 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{glsl as o}from"../../core/shaderModules/glsl.js";function r(r,e){e.snowCover&&(r.code.add(o`float getSnow(vec3 normal, vec3 normalGround) {
6
- return smoothstep(0.5, 0.55, dot(normal, normalGround));
7
- }`),r.code.add(o`vec3 applySnowToMRR(vec3 mrr, float snow) {
5
+ import{FloatBindUniform as o}from"../../core/shaderModules/FloatBindUniform.js";import{glsl as r}from"../../core/shaderModules/glsl.js";function e(e,n){n.snowCover&&(e.uniforms.add(new o("snowCover",o=>o.snowCover)).code.add(r`float getSnow(vec3 normal, vec3 normalGround) {
6
+ return smoothstep(0.5, 0.55, dot(normal, normalGround)) * snowCover;
7
+ }`),e.code.add(r`vec3 applySnowToMRR(vec3 mrr, float snow) {
8
8
  return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
9
9
  }
10
10
  vec4 snowCoverForEmissions(vec4 emission, float snow) {
11
11
  return mix(emission, vec4(0.0), snow);
12
- }`))}export{r as SnowCover};
12
+ }`))}export{e as SnowCover};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{CloudsParameters as h}from"../../environment/CloudsParameters.js";import e from"../../webgl/RenderCamera.js";import{SceneLighting as s}from"../lighting/SceneLighting.js";class n{constructor(i,t){this.width=i,this.height=t}}class r{constructor(i){this.shadowMap=i,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.enableFillLights=!0,this.oitPass=0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillEnabled=!1,this._camera=new e,this._inverseViewport=t(),this._oldLighting=new s,this._newLighting=new s,this._fadedLighting=new s,this._lighting=this._newLighting,this.ssr=new g,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.highlights=new Array,this.highlightOrderMap=new Map,this.highlightMixOrigin=t(),this.highlightMixTexture=null,this.hudRenderStyle=0,this.hudOccludedFragmentOpacity=1,this.snowCover=!1,this.clouds=new h,this.shadowHighlightsVisible=!1}destroy(){this._camera=null,this.contentCamera=null,this.depth=null,this.geometryDepth=null,this.mainDepth=null,this.overlay=null,this.ssao=null,this.terrainDepth=null}get camera(){return this._camera}set camera(i){this._camera=i,this._inverseViewport[0]=1/i.fullViewport[2],this._inverseViewport[1]=1/i.fullViewport[3]}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(i,t,h,e){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=h,this._newLighting.set(i),1===e&&this.clouds.requestFade(),this.fadeLighting()}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}}class g{constructor(){this.fadeFactor=1,this.reprojectionMatrix=i()}}export{r as BindParameters,n as ViewportSize};
5
+ import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{CloudsParameters as h}from"../../environment/CloudsParameters.js";import e from"../../webgl/RenderCamera.js";import{SceneLighting as s}from"../lighting/SceneLighting.js";class n{constructor(i,t){this.width=i,this.height=t}}class r{constructor(i){this.shadowMap=i,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.enableFillLights=!0,this.oitPass=0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillEnabled=!1,this._camera=new e,this._inverseViewport=t(),this._oldLighting=new s,this._newLighting=new s,this._fadedLighting=new s,this._lighting=this._newLighting,this.ssr=new g,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.highlights=new Array,this.highlightOrderMap=new Map,this.highlightMixOrigin=t(),this.highlightMixTexture=null,this.hudRenderStyle=0,this.hudOccludedFragmentOpacity=1,this.snowCover=0,this.clouds=new h,this.shadowHighlightsVisible=!1}destroy(){this._camera=null,this.contentCamera=null,this.depth=null,this.geometryDepth=null,this.mainDepth=null,this.overlay=null,this.ssao=null,this.terrainDepth=null}get camera(){return this._camera}set camera(i){this._camera=i,this._inverseViewport[0]=1/i.fullViewport[2],this._inverseViewport[1]=1/i.fullViewport[3]}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(i,t,h,e){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=h,this._newLighting.set(i),1===e&&this.clouds.requestFade(),this.fadeLighting()}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}}class g{constructor(){this.fadeFactor=1,this.reprojectionMatrix=i()}}export{r as BindParameters,n as ViewportSize};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{watch as s}from"../../../../core/reactiveUtils.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{g as o,J as n,c as h,d as l}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{elementsPerSplatPage as u,splatAtlasTextureSize as c}from"../../../../layers/support/GaussianSplatAtlasPageAllocator.js";import{evalTextureSize as m,maxAllowedVisibleGaussians as _}from"../../../../layers/support/gaussianSplatUtils.js";import{RenderCategory as d}from"../../webgl.js";import{makeScheduleFunction as f}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as g}from"../../support/GaussianSplatWorkerHandle.js";import b from"../../webgl/RenderNode.js";import{G as S}from"../../../../chunks/GaussianSplat.glsl.js";import{G as C}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as T}from"../shaders/GaussianSplatCompositionTechnique.js";import{G as w}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as P}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatDepthTechnique as y}from"../shaders/GaussianSplatDepthTechnique.js";import{GaussianSplatTechnique as G}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as q}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{DepthStencilAttachment as x,PrimitiveType as v,PixelType as A,SizedPixelFormat as j}from"../../../webgl/enums.js";import{Texture as D}from"../../../webgl/Texture.js";import{TextureDescriptor as I}from"../../../webgl/TextureDescriptor.js";var k;let F=class extends b{static{k=this}static{this.tileSize=2.048}constructor(t){super(t),this.produces=d.OPAQUE,this._gaussianSplatParameters=new S,this._gaussianSplatCompositionParameters=new C,this._gaussianSplatDepthCompositionParameters=new w,this._splatDepthTechniqueConfiguration=new q(!0),this._totalVisibleGaussians=0,this._orderTexture=null,this._textureAtlas=null,this._visibleGaussianTiles=new Array,this._workerHandle=null,this._isSorting=!1,this._pendingSortTask=!1,this._bufferCapacity=0,this._previousCameraPosition=p(),this._previousCameraDirection=p(),this._tanFov=r(),this._tempVec=p(),this._cameraDelta=p(),this._coarseCameraPosition=p()}async initialize(){this._initializeTextures(),this.addHandles([s(()=>this.view.state.camera,()=>this._onCameraChange())]);const{resourceController:t}=this.view;this._workerHandle=new g(f(t))}precompile(){this.techniques.precompile(G),this.techniques.precompile(y,this._splatDepthTechniqueConfiguration),this.techniques.precompile(T),this.techniques.precompile(P)}render(t){const e=t.find(({name:t})=>t===d.OPAQUE),s=this.techniques.get(G),i=this.techniques.get(y,this._splatDepthTechniqueConfiguration),r=this.techniques.get(T),o=this.techniques.get(P);if(!(s.compiled&&i.compiled&&o.compiled&&r.compiled))return this.requestRender(1),e;const{fullWidth:n,fullHeight:h}=this.bindParameters.camera,l=this.fboCache,p=l.acquire(n,h,"gaussianColorOutput");p.attachDepth(e.getAttachment(x));const u=this.renderingContext;u.bindFramebuffer(p.fbo),u.setClearColor(0,0,0,0),u.clear(16384),this._gaussianSplatParameters.totalGaussians=this._totalVisibleGaussians,this._gaussianSplatParameters.splatOrder=this._orderTexture,this._gaussianSplatParameters.splatAtlas=this._textureAtlas;const c=Math.tan(.5*this.camera.fovY),m=c/h*n;a(this._tanFov,m,c);const _=h/(2*c);this._gaussianSplatParameters.focalLength=_,this._gaussianSplatParameters.tanFov=this._tanFov,this.prepareHighPrecisionCameraPosition(),this.renderingContext.bindTechnique(s,this.bindParameters,this._gaussianSplatParameters),this.renderingContext.drawArraysInstanced(v.TRIANGLE_STRIP,0,4,this._totalVisibleGaussians);const f=l.acquire(n,h,"splatDepth",8);f.attachDepth(e.getAttachment(x)),u.bindFramebuffer(f.fbo),u.setClearColor(0,0,0,0),u.clear(16384),this.renderingContext.bindTechnique(i,this.bindParameters,this._gaussianSplatParameters),this.renderingContext.drawArraysInstanced(v.TRIANGLE_STRIP,0,4,this._totalVisibleGaussians);const g=l.acquire(n,h,this.produces);return this._gaussianSplatDepthCompositionParameters.splatDepth=f.getTexture(),g.attachDepth(e.getAttachment(x)),u.bindFramebuffer(g.fbo),u.bindTechnique(o,this.bindParameters,this._gaussianSplatDepthCompositionParameters),u.screen.draw(),this._gaussianSplatCompositionParameters.color=e.getTexture(),this._gaussianSplatCompositionParameters.splatColor=p.getTexture(),u.bindFramebuffer(g.fbo),u.bindTechnique(r,this.bindParameters,this._gaussianSplatCompositionParameters),u.screen.draw(),p.release(),f.release(),g}updateGaussianVisibility(t){this._visibleGaussianTiles=t,this._requestSort()}destroy(){this._workerHandle?.destroyWorkerAndSelf(),super.destroy()}updateTextureAtlas(t,e,s){this._textureAtlas?.updateData(0,t,e,u,1,s)}_ensureBufferCapacity(t){if(this._bufferCapacity<t){const s=Math.ceil(t*e);this._atlasIndicesBuffer=new Uint32Array(s),this._sortedAtlasIndicesBuffer=new Uint32Array(s),this._bufferCapacity=s}}_initializeTextures(){const t=new I;t.height=c,t.width=c,t.pixelFormat=36249,t.dataType=A.UNSIGNED_INT,t.internalFormat=j.RGBA32UI,t.samplingMode=9728,t.wrapMode=33071,this._textureAtlas=new D(this.renderingContext,t);const e=m(_);this._orderBuffer=new Uint32Array(e[0]*e[1]);const s=new I;s.height=e[0],s.width=e[1],s.pixelFormat=36244,s.dataType=A.UNSIGNED_INT,s.internalFormat=j.R32UI,s.wrapMode=33071,s.samplingMode=9728,this._orderTexture=new D(this.renderingContext,s)}_onCameraChange(){const t=this.view.state.camera.eye,e=this.view.state.camera.ray.direction,s=.001;(Math.abs(t[0]-this._previousCameraPosition[0])>s||Math.abs(t[1]-this._previousCameraPosition[1])>s||Math.abs(t[2]-this._previousCameraPosition[2])>s||Math.abs(e[0]-this._previousCameraDirection[0])>s||Math.abs(e[1]-this._previousCameraDirection[1])>s||Math.abs(e[2]-this._previousCameraDirection[2])>s)&&this._requestSort()}prepareHighPrecisionCameraPosition(){o(this._tempVec,this.camera.eye,1/k.tileSize),n(this._tempVec,this._tempVec),h(this._coarseCameraPosition,this._tempVec),this._gaussianSplatParameters.cameraPos8k=this._coarseCameraPosition,o(this._tempVec,this._tempVec,k.tileSize),l(this._cameraDelta,this.camera.eye,this._tempVec),this._gaussianSplatParameters.cameraDelta=this._cameraDelta}_requestSort(){this._isSorting?this._pendingSortTask=!0:(this._isSorting=!0,this._pendingSortTask=!1,this._sortOnWorker().then(()=>{this._isSorting=!1,this._pendingSortTask&&this._requestSort()}).catch(()=>{this._isSorting=!1,this._pendingSortTask&&this._requestSort()}))}async _sortOnWorker(){let t=0;for(let _=0;_<this._visibleGaussianTiles.length;_++)t+=this._visibleGaussianTiles[_].gaussianAtlasIndices.length;if(0===t||t>_)return;this._ensureBufferCapacity(t);const e=this.camera.ray.direction,s=e[0],i=e[1],a=e[2],r=1/Math.sqrt(s*s+i*i+a*a),o=s*r,n=i*r,h=a*r,l=this._atlasIndicesBuffer.subarray(0,t),p=new Float64Array(t);let u=0;for(let _=0;_<this._visibleGaussianTiles.length;_++){const t=this._visibleGaussianTiles[_],e=t.gaussianAtlasIndices,s=t.positions;for(let i=0;i<e.length;i++){l[u]=e[i];const t=3*i,a=s[t],r=s[t+1],c=s[t+2];p[u]=a*o+r*n+c*h,u++}}const c=new Uint32Array(t);for(let _=0;_<t;_++)c[_]=_;const m={distances:p,sortOrderIndices:c};await(this._workerHandle?.sort(m).then(e=>{const s=this._sortedAtlasIndicesBuffer.subarray(0,t);for(let i=0;i<t;i++)s[i]=l[e.sortedOrderIndices[i]];this._orderBuffer.set(s),this._orderTexture?.setData(this._orderBuffer),this._totalVisibleGaussians=t,this.requestRender(1)}))}};F=k=t([i("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],F);export{F as GaussianSplatRenderNode};