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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/Map.d.ts +6 -0
  2. package/analysis/AreaMeasurementAnalysis.d.ts +4 -2
  3. package/analysis/DirectLineMeasurementAnalysis.d.ts +8 -4
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/0363d29fc665d169ebc4.js +1 -0
  6. package/assets/esri/core/workers/chunks/037c67ef5c4398d5954d.js +1 -0
  7. package/assets/esri/core/workers/chunks/03f33cb78b5405ab7e23.js +1 -0
  8. package/assets/esri/core/workers/chunks/07b726a46864501b90a0.js +1 -0
  9. package/assets/esri/core/workers/chunks/0864da8f8f147016cf1c.js +1 -0
  10. package/assets/esri/core/workers/chunks/{768389f7f8dba6080df7.js → 0cc7fba402a93e6d2455.js} +2 -2
  11. package/assets/esri/core/workers/chunks/0cfdeb53fb7d5532cf01.js +1 -0
  12. package/assets/esri/core/workers/chunks/112ed86f812e4400a7e0.js +1 -0
  13. package/assets/esri/core/workers/chunks/177f353ce72133e2eeed.js +1 -0
  14. package/assets/esri/core/workers/chunks/1dc6f093028530a492e6.js +1 -0
  15. package/assets/esri/core/workers/chunks/2294254af2c6afb560ee.js +1 -0
  16. package/assets/esri/core/workers/chunks/23a4806b4cdf7cc32e4d.js +1 -0
  17. package/assets/esri/core/workers/chunks/2447d2e2a4a3ab8fcf94.js +1 -0
  18. package/assets/esri/core/workers/chunks/271ae7deccb94112c2df.js +1 -0
  19. package/assets/esri/core/workers/chunks/2df37a9a95ceebb87a5f.js +1 -0
  20. package/assets/esri/core/workers/chunks/2e00c155e447e4930442.js +1 -0
  21. package/assets/esri/core/workers/chunks/2e9a1673b1d51aa082b6.js +1 -0
  22. package/assets/esri/core/workers/chunks/344f5334ad95c7974349.js +1 -0
  23. package/assets/esri/core/workers/chunks/348f1def9cd2ddf92e87.js +1 -0
  24. package/assets/esri/core/workers/chunks/{8e4206068c6953bb7df2.js → 3a47fc97c400fca2c736.js} +1 -1
  25. package/assets/esri/core/workers/chunks/47c97640ec525676918b.js +1 -0
  26. package/assets/esri/core/workers/chunks/50763ea061d5fb3f2e49.js +1 -0
  27. package/assets/esri/core/workers/chunks/518ab22f80c3300bcfff.js +1 -0
  28. package/assets/esri/core/workers/chunks/58609bf94f72bc4f1952.js +1 -0
  29. package/assets/esri/core/workers/chunks/586a929bc037e23857af.js +1 -0
  30. package/assets/esri/core/workers/chunks/58d10e0b35968680fd9f.js +1 -0
  31. package/assets/esri/core/workers/chunks/59bc55880e6fd8ce20c0.js +1 -0
  32. package/assets/esri/core/workers/chunks/{7c75a8ee266c36baa902.js → 5eec1c1162779574f46e.js} +1 -1
  33. package/assets/esri/core/workers/chunks/62a0abcf45a2bd14ecbe.js +1 -0
  34. package/assets/esri/core/workers/chunks/63c4412c16d8a44a5668.js +1 -0
  35. package/assets/esri/core/workers/chunks/6b4c3411f63a9ad9354c.js +1 -0
  36. package/assets/esri/core/workers/chunks/{f528ac5c648ca6a98582.js → 711cfb84659cb4437679.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{9dd1fc56eb1ea6eb705e.js → 76e27e36050a3dd9d249.js} +1 -1
  38. package/assets/esri/core/workers/chunks/76f877e2d2493d56afab.js +1 -0
  39. package/assets/esri/core/workers/chunks/77463141652bf1ca6fb2.js +1 -0
  40. package/assets/esri/core/workers/chunks/7d3f7940815fa5dc244e.js +1 -0
  41. package/assets/esri/core/workers/chunks/914a0b5d9fef683cdf9c.js +1 -0
  42. package/assets/esri/core/workers/chunks/96f87c8efd4b11b37686.js +1 -0
  43. package/assets/esri/core/workers/chunks/97ec46605f16333144b7.js +1 -0
  44. package/assets/esri/core/workers/chunks/{7b482afb9fd1229f5707.js → 9934e8e19f94e9169eea.js} +1 -1
  45. package/assets/esri/core/workers/chunks/99f51d5d9da6e9bfc430.js +1 -0
  46. package/assets/esri/core/workers/chunks/9aebe876b1a2fb075f9c.js +1 -0
  47. package/assets/esri/core/workers/chunks/9c3db7a7c05fa0e81f0a.js +1 -0
  48. package/assets/esri/core/workers/chunks/{6f1d6453184e0a1530ad.js → 9c4961213ac6ec283dd9.js} +25 -25
  49. package/assets/esri/core/workers/chunks/a2cc53ad1a514167e4b8.js +1 -0
  50. package/assets/esri/core/workers/chunks/a33ba23aee3f8f40200f.js +1 -0
  51. package/assets/esri/core/workers/chunks/{45ba4aa87a4732198596.js → b13d8f4e4e80ef00b1bd.js} +1 -1
  52. package/assets/esri/core/workers/chunks/b3801d58c024224917df.js +1 -0
  53. package/assets/esri/core/workers/chunks/b3aa29589dcfb5b93106.js +1 -0
  54. package/assets/esri/core/workers/chunks/b3dbcf43f136ba2dadc5.js +1 -0
  55. package/assets/esri/core/workers/chunks/b9596d862da1ec342cd3.js +1 -0
  56. package/assets/esri/core/workers/chunks/bc1fcc9c897461e68e29.js +1 -0
  57. package/assets/esri/core/workers/chunks/{8b4e9fd88c0c313416d4.js → be04f40f8b403befd0ef.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{150e7a7bd5df25693da7.js → c90388932a7825d9d933.js} +1 -1
  59. package/assets/esri/core/workers/chunks/ca21786e519c914fc9e1.js +1 -0
  60. package/assets/esri/core/workers/chunks/cdb5c26fed7d9a97db49.js +1 -0
  61. package/assets/esri/core/workers/chunks/cdf0c7706d3e1221f49b.js +1 -0
  62. package/assets/esri/core/workers/chunks/d63e181f0e48bde73395.js +1 -0
  63. package/assets/esri/core/workers/chunks/d77888c84a8b49478807.js +1 -0
  64. package/assets/esri/core/workers/chunks/d7f2f1708d2a2668676c.js +1 -0
  65. package/assets/esri/core/workers/chunks/{13c64087be3b2985a21b.js → dbda982485d3fe26c729.js} +1 -1
  66. package/assets/esri/core/workers/chunks/dc7aa0a1eb6c6e361f9f.js +1 -0
  67. package/assets/esri/core/workers/chunks/ec1c4d66142b6efb0e8b.js +1 -0
  68. package/assets/esri/core/workers/chunks/ef2c3febcceedc44b3ac.js +1 -0
  69. package/assets/esri/core/workers/chunks/f08a2a262a3b55149396.js +1 -0
  70. package/assets/esri/core/workers/chunks/f2d56f5c15d5977e1d19.js +1 -0
  71. package/assets/esri/core/workers/chunks/ffe2077a9df7c838ea27.js +1 -0
  72. package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
  73. package/chunks/BlendLayers.glsl.js +1 -1
  74. package/chunks/Component.glsl.js +9 -12
  75. package/chunks/GaussianSplat.glsl.js +65 -21
  76. package/chunks/GaussianSplatDepth.glsl.js +45 -4
  77. package/chunks/GaussianSplatShadow.glsl.js +73 -19
  78. package/chunks/GlobalIllumination.glsl.js +17 -47
  79. package/chunks/LineMarker.glsl.js +32 -31
  80. package/chunks/OITAddEmission.glsl.js +1 -1
  81. package/chunks/RasterColorizer.glsl.js +1 -1
  82. package/chunks/RibbonLine.glsl.js +36 -36
  83. package/chunks/Terrain.glsl.js +3 -4
  84. package/chunks/Water.glsl.js +22 -23
  85. package/config.js +1 -1
  86. package/core/ReentrantObjectPool.js +1 -1
  87. package/core/memoryEstimations.js +1 -1
  88. package/core/workers/workers.js +2 -2
  89. package/core/workers.d.ts +1 -1
  90. package/form/elements/inputs/DynamicChoiceInput.d.ts +2 -2
  91. package/form/elements/inputs.d.ts +126 -25
  92. package/form/elements/inputs.js +1 -1
  93. package/form/elements.d.ts +1 -0
  94. package/geometry/operators/containsOperator.d.ts +1 -1
  95. package/geometry/operators/densifyOperator.d.ts +1 -1
  96. package/geometry/operators/differenceOperator.d.ts +6 -4
  97. package/geometry/operators/distanceOperator.d.ts +1 -1
  98. package/geometry/operators/geodesicProximityOperator.d.ts +8 -8
  99. package/geometry/operators/graphicBufferOperator.d.ts +6 -6
  100. package/geometry/operators/integrateOperator.d.ts +2 -2
  101. package/geometry/operators/intersectsOperator.d.ts +3 -3
  102. package/geometry/operators/linesToPolygonsOperator.d.ts +2 -2
  103. package/geometry/operators/locateBetweenOperator.d.ts +2 -2
  104. package/geometry/operators/minimumBoundingCircleOperator.d.ts +1 -1
  105. package/geometry/operators/multiPartToSinglePartOperator.d.ts +2 -2
  106. package/geometry/operators/polygonSlicerOperator.d.ts +2 -2
  107. package/geometry/operators/projectOperator.d.ts +2 -2
  108. package/geometry/operators/proximityOperator.d.ts +15 -15
  109. package/geometry/operators/shapePreservingProjectOperator.d.ts +2 -2
  110. package/geometry/operators/simplifyOperator.d.ts +2 -2
  111. package/geometry/operators/support/GeographicTransformationStep.d.ts +3 -3
  112. package/geometry/operators/support/Transformation.d.ts +8 -8
  113. package/geometry/operators/support/geographicTransformationUtils.d.ts +3 -3
  114. package/geometry/operators/symmetricDifferenceOperator.d.ts +2 -2
  115. package/geometry/operators/withinOperator.d.ts +3 -3
  116. package/geometry/support/Indices.js +1 -1
  117. package/graphic/MapNotesGraphicOrigin.d.ts +1 -0
  118. package/kernel.js +1 -1
  119. package/layers/GeospatialPDFLayer.d.ts +2 -2
  120. package/layers/GeospatialPDFLayer.js +1 -1
  121. package/layers/MapNotesLayer.d.ts +3 -2
  122. package/layers/ParquetLayer.d.ts +1 -1
  123. package/layers/VectorTileLayer.d.ts +10 -1
  124. package/layers/buildingSublayers/BuildingGroupSublayer.d.ts +2 -1
  125. package/layers/geospatialPDF/CIM2DLayerview.js +2 -0
  126. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  127. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  128. package/layers/mixins/SublayersOwner.js +1 -1
  129. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  130. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  131. package/layers/support/Sublayer.d.ts +2 -2
  132. package/layers/support/Sublayer.js +1 -1
  133. package/layers/support/SubtypeSublayer.js +1 -1
  134. package/layers/support/layerUtils.js +1 -1
  135. package/package.json +3 -3
  136. package/popup/FeaturesModel.js +1 -1
  137. package/popup/support/featureUtils.js +1 -1
  138. package/rest/featureService/FeatureService.d.ts +0 -5
  139. package/rest/networks/support/TraceLocation.d.ts +2 -1
  140. package/rest/networks/support/TraceResult.d.ts +0 -4
  141. package/rest/support/AttributeBinsQuery.d.ts +3 -2
  142. package/rest/support/ImageGPSInfoParameters.d.ts +2 -1
  143. package/rest/support/OutDistance.d.ts +2 -2
  144. package/rest/support/Query.d.ts +3 -2
  145. package/rest/support/TopFeaturesQuery.d.ts +2 -1
  146. package/rest/support/types.d.ts +10 -1
  147. package/smartMapping/raster/renderers/flow.d.ts +2 -1
  148. package/smartMapping/renderers/color.d.ts +11 -8
  149. package/smartMapping/renderers/location.d.ts +7 -4
  150. package/smartMapping/renderers/predominance.d.ts +7 -4
  151. package/smartMapping/renderers/relationship.d.ts +7 -4
  152. package/smartMapping/renderers/size.d.ts +6 -4
  153. package/smartMapping/renderers/type.d.ts +7 -4
  154. package/smartMapping/renderers/types.d.ts +15 -0
  155. package/smartMapping/renderers/univariateColorSize.d.ts +4 -2
  156. package/smartMapping/statistics/histogramForTimeSeries.js +1 -1
  157. package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +1 -1
  158. package/smartMapping/symbology/flow.d.ts +2 -1
  159. package/smartMapping/symbology/types.d.ts +2 -1
  160. package/support/BasemapStyle.d.ts +2 -2
  161. package/symbols/cim/CIMCursor.js +1 -1
  162. package/symbols/cim/types.d.ts +7 -9
  163. package/tables/elements.d.ts +1 -0
  164. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  165. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  166. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  167. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack.js +1 -1
  168. package/views/2d/engine/webgl/textureUtils.js +1 -1
  169. package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
  170. package/views/2d/layers/MediaLayerView2D.js +1 -1
  171. package/views/2d/layers/TileLayerView2D.js +1 -1
  172. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  173. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  174. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  175. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  176. package/views/3d/analysis/support/projectionUtils.js +1 -1
  177. package/views/3d/environment/SunLighting.d.ts +15 -2
  178. package/views/3d/environment/VirtualLighting.d.ts +15 -2
  179. package/views/3d/input/SceneInputManager.js +1 -1
  180. package/views/3d/input/handlers/ground/GroundMouseWheelMove.js +2 -0
  181. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  182. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  183. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  184. package/views/3d/layers/GeospatialPDFLayerView3D.js +1 -1
  185. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  186. package/views/3d/layers/graphics/Graphics3DBufferGraphicLayer.js +1 -1
  187. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  188. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayerBase.js +1 -1
  189. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  190. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  191. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  192. package/views/3d/layers/graphics/Graphics3DGraphicCreationContext.js +1 -1
  193. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  194. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  195. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  196. package/views/3d/layers/graphics/Graphics3DStageObjectGraphicLayer.js +1 -1
  197. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  198. package/views/3d/layers/graphics/Labeler.js +1 -1
  199. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  200. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  201. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  202. package/views/3d/layers/support/featureReference.js +1 -1
  203. package/views/3d/navigation/Navigation3D.js +1 -1
  204. package/views/3d/state/controllers/GroundMouseWheelController.js +2 -0
  205. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  206. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  207. package/views/3d/terrain/BlendLayers.glsl.js +1 -1
  208. package/views/3d/terrain/PatchRenderData.js +1 -1
  209. package/views/3d/terrain/RasterColorizer.glsl.js +1 -1
  210. package/views/3d/terrain/TerrainData.js +1 -1
  211. package/views/3d/terrain/TerrainRenderer.js +1 -1
  212. package/views/3d/terrain/TerrainSurface.js +1 -1
  213. package/views/3d/terrain/TextureFader.js +1 -1
  214. package/views/3d/terrain/TextureReference.js +1 -1
  215. package/views/3d/terrain/TileCompositor.js +1 -1
  216. package/views/3d/terrain/TileRenderInfo.js +1 -1
  217. package/views/3d/terrain/TileRenderer.js +1 -1
  218. package/views/3d/terrain/terrainUtils.js +1 -1
  219. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js +7 -8
  220. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +25 -25
  221. package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -5
  222. package/views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js +6 -0
  223. package/views/3d/webgl-engine/core/shaderLibrary/shading/getLocalUp.glsl.js +4 -0
  224. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +1 -1
  225. package/views/3d/webgl-engine/core/shaderLibrary/terrain/{TileBackground.glsl.js → blendLayers.glsl.js} +10 -11
  226. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +8 -2
  227. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
  228. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  229. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  230. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
  231. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  232. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  233. package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
  234. package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
  235. package/views/3d/webgl-engine/lib/DirtyEvents.js +1 -1
  236. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  237. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  238. package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
  239. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  240. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  241. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  242. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
  243. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  244. package/views/3d/webgl-engine/lib/geometryMemoryUtils.js +2 -0
  245. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  246. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  247. package/views/3d/webgl-engine/shaders/GaussianSplatDepth.glsl.js +1 -1
  248. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +61 -108
  249. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
  250. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  251. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  252. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  253. package/views/VideoView.js +1 -1
  254. package/views/draw/DrawOperation.js +1 -1
  255. package/views/draw/DrawScreenTool.js +1 -1
  256. package/views/input/types.d.ts +2 -4
  257. package/views/interactive/options/LabelOptions.d.ts +5 -5
  258. package/views/interactive/options/SnappingOptions.d.ts +2 -2
  259. package/views/selection/SelectionOperation.js +1 -1
  260. package/views/selection/types.d.ts +43 -3
  261. package/views/support/layerViewUtils.js +1 -1
  262. package/views/support/selectionUtils.js +1 -1
  263. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +0 -1
  264. package/widgets/Editor/VisibleElements.d.ts +4 -0
  265. package/widgets/Editor.d.ts +2 -0
  266. package/widgets/FeatureTable.js +1 -1
  267. package/widgets/Features/FeaturesViewModel.js +1 -1
  268. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  269. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  270. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  271. package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
  272. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
  273. package/widgets/OrientedImageryViewer.js +2 -2
  274. package/widgets/PanoramicViewer/utils.js +1 -1
  275. package/widgets/Print.js +1 -1
  276. package/widgets/Search/LayerSearchSource.d.ts +1 -1
  277. package/widgets/Sketch/VisibleElements.d.ts +4 -0
  278. package/widgets/Sketch.d.ts +2 -0
  279. package/widgets/support/SelectionList/GroupLayerItem.d.ts +6 -0
  280. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  281. package/widgets/support/SelectionList/ItemBase.js +1 -1
  282. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +6 -1
  283. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  284. package/widgets/support/SelectionToolbar.d.ts +8 -1
  285. package/widgets/support/SelectionToolbar.js +1 -1
  286. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  287. package/assets/esri/core/workers/chunks/0320cbd825f9a4222042.js +0 -1
  288. package/assets/esri/core/workers/chunks/067de1910190da228291.js +0 -1
  289. package/assets/esri/core/workers/chunks/09bd5df07eab80ae7b15.js +0 -1
  290. package/assets/esri/core/workers/chunks/164e74d586297946a717.js +0 -1
  291. package/assets/esri/core/workers/chunks/1c0c5cb13c2590aae906.js +0 -1
  292. package/assets/esri/core/workers/chunks/1c77de1e79860f8d2228.js +0 -1
  293. package/assets/esri/core/workers/chunks/24dac4970526a4e0ae63.js +0 -1
  294. package/assets/esri/core/workers/chunks/2acf2952cef69e382a35.js +0 -1
  295. package/assets/esri/core/workers/chunks/30dcf2cfb31cb70de7df.js +0 -1
  296. package/assets/esri/core/workers/chunks/371e2ddb88cc6b9a41e8.js +0 -1
  297. package/assets/esri/core/workers/chunks/42f6194633c2d879c8da.js +0 -1
  298. package/assets/esri/core/workers/chunks/44f90e75c1dc3d726a95.js +0 -1
  299. package/assets/esri/core/workers/chunks/4abd3753cd9b80e4d937.js +0 -1
  300. package/assets/esri/core/workers/chunks/4bb9a5f4ca944d3fc206.js +0 -1
  301. package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +0 -1
  302. package/assets/esri/core/workers/chunks/4d93bed14945e3d34d5c.js +0 -1
  303. package/assets/esri/core/workers/chunks/4e3f651ac76fcd53df2b.js +0 -1
  304. package/assets/esri/core/workers/chunks/505227797bcf2a1d908d.js +0 -1
  305. package/assets/esri/core/workers/chunks/58da3f8cf0f7f6a7e4fa.js +0 -1
  306. package/assets/esri/core/workers/chunks/5a19a9c3e01d3d415188.js +0 -1
  307. package/assets/esri/core/workers/chunks/5a830bc35adbedd33783.js +0 -1
  308. package/assets/esri/core/workers/chunks/6db0f8fe1402643fbe1a.js +0 -1
  309. package/assets/esri/core/workers/chunks/7124ad8dc5ad40dc66f3.js +0 -1
  310. package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +0 -1
  311. package/assets/esri/core/workers/chunks/7c631e2947243e2c9bde.js +0 -1
  312. package/assets/esri/core/workers/chunks/7f0f9dddc44b1f1600f0.js +0 -1
  313. package/assets/esri/core/workers/chunks/7fb7493f483cd9878bfa.js +0 -1
  314. package/assets/esri/core/workers/chunks/8e310e9cb9d84ac3ca2f.js +0 -1
  315. package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +0 -1
  316. package/assets/esri/core/workers/chunks/99a0a434ea2162166754.js +0 -1
  317. package/assets/esri/core/workers/chunks/9afc87474cef1fc4fe4a.js +0 -1
  318. package/assets/esri/core/workers/chunks/9cbde13e536676767900.js +0 -1
  319. package/assets/esri/core/workers/chunks/9cd3fcb5fca6f9dbbcd8.js +0 -1
  320. package/assets/esri/core/workers/chunks/a025ee38d402504193df.js +0 -1
  321. package/assets/esri/core/workers/chunks/a4b822ee45810c4c292a.js +0 -1
  322. package/assets/esri/core/workers/chunks/a51576d84edca88e41dd.js +0 -1
  323. package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +0 -1
  324. package/assets/esri/core/workers/chunks/ace41659a5ca0e5abfc3.js +0 -1
  325. package/assets/esri/core/workers/chunks/b01804aa6c47a220a603.js +0 -1
  326. package/assets/esri/core/workers/chunks/b3273f847405799e3362.js +0 -1
  327. package/assets/esri/core/workers/chunks/ba3d5abff65aefcb8dee.js +0 -1
  328. package/assets/esri/core/workers/chunks/bca6b469940b7b954123.js +0 -1
  329. package/assets/esri/core/workers/chunks/c0d7ae314ebfad1e3791.js +0 -1
  330. package/assets/esri/core/workers/chunks/c337fc0e6dc69c233e6d.js +0 -1
  331. package/assets/esri/core/workers/chunks/c8eae00b0ec87d8b2ff3.js +0 -1
  332. package/assets/esri/core/workers/chunks/cd9aa950cb74b09008fe.js +0 -1
  333. package/assets/esri/core/workers/chunks/e0d9dc97985561320bd4.js +0 -1
  334. package/assets/esri/core/workers/chunks/e2775b4b753306dc8477.js +0 -1
  335. package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +0 -1
  336. package/assets/esri/core/workers/chunks/ebbf425af348e6ede814.js +0 -1
  337. package/assets/esri/core/workers/chunks/efc53007cd2e4991d7d4.js +0 -1
  338. package/assets/esri/core/workers/chunks/f46e92c67986c8c09bdd.js +0 -1
  339. package/assets/esri/core/workers/chunks/f8bc474434fd365ab174.js +0 -1
  340. package/assets/esri/core/workers/chunks/f8d2225f333524ce1d88.js +0 -1
  341. package/assets/esri/core/workers/chunks/f95a1f878c9c1146180e.js +0 -1
  342. package/assets/esri/core/workers/chunks/fb37f0848196c28b7fd7.js +0 -1
  343. /package/assets/esri/core/workers/chunks/{768389f7f8dba6080df7.js.LICENSE.txt → 0cc7fba402a93e6d2455.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import r from"../../../../core/Error.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{findInMap as a}from"../../../../core/MapUtils.js";import{abortMaybe as o,removeMaybe as s,destroyMaybe as c}from"../../../../core/maybe.js";import{MinPriority as l}from"../../../../core/MemCache.js";import u from"../../../../core/PooledArray.js";import{throwIfAborted as d,ignoreAbortErrors as f,isAbortError as p}from"../../../../core/promiseUtils.js";import m from"../../../../core/Queue.js";import{when as h,watch as g,on as ee,syncAndInitial as te,whenOnce as _}from"../../../../core/reactiveUtils.js";import{schedule as v}from"../../../../core/scheduling.js";import{property as y,subclass as ne}from"../../../../core/accessorSupport/decorators.js";import{diff as b,isEmpty as re}from"../../../../core/accessorSupport/diffUtils.js";import{runUntracked as x}from"../../../../core/accessorSupport/tracking.js";import{set as S,add as C,scale as w}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import ie from"../../../../geometry/Extent.js";import ae from"../../../../geometry/Point.js";import{canProjectWithoutEngine as oe}from"../../../../geometry/projectionUtils.js";import{projectBuffer as E}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as D}from"../../../../geometry/projection/projectVectorToVector.js";import{projectXYZToVector as O}from"../../../../geometry/projection/projectXYZToVector.js";import{center as se,fromRect as ce,create as k,equals as le}from"../../../../geometry/support/aaBoundingBox.js";import{create as ue}from"../../../../geometry/support/aaBoundingRect.js";import{equals as de}from"../../../../geometry/support/spatialReferenceUtils.js";import{isPopupProvider as fe}from"../../../../graphic/getPopupProvider.js";import pe from"../../../../layers/Layer.js";import{getObjectId as A,computeAABB as j,hasGeometry as M}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as N}from"../../../../layers/graphics/hydratedFeatures.js";import P from"../../../../renderers/UniqueValueRenderer.js";import{isSupportedRenderer3D as F,validateTo3D as I}from"../../../../renderers/support/rendererConversion.js";import{RenderingInfo as L}from"../../../../renderers/support/RenderingInfo.js";import{isBasemapLayerView as R}from"../../../../support/basemapUtils.js";import{loadArcade as z}from"../../../../support/loadArcade.js";import B from"../../../../symbols/LabelSymbol3D.js";import me from"../../../../symbols/TextSymbol.js";import he from"../../../../symbols/WebStyleSymbol.js";import{getDefaultSymbol3D as ge}from"../../../../symbols/support/defaults3D.js";import{to3D as V}from"../../../../symbols/support/symbolConversion.js";import{aggregateSymbolComplexity as _e,defaultSymbolComplexity as ve}from"./defaultSymbolComplexity.js";import{DisplayFeatureLimit as ye}from"./DisplayFeatureLimit.js";import{ViewElevationProvider as be}from"./ElevationQuery.js";import{extractExpressionInfo as H,createContext as U}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as xe}from"./Graphics3DFeatureStore.js";import{Graphics3DGraphicCreationContext as Se}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as Ce}from"./Graphics3DSymbolCreationContext.js";import{make as we}from"./Graphics3DSymbolFactory.js";import{Graphics3DWebStyleSymbol as Te}from"./Graphics3DWebStyleSymbol.js";import{GraphicsCorePerformanceInfo as Ee}from"./GraphicsCorePerformanceInfo.js";import{GraphicStateTracking as De}from"./GraphicStateTracking.js";import{computeCentroid as Oe}from"./graphicUtils.js";import{placePointOnGeometry as ke}from"./pointUtils.js";import{SpatialIndex2D as Ae}from"./SpatialIndex2D.js";import{AggregateSymbolComplexity as je}from"./SymbolComplexity.js";import{StageLayerElevationProvider as Me}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as Ne}from"../../support/extentUtils.js";import{affectsGeometry as Pe}from"../../webgl-engine/lib/affectsGeometry.js";import{GridLocalOriginFactory as Fe}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{isScreenSizePerspectiveEnabled as W}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{WebGLLayer as Ie}from"../../webgl-engine/lib/WebGLLayer.js";import{HUDMaterial as Le}from"../../webgl-engine/materials/HUDMaterial.js";import{hasPopupTemplate as Re}from"../../../layers/support/popupUtils.js";import{PromiseQueue as G}from"../../../support/PromiseQueue.js";import{PropertiesPool as ze}from"../../../support/PropertiesPool.js";import{ImmediateTask as K,noBudget as Be,TaskPriority as Ve}from"../../../support/Scheduler.js";import{TextureCompressionTracker as He}from"../../../support/TextureCompressionTracker.js";import{Yield as Ue}from"../../../support/Yield.js";import{alphaCutoff as q}from"../../../../webscene/support/AlphaCutoff.js";var J;const Y=T(),We=k();let X=class extends t{static{J=this}static{this.tmpVec=T()}get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new Ae({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get deconflictor(){return this._deconflictor}get labeler(){return this._labeler}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return this.currentRenderer!=null&&this.currentRenderer.type===`dictionary`?0:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this.dataUpdating||this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._frameTaskHandle.updating||this._updateQueue.updating||this.readyToRun)}get dataUpdating(){return!!(this._graphicsWaitingForSymbol.size>0||this._pendingUpdates.size>0||this._spatialIndex?.updating||this._updatingPendingLoadedGraphicsChange||this._dataUpdateQueue.updating||this._loadingSymbols>0||this.compressionTracker.compressing)}get readyToRun(){return this._pendingUpdates.size>0||!!this._spatialIndex?.updating||this._dataUpdateQueue.readyToRun||this._updateQueue.readyToRun||this._focusAreasGraphicsQueue.length>0}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return x(()=>this.updating?this._pendingUpdates.size+(this._spatialIndex?.updatingRemaining||0)*.1+(this._elevationAlignment?.updatingRemaining||0)*.1:0)}get displayFeatureLimit(){let e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?.graphics3D.minTotalNumberOfFeatures??0,n=e?.graphics3D.maxTotalNumberOfFeatures??0,r=e?.graphics3D.maxNumberOfDrawCalls??0,i=e?.graphics3D.maxTotalNumberOfVertices??0,a=this.averageSymbolComplexity,o=Math.max(1,a?.verticesPerFeature??1),s=a&&a.drawCallsPerFeature>0&&r>0?r/a.drawCallsPerFeature:n,c=Math.ceil(i/o),l=Math.max(t,Math.min(n,c,s)),u=this._get(`displayFeatureLimit`);return u&&u.maximumTotalNumberOfVertices===i&&u.averageSymbolComplexity===a&&u.maximumNumberOfFeatures===l?u:new ye(i,l,a)}get averageSymbolComplexity(){return x(()=>{let e=this._averageSymbolComplexities,t=this._get(`averageSymbolComplexity`);return e.numComplexities===0||t!=null&&(e.estimated&&(t.verticesPerFeature>=e.verticesPerFeature||t.verticesPerCoordinate>=e.verticesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.verticesPerFeature===e.verticesPerFeature&&t.verticesPerCoordinate===e.verticesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e})}get _averageSymbolComplexities(){let e=this._totalSymbolComplexities;return e.numComplexities>0&&(e.verticesPerFeature/=e.numComplexities,e.verticesPerCoordinate/=e.numComplexities,e.drawCallsPerFeature/=e.numComplexities,e.memory.bytesPerFeature/=e.numComplexities,e.memory.bytesPerFeatureLabel/=e.numComplexities,e.memory.resourceBytes/=e.numComplexities,e.memory.draped.bytesPerFeature/=e.numComplexities,e.memory.draped.bytesPerFeatureLabel/=e.numComplexities),e}get _totalSymbolComplexities(){let e=new je;return this._forEachSymbolComplexity(t=>_e(t,e)),e}get usedMemory(){let e=this.labelsEnabled?(this.averageSymbolComplexity?.memory.bytesPerFeatureLabel??0)*this._numberOfGraphics:0,t=0;if(this._forEachSymbolComplexityUsed(e=>t+=e?.memory.resourceBytes??0),this._symbolMaterials==null){this._symbolMaterials=[];for(let e of this._symbols.values())if(e!=null){for(let t of e.symbolLayers)if(t)for(let e of t.materials)e&&this._symbolMaterials.push(e)}}let n=this.owner.view.stage.renderer,r=this.owner.view.overlayManager.renderer,i=this._symbolMaterials.reduce((e,t)=>e+((n.getMaterialRenderer(t)||r.getMaterialRenderer(t))?.usedMemory??0),0);return this._usedMemory+e+t+i}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){let e=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*e}if(this.averageSymbolComplexity!=null){let e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}_forEachSymbolComplexity(e){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(e):this._forEachSymbolComplexityUsed(e)}get visible(){return this._visible}_getConvertedSymbol(e){let t=e;if(t.type===`web-style`)return t.clone();let n=this._symbolConversionCache.get(t.id);if(n!=null)return n;let r=V(t,{geometryType:this.layer?.geometryType??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(t),cimFallbackEnabled:!0}),a=r.symbol||null;return a==null&&r.error&&i.getLogger(this).error(r.error.message),this._symbolConversionCache.set(t.id,a),a}_getSymbolComplexitiesUsedOrRenderer(e){let t=this.currentRenderer;if(t==null)return;let n=t.symbols,r=`backgroundFillSymbol`in t?t.backgroundFillSymbol:null;if(!r&&!n.length)return;let i=this._getSymbolComplexityUsedOrRenderer(r);i!=null&&e(i);for(let t of n){let n=this._getSymbolComplexityUsedOrRenderer(t);n!=null&&e(n)}}_getSymbolComplexityUsedOrRenderer(e){if(e==null)return null;let t=this._symbols.get(e.id);if(t!=null)return t.complexity;let n=this._getConvertedSymbol(e);return n==null?null:ve(n)}_forEachSymbolComplexityUsed(e){this._symbols.forEach(t=>{e(t?.complexity)})}get _objectIdField(){return this.layer.objectIdField}constructor(e){super(e),this._propertiesPool=new ze({computedExtent:()=>new ie},this),this.computedExtent=null,this.currentRenderer=null,this.rendererRequiresHydratedGraphic=!1,this._graphicStateTracking=null,this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this._graphicsDrapedUids=new Set,this._graphicsBySymbol=new Map,this._symbolConversionCache=new Map,this._symbols=new Map,this._graphicsWithoutSymbol=new Map,this._graphicsWaitingForSymbol=new Map,this._graphicsUpdateId=0,this._frameTaskHandle=K,this._dataUpdateQueue=new G,this._updateQueue=new G,this._focusAreasGraphicsQueue=new m,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=null,this._elevationAlignment=null,this._scaleVisibility=null,this._filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this._featureStore=null,this._deconflictor=null,this._labeler=null,this._objectStates=null,this._viewElevationProvider=null,this._stageLayerElevationProvider=null,this._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this.compressionTracker=new He,this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new u,this.preferredUpdatePolicy=1,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.reportGraphicSourceMemory=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this._unusedSymbolsCache=e.owner.view.resourceController.memoryController.newCache(`graphics-3d-unused-symbols`,e=>e.destroy()),this.symbolCreationContext=new Ce(e.owner.view.resourceController.scheduler,(e,t)=>this._updateQueue.push(e,t),e.owner.layerViewUid,this.compressionTracker)}initialize(){this._featureStore=new xe({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:e=>this.graphics3DGraphics.forEach(e),usedMemoryInvalidated:e=>{let t=e.updateUsedMemory(this.reportGraphicSourceMemory);this.graphics3DGraphics.get(e.graphic.uid)===e&&(this._usedMemory+=t)}});let e=(e,t,n)=>this.spatialIndex.queryGraphicUIDsInExtent(e,t,n),{componentFactories:t}=this;this._elevationAlignment=t.elevationAlignment?.(this,e),this._scaleVisibility=t.scaleVisibility?.(this,e),this._filterVisibility=t.filterVisibility?.({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e(A(t.graphic,this._objectIdField)))),setAllFeaturesVisibility:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e)),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,4,!0))}),this._deconflictor=t.deconflictor?.(this),this._labeler=t.labeler?.(this,this._scaleVisibility),this._objectStates=t.objectStates?.(this),this._initializeAbortController=new AbortController,this.addHandles(h(()=>this.owner.view.state.highlights,()=>{let{highlightOrderMap:e}=this.owner.view.state;this.graphics3DGraphics.forEach(t=>t.updateHighlights(e))})),this._initializePromise=this._initializeAsync()}async _initializeAsync(){let e=this._initializeAbortController?.signal,t=this.owner.view;this._viewElevationProvider=new be(this._viewSpatialReference,t),this._initializeStage(t,this.owner.layerViewUid);let n=t.sharedSymbolResources;this.symbolCreationContext.sharedResources=n,this.currentRenderer!=null&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new Fe(t.renderSpatialReference),this.symbolCreationContext.elevationProvider=t.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e),this.symbolCreationContext.focusAreaStyle=t.map?.focusAreas.style??null;let r=H(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await U(r,this._viewSpatialReference,e,i.getLogger(this)),d(e),this.symbolCreationContext.screenSizePerspectiveEnabled=W(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,this.symbolCreationContext.skipHighSymbolLods=!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,`drapeSourceType`in this.owner){let{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=t.overlayManager.registerGeometryDrapeSource(e)}this.addHandles([g(()=>this.suspendedOrOutsideOfView,()=>this._updateQueue.unshift(()=>this._updateLayerVisibility(),null).catch(f)),g(()=>W(this.layer?.screenSizePerspectiveEnabled),e=>{e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this._screenSizePerspectiveEnabledChange())}),g(()=>this.owner.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(!!e)),g(()=>this.owner.view.state?.rasterPixelRatio,()=>this._pixelRatioChange()),g(()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._physicalBasedRenderingChange(e)),g(()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,e=>this._skipHighSymbolLoDsChange(e)),g(()=>this.owner.view.focusAreasView?.polygons,()=>this._updateFocusedLabels()),g(()=>this.owner.view.timeZone,()=>{this.currentRenderer?.arcadeRequired&&this.recreateAllGraphics()}),g(()=>this.owner.view.map?.focusAreas.style,e=>{this.symbolCreationContext.focusAreaStyle=e??null,this.recreateAllGraphicsAndSymbols()}),h(()=>t.basemapTerrain?.tilingScheme,e=>{let n=t.groundView?.spatialReference;!e.spatialReference.equals(this.symbolCreationContext.overlaySR)&&n!=null&&(this.symbolCreationContext.overlaySR=n),this.hasHandles(`loaded-graphics`)?this.recreateAllGraphics():this.addHandles([ee(()=>this.owner?.loadedGraphics,`change`,e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],`loaded-graphics`)},{initial:!0}),g(()=>this.effectiveUpdatePolicy,e=>{this.stageLayer!=null&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===0,e===1&&this.runTask(Be)},te)]),this._frameTaskHandle=t.resourceController.scheduler.registerTask(Ve.GRAPHICS_CORE,this),this.layer&&`featureReduction`in this.layer&&this.addHandles(g(()=>this.layer.featureReduction,()=>this._deconflictor?.featureReductionChange())),this.notifyChange(`averageSymbolComplexity`),this.rendererChange(this.owner.renderer).catch(()=>{}),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController=o(this._initializeAbortController)}_updateFocusedLabels(){this._focusAreasGraphicsQueue.clear(),this.forEachGraphics3DSymbol((e,t)=>{t&&e.needsUpdateFocus&&t.forEach(e=>{this._focusAreasGraphicsQueue.push(e)})})}destroy(){if(this._unusedSymbolsCache.destroy(),this._abortInitialize(),this._rendererChangeAbortController=o(this._rendererChangeAbortController),this._abortElevationInfoChange(),this._frameTaskHandle.remove(),this._frameTaskHandle=K,this._dataUpdateQueue.cancelAll(),this._updateQueue.cancelAll(),this._deconflictor=s(this._deconflictor),this._labeler=s(this._labeler),this._elevationAlignment=c(this._elevationAlignment),this._scaleVisibility=c(this._scaleVisibility),this._filterVisibility=c(this._filterVisibility),this._objectStates=c(this._objectStates),this.clear(),`drapeSourceType`in this.owner){let{owner:e}=this;this.stage.view.overlayManager.unregisterDrapeSource(e)}this._featureStore=c(this._featureStore),this._updatingPendingLoadedGraphicsChange=s(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=c(this._graphicStateTracking),this.stage&&=(this.stageLayer=c(this.stageLayer),null),this._set(`owner`,null);for(let e in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[e].reject(new r(`graphic:layer-destroyed`,`Layer has been destroyed`));this._whenGraphics3DGraphicRequests=null,this._propertiesPool=c(this._propertiesPool),this._whenSymbolRemoved.prune(),this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=c(this._spatialIndex),this._symbolMaterials=null}clear(){this._objectStates?.allGraphicsDeleted(),this._graphicStateTracking!=null&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(e=>e.destroy()),this._spatialIndex?.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(c),this._symbols.clear(),this._symbolMaterials&&=(this._symbolMaterials.length=0,null),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange(`dataUpdating`),this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}_initializeStage(e,t){this.stage=e.stage,this.stageLayer=new Ie(this.stage,{visible:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t);let n=this.stageLayer.events;n.on(`transformationChanged`,e=>this.notifyGraphicGeometryChanged(e.graphicUid)),n.on(`shaderTransformationChanged`,e=>this.notifyGraphicGeometryChanged(e.graphicUid)),n.on(`visibilityChanged`,e=>this.notifyGraphicVisibilityChanged(e.graphicUid)),n.on(`geometryAdded`,e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),n.on(`geometryRemoved`,e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),n.on(`attributesChanged`,e=>Pe(e.attribute)&&this.notifyGraphicGeometryChanged(e.object.graphicUid))}notifyGraphicGeometryChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),this._graphicStateTracking==null||e==null)return;let t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),this._graphicStateTracking==null||e==null)return;let t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){let e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this._numberOfGraphics>e*Ge,n=!this.suspendedOrOutsideOfView&&!t;n!==this._visible&&(this._visible=n,this._updateStageLayerVisibility())}_updateStageLayerVisibility(){let e=this._visible&&(this.layer.opacity==null||this.layer.opacity>=q);this.stageLayer.visible!==e&&(this.stageLayer.visible=e,e?this.updateGraphicsVisibilities():this._hideAllGraphics(),this.owner.notifyContentGeometryUpdate?.())}getGraphics3DGraphicById(e){return e==null?void 0:this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer?.objectIdField){return A(e,t)}get graphics3DGraphicsByObjectID(){let e=this.owner.layer?.objectIdField;if(!e)return;let t=new Map;return this.graphics3DGraphics.forEach(n=>{if(!n)return;let r=n.graphic,i=this._getGraphicObjectID(r,e);i!=null&&t.set(i,n)}),t}get labelsEnabled(){return!!this._labeler?.layerLabelsEnabled()}async updateLabelingInfo(e){let t=this._deconflictor?.labelingInfoChange(e),n=this._labeler?.labelingInfoChange(e);await Promise.allSettled([t,n])}updateVisibilityInfo(){this._deconflictor?.labelingInfoChange(),this._labeler?.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return`unknown`;let e=!1,t=!1;for(let[n,r]of this._symbols)if(r!=null)switch(r.getFastUpdateStatus()){case 3:return`unknown`;case 1:this._graphicsBySymbol.has(n)&&(t=!0);break;case 0:this._graphicsBySymbol.has(n)&&(e=!0);break;case 2:this._graphicsBySymbol.has(n)&&(t=e=!0)}return t?e?`mixed`:`fast`:e?`slow`:`mixed`}runTask(e){if(this._dataUpdateQueue.runTask(e),this._updateQueue.runTask(e),this._applyPendingUpdates(e),this._applyFocusAreasUpdates(e),this.notifyChange(`readyToRun`),this.readyToRun||this.notifyChange(`dataUpdating`),this.notifyChange(`updatingRemaining`),!e.hasProgressed)return Ue}setObjectIdVisibility(e,t){t?this._objectIdInvisibleSet.delete(e):this._objectIdInvisibleSet.add(e);let n=this._findGraphics3DGraphicByObjectId(e);n!=null&&this._updateUserVisibility(n)}_findGraphics3DGraphicByObjectId(e){return a(this.graphics3DGraphics,t=>this._getGraphicObjectID(t.graphic)===e)}_updateUserVisibility(e){if(e==null)return!1;let t=e.graphic,n=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&this.stageLayer.visible&&(n==null||!this._objectIdInvisibleSet.has(n));return e.setVisibilityFlag(1,1,r)}_whenGraphics3DGraphic(e){let t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);let n=this._whenGraphics3DGraphicRequests[e.uid];if(n)return n.promise;let r=Promise.withResolvers();return this._whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){let n=this._viewSpatialReference,r=this.owner.view.renderSpatialReference,i=this.owner.view.groundView.spatialReference,a=(e,t,i)=>E(e,r,t,e,n,t,i),o=(e,t,r)=>E(e,i,t,e,n,t,r),s=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:t!=null&&!!t.useViewElevation,minDemResolution:t==null?null:t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,c=await e.getProjectedBoundingBox(a,o,s,t?.signal);if(!c)return null;let l=c.boundingBox;if(c.requiresDrapedElevation){let e=this.symbolCreationContext.elevationProvider;if(e){se(l,Y);let t=e.getElevation(Y[0],Y[1],0,n,`ground`)??0;l[2]=Math.min(l[2],t),l[5]=Math.max(l[5],t)}}return{boundingBox:l,screenSpaceObjects:c.screenSpaceObjects}}async whenGraphicBounds(e,t){await _(()=>this.owner?.loadedGraphics);let n=this.owner.layer?.objectIdField,i=this.owner.loadedGraphics.find(t=>t===e||n!=null&&t.attributes!=null&&e.attributes&&t.attributes[n]===e.attributes[n]);if(!i)throw new r(`internal:graphic-not-part-of-view`,`Graphic is not part of this view`);let a=await this._whenGraphics3DGraphic(i);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){let n=this.graphics3DGraphics.get(e.uid);if(!n)return null;let r=n.computeAttachmentOrigin();if(r.render.num===0&&r.draped.num===0)return null;S(Q,0,0,0);let i=0;if(r.render.num>0){if(!D(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,$,t))return null;C(Q,Q,$),i++}if(r.draped.num>0){let[e,n]=r.draped.origin,a=this.owner.view.groundView.spatialReference,o=this.owner.view.elevationProvider.getElevation(e,n,0,a,`ground`)??0;if(S($,e,n,o),!D($,a,$,t))return null;C(Q,Q,$),i++}return i>1&&w(Q,Q,1/i),new ae({x:Q[0],y:Q[1],z:Q[2],spatialReference:t})}getSymbolLayerSize(e,t){let n=this._symbols.get(e.id);if(n==null)throw new r(`internal:symbol-not-part-of-view`,`Symbol is not part of this view`);let i=e.symbolLayers.indexOf(t);if(i===-1)throw new r(`internal:missing-symbol-layer`,`Symbol layer is not in symbol`);let a=n.getSymbolLayerSize(i);if(a==null)throw new r(`internal:missing-size`,`Symbol layer has no valid size`);return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){let t=e.graphic.uid,n=this.graphics3DGraphics.get(t);if(n!=null||this._graphicsWithoutSymbol.get(t)!=null){switch(e.property){case`visible`:this._graphicUpdateVisibleHandler(n);break;case`geometry`:this._graphicUpdateGeometryHandler(n,e.graphic);break;case`symbol`:this._graphicUpdateSymbolHandler(n,e);break;case`attributes`:this.symbolCreationContext.featureExpressionInfoContext?.arcade?this._graphicUpdateGeometryHandler(n,e.graphic):this._usedMemory+=n?.updateUsedMemory(this.reportGraphicSourceMemory)??0;break;case`popupTemplate`:break;case`origin-transform`:this._graphicUpdateTransformHandler(n,e)}this.owner.notifyContentGeometryUpdate?.()}}_graphicUpdateGeometryHandler(e,t){this._graphicUpdateGeometryOrTransformHandler(e,t,()=>e!=null&&e.graphics3DSymbol.updateGeometry(e)&&(this._labeler?.updateGraphicGeometry(e)??!0)?(this._labeler?.setDirty(),this._deconflictor?.setDirty(),this._usedMemory+=e.updateUsedMemory(this.reportGraphicSourceMemory),!0):!1);let n=t.geometry;n!=null&&this._expandComputedExtent(n)}_graphicUpdateTransformHandler(e,t){let n=t.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(e,t.graphic,()=>t.newValue!=null&&e!=null&&n!=null&&e.graphics3DSymbol.updateTransform(e,n.spatialReference,t.newValue,t.action))}_graphicUpdateGeometryOrTransformHandler(e,t,n){if(t.geometry==null)this._recreateGraphic(t);else if(e==null){let e=t.symbol?.id;if(e){let t=this._symbols.get(e);if(t!=null&&t.loadStatus===0)return}this._recreateGraphic(t)}else if(!n()){let n=this._deconflictor?.getState(e);this._recreateGraphic(t);let r=this.graphics3DGraphics.get(t.uid);r&&n!=null&&this._deconflictor?.setState(r,n)}}_graphicUpdateSymbolHandler(e,t){let n=t.graphic,r=e==null?t.oldValue==null?null:this._symbols.get(t.oldValue.id):e.graphics3DSymbol;if(r==null||t.newValue==null){this._recreateGraphic(n);return}let i=r.symbol,a=this._getConvertedSymbol(t.newValue);if(a!=null&&(a.type!==i.type||a.type===`web-style`)||i.type===`web-style`){this._recreateGraphic(n);return}let o=this._graphicsBySymbol.get(i.id);if(o&&o.size!==1){this._recreateGraphic(n);return}let s=b(i,a);if(s==null){this._updateSymbolMapping(i.id,a);return}let c={diff:s,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(c),!re(c.diff)){this._recreateGraphic(n);return}let l=this._getRenderingInfo(n,!1);if(l==null){this._recreateGraphic(n);return}let u=r.extentPadding;for(let e of c.symbolStatePatches)e();if(u!==r.extentPadding&&this._recomputeExtentPadding(),e!=null)for(let t of c.graphics3DGraphicPatches)t(e,l);this._updateSymbolMapping(i.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}recreateGraphics(e){this._suspendSymbolCleanup=!0,this.remove(e),this.add(e),this._suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===1&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){let t=this._graphicsUpdateId;return this._graphicsUpdateId++,this._graphicsWaitingForSymbol.set(e.uid,t),this._graphicsWaitingForSymbol.size===1&&this.notifyChange(`dataUpdating`),t}_endGraphicUpdate(e,t){e&&(t&&this._graphicStateTracking?.updateGraphicError(e,t),this._graphicsWaitingForSymbol.delete(e.uid),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange(`dataUpdating`)))}_recomputeExtentPadding(){let e=0;this._symbols.forEach(t=>{t!=null&&(e=Math.max(e,t.extentPadding))}),this._set(`extentPadding`,e)}_expandComputedExtent(e){let t=We,n=e.spatialReference;j(e,t);let r=this._viewSpatialReference,i=J.tmpVec;if(de(n,r)||O(t[0],t[1],0,n,i,r)&&(t[0]=i[0],t[1]=i[1],O(t[3],t[4],0,n,i,r),t[3]=i[0],t[4]=i[1]),!isFinite(t[0])||!isFinite(t[3])||!isFinite(t[1])||!isFinite(t[4]))return;let a=this.computedExtent,o=null,s=isFinite(t[2])&&isFinite(t[5]),c=s&&(a?.zmin==null||t[2]<a.zmin),l=s&&(a?.zmax==null||t[5]>a.zmax);a?(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||c||l)&&(o=this._propertiesPool.get(`computedExtent`),o.xmin=Math.min(t[0],a.xmin),o.ymin=Math.min(t[1],a.ymin),o.xmax=Math.max(t[3],a.xmax),o.ymax=Math.max(t[4],a.ymax),o.spatialReference=r):(o=this._propertiesPool.get(`computedExtent`),o.xmin=t[0],o.ymin=t[1],o.xmax=t[3],o.ymax=t[4],o.spatialReference=r),o&&(c&&(o.zmin=t[2]),l&&(o.zmax=t[5]),this._set(`computedExtent`,o))}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&=(this._elevationInfoChangeAbortController.abort(),null)}async elevationInfoChange(){this._abortElevationInfoChange();let e=new AbortController;this._elevationInfoChangeAbortController=e;let t=H(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await U(t,this._viewSpatialReference,e.signal,i.getLogger(this)),d(e.signal),this._elevationInfoChangeAbortController=null,this._labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`elevationInfo`,t)?t?.forEach(e=>{let t=e.graphic,n=e.labelLayers;for(let e of n)e.graphics3DSymbolLayer.graphics3DGraphicLayerElevationInfoChanged(t,e)}):this._recreateSymbol(n)}),this.updateStageLayerElevationProvider(),this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?(this.layer.elevationInfo?.mode===`relative-to-scene`||this._numberOfGraphicsProvidingElevation===0)&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=c(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&this.layer.elevationInfo.mode!==`relative-to-scene`)&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new Me({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register(2,this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),this._filterVisibility!=null&&this._filterVisibility.clear(),this._labeler?.reset(),this._deconflictor?.clear(),this._elevationAlignment?.clear(),this.stageLayer?.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&=(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),c(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;let{loadedGraphics:t,view:n}=this.owner,r=n.basemapTerrain?.tilingScheme&&t?.length?t.toArray():null;(e||!r)&&this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=W(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set(`computedExtent`,null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){let t=this._graphicsBySymbol.get(e),n=[];t&&(t.forEach((e,t)=>{this._conditionalRemove(e,t),this._spatialIndex?.remove(e),n.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,e),this._updateLayerVisibility(),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}),this._graphicsBySymbol.set(e,new Map));let r=this._symbols.get(e);c(r),this._symbols.delete(e),this._symbolMaterials=null,c(this._unusedSymbolsCache.pop(e)),this.add(n)}_recreateGraphicsForSymbol(e){let t=this._graphicsBySymbol.get(e);if(t){let e=[];t.forEach(t=>e.push(t.graphic)),this.recreateGraphics(e)}}_conditionalRemove(e,t){this._graphicsDrapedUids.delete(t),this._objectStates?.removeGraphic(e),this._labeler?.removeGraphic(e),this._deconflictor?.removeGraphic(e),this._graphicStateTracking!=null&&this._graphicStateTracking.removeGraphic(e)}add(e){e&&e.length!==0&&(this.owner.view.basemapTerrain?.tilingScheme?(this._updatePolicyForGraphics(e)===0?this._addDelayed(e):this._addImmediate(e),this.notifyChange(`dataUpdating`)):i.getLogger(this).error(`#add()`,`Cannot add graphics before terrain surface has been initialized`))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===1&&(this.layer.geometryType===`mesh`||this.layer.geometryType==null)){for(let t of e)if(t.geometry!=null&&t.geometry.type===`mesh`&&!t.geometry.loaded)return 0}return this.effectiveUpdatePolicy}_addImmediate(e){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(let t of e)this._addGraphic(t,this._getRenderingInfo(t),1);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_addDelayed(e){for(let t of e){let e=t.uid,n=this._pendingUpdates.get(e);n?n.add?n.state!==0&&n.abortController?.abort():this._pendingAdds++:(n=new Z,this._pendingAdds++,this._pendingUpdates.set(e,n)),n.add=t}this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this.notifyChange(`dataUpdating`)}remove(e){this.effectiveUpdatePolicy===0?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange(`dataUpdating`)}_removeImmediate(e){for(let t of e)this._removeGraphic(t);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_removeDelayed(e){for(let t of e){let e=t.uid,n=this._pendingUpdates.get(e);if(n)n.add&&(n.remove?n.add=null:this._pendingUpdates.delete(e),n.state===1&&n.abortController?.abort(),this._pendingAdds--);else{let n=new Z;n.remove=t,this._pendingUpdates.set(e,n),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}this._pendingUpdates.size===0&&this._finishPendingUpdates(),this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this.notifyChange(`dataUpdating`)}_finishPendingUpdates(){this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&i.getLogger(this).warn(`pendingAdds/Removes in inconsistent state!`),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyFocusAreasUpdates(e){for(;this._focusAreasGraphicsQueue.length>0&&!e.done;){e.madeProgress();let t=this._focusAreasGraphicsQueue.pop(),n=ke(t.graphic.geometry);if(n==null)continue;let r=this.stage.view.focusAreasView?.containsGeometry(n)??!0;t.layers.forEach(e=>{(e?.type===`object3d`||e?.type===`buffer`)&&e.stageObject.geometries.some(e=>e.material instanceof Le&&e.material.parameters.focusAreaStyle==null!==r)&&this.recreateGraphics([t.graphic])})}this._focusAreasGraphicsQueue.length===0&&this.notifyChange(`readyToRun`)}_applyPendingUpdates(e){if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,this._pendingUpdates.size===0&&this._spatialIndex?.updating)this._spatialIndex.update(),e.madeProgress();else{if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(let[t,n]of this._pendingUpdates){if(e.done){this._applyPendingRemovesFirst=!0;break}if(n.remove&&!n.add&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(n.remove),n.remove=null,this._pendingUpdates.delete(t),this._pendingRemoves===0))break}}for(let[t,n]of this._pendingUpdates){if(e.done)break;n.add&&n.state===0&&this._processPendingUpdateNew(n);let r=this.effectiveUpdatePolicy;if(n.remove&&(!n.add||n.state===2)&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(n.remove),n.remove=null,r=1),n.add)switch(n.state){case 2:this._addGraphic(n.add,n.renderingInfo,r),n.add=null,this._pendingAdds--,e.madeProgress();break;case 3:n.add=null,this._pendingAdds--}n.remove==null&&n.add==null&&this._pendingUpdates.delete(t)}this._pendingUpdates.size===0&&(this._finishPendingUpdates(),this.notifyChange(`readyToRun`),this.notifyChange(`dataUpdating`))}}_processPendingUpdateNew(e){if(!e.add){e.state=2;return}let t=e.add.geometry;t!=null&&t.type===`mesh`&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=1,e.abortController=new AbortController;let n=e.abortController.signal;try{await t.load({signal:n})}catch(t){return this._processPendingUpdateNewError(e,t)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,e.state=p(t)?0:3}async _processPendingUpdateNewRenderingInfo(e){if(this.layer.renderer==null||this.layer.renderer.type!==`dictionary`){e.renderingInfo=this._getRenderingInfo(e.add),e.state=2;return}e.state=1,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(t){e.abortController=null,e.state=p(t)?0:3;return}t?.symbol==null?(this._symbolWarningLogged||(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=2}_addGraphic(e,t,n){if(this._graphicsWithoutSymbol.set(e.uid,e),t?.symbol==null||!M(e))return;let r=this.stage.renderView.olidRenderHelper;if(r&&this.setUidToIdOnAdd){let t=R(this.owner.view,this.owner.layerViewUid);r.setUidToObjectAndLayerId(A(e,this._objectIdField),e.uid,this.layer.id,this.owner.layerViewUid,fe(this.layer)&&!!this.layer.popupEnabled&&!t&&Re(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}let i=t.symbol,a=this.getOrCreateGraphics3DSymbol(i,t.renderer);if(a==null)return;this._expandComputedExtent(e.geometry);let o=this._beginGraphicUpdate(e),s=new Se(e,t,this.layer),c=!1,l=e=>{e===a.symbol.id&&(c=!0)};this._whenSymbolRemoved.push(l);let u=()=>{if(--this._loadingSymbols,!this.destroyed){if(this._whenSymbolRemoved.removeUnordered(l),this._graphicsWaitingForSymbol.get(e.uid)===o&&!c&&!a.destroyed&&(!this.graphicSymbolSupported||!e.symbol||e.symbol.id===a.symbol.id)){let t=this._createGraphics3DGraphic(a,s);this._spatialIndex&&t!=null&&this._spatialIndex.add(t),--a.referenced,this._endGraphicUpdate(e)}else--a.referenced,this._cleanupSymbols();this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.(),this._labeler?.setDirty()}},d=t=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(l),c||(p(t)?this.add([e]):a.destroyed||this._endGraphicUpdate(e,t)))};++this._loadingSymbols,n===0?a.load(()=>this._dataUpdateQueue.push(u,null).catch(f),e=>this._dataUpdateQueue.push(()=>d(e),null).catch(f)):a.load(u,d)}_removeGraphic(e){let t=e.uid,n=this.graphics3DGraphics.get(t);if(n){n.graphics3DSymbol.onRemoveGraphic(n);let e=n.isElevationSource;this._conditionalRemove(n,t),this._spatialIndex?.remove(n);let r=n.graphics3DSymbol.symbol.id;this._graphicsBySymbol.get(r)?.delete(t),this._graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,n,e),n.destroy(),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}else this._graphicsWithoutSymbol.delete(t),this._graphicsWaitingForSymbol.delete(t),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange(`dataUpdating`))}_hasLabelingContext(e){if(e instanceof B||e instanceof me){let t=this.symbolCreationContext.layer;return t.labelingInfo?t.labelingInfo.some(t=>t.symbol===e):!1}return!1}_hasValidSymbolCreationContext(e){return e instanceof B&&!this._hasLabelingContext(e)?(i.getLogger(this).error(`LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported.`),!1):!0}_getRenderingInfo(e,t=!0){let n=e.geometry;if(n==null)return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!oe(n.spatialReference,this._viewSpatialReference))return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&e.symbol!=null)return t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;let r=this.rendererRequiresHydratedGraphic?N(e,this.layer,null):e,a;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||this.currentRenderer!=null))a=this.owner.getRenderingInfo(r,this.currentRenderer,this._arcadeOnDemand);else{let e=r.symbol||ge(r.geometry);a=new L(null,e)}return a?.symbol==null?(t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):a}_getRenderingInfoAsync(e,t){if(e.geometry==null)return this._geometryWarningLogged||(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&e.symbol!=null)return this._symbolWarningLogged||(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;let n=this.rendererRequiresHydratedGraphic?N(e,this.layer,null):e;return this.owner.getRenderingInfoAsync(n,this.currentRenderer,this._arcadeOnDemand,t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;let n=this._getConvertedSymbol(e);if(!n)return null;let r;if(t!=null&&`backgroundFillSymbol`in t&&t.backgroundFillSymbol){let e=V(t.backgroundFillSymbol,{ignoreDrivers:!0});e.symbol!=null&&(r=e.symbol.symbolLayers)}let i=we(n,this.symbolCreationContext,r);return i.load(()=>{let e=i.extentPadding;e>this.extentPadding&&this._set(`extentPadding`,e),this.notifyChange(`averageSymbolComplexity`)},()=>{}),i}getOrCreateGraphics3DSymbol(e,t){let n=this._symbols.get(e.id);return n===void 0&&(n=this._unusedSymbolsCache.pop(e.id)??(e instanceof he?new Te(e,e=>this._dataUpdateQueue.push(e,null),e=>this._createGraphics3DSymbol(e,t)):this._createGraphics3DSymbol(e,t)),this._symbols.set(e.id,n),this._symbolMaterials=null),n!=null&&++n.referenced,n}trackGraphicState(e){return this._graphicStateTracking??=new De(this),this._graphicStateTracking.add(e)}_addGraphics3DGraphic(e){e.updateUsedMemory(this.reportGraphicSourceMemory),this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this._numberOfGraphics++,e.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,n=!1){this._usedMemory-=t.usedMemory,this.graphics3DGraphics.delete(e),this._numberOfGraphics--,n&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){let{graphic:n}=t;if(this._graphicsWithoutSymbol.delete(n.uid),!this._symbols.has(e.symbol.id))return this.add([n]),null;if(this.graphics3DGraphics.has(n.uid))return null;let r=e.createGraphics3DGraphic(t);if(r==null)return null;this._addGraphics3DGraphic(r);let i=e.symbol.id;if(this._graphicsBySymbol.has(i)||this._graphicsBySymbol.set(i,new Map),this._graphicsBySymbol.get(i).set(n.uid,r),r.isDraped&&this._graphicsDrapedUids.add(n.uid),r.centroid=null,n.geometry!=null&&n.geometry.type!==`point`&&(r.centroid=Oe(n.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),this._scaleVisibility!=null&&this._scaleVisibility.updateVisibility(r),this._filterVisibility!=null){let{defaultVisibility:e}=this._filterVisibility;r.setVisibilityFlag(1,4,e),e||this._filterVisibility.reapply()}this._deconflictor?.addGraphic(r),this._labeler?.addGraphic(r),this._objectStates?.addGraphic(r),r.initialize(this.stageLayer),this._graphicStateTracking!=null&&this._graphicStateTracking.addGraphic(r);let a=this._whenGraphics3DGraphicRequests[n.uid];return a&&(delete this._whenGraphics3DGraphicRequests[n.uid],a.resolve(r)),this._symbolMaterials=null,r}async rendererChange(e){if(this._rendererChangeAbortController=o(this._rendererChangeAbortController),e!==this.currentRenderer){if(this._validateRenderer(e),e??this._currentRendererChange(null,!1),!F(e))this._currentRendererChange(e,!1);else if(e?.arcadeRequired){let t=new AbortController;this._rendererChangeAbortController=t;let{arcadeUtils:n}=await this._ensureArcade();d(t);let r=n.hasGeometryOperations(e),i=r||await this._rendererUsesFieldsRequiringArcadeTypeConversion(e);d(t),r&&(await n.enableGeometryOperations(),d(t)),this.effectiveUpdatePolicy===0?await this._updateQueue.push(()=>this._currentRendererChange(e,i),t.signal):this._currentRendererChange(e,i),this._rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===0){let t=new AbortController;this._rendererChangeAbortController=t,await this._updateQueue.push(()=>this._currentRendererChange(e,!1),t.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(e,!1)}}async _ensureArcade(){return this._arcadeOnDemand??=await z(),this._arcadeOnDemand}async _rendererUsesFieldsRequiringArcadeTypeConversion(e){let{fieldsIndex:t}=this.layer;return t!=null&&(await e.getRequiredFields(t)).some(e=>{switch(t.get(e)?.type){case`date`:case`date-only`:case`time-only`:case`timestamp-offset`:return!0;default:return!1}})}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererRequiresHydratedGraphic=t,this.symbolCreationContext.arcade=this._arcadeOnDemand;let n=this.symbolCreationContext.renderer;if(e===n)return;if(this._symbolConversionCache.clear(),this._unusedSymbolsCache.clear(),e==null){this.symbolCreationContext.renderer=null,this.recreateAllGraphicsAndSymbols();return}let r=b(n,e);this._updateUnchangedSymbolMappings(r,e,n),this.symbolCreationContext.renderer=e,r!=null&&(r.type===`complete`?this.recreateAllGraphicsAndSymbols():r.type===`partial`&&(this._applyRendererDiff(r,e,n)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange(`averageSymbolComplexity`))}_diffHasSymbolChange(e){for(let t in e.diff)switch(t){case`visualVariables`:case`defaultSymbol`:case`uniqueValueInfos`:break;case`uniqueValueGroups`:case`authoringInfo`:case`fieldDelimiter`:delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,n){e||=[],t||=[];let r=[];for(let i of t){let t=this._graphicsBySymbol.get(i.id);t&&t.forEach((a,o)=>{let s=a.graphic,c=this.layer instanceof pe?this.layer:null,l=this._arcadeOnDemand;if(i===n.defaultSymbol&&n.getSymbol(N(s,c,null),{arcade:l})===n.defaultSymbol)return;e.length||n.defaultSymbol?r.push(s):this._graphicsWithoutSymbol.set(o,s);let u=this.graphics3DGraphics.get(o);this._conditionalRemove(u,o),a.destroy(),t.delete(o),this._removeGraphics3DGraphic(o,u),this._updateLayerVisibility()}),this._whenSymbolRemoved.forAll(e=>e(i.id))}(e.length||r.length)&&(this._graphicsWithoutSymbol.forEach(e=>r.push(e)),this._graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_applyUniqueValueRendererDiff(e,t,r){let i=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(i||a){let o=a?.changed,s=a?.unchanged;if(o&&s&&o.some(e=>s.some(t=>t.oldValue.symbol?.id===e.oldValue.symbol?.id)))return!1;let c=a?a.added.map(e=>e.symbol).filter(n):[],l=a?a.removed.map(e=>e.symbol).filter(n):[];if(o)for(let e=0;e<o.length;e++)c.push(o[e].newValue.symbol),l.push(o[e].oldValue.symbol);return i?(r.defaultSymbol&&l.push(r.defaultSymbol),t.defaultSymbol&&c.push(t.defaultSymbol)):r.defaultSymbol&&c.length&&l.push(t.defaultSymbol),this._applySymbolSetDiff(c,l,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,n){if(t?.type!==`unique-value`||n?.type!==`unique-value`||e!=null&&e.type!==`partial`)return[];let r=e=>e==null?null:e.id,i=e&&e.diff,a=i?.defaultSymbol,o=i&&i.uniqueValueInfos,s;if(o)s=o.unchanged.map(e=>({oldId:r(e.oldValue.symbol),newId:r(e.newValue.symbol)}));else{s=[];for(let e of n.uniqueValueInfos??[]){let n=r(e.symbol),i=t.uniqueValueInfos?.find(t=>t.value===e.value);i&&n!==r(i.symbol)&&s.push({oldId:n,newId:r(i.symbol)})}}return!a&&n.defaultSymbol&&s.push({oldId:r(n.defaultSymbol),newId:r(t.defaultSymbol)}),s}_updateSymbolMapping(e,t){let n=t!=null&&t?typeof t==`string`?t:t.id:null;if(e==null||e===n)return;let r=this._graphicsBySymbol.get(e);this._graphicsBySymbol.delete(e),r!==void 0&&this._graphicsBySymbol.set(n,r);let i=this._symbols.get(e);if(i!==void 0&&(this._symbols.delete(e),this._symbols.set(n,i),this._symbolMaterials=null,i!=null)){let e=typeof t==`string`?null:t;e==null?i.symbol.id=n:i.symbol=e}}_updateUnchangedSymbolMappings(e,t,n){let r=this._calculateUnchangedSymbolMapping(e,t,n);for(let{oldId:e,newId:t}of r)this._updateSymbolMapping(e,t)}_applyRendererDiff(e,t,n){if(this._diffHasSymbolChange(e))return!1;if(t instanceof P&&n instanceof P&&this._applyUniqueValueRendererDiff(e,t,n)&&Object.keys(e.diff).length===0)return!0;for(let n of this._graphicsBySymbol.keys()){let r=this._symbols.get(n);if(r!=null)switch(r.applyRendererDiff(e,t)){case 0:this._recreateSymbol(n);break;case 1:this._recreateGraphicsForSymbol(n)}}return!0}opacityChange(){this._updateStageLayerVisibility(),this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`opacity`,t))}_screenSizePerspectiveEnabledChange(){this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`screenSizePerspectiveEnabled`,t)),this._labeler?.screenSizePerspectiveEnabledChanged(),this._deconflictor?.screenSizePerspectiveEnabledChanged()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.sliceable=e,this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`slicePlaneEnabled`,t)),this._deconflictor?.slicePlaneEnabledChange(),this._labeler?.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`physicalBasedRenderingEnabled`,t)||this._recreateSymbol(n)})}_skipHighSymbolLoDsChange(e){this.symbolCreationContext.skipHighSymbolLods=e,this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`skipHighSymbolLods`,t)||this._recreateSymbol(n)})}_pixelRatioChange(){this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`pixelRatio`,t)||this._recreateSymbol(n)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=v(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(e,t){let n=this.symbolCreationContext.clippingExtent,r=ue();return Ne(e,r,t)?this.symbolCreationContext.clippingExtent=ce(k(),r):this.symbolCreationContext.clippingExtent=null,!le(this.symbolCreationContext.clippingExtent,n)}modifyGraphics3DGraphicVisibilities(e){if(this.destroyed)return;let t=!1;this.graphics3DGraphics.forEach(n=>{e(n)&&(t=!0)}),t&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}forEachGraphics3DSymbol(e,t){for(let[t,n]of this._symbols){if(n==null)return;e(n,this._graphicsBySymbol.get(t)||Ke,t)}if(!t?.excludeUnused)for(let t of this._unusedSymbolsCache)e(t,void 0,t.symbol.id)}updateGraphicsVisibilities(){this._filterVisibility!=null&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities(e=>{let t=this._updateUserVisibility(e),n=!!this._scaleVisibility?.updateVisibility(e);return t||n})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,1,!1))}_validateRenderer(e){let t=()=>`'${this.layer.title?`${this.layer.title}, `:``}id:${this.layer.id}'`,n=I(e,{geometryType:this.layer?.geometryType,logWarning:(e,n)=>i.getLogger(this).warn(e,`Symbology conversion for layer ${t()}: ${n}`)});if(n){let e=`Renderer for layer ${t} is not supported in a SceneView`;i.getLogger(this).warn(e,n.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let e=!1;this._symbols.forEach((t,n)=>{if(t==null||t.referenced>0)return;let r=this._graphicsBySymbol.get(n);r&&r.size!==0||(this._graphicsBySymbol.delete(n),this._symbols.delete(n),this._symbolMaterials=null,this._unusedSymbolsCache.put(n,t,l),e=!0)}),e&&(this._recomputeExtentPadding(),this.notifyChange(`averageSymbolComplexity`))}get test(){}get performanceInfo(){return new Ee(this.graphics3DGraphics.size,this.graphics3DGraphics.values().reduce((e,t)=>e+ +!!t.isVisible(),0),this._graphicsWithoutSymbol.size,this._pendingUpdates.size)}};e([y({readOnly:!0})],X.prototype,`computedExtent`,void 0),e([y()],X.prototype,`currentRenderer`,void 0),e([y()],X.prototype,`rendererRequiresHydratedGraphic`,void 0),e([y()],X.prototype,`_frameTaskHandle`,void 0),e([y()],X.prototype,`_dataUpdateQueue`,void 0),e([y()],X.prototype,`_updateQueue`,void 0),e([y({readOnly:!0})],X.prototype,`_viewSpatialReference`,null),e([y()],X.prototype,`_rendererChangeAbortController`,void 0),e([y()],X.prototype,`_elevationInfoChangeAbortController`,void 0),e([y()],X.prototype,`_initializeAbortController`,void 0),e([y()],X.prototype,`_elevationAlignment`,void 0),e([y()],X.prototype,`_scaleVisibility`,void 0),e([y()],X.prototype,`_filterVisibility`,void 0),e([y()],X.prototype,`_initializePromise`,void 0),e([y()],X.prototype,`_spatialIndex`,void 0),e([y({readOnly:!0})],X.prototype,`extentPadding`,void 0),e([y()],X.prototype,`_updatingPendingLoadedGraphicsChange`,void 0),e([y()],X.prototype,`_featureStore`,void 0),e([y()],X.prototype,`_objectStates`,void 0),e([y()],X.prototype,`_loadingSymbols`,void 0),e([y({constructOnly:!0})],X.prototype,`compressionTracker`,void 0),e([y()],X.prototype,`preferredUpdatePolicy`,void 0),e([y()],X.prototype,`_forcedUpdatePolicy`,void 0),e([y({readOnly:!0})],X.prototype,`effectiveUpdatePolicy`,null),e([y({constructOnly:!0})],X.prototype,`elevationFeatureExpressionEnabled`,void 0),e([y({constructOnly:!0})],X.prototype,`owner`,void 0),e([y({constructOnly:!0})],X.prototype,`layer`,void 0),e([y({constructOnly:!0})],X.prototype,`graphicSymbolSupported`,void 0),e([y({constructOnly:!0})],X.prototype,`getRenderingInfoWithoutRenderer`,void 0),e([y({constructOnly:!0})],X.prototype,`componentFactories`,void 0),e([y({constructOnly:!0})],X.prototype,`setUidToIdOnAdd`,void 0),e([y({constructOnly:!0})],X.prototype,`reportGraphicSourceMemory`,void 0),e([y()],X.prototype,`featureStore`,null),e([y()],X.prototype,`initializePromise`,null),e([y()],X.prototype,`scaleVisibility`,null),e([y()],X.prototype,`elevationAlignment`,null),e([y()],X.prototype,`objectStates`,null),e([y()],X.prototype,`filterVisibility`,null),e([y({readOnly:!0})],X.prototype,`updating`,null),e([y({readOnly:!0})],X.prototype,`dataUpdating`,null),e([y({readOnly:!0})],X.prototype,`readyToRun`,null),e([y({readOnly:!0})],X.prototype,`suspendedOrOutsideOfView`,null),e([y({readOnly:!0})],X.prototype,`updatingRemaining`,null),e([y({readOnly:!0})],X.prototype,`displayFeatureLimit`,null),e([y({readOnly:!0})],X.prototype,`averageSymbolComplexity`,null),e([y({constructOnly:!0})],X.prototype,`hasZ`,void 0),e([y({constructOnly:!0})],X.prototype,`hasM`,void 0),e([y()],X.prototype,`_objectIdField`,null),X=J=e([ne(`esri.views.3d.layers.graphics.Graphics3DCore`)],X);class Z{constructor(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}}const Ge=10,Q=T(),$=T(),Ke=new Map;export{X as Graphics3DCore};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import r from"../../../../core/Error.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{findInMap as a}from"../../../../core/MapUtils.js";import{abortMaybe as o,removeMaybe as s,destroyMaybe as c}from"../../../../core/maybe.js";import{MinPriority as l}from"../../../../core/MemCache.js";import u from"../../../../core/PooledArray.js";import{throwIfAborted as d,ignoreAbortErrors as f,isAbortError as p}from"../../../../core/promiseUtils.js";import m from"../../../../core/Queue.js";import{when as h,watch as g,on as ee,syncAndInitial as te,whenOnce as _}from"../../../../core/reactiveUtils.js";import{schedule as v}from"../../../../core/scheduling.js";import{property as y,subclass as ne}from"../../../../core/accessorSupport/decorators.js";import{diff as b,isEmpty as re}from"../../../../core/accessorSupport/diffUtils.js";import{runUntracked as x}from"../../../../core/accessorSupport/tracking.js";import{set as S,add as C,scale as w}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import ie from"../../../../geometry/Extent.js";import ae from"../../../../geometry/Point.js";import{canProjectWithoutEngine as oe}from"../../../../geometry/projectionUtils.js";import{projectBuffer as E}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as D}from"../../../../geometry/projection/projectVectorToVector.js";import{projectXYZToVector as O}from"../../../../geometry/projection/projectXYZToVector.js";import{center as se,fromRect as ce,create as k,equals as le}from"../../../../geometry/support/aaBoundingBox.js";import{create as ue}from"../../../../geometry/support/aaBoundingRect.js";import{equals as de}from"../../../../geometry/support/spatialReferenceUtils.js";import{isPopupProvider as fe}from"../../../../graphic/getPopupProvider.js";import pe from"../../../../layers/Layer.js";import{getObjectId as A,computeAABB as j,hasGeometry as M}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as N}from"../../../../layers/graphics/hydratedFeatures.js";import P from"../../../../renderers/UniqueValueRenderer.js";import{isSupportedRenderer3D as F,validateTo3D as I}from"../../../../renderers/support/rendererConversion.js";import{RenderingInfo as L}from"../../../../renderers/support/RenderingInfo.js";import{isBasemapLayerView as R}from"../../../../support/basemapUtils.js";import{loadArcade as z}from"../../../../support/loadArcade.js";import B from"../../../../symbols/LabelSymbol3D.js";import me from"../../../../symbols/TextSymbol.js";import he from"../../../../symbols/WebStyleSymbol.js";import{getDefaultSymbol3D as ge}from"../../../../symbols/support/defaults3D.js";import{to3D as V}from"../../../../symbols/support/symbolConversion.js";import{aggregateSymbolComplexity as _e,defaultSymbolComplexity as ve}from"./defaultSymbolComplexity.js";import{DisplayFeatureLimit as ye}from"./DisplayFeatureLimit.js";import{ViewElevationProvider as be}from"./ElevationQuery.js";import{extractExpressionInfo as H,createContext as U}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as xe}from"./Graphics3DFeatureStore.js";import{Graphics3DGraphicCreationContext as Se}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as Ce}from"./Graphics3DSymbolCreationContext.js";import{make as we}from"./Graphics3DSymbolFactory.js";import{Graphics3DWebStyleSymbol as Te}from"./Graphics3DWebStyleSymbol.js";import{GraphicsCorePerformanceInfo as Ee}from"./GraphicsCorePerformanceInfo.js";import{GraphicStateTracking as De}from"./GraphicStateTracking.js";import{computeCentroid as Oe}from"./graphicUtils.js";import{placePointOnGeometry as ke}from"./pointUtils.js";import{SpatialIndex2D as Ae}from"./SpatialIndex2D.js";import{AggregateSymbolComplexity as je}from"./SymbolComplexity.js";import{StageLayerElevationProvider as Me}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as Ne}from"../../support/extentUtils.js";import{affectsGeometry as Pe}from"../../webgl-engine/lib/affectsGeometry.js";import{GridLocalOriginFactory as Fe}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{isScreenSizePerspectiveEnabled as W}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{WebGLLayer as Ie}from"../../webgl-engine/lib/WebGLLayer.js";import{HUDMaterial as Le}from"../../webgl-engine/materials/HUDMaterial.js";import{hasPopupTemplate as Re}from"../../../layers/support/popupUtils.js";import{PromiseQueue as G}from"../../../support/PromiseQueue.js";import{PropertiesPool as ze}from"../../../support/PropertiesPool.js";import{ImmediateTask as K,noBudget as Be,TaskPriority as Ve}from"../../../support/Scheduler.js";import{TextureCompressionTracker as He}from"../../../support/TextureCompressionTracker.js";import{Yield as Ue}from"../../../support/Yield.js";import{alphaCutoff as q}from"../../../../webscene/support/AlphaCutoff.js";var J;const Y=T(),We=k();let X=class extends t{static{J=this}static{this.tmpVec=T()}get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new Ae({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get deconflictor(){return this._deconflictor}get labeler(){return this._labeler}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return this.currentRenderer!=null&&this.currentRenderer.type===`dictionary`?0:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this.dataUpdating||this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._frameTaskHandle.updating||this._updateQueue.updating||this.readyToRun)}get dataUpdating(){return!!(this._graphicsWaitingForSymbol.size>0||this._pendingUpdates.size>0||this._spatialIndex?.updating||this._updatingPendingLoadedGraphicsChange||this._dataUpdateQueue.updating||this._loadingSymbols>0||this.compressionTracker.compressing)}get readyToRun(){return this._pendingUpdates.size>0||!!this._spatialIndex?.updating||this._dataUpdateQueue.readyToRun||this._updateQueue.readyToRun||this._focusAreasGraphicsQueue.length>0}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return x(()=>this.updating?this._pendingUpdates.size+(this._spatialIndex?.updatingRemaining||0)*.1+(this._elevationAlignment?.updatingRemaining||0)*.1:0)}get displayFeatureLimit(){let e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?.graphics3D.minTotalNumberOfFeatures??0,n=e?.graphics3D.maxTotalNumberOfFeatures??0,r=e?.graphics3D.maxNumberOfDrawCalls??0,i=e?.graphics3D.maxTotalNumberOfVertices??0,a=this.averageSymbolComplexity,o=Math.max(1,a?.verticesPerFeature??1),s=a&&a.drawCallsPerFeature>0&&r>0?r/a.drawCallsPerFeature:n,c=Math.ceil(i/o),l=Math.max(t,Math.min(n,c,s)),u=this._get(`displayFeatureLimit`);return u&&u.maximumTotalNumberOfVertices===i&&u.averageSymbolComplexity===a&&u.maximumNumberOfFeatures===l?u:new ye(i,l,a)}get averageSymbolComplexity(){return x(()=>{let e=this._averageSymbolComplexities,t=this._get(`averageSymbolComplexity`);return e.numComplexities===0||t!=null&&(e.estimated&&(t.verticesPerFeature>=e.verticesPerFeature||t.verticesPerCoordinate>=e.verticesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.verticesPerFeature===e.verticesPerFeature&&t.verticesPerCoordinate===e.verticesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e})}get _averageSymbolComplexities(){let e=this._totalSymbolComplexities;return e.numComplexities>0&&(e.verticesPerFeature/=e.numComplexities,e.verticesPerCoordinate/=e.numComplexities,e.drawCallsPerFeature/=e.numComplexities,e.memory.bytesPerFeature/=e.numComplexities,e.memory.bytesPerFeatureLabel/=e.numComplexities,e.memory.resourceBytes/=e.numComplexities,e.memory.draped.bytesPerFeature/=e.numComplexities,e.memory.draped.bytesPerFeatureLabel/=e.numComplexities),e}get _totalSymbolComplexities(){let e=new je;return this._forEachSymbolComplexity(t=>_e(t,e)),e}get usedMemory(){let e=this.labelsEnabled?(this.averageSymbolComplexity?.memory.bytesPerFeatureLabel??0)*this._numberOfGraphics:0,t=0;if(this._forEachSymbolComplexityUsed(e=>t+=e?.memory.resourceBytes??0),this._symbolMaterials==null){this._symbolMaterials=[];for(let e of this._symbols.values())if(e!=null){for(let t of e.symbolLayers)if(t)for(let e of t.materials)e&&this._symbolMaterials.push(e)}}let n=this.owner.view.stage.renderer,r=this.owner.view.overlayManager.renderer,i=this._symbolMaterials.reduce((e,t)=>e+((n.getMaterialRenderer(t)||r.getMaterialRenderer(t))?.usedMemory??0),0);return this._usedMemory+e+t+i}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){let e=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*e}if(this.averageSymbolComplexity!=null){let e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}_forEachSymbolComplexity(e){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(e):this._forEachSymbolComplexityUsed(e)}get visible(){return this._visible}_getConvertedSymbol(e){let t=e;if(t.type===`web-style`)return t.clone();let n=this._symbolConversionCache.get(t.id);if(n!=null)return n;let r=V(t,{geometryType:this.layer?.geometryType??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(t),cimFallbackEnabled:!0}),a=r.symbol||null;return a==null&&r.error&&i.getLogger(this).error(r.error.message),this._symbolConversionCache.set(t.id,a),a}_getSymbolComplexitiesUsedOrRenderer(e){let t=this.currentRenderer;if(t==null)return;let n=t.symbols,r=`backgroundFillSymbol`in t?t.backgroundFillSymbol:null;if(!r&&!n.length)return;let i=this._getSymbolComplexityUsedOrRenderer(r);i!=null&&e(i);for(let t of n){let n=this._getSymbolComplexityUsedOrRenderer(t);n!=null&&e(n)}}_getSymbolComplexityUsedOrRenderer(e){if(e==null)return null;let t=this._symbols.get(e.id);if(t!=null)return t.complexity;let n=this._getConvertedSymbol(e);return n==null?null:ve(n)}_forEachSymbolComplexityUsed(e){this._symbols.forEach(t=>{e(t?.complexity)})}get _objectIdField(){return this.layer.objectIdField}constructor(e){super(e),this._propertiesPool=new ze({computedExtent:()=>new ie},this),this.computedExtent=null,this.currentRenderer=null,this.rendererRequiresHydratedGraphic=!1,this._graphicStateTracking=null,this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this._graphicsDrapedUids=new Set,this._graphicsBySymbol=new Map,this._symbolConversionCache=new Map,this._symbols=new Map,this._graphicsWithoutSymbol=new Map,this._graphicsWaitingForSymbol=new Map,this._graphicsUpdateId=0,this._frameTaskHandle=K,this._dataUpdateQueue=new G,this._updateQueue=new G,this._focusAreasGraphicsQueue=new m,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=null,this._elevationAlignment=null,this._scaleVisibility=null,this._filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this._featureStore=null,this._deconflictor=null,this._labeler=null,this._objectStates=null,this._viewElevationProvider=null,this._stageLayerElevationProvider=null,this._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this.compressionTracker=new He,this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new u,this.preferredUpdatePolicy=1,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.reportGraphicSourceMemory=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this._notifyMemoryChange=e=>{this._usedMemory+=e},this._unusedSymbolsCache=e.owner.view.resourceController.memoryController.newCache(`graphics-3d-unused-symbols`,e=>e.destroy()),this.symbolCreationContext=new Ce(e.owner.view.resourceController.scheduler,(e,t)=>this._updateQueue.push(e,t),e.owner.layerViewUid,this.compressionTracker)}initialize(){this._featureStore=new xe({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:e=>this.graphics3DGraphics.forEach(e)});let e=(e,t,n)=>this.spatialIndex.queryGraphicUIDsInExtent(e,t,n),{componentFactories:t}=this;this._elevationAlignment=t.elevationAlignment?.(this,e),this._scaleVisibility=t.scaleVisibility?.(this,e),this._filterVisibility=t.filterVisibility?.({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e(A(t.graphic,this._objectIdField)))),setAllFeaturesVisibility:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e)),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,4,!0))}),this._deconflictor=t.deconflictor?.(this),this._labeler=t.labeler?.(this,this._scaleVisibility),this._objectStates=t.objectStates?.(this),this._initializeAbortController=new AbortController,this.addHandles(h(()=>this.owner.view.state.highlights,()=>{let{highlightOrderMap:e}=this.owner.view.state;this.graphics3DGraphics.forEach(t=>t.updateHighlights(e))})),this._initializePromise=this._initializeAsync()}async _initializeAsync(){let e=this._initializeAbortController?.signal,t=this.owner.view;this._viewElevationProvider=new be(this._viewSpatialReference,t),this._initializeStage(t,this.owner.layerViewUid);let n=t.sharedSymbolResources;this.symbolCreationContext.sharedResources=n,this.currentRenderer!=null&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new Fe(t.renderSpatialReference),this.symbolCreationContext.elevationProvider=t.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e),this.symbolCreationContext.focusAreaStyle=t.map?.focusAreas.style??null;let r=H(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await U(r,this._viewSpatialReference,e,i.getLogger(this)),d(e),this.symbolCreationContext.screenSizePerspectiveEnabled=W(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,this.symbolCreationContext.skipHighSymbolLods=!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,`drapeSourceType`in this.owner){let{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=t.overlayManager.registerGeometryDrapeSource(e)}this.addHandles([g(()=>this.suspendedOrOutsideOfView,()=>this._updateQueue.unshift(()=>this._updateLayerVisibility(),null).catch(f)),g(()=>W(this.layer?.screenSizePerspectiveEnabled),e=>{e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this._screenSizePerspectiveEnabledChange())}),g(()=>this.owner.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(!!e)),g(()=>this.owner.view.state?.rasterPixelRatio,()=>this._pixelRatioChange()),g(()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._physicalBasedRenderingChange(e)),g(()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,e=>this._skipHighSymbolLoDsChange(e)),g(()=>this.owner.view.focusAreasView?.polygons,()=>this._updateFocusedLabels()),g(()=>this.owner.view.timeZone,()=>{this.currentRenderer?.arcadeRequired&&this.recreateAllGraphics()}),g(()=>this.owner.view.map?.focusAreas.style,e=>{this.symbolCreationContext.focusAreaStyle=e??null,this.recreateAllGraphicsAndSymbols()}),h(()=>t.basemapTerrain?.tilingScheme,e=>{let n=t.groundView?.spatialReference;!e.spatialReference.equals(this.symbolCreationContext.overlaySR)&&n!=null&&(this.symbolCreationContext.overlaySR=n),this.hasHandles(`loaded-graphics`)?this.recreateAllGraphics():this.addHandles([ee(()=>this.owner?.loadedGraphics,`change`,e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],`loaded-graphics`)},{initial:!0}),g(()=>this.effectiveUpdatePolicy,e=>{this.stageLayer!=null&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===0,e===1&&this.runTask(Be)},te)]),this._frameTaskHandle=t.resourceController.scheduler.registerTask(Ve.GRAPHICS_CORE,this),this.layer&&`featureReduction`in this.layer&&this.addHandles(g(()=>this.layer.featureReduction,()=>this._deconflictor?.featureReductionChange())),this.notifyChange(`averageSymbolComplexity`),this.rendererChange(this.owner.renderer).catch(()=>{}),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController=o(this._initializeAbortController)}_updateFocusedLabels(){this._focusAreasGraphicsQueue.clear(),this.forEachGraphics3DSymbol((e,t)=>{t&&e.needsUpdateFocus&&t.forEach(e=>{this._focusAreasGraphicsQueue.push(e)})})}destroy(){if(this._unusedSymbolsCache.destroy(),this._abortInitialize(),this._rendererChangeAbortController=o(this._rendererChangeAbortController),this._abortElevationInfoChange(),this._frameTaskHandle.remove(),this._frameTaskHandle=K,this._dataUpdateQueue.cancelAll(),this._updateQueue.cancelAll(),this._deconflictor=s(this._deconflictor),this._labeler=s(this._labeler),this._elevationAlignment=c(this._elevationAlignment),this._scaleVisibility=c(this._scaleVisibility),this._filterVisibility=c(this._filterVisibility),this._objectStates=c(this._objectStates),this.clear(),`drapeSourceType`in this.owner){let{owner:e}=this;this.stage.view.overlayManager.unregisterDrapeSource(e)}this._featureStore=c(this._featureStore),this._updatingPendingLoadedGraphicsChange=s(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=c(this._graphicStateTracking),this.stage&&=(this.stageLayer=c(this.stageLayer),null),this._set(`owner`,null);for(let e in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[e].reject(new r(`graphic:layer-destroyed`,`Layer has been destroyed`));this._whenGraphics3DGraphicRequests=null,this._propertiesPool=c(this._propertiesPool),this._whenSymbolRemoved.prune(),this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=c(this._spatialIndex),this._symbolMaterials=null}clear(){this._objectStates?.allGraphicsDeleted(),this._graphicStateTracking!=null&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(e=>e.destroy()),this._spatialIndex?.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(c),this._symbols.clear(),this._symbolMaterials&&=(this._symbolMaterials.length=0,null),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange(`dataUpdating`),this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}_initializeStage(e,t){this.stage=e.stage,this.stageLayer=new Ie(this.stage,{visible:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t);let n=this.stageLayer.events;n.on(`transformationChanged`,e=>this.notifyGraphicGeometryChanged(e.graphicUid)),n.on(`shaderTransformationChanged`,e=>this.notifyGraphicGeometryChanged(e.graphicUid)),n.on(`visibilityChanged`,e=>this.notifyGraphicVisibilityChanged(e.graphicUid)),n.on(`geometriesChanged`,e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),n.on(`attributesChanged`,e=>Pe(e.attribute)&&this.notifyGraphicGeometryChanged(e.object.graphicUid))}notifyGraphicGeometryChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),this._graphicStateTracking==null||e==null)return;let t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),this._graphicStateTracking==null||e==null)return;let t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){let e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this._numberOfGraphics>e*Ge,n=!this.suspendedOrOutsideOfView&&!t;n!==this._visible&&(this._visible=n,this._updateStageLayerVisibility())}_updateStageLayerVisibility(){let e=this._visible&&(this.layer.opacity==null||this.layer.opacity>=q);this.stageLayer.visible!==e&&(this.stageLayer.visible=e,e?this.updateGraphicsVisibilities():this._hideAllGraphics(),this.owner.notifyContentGeometryUpdate?.())}getGraphics3DGraphicById(e){return e==null?void 0:this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer?.objectIdField){return A(e,t)}get graphics3DGraphicsByObjectID(){let e=this.owner.layer?.objectIdField;if(!e)return;let t=new Map;return this.graphics3DGraphics.forEach(n=>{if(!n)return;let r=n.graphic,i=this._getGraphicObjectID(r,e);i!=null&&t.set(i,n)}),t}get labelsEnabled(){return!!this._labeler?.layerLabelsEnabled()}async updateLabelingInfo(e){let t=this._deconflictor?.labelingInfoChange(e),n=this._labeler?.labelingInfoChange(e);await Promise.allSettled([t,n])}updateVisibilityInfo(){this._deconflictor?.labelingInfoChange(),this._labeler?.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return`unknown`;let e=!1,t=!1;for(let[n,r]of this._symbols)if(r!=null)switch(r.getFastUpdateStatus()){case 3:return`unknown`;case 1:this._graphicsBySymbol.has(n)&&(t=!0);break;case 0:this._graphicsBySymbol.has(n)&&(e=!0);break;case 2:this._graphicsBySymbol.has(n)&&(t=e=!0)}return t?e?`mixed`:`fast`:e?`slow`:`mixed`}runTask(e){if(this._dataUpdateQueue.runTask(e),this._updateQueue.runTask(e),this._applyPendingUpdates(e),this._applyFocusAreasUpdates(e),this.notifyChange(`readyToRun`),this.readyToRun||this.notifyChange(`dataUpdating`),this.notifyChange(`updatingRemaining`),!e.hasProgressed)return Ue}setObjectIdVisibility(e,t){t?this._objectIdInvisibleSet.delete(e):this._objectIdInvisibleSet.add(e);let n=this._findGraphics3DGraphicByObjectId(e);n!=null&&this._updateUserVisibility(n)}_findGraphics3DGraphicByObjectId(e){return a(this.graphics3DGraphics,t=>this._getGraphicObjectID(t.graphic)===e)}_updateUserVisibility(e){if(e==null)return!1;let t=e.graphic,n=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&this.stageLayer.visible&&(n==null||!this._objectIdInvisibleSet.has(n));return e.setVisibilityFlag(1,1,r)}_whenGraphics3DGraphic(e){let t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);let n=this._whenGraphics3DGraphicRequests[e.uid];if(n)return n.promise;let r=Promise.withResolvers();return this._whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){let n=this._viewSpatialReference,r=this.owner.view.renderSpatialReference,i=this.owner.view.groundView.spatialReference,a=(e,t,i)=>E(e,r,t,e,n,t,i),o=(e,t,r)=>E(e,i,t,e,n,t,r),s=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:t!=null&&!!t.useViewElevation,minDemResolution:t==null?null:t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,c=await e.getProjectedBoundingBox(a,o,s,t?.signal);if(!c)return null;let l=c.boundingBox;if(c.requiresDrapedElevation){let e=this.symbolCreationContext.elevationProvider;if(e){se(l,Y);let t=e.getElevation(Y[0],Y[1],0,n,`ground`)??0;l[2]=Math.min(l[2],t),l[5]=Math.max(l[5],t)}}return{boundingBox:l,screenSpaceObjects:c.screenSpaceObjects}}async whenGraphicBounds(e,t){await _(()=>this.owner?.loadedGraphics);let n=this.owner.layer?.objectIdField,i=this.owner.loadedGraphics.find(t=>t===e||n!=null&&t.attributes!=null&&e.attributes&&t.attributes[n]===e.attributes[n]);if(!i)throw new r(`internal:graphic-not-part-of-view`,`Graphic is not part of this view`);let a=await this._whenGraphics3DGraphic(i);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){let n=this.graphics3DGraphics.get(e.uid);if(!n)return null;let r=n.computeAttachmentOrigin();if(r.render.num===0&&r.draped.num===0)return null;S(Q,0,0,0);let i=0;if(r.render.num>0){if(!D(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,$,t))return null;C(Q,Q,$),i++}if(r.draped.num>0){let[e,n]=r.draped.origin,a=this.owner.view.groundView.spatialReference,o=this.owner.view.elevationProvider.getElevation(e,n,0,a,`ground`)??0;if(S($,e,n,o),!D($,a,$,t))return null;C(Q,Q,$),i++}return i>1&&w(Q,Q,1/i),new ae({x:Q[0],y:Q[1],z:Q[2],spatialReference:t})}getSymbolLayerSize(e,t){let n=this._symbols.get(e.id);if(n==null)throw new r(`internal:symbol-not-part-of-view`,`Symbol is not part of this view`);let i=e.symbolLayers.indexOf(t);if(i===-1)throw new r(`internal:missing-symbol-layer`,`Symbol layer is not in symbol`);let a=n.getSymbolLayerSize(i);if(a==null)throw new r(`internal:missing-size`,`Symbol layer has no valid size`);return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){let t=e.graphic.uid,n=this.graphics3DGraphics.get(t);if(n!=null||this._graphicsWithoutSymbol.get(t)!=null){switch(e.property){case`visible`:this._graphicUpdateVisibleHandler(n);break;case`geometry`:this._graphicUpdateGeometryHandler(n,e.graphic);break;case`symbol`:this._graphicUpdateSymbolHandler(n,e);break;case`attributes`:this.symbolCreationContext.featureExpressionInfoContext?.arcade?this._graphicUpdateGeometryHandler(n,e.graphic):n?.updateAttributes();break;case`popupTemplate`:break;case`origin-transform`:this._graphicUpdateTransformHandler(n,e)}this.owner.notifyContentGeometryUpdate?.()}}_graphicUpdateGeometryHandler(e,t){this._graphicUpdateGeometryOrTransformHandler(e,t,()=>e!=null&&e.updateGeometry()&&(this._labeler?.updateGraphicGeometry(e)??!0)?(this._labeler?.setDirty(),this._deconflictor?.setDirty(),!0):!1);let n=t.geometry;n!=null&&this._expandComputedExtent(n)}_graphicUpdateTransformHandler(e,t){let n=t.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(e,t.graphic,()=>t.newValue!=null&&e!=null&&n!=null&&e.graphics3DSymbol.updateTransform(e,n.spatialReference,t.newValue,t.action))}_graphicUpdateGeometryOrTransformHandler(e,t,n){if(t.geometry==null)this._recreateGraphic(t);else if(e==null){let e=t.symbol?.id;if(e){let t=this._symbols.get(e);if(t!=null&&t.loadStatus===0)return}this._recreateGraphic(t)}else if(!n()){let n=this._deconflictor?.getState(e);this._recreateGraphic(t);let r=this.graphics3DGraphics.get(t.uid);r&&n!=null&&this._deconflictor?.setState(r,n)}}_graphicUpdateSymbolHandler(e,t){let n=t.graphic,r=e==null?t.oldValue==null?null:this._symbols.get(t.oldValue.id):e.graphics3DSymbol;if(r==null||t.newValue==null){this._recreateGraphic(n);return}let i=r.symbol,a=this._getConvertedSymbol(t.newValue);if(a!=null&&(a.type!==i.type||a.type===`web-style`)||i.type===`web-style`){this._recreateGraphic(n);return}let o=this._graphicsBySymbol.get(i.id);if(o&&o.size!==1){this._recreateGraphic(n);return}let s=b(i,a);if(s==null){this._updateSymbolMapping(i.id,a);return}let c={diff:s,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(c),!re(c.diff)){this._recreateGraphic(n);return}let l=this._getRenderingInfo(n,!1);if(l==null){this._recreateGraphic(n);return}let u=r.extentPadding;for(let e of c.symbolStatePatches)e();if(u!==r.extentPadding&&this._recomputeExtentPadding(),e!=null)for(let t of c.graphics3DGraphicPatches)t(e,l);this._updateSymbolMapping(i.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}recreateGraphics(e){this._suspendSymbolCleanup=!0,this.remove(e),this.add(e),this._suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===1&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){let t=this._graphicsUpdateId;return this._graphicsUpdateId++,this._graphicsWaitingForSymbol.set(e.uid,t),this._graphicsWaitingForSymbol.size===1&&this.notifyChange(`dataUpdating`),t}_endGraphicUpdate(e,t){e&&(t&&this._graphicStateTracking?.updateGraphicError(e,t),this._graphicsWaitingForSymbol.delete(e.uid),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange(`dataUpdating`)))}_recomputeExtentPadding(){let e=0;this._symbols.forEach(t=>{t!=null&&(e=Math.max(e,t.extentPadding))}),this._set(`extentPadding`,e)}_expandComputedExtent(e){let t=We,n=e.spatialReference;j(e,t);let r=this._viewSpatialReference,i=J.tmpVec;if(de(n,r)||O(t[0],t[1],0,n,i,r)&&(t[0]=i[0],t[1]=i[1],O(t[3],t[4],0,n,i,r),t[3]=i[0],t[4]=i[1]),!isFinite(t[0])||!isFinite(t[3])||!isFinite(t[1])||!isFinite(t[4]))return;let a=this.computedExtent,o=null,s=isFinite(t[2])&&isFinite(t[5]),c=s&&(a?.zmin==null||t[2]<a.zmin),l=s&&(a?.zmax==null||t[5]>a.zmax);a?(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||c||l)&&(o=this._propertiesPool.get(`computedExtent`),o.xmin=Math.min(t[0],a.xmin),o.ymin=Math.min(t[1],a.ymin),o.xmax=Math.max(t[3],a.xmax),o.ymax=Math.max(t[4],a.ymax),o.spatialReference=r):(o=this._propertiesPool.get(`computedExtent`),o.xmin=t[0],o.ymin=t[1],o.xmax=t[3],o.ymax=t[4],o.spatialReference=r),o&&(c&&(o.zmin=t[2]),l&&(o.zmax=t[5]),this._set(`computedExtent`,o))}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&=(this._elevationInfoChangeAbortController.abort(),null)}async elevationInfoChange(){this._abortElevationInfoChange();let e=new AbortController;this._elevationInfoChangeAbortController=e;let t=H(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await U(t,this._viewSpatialReference,e.signal,i.getLogger(this)),d(e.signal),this._elevationInfoChangeAbortController=null,this._labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`elevationInfo`,t)?t?.forEach(e=>{let t=e.graphic,n=e.labelLayers;for(let e of n)e.graphics3DSymbolLayer.graphics3DGraphicLayerElevationInfoChanged(t,e)}):this._recreateSymbol(n)}),this.updateStageLayerElevationProvider(),this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?(this.layer.elevationInfo?.mode===`relative-to-scene`||this._numberOfGraphicsProvidingElevation===0)&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=c(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&this.layer.elevationInfo.mode!==`relative-to-scene`)&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new Me({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register(2,this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),this._filterVisibility!=null&&this._filterVisibility.clear(),this._labeler?.reset(),this._deconflictor?.clear(),this._elevationAlignment?.clear(),this.stageLayer?.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&=(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),c(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;let{loadedGraphics:t,view:n}=this.owner,r=n.basemapTerrain?.tilingScheme&&t?.length?t.toArray():null;(e||!r)&&this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=W(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set(`computedExtent`,null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){let t=this._graphicsBySymbol.get(e),n=[];t&&(t.forEach((e,t)=>{this._conditionalRemove(e,t),this._spatialIndex?.remove(e),n.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,e),this._updateLayerVisibility(),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}),this._graphicsBySymbol.set(e,new Map));let r=this._symbols.get(e);c(r),this._symbols.delete(e),this._symbolMaterials=null,c(this._unusedSymbolsCache.pop(e)),this.add(n)}_recreateGraphicsForSymbol(e){let t=this._graphicsBySymbol.get(e);if(t){let e=[];t.forEach(t=>e.push(t.graphic)),this.recreateGraphics(e)}}_conditionalRemove(e,t){this._graphicsDrapedUids.delete(t),this._objectStates?.removeGraphic(e),this._labeler?.removeGraphic(e),this._deconflictor?.removeGraphic(e),this._graphicStateTracking!=null&&this._graphicStateTracking.removeGraphic(e)}add(e){e&&e.length!==0&&(this.owner.view.basemapTerrain?.tilingScheme?(this._updatePolicyForGraphics(e)===0?this._addDelayed(e):this._addImmediate(e),this.notifyChange(`dataUpdating`)):i.getLogger(this).error(`#add()`,`Cannot add graphics before terrain surface has been initialized`))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===1&&(this.layer.geometryType===`mesh`||this.layer.geometryType==null)){for(let t of e)if(t.geometry!=null&&t.geometry.type===`mesh`&&!t.geometry.loaded)return 0}return this.effectiveUpdatePolicy}_addImmediate(e){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(let t of e)this._addGraphic(t,this._getRenderingInfo(t),1);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_addDelayed(e){for(let t of e){let e=t.uid,n=this._pendingUpdates.get(e);n?n.add?n.state!==0&&n.abortController?.abort():this._pendingAdds++:(n=new Z,this._pendingAdds++,this._pendingUpdates.set(e,n)),n.add=t}this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this.notifyChange(`dataUpdating`)}remove(e){this.effectiveUpdatePolicy===0?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange(`dataUpdating`)}_removeImmediate(e){for(let t of e)this._removeGraphic(t);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_removeDelayed(e){for(let t of e){let e=t.uid,n=this._pendingUpdates.get(e);if(n)n.add&&(n.remove?n.add=null:this._pendingUpdates.delete(e),n.state===1&&n.abortController?.abort(),this._pendingAdds--);else{let n=new Z;n.remove=t,this._pendingUpdates.set(e,n),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}this._pendingUpdates.size===0&&this._finishPendingUpdates(),this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this.notifyChange(`dataUpdating`)}_finishPendingUpdates(){this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&i.getLogger(this).warn(`pendingAdds/Removes in inconsistent state!`),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyFocusAreasUpdates(e){for(;this._focusAreasGraphicsQueue.length>0&&!e.done;){e.madeProgress();let t=this._focusAreasGraphicsQueue.pop(),n=ke(t.graphic.geometry);if(n==null)continue;let r=this.stage.view.focusAreasView?.containsGeometry(n)??!0;t.layers.forEach(e=>{(e?.type===`object3d`||e?.type===`buffer`)&&e.stageObject.geometries.some(e=>e.material instanceof Le&&e.material.parameters.focusAreaStyle==null!==r)&&this.recreateGraphics([t.graphic])})}this._focusAreasGraphicsQueue.length===0&&this.notifyChange(`readyToRun`)}_applyPendingUpdates(e){if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,this._pendingUpdates.size===0&&this._spatialIndex?.updating)this._spatialIndex.update(),e.madeProgress();else{if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(let[t,n]of this._pendingUpdates){if(e.done){this._applyPendingRemovesFirst=!0;break}if(n.remove&&!n.add&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(n.remove),n.remove=null,this._pendingUpdates.delete(t),this._pendingRemoves===0))break}}for(let[t,n]of this._pendingUpdates){if(e.done)break;n.add&&n.state===0&&this._processPendingUpdateNew(n);let r=this.effectiveUpdatePolicy;if(n.remove&&(!n.add||n.state===2)&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(n.remove),n.remove=null,r=1),n.add)switch(n.state){case 2:this._addGraphic(n.add,n.renderingInfo,r),n.add=null,this._pendingAdds--,e.madeProgress();break;case 3:n.add=null,this._pendingAdds--}n.remove==null&&n.add==null&&this._pendingUpdates.delete(t)}this._pendingUpdates.size===0&&(this._finishPendingUpdates(),this.notifyChange(`readyToRun`),this.notifyChange(`dataUpdating`))}}_processPendingUpdateNew(e){if(!e.add){e.state=2;return}let t=e.add.geometry;t!=null&&t.type===`mesh`&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=1,e.abortController=new AbortController;let n=e.abortController.signal;try{await t.load({signal:n})}catch(t){return this._processPendingUpdateNewError(e,t)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,e.state=p(t)?0:3}async _processPendingUpdateNewRenderingInfo(e){if(this.layer.renderer==null||this.layer.renderer.type!==`dictionary`){e.renderingInfo=this._getRenderingInfo(e.add),e.state=2;return}e.state=1,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(t){e.abortController=null,e.state=p(t)?0:3;return}t?.symbol==null?(this._symbolWarningLogged||(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=2}_addGraphic(e,t,n){if(this._graphicsWithoutSymbol.set(e.uid,e),t?.symbol==null||!M(e))return;let r=this.stage.renderView.olidRenderHelper;if(r&&this.setUidToIdOnAdd){let t=R(this.owner.view,this.owner.layerViewUid);r.setUidToObjectAndLayerId(A(e,this._objectIdField),e.uid,this.layer.id,this.owner.layerViewUid,fe(this.layer)&&!!this.layer.popupEnabled&&!t&&Re(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}let i=t.symbol,a=this.getOrCreateGraphics3DSymbol(i,t.renderer);if(a==null)return;this._expandComputedExtent(e.geometry);let o=this._beginGraphicUpdate(e),s=new Se(e,t,this.layer,this.reportGraphicSourceMemory),c=!1,l=e=>{e===a.symbol.id&&(c=!0)};this._whenSymbolRemoved.push(l);let u=()=>{if(--this._loadingSymbols,!this.destroyed){if(this._whenSymbolRemoved.removeUnordered(l),this._graphicsWaitingForSymbol.get(e.uid)===o&&!c&&!a.destroyed&&(!this.graphicSymbolSupported||!e.symbol||e.symbol.id===a.symbol.id)){let t=this._createGraphics3DGraphic(a,s);this._spatialIndex&&t!=null&&this._spatialIndex.add(t),--a.referenced,this._endGraphicUpdate(e)}else--a.referenced,this._cleanupSymbols();this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.(),this._labeler?.setDirty()}},d=t=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(l),c||(p(t)?this.add([e]):a.destroyed||this._endGraphicUpdate(e,t)))};++this._loadingSymbols,n===0?a.load(()=>this._dataUpdateQueue.push(u,null).catch(f),e=>this._dataUpdateQueue.push(()=>d(e),null).catch(f)):a.load(u,d)}_removeGraphic(e){let t=e.uid,n=this.graphics3DGraphics.get(t);if(n){n.graphics3DSymbol.onRemoveGraphic(n);let e=n.isElevationSource;this._conditionalRemove(n,t),this._spatialIndex?.remove(n);let r=n.graphics3DSymbol.symbol.id;this._graphicsBySymbol.get(r)?.delete(t),this._graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,n,e),n.destroy(),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}else this._graphicsWithoutSymbol.delete(t),this._graphicsWaitingForSymbol.delete(t),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange(`dataUpdating`))}_hasLabelingContext(e){if(e instanceof B||e instanceof me){let t=this.symbolCreationContext.layer;return t.labelingInfo?t.labelingInfo.some(t=>t.symbol===e):!1}return!1}_hasValidSymbolCreationContext(e){return e instanceof B&&!this._hasLabelingContext(e)?(i.getLogger(this).error(`LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported.`),!1):!0}_getRenderingInfo(e,t=!0){let n=e.geometry;if(n==null)return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!oe(n.spatialReference,this._viewSpatialReference))return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&e.symbol!=null)return t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;let r=this.rendererRequiresHydratedGraphic?N(e,this.layer,null):e,a;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||this.currentRenderer!=null))a=this.owner.getRenderingInfo(r,this.currentRenderer,this._arcadeOnDemand);else{let e=r.symbol||ge(r.geometry);a=new L(null,e)}return a?.symbol==null?(t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):a}_getRenderingInfoAsync(e,t){if(e.geometry==null)return this._geometryWarningLogged||(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&e.symbol!=null)return this._symbolWarningLogged||(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;let n=this.rendererRequiresHydratedGraphic?N(e,this.layer,null):e;return this.owner.getRenderingInfoAsync(n,this.currentRenderer,this._arcadeOnDemand,t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;let n=this._getConvertedSymbol(e);if(!n)return null;let r;if(t!=null&&`backgroundFillSymbol`in t&&t.backgroundFillSymbol){let e=V(t.backgroundFillSymbol,{ignoreDrivers:!0});e.symbol!=null&&(r=e.symbol.symbolLayers)}let i=we(n,this.symbolCreationContext,r);return i.load(()=>{let e=i.extentPadding;e>this.extentPadding&&this._set(`extentPadding`,e),this.notifyChange(`averageSymbolComplexity`)},()=>{}),i}getOrCreateGraphics3DSymbol(e,t){let n=this._symbols.get(e.id);return n===void 0&&(n=this._unusedSymbolsCache.pop(e.id)??(e instanceof he?new Te(e,e=>this._dataUpdateQueue.push(e,null),e=>this._createGraphics3DSymbol(e,t)):this._createGraphics3DSymbol(e,t)),this._symbols.set(e.id,n),this._symbolMaterials=null),n!=null&&++n.referenced,n}trackGraphicState(e){return this._graphicStateTracking??=new De(this),this._graphicStateTracking.add(e)}_addGraphics3DGraphic(e){this._usedMemory+=e.usedMemory,e.notifyMemoryChange=this._notifyMemoryChange,this.graphics3DGraphics.set(e.graphic.uid,e),this._numberOfGraphics++,e.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,n=!1){t.notifyMemoryChange=void 0,this._usedMemory-=t.usedMemory,this.graphics3DGraphics.delete(e),this._numberOfGraphics--,n&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){let{graphic:n}=t;if(this._graphicsWithoutSymbol.delete(n.uid),!this._symbols.has(e.symbol.id))return this.add([n]),null;if(this.graphics3DGraphics.has(n.uid))return null;let r=e.createGraphics3DGraphic(t);if(r==null)return null;this._addGraphics3DGraphic(r);let i=e.symbol.id;if(this._graphicsBySymbol.has(i)||this._graphicsBySymbol.set(i,new Map),this._graphicsBySymbol.get(i).set(n.uid,r),r.isDraped&&this._graphicsDrapedUids.add(n.uid),r.centroid=null,n.geometry!=null&&n.geometry.type!==`point`&&(r.centroid=Oe(n.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),this._scaleVisibility!=null&&this._scaleVisibility.updateVisibility(r),this._filterVisibility!=null){let{defaultVisibility:e}=this._filterVisibility;r.setVisibilityFlag(1,4,e),e||this._filterVisibility.reapply()}this._deconflictor?.addGraphic(r),this._labeler?.addGraphic(r),this._objectStates?.addGraphic(r),r.initialize(this.stageLayer),this._graphicStateTracking!=null&&this._graphicStateTracking.addGraphic(r);let a=this._whenGraphics3DGraphicRequests[n.uid];return a&&(delete this._whenGraphics3DGraphicRequests[n.uid],a.resolve(r)),this._symbolMaterials=null,r}async rendererChange(e){if(this._rendererChangeAbortController=o(this._rendererChangeAbortController),e!==this.currentRenderer){if(this._validateRenderer(e),e??this._currentRendererChange(null,!1),!F(e))this._currentRendererChange(e,!1);else if(e?.arcadeRequired){let t=new AbortController;this._rendererChangeAbortController=t;let{arcadeUtils:n}=await this._ensureArcade();d(t);let r=n.hasGeometryOperations(e),i=r||await this._rendererUsesFieldsRequiringArcadeTypeConversion(e);d(t),r&&(await n.enableGeometryOperations(),d(t)),this.effectiveUpdatePolicy===0?await this._updateQueue.push(()=>this._currentRendererChange(e,i),t.signal):this._currentRendererChange(e,i),this._rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===0){let t=new AbortController;this._rendererChangeAbortController=t,await this._updateQueue.push(()=>this._currentRendererChange(e,!1),t.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(e,!1)}}async _ensureArcade(){return this._arcadeOnDemand??=await z(),this._arcadeOnDemand}async _rendererUsesFieldsRequiringArcadeTypeConversion(e){let{fieldsIndex:t}=this.layer;return t!=null&&(await e.getRequiredFields(t)).some(e=>{switch(t.get(e)?.type){case`date`:case`date-only`:case`time-only`:case`timestamp-offset`:return!0;default:return!1}})}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererRequiresHydratedGraphic=t,this.symbolCreationContext.arcade=this._arcadeOnDemand;let n=this.symbolCreationContext.renderer;if(e===n)return;if(this._symbolConversionCache.clear(),this._unusedSymbolsCache.clear(),e==null){this.symbolCreationContext.renderer=null,this.recreateAllGraphicsAndSymbols();return}let r=b(n,e);this._updateUnchangedSymbolMappings(r,e,n),this.symbolCreationContext.renderer=e,r!=null&&(r.type===`complete`?this.recreateAllGraphicsAndSymbols():r.type===`partial`&&(this._applyRendererDiff(r,e,n)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange(`averageSymbolComplexity`))}_diffHasSymbolChange(e){for(let t in e.diff)switch(t){case`visualVariables`:case`defaultSymbol`:case`uniqueValueInfos`:break;case`uniqueValueGroups`:case`authoringInfo`:case`fieldDelimiter`:delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,n){e||=[],t||=[];let r=[];for(let i of t){let t=this._graphicsBySymbol.get(i.id);t&&t.forEach((a,o)=>{let s=a.graphic,c=this.layer instanceof pe?this.layer:null,l=this._arcadeOnDemand;if(i===n.defaultSymbol&&n.getSymbol(N(s,c,null),{arcade:l})===n.defaultSymbol)return;e.length||n.defaultSymbol?r.push(s):this._graphicsWithoutSymbol.set(o,s);let u=this.graphics3DGraphics.get(o);this._conditionalRemove(u,o),a.destroy(),t.delete(o),this._removeGraphics3DGraphic(o,u),this._updateLayerVisibility()}),this._whenSymbolRemoved.forAll(e=>e(i.id))}(e.length||r.length)&&(this._graphicsWithoutSymbol.forEach(e=>r.push(e)),this._graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_applyUniqueValueRendererDiff(e,t,r){let i=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(i||a){let o=a?.changed,s=a?.unchanged;if(o&&s&&o.some(e=>s.some(t=>t.oldValue.symbol?.id===e.oldValue.symbol?.id)))return!1;let c=a?a.added.map(e=>e.symbol).filter(n):[],l=a?a.removed.map(e=>e.symbol).filter(n):[];if(o)for(let e=0;e<o.length;e++)c.push(o[e].newValue.symbol),l.push(o[e].oldValue.symbol);return i?(r.defaultSymbol&&l.push(r.defaultSymbol),t.defaultSymbol&&c.push(t.defaultSymbol)):r.defaultSymbol&&c.length&&l.push(t.defaultSymbol),this._applySymbolSetDiff(c,l,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,n){if(t?.type!==`unique-value`||n?.type!==`unique-value`||e!=null&&e.type!==`partial`)return[];let r=e=>e==null?null:e.id,i=e&&e.diff,a=i?.defaultSymbol,o=i&&i.uniqueValueInfos,s;if(o)s=o.unchanged.map(e=>({oldId:r(e.oldValue.symbol),newId:r(e.newValue.symbol)}));else{s=[];for(let e of n.uniqueValueInfos??[]){let n=r(e.symbol),i=t.uniqueValueInfos?.find(t=>t.value===e.value);i&&n!==r(i.symbol)&&s.push({oldId:n,newId:r(i.symbol)})}}return!a&&n.defaultSymbol&&s.push({oldId:r(n.defaultSymbol),newId:r(t.defaultSymbol)}),s}_updateSymbolMapping(e,t){let n=t!=null&&t?typeof t==`string`?t:t.id:null;if(e==null||e===n)return;let r=this._graphicsBySymbol.get(e);this._graphicsBySymbol.delete(e),r!==void 0&&this._graphicsBySymbol.set(n,r);let i=this._symbols.get(e);if(i!==void 0&&(this._symbols.delete(e),this._symbols.set(n,i),this._symbolMaterials=null,i!=null)){let e=typeof t==`string`?null:t;e==null?i.symbol.id=n:i.symbol=e}}_updateUnchangedSymbolMappings(e,t,n){let r=this._calculateUnchangedSymbolMapping(e,t,n);for(let{oldId:e,newId:t}of r)this._updateSymbolMapping(e,t)}_applyRendererDiff(e,t,n){if(this._diffHasSymbolChange(e))return!1;if(t instanceof P&&n instanceof P&&this._applyUniqueValueRendererDiff(e,t,n)&&Object.keys(e.diff).length===0)return!0;for(let n of this._graphicsBySymbol.keys()){let r=this._symbols.get(n);if(r!=null)switch(r.applyRendererDiff(e,t)){case 0:this._recreateSymbol(n);break;case 1:this._recreateGraphicsForSymbol(n)}}return!0}opacityChange(){this._updateStageLayerVisibility(),this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`opacity`,t))}_screenSizePerspectiveEnabledChange(){this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`screenSizePerspectiveEnabled`,t)),this._labeler?.screenSizePerspectiveEnabledChanged(),this._deconflictor?.screenSizePerspectiveEnabledChanged()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.sliceable=e,this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`slicePlaneEnabled`,t)),this._deconflictor?.slicePlaneEnabledChange(),this._labeler?.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`physicalBasedRenderingEnabled`,t)||this._recreateSymbol(n)})}_skipHighSymbolLoDsChange(e){this.symbolCreationContext.skipHighSymbolLods=e,this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`skipHighSymbolLods`,t)||this._recreateSymbol(n)})}_pixelRatioChange(){this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`pixelRatio`,t)||this._recreateSymbol(n)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=v(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(e,t){let n=this.symbolCreationContext.clippingExtent,r=ue();return Ne(e,r,t)?this.symbolCreationContext.clippingExtent=ce(k(),r):this.symbolCreationContext.clippingExtent=null,!le(this.symbolCreationContext.clippingExtent,n)}modifyGraphics3DGraphicVisibilities(e){if(this.destroyed)return;let t=!1;this.graphics3DGraphics.forEach(n=>{e(n)&&(t=!0)}),t&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}forEachGraphics3DSymbol(e,t){for(let[t,n]of this._symbols){if(n==null)return;e(n,this._graphicsBySymbol.get(t)||Ke,t)}if(!t?.excludeUnused)for(let t of this._unusedSymbolsCache)e(t,void 0,t.symbol.id)}updateGraphicsVisibilities(){this._filterVisibility!=null&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities(e=>{let t=this._updateUserVisibility(e),n=!!this._scaleVisibility?.updateVisibility(e);return t||n})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,1,!1))}_validateRenderer(e){let t=()=>`'${this.layer.title?`${this.layer.title}, `:``}id:${this.layer.id}'`,n=I(e,{geometryType:this.layer?.geometryType,logWarning:(e,n)=>i.getLogger(this).warn(e,`Symbology conversion for layer ${t()}: ${n}`)});if(n){let e=`Renderer for layer ${t} is not supported in a SceneView`;i.getLogger(this).warn(e,n.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let e=!1;this._symbols.forEach((t,n)=>{if(t==null||t.referenced>0)return;let r=this._graphicsBySymbol.get(n);r&&r.size!==0||(this._graphicsBySymbol.delete(n),this._symbols.delete(n),this._symbolMaterials=null,this._unusedSymbolsCache.put(n,t,l),e=!0)}),e&&(this._recomputeExtentPadding(),this.notifyChange(`averageSymbolComplexity`))}get test(){}get performanceInfo(){return new Ee(this.graphics3DGraphics.size,this.graphics3DGraphics.values().reduce((e,t)=>e+ +!!t.isVisible(),0),this._graphicsWithoutSymbol.size,this._pendingUpdates.size)}};e([y({readOnly:!0})],X.prototype,`computedExtent`,void 0),e([y()],X.prototype,`currentRenderer`,void 0),e([y()],X.prototype,`rendererRequiresHydratedGraphic`,void 0),e([y()],X.prototype,`_frameTaskHandle`,void 0),e([y()],X.prototype,`_dataUpdateQueue`,void 0),e([y()],X.prototype,`_updateQueue`,void 0),e([y({readOnly:!0})],X.prototype,`_viewSpatialReference`,null),e([y()],X.prototype,`_rendererChangeAbortController`,void 0),e([y()],X.prototype,`_elevationInfoChangeAbortController`,void 0),e([y()],X.prototype,`_initializeAbortController`,void 0),e([y()],X.prototype,`_elevationAlignment`,void 0),e([y()],X.prototype,`_scaleVisibility`,void 0),e([y()],X.prototype,`_filterVisibility`,void 0),e([y()],X.prototype,`_initializePromise`,void 0),e([y()],X.prototype,`_spatialIndex`,void 0),e([y({readOnly:!0})],X.prototype,`extentPadding`,void 0),e([y()],X.prototype,`_updatingPendingLoadedGraphicsChange`,void 0),e([y()],X.prototype,`_featureStore`,void 0),e([y()],X.prototype,`_objectStates`,void 0),e([y()],X.prototype,`_loadingSymbols`,void 0),e([y({constructOnly:!0})],X.prototype,`compressionTracker`,void 0),e([y()],X.prototype,`preferredUpdatePolicy`,void 0),e([y()],X.prototype,`_forcedUpdatePolicy`,void 0),e([y({readOnly:!0})],X.prototype,`effectiveUpdatePolicy`,null),e([y({constructOnly:!0})],X.prototype,`elevationFeatureExpressionEnabled`,void 0),e([y({constructOnly:!0})],X.prototype,`owner`,void 0),e([y({constructOnly:!0})],X.prototype,`layer`,void 0),e([y({constructOnly:!0})],X.prototype,`graphicSymbolSupported`,void 0),e([y({constructOnly:!0})],X.prototype,`getRenderingInfoWithoutRenderer`,void 0),e([y({constructOnly:!0})],X.prototype,`componentFactories`,void 0),e([y({constructOnly:!0})],X.prototype,`setUidToIdOnAdd`,void 0),e([y({constructOnly:!0})],X.prototype,`reportGraphicSourceMemory`,void 0),e([y()],X.prototype,`featureStore`,null),e([y()],X.prototype,`initializePromise`,null),e([y()],X.prototype,`scaleVisibility`,null),e([y()],X.prototype,`elevationAlignment`,null),e([y()],X.prototype,`objectStates`,null),e([y()],X.prototype,`filterVisibility`,null),e([y({readOnly:!0})],X.prototype,`updating`,null),e([y({readOnly:!0})],X.prototype,`dataUpdating`,null),e([y({readOnly:!0})],X.prototype,`readyToRun`,null),e([y({readOnly:!0})],X.prototype,`suspendedOrOutsideOfView`,null),e([y({readOnly:!0})],X.prototype,`updatingRemaining`,null),e([y({readOnly:!0})],X.prototype,`displayFeatureLimit`,null),e([y({readOnly:!0})],X.prototype,`averageSymbolComplexity`,null),e([y({constructOnly:!0})],X.prototype,`hasZ`,void 0),e([y({constructOnly:!0})],X.prototype,`hasM`,void 0),e([y()],X.prototype,`_objectIdField`,null),X=J=e([ne(`esri.views.3d.layers.graphics.Graphics3DCore`)],X);class Z{constructor(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}}const Ge=10,Q=T(),$=T(),Ke=new Map;export{X as Graphics3DCore};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as n,create as r,expandWithRect as i,center as a,set as o,toRect as s}from"../../../../geometry/support/aaBoundingBox.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{demResolutionForBoundingBox as l}from"./graphicUtils.js";class u{constructor(e,t,n,r){this.graphics3DSymbolLayer=e,this.renderGeometries=t,this.boundingBox=n,this._drapeSourceRenderer=r,this._visible=!1,this._addedToStage=!1,this.isElevationSource=!1}initialize(e){this.stage=e.stage}get usedMemory(){return this.graphics3DSymbolLayer.usedMemory}setVisibility(e){if(this.stage!=null&&this._visible!==e){if(this._visible=e,e&&!this._addedToStage)this._addedToStage=!0,this._drapeSourceRenderer.addGeometries(this.renderGeometries,0);else if(e||this._addedToStage){for(let e of this.renderGeometries)e.visible=this._visible;this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,1)}}}destroy(){this.stage&&this._addedToStage&&this._drapeSourceRenderer.removeGeometries(this.renderGeometries,2),this._addedToStage=!1,this._visible=!1,this.stage=null}getCenterObjectSpace(n=t()){return e(n,0,0,0)}getBoundingBoxObjectSpace(e=r()){return n(e)}addObjectState(e){e.stateType===0&&(this.renderGeometries.forEach(t=>{let n=d(t).allocateIdAndHighlight(e.highlightName);e.addRenderGeometry(t,n,this)}),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,8))}removeObjectState(e){this.renderGeometries.forEach(t=>e.removeByObject(t))}updateHighlights(e){}removeRenderGeometryObjectState(e,t){t.channel===0&&(d(e).removeHighlight(t),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries([e],8))}computeAttachmentOrigin(e){for(let t of this.renderGeometries)d(t).computeAttachmentOrigin(m)&&(e.draped.origin[0]+=m[0],e.draped.origin[1]+=m[1],e.draped.num++)}async getProjectedBoundingBox(e,t,r,o,s){n(s);for(let t=0;t<this.renderGeometries.length;t++){let n=this.renderGeometries[t];this._getRenderGeometryProjectedBoundingRect(n,e,f,r),i(s,f)}if(t){a(s,m);let e,n=l(s,t.service.spatialReference,t);try{e=await t.service.queryElevation(m[0],m[1],o,n,`ground`)}catch{}e!=null&&(s[2]=Math.min(s[2],e),s[5]=Math.max(s[5],e))}return s}_getRenderGeometryProjectedBoundingRect(e,t,n,r){if(this.boundingBox)o(p,this.boundingBox);else{let{center:t,radius:n}=e.boundingSphere;p[0]=t[0]-n,p[1]=t[1]-n,p[2]=t[2]-n,p[3]=t[0]+n,p[4]=t[1]+n,p[5]=t[2]+n}return t(p,0,2),this.calculateRelativeScreenBounds&&r.push({location:a(p),screenSpaceBoundingRect:this.calculateRelativeScreenBounds()}),s(p,n)}}function d(e){return e.type===1?e:e.geometry}const f=c(),p=r(),m=t();export{u as Graphics3DDrapedGraphicLayerBase};
2
+ import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as n,create as r,expandWithRect as i,center as a,set as o,toRect as s}from"../../../../geometry/support/aaBoundingBox.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{demResolutionForBoundingBox as l}from"./graphicUtils.js";import{computeGeometryBufferMemory as u}from"../../webgl-engine/lib/geometryMemoryUtils.js";class d{constructor(e,t,n,r){this.graphics3DSymbolLayer=e,this.renderGeometries=t,this.boundingBox=n,this._drapeSourceRenderer=r,this._visible=!1,this._addedToStage=!1,this.isElevationSource=!1,this._geometryBufferMemory=u(t.map(f))}initialize(e){this.stage=e.stage}get usedMemory(){return this.graphics3DSymbolLayer.usedMemory+this._geometryBufferMemory+this.renderGeometries.reduce((e,t)=>e+f(t).usedMemoryExcludingBuffers,0)}setNotifyMemoryChange(e){for(let t of this.renderGeometries)f(t).notifyMemoryChange=e}setVisibility(e){if(this.stage!=null&&this._visible!==e){if(this._visible=e,e&&!this._addedToStage)this._addedToStage=!0,this._drapeSourceRenderer.addGeometries(this.renderGeometries,0);else if(e||this._addedToStage){for(let e of this.renderGeometries)e.visible=this._visible;this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,1)}}}destroy(){this.setNotifyMemoryChange(void 0),this.stage&&this._addedToStage&&this._drapeSourceRenderer.removeGeometries(this.renderGeometries,2),this._addedToStage=!1,this._visible=!1,this.stage=null}getCenterObjectSpace(n=t()){return e(n,0,0,0)}getBoundingBoxObjectSpace(e=r()){return n(e)}addObjectState(e){e.stateType===0&&(this.renderGeometries.forEach(t=>{let n=f(t).allocateIdAndHighlight(e.highlightName);e.addRenderGeometry(t,n,this)}),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,8))}removeObjectState(e){this.renderGeometries.forEach(t=>e.removeByObject(t))}updateHighlights(e){}removeRenderGeometryObjectState(e,t){t.channel===0&&(f(e).removeHighlight(t),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries([e],8))}computeAttachmentOrigin(e){for(let t of this.renderGeometries)f(t).computeAttachmentOrigin(h)&&(e.draped.origin[0]+=h[0],e.draped.origin[1]+=h[1],e.draped.num++)}async getProjectedBoundingBox(e,t,r,o,s){n(s);for(let t=0;t<this.renderGeometries.length;t++){let n=this.renderGeometries[t];this._getRenderGeometryProjectedBoundingRect(n,e,p,r),i(s,p)}if(t){a(s,h);let e,n=l(s,t.service.spatialReference,t);try{e=await t.service.queryElevation(h[0],h[1],o,n,`ground`)}catch{}e!=null&&(s[2]=Math.min(s[2],e),s[5]=Math.max(s[5],e))}return s}_getRenderGeometryProjectedBoundingRect(e,t,n,r){if(this.boundingBox)o(m,this.boundingBox);else{let{center:t,radius:n}=e.boundingSphere;m[0]=t[0]-n,m[1]=t[1]-n,m[2]=t[2]-n,m[3]=t[0]+n,m[4]=t[1]+n,m[5]=t[2]+n}return t(m,0,2),this.calculateRelativeScreenBounds&&r.push({location:a(m),screenSpaceBoundingRect:this.calculateRelativeScreenBounds()}),s(m,n)}}function f(e){return e.type===1?e:e.geometry}const p=c(),m=r(),h=t();export{d as Graphics3DDrapedGraphicLayerBase};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{clone as e}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as t}from"../../../../core/units.js";import{normalFromMat4 as n}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as i,invertOrIdentity as a}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as s,sub as c,cross as l,add as u,normalize as d,transformMat4 as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ONES as p,create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as h,ZEROS as g}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as _}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as v,fromBuffer as y,intersectsClippingArea as b}from"../../../../geometry/support/aaBoundingBox.js";import{getZeroIndexArray as x}from"../../../../geometry/support/Indices.js";import{t as S}from"../../../../chunks/vec3.js";import{SnappingCandidateVertex as C,SnappingCandidateEdge as w}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as T}from"../../../../renderers/support/renderingInfoUtils.js";import{isDrivenOpacityFallbackAlwaysOpaque as E}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{needsElevationUpdates3D as D,SampleElevationInfo as O}from"./elevationAlignmentUtils.js";import{extrudePolygon as ee}from"./extrudePolygon.js";import{Object3DEdgeState as k,Graphics3DObject3DGraphicLayer as A}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as j}from"./Graphics3DSymbolLayer.js";import{computeCentroid as M}from"./graphicUtils.js";import{addOlidAttribute as N}from"./olidUtils.js";import{geometryAsPolygon as P}from"./polygonUtils.js";import{createMaterial as te}from"../support/edgeUtils.js";import{encodeNaNUInt8 as F}from"../support/symbolColorUtils.js";import{debugFlags as I}from"../../support/debugFlags.js";import{SamplePosition as L}from"../../support/ElevationProvider.js";import{loadTessellationUtils as R,preloadedPolygonToRenderInfoElevationAligned as z}from"../../support/renderInfoUtils/polygon.js";import{Attribute as B}from"../../webgl-engine/lib/Attribute.js";import{Geometry as V}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as H}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as U,compressNormal as W}from"../../webgl-engine/lib/Normals.js";import{Object3D as G}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as K}from"../../webgl-engine/materials/DefaultMaterial.js";const q=[`polygon`,`extent`];class J extends j{constructor(e,t,n,r){super(e,t,n,r,E(t)),this.ensureDrapedStatus(!1)}async doLoad(){let e=this.symbolLayer,t=e?.material,n=this.symbolLayer.material?.color?.a,r=this._hasDrivenColorOrOpacity,i=this.needsDrivenTransparentPass||r&&n!=null&&n<1,a=t?.emissive,o=(a?.source===`color`?a?.strength:void 0)??0,s=!r&&(n==null||n===0),c=r?h:this._materialColor?.toUnitRGBA()??g,l={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,useIndexing:!0,ambient:p,diffuse:p,externalColor:c,opacity:+!s,layerOpacity:this._getLayerOpacity(),drivenOpacity:i,hasSymbolColors:r,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:e.castShadows,emissiveStrengthFromSymbol:o,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},u=new K(l,this._context),d=new K({...l,cullFace:2},this._context);this._materials[0]=u,this._materials[1]=d,this._updateTransparentDepedentMaterialParameters(),await R()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry,q,this.symbolLayer.type))return null;let n=this._getDrivenUInt8ColorWithNaNSupport(e.renderingInfo,this._materialColor,!1);F(n,n);let r=this.createElevationContextForGraphic(t);return this._createAs3DShape(t,e.renderingInfo,n,r,t.uid)}layerOpacityChanged(e,t){let n=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:n}),this._materials[1]?.setParameters({layerOpacity:n}),this._updateTransparentDepedentMaterialParameters(),e?.forEach(e=>t(e)?.layerOpacityChanged(n,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,D)}slicePlaneEnabledChanged(e,t){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e?.forEach(e=>{t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){let e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(e),this._materials[1]?.setParameters(e),!0}_getExtrusionSize(e){let t;return t=e.size&&this._drivenProperties.size?T(e.size.output,2)??0:this._getSymbolSize(),t/=this._context.renderCoordsHelper.unitInMeters,t}_containsRenderableGeometry(e){return`polygonIndexCount`in e&&`outlineIndexCount`in e?e.polygonIndexCount>0||e.outlineIndexCount>0:super._containsRenderableGeometry(e)}applyRendererDiff(e,t){return+!this._drivenPropertiesChanged(t)}async queryForSnapping(n,r,i,a){let o=this._getExtrusionSize(i)*this._context.renderCoordsHelper.unitInMeters/t(r),{objectId:s,target:c}=n,l=e(c);switch(l.z=(l.z??0)+o,n.type){case`edge`:{let{start:t,end:r}=n,i=e(t),a=e(r);return i.z=(i.z??0)+o,a.z=(a.z??0)+o,[new w(s,l,1/0,i,a)]}case`vertex`:return[new C(s,l,1/0),new w(s,c,1/0,c,l)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,t,a,s,c){let l=P(e.geometry);if(l==null)return null;if(l.rings.length===0||!l.rings.some(e=>e.length>0))return this._logGeometryValidationWarnings(l.rings,`rings`,`ExtrudeSymbol3DLayer`),null;let u=z(l,this._context.elevationProvider,this._context.renderCoordsHelper,s,{outlineOutput:`tessellated-indices`,owner:this._context.layer});if(u==null)return;this._logGeometryCreationWarnings(u,l.rings,`rings`,`ExtrudeSymbol3DLayer`);let d=M(l);if(d==null)return null;let f=[],p=[],h=v(),g=o(),x=m(),C=this._context.renderCoordsHelper.viewingMode===1;C||this._context.renderCoordsHelper.worldUpAtPosition(null,x),_(l.spatialReference,[d.x,d.y,0],g,this._context.renderCoordsHelper.spatialReference);let w=o();i(w,g);let T=r();n(T,w);let E=new Map,O=this._materials[0];if(this._context.clippingExtent&&(y(u.mapPositions,h),!b(h,this._context.clippingExtent))||u.polygonIndexCount===0&&u.outlineIndexCount===0)return;let j=this._getExtrusionSize(t),N=ee(u,{height:j,worldUp:x,spherical:C,requireElevation:!0,requireNormals:!0,requireSizes:!0});if(N==null)return;S(N.vertices,N.vertices,w);let F=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:c,layerViewUid:this._context.layerViewUid}),I=new le(N.vertices,N.elevation,U(N.normals),N.sizes),L=Y(O,N.indices,N.indices.length-N.bottomIndices.length,I,a,F),R=u.vertexCount,B=u.outlineSegmentCount*2,V=u.polygonIndexCount/3,H=new ue(R,B,V);if(Z(L,H,g),E.set(L,H),f.push(L),N.bottomIndices.length>0&&f.push(Y(this._materials[1],N.bottomIndices,0,I,a,F)),p.push(I.heights),f.length===0)return null;let W=new G({geometries:f,layerViewUid:this._context.layerViewUid,graphicUid:c,isElevationSource:!0});W.transformation=g;let K=te(this.symbolLayer,{opacity:this._getLayerOpacity()}),q=K?new k(this._materials[0],K,this._context.slicePlaneEnabled):null,J=new A(this,W,null,(e,t,n,r,i)=>re(e,t,n,r,i,p,E),s,q);return J.alignedSampledElevation=u.sampledElevation,J.needsElevationUpdates=D(s.mode),J}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){let e=this._materials[0];e&&e.setParameters({cullFace:e.transparent?0:2})}}function Y(e,t,n,r,i,a){let{attributeIndices:o,drawIndices:s}=ne(t),c=[[`position`,new B(r.positions,o,3,!0)],[`normalCompressed`,new B(r.normals,o,2,!0)]],l=null;return e.parameters.hasSymbolColors&&(l=x(o.length),c.push([`symbolColor`,new B(i,l,4,!0)])),a!=null&&(l??=x(o.length),N(c,a,l)),new V(e,c,r.elevation,n,null,s)}function ne(e){let t=[],n=new Map,r=[];for(let i=0;i<e.length;++i){let a=e[i],o=n.get(a);o??(o=t.length,t.push(a),n.set(a,o)),r.push(o)}return{attributeIndices:t,drawIndices:r}}const X=m();function re(e,t,n,r,i,c,l){let u=e.stageObject,d=u.geometries,p=d.length,m=t.mode!==`absolute-height`,h=0,g=u.transformation,_=a(o(),g);for(let e=0,t=0;e<p;++e){let a=d[e],o=l.get(a);if(!o||!H(a))continue;let p=a.getMutableAttribute(`position`).data,v=c[t++],y=new L(a.mapPositions),b=p.length/3,x=!1,S=0;{let e=0;for(let t=0;t<b;t++){X[0]=p[e],X[1]=p[e+1],X[2]=p[e+2],r(y,$),m&&(S+=$.sampledElevation),I.ENABLE_OPTIMIZATIONS?(s(Q,p[e],p[e+1],p[e+2]),f(Q,Q,g),i.setAltitude(Q,$.z+v[e/3]),f(Q,Q,_)):(s(Q,y.array[y.offset],y.array[y.offset+1],$.z+v[e/3]),n!=null&&i.toRenderCoords(Q,n,Q),f(Q,Q,_)),p[e]=Q[0],p[e+1]=Q[1],p[e+2]=Q[2];let t=ae/i.unitInMeters;(Math.abs(X[0]-p[e])>=t||Math.abs(X[1]-p[e+1])>=t||Math.abs(X[2]-p[e+2])>=t)&&(x=!0),y.offset+=3,e+=3}}if(x){Z(a,o,g),u.geometryVertexAttributeUpdated(d[e],`normalCompressed`),a.invalidateBoundingInfo(),u.geometryVertexAttributeUpdated(d[e],`position`);let t=d[e+1],n=!l.has(t);t&&n&&(t.invalidateBoundingInfo(),u.geometryVertexAttributeUpdated(t,`position`))}h+=S/b}return h/p}function Z(e,t,n){let r=e.getMutableAttribute(`normalCompressed`).data,i=e.readPrimitivePosition,{plateVertexCount:a,topFaceStart:o,topFaceCount:p}=t,m=o+p,h=oe,g=se,_=ce,v=ie,y=Q;s(y,0,0,0);let b=(e,t)=>{f(t,i(t,e),n)};for(let e=o;e<m;++e){let t=e*3;b(t,h[0]),b(t+1,h[1]),b(t+2,h[2]),c(g,h[1],h[0]),c(_,h[2],h[0]),l(v,g,_),u(y,y,v)}d(y,y);for(let e=0;e<a;++e){let t=y[0],n=y[1],i=y[2];W(r,e,-t,-n,-i),W(r,e+a,t,n,i)}}const Q=m(),ie=m(),$=new O,ae=.01,oe=[m(),m(),m()],se=m(),ce=m();class le{constructor(e,t,n,r){this.positions=e,this.elevation=t,this.normals=n,this.heights=r}}class ue{constructor(e,t,n){this.plateVertexCount=e,this.topFaceStart=t,this.topFaceCount=n}}export{J as Graphics3DExtrudeSymbolLayer};
2
+ import{clone as e}from"../../../../core/lang.js";import{estimateArrayMemory as t}from"../../../../core/memoryEstimations.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/units.js";import{normalFromMat4 as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as a,invertOrIdentity as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as c,sub as l,cross as u,add as d,normalize as f,transformMat4 as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ONES as m,create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g,ZEROS as _}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as v}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as y,fromBuffer as b,intersectsClippingArea as x}from"../../../../geometry/support/aaBoundingBox.js";import{getZeroIndexArray as S}from"../../../../geometry/support/Indices.js";import{t as C}from"../../../../chunks/vec3.js";import{SnappingCandidateVertex as w,SnappingCandidateEdge as T}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as E}from"../../../../renderers/support/renderingInfoUtils.js";import{isDrivenOpacityFallbackAlwaysOpaque as D}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{needsElevationUpdates3D as O,SampleElevationInfo as k}from"./elevationAlignmentUtils.js";import{extrudePolygon as A}from"./extrudePolygon.js";import{Object3DEdgeState as ee,Graphics3DObject3DGraphicLayer as j}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as M}from"./Graphics3DSymbolLayer.js";import{computeCentroid as N}from"./graphicUtils.js";import{addOlidAttribute as P}from"./olidUtils.js";import{geometryAsPolygon as te}from"./polygonUtils.js";import{createMaterial as ne}from"../support/edgeUtils.js";import{encodeNaNUInt8 as F}from"../support/symbolColorUtils.js";import{debugFlags as I}from"../../support/debugFlags.js";import{SamplePosition as L}from"../../support/ElevationProvider.js";import{loadTessellationUtils as R,preloadedPolygonToRenderInfoElevationAligned as z}from"../../support/renderInfoUtils/polygon.js";import{Attribute as B}from"../../webgl-engine/lib/Attribute.js";import{Geometry as V}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as H}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as re,compressNormal as U}from"../../webgl-engine/lib/Normals.js";import{Object3D as ie}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as W}from"../../webgl-engine/materials/DefaultMaterial.js";const G=[`polygon`,`extent`];class K extends M{constructor(e,t,n,r){super(e,t,n,r,D(t)),this.ensureDrapedStatus(!1)}async doLoad(){let e=this.symbolLayer,t=e?.material,n=this.symbolLayer.material?.color?.a,r=this._hasDrivenColorOrOpacity,i=this.needsDrivenTransparentPass||r&&n!=null&&n<1,a=t?.emissive,o=(a?.source===`color`?a?.strength:void 0)??0,s=!r&&(n==null||n===0),c=r?g:this._materialColor?.toUnitRGBA()??_,l={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,useIndexing:!0,ambient:m,diffuse:m,externalColor:c,opacity:+!s,layerOpacity:this._getLayerOpacity(),drivenOpacity:i,hasSymbolColors:r,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:e.castShadows,emissiveStrengthFromSymbol:o,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},u=new W(l,this._context),d=new W({...l,cullFace:2},this._context);this._materials[0]=u,this._materials[1]=d,this._updateTransparentDepedentMaterialParameters(),await R()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry,G,this.symbolLayer.type))return null;let n=this._getDrivenUInt8ColorWithNaNSupport(e.renderingInfo,this._materialColor,!1);F(n,n);let r=this.createElevationContextForGraphic(t);return this._createAs3DShape(t,e.renderingInfo,n,r,t.uid)}layerOpacityChanged(e,t){let n=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:n}),this._materials[1]?.setParameters({layerOpacity:n}),this._updateTransparentDepedentMaterialParameters(),e?.forEach(e=>t(e)?.layerOpacityChanged(n,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,O)}slicePlaneEnabledChanged(e,t){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e?.forEach(e=>{t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){let e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(e),this._materials[1]?.setParameters(e),!0}_getExtrusionSize(e){let t;return t=e.size&&this._drivenProperties.size?E(e.size.output,2)??0:this._getSymbolSize(),t/=this._context.renderCoordsHelper.unitInMeters,t}_containsRenderableGeometry(e){return`polygonIndexCount`in e&&`outlineIndexCount`in e?e.polygonIndexCount>0||e.outlineIndexCount>0:super._containsRenderableGeometry(e)}applyRendererDiff(e,t){return+!this._drivenPropertiesChanged(t)}async queryForSnapping(t,r,i,a){let o=this._getExtrusionSize(i)*this._context.renderCoordsHelper.unitInMeters/n(r),{objectId:s,target:c}=t,l=e(c);switch(l.z=(l.z??0)+o,t.type){case`edge`:{let{start:n,end:r}=t,i=e(n),a=e(r);return i.z=(i.z??0)+o,a.z=(a.z??0)+o,[new T(s,l,1/0,i,a)]}case`vertex`:return[new w(s,l,1/0),new T(s,c,1/0,c,l)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,n,o,c,l){let u=te(e.geometry);if(u==null)return null;if(u.rings.length===0||!u.rings.some(e=>e.length>0))return this._logGeometryValidationWarnings(u.rings,`rings`,`ExtrudeSymbol3DLayer`),null;let d=z(u,this._context.elevationProvider,this._context.renderCoordsHelper,c,{outlineOutput:`tessellated-indices`,owner:this._context.layer});if(d==null)return;this._logGeometryCreationWarnings(d,u.rings,`rings`,`ExtrudeSymbol3DLayer`);let f=N(u);if(f==null)return null;let p=[],m=[],g=y(),_=s(),S=h(),w=this._context.renderCoordsHelper.viewingMode===1;w||this._context.renderCoordsHelper.worldUpAtPosition(null,S),v(u.spatialReference,[f.x,f.y,0],_,this._context.renderCoordsHelper.spatialReference);let T=s();a(T,_);let E=i();r(E,T);let D=new Map,k=this._materials[0];if(this._context.clippingExtent&&(b(d.mapPositions,g),!x(g,this._context.clippingExtent))||d.polygonIndexCount===0&&d.outlineIndexCount===0)return;let M=this._getExtrusionSize(n),P=A(d,{height:M,worldUp:S,spherical:w,requireElevation:!0,requireNormals:!0,requireSizes:!0});if(P==null)return;C(P.vertices,P.vertices,T);let F=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:l,layerViewUid:this._context.layerViewUid}),I=new ue(P.vertices,P.elevation,re(P.normals),P.sizes),L=q(k,P.indices,P.indices.length-P.bottomIndices.length,I,o,F),R=d.vertexCount,B=d.outlineSegmentCount*2,V=d.polygonIndexCount/3,H=new de(R,B,V);if(X(L,H,_),D.set(L,H),p.push(L),P.bottomIndices.length>0&&p.push(q(this._materials[1],P.bottomIndices,0,I,o,F)),m.push(I.heights),p.length===0)return null;let U=new ie({geometries:p,layerViewUid:this._context.layerViewUid,graphicUid:l,isElevationSource:!0});U.transformation=_;let W=ne(this.symbolLayer,{opacity:this._getLayerOpacity()}),G=W?new ee(this._materials[0],W,this._context.slicePlaneEnabled):null,K=new j(this,U,null,(e,t,n,r,i)=>ae(e,t,n,r,i,m,D),c,G,m.reduce((e,n)=>e+t(n,8),0));return K.alignedSampledElevation=d.sampledElevation,K.needsElevationUpdates=O(c.mode),K}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){let e=this._materials[0];e&&e.setParameters({cullFace:e.transparent?0:2})}}function q(e,t,n,r,i,a){let{attributeIndices:o,drawIndices:s}=J(t),c=[[`position`,new B(r.positions,o,3,!0)],[`normalCompressed`,new B(r.normals,o,2,!0)]],l=null;return e.parameters.hasSymbolColors&&(l=S(o.length),c.push([`symbolColor`,new B(i,l,4,!0)])),a!=null&&(l??=S(o.length),P(c,a,l)),new V(e,c,r.elevation,n,null,s)}function J(e){if(e.length===0)return{attributeIndices:[],drawIndices:[]};let t=new Map,n=Array(e.length).fill(0);for(let r=0;r<e.length;++r){let i=e[r],a=t.get(i);a??(a=t.size,t.set(i,a)),n[r]=a}let r=Array(t.size).fill(0);for(let[e,n]of t)r[n]=e;return{attributeIndices:r,drawIndices:n}}const Y=h();function ae(e,t,n,r,i,a,l){let u=e.stageObject,d=u.geometries,f=d.length,m=t.mode!==`absolute-height`,h=0,g=u.transformation,_=o(s(),g);for(let e=0,t=0;e<f;++e){let o=d[e],s=l.get(o);if(!s||!H(o))continue;let f=o.getMutableAttribute(`position`).data,v=a[t++],y=new L(o.mapPositions),b=f.length/3,x=!1,S=0;{let e=0;for(let t=0;t<b;t++){Y[0]=f[e],Y[1]=f[e+1],Y[2]=f[e+2],r(y,Q),m&&(S+=Q.sampledElevation),I.ENABLE_OPTIMIZATIONS?(c(Z,f[e],f[e+1],f[e+2]),p(Z,Z,g),i.setAltitude(Z,Q.z+v[e/3]),p(Z,Z,_)):(c(Z,y.array[y.offset],y.array[y.offset+1],Q.z+v[e/3]),n!=null&&i.toRenderCoords(Z,n,Z),p(Z,Z,_)),f[e]=Z[0],f[e+1]=Z[1],f[e+2]=Z[2];let t=se/i.unitInMeters;(Math.abs(Y[0]-f[e])>=t||Math.abs(Y[1]-f[e+1])>=t||Math.abs(Y[2]-f[e+2])>=t)&&(x=!0),y.offset+=3,e+=3}}if(x){X(o,s,g),u.geometryVertexAttributeUpdated(d[e],`normalCompressed`),o.invalidateBoundingInfo(),u.geometryVertexAttributeUpdated(d[e],`position`);let t=d[e+1],n=!l.has(t);t&&n&&(t.invalidateBoundingInfo(),u.geometryVertexAttributeUpdated(t,`position`))}h+=S/b}return h/f}function X(e,t,n){let r=e.getMutableAttribute(`normalCompressed`).data,i=e.readPrimitivePosition,{plateVertexCount:a,topFaceStart:o,topFaceCount:s}=t,m=o+s,h=ce,g=le,_=$,v=oe,y=Z;c(y,0,0,0);let b=(e,t)=>{p(t,i(t,e),n)};for(let e=o;e<m;++e){let t=e*3;b(t,h[0]),b(t+1,h[1]),b(t+2,h[2]),l(g,h[1],h[0]),l(_,h[2],h[0]),u(v,g,_),d(y,y,v)}f(y,y);for(let e=0;e<a;++e){let t=y[0],n=y[1],i=y[2];U(r,e,-t,-n,-i),U(r,e+a,t,n,i)}}const Z=h(),oe=h(),Q=new k,se=.01,ce=[h(),h(),h()],le=h(),$=h();class ue{constructor(e,t,n,r){this.positions=e,this.elevation=t,this.normals=n,this.heights=r}}class de{constructor(e,t,n){this.plateVertexCount=e,this.topFaceStart=t,this.topFaceCount=n}}export{K as Graphics3DExtrudeSymbolLayer,J as remapIndicesToAttributeSubset};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{EventEmitter as n}from"../../../../core/Evented.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{projectPoint as a}from"../../../../geometry/projectionUtils.js";import{create as o}from"../../../../geometry/support/aaBoundingBox.js";import{getObjectId as s}from"../../../../layers/graphics/dehydratedFeatures.js";import{OptimizedFeature as c}from"../../../../layers/graphics/OptimizedFeature.js";import l from"../../../../layers/graphics/OptimizedGeometry.js";import{optimizedFeatureQueryEngineAdapter as u}from"../../../../layers/graphics/data/optimizedFeatureQueryEngineAdapter.js";const d=o();let f=class extends t{constructor(e){super(e),this.events=new n,this.hasZ=null,this.hasM=null,this.objectIdField=null,this.featureAdapter={getAttribute(e,t){return`graphic`in e?e.graphic.attributes[t]:u.getAttribute(e,t)},getAttributeAsTimestamp(e,t){let n=this.getAttribute(e,t);return typeof n==`number`?n:new Date(n).getTime()},getAttributes(e){return`graphic`in e?e.graphic.attributes:u.getAttributes(e)},getObjectId:e=>`graphic`in e?s(e.graphic,this.objectIdField)??void 0:u.getObjectId(e),getGeometry:e=>{if(`graphic`in e){let t=e.hasCachedOptimizedGeometry,n=e.getAsOptimizedGeometry(this.hasZ,this.hasM);return!t&&n!=null&&this.usedMemoryInvalidated(e),n}return u.getGeometry(e)},getCentroid:(e,t)=>{if(`graphic`in e){let n=null;e.centroid==null?e.graphic.geometry.type===`point`&&a(e.graphic.geometry,p,this.viewSpatialReference)&&(n=p):n=e.centroid;let r=Array(2+ +!!t.hasZ+ +!!t.hasM);return n==null?(r[0]=0,r[1]=0,r[2]=0,r[3]=0):(r[0]=n.x,r[1]=n.y,t.hasZ&&(r[2]=n.hasZ?n.z:0),t.hasM&&(r[t.hasZ?3:2]=n.hasM?n.m:0)),new l([],r,t.hasZ,t.hasM)}return u.getCentroid(e,t)},cloneWithGeometry:(e,t,n)=>`graphic`in e?new c(t,this.featureAdapter.getAttributes(e),null,this.featureAdapter.getObjectId(e)):u.cloneWithGeometry(e,t,n)}}forEachInBounds(e,t){this.getSpatialIndex().forEachInBounds(e,t)}forEachBounds(e,t){let n=this.getSpatialIndex();for(let r of e){let e=this.featureAdapter.getObjectId(r);n.getBounds(e,d)!=null&&t(d)}}};e([r({constructOnly:!0})],f.prototype,`getSpatialIndex`,void 0),e([r({constructOnly:!0})],f.prototype,`forEach`,void 0),e([r({constructOnly:!0})],f.prototype,`usedMemoryInvalidated`,void 0),e([r({constructOnly:!0})],f.prototype,`hasZ`,void 0),e([r({constructOnly:!0})],f.prototype,`hasM`,void 0),e([r({constructOnly:!0})],f.prototype,`objectIdField`,void 0),e([r({constructOnly:!0})],f.prototype,`viewSpatialReference`,void 0),e([r({constructOnly:!0})],f.prototype,`featureSpatialReference`,void 0),f=e([i(`esri.views.3d.layers.graphics.Graphics3DFeatureStore`)],f);const p={type:`point`,x:0,y:0,hasZ:!1,hasM:!1,spatialReference:null};export{f as Graphics3DFeatureStore};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{EventEmitter as n}from"../../../../core/Evented.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{projectPoint as a}from"../../../../geometry/projectionUtils.js";import{create as o}from"../../../../geometry/support/aaBoundingBox.js";import{getObjectId as s}from"../../../../layers/graphics/dehydratedFeatures.js";import{OptimizedFeature as c}from"../../../../layers/graphics/OptimizedFeature.js";import l from"../../../../layers/graphics/OptimizedGeometry.js";import{optimizedFeatureQueryEngineAdapter as u}from"../../../../layers/graphics/data/optimizedFeatureQueryEngineAdapter.js";const d=o();let f=class extends t{constructor(e){super(e),this.events=new n,this.hasZ=null,this.hasM=null,this.objectIdField=null,this.featureAdapter={getAttribute(e,t){return`graphic`in e?e.graphic.attributes[t]:u.getAttribute(e,t)},getAttributeAsTimestamp(e,t){let n=this.getAttribute(e,t);return typeof n==`number`?n:new Date(n).getTime()},getAttributes(e){return`graphic`in e?e.graphic.attributes:u.getAttributes(e)},getObjectId:e=>`graphic`in e?s(e.graphic,this.objectIdField)??void 0:u.getObjectId(e),getGeometry:e=>`graphic`in e?e.getAsOptimizedGeometry(this.hasZ,this.hasM):u.getGeometry(e),getCentroid:(e,t)=>{if(`graphic`in e){let n=null;e.centroid==null?e.graphic.geometry.type===`point`&&a(e.graphic.geometry,p,this.viewSpatialReference)&&(n=p):n=e.centroid;let r=Array(2+ +!!t.hasZ+ +!!t.hasM);return n==null?(r[0]=0,r[1]=0,r[2]=0,r[3]=0):(r[0]=n.x,r[1]=n.y,t.hasZ&&(r[2]=n.hasZ?n.z:0),t.hasM&&(r[t.hasZ?3:2]=n.hasM?n.m:0)),new l([],r,t.hasZ,t.hasM)}return u.getCentroid(e,t)},cloneWithGeometry:(e,t,n)=>`graphic`in e?new c(t,this.featureAdapter.getAttributes(e),null,this.featureAdapter.getObjectId(e)):u.cloneWithGeometry(e,t,n)}}forEachInBounds(e,t){this.getSpatialIndex().forEachInBounds(e,t)}forEachBounds(e,t){let n=this.getSpatialIndex();for(let r of e){let e=this.featureAdapter.getObjectId(r);n.getBounds(e,d)!=null&&t(d)}}};e([r({constructOnly:!0})],f.prototype,`getSpatialIndex`,void 0),e([r({constructOnly:!0})],f.prototype,`forEach`,void 0),e([r({constructOnly:!0})],f.prototype,`hasZ`,void 0),e([r({constructOnly:!0})],f.prototype,`hasM`,void 0),e([r({constructOnly:!0})],f.prototype,`objectIdField`,void 0),e([r({constructOnly:!0})],f.prototype,`viewSpatialReference`,void 0),e([r({constructOnly:!0})],f.prototype,`featureSpatialReference`,void 0),f=e([i(`esri.views.3d.layers.graphics.Graphics3DFeatureStore`)],f);const p={type:`point`,x:0,y:0,hasZ:!1,hasM:!1,spatialReference:null};export{f as Graphics3DFeatureStore};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{emptyArray as e}from"../../../../core/arrayUtils.js";import{forEach as t}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import n from"../../../../core/ObjectPool.js";import{scale as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scale as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../../geometry/Polygon.js";import{projectBoundingRect as c}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as l,expandWithAABB as u,allFinite as d,toRect as f,create as p,set as m,zero as h}from"../../../../geometry/support/aaBoundingBox.js";import{create as g,allFinite as _}from"../../../../geometry/support/aaBoundingRect.js";import{equals as v}from"../../../../geometry/support/spatialReferenceUtils.js";import{computeAABR as y,estimateSize as b}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromGeometry as x}from"../../../../layers/graphics/featureConversionUtils.js";const S=new n(()=>p(),e=>m(e,h),null,10,5),C=g();class w{get labelLayers(){return this._labelLayers||e}get usedMemory(){return this._usedMemory}get extent(){return this._extent}get isElevationSource(){return this.layers.some(e=>e?.isElevationSource)}constructor(e,t,n){this.graphic=e,this.graphics3DSymbol=t,this.layers=n,this._visibleFlags=255,this._usedMemory=0,++t.referenced,n.every(e=>e&&`hiddenIfDeconflicted`in e&&e.hiddenIfDeconflicted)&&(this._visibleFlags|=256)}initialize(e){this._layer=e,this._forEachSymbolLayerGraphic(t=>{t.initialize(e),T(this._visibleFlags,1,t)})}destroy(){this._forEachSymbolLayerGraphic(e=>e.destroy()),this._calloutLayer=null,--this.graphics3DSymbol.referenced,this.graphics3DSymbol=null}get destroyed(){return this.layers==null}clearLabelGraphics(){this._forEachLabelGraphic(e=>e.destroy()),this._labelLayers=null}addLabelGraphic(e,t){this._labelLayers||=[],this._labelLayers.push(e),e.initialize(t),T(this._visibleFlags,16,e)}setCalloutGraphic(e){this._calloutLayer=e,this._layer&&(e.initialize(this._layer),T(this._visibleFlags,1,e))}get calloutLayer(){return this._calloutLayer}get isDraped(){let e=!1;return this._forEachSymbolLayerGraphic(t=>{(t.type===`draped`||t.type===`draped-buffer`)&&(e=!0)}),e}isVisible(e=1,t=0){let n=this._visibleFlags;return E(n,e,t|t*16|(n&256?0:8))}setVisibilityFlag(e,t,n){let r=e*t;return n!==((this._visibleFlags&r)===r)&&(n?this._visibleFlags|=r:this._visibleFlags&=~r,e===1&&this._forEachSymbolLayerGraphic(e=>T(this._visibleFlags,1,e)),this._forEachLabelGraphic(e=>T(this._visibleFlags,16,e)),!0)}getVisibilityFlag(e,t){return(this._visibleFlags&e*t)!==0}computeExtent(e){if(!this._extent){let t=this.graphic.geometry;if(t==null)return!1;this._extent=g(),y(t,this._extent);let n=t.spatialReference;if(!v(n,e)&&!c(this._extent,n,this._extent,e))return this._extent=null,!1}return!0}get hasCachedOptimizedGeometry(){return this._optimizedGeometry!=null}getAsOptimizedGeometry(e,t){return this._optimizedGeometry||=this._convertGraphicToOptimizedGeometry(this.graphic,e,t),this._optimizedGeometry}updateUsedMemory(e){let t=(e?b(this.graphic):0)+(this._optimizedGeometry?.usedMemory??0);this._forEachSymbolLayerGraphic(e=>t+=e.usedMemory);let n=t-this._usedMemory;return this._usedMemory=t,n}_convertGraphicToOptimizedGeometry(e,t,n){let r=e.geometry;return(r.type===`mesh`||r.type===`extent`)&&(r=s.fromExtent(r.type===`mesh`?r.extent:r)),x(r,t,n)}computeAttachmentOrigin(){let e={render:{origin:o(),num:0},draped:{origin:i(),num:0}};for(let t of this.layers)t?.computeAttachmentOrigin(e);return e.render.num>1&&a(e.render.origin,e.render.origin,1/e.render.num),e.draped.num>1&&r(e.draped.origin,e.draped.origin,1/e.draped.num),e}async getProjectedBoundingBox(e,n,r,i,a){return a||={boundingBox:null,requiresDrapedElevation:!1,screenSpaceObjects:[]},a.boundingBox?l(a.boundingBox):a.boundingBox=l(),a.requiresDrapedElevation=!1,await t(this.layers,async t=>{if(t==null)return;let o=t.type===`draped`||t.type===`draped-buffer`?n:e,s=S.acquire(),c=await t.getProjectedBoundingBox(o,r,a.screenSpaceObjects,i,s);isFinite(c[2])&&isFinite(c[5])||(a.requiresDrapedElevation=!0),c&&u(a.boundingBox,s),S.release(s)}),d(a.boundingBox)||_(f(a.boundingBox,C))?a:null}needsElevationUpdates(){for(let e of this.layers)if(e!=null&&(e.type===`object3d`||e.type===`buffer`||e.type===`lod-instance`)&&e.needsElevationUpdates)return!0;return this._labelLayers?.some(e=>e?.needsElevationUpdates??!1)??!1}alignWithElevation(e,t,n){this._forEachRenderedGraphic(r=>{(r.type===`object3d`||r.type===`buffer`||r.type===`lod-instance`)&&r.alignWithElevation(e,t,n)})}alignWithAbsoluteElevation(e,t,n){this._forEachRenderedGraphic(r=>{(r.type===`object3d`||r.type===`buffer`)&&r.alignWithAbsoluteElevation(e,t,n)})}addObjectStateSet(e){this._forEachSymbolLayerGraphic(t=>t.addObjectState(e))}removeObjectState(e){this._forEachSymbolLayerGraphic(t=>t.removeObjectState(e))}updateHighlights(e){this._forEachSymbolLayerGraphic(t=>t.updateHighlights(e))}_forEachGraphicList(e,t){e?.forEach(e=>e&&t(e))}_forEachSymbolLayerGraphic(e){this._forEachGraphicList(this.layers,e),this._calloutLayer&&e(this._calloutLayer)}_forEachLabelGraphic(e){this._forEachGraphicList(this.labelLayers,e)}_forEachRenderedGraphic(e){this._forEachSymbolLayerGraphic(e),this._forEachLabelGraphic(e)}get test(){}}function T(e,t,n){let r=t===1?`hiddenIfDeconflicted`in n&&n.hiddenIfDeconflicted?0:8:e&256?0:8;n.setVisibility(E(e,t,r))}function E(e,t,n=0){let r=(t===1?15:255)&~n;return(e&r)===r}export{w as Graphics3DGraphic};
2
+ import{emptyArray as e}from"../../../../core/arrayUtils.js";import{forEach as t}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import n from"../../../../core/ObjectPool.js";import{scale as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scale as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import s from"../../../../geometry/Polygon.js";import{projectBoundingRect as c}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as l,expandWithAABB as u,allFinite as d,toRect as f,create as p,set as m,zero as h}from"../../../../geometry/support/aaBoundingBox.js";import{create as g,allFinite as _}from"../../../../geometry/support/aaBoundingRect.js";import{equals as v}from"../../../../geometry/support/spatialReferenceUtils.js";import{computeAABR as y,estimateSize as b}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromGeometry as x}from"../../../../layers/graphics/featureConversionUtils.js";const S=new n(()=>p(),e=>m(e,h),null,10,5),C=g();class w{get labelLayers(){return this._labelLayers||e}get usedMemory(){return this._usedMemory}get extent(){return this._extent}get isElevationSource(){return this.layers.some(e=>e?.isElevationSource)}constructor(e,t,n,r=!0){this.graphic=e,this.graphics3DSymbol=t,this.layers=n,this._reportGraphicSourceMemory=r,this._visibleFlags=255,this._usedMemory=0,this._notifyMemoryChange=e=>{this._usedMemory+=e,this.notifyMemoryChange?.(e)},++t.referenced,n.every(e=>e&&`hiddenIfDeconflicted`in e&&e.hiddenIfDeconflicted)&&(this._visibleFlags|=256),this._forEachSymbolLayerGraphic(e=>e.setNotifyMemoryChange(this._notifyMemoryChange)),this._updateUsedMemory()}initialize(e){this._layer=e,this._forEachSymbolLayerGraphic(t=>{t.initialize(e),T(this._visibleFlags,1,t)})}destroy(){this.notifyMemoryChange=void 0,this._forEachSymbolLayerGraphic(e=>{e.setNotifyMemoryChange(void 0),e.destroy()}),this._calloutLayer=null,this._updateUsedMemory(),--this.graphics3DSymbol.referenced,this.graphics3DSymbol=null}get destroyed(){return this.layers==null}clearLabelGraphics(){this._forEachLabelGraphic(e=>e.destroy()),this._labelLayers=null}addLabelGraphic(e,t){this._labelLayers||=[],this._labelLayers.push(e),e.initialize(t),T(this._visibleFlags,16,e)}setCalloutGraphic(e){this._calloutLayer&&this._calloutLayer.setNotifyMemoryChange(void 0);let t=e.usedMemory-(this._calloutLayer?.usedMemory??0);this._calloutLayer=e,e.setNotifyMemoryChange(this._notifyMemoryChange),t&&this._notifyMemoryChange(t),this._layer&&(e.initialize(this._layer),T(this._visibleFlags,1,e))}get calloutLayer(){return this._calloutLayer}get isDraped(){let e=!1;return this._forEachSymbolLayerGraphic(t=>{(t.type===`draped`||t.type===`draped-buffer`)&&(e=!0)}),e}isVisible(e=1,t=0){let n=this._visibleFlags;return E(n,e,t|t*16|(n&256?0:8))}setVisibilityFlag(e,t,n){let r=e*t;return n!==((this._visibleFlags&r)===r)&&(n?this._visibleFlags|=r:this._visibleFlags&=~r,e===1&&this._forEachSymbolLayerGraphic(e=>T(this._visibleFlags,1,e)),this._forEachLabelGraphic(e=>T(this._visibleFlags,16,e)),!0)}getVisibilityFlag(e,t){return(this._visibleFlags&e*t)!==0}computeExtent(e){if(!this._extent){let t=this.graphic.geometry;if(t==null)return!1;this._extent=g(),y(t,this._extent);let n=t.spatialReference;if(!v(n,e)&&!c(this._extent,n,this._extent,e))return this._extent=null,!1}return!0}get hasCachedOptimizedGeometry(){return this._optimizedGeometry!=null}getAsOptimizedGeometry(e,t){return this._optimizedGeometry||(this._optimizedGeometry=this._convertGraphicToOptimizedGeometry(this.graphic,e,t),this._optimizedGeometry&&this._notifyMemoryChange(this._optimizedGeometry.usedMemory)),this._optimizedGeometry}updateAttributes(){this._updateUsedMemory()}updateGeometry(){return this.graphics3DSymbol.updateGeometry(this)?(this._updateUsedMemory(),!0):!1}_updateUsedMemory(){let e=(this._reportGraphicSourceMemory?b(this.graphic):0)+(this._optimizedGeometry?.usedMemory??0);this._forEachSymbolLayerGraphic(t=>e+=t.usedMemory);let t=e-this._usedMemory;t&&this._notifyMemoryChange(t)}_convertGraphicToOptimizedGeometry(e,t,n){let r=e.geometry;return(r.type===`mesh`||r.type===`extent`)&&(r=s.fromExtent(r.type===`mesh`?r.extent:r)),x(r,t,n)}computeAttachmentOrigin(){let e={render:{origin:o(),num:0},draped:{origin:i(),num:0}};for(let t of this.layers)t?.computeAttachmentOrigin(e);return e.render.num>1&&a(e.render.origin,e.render.origin,1/e.render.num),e.draped.num>1&&r(e.draped.origin,e.draped.origin,1/e.draped.num),e}async getProjectedBoundingBox(e,n,r,i,a){return a||={boundingBox:null,requiresDrapedElevation:!1,screenSpaceObjects:[]},a.boundingBox?l(a.boundingBox):a.boundingBox=l(),a.requiresDrapedElevation=!1,await t(this.layers,async t=>{if(t==null)return;let o=t.type===`draped`||t.type===`draped-buffer`?n:e,s=S.acquire(),c=await t.getProjectedBoundingBox(o,r,a.screenSpaceObjects,i,s);isFinite(c[2])&&isFinite(c[5])||(a.requiresDrapedElevation=!0),c&&u(a.boundingBox,s),S.release(s)}),d(a.boundingBox)||_(f(a.boundingBox,C))?a:null}needsElevationUpdates(){for(let e of this.layers)if(e!=null&&(e.type===`object3d`||e.type===`buffer`||e.type===`lod-instance`)&&e.needsElevationUpdates)return!0;return this._labelLayers?.some(e=>e?.needsElevationUpdates??!1)??!1}alignWithElevation(e,t,n){this._forEachRenderedGraphic(r=>{(r.type===`object3d`||r.type===`buffer`||r.type===`lod-instance`)&&r.alignWithElevation(e,t,n)})}alignWithAbsoluteElevation(e,t,n){this._forEachRenderedGraphic(r=>{(r.type===`object3d`||r.type===`buffer`)&&r.alignWithAbsoluteElevation(e,t,n)})}addObjectStateSet(e){this._forEachSymbolLayerGraphic(t=>t.addObjectState(e))}removeObjectState(e){this._forEachSymbolLayerGraphic(t=>t.removeObjectState(e))}updateHighlights(e){this._forEachSymbolLayerGraphic(t=>t.updateHighlights(e))}_forEachGraphicList(e,t){e?.forEach(e=>e&&t(e))}_forEachSymbolLayerGraphic(e){this._forEachGraphicList(this.layers,e),this._calloutLayer&&e(this._calloutLayer)}_forEachLabelGraphic(e){this._forEachGraphicList(this.labelLayers,e)}_forEachRenderedGraphic(e){this._forEachSymbolLayerGraphic(e),this._forEachLabelGraphic(e)}get test(){}}function T(e,t,n){let r=t===1?`hiddenIfDeconflicted`in n&&n.hiddenIfDeconflicted?0:8:e&256?0:8;n.setVisibility(E(e,t,r))}function E(e,t,n=0){let r=(t===1?15:255)&~n;return(e&r)===r}export{w as Graphics3DGraphic};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- class e{constructor(e,t,n){this.graphic=e,this.renderingInfo=t,this.layer=n}}export{e as Graphics3DGraphicCreationContext};
2
+ class e{constructor(e,t,n,r){this.graphic=e,this.renderingInfo=t,this.layer=n,this.reportGraphicSourceMemory=r}}export{e as Graphics3DGraphicCreationContext};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as t,set as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as i,expandWithVec3 as a,create as o,isPoint as s,center as c,offset as l}from"../../../../geometry/support/aaBoundingBox.js";import{evaluateElevationInfoAtPoint as u}from"./elevationAlignmentUtils.js";import{demResolutionForBoundingBox as d}from"./graphicUtils.js";import{Object3DHighlightStateID as f}from"../../webgl-engine/lib/Object3DStateID.js";class p{constructor(e,t,n,r,i){this.graphics3DSymbolLayer=e,this.instanceIndex=t,this.elevationAligner=n,this.elevationContext=r,this._highlightOrderMap=i,this.type=`lod-instance`,this._highlights=new Set,this.alignedSampledElevation=0,this.isElevationSource=!1,this.needsElevationUpdates=!1,this._highlightName=null}initialize(){}setVisibility(e){let{instanceData:t}=this;e!==t.getVisible(this.instanceIndex)&&t.setVisible(this.instanceIndex,e)}destroy(){this.instanceIndex!=null&&(this.instanceData.removeInstance(this.instanceIndex),this.graphics3DSymbolLayer.notifyDestroyGraphicLayer(this))}get usedMemory(){return this.graphics3DSymbolLayer.usedMemory}alignWithElevation(e,t){if(this.elevationAligner){let n=this.elevationAligner(this,this.elevationContext,e.spatialReference,(n,r)=>u(n,e,this.elevationContext,t,r),t);n!=null&&(this.alignedSampledElevation=n)}}getCenterObjectSpace(e=r()){return this.instanceData.getCombinedLocalTransform(this.instanceIndex,v),t(e,this._lodRenderer.baseBoundingSphere.center,v)}getBoundingBoxObjectSpace(e=o()){this.instanceData.getCombinedLocalTransform(this.instanceIndex,v);let r=this._lodRenderer.baseBoundingBox;i(e);for(let i=0;i<8;++i)n(h,i&1?r[3]:r[0],i&2?r[4]:r[1],i&4?r[5]:r[2]),t(h,h,v),a(e,h);return e}computeAttachmentOrigin(e){this.instanceData.getGlobalTransform(this.instanceIndex,v),e.render.origin[0]+=v[12],e.render.origin[1]+=v[13],e.render.origin[2]+=v[14],e.render.num++}async getProjectedBoundingBox(e,n,r,a,o){let u=this.getBoundingBoxObjectSpace(o),f=_,p=s(u)?1:f.length;this.instanceData.getGlobalTransform(this.instanceIndex,v);for(let e=0;e<p;e++){let n=f[e];h[0]=u[n[0]],h[1]=u[n[1]],h[2]=u[n[2]],t(h,h,v),m[e*3]=h[0],m[e*3+1]=h[1],m[e*3+2]=h[2]}if(!e(m,0,p))return null;i(u);let y=null;this.calculateRelativeScreenBounds&&(y=this.calculateRelativeScreenBounds());for(let e=0;e<p*3;e+=3){for(let t=0;t<3;t++)u[t]=Math.min(u[t],m[e+t]),u[t+3]=Math.max(u[t+3],m[e+t]);y&&r.push({location:m.slice(e,e+3),screenSpaceBoundingRect:y})}if(n&&(c(u,g),this.elevationContext.mode!==`absolute-height`)){let e,t=d(u,n.service.spatialReference,n);try{e=await n.service.queryElevation(g[0],g[1],a,t,`ground`)}catch{}e!=null&&l(u,0,0,-this.alignedSampledElevation+e)}return u}addObjectState(e){e.stateType===0&&this.addObjectHighlightState(e)}addObjectHighlightState(e){let t=new f(e.highlightName);this._addHighlightId(t),e.addExternal(e=>{this._removeHighlightId(e)},t)}removeObjectState(e){this._highlights.forEach(t=>e.remove(t))}updateHighlights(e){this._highlightOrderMap=e,this._updateHighlightOptions()}_calculateHighlightOptions(){let e=-1,t=null;return this._highlights.forEach(({highlightName:n})=>{let r=this._highlightOrderMap.get(n);r!==void 0&&r>e&&(e=r,t=n)}),t}_addHighlightId(e){this._highlights.add(e),this._updateHighlightOptions()}_removeHighlightId(e){this._highlights.delete(e),this._updateHighlightOptions()}_updateHighlightOptions(){let e=this._calculateHighlightOptions();e!==this._highlightName&&(this._highlightName=e,this.instanceData.setHighlight(this.instanceIndex,e))}get _lodRenderer(){return this.graphics3DSymbolLayer.lodRenderer}get instanceData(){return this._lodRenderer.instanceData}}const m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=r(),g=r(),_=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]],v=e();export{p as Graphics3DLodInstanceGraphicLayer};
2
+ import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as t,set as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as i,expandWithVec3 as a,create as o,isPoint as s,center as c,offset as l}from"../../../../geometry/support/aaBoundingBox.js";import{evaluateElevationInfoAtPoint as u}from"./elevationAlignmentUtils.js";import{demResolutionForBoundingBox as d}from"./graphicUtils.js";import{Object3DHighlightStateID as f}from"../../webgl-engine/lib/Object3DStateID.js";class p{constructor(e,t,n,r,i){this.graphics3DSymbolLayer=e,this.instanceIndex=t,this.elevationAligner=n,this.elevationContext=r,this._highlightOrderMap=i,this.type=`lod-instance`,this._highlights=new Set,this.alignedSampledElevation=0,this.isElevationSource=!1,this.needsElevationUpdates=!1,this._highlightName=null}initialize(){}setVisibility(e){let{instanceData:t}=this;e!==t.getVisible(this.instanceIndex)&&t.setVisible(this.instanceIndex,e)}destroy(){this.instanceIndex!=null&&(this.instanceData.removeInstance(this.instanceIndex),this.graphics3DSymbolLayer.notifyDestroyGraphicLayer(this))}get usedMemory(){return this.graphics3DSymbolLayer.usedMemory}setNotifyMemoryChange(e){}alignWithElevation(e,t){if(this.elevationAligner){let n=this.elevationAligner(this,this.elevationContext,e.spatialReference,(n,r)=>u(n,e,this.elevationContext,t,r),t);n!=null&&(this.alignedSampledElevation=n)}}getCenterObjectSpace(e=r()){return this.instanceData.getCombinedLocalTransform(this.instanceIndex,v),t(e,this._lodRenderer.baseBoundingSphere.center,v)}getBoundingBoxObjectSpace(e=o()){this.instanceData.getCombinedLocalTransform(this.instanceIndex,v);let r=this._lodRenderer.baseBoundingBox;i(e);for(let i=0;i<8;++i)n(h,i&1?r[3]:r[0],i&2?r[4]:r[1],i&4?r[5]:r[2]),t(h,h,v),a(e,h);return e}computeAttachmentOrigin(e){this.instanceData.getGlobalTransform(this.instanceIndex,v),e.render.origin[0]+=v[12],e.render.origin[1]+=v[13],e.render.origin[2]+=v[14],e.render.num++}async getProjectedBoundingBox(e,n,r,a,o){let u=this.getBoundingBoxObjectSpace(o),f=_,p=s(u)?1:f.length;this.instanceData.getGlobalTransform(this.instanceIndex,v);for(let e=0;e<p;e++){let n=f[e];h[0]=u[n[0]],h[1]=u[n[1]],h[2]=u[n[2]],t(h,h,v),m[e*3]=h[0],m[e*3+1]=h[1],m[e*3+2]=h[2]}if(!e(m,0,p))return null;i(u);let y=null;this.calculateRelativeScreenBounds&&(y=this.calculateRelativeScreenBounds());for(let e=0;e<p*3;e+=3){for(let t=0;t<3;t++)u[t]=Math.min(u[t],m[e+t]),u[t+3]=Math.max(u[t+3],m[e+t]);y&&r.push({location:m.slice(e,e+3),screenSpaceBoundingRect:y})}if(n&&(c(u,g),this.elevationContext.mode!==`absolute-height`)){let e,t=d(u,n.service.spatialReference,n);try{e=await n.service.queryElevation(g[0],g[1],a,t,`ground`)}catch{}e!=null&&l(u,0,0,-this.alignedSampledElevation+e)}return u}addObjectState(e){e.stateType===0&&this.addObjectHighlightState(e)}addObjectHighlightState(e){let t=new f(e.highlightName);this._addHighlightId(t),e.addExternal(e=>{this._removeHighlightId(e)},t)}removeObjectState(e){this._highlights.forEach(t=>e.remove(t))}updateHighlights(e){this._highlightOrderMap=e,this._updateHighlightOptions()}_calculateHighlightOptions(){let e=-1,t=null;return this._highlights.forEach(({highlightName:n})=>{let r=this._highlightOrderMap.get(n);r!==void 0&&r>e&&(e=r,t=n)}),t}_addHighlightId(e){this._highlights.add(e),this._updateHighlightOptions()}_removeHighlightId(e){this._highlights.delete(e),this._updateHighlightOptions()}_updateHighlightOptions(){let e=this._calculateHighlightOptions();e!==this._highlightName&&(this._highlightName=e,this.instanceData.setHighlight(this.instanceIndex,e))}get _lodRenderer(){return this.graphics3DSymbolLayer.lodRenderer}get instanceData(){return this._lodRenderer.instanceData}}const m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=r(),g=r(),_=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]],v=e();export{p as Graphics3DLodInstanceGraphicLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{getTranslation as e,multiply as t,invert as n,copy as r,fromTranslation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as a,create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{perObjectElevationAligner as l}from"./ElevationAligners.js";import{evaluateElevationInfoAtPoint as u}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as d}from"./Graphics3DObject3DGraphicLayer.js";import{meshAutoFastUpdateConstants as f}from"./meshAutoFastUpdateConstants.js";class p extends d{constructor(){super(...arguments),this.fastTransformUpdatesAllowed=!1,this._originalGeometries=[],this._fastTransformUpdatesEnabled=!1,this._autoDisableFastUpdatesTimeoutId=0}get fastTransformUpdatesEnabled(){return this._fastTransformUpdatesEnabled}destroy(){super.destroy(),this._cancelAutoDisableFastUpdates()}enableFastTransformUpdates(t,n){if(!this.fastTransformUpdatesAllowed||this._fastTransformUpdatesEnabled)return;this._cancelAutoDisableFastUpdates(),this._fastTransformUpdatesEnabled=!0;let{stageObject:r}=this,i=r.geometries.slice();r.removeAllGeometries();let a=e(m,r.transformation),o=n.getOrigin(a);for(let e of i){let n=t(e.material),i=e.instantiate({material:n});i.localOrigin=o,r.addGeometry(i)}this._originalGeometries=i}autoDisableFastTransformUpdates(e){this._cancelAutoDisableFastUpdates(),this._autoDisableFastUpdatesTimeoutId=setTimeout(()=>{this._autoDisableFastUpdatesTimeoutId=0,e()},f.disableDelayMs)}updateAutoDisableFastTransformUpdates(e){this._autoDisableFastUpdatesTimeoutId&&this.autoDisableFastTransformUpdates(e)}_cancelAutoDisableFastUpdates(){clearTimeout(this._autoDisableFastUpdatesTimeoutId),this._autoDisableFastUpdatesTimeoutId=0}disableFastTransformUpdates(e){if(!this._fastTransformUpdatesEnabled)return;this._cancelAutoDisableFastUpdates(),this._fastTransformUpdatesEnabled=!1;let{stageObject:t}=this,n=t.geometries.length>0?t.geometries[0].localOrigin:void 0,r=t.geometries.map(t=>e(t.material));t.removeAllGeometries();for(let e=0;e<this._originalGeometries.length;e++){let i=this._originalGeometries[e],a=r[e];a.setParameters({modelTransformation:null}),i.localOrigin!=null&&(i.localOrigin=n),a===i.material?t.addGeometry(i):t.addGeometry(i.instantiate({material:a}))}this._originalGeometries.length=0}updateFastLocalOrigin(t,n,r,i=!0){if(!this._fastTransformUpdatesEnabled)return;let{stageObject:o}=this;if(o.geometries.length===0)return;let s=o.geometries[0].localOrigin,c=e(m,t);if(s&&!i&&!r.needsOriginUpdate(s,c,o.boundingVolumeWorldSpace.sphere.radius*2))return;let l=r.getOrigin(c);if(l===s)return;let u=n?.localMatrix??a;o.shaderTransformation=null,o.transformation=t,o.geometries.forEach(e=>{e.transformation=u,e.localOrigin=l})}updateTransform(e,r,i){let{stageObject:o}=this,s=r?.localMatrix??a;if(!this._fastTransformUpdatesEnabled){o.shaderTransformation=null,o.transformation=e,o.geometries.forEach(e=>e.transformation=s),this._updateEdgeTransform(i);return}let c=o.transformation,l=o.geometries[0].transformation,u=e,d=s,f=t(h,c,l),p=t(g,u,d);o.shaderTransformation=t(v,p,n(v,l)),this._setFastMaterialTransformation({matA:f,matB:p}),this._updateEdgeTransform(i)}alignWithElevation(e,n,i){if(!this._fastTransformUpdatesEnabled){super.alignWithElevation(e,n,i);return}let a=(t,r)=>u(t,e,this.elevationContext,n,r),{stageObject:o}=this;if(!o.geometries[0].material.parameters.modelTransformation)return;let s=o.transformation,c=o.geometries[0].transformation,d=t(h,s,c),f=o.effectiveTransformation,p=r(_,f);this.alignedSampledElevation=l(this,this.elevationContext,e.spatialReference,a,n,p),o.shaderTransformation=p;let m=o.geometries[0].transformation,v=t(g,p,m);this._setFastMaterialTransformation({matA:d,matB:v}),this._updateEdgeTransform(i)}_setFastMaterialTransformation({matA:e,matB:r}){let{stageObject:a}=this;if(a.geometries.length===0)return;let o=a.geometries[0].localOrigin,c=i(x,s(m,o.vec3,-1)),l=t(y,c,e),u=t(b,c,r),d=n(y,l),f=t(b,u,d);for(let e of a.geometries)e.material.setParameters({modelTransformation:f})}_updateEdgeTransform(e){let{stageObject:t,_stageLayer:n}=this;n.stage.renderer.withEdgeView(n=>{n.fastUpdateObject3DEdgesTransform(t)||this.resetEdgeObject(e)})}}const m=c(),h=o(),g=o(),_=o(),v=o(),y=o(),b=o(),x=o();export{p as Graphics3DMeshObject3DGraphicLayer};
2
+ import{getTranslation as e,multiply as t,invert as n,copy as r,fromTranslation as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as a,create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{perObjectElevationAligner as l}from"./ElevationAligners.js";import{evaluateElevationInfoAtPoint as u}from"./elevationAlignmentUtils.js";import{Graphics3DObject3DGraphicLayer as d}from"./Graphics3DObject3DGraphicLayer.js";import{meshAutoFastUpdateConstants as f}from"./meshAutoFastUpdateConstants.js";class p extends d{constructor(){super(...arguments),this.fastTransformUpdatesAllowed=!1,this._originalGeometries=[],this._fastTransformUpdatesEnabled=!1,this._autoDisableFastUpdatesTimeoutId=0}get fastTransformUpdatesEnabled(){return this._fastTransformUpdatesEnabled}destroy(){super.destroy(),this._cancelAutoDisableFastUpdates()}enableFastTransformUpdates(t,n){if(!this.fastTransformUpdatesAllowed||this._fastTransformUpdatesEnabled)return;this._cancelAutoDisableFastUpdates(),this._fastTransformUpdatesEnabled=!0;let{stageObject:r}=this,i=r.geometries.slice(),a=e(m,r.transformation),o=n.getOrigin(a),s=i.map(e=>{let n=t(e.material),r=e.instantiate({material:n});return r.localOrigin=o,r});r.replaceGeometries(s),this._originalGeometries=i}autoDisableFastTransformUpdates(e){this._cancelAutoDisableFastUpdates(),this._autoDisableFastUpdatesTimeoutId=setTimeout(()=>{this._autoDisableFastUpdatesTimeoutId=0,e()},f.disableDelayMs)}updateAutoDisableFastTransformUpdates(e){this._autoDisableFastUpdatesTimeoutId&&this.autoDisableFastTransformUpdates(e)}_cancelAutoDisableFastUpdates(){clearTimeout(this._autoDisableFastUpdatesTimeoutId),this._autoDisableFastUpdatesTimeoutId=0}disableFastTransformUpdates(e){if(!this._fastTransformUpdatesEnabled)return;this._cancelAutoDisableFastUpdates(),this._fastTransformUpdatesEnabled=!1;let{stageObject:t}=this,n=t.geometries.length>0?t.geometries[0].localOrigin:void 0,r=t.geometries.map(t=>e(t.material)),i=this._originalGeometries.map((e,t)=>{let i=r[t];return i.setParameters({modelTransformation:null}),e.localOrigin!=null&&(e.localOrigin=n),i===e.material?e:e.instantiate({material:i})});t.replaceGeometries(i),this._originalGeometries.length=0}updateFastLocalOrigin(t,n,r,i=!0){if(!this._fastTransformUpdatesEnabled)return;let{stageObject:o}=this;if(o.geometries.length===0)return;let s=o.geometries[0].localOrigin,c=e(m,t);if(s&&!i&&!r.needsOriginUpdate(s,c,o.boundingVolumeWorldSpace.sphere.radius*2))return;let l=r.getOrigin(c);if(l===s)return;let u=n?.localMatrix??a;o.shaderTransformation=null,o.transformation=t,o.geometries.forEach(e=>{e.transformation=u,e.localOrigin=l})}updateTransform(e,r,i){let{stageObject:o}=this,s=r?.localMatrix??a;if(!this._fastTransformUpdatesEnabled){o.shaderTransformation=null,o.transformation=e,o.geometries.forEach(e=>e.transformation=s),this._updateEdgeTransform(i);return}let c=o.transformation,l=o.geometries[0].transformation,u=e,d=s,f=t(h,c,l),p=t(g,u,d);o.shaderTransformation=t(v,p,n(v,l)),this._setFastMaterialTransformation({matA:f,matB:p}),this._updateEdgeTransform(i)}alignWithElevation(e,n,i){if(!this._fastTransformUpdatesEnabled){super.alignWithElevation(e,n,i);return}let a=(t,r)=>u(t,e,this.elevationContext,n,r),{stageObject:o}=this;if(!o.geometries[0].material.parameters.modelTransformation)return;let s=o.transformation,c=o.geometries[0].transformation,d=t(h,s,c),f=o.effectiveTransformation,p=r(_,f);this.alignedSampledElevation=l(this,this.elevationContext,e.spatialReference,a,n,p),o.shaderTransformation=p;let m=o.geometries[0].transformation,v=t(g,p,m);this._setFastMaterialTransformation({matA:d,matB:v}),this._updateEdgeTransform(i)}_setFastMaterialTransformation({matA:e,matB:r}){let{stageObject:a}=this;if(a.geometries.length===0)return;let o=a.geometries[0].localOrigin,c=i(x,s(m,o.vec3,-1)),l=t(y,c,e),u=t(b,c,r),d=n(y,l),f=t(b,u,d);for(let e of a.geometries)e.material.setParameters({modelTransformation:f})}_updateEdgeTransform(e){let{stageObject:t,_stageLayer:n}=this;n.stage.renderer.withEdgeView(n=>{n.fastUpdateObject3DEdgesTransform(t)||this.resetEdgeObject(e)})}}const m=c(),h=o(),g=o(),_=o(),v=o(),y=o(),b=o(),x=o();export{p as Graphics3DMeshObject3DGraphicLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{Graphics3DStageObjectGraphicLayer as e}from"./Graphics3DStageObjectGraphicLayer.js";class t{constructor(e,t,n){this.baseMaterial=e,this.edgeMaterial=t,this.hasSlicePlane=n}}class n extends e{get useObjectOriginAsAttachmentOrigin(){return this._getFlag(4)}set useObjectOriginAsAttachmentOrigin(e){this._setFlag(4,e)}constructor(e,t,n,r,i,a=null){super(e,t,n,i),this.elevationAligner=r,this._edgeState=a,this.type=`object3d`}_disposeStageObject(){this._stageLayer?.stage.renderer.edgeView?.removeObject(this.stageObject),super._disposeStageObject()}layerOpacityChanged(e,t){let{stageObject:n,_edgeState:i,_stageLayer:a}=this;if(i==null)return;let o=r(i.baseMaterial);i.edgeMaterial.objectTransparency!==o&&(i.edgeMaterial.objectTransparency=o,this.resetEdgeObject(t)),a.stage.renderer.withEdgeView(t=>t.updateAllComponentOpacities(n,[e]))}updateMaterial(e){this.stageObject.geometries.map(t=>t.instantiate({material:e})).forEach(e=>{this.stageObject.addGeometry(e),this.stageObject.removeGeometry(0)})}slicePlaneEnabledChanged(e,t){let{stageObject:n,_edgeState:r,_stageLayer:i}=this;r!=null&&i.stage.renderer.withEdgeView(i=>{i.updateAllComponentMaterials(n,r.edgeMaterial,e,!t),r.hasSlicePlane=e})}setVisibility(e){let{_edgeState:t,stageObject:n,_stageLayer:r}=this;r!=null&&this.visible!==e&&(super.setVisibility(e),t!=null&&r.stage.renderer.withEdgeView(r=>{r.hasObject(n)?r.updateObjectVisibility(n,e):e&&this._addOrUpdateEdgeObject(t,r,!1)}))}_alignWithElevation(e,t,n,r){this.elevationAligner!=null&&(this.alignedSampledElevation=this.elevationAligner(this,this.elevationContext,e,t,n),this.resetEdgeObject(r))}computeAttachmentOrigin(e){let t=this.stageObject.effectiveTransformation;this.useObjectOriginAsAttachmentOrigin?(e.render.origin[0]+=t[12],e.render.origin[1]+=t[13],e.render.origin[2]+=t[14],e.render.num++):super.computeAttachmentOrigin(e)}resetEdgeObject(e){let{_edgeState:t,stageObject:n,_stageLayer:r,visible:i}=this;t!=null&&r.stage.renderer.withEdgeView(r=>{i?this._addOrUpdateEdgeObject(t,r,e):r.removeObject(n)})}_addOrUpdateEdgeObject(e,t,n){let i=r(e.baseMaterial);e.edgeMaterial.objectTransparency=i,t.addOrUpdateObject3D(this.stageObject,e.edgeMaterial,e.hasSlicePlane,!n).then(()=>this._stageLayer?.sync())}}function r(e){return+!e.transparent}export{n as Graphics3DObject3DGraphicLayer,t as Object3DEdgeState};
2
+ import{Graphics3DStageObjectGraphicLayer as e}from"./Graphics3DStageObjectGraphicLayer.js";class t{constructor(e,t,n){this.baseMaterial=e,this.edgeMaterial=t,this.hasSlicePlane=n}}class n extends e{get useObjectOriginAsAttachmentOrigin(){return this._getFlag(4)}set useObjectOriginAsAttachmentOrigin(e){this._setFlag(4,e)}constructor(e,t,n,r,i,a=null,o=0){super(e,t,n,i,o),this.elevationAligner=r,this._edgeState=a,this.type=`object3d`}_disposeStageObject(){this._stageLayer?.stage.renderer.edgeView?.removeObject(this.stageObject),super._disposeStageObject()}layerOpacityChanged(e,t){let{stageObject:n,_edgeState:i,_stageLayer:a}=this;if(i==null)return;let o=r(i.baseMaterial);i.edgeMaterial.objectTransparency!==o&&(i.edgeMaterial.objectTransparency=o,this.resetEdgeObject(t)),a.stage.renderer.withEdgeView(t=>t.updateAllComponentOpacities(n,[e]))}updateMaterial(e){let t=this.usedMemory;this._detachGeometryMemoryCallbacks(),this.stageObject.geometries.map(t=>t.instantiate({material:e})).forEach(e=>{this.stageObject.addGeometry(e),this.stageObject.removeGeometry(0)}),this._updateGeometryBufferMemory(t)}slicePlaneEnabledChanged(e,t){let{stageObject:n,_edgeState:r,_stageLayer:i}=this;r!=null&&i.stage.renderer.withEdgeView(i=>{i.updateAllComponentMaterials(n,r.edgeMaterial,e,!t),r.hasSlicePlane=e})}setVisibility(e){let{_edgeState:t,stageObject:n,_stageLayer:r}=this;r!=null&&this.visible!==e&&(super.setVisibility(e),t!=null&&r.stage.renderer.withEdgeView(r=>{r.hasObject(n)?r.updateObjectVisibility(n,e):e&&this._addOrUpdateEdgeObject(t,r,!1)}))}_alignWithElevation(e,t,n,r){this.elevationAligner!=null&&(this.alignedSampledElevation=this.elevationAligner(this,this.elevationContext,e,t,n),this.resetEdgeObject(r))}computeAttachmentOrigin(e){let t=this.stageObject.effectiveTransformation;this.useObjectOriginAsAttachmentOrigin?(e.render.origin[0]+=t[12],e.render.origin[1]+=t[13],e.render.origin[2]+=t[14],e.render.num++):super.computeAttachmentOrigin(e)}resetEdgeObject(e){let{_edgeState:t,stageObject:n,_stageLayer:r,visible:i}=this;t!=null&&r.stage.renderer.withEdgeView(r=>{i?this._addOrUpdateEdgeObject(t,r,e):r.removeObject(n)})}_addOrUpdateEdgeObject(e,t,n){let i=r(e.baseMaterial);e.edgeMaterial.objectTransparency=i,t.addOrUpdateObject3D(this.stageObject,e.edgeMaterial,e.hasSlicePlane,!n).then(()=>this._stageLayer?.sync())}}function r(e){return+!e.transparent}export{n as Graphics3DObject3DGraphicLayer,t as Object3DEdgeState};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{transformMat4 as e,add as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as r,create as i,isPoint as a,empty as o,center as s,offset as c}from"../../../../geometry/support/aaBoundingBox.js";import{evaluateElevationInfoAtPoint as l}from"./elevationAlignmentUtils.js";import{demResolutionForBoundingBox as u}from"./graphicUtils.js";class d{_getFlag(e){return(this._flags&e)===e}_setFlag(e,t){t?this._flags|=e:this._flags&=~e}get needsElevationUpdates(){return this._getFlag(2)}set needsElevationUpdates(e){this._setFlag(2,e)}get hiddenIfDeconflicted(){return this._getFlag(8)}set hiddenIfDeconflicted(e){this._setFlag(8,e)}get occlusionCheck(){return this._getFlag(16)}get adaptiveOcclusion(){return this._getFlag(32)}setOccludedVisibilityMode(e=`hidden`){this._setFlag(16,e!==`visible`),this._setFlag(32,e===`adaptive`)}get isElevationSource(){return!!this.stageObject.lastValidElevationBB}constructor(e,t,n,r){this.graphics3DSymbolLayer=e,this.stageObject=t,this._sharedResource=n,this.elevationContext=r,this._stageLayer=null,this._flags=0,this.alignedSampledElevation=0}initialize(e){this._stageLayer=e,this.hiddenIfDeconflicted&&(e.add(this.stageObject),this._setFlag(1,!0))}destroy(){this._getFlag(64)||(this._setFlag(64,!0),this._getFlag(1)&&(this._stageLayer.remove(this.stageObject),this._setFlag(1,!1)),this._disposeStageObject(),this._sharedResource?.release(),this._stageLayer=null)}_disposeStageObject(){this.stageObject.dispose()}get usedMemory(){return this.graphics3DSymbolLayer.usedMemory}updateHighlights(e){}setVisibility(e){let{stageObject:t,_stageLayer:n}=this;n!=null&&this.visible!==e&&(t.visible=e,e&&!this._getFlag(1)&&(n.add(t),this._setFlag(1,!0)))}get visible(){return this._getFlag(1)&&this.stageObject.visible}alignWithElevation(e,t,n){this._alignWithElevation(e.spatialReference,(n,r)=>l(n,e,this.elevationContext,t,r),t,n)}alignWithAbsoluteElevation(e,t,n){this._alignWithElevation(this.graphics3DSymbolLayer.view.spatialReference,(t,n)=>{n.sampledElevation=e,n.verticalDistanceToGround=0,n.z=e},t,n)}getCenterObjectSpace(){return this.stageObject.boundingVolumeObjectSpace.sphere.center}getBoundingBoxObjectSpace(e=i()){let t=this.stageObject.boundingVolumeObjectSpace;return r(e,t.box),e}computeAttachmentOrigin(n){let r=this.stageObject.effectiveTransformation;for(let i of this.stageObject.geometries)i.computeAttachmentOrigin(m)&&(e(m,m,r),t(n.render.origin,n.render.origin,m),n.render.num++)}async getProjectedBoundingBox(t,n,r,i,l){let d=this.getBoundingBoxObjectSpace(l),g=h,_=a(d)?1:g.length;for(let t=0;t<_;t++){let n=g[t];p[0]=d[n[0]],p[1]=d[n[1]],p[2]=d[n[2]],e(p,p,this.stageObject.transformation),f[t*3]=p[0],f[t*3+1]=p[1],f[t*3+2]=p[2]}if(!t(f,0,_))return null;o(d);let v=null;this.calculateRelativeScreenBounds&&(v=this.calculateRelativeScreenBounds());for(let e=0;e<_*3;e+=3){for(let t=0;t<3;t++)d[t]=Math.min(d[t],f[e+t]),d[t+3]=Math.max(d[t+3],f[e+t]);v&&r.push({location:f.slice(e,e+3),screenSpaceBoundingRect:v})}if(n?.service&&this.elevationContext.mode!==`absolute-height`){s(d,m);let e=this.elevationContext.mode===`relative-to-scene`?`scene`:`ground`,t=0;if(n.useViewElevation)t=n.service.getElevation(m[0],m[1],e)??0;else try{let r=u(d,n.service.spatialReference,n);t=await n.service.queryElevation(m[0],m[1],i,r,e)??0}catch{}c(d,0,0,-this.alignedSampledElevation+t)}return d}addObjectState(e){e.stateType===0&&e.addObject(this.stageObject,this.stageObject.highlight(e.highlightName)),e.stateType===1&&e.addObject(this.stageObject,this.stageObject.maskOccludee())}removeObjectState(e){e.removeByObject(this.stageObject)}}const f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=n(),m=n(),h=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];export{d as Graphics3DStageObjectGraphicLayer};
2
+ import{transformMat4 as e,add as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as r,create as i,isPoint as a,empty as o,center as s,offset as c}from"../../../../geometry/support/aaBoundingBox.js";import{evaluateElevationInfoAtPoint as l}from"./elevationAlignmentUtils.js";import{demResolutionForBoundingBox as u}from"./graphicUtils.js";import{computeGeometryBufferMemory as d}from"../../webgl-engine/lib/geometryMemoryUtils.js";class f{setNotifyMemoryChange(e){this._notifyMemoryChange=e;for(let t of this.stageObject.geometries)t.notifyMemoryChange=e}_getFlag(e){return(this._flags&e)===e}_setFlag(e,t){t?this._flags|=e:this._flags&=~e}get needsElevationUpdates(){return this._getFlag(2)}set needsElevationUpdates(e){this._setFlag(2,e)}get hiddenIfDeconflicted(){return this._getFlag(8)}set hiddenIfDeconflicted(e){this._setFlag(8,e)}get occlusionCheck(){return this._getFlag(16)}get adaptiveOcclusion(){return this._getFlag(32)}setOccludedVisibilityMode(e=`hidden`){this._setFlag(16,e!==`visible`),this._setFlag(32,e===`adaptive`)}get isElevationSource(){return!!this.stageObject.lastValidElevationBB}constructor(e,t,n,r,i=0){this.graphics3DSymbolLayer=e,this.stageObject=t,this._resourceToReleaseOnDestroy=n,this.elevationContext=r,this._additionalMemory=i,this._stageLayer=null,this._flags=0,this._geometryBufferMemory=0,this.alignedSampledElevation=0,this._updateGeometryBufferMemory()}initialize(e){this._stageLayer=e,this.hiddenIfDeconflicted&&(e.add(this.stageObject),this._setFlag(1,!0))}destroy(){this._getFlag(64)||(this._setFlag(64,!0),this.setNotifyMemoryChange(void 0),this._getFlag(1)&&(this._stageLayer.remove(this.stageObject),this._setFlag(1,!1)),this._disposeStageObject(),this._resourceToReleaseOnDestroy?.release(),this._stageLayer=null)}_disposeStageObject(){this.stageObject.dispose()}get usedMemory(){let e=this.graphics3DSymbolLayer.usedMemory+this._geometryBufferMemory+this._additionalMemory;for(let t of this.stageObject.geometries)e+=t.usedMemoryExcludingBuffers;return e}_detachGeometryMemoryCallbacks(){for(let e of this.stageObject.geometries)e.notifyMemoryChange=void 0}_updateGeometryBufferMemory(e){if(this._geometryBufferMemory=d(this.stageObject.geometries),this.setNotifyMemoryChange(this._notifyMemoryChange),e!==void 0){let t=this.usedMemory-e;t&&this._notifyMemoryChange?.(t)}}updateHighlights(e){}setVisibility(e){let{stageObject:t,_stageLayer:n}=this;n!=null&&this.visible!==e&&(t.visible=e,e&&!this._getFlag(1)&&(n.add(t),this._setFlag(1,!0)))}get visible(){return this._getFlag(1)&&this.stageObject.visible}alignWithElevation(e,t,n){this._alignWithElevation(e.spatialReference,(n,r)=>l(n,e,this.elevationContext,t,r),t,n)}alignWithAbsoluteElevation(e,t,n){this._alignWithElevation(this.graphics3DSymbolLayer.view.spatialReference,(t,n)=>{n.sampledElevation=e,n.verticalDistanceToGround=0,n.z=e},t,n)}getCenterObjectSpace(){return this.stageObject.boundingVolumeObjectSpace.sphere.center}getBoundingBoxObjectSpace(e=i()){let t=this.stageObject.boundingVolumeObjectSpace;return r(e,t.box),e}computeAttachmentOrigin(n){let r=this.stageObject.effectiveTransformation;for(let i of this.stageObject.geometries)i.computeAttachmentOrigin(h)&&(e(h,h,r),t(n.render.origin,n.render.origin,h),n.render.num++)}async getProjectedBoundingBox(t,n,r,i,l){let d=this.getBoundingBoxObjectSpace(l),f=g,_=a(d)?1:f.length;for(let t=0;t<_;t++){let n=f[t];m[0]=d[n[0]],m[1]=d[n[1]],m[2]=d[n[2]],e(m,m,this.stageObject.transformation),p[t*3]=m[0],p[t*3+1]=m[1],p[t*3+2]=m[2]}if(!t(p,0,_))return null;o(d);let v=null;this.calculateRelativeScreenBounds&&(v=this.calculateRelativeScreenBounds());for(let e=0;e<_*3;e+=3){for(let t=0;t<3;t++)d[t]=Math.min(d[t],p[e+t]),d[t+3]=Math.max(d[t+3],p[e+t]);v&&r.push({location:p.slice(e,e+3),screenSpaceBoundingRect:v})}if(n?.service&&this.elevationContext.mode!==`absolute-height`){s(d,h);let e=this.elevationContext.mode===`relative-to-scene`?`scene`:`ground`,t=0;if(n.useViewElevation)t=n.service.getElevation(h[0],h[1],e)??0;else try{let r=u(d,n.service.spatialReference,n);t=await n.service.queryElevation(h[0],h[1],i,r,e)??0}catch{}c(d,0,0,-this.alignedSampledElevation+t)}return d}addObjectState(e){e.stateType===0&&e.addObject(this.stageObject,this.stageObject.highlight(e.highlightName)),e.stateType===1&&e.addObject(this.stageObject,this.stageObject.maskOccludee())}removeObjectState(e){e.removeByObject(this.stageObject)}}const p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=n(),h=n(),g=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];export{f as Graphics3DStageObjectGraphicLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{isSome as e}from"../../../../core/arrayUtils.js";import{forEach as t}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{onAbortOrThrow as n,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{aggregateSymbolComplexity as i}from"./defaultSymbolComplexity.js";import{Graphics3DGraphic as a}from"./Graphics3DGraphic.js";import{Graphics3DSymbolLayerCreationContext as o}from"./Graphics3DSymbolCreationContext.js";import{Loadable as s}from"./Loadable.js";import{AggregateSymbolComplexity as c}from"./SymbolComplexity.js";import{getSymbolMemorySize as l}from"./symbolMemory.js";class u extends s{set symbol(e){this._symbol=e,e.symbolLayers.forEach((t,n)=>{let r=this.symbolLayers[n];r!=null&&(r.symbol=e,r.symbolLayer=t)})}get symbol(){return this._symbol}constructor(e,t,n){super(t.schedule),this._symbol=e,this._context=t,this._backgroundLayers=n,this._destroyed=!1,this.symbolLayers=[],this.referenced=0,this._extentPadding=0}async doLoad(e){let i=this._symbol.symbolLayers;this._extentPadding=0,this._backgroundLayers&&(i=this._backgroundLayers.concat(i));let a=i.length;for(;this.symbolLayers.length<i.length;)this.symbolLayers.push(null);this.symbolLayers.length=i.length;let o=[];if(!d){let{make:e}=await import(`./Graphics3DSymbolLayerFactory.js`);d=e}for(let t=0;t<a;t++){let r=i.at(t);if(r.enabled===!1)continue;f.renderPriority=1-(1+t)/a,f.renderPriorityStep=1/a,f.ignoreDrivers=r.ignoreDrivers;let s=d(this.symbol,r,this._context,f),c=n(e,()=>{this.symbolLayers[t]=null,s.destroy()});c&&o.push(c),this.symbolLayers[t]=s}if(await t(this.symbolLayers,async(e,t)=>{if(e!=null)try{await e.load(),this._extentPadding+=Math.max(this._extentPadding,e.extentPadding)}catch{this.symbolLayers[t]=null}}),o.forEach(e=>e.remove()),r(e),this.symbolLayers.length&&!this.symbolLayers.some(e=>!!e))throw Error()}getSymbolLayerSize(e){let t=this.symbolLayers[e];return t==null?null:t.getCachedSize()}get extentPadding(){return this._extentPadding}get symbologySnappingSupported(){return this.symbolLayers.some(e=>e?.queryForSnapping)}get needsUpdateFocus(){return this.symbolLayers.some(e=>e?.needsUpdateFocus===!0)}createGraphics3DGraphic(e,t){let{graphic:n}=e,r=this.symbolLayers.map(t=>t?.createGraphics3DGraphic(e)??null);return new a(n,t||this,r)}get complexity(){let e=new c;return this.symbolLayers.forEach(t=>i(t?.complexity,e)),e}globalPropertyChanged(e,t){let n=this.symbolLayers.length;for(let r=0;r<n;r++){let n=this.symbolLayers[r];if(n!=null&&!n.globalPropertyChanged(e,t,e=>{let t=e.layers[r];return t?.type===`object3d`||t?.type===`buffer`?t:null}))return!1}return!0}applyRendererDiff(e,t){return this.loadStatus===1?this.symbolLayers.reduce((n,r)=>n!==0&&r!=null?Math.min(n,r.applyRendererDiff(e,t)):n,2):0}prepareSymbolPatch(e){if(this.loadStatus===2||e.diff.type!==`partial`)return;let t=e.diff.diff;if(!t.symbolLayers||t.symbolLayers.type!==`partial`)return;let n=t.symbolLayers.diff;this.symbolLayers.forEach((t,r)=>{if(t==null)return;let i=n[r];if(i){let n={diff:i,graphics3DGraphicPatches:[],symbolLayerStatePatches:[]};t.prepareSymbolLayerPatch(n),e.symbolStatePatches.push(...n.symbolLayerStatePatches),n.graphics3DGraphicPatches.length&&e.graphics3DGraphicPatches.push((e,t)=>{let i=e.layers[r];i!=null&&n.graphics3DGraphicPatches.forEach(e=>e(i,t))})}})}updateGeometry(e){return this._updateGeometryOrTransform(e,(t,n)=>t.updateGeometry?t.updateGeometry(e.graphic,n):!1)}updateTransform(e,t,n,r){return this._updateGeometryOrTransform(e,(e,i)=>e.updateTransform?e.updateTransform(i,t,n,r):!1)}_updateGeometryOrTransform(e,t){for(let n=0;n<this.symbolLayers.length;n++){let r=this.symbolLayers[n];if(r==null)continue;let i=e.layers[n];if(!i||!t(r,i))return!1}return!0}onRemoveGraphic(e){for(let t=0;t<this.symbolLayers.length;t++){let n=this.symbolLayers[t];if(n==null)continue;let r=e.layers[t];r!=null&&n.onRemoveGraphic(r)}}getFastUpdateStatus(){let e=!1,t=!1;for(let n of this.symbolLayers)if(n!=null){if(n.loadStatus===0)return 3;n.isFastUpdatesEnabled()?t=!0:e=!0}return t?e?2:1:e?0:4}async queryForSnapping(t,n,i,a){let o=this.symbolLayers.filter(e).filter(e=>e.queryForSnapping!=null).map(e=>e.queryForSnapping(t,n,i,a)),s=await Promise.all(o);return r(a),s.flat()}destroy(){if(!this.destroyed){super.destroy();for(let e of this.symbolLayers)e?.destroy();this.symbolLayers.length=0,this._destroyed=!0}}get destroyed(){return this._destroyed}get usedMemory(){return l(this)}}let d=null;const f=new o;export{u as Graphics3DSymbol};
2
+ import{isSome as e}from"../../../../core/arrayUtils.js";import{forEach as t}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{onAbortOrThrow as n,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{aggregateSymbolComplexity as i}from"./defaultSymbolComplexity.js";import{Graphics3DGraphic as a}from"./Graphics3DGraphic.js";import{Graphics3DSymbolLayerCreationContext as o}from"./Graphics3DSymbolCreationContext.js";import{Loadable as s}from"./Loadable.js";import{AggregateSymbolComplexity as c}from"./SymbolComplexity.js";import{getSymbolMemorySize as l}from"./symbolMemory.js";class u extends s{set symbol(e){this._symbol=e,e.symbolLayers.forEach((t,n)=>{let r=this.symbolLayers[n];r!=null&&(r.symbol=e,r.symbolLayer=t)})}get symbol(){return this._symbol}constructor(e,t,n){super(t.schedule),this._symbol=e,this._context=t,this._backgroundLayers=n,this._destroyed=!1,this.symbolLayers=[],this.referenced=0,this._extentPadding=0}async doLoad(e){let i=this._symbol.symbolLayers;this._extentPadding=0,this._backgroundLayers&&(i=this._backgroundLayers.concat(i));let a=i.length;for(;this.symbolLayers.length<i.length;)this.symbolLayers.push(null);this.symbolLayers.length=i.length;let o=[];if(!d){let{make:e}=await import(`./Graphics3DSymbolLayerFactory.js`);d=e}for(let t=0;t<a;t++){let r=i.at(t);if(r.enabled===!1)continue;f.renderPriority=1-(1+t)/a,f.renderPriorityStep=1/a,f.ignoreDrivers=r.ignoreDrivers;let s=d(this.symbol,r,this._context,f),c=n(e,()=>{this.symbolLayers[t]=null,s.destroy()});c&&o.push(c),this.symbolLayers[t]=s}if(await t(this.symbolLayers,async(e,t)=>{if(e!=null)try{await e.load(),this._extentPadding+=Math.max(this._extentPadding,e.extentPadding)}catch{this.symbolLayers[t]=null}}),o.forEach(e=>e.remove()),r(e),this.symbolLayers.length&&!this.symbolLayers.some(e=>!!e))throw Error()}getSymbolLayerSize(e){let t=this.symbolLayers[e];return t==null?null:t.getCachedSize()}get extentPadding(){return this._extentPadding}get symbologySnappingSupported(){return this.symbolLayers.some(e=>e?.queryForSnapping)}get needsUpdateFocus(){return this.symbolLayers.some(e=>e?.needsUpdateFocus===!0)}createGraphics3DGraphic(e,t){let{graphic:n}=e,r=this.symbolLayers.map(t=>t?.createGraphics3DGraphic(e)??null);return new a(n,t||this,r,e.reportGraphicSourceMemory)}get complexity(){let e=new c;return this.symbolLayers.forEach(t=>i(t?.complexity,e)),e}globalPropertyChanged(e,t){let n=this.symbolLayers.length;for(let r=0;r<n;r++){let n=this.symbolLayers[r];if(n!=null&&!n.globalPropertyChanged(e,t,e=>{let t=e.layers[r];return t?.type===`object3d`||t?.type===`buffer`?t:null}))return!1}return!0}applyRendererDiff(e,t){return this.loadStatus===1?this.symbolLayers.reduce((n,r)=>n!==0&&r!=null?Math.min(n,r.applyRendererDiff(e,t)):n,2):0}prepareSymbolPatch(e){if(this.loadStatus===2||e.diff.type!==`partial`)return;let t=e.diff.diff;if(!t.symbolLayers||t.symbolLayers.type!==`partial`)return;let n=t.symbolLayers.diff;this.symbolLayers.forEach((t,r)=>{if(t==null)return;let i=n[r];if(i){let n={diff:i,graphics3DGraphicPatches:[],symbolLayerStatePatches:[]};t.prepareSymbolLayerPatch(n),e.symbolStatePatches.push(...n.symbolLayerStatePatches),n.graphics3DGraphicPatches.length&&e.graphics3DGraphicPatches.push((e,t)=>{let i=e.layers[r];i!=null&&n.graphics3DGraphicPatches.forEach(e=>e(i,t))})}})}updateGeometry(e){return this._updateGeometryOrTransform(e,(t,n)=>t.updateGeometry?t.updateGeometry(e.graphic,n):!1)}updateTransform(e,t,n,r){return this._updateGeometryOrTransform(e,(e,i)=>e.updateTransform?e.updateTransform(i,t,n,r):!1)}_updateGeometryOrTransform(e,t){for(let n=0;n<this.symbolLayers.length;n++){let r=this.symbolLayers[n];if(r==null)continue;let i=e.layers[n];if(!i||!t(r,i))return!1}return!0}onRemoveGraphic(e){for(let t=0;t<this.symbolLayers.length;t++){let n=this.symbolLayers[t];if(n==null)continue;let r=e.layers[t];r!=null&&n.onRemoveGraphic(r)}}getFastUpdateStatus(){let e=!1,t=!1;for(let n of this.symbolLayers)if(n!=null){if(n.loadStatus===0)return 3;n.isFastUpdatesEnabled()?t=!0:e=!0}return t?e?2:1:e?0:4}async queryForSnapping(t,n,i,a){let o=this.symbolLayers.filter(e).filter(e=>e.queryForSnapping!=null).map(e=>e.queryForSnapping(t,n,i,a)),s=await Promise.all(o);return r(a),s.flat()}destroy(){if(!this.destroyed){super.destroy();for(let e of this.symbolLayers)e?.destroy();this.symbolLayers.length=0,this._destroyed=!0}}get destroyed(){return this._destroyed}get usedMemory(){return l(this)}}let d=null;const f=new o;export{u as Graphics3DSymbol};