@arcgis/core 4.23.0-next.20220126 → 4.23.0-next.20220130

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 (523) hide show
  1. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/02fbc76dfdc20e628c61.js +1 -0
  4. package/assets/esri/core/workers/chunks/0453fad5cb819797b4f6.js +1 -0
  5. package/assets/esri/core/workers/chunks/0463ba46df855a92b9c0.js +1 -0
  6. package/assets/esri/core/workers/chunks/0cd0a6eef51fc5b9ea61.js +1 -0
  7. package/assets/esri/core/workers/chunks/{97ec9eef0048760fa260.js → 0d02c6ad1f4688bfa374.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0d684f16f37d5dc385dd.js +1 -0
  9. package/assets/esri/core/workers/chunks/0e17691520d890d34efb.js +1 -0
  10. package/assets/esri/core/workers/chunks/16b6d0f8378582c051c3.js +1 -0
  11. package/assets/esri/core/workers/chunks/{0ce1dc14280d6f188468.js → 17de7a324dfa7f57ad5d.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{b313ab14a643273e7d09.js → 1877ab1b6a115dbba1c5.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{c36f84daa7736878418d.js → 197ec52641aed20029c6.js} +1 -1
  14. package/assets/esri/core/workers/chunks/1b2a961f776a0b57e57a.js +1 -0
  15. package/assets/esri/core/workers/chunks/1b3fd66577b19aa5f2b6.js +1 -0
  16. package/assets/esri/core/workers/chunks/1c733b7db092a2a88ef3.js +1 -0
  17. package/assets/esri/core/workers/chunks/1f8c6a179e39fd4c5e6f.js +1 -0
  18. package/assets/esri/core/workers/chunks/2076fcbae63f1bfb7143.js +1 -0
  19. package/assets/esri/core/workers/chunks/{9387db408f496e7dd003.js → 214910032945dd2d86b0.js} +1 -1
  20. package/assets/esri/core/workers/chunks/27474b007988855bea9d.js +1 -0
  21. package/assets/esri/core/workers/chunks/281b89dbf5574fc642ae.js +1 -0
  22. package/assets/esri/core/workers/chunks/2c8fe9bc988c3c5760a5.js +1 -0
  23. package/assets/esri/core/workers/chunks/34b59d7099904dcb28b5.js +1 -0
  24. package/assets/esri/core/workers/chunks/357033117dfe61eb81ea.js +1 -0
  25. package/assets/esri/core/workers/chunks/{b2ebe4f6d100e15b512d.js → 37c03cfc19086ce631c6.js} +1 -1
  26. package/assets/esri/core/workers/chunks/386f86f961146f530aa7.js +1 -0
  27. package/assets/esri/core/workers/chunks/{e6165e17fbb07bfc40a1.js → 391e96192d1ec4e55ce2.js} +1 -1
  28. package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
  29. package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
  30. package/assets/esri/core/workers/chunks/{c959e0d1cf7dce0421b9.js → 48fa8aed6c24877b44c4.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{438f0b5ae5c53ae4f06a.js → 4954fd86b48cc68b737c.js} +1 -1
  32. package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
  33. package/assets/esri/core/workers/chunks/4ba6de8aa7e2960bad49.js +1 -0
  34. package/assets/esri/core/workers/chunks/4be35af7d6babbfe9d84.js +1 -0
  35. package/assets/esri/core/workers/chunks/5457962a70bd3c557a75.js +1 -0
  36. package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
  37. package/assets/esri/core/workers/chunks/{b9c177524b3e7de1ffd1.js → 5790d171072b3c7d108f.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{5dfe1f8d520025e2118b.js → 57b349d1dbc0bed75b79.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{97a28641b3b2fd31bea2.js → 5bcb3240b3c005e5fe72.js} +1 -1
  40. package/assets/esri/core/workers/chunks/5d11b97b667921d67ae7.js +1 -0
  41. package/assets/esri/core/workers/chunks/5dbe555a5a662ff3d9ce.js +1 -0
  42. package/assets/esri/core/workers/chunks/5ec98f4ddac707d0fbd1.js +1 -0
  43. package/assets/esri/core/workers/chunks/64b7e8d812ea8fcf269e.js +1 -0
  44. package/assets/esri/core/workers/chunks/{ba5eb394f098968c22d2.js → 655b55ac0cd533d7e9d7.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{b0b036ad3ad3cd956747.js → 69fd99b7c76e9992ccf3.js} +1 -1
  46. package/assets/esri/core/workers/chunks/75d812955a473d0e8960.js +1 -0
  47. package/assets/esri/core/workers/chunks/7903a3e2e0faff0f86c0.js +1 -0
  48. package/assets/esri/core/workers/chunks/{cc146c57bbdac8029fd8.js → 7a5f5acfbd4ca1a5c1f3.js} +1 -1
  49. package/assets/esri/core/workers/chunks/83d00afae4406ec78bc9.js +1 -0
  50. package/assets/esri/core/workers/chunks/{434b16731c6a81f868ef.js → 85b1f36790df95b17659.js} +1 -1
  51. package/assets/esri/core/workers/chunks/89820b200ee44e678af5.js +1 -0
  52. package/assets/esri/core/workers/chunks/918bb7a7d901544a7367.js +1 -0
  53. package/assets/esri/core/workers/chunks/{94b8dbf859df71858d1c.js → 929c9b7cdab7c4ca3d87.js} +1 -1
  54. package/assets/esri/core/workers/chunks/949b2269457302ffc64b.js +1 -0
  55. package/assets/esri/core/workers/chunks/{601e697dc7414bda128a.js → 952980635afc7ec81804.js} +1 -1
  56. package/assets/esri/core/workers/chunks/9876a1bae350795fab36.js +1 -0
  57. package/assets/esri/core/workers/chunks/99619fcb772807c74f3b.js +1 -0
  58. package/assets/esri/core/workers/chunks/{010a71c2aa1b7681e191.js → 9d11f84e6c893b9d0019.js} +1 -1
  59. package/assets/esri/core/workers/chunks/a1930e4f035bc9aa1ae5.js +1 -0
  60. package/assets/esri/core/workers/chunks/a8692bffb76444c34760.js +1 -0
  61. package/assets/esri/core/workers/chunks/{f760a3e030b0f358a92a.js → aeaa1667c2d9f1b3366b.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{3f343f792fd9f44d6f25.js → b3f5e91116112b0b612a.js} +1 -1
  63. package/assets/esri/core/workers/chunks/b97953694f42bfec1b3c.js +1 -0
  64. package/assets/esri/core/workers/chunks/b9e9cb354822c6d995a4.js +1 -0
  65. package/assets/esri/core/workers/chunks/ba762bcfd74af0bb8218.js +1 -0
  66. package/assets/esri/core/workers/chunks/{e4b84ca8ddfd48dd79b1.js → bac9fc90e6756e211160.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{4c76146014dc15143ba3.js → be588873c16770ceb9ef.js} +1 -1
  68. package/assets/esri/core/workers/chunks/bf97a933ea3b220115e1.js +1 -0
  69. package/assets/esri/core/workers/chunks/bfedd6ebff817c9b31c0.js +1 -0
  70. package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +1 -0
  71. package/assets/esri/core/workers/chunks/c1135cb02ec46c491459.js +1 -0
  72. package/assets/esri/core/workers/chunks/{e4e2036373166c1d5cf5.js → c2253a9f29c1aabb2b75.js} +1 -1
  73. package/assets/esri/core/workers/chunks/d04fca5d46cca02500b7.js +1 -0
  74. package/assets/esri/core/workers/chunks/d08efbc349dd9f999497.js +1 -0
  75. package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +1 -0
  76. package/assets/esri/core/workers/chunks/{a8b13fb804bb775e4967.js → db3c729ce0c0b2690dc9.js} +1 -1
  77. package/assets/esri/core/workers/chunks/dd13772a5e2eccc6a2bc.js +1 -0
  78. package/assets/esri/core/workers/chunks/dedc333a61081772ca7b.js +1 -0
  79. package/assets/esri/core/workers/chunks/{6f50a9647f026a8d4729.js → e0c8d61c7a85ce15499a.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{199670a3a564ebe3bd79.js → e218bde41ffbcc5194f5.js} +1 -1
  81. package/assets/esri/core/workers/chunks/e21b211913aefde47e30.js +1 -0
  82. package/assets/esri/core/workers/chunks/e287f49184d076af17e2.js +1 -0
  83. package/assets/esri/core/workers/chunks/{bde1d5b0a7717350986e.js → e4019b63a1fe74e2c842.js} +1 -1
  84. package/assets/esri/core/workers/chunks/e8e775758b79c5a084c8.js +1 -0
  85. package/assets/esri/core/workers/chunks/e93dfdede0532a89ffa5.js +1 -0
  86. package/assets/esri/core/workers/chunks/ea595b0df5050eda2a13.js +1 -0
  87. package/assets/esri/core/workers/chunks/eb82ff10cef2bde6e57f.js +1 -0
  88. package/assets/esri/core/workers/chunks/ebc6f4764b82d4104c65.js +1 -0
  89. package/assets/esri/core/workers/chunks/{1305ef8717da6e902a55.js → ec10151a2a95e95a0bb5.js} +1 -1
  90. package/assets/esri/core/workers/chunks/eccba071ced2d922bb85.js +1 -0
  91. package/assets/esri/core/workers/chunks/ee6e0db58dc64410e687.js +1 -0
  92. package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +1 -0
  93. package/assets/esri/core/workers/chunks/f2124f4d0f2b8a91f0ea.js +1 -0
  94. package/assets/esri/core/workers/chunks/ff6abdc72076f3994659.js +981 -0
  95. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  96. package/assets/esri/themes/base/widgets/_Weather.scss +1 -1
  97. package/assets/esri/themes/dark/main.css +1 -1
  98. package/assets/esri/themes/dark-blue/main.css +1 -1
  99. package/assets/esri/themes/dark-green/main.css +1 -1
  100. package/assets/esri/themes/dark-purple/main.css +1 -1
  101. package/assets/esri/themes/dark-red/main.css +1 -1
  102. package/assets/esri/themes/light/main.css +1 -1
  103. package/assets/esri/themes/light/view.css +1 -1
  104. package/assets/esri/themes/light-blue/main.css +1 -1
  105. package/assets/esri/themes/light-green/main.css +1 -1
  106. package/assets/esri/themes/light-purple/main.css +1 -1
  107. package/assets/esri/themes/light-red/main.css +1 -1
  108. package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
  109. package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
  110. package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
  111. package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
  112. package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
  113. package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
  114. package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
  115. package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
  116. package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
  117. package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
  118. package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
  119. package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
  120. package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
  121. package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
  122. package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
  123. package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
  124. package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
  125. package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
  126. package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
  127. package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
  128. package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
  129. package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
  130. package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
  131. package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
  132. package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
  133. package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
  134. package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
  135. package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
  136. package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
  137. package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
  138. package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
  139. package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
  140. package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
  141. package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
  142. package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
  143. package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
  144. package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
  145. package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
  146. package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
  147. package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
  148. package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
  149. package/chunks/BlendLayers.glsl.js +2 -2
  150. package/chunks/ChapmanAtmosphere.glsl.js +17 -17
  151. package/chunks/CheckerBoard.glsl.js +3 -3
  152. package/chunks/Clouds.glsl.js +2 -2
  153. package/chunks/CloudsComposition.glsl.js +1 -1
  154. package/chunks/ColorMaterial.glsl.js +12 -12
  155. package/chunks/ComponentShader.glsl.js +3 -3
  156. package/chunks/Compositing.glsl.js +1 -1
  157. package/chunks/DefaultMaterial.glsl.js +33 -33
  158. package/chunks/EdgeShaderProgram.glsl.js +7 -7
  159. package/chunks/Fog.glsl.js +10 -12
  160. package/chunks/HUDMaterial.glsl.js +2 -2
  161. package/chunks/HighlightComposition.glsl.js +5 -5
  162. package/chunks/ImageMaterial.glsl.js +6 -6
  163. package/chunks/LaserlinePath.glsl.js +8 -8
  164. package/chunks/LineCallout.glsl.js +6 -6
  165. package/chunks/MeasurementArrow.glsl.js +1 -1
  166. package/chunks/NativeLine.glsl.js +1 -1
  167. package/chunks/Path.glsl.js +5 -5
  168. package/chunks/Pattern.glsl.js +9 -9
  169. package/chunks/PointRenderer.glsl.js +14 -14
  170. package/chunks/Precipitation.glsl.js +91 -0
  171. package/chunks/RealisticTree.glsl.js +21 -21
  172. package/chunks/RibbonLine.glsl.js +11 -11
  173. package/chunks/SMAA.glsl.js +40 -40
  174. package/chunks/ShadedColorMaterial.glsl.js +12 -12
  175. package/chunks/ShadowCast.glsl.js +6 -6
  176. package/chunks/ShadowHighlight.glsl.js +4 -4
  177. package/chunks/SimpleAtmosphere.glsl.js +3 -3
  178. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  179. package/chunks/Stars.glsl.js +3 -3
  180. package/chunks/Terrain.glsl.js +11 -11
  181. package/chunks/TextureOnly.glsl.js +2 -2
  182. package/chunks/WaterSurface.glsl.js +5 -5
  183. package/chunks/boundedPlane.js +1 -1
  184. package/chunks/vxlLayer.js +1 -1
  185. package/core/accessorSupport/watch.js +1 -1
  186. package/core/clock.js +1 -1
  187. package/core/jsonMap.js +1 -1
  188. package/core/loadAll.js +1 -1
  189. package/core/promiseUtils.js +1 -1
  190. package/core/reactiveUtils.js +1 -1
  191. package/form/ExpressionInfo.js +1 -1
  192. package/geometry/support/frustum.js +1 -1
  193. package/geometry/support/plane.js +1 -1
  194. package/interfaces.d.ts +232 -38
  195. package/layers/VectorTileLayer.js +1 -1
  196. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  197. package/layers/graphics/featureConversionUtils.js +1 -1
  198. package/layers/support/LayerContingentValuesCache.js +1 -1
  199. package/layers/support/TileInfo.js +1 -1
  200. package/package.json +1 -1
  201. package/rest/print.js +1 -1
  202. package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
  203. package/support/arcadeOnDemand.js +1 -1
  204. package/support/featureFlags.js +1 -1
  205. package/support/revision.js +1 -1
  206. package/symbols/FillSymbol3DLayer.js +1 -1
  207. package/symbols/IconSymbol3DLayer.js +1 -1
  208. package/symbols/ObjectSymbol3DLayer.js +1 -1
  209. package/symbols/Symbol3D.js +1 -1
  210. package/symbols/WebStyleSymbol.js +1 -1
  211. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  212. package/symbols/support/IconSymbol3DLayerResource.js +1 -1
  213. package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
  214. package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
  215. package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
  216. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  217. package/symbols/support/Symbol3DIconOutline.js +1 -1
  218. package/symbols/support/Symbol3DOutline.js +1 -1
  219. package/symbols/support/Thumbnail.js +1 -1
  220. package/symbols/support/webStyleSymbolUtils.js +1 -1
  221. package/views/2d/MapViewConstraints.js +1 -1
  222. package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
  223. package/views/2d/viewpointUtils.js +1 -1
  224. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  225. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  226. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  227. package/views/3d/environment/CloudsGenerator.js +1 -1
  228. package/views/3d/environment/CloudsPresets.js +1 -1
  229. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  230. package/views/3d/environment/Fog.glsl.js +1 -1
  231. package/views/3d/environment/Fog.js +1 -1
  232. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  233. package/views/3d/environment/Precipitation.glsl.js +5 -0
  234. package/views/3d/environment/Precipitation.js +5 -0
  235. package/views/3d/environment/PrecipitationTechnique.js +5 -0
  236. package/views/3d/environment/RainyWeather.js +1 -1
  237. package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
  238. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  239. package/views/3d/environment/SnowyWeather.js +5 -0
  240. package/views/3d/environment/Stars.glsl.js +1 -1
  241. package/views/3d/environment/Stars.js +1 -1
  242. package/views/3d/environment/weather.js +1 -1
  243. package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
  244. package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
  245. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  246. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  247. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  248. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  249. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  250. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  251. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  252. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  253. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  254. package/views/3d/layers/GraphicsView3D.js +1 -1
  255. package/views/3d/layers/I3SMeshView3D.js +1 -1
  256. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  257. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  258. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  259. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  260. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  261. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  262. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  263. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  264. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  265. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  266. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  267. package/views/3d/layers/graphics/lineUtils.js +1 -1
  268. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  269. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  270. package/views/3d/layers/graphics/symbolComplexity.js +1 -1
  271. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  272. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  273. package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
  274. package/views/3d/layers/support/overlayImageUtils.js +1 -1
  275. package/views/3d/layers/support/patternUtils.js +1 -1
  276. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  277. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  278. package/views/3d/support/LaserLineRenderer.js +1 -1
  279. package/views/3d/support/LaserlinePathData.js +1 -1
  280. package/views/3d/support/sunUtils.js +1 -1
  281. package/views/3d/terrain/OverlayRenderer.js +1 -1
  282. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  283. package/views/3d/terrain/TerrainRenderer.js +1 -1
  284. package/views/3d/terrain/TerrainSurface.js +1 -1
  285. package/views/3d/terrain/Tile.js +1 -1
  286. package/views/3d/terrain/terrainUtils.js +1 -1
  287. package/views/3d/terrain/tileUtils.js +1 -1
  288. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  289. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  290. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  291. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
  292. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  293. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  294. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  295. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  296. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
  297. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
  298. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
  299. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
  300. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  301. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
  302. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
  303. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  304. package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
  305. package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
  306. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
  307. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
  308. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
  309. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
  310. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
  311. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
  312. package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
  313. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
  314. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
  315. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  316. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
  317. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
  318. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
  319. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
  320. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
  321. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
  322. package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
  323. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
  324. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
  325. package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
  326. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
  327. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
  328. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +10 -10
  329. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
  330. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
  331. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
  332. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  333. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  334. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  335. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  336. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  337. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  338. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  339. package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
  340. package/views/3d/webgl-engine/lib/Material.js +1 -1
  341. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  342. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  343. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  344. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  345. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  346. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  347. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  348. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  349. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  350. package/views/3d/webgl-engine/lib/TextureUniformName.js +4 -0
  351. package/views/3d/webgl-engine/lib/UniformName.js +4 -0
  352. package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
  353. package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
  354. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  355. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  356. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
  357. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  358. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  359. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  360. package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
  361. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  362. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  363. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  364. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  365. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  366. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  367. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  368. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  369. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  370. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  371. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  372. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  373. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  374. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  375. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  376. package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
  377. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  378. package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
  379. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  380. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  381. package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
  382. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  383. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  384. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  385. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  386. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  387. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  388. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  389. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  390. package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
  391. package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
  392. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  393. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  394. package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
  395. package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
  396. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  397. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  398. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
  399. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  400. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  401. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  402. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  403. package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
  404. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  405. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  406. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  407. package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
  408. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  409. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  410. package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
  411. package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
  412. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  413. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  414. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
  415. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
  416. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
  417. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
  418. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
  419. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
  420. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
  421. package/views/MapView.js +1 -1
  422. package/views/SceneView.js +1 -1
  423. package/views/View.js +1 -1
  424. package/views/input/recognizers/DoubleTapDrag.js +1 -1
  425. package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
  426. package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
  427. package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
  428. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  429. package/views/support/DefaultsFromMap.js +1 -1
  430. package/views/support/WatchUpdatingTracking.js +1 -1
  431. package/views/support/projectionUtils.js +5 -0
  432. package/views/webgl/BufferObject.js +1 -1
  433. package/views/webgl/InstanceCounter.js +1 -1
  434. package/views/webgl/Program.js +1 -1
  435. package/webdoc/support/{Thumbnail.js → SlideThumbnail.js} +1 -1
  436. package/webmap/Bookmark.js +1 -1
  437. package/webmap/Version.js +1 -1
  438. package/webscene/Slide.js +1 -1
  439. package/webscene/Version.js +1 -1
  440. package/webscene/support/SlideVisibleLayer.js +1 -1
  441. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  442. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  443. package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
  444. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  445. package/widgets/BasemapGallery.js +1 -1
  446. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  447. package/widgets/Bookmarks.js +1 -1
  448. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  449. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  450. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  451. package/widgets/Search/support/locatorUtils.js +1 -1
  452. package/widgets/Search.js +1 -1
  453. package/widgets/Slice/SliceViewModel.js +1 -1
  454. package/widgets/TimeSlider.js +1 -1
  455. package/widgets/Weather/WeatherViewModel.js +1 -1
  456. package/widgets/Weather/css.js +1 -1
  457. package/widgets/Weather/enums.js +5 -0
  458. package/widgets/Weather.js +1 -1
  459. package/widgets/support/InteractiveToolViewModel.js +1 -1
  460. package/assets/esri/core/workers/chunks/00c5bb5eecb0e89266df.js +0 -1
  461. package/assets/esri/core/workers/chunks/021a37e2b191298e80b7.js +0 -1
  462. package/assets/esri/core/workers/chunks/1370c92c40fd6271553c.js +0 -1
  463. package/assets/esri/core/workers/chunks/14bef72154b3a19561a7.js +0 -1
  464. package/assets/esri/core/workers/chunks/18668dc45eb9e35530df.js +0 -1
  465. package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +0 -1
  466. package/assets/esri/core/workers/chunks/1fbcc8424452d0256bd6.js +0 -1
  467. package/assets/esri/core/workers/chunks/208a7e24e19fc5633dd7.js +0 -1
  468. package/assets/esri/core/workers/chunks/22b09e276c9b9f22f0f8.js +0 -1
  469. package/assets/esri/core/workers/chunks/23b15e7c2f96d260e16c.js +0 -1
  470. package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +0 -1
  471. package/assets/esri/core/workers/chunks/2792ca40f1e92849247c.js +0 -1
  472. package/assets/esri/core/workers/chunks/2a96f1bba9ce6883e5e0.js +0 -1
  473. package/assets/esri/core/workers/chunks/3231ee3e090bb4cac3fc.js +0 -1
  474. package/assets/esri/core/workers/chunks/36a3f6fb4d1d18fcb642.js +0 -1
  475. package/assets/esri/core/workers/chunks/36e250278b5622ccf068.js +0 -1
  476. package/assets/esri/core/workers/chunks/395ba088d4864588ff66.js +0 -1
  477. package/assets/esri/core/workers/chunks/3aa4194dc5497c57647f.js +0 -1
  478. package/assets/esri/core/workers/chunks/3cc77692b2eee27b9c9e.js +0 -1
  479. package/assets/esri/core/workers/chunks/40a1e713f63ec77110c0.js +0 -1
  480. package/assets/esri/core/workers/chunks/4385a268c2a64281d1c1.js +0 -1
  481. package/assets/esri/core/workers/chunks/46b4bb66a54bbd8e2e57.js +0 -1
  482. package/assets/esri/core/workers/chunks/4bfbf5a34c9207fdcf44.js +0 -1
  483. package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +0 -1
  484. package/assets/esri/core/workers/chunks/5d4863a92b03bebc1b54.js +0 -1
  485. package/assets/esri/core/workers/chunks/5d991b74d958005c26c4.js +0 -1
  486. package/assets/esri/core/workers/chunks/634b5ccd7a3ac67f855d.js +0 -1
  487. package/assets/esri/core/workers/chunks/662d13f68cf3ec92439b.js +0 -1
  488. package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
  489. package/assets/esri/core/workers/chunks/7bc5cc5dbf1b7b70ddac.js +0 -1
  490. package/assets/esri/core/workers/chunks/7d661129a0d8c466eeec.js +0 -1
  491. package/assets/esri/core/workers/chunks/8070972c0efb78523b68.js +0 -1
  492. package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +0 -1
  493. package/assets/esri/core/workers/chunks/8b6ab6202a40fe622833.js +0 -1
  494. package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +0 -1
  495. package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
  496. package/assets/esri/core/workers/chunks/98986e6601b0366376b4.js +0 -1
  497. package/assets/esri/core/workers/chunks/9cdcf9309d6feda70185.js +0 -1
  498. package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +0 -1
  499. package/assets/esri/core/workers/chunks/aace7e1fef256bb961c9.js +0 -1
  500. package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +0 -1
  501. package/assets/esri/core/workers/chunks/af5694b4d278cf1db2d9.js +0 -1
  502. package/assets/esri/core/workers/chunks/afbb4f802ca5774f0326.js +0 -1
  503. package/assets/esri/core/workers/chunks/b2c5f92e3d7606297ca9.js +0 -1
  504. package/assets/esri/core/workers/chunks/b8316c6469a543029bc6.js +0 -1
  505. package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +0 -1
  506. package/assets/esri/core/workers/chunks/ba6654a885be4b7a43f0.js +0 -1
  507. package/assets/esri/core/workers/chunks/bf0a65b4be31959f921d.js +0 -1
  508. package/assets/esri/core/workers/chunks/c11474b702dfb94e8e87.js +0 -1
  509. package/assets/esri/core/workers/chunks/c890c7fca27170e3341f.js +0 -1
  510. package/assets/esri/core/workers/chunks/c976785f2391c77d8a30.js +0 -1
  511. package/assets/esri/core/workers/chunks/ca2f5faa01d99c21ec14.js +0 -1
  512. package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +0 -1
  513. package/assets/esri/core/workers/chunks/cfbffa429d88e7709c3f.js +0 -1
  514. package/assets/esri/core/workers/chunks/d24c4fbc567486b1188f.js +0 -1
  515. package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
  516. package/assets/esri/core/workers/chunks/e4f93c55eaefab4192b5.js +0 -1
  517. package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
  518. package/assets/esri/core/workers/chunks/ec89466f76d0ba22525e.js +0 -1
  519. package/assets/esri/core/workers/chunks/ee45618c45806ab654cb.js +0 -1
  520. package/assets/esri/core/workers/chunks/f467c8f1fce22f6f599c.js +0 -1
  521. package/assets/esri/core/workers/chunks/f4baa5ea2e42b1317941.js +0 -1
  522. package/assets/esri/core/workers/chunks/face43cf5abcd2f5bd9d.js +0 -1
  523. package/assets/esri/core/workers/chunks/ffaf091c6023225cf5aa.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{destroyMaybe as r,get as s,isNone as i}from"../../../core/maybe.js";import{whenOnce as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as a}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as u}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import p from"../../../rest/support/Query.js";import{DrapeSourceType as c}from"./interfaces.js";import d from"./graphics/Graphics3DFeatureProcessor.js";import h from"./graphics/QueryEngine.js";import{toViewIfLocal as y}from"./support/projectExtentUtils.js";import{UpdatePolicy as m}from"../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as g}from"../../support/Scheduler.js";const f=f=>{let E=class extends f{constructor(){super(...arguments),this.controller=null,this.updatePolicy=m.SYNC,this.suspendResumeExtentMode="computed",this.slicePlaneEnabled=!1,this.drapeSourceType=c.Features,this.fullExtentInLocalViewSpatialReference=null,this.suspendResumeExtent=null,this._controllerCreated=!1,this.clippingExtent=null,this.supportsHeightUnitConversion=!0,this.pendingController=null,this.queryEngine=null}initialize(){const e=this.layer;if("isTable"in e&&e.isTable)return void this.addResolvingPromise(Promise.reject(new t("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e})));this.addResolvingPromise(this._validateGeometryType());const r=new d({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentVisibilityEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:e=>this._updateClippingExtent(e)});this._set("processor",r),this.addResolvingPromise((async()=>{await r.setup(),this.queryEngine=new h({layerView:this,priority:g.FEATURE_QUERY_ENGINE})})()),this.addResolvingPromise((async()=>{const e=await y(this);this.fullExtentInLocalViewSpatialReference=e,await this._initializeController()})()),this.updatingHandles.add((()=>this.updatePolicy),(e=>this.processor.preferredUpdatePolicy=e)),this.notifyChange("updating")}destroy(){this._destroyPendingController(),this.controller=r(this.controller),this._set("processor",r(this.processor)),this.queryEngine=r(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this.pendingController=r(this.pendingController)}get legendEnabled(){var e,t;return this.canResume()&&!(null!=(e=this.processor)&&null!=(t=e.frustumVisibility)&&t.suspended)}getGraphicFromGraphicUid(e){var t;let r=null;return null==(t=this.loadedGraphics)||t.forEach((t=>{t.uid===e&&(r=a(t,this.layer))})),r}whenGraphicBounds(e,t){var r;return null==(r=this.processor)?void 0:r.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){var r;return null==(r=this.processor)?void 0:r.computeAttachmentOrigin(e,t)}queryFeatures(e,t){return this.queryEngine.executeQuery(this._ensureQuery(e),s(t,"signal"))}queryObjectIds(e,t){return this.queryEngine.executeQueryForIds(this._ensureQuery(e),s(t,"signal"))}queryFeatureCount(e,t){return this.queryEngine.executeQueryForCount(this._ensureQuery(e),s(t,"signal"))}queryExtent(e,t){return this.queryEngine.executeQueryForExtent(this._ensureQuery(e),s(t,"signal"))}_ensureQuery(e){return i(e)?this.createQuery():p.from(e)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}maskOccludee(e){return this.processor.maskOccludee(e)}canResume(){var e;return super.canResume()&&!(null!=(e=this.processor)&&e.suspended)}getSuspendInfo(){const e=super.getSuspendInfo();return this.processor?{...e,...this.processor.suspendInfo}:e}isUpdating(){var e,t,r;return!(!this.processor||this.processor.destroyed)&&!(this._controllerCreated&&(null==(e=this.controller)||!e.updating)&&null!=(t=this.view)&&null!=(r=t.basemapTerrain)&&r.ready&&!this.processor.updating)}async _initializeController(){const e=this.createController();this.pendingController=e,await e.when(),this._setControllerWhenInitialized(e)}async _setControllerWhenInitialized(e){try{await this.when()}catch(t){}this._controllerCreated=!0,this.notifyChange("updating"),this.isResolved()&&!this.destroyed?(await o((()=>{var e,t;return null==(e=this.view)||null==(t=e.basemapTerrain)?void 0:t.ready})),this.beforeSetController(e),this.pendingController=null,this.controller=e,this.loadedGraphics=e.graphics,this.notifyChange("updating")):this._destroyPendingController()}_updateClippingExtent(e){if(this.clippingExtent=e,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=e,!0}}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":return Promise.reject(new t("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType}))}}_getResourceInfo(){var e,t;const r=this.controller instanceof u?this.controller:null;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:null!=(e=null==r?void 0:r.maximumNumberOfFeatures)?e:-1,totalNumberOfFeatures:null!=(t=null==r?void 0:r.serviceDataCount)?t:-1,nodes:0,...this.processor.performanceInfo}}get performanceInfo(){return this._getResourceInfo()}};return e([n()],E.prototype,"loadedGraphics",void 0),e([n()],E.prototype,"suspended",void 0),e([n({readOnly:!0})],E.prototype,"legendEnabled",null),e([n()],E.prototype,"updating",void 0),e([n()],E.prototype,"controller",void 0),e([n()],E.prototype,"processor",void 0),e([n({readOnly:!0})],E.prototype,"updatePolicy",void 0),e([n({readOnly:!0})],E.prototype,"suspendResumeExtentMode",void 0),e([n({type:Boolean})],E.prototype,"slicePlaneEnabled",void 0),e([n({readOnly:!0})],E.prototype,"suspendInfo",void 0),E=e([l("esri.views.3d.layers.FeatureLikeLayerView3D")],E),E};export{f as FeatureLikeLayerView3D};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as t,get as s,isNone as i}from"../../../core/maybe.js";import{whenOnce as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as a}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as p}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import u from"../../../rest/support/Query.js";import{DrapeSourceType as c}from"./interfaces.js";import h from"./graphics/Graphics3DFeatureProcessor.js";import d from"./graphics/QueryEngine.js";import{toViewIfLocal as y}from"./support/projectExtentUtils.js";import{UpdatePolicy as m}from"../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as g}from"../../support/Scheduler.js";const f=f=>{let v=class extends f{constructor(){super(...arguments),this.controller=null,this.updatePolicy=m.SYNC,this.suspendResumeExtentMode="computed",this.slicePlaneEnabled=!1,this.drapeSourceType=c.Features,this.fullExtentInLocalViewSpatialReference=null,this.suspendResumeExtent=null,this._controllerCreated=!1,this.clippingExtent=null,this.supportsHeightUnitConversion=!0,this.pendingController=null,this.queryEngine=null}initialize(){const e=this.layer;if("isTable"in e&&e.isTable)return void this.addResolvingPromise(Promise.reject(new r("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e})));this.addResolvingPromise(this._validateGeometryType());const t=new h({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentVisibilityEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:e=>this._updateClippingExtent(e)});this._set("processor",t),this.addResolvingPromise((async()=>{await t.setup(),this.queryEngine=new d({layerView:this,priority:g.FEATURE_QUERY_ENGINE})})()),this.addResolvingPromise((async()=>{const e=await y(this);this.fullExtentInLocalViewSpatialReference=e,await this._initializeController()})()),this.updatingHandles.add((()=>this.updatePolicy),(e=>this.processor.preferredUpdatePolicy=e)),this.notifyChange("updating")}destroy(){this._destroyPendingController(),this.controller=t(this.controller),this._set("processor",t(this.processor)),this.queryEngine=t(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this.pendingController=t(this.pendingController)}get legendEnabled(){var e;return this.canResume()&&(null==(e=this.processor)?void 0:e.legendEnabled)}get graphics3DProcessor(){var e;return"graphics-3d"===(null==(e=this.processor)?void 0:e.type)?this.processor:null}get heatmapProcessor(){var e;return"heatmap"===(null==(e=this.processor)?void 0:e.type)?this.processor:null}getGraphicFromGraphicUid(e){var r;let t=null;return null==(r=this.loadedGraphics)||r.forEach((r=>{r.uid===e&&(t=a(r,this.layer))})),t}whenGraphicBounds(e,r){var t;return null==(t=this.processor)?void 0:t.whenGraphicBounds(e,r)}computeAttachmentOrigin(e,r){var t;return null==(t=this.processor)?void 0:t.computeAttachmentOrigin(e,r)}queryFeatures(e,r){return this.queryEngine.executeQuery(this._ensureQuery(e),s(r,"signal"))}queryObjectIds(e,r){return this.queryEngine.executeQueryForIds(this._ensureQuery(e),s(r,"signal"))}queryFeatureCount(e,r){return this.queryEngine.executeQueryForCount(this._ensureQuery(e),s(r,"signal"))}queryExtent(e,r){return this.queryEngine.executeQueryForExtent(this._ensureQuery(e),s(r,"signal"))}_ensureQuery(e){return i(e)?this.createQuery():u.from(e)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}maskOccludee(e){return this.processor.maskOccludee(e)}canResume(){var e;return super.canResume()&&!(null!=(e=this.processor)&&e.scaleVisibilitySuspended)}getSuspendInfo(){const e=super.getSuspendInfo();return this.processor?{...e,...this.processor.suspendInfo}:e}isUpdating(){var e,r,t;return!(!this.processor||this.processor.destroyed)&&!(this._controllerCreated&&(null==(e=this.controller)||!e.updating)&&null!=(r=this.view)&&null!=(t=r.basemapTerrain)&&t.ready&&!this.processor.updating)}async _initializeController(){const e=this.createController();this.pendingController=e,await e.when(),this._setControllerWhenInitialized(e)}async _setControllerWhenInitialized(e){try{await this.when()}catch(r){}this._controllerCreated=!0,this.notifyChange("updating"),this.isResolved()&&!this.destroyed?(await o((()=>{var e,r;return null==(e=this.view)||null==(r=e.basemapTerrain)?void 0:r.ready})),this.beforeSetController(e),this.pendingController=null,this.controller=e,this.loadedGraphics=e.graphics,this.notifyChange("updating")):this._destroyPendingController()}_updateClippingExtent(e){if(this.clippingExtent=e,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=e,!0}}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":return Promise.reject(new r("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType}))}}_getResourceInfo(){var e,r;const t=this.controller instanceof p?this.controller:null;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:null!=(e=null==t?void 0:t.maximumNumberOfFeatures)?e:-1,totalNumberOfFeatures:null!=(r=null==t?void 0:t.serviceDataCount)?r:-1,nodes:0,...this.processor.performanceInfo}}get performanceInfo(){return this._getResourceInfo()}};return e([n()],v.prototype,"loadedGraphics",void 0),e([n()],v.prototype,"suspended",void 0),e([n({readOnly:!0})],v.prototype,"legendEnabled",null),e([n()],v.prototype,"updating",void 0),e([n()],v.prototype,"controller",void 0),e([n()],v.prototype,"processor",void 0),e([n({readOnly:!0})],v.prototype,"updatePolicy",void 0),e([n({readOnly:!0})],v.prototype,"suspendResumeExtentMode",void 0),e([n({type:Boolean})],v.prototype,"slicePlaneEnabled",void 0),e([n({readOnly:!0})],v.prototype,"suspendInfo",void 0),e([n()],v.prototype,"graphics3DProcessor",null),e([n()],v.prototype,"heatmapProcessor",null),v=e([l("esri.views.3d.layers.FeatureLikeLayerView3D")],v),v};export{f as FeatureLikeLayerView3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as s}from"../../../chunks/tslib.es6.js";import{isSome as e}from"../../../core/maybe.js";import{whenTrueOnce as r,init as i,watch as t}from"../../../core/watchUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as p}from"./interfaces.js";import{LayerView3D as n}from"./LayerView3D.js";import c from"./graphics/Graphics3DFrustumVisibility.js";import h from"./graphics/GraphicsProcessor.js";import{enlargeExtent as u}from"./graphics/graphicUtils.js";import{toViewIfLocal as l}from"./support/projectExtentUtils.js";import{UpdatePolicy as d}from"../webgl-engine/lib/basicInterfaces.js";import m from"../../layers/LayerView.js";const y=1.2;let g=class extends(n(m)){constructor(){super(...arguments),this.type="graphics-3d",this.frustumVisibility=new c,this.slicePlaneEnabled=!1,this.drapeSourceType=p.Features,this.suspendResumeExtent=null,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set("processor",new h({owner:this,layer:this.layer,scaleVisibilityEnabled:!0})),this.processor.setup(),this.frustumVisibility.setup(this),this._setupSuspendResumeExtent(),this.updatingHandles.add((()=>this.fullOpacity),(()=>this.processor.graphicsCore.opacityChange())),this.handles.add(this.layer.on("graphic-update",(s=>this.processor.graphicsCore.graphicUpdateHandler(s)))),this.addResolvingPromise(l(this).then((s=>this.fullExtentInLocalViewSpatialReference=s))),this.layer.internal?this.notifyChange("updating"):this.handles.add(r(this.view,"basemapTerrain.ready",(()=>this.notifyChange("updating"))))}destroy(){this.frustumVisibility&&(this.frustumVisibility.destroy(),this._set("frustumVisibility",null)),this.processor&&(this.processor.destroy(),this._set("processor",null))}get legendEnabled(){return this.canResume()&&!this.frustumVisibility.suspended}getSuspendInfo(){var s;const r=super.getSuspendInfo();return e(this.processor.scaleVisibility)&&this.processor.scaleVisibility.suspended&&(r.outsideScaleRange=!0),r.outsideOfView=!(null==(s=this.frustumVisibility)||!s.suspended),r}async fetchPopupFeatures(s,r){return e(r)?r.clientGraphics:null}notifyGraphicGeometryChanged(s){this.processor.graphicsCore.notifyGraphicGeometryChanged(s)}notifyGraphicVisibilityChanged(s){this.processor.graphicsCore.notifyGraphicVisibilityChanged(s)}get graphics3DGraphics(){var s;return null==(s=this.processor)?void 0:s.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var s;return null==(s=this.processor)?void 0:s.graphics3DGraphicsByObjectID}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getGraphicFromGraphicUid(s){return this.processor.getGraphicFromGraphicUid(s)}whenGraphicBounds(s,e){return this.processor.whenGraphicBounds(s,e)}computeAttachmentOrigin(s,e){return this.processor?this.processor.graphicsCore.computeAttachmentOrigin(s,e):null}getSymbolLayerSize(s,e){return this.processor.getSymbolLayerSize(s,e)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(s){return this.processor.maskOccludee(s)}highlight(s){return this.processor.highlight(s)}get updatePolicy(){var s;return(null==(s=this.processor)?void 0:s.graphicsCore.effectiveUpdatePolicy)||d.SYNC}canResume(){var s;return super.canResume()&&!(null!=(s=this.processor)&&s.suspended)}isUpdating(){var s,e;return!(!(this.processor&&this.processor.updating||this.frustumVisibility&&this.frustumVisibility.updating)&&(this.layer.internal||null!=(s=this.view)&&null!=(e=s.basemapTerrain)&&e.ready))}_setupSuspendResumeExtent(){const s=()=>{this.suspendResumeExtent=u(this.processor.graphicsCore.computedExtent,this.suspendResumeExtent,y,this.processor.graphicsCore.extentPadding),this.frustumVisibility.setExtent(this.suspendResumeExtent)};i(this.processor.graphicsCore,"computedExtent",(()=>s()),!0),t(this.processor.graphicsCore,"extentPadding",(()=>s()),!0)}get performanceInfo(){return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:this.processor.elevationAlignment.updating,visibilityFrustum:!this.frustumVisibility.suspended}}};s([o({aliasOf:"layer.graphics"})],g.prototype,"loadedGraphics",void 0),s([o({readOnly:!0})],g.prototype,"suspended",void 0),s([o({readOnly:!0})],g.prototype,"legendEnabled",null),s([o({readOnly:!0})],g.prototype,"updating",void 0),s([o()],g.prototype,"layer",void 0),s([o({readOnly:!0})],g.prototype,"frustumVisibility",void 0),s([o({readOnly:!0})],g.prototype,"processor",void 0),s([o({type:Boolean})],g.prototype,"slicePlaneEnabled",void 0),g=s([a("esri.views.3d.layers.GraphicsLayerView3D")],g);const f=g;export{f as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{destroyMaybe as s,isSome as t}from"../../../core/maybe.js";import{when as i,watch as r,syncAndInitial as o,sync as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as l}from"./interfaces.js";import{LayerView3D as u}from"./LayerView3D.js";import c from"./graphics/Graphics3DFrustumVisibility.js";import{GraphicsProcessor as h}from"./graphics/GraphicsProcessor.js";import{enlargeExtent as d}from"./graphics/graphicUtils.js";import{toViewIfLocal as m}from"./support/projectExtentUtils.js";import{UpdatePolicy as y}from"../webgl-engine/lib/basicInterfaces.js";import g from"../../layers/LayerView.js";const f=1.2;let b=class extends(u(g)){constructor(){super(...arguments),this.type="graphics-3d",this.frustumVisibility=new c,this.slicePlaneEnabled=!1,this.drapeSourceType=l.Features,this.suspendResumeExtent=null,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set("processor",new h({owner:this,scaleVisibilityEnabled:!0})),this.processor.setup(),this.frustumVisibility.setup(this.processor),this._setupSuspendResumeExtent(),this.updatingHandles.add((()=>this.fullOpacity),(()=>this.processor.graphicsCore.opacityChange())),this.handles.add(this.layer.on("graphic-update",(e=>this.processor.graphicsCore.graphicUpdateHandler(e)))),this.addResolvingPromise(m(this).then((e=>this.fullExtentInLocalViewSpatialReference=e))),this.layer.internal?this.notifyChange("updating"):this.handles.add(i((()=>{var e,s;return null==(e=this.view)||null==(s=e.basemapTerrain)?void 0:s.ready}),(()=>()=>this.notifyChange("updating")),{once:!0}))}destroy(){this.handles.removeAll(),this._set("frustumVisibility",s(this.frustumVisibility)),this._set("processor",s(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){return this.canResume()&&!this.frustumVisibility.suspended}getSuspendInfo(){var e,s;const i=super.getSuspendInfo();return t(this.processor.scaleVisibility)&&this.processor.scaleVisibility.suspended&&(i.outsideScaleRange=!0),i.outsideOfView=null!=(e=null==(s=this.frustumVisibility)?void 0:s.suspended)&&e,i}async fetchPopupFeatures(e,s){return t(s)?s.clientGraphics:null}getGraphicFromGraphicUid(e){return this.processor.getGraphicFromGraphicUid(e)}whenGraphicBounds(e,s){return this.processor.whenGraphicBounds(e,s)}computeAttachmentOrigin(e,s){var t;return null==(t=this.processor)?void 0:t.computeAttachmentOrigin(e,s)}getSymbolLayerSize(e,s){return this.processor.getSymbolLayerSize(e,s)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e){return this.processor.highlight(e)}get updatePolicy(){var e;return(null==(e=this.processor)?void 0:e.graphicsCore.effectiveUpdatePolicy)||y.SYNC}canResume(){var e;return super.canResume()&&!(null!=(e=this.processor)&&e.scaleVisibilitySuspended)}isUpdating(){var e,s;return!(!(this.processor&&this.processor.updating||this.frustumVisibility&&this.frustumVisibility.updating)&&(this.layer.internal||null!=(e=this.view)&&null!=(s=e.basemapTerrain)&&s.ready))}_setupSuspendResumeExtent(){const e=()=>{this.suspendResumeExtent=d(this.processor.graphicsCore.computedExtent,this.suspendResumeExtent,f,this.processor.graphicsCore.extentPadding),this.frustumVisibility.setExtent(this.suspendResumeExtent)};this.handles.add(r((()=>{var e,s;return null==(e=this.processor)||null==(s=e.graphicsCore)?void 0:s.computedExtent}),(()=>e()),o)),this.handles.add(r((()=>{var e,s;return null==(e=this.processor)||null==(s=e.graphicsCore)?void 0:s.extentPadding}),(()=>e()),a))}get performanceInfo(){return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:this.processor.elevationAlignment.updating,visibilityFrustum:!this.frustumVisibility.suspended}}};e([n()],b.prototype,"loadedGraphics",null),e([n({readOnly:!0})],b.prototype,"legendEnabled",null),e([n()],b.prototype,"layer",void 0),e([n({readOnly:!0})],b.prototype,"frustumVisibility",void 0),e([n({readOnly:!0})],b.prototype,"processor",void 0),e([n({type:Boolean})],b.prototype,"slicePlaneEnabled",void 0),b=e([p("esri.views.3d.layers.GraphicsLayerView3D")],b);const v=b;export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../../chunks/tslib.es6.js";import s from"../../../core/Accessor.js";import{isSome as e}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as t}from"./interfaces.js";import p from"./graphics/GraphicsProcessor.js";import{GraphicsView as c}from"../../layers/GraphicsView.js";let a=class extends(c(s)){constructor(r){super(r),this.processor=null,this.slicePlaneEnabled=!1,this.drapeSourceType=t.Features}initialize(){const r="__sceneView.graphics-"+Date.now().toString(16),s={id:r,uid:r,type:"graphics-view-3d-proxy"};this._set("processor",new p({owner:this,layer:s})),this.processor.setup()}destroy(){this.processor&&(this.processor.destroy(),this._set("processor",null))}get updating(){var r;return!(null==(r=this.processor)||!r.updating)}notifyGraphicGeometryChanged(r){this.processor.graphicsCore.notifyGraphicGeometryChanged(r)}notifyGraphicVisibilityChanged(r){this.processor.graphicsCore.notifyGraphicVisibilityChanged(r)}get graphics3DGraphics(){return this.processor.graphicsCore.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.processor.graphicsCore.graphics3DGraphicsByObjectID}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getGraphicFromGraphicUid(r){return this.processor.getGraphicFromGraphicUid(r)}whenGraphicBounds(r,s){return this.processor.whenGraphicBounds(r,s)}graphicChanged(r){this.processor.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}queryGraphics(){return Promise.resolve(this.loadedGraphics)}async fetchPopupFeatures(r,s){return e(s)?s.clientGraphics:null}highlight(r){return this.processor.highlight(r)}maskOccludee(r){return this.processor.maskOccludee(r)}};r([o({readOnly:!0,aliasOf:"view.graphics"})],a.prototype,"graphics",void 0),r([o({aliasOf:"graphics"})],a.prototype,"loadedGraphics",void 0),r([o({readOnly:!0})],a.prototype,"updating",null),r([o({constructOnly:!0})],a.prototype,"view",void 0),r([o()],a.prototype,"processor",void 0),r([o({type:Boolean})],a.prototype,"slicePlaneEnabled",void 0),a=r([i("esri.views.3d.layers.GraphicsView3D")],a);const h=a;export{h as default};
5
+ import{_ as r}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{Identifiable as s}from"../../../core/Identifiable.js";import{destroyMaybe as o,isSome as t}from"../../../core/maybe.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as c}from"./interfaces.js";import{GraphicsProcessor as a}from"./graphics/GraphicsProcessor.js";import{GraphicsView as h}from"../../layers/GraphicsView.js";let n=class extends(h(e)){constructor(r){super(r),this.processor=null,this.slicePlaneEnabled=!1,this.layer=new l,this.drapeSourceType=c.Features}initialize(){this._set("processor",new a({owner:this})),this.processor.setup()}destroy(){this._set("processor",o(this.processor))}get graphics(){return this.view.graphics}get loadedGraphics(){return this.graphics}get updating(){var r;return!(null==(r=this.processor)||!r.updating)}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getGraphicFromGraphicUid(r){return this.processor.getGraphicFromGraphicUid(r)}whenGraphicBounds(r,e){return this.processor.whenGraphicBounds(r,e)}graphicChanged(r){this.processor.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}async queryGraphics(){return this.loadedGraphics}async fetchPopupFeatures(r,e){return t(e)?e.clientGraphics:null}highlight(r){return this.processor.highlight(r)}maskOccludee(r){return this.processor.maskOccludee(r)}};r([i({readOnly:!0})],n.prototype,"graphics",null),r([i()],n.prototype,"loadedGraphics",null),r([i({readOnly:!0})],n.prototype,"updating",null),r([i({constructOnly:!0})],n.prototype,"view",void 0),r([i()],n.prototype,"processor",void 0),r([i({type:Boolean})],n.prototype,"slicePlaneEnabled",void 0),r([i()],n.prototype,"layer",void 0),n=r([p("esri.views.3d.layers.GraphicsView3D")],n);class l extends s{constructor(){super(),this.type="graphics-view-3d-dummy",this.id=this.uid}}const u=n;export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{ByteSizeUnit as s}from"../../../core/byteSizeEstimations.js";import r from"../../../core/Collection.js";import o from"../../../core/has.js";import a from"../../../core/Logger.js";import{someMap as n}from"../../../core/MapUtils.js";import{unwrapOr as l,destroyMaybe as d,isSome as h,isNone as c,applySome as u,unwrap as _}from"../../../core/maybe.js";import m from"../../../core/PooledArray.js";import{throwIfAborted as g,createResolver as p}from"../../../core/promiseUtils.js";import{initial as f}from"../../../core/reactiveUtils.js";import{schedule as b}from"../../../core/scheduling.js";import{isArrayBuffer as y}from"../../../core/typedArrayUtil.js";import{getMetersPerVerticalUnitForSR as I}from"../../../core/unitUtils.js";import{init as v}from"../../../core/watchUtils.js";import{property as M}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as C}from"../../../core/accessorSupport/decorators/subclass.js";import{f as x}from"../../../chunks/mat3.js";import{c as O}from"../../../chunks/mat3f32.js";import{m as S,B as E}from"../../../chunks/mat4.js";import{b as j,c as w}from"../../../chunks/mat4f64.js";import{m as T,g as N}from"../../../chunks/vec3.js";import{c as D}from"../../../chunks/vec3f64.js";import{s as R}from"../../../chunks/vec4.js";import{projectBuffer as F,getProjectorName as A,localLinearScaleFactors as P,projectVectorToVector as V,projectBoundingSphere as U}from"../../../geometry/projection.js";import{create as H,empty as G,expandWithBuffer as L,toRect as B}from"../../../geometry/support/aaBoundingBox.js";import{create as k,intersects as q}from"../../../geometry/support/aaBoundingRect.js";import z from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as K}from"../../../layers/support/fieldUtils.js";import{areLabelsVisible as W}from"../../../layers/support/layerUtils.js";import $ from"../../../layers/support/SceneModification.js";import{getColor as X,getOpacity as Y}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{loadArcade as Q}from"../../../support/arcadeOnDemand.js";import J from"../../../symbols/Symbol3D.js";import{getMetersPerUnit as Z}from"../../../symbols/support/unitConversionUtils.js";import ee from"./I3SMeshViewLabeler.js";import{I3SMeshWorkerHandle as te,toWasmModification as ie}from"./I3SMeshWorkerHandle.js";import{ForAllFeaturesVisibilityMode as se,ForAllFeaturesReturnType as re}from"./II3SMeshView3D.js";import{initialize as oe,setModificationsSync as ae,filterObbsForModificationsSync as ne,interpretObbModificationResults as le}from"./SceneLayerWorker.js";import{overrideColor as de}from"./graphics/graphicUtils.js";import{TextureUsage as he,TextureEncoding as ce}from"./i3s/enums.js";import ue from"./i3s/Highlights.js";import{I3SAttributeOverrides as _e}from"./i3s/I3SAttributeOverrides.js";import{I3SCrossfadeHelper as me,NodeCrossfadeMetaData as ge}from"./i3s/I3SCrossfadeHelper.js";import pe from"./i3s/I3SElevationProvider.js";import{boundingBoxCornerPoints as fe}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as be}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as ye,selectEncoding as Ie,createTexture as ve,configureMaterial as Me}from"./i3s/I3SMaterialUtil.js";import{NodeIMModificationImpact as Ce,NodeState as xe}from"./i3s/I3SNode.js";import{computeGlobalTransformation as Oe,getLocalOrigin as Se}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Ee,checkSceneLayerValid as je,checkSceneLayerCompatibleWithView as we,getCacheKeySuffix as Te,whenGraphicAttributes as Ne,computeVisibilityObb as De,filterInPlace as Re,getCachedAttributeValue as Fe,intersectBoundingRectWithMbs as Ae,MbsIntersectResult as Pe,addWraparound as Ve,getSymbolInfo as Ue,transparentEdgeMaterial as He,getClipRect as Ge}from"./i3s/I3SUtil.js";import{IDBCache as Le}from"./i3s/IDBCache.js";import{attributeLookup as Be}from"./support/attributeUtils.js";import{ColorMixModeEnum as ke}from"./support/symbolColorUtils.js";import qe from"../support/debugFlags.js";import{toBoundingRect as ze}from"../support/extentUtils.js";import{create as Ke,clone as We}from"../support/orientedBoundingBox.js";import{updatingProgress as $e}from"../support/updatingProperties.js";import{glLayout as Xe}from"../support/buffer/glUtil.js";import{State as Ye}from"../webgl-engine/collections/Component/ComponentObject.js";import{createVertexBufferLayout as Qe}from"../webgl-engine/collections/Component/SourceGeometry.js";import{TextureCoordinateAttribute as Je}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{loadBasis as Ze}from"../webgl-engine/lib/BasisUtil.js";import{Transparency as et}from"../webgl-engine/lib/edgeRendering/interfaces.js";const tt=a.getLogger("esri.views.3d.layers.SceneLayerView3D"),it=[1,1,1,1];class st extends ge{constructor(e,t,i,s,r,o,a){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=a,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0,this.cachedSymbology=null}}var rt;!function(e){e[e.CastShadows=4]="CastShadows",e[e.Pickable=5]="Pickable"}(rt||(rt={}));const ot=19,at=100*s.MEGABYTES,nt=t=>{let s=class extends t{constructor(...e){super(e),this._elevationProvider=null,this._intersectionHandler=null,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._idbCache=new Le("esri-scenelayer-cache","geometries"),this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.filter=null,this.slicePlaneEnabled=!1,this._modifications=new Array,this._layerUrl="",this._cacheKeySuffix=null,this._arcade=null,this._tmpAttributeOnlyGraphic=new i(null,null,{}),this._crossfadeHelper=new me(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerUid(){return this.i3slayer&&this.i3slayer.uid}get sublayerUid(){return null}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Ee(this._currentRenderer)?this._usePBR()||this._hasLoadedPBRTextures?he.AllTexturesPBR:he.AllTextures:this._usePBR()||this._hasLoadedPBRTextures?he.GeometryTexturesPBR:he.GeometryTextures}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null!=e&&"absolute-height"===e.mode){const t=I(this.i3slayer.spatialReference),i=Z(e.unit);return l(e.offset,0)*i/t}return 0}get supportedTextureEncodings(){return ye(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){var e;const t=null==(e=this.view)?void 0:e.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled,i=0==(this.supportedTextureEncodings&ce.DDS_S3TC);return t&&i}initialize(){this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const e=this.view.resourceController;if(this.attributeOverrides=new _e(this.i3slayer,e.memoryController),this._worker=new te((t=>e.schedule(t))),this.addResolvingPromise(this._worker.promise),this._worker.setLegacySchema(this.layerUid,this.i3slayer.store.defaultGeometrySchema),je(this.i3slayer),we(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new z({layerView:this}),this.gpuMemoryEstimate=0,this.texMemoryEstimate=0,this.geoMemoryEstimate=0,this._stage=this.view._stage,this._collection=this._stage.renderView.componentObjectCollection,this._highlights=new ue({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,se.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)}),this._isIntegratedMesh||!this.i3slayer.store.defaultGeometrySchema)this._hasSymbolColors=!1;else{const e=this.i3slayer.store.defaultGeometrySchema.featureAttributes;this._hasSymbolColors=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=this.i3slayer.store.defaultGeometrySchema.vertexAttributes.color&&(null==this.i3slayer.cachedDrawingInfo||!this.i3slayer.cachedDrawingInfo.color),this._isIntegratedMesh||(this._edgeView=this._stage.renderView.ensureEdgeView());const t=this.view.resourceController.memoryController.newCache(this.i3slayer.uid,(e=>this._deleteComponentObject(e)));this._memCache=t;const i=e=>h(this._controller.index)&&h(this._controller.index.rootNode)?this._controller.index.traverse(this._controller.index.rootNode,(t=>{const i=t.index,s=this._nodeId2Meta.get(i)||this._nodeId2MetaReloading.get(i);return e(t,h(s)?s.objectHandle:null)})):()=>{};this._intersectionHandler=new be({layerUid:this.layerUid,sublayerUid:this.sublayerUid,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:i}),this._elevationProvider=new pe({layerView:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR(),this.updatingHandles.add((()=>this.view.clippingArea),(()=>this._clippingAreaChanged()),f),this.updatingHandles.add((()=>this.fullOpacity),(e=>this._opacityChange(e))),this.updatingHandles.add((()=>this.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(e))),this.updatingHandles.add((()=>this.elevationOffset),((e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()})),this.updatingHandles.add((()=>this.filter),(()=>this._filterChange()),f),this.updatingHandles.add((()=>this.view.qualitySettings.physicallyBasedRenderingEnabled),(()=>this._updatePBR()));const s=()=>{this._reloadAll(),this.clearMemCache()};this.updatingHandles.add((()=>this.rendererTextureUsage),s),this.updatingHandles.add((()=>this.uncompressedTextureDownsamplingEnabled),s),this.updatingHandles.add((()=>this.suspended),(e=>this._suspendedChange(e)),f),this.updatingHandles.add((()=>this.i3slayer.labelsVisible),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this.i3slayer.labelingInfo),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this._modifications),(()=>this._modificationsChanged()),f),this.handles.add([v(qe,"I3S_TREE_SHOW_TILES",(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&qe.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||qe.I3S_TREE_SHOW_TILES||(this._treeDebugger=d(this._treeDebugger))})),v(qe,"I3S_SHOW_MODIFICATIONS",(()=>this._showModifications()))]),this._cacheKeySuffix=Te(this.i3slayer.spatialReference,this.view.renderSpatialReference),this._idbCache.init().catch((e=>tt.warn(`Failed to initialize IndexedDB cache: ${e}`)))}destroy(){this._clearAddTasks(),this.attributeOverrides=d(this.attributeOverrides),this._elevationProvider&&(this._elevationProvider.layerChanged(),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._worker;e&&(e.destroyContext(this.i3slayer.uid).then((()=>e.destroy())),this._worker=null),this._removeAllNodeDataFromStage(),this._memCache=d(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=d(this._labeler),this._treeDebugger=d(this._treeDebugger),this._controller=d(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_memEstimateTextureAdded(e){const t=e.estimatedTexMemRequired;return this.gpuMemoryEstimate+=t,this.texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(h(e)){const t=e.estimatedTexMemRequired;this.gpuMemoryEstimate-=t,this.texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){const t=this._collection.getObjectGPUMemoryUsage(e);return this.gpuMemoryEstimate+=t,this.geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){const t=this._collection.getObjectGPUMemoryUsage(e);this.gpuMemoryEstimate-=t,this.geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}getUsedMemory(){let e=h(this._labeler)?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach((t=>e+=h(t)?t.node.memory:0)),this._nodeId2MetaReloading.forEach((t=>e+=h(t)?t.node.memory:0)),e}getUnloadedMemory(){return(h(this._controller)?this._controller.unloadedMemoryEstimate:0)+(h(this._labeler)?this._labeler.unloadedMemoryEstimate:0)}ignoresMemoryFactor(){return!1}_labelingChanged(){if(!(W(this.i3slayer)&&this._supportsLabeling))return void(h(this._labeler)&&(this._labeler.destroy(),this._labeler=null));if(h(this._labeler))return;const e=new ee({view:this.view,layer:this.i3slayer,collection:this._collection});this._nodeId2Meta.forEach((t=>h(t)&&this._addMetaToLabeler(e,t))),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then((e=>(--this._asyncModuleLoading,e)),(e=>{throw--this._asyncModuleLoading,e}))}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=oe().then((()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()})),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=this.i3slayer.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const i=ie(this._layerClippingArea,this._modifications,t);ae({context:e,modifications:i,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const s=this.hasModifications?new m:null;this._nodeId2Meta.forEach(((e,t)=>{c(e)?this._nodeId2Meta.delete(t):e.node.hasModifications?(this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):h(s)&&s.push(e.node)})),h(s)&&this._nodeId2MetaReloading.forEach((e=>s.push(e.node))),h(s)&&s.length>0&&(this.updateNodeModificationStatus(s),s.forAll((e=>{if(e.imModificationImpact!==Ce.Culled){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),this._nodeId2Meta.delete(e.index),h(t)&&this._nodeId2MetaReloading.set(e.index,t)}}))),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(h(this._modificationGraphics)&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!qe.I3S_SHOW_MODIFICATIONS||0===this._modifications.length)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={type:"simple-fill",outline:{color:[255,255,255],width:1}};this._modificationGraphics=new Array;for(const s of this._modifications){s.geometry.spatialReference=this.i3slayer.spatialReference;const r={...t,color:e[s.type]};this._modificationGraphics.push(new i({geometry:s.geometry,symbol:r}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,((e,t)=>this._createAttributes(e,t)))}_suspendedChange(e){e?(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler)):(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);h(i)&&h(i.attributeInfo)&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);h(s)&&(await this.attributeOverrides.apply(s.featureIds,t,i),s.attributeInfo=t,this._attributeValuesChanged(s))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.filteredIds=null,h(this._labeler)&&this._labeler.setNodeMetaAttributes(e,((e,t)=>this._createAttributes(e,t))),this._updateEngineObject(e)}clearMemCache(){h(this._memCache)&&this._memCache.clear()}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach((t=>h(t)&&e.push(t.node))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach(((t,i)=>e.push(i))),this._nodeId2MetaReloading.forEach(((t,i)=>e.push(i)))}_preLoadBasis(){!o("disable-feature:i3s-basis")&&0!=(this.supportedTextureEncodings&ce.Basis)&&u(this.i3slayer.textureSetDefinitions,(e=>e.some((e=>e.formats.some((e=>"basis"===e.format||"ktx2"===e.format))))))&&Ze()}_getVertexBufferLayout(e,t){const i={hasTexture:gt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion};return Xe(Qe(this._getGeometryParameters(i)))}_getObjectIdField(){return this.i3slayer.objectIdField||"OBJECTID"}_findGraphicNodeAndIndex(e){const t=Be(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());let i=null;return n(this._nodeId2Meta,(e=>{if(c(e))return!1;const s=e.featureIds.indexOf(t);return-1!==s&&(i={node:e.node,index:s},!0)})),i}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(c(i))return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const a of t){const e=Be(o,a.attributes,r),t=i.featureIds.indexOf(e);-1!==t&&s.push(t)}return s}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const i=this._nodeId2Meta.get(t.node.index);if(c(i))return Promise.reject();const s=i.objectHandle,r=fe(t.index,this._collection,s,new Float64Array(24)),o=this.view.renderSpatialReference,a=this.view.spatialReference;if(F(r,o,0,r,a,0,8)){const e=G();return L(e,r,0,8),Promise.resolve({boundingBox:e,screenSpaceObjects:[]})}}whenGraphicAttributes(e,t){return Ne(this.i3slayer,e,this._getObjectIdField(),t,(()=>[...this._nodeId2Meta.values()].filter(h)))}getGraphicFromIntersectorTarget(e){if(null==e.nodeIndex||null==e.componentIndex)return null;const t=this._nodeId2Meta.get(e.nodeIndex);return c(t)||null==t.featureIds||e.componentIndex>=t.featureIds.length?null:this._createGraphic(e.componentIndex,t)}_getCacheKey(e){return`${this._layerUrl}/v${ot}/${e.id}${this._cacheKeySuffix}`}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(e){return h(this._memCache)?this._memCache.pop(this._getMemCacheKey(e.index)):null}deleteCachedGPUData(e){h(e)&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(c(this._memCache))return void this._deleteComponentObject(e);const i=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,e.node.memory,i)}loadMissingTextures(e,t,i,s){const r=e.filter(((e,i)=>{if(0==(e.usage&this.rendererTextureUsage))return!1;if(c(t))return!0;const s=Ie(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(c(r)||null==r.data||s&&r.encoding!==s.encoding)}));return 0===r.length?Promise.resolve(!1):i(r,s).then((i=>{let s=0;for(let r=0;r<e.length;r++)s<i.length&&i[s].id===e[r].id&&(t[r]=i[s],s++);return!0}))}loadCachedNodeData(e,t,i){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e),t).then((s=>null==s?null:s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e)),null):(e.geometryObb=s.geometryObb,this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then((i=>(i&&this._idbCache.initialized&&h(s.textureData)&&(s.byteSize=bt(s.transformedGeometry,s.textureData),s.textureData.every(ft)&&yt(e,s)&&this._idbCache.put(this._getCacheKey(e),s).catch((t=>tt.warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`)))),g(t),s)))))):Promise.resolve(null)}addNode(e,t,i){return pt(t)?this._addData(e,t.attributeDataInfo,(()=>this._transformNode(e,t,i).then((s=>this._safeReschedule((()=>{if(c(s))return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:o,featureIds:a,transformedGeometry:n}=s,l=this._controller.crsIndex,d=this.view.renderSpatialReference,u=Oe(e.mbs,this.elevationOffset,l,d);e.geometryObb=Ke([r.center.x,r.center.y,r.center.z],[r.extents.x,r.extents.y,r.extents.z],[r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w]),T(e.geometryObb.center,e.geometryObb.center,u),t.geometryData.componentOffsets=o,a&&(t.geometryData.featureIds=Array.prototype.slice.call(a));const _={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:n,globalTrafo:u,geometryObb:e.geometryObb,byteSize:bt(n,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&yt(e,_)){const t=h(_.textureData)?_.textureData.map((e=>ft(e)?e:null)):null;this._idbCache.put(this._getCacheKey(e),{..._,textureData:t}).catch((t=>tt.warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`)))}return this._addCachedNodeData(e,_,i)}),i))))):Promise.reject()}computeVisibilityObb(e){return De(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications)}_transformNode(e,t,i){const s=t.geometryData.geometries,r=new Array(s.length);for(let c=0;c<s.length;++c)r[c]=this._getVertexBufferLayout(s[c],t.geometryDescriptor);const o=e.mbs,a=this.elevationOffset,n=this._controller.crsIndex,l=this._controller.crsVertex,d=this.view.renderSpatialReference,h=Se(o,a,n),u=Oe(o,a,n,d),_=A(n,l),m=A(l,d);if(c(_)||c(m))return Promise.resolve(null);const g={context:this.i3slayer.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,localOrigin:h,globalTrafo:u,mbs:o,obb:e.serviceObb,elevationOffset:a,needNormals:!this._isIntegratedMesh&&this._controller.isMeshPyramid,normalReferenceFrame:this.i3slayer.normalReferenceFrame||"none",indexToVertexProjector:_,vertexToRenderProjector:m};return this._worker.invoke(g,i)}get supportsNodeCrossFading(){var e,t;return!(null!=(e=this.view)&&null!=(t=e._stage)&&t.renderView.hasShadowsEnabled)}get nodeCrossfadingEnabled(){return this.supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this.supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){const t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,i){if(e.geometryObb=We(this._collection.getComponentObb(t.objectHandle)),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);h(this._labeler)&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,Ye.Visible),this._updateMaterial(t),this._setNewNodeOpacity(t),this._updateEngineObject(t),this._highlights.objectCreated(t),h(this._treeDebugger)&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,(()=>this._addCachedNodeData(e,t,s)))}async _addCachedNodeData(e,t,i){if(this.suspended||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(c(t))return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:a,globalTrafo:n}=t;await this.attributeOverrides.apply(r.featureIds,s.attributeInfo,i);const l=h(t.textureData)?t.textureData.filter((e=>h(e)&&0!=(e.usage&this.rendererTextureUsage))):[];!o("disable-feature:i3s-basis")&&l.some((e=>h(e)&&(e.encoding===ce.Basis||e.encoding===ce.KTX2)))&&await Ze(),e.memory=0;const{componentOffsets:d,geometries:u,featureIds:m}=r,g=this._collection,p=u[0],{layout:f,indices:b,interleavedVertexData:y,positionData:I,hasColors:v}=a,M=this._materialParameters(p,f),C=d||new Uint32Array([0,b?b.length:y.byteLength/f[0].stride]),T={vertices:{data:y,count:y.byteLength/f[0].stride,layoutParameters:M.geometryParams},positionData:{positions:I.data,indices:I.indices},indices:b,componentOffsets:C},N=p.transformation?j(p.transformation):w();S(N,n,N);const R=E(D(),N),F=x(O(),N),A=this.view.renderSpatialReference,U=this.view.basemapTerrain.spatialReference,H=D(),G=[1,1,1];P(R,A,G,U)||tt.errorOnce("Unsupported coordinate system for IM overlay"),V(R,A,H,U);const L=g.createObject({toMapSpace:[H[0],H[1],G[0],G[1]],geometry:T,obb:_(e.geometryObb),transform:{position:R,rotationScale:F}}),B=M.geometryParams.textureCoordinates===Je.AttributeType.Atlas,{textures:k,texturePromise:q}=this._initMaterialAndTextures(L,M.material,l,B);e.memory+=this._memEstimateGeometryAdded(L),e.memory+=k.reduce(((e,t)=>e+(h(t)?this._memEstimateTextureAdded(t):0)),0);const z=!!M.material.hasParametersFromSource,K="blend"!==M.material.alphaMode&&M.material.metallicRoughness.baseColorFactor[3]>=1,W=new st(e,m,L,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:z,isOpaque:K},k);s.meta=W,!this._hasTextures&&t.requiredTextures.some((({usage:e})=>0!=(e&he.ColorTextures)))&&(this._hasTextures=!0),this._hasData=!0,this._hasColors=this._hasColors||v,this._hasTextures=this._hasTextures||!!e.resources.texture,this.notifyChange("hasTexturesOrVertexColors");const $=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(W),q]).then((([t,s])=>(h(t)&&t.updateObjectVisibility(W.objectHandle,!1),this._safeReschedule((()=>{const i=this._addTasks.get(e.index);if(!i)return;if(h(this._labeler)&&this._addMetaToLabeler(this._labeler,W),this._addNodeMeta(e.index,W),i.meta=null,this.suspended)return void this._removeNodeStageData(e.index,this.elevationOffset);g.setObjectVisibility(L,Ye.Visible),h(t)&&t.updateObjectVisibility(W.objectHandle,!0),W.attributeInfo=i.attributeInfo;const s=W.cachedRendererVersion!==this._rendererVersion,r=$!==this.slicePlaneEnabled;this._setObjectSymbolColors(W);const o=this._applyFiltersToNode(W);(s||h(t)&&(r||o))&&this._addOrUpdateEdgeRendering(W),this._visibleGeometryChanged(W),this._highlights.objectCreated(W),this._updateMaterial(W),this._setNewNodeOpacity(W),h(this._treeDebugger)&&this._treeDebugger.update()}),i)))).catch((e=>{throw h(s.meta)&&(this._cacheGPUData(s.meta),s.meta=null),e}))}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){tt.error("Removing duplicated node");const t=this._nodeId2Meta.get(e);h(t)&&this._deleteComponentObject(t)}h(t)&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Mt(t.cachedEdgeMaterials,0)),this._nodeId2Meta.set(e,t)}_safeReschedule(e,t){return g(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=e.params.material,s=t.some((e=>"uvRegion"===e.name)),r=t.some((e=>"normalCompressed"===e.name)),o=gt(i);return{geometryParams:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s){const r=this._stage.renderView,o=i.map((e=>ve(e,t,s,r)));this._stage.addMany(o);let a=null;return this._collection.updateMaterial(e,(e=>{a=Me(e,t,o,i,this.view._stage.renderView.textureRepository,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR(),isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(e)})),{textures:o,texturePromise:a}}_getGeometryParameters(e){return{textureCoordinates:e.hasTexture?e.hasRegions?Je.AttributeType.Atlas:Je.AttributeType.Default:Je.AttributeType.None,colors:this._hasVertexColors,normals:e.hasNormals&&!this._isIntegratedMesh}}_addData(e,t,i){let s=this._addTasks.get(e.index);return s?s.attributeInfo=t:(s={...p(),attributeInfo:t,meta:null},this._addTasks.set(e.index,s),i().then(s.resolve,s.reject).then((()=>this._addTasks.delete(e.index))).catch((t=>{throw this._addTasks.delete(e.index),t}))),s.promise}_clearAddTasks(){this._addTasks.forEach((e=>{h(e.meta)&&(this._cacheGPUData(e.meta),e.meta=null)})),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=k();this._renderClippingArea=ze(this.view.clippingArea,i,e)?i:null;const s=k();this._layerClippingArea=ze(this.view.clippingArea,s,t)?s:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}_geometryFilterChange(){this._controller.geometryFilterChanged(this.hasGeometryFilter)}get hasGeometryFilter(){return!1}_filterChange(){this._applyFilters(!1)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach((e=>{h(e)&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e))}))}getFilters(){const e=[],t=this._renderClippingArea;return h(t)&&e.push(((e,i)=>this._boundingRectFilter(e,i,t))),e}addSqlFilter(e,t,i){if(h(t)){const s=t.fieldNames;e.push(((e,r)=>this._sqlFilter(e,r,t,s,i)))}}_sqlFilter(e,t,i,s,r){const o={},a=this._createLayerGraphic(o),n=this.i3slayer.objectIdField,l=t.featureIds,d=h(t.attributeInfo)&&t.attributeInfo.attributeData;s.every((e=>null!=d[e]||e===n))&&Re(e,l,(e=>{o[n]=l[e];for(const i of s)i!==n&&(o[i]=Fe(d[i],e));try{return i.testFeature(a)}catch(t){return r(t),!1}}))}_boundingRectNodeTest(e,t){return U(e.node.mbs,this._controller.crsIndex,mt,this.view.renderSpatialReference),Ae(t,mt)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,lt),B(lt,dt),q(i,dt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(r===Pe.INSIDE)return;if(r===Pe.OUTSIDE)return void(e.length=0);const o=s.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const a=this._transformClippingArea(ht,i,t.objectHandle);Re(e,t.featureIds,(e=>this._boundingRectFeatureTest(t,e,a)))}_transformClippingArea(e,t,i){const s=this._collection.getObjectTransform(i),r=s.position,o=s.rotationScale;return e[0]=(t[0]-r[0])/o[0],e[1]=(t[1]-r[1])/o[4],e[2]=(t[2]-r[0])/o[0],e[3]=(t[3]-r[1])/o[4],e}_addOrUpdateEdgeRendering(e,t=!0){const i=this._edgeView;if(c(i))return Promise.resolve(null);const s=e.objectHandle,r=i.hasObject(s),{hasEdges:o,perFeatureEdgeMaterials:a}=this._getFilteredEdgeMaterials(e),n={slicePlaneEnabled:this.slicePlaneEnabled};if(o&&r){if(this.nodeCrossfadingEnabled){Mt(a,this.getNodeOpacity(e))}return i.updateAllComponentMaterials(s,a,n,t),i.updateObjectVisibility(s,!0),Promise.resolve(i)}return o&&!r?this._collection.addEdges(s,i,a,n).then((t=>(e.edgeMemoryUsage=t,e.node.memory+=t,i))):(!o&&r&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,i.removeObject(s)),Promise.resolve(null))}_applyFiltersToNode(e){return!!this._applyFiltersToNodeComponents(e)&&(h(this._labeler)&&this._labeler.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,i=0===t.getComponentCount(e.objectHandle).invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!i;if(this._updateCachedFilteredIds(e),e.filteredIds===e.featureIds)return!i;const s=this._computeFilteredComponentIndices(e);return t.setAllComponentVisibilities(e.objectHandle,s),!0}_updateCachedFilteredIds(e){null!=e.filteredIds&&e.appliedFilters===this._filters||(e.filteredIds=this._computeFilteredIds(e),e.appliedFilters=this._filters)}_computeFilteredIds(e){const t=e.featureIds.slice();for(const i of this._filters)if(i(t,e),0===t.length)break;return t.length===e.featureIds.length?e.featureIds:t}_computeFilteredComponentIndices(e){const t=new Array;return e.featureIds.forEach(((i,s)=>{e.filteredIds[t.length]===i&&t.push(s)})),t}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach(((t,i)=>this._removeNodeStageData(i,e))),this._nodeId2MetaReloading.forEach(((t,i)=>this._removeNodeStageData(i,e,this._nodeId2MetaReloading)))}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading)}_removeNodeStageData(e,t,i=this._nodeId2Meta){const s=i.get(e);c(s)?i.delete(e):(this._collection.setObjectVisibility(s.objectHandle,Ye.Hidden),h(this._edgeView)&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1),this._visibleGeometryChanged(s),h(this._labeler)&&this._labeler.removeNodeMeta(s),i.delete(e),this._highlights.objectDeleted(s),i===this._nodeId2Meta?(this._cacheGPUData(s,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(s)):this._deleteComponentObject(s),h(this._treeDebugger)&&this._treeDebugger.update())}_deleteComponentObject(e){if(h(this._edgeView)&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(const t of e.textures)this._memEstimateTextureRemoved(t),this._stage.remove(t)}updateNodeState(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._collection.updateMaterial(i.objectHandle,(e=>e.polygonOffsetEnabled=t===xe.Hole))}_invalidateAllSymbols(){this._rendererVersion=Ve(this._rendererVersion,1),this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return Ve(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=Ve(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.i3slayer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&"arcadeRequired"in e&&e.arcadeRequired&&(this._arcade=await Q()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:tt.warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.getSymbols())"mesh-3d"!==t.type&&tt.error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasSymbolColors&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getSymbolColors(e){this._hasSymbolColors&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(e,i)=>{const s=5*e;R(i.externalColor,t[s+0]/255,t[s+1]/255,t[s+2]/255,t[s+3]/255),i.externalColorMixMode=t[s+4]&(1<<rt.CastShadows)-1,i.castShadows=0!=(t[s+4]&1<<rt.CastShadows),i.pickable=0!=(t[s+4]&1<<rt.Pickable)}}_getSymbolInfo(e,t){const i=e&&e.getSymbol(t,{arcade:this._arcade});if(!(i instanceof J))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=Ue(i);return this._symbolInfos.set(s,r),r}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=h(this._symbologyOverrideFields)&&this._symbologyOverrideFields.length>0?h(this._rendererFields)&&this._rendererFields.length>0?K(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasSymbolColors)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=h(e.attributeInfo)&&e.attributeInfo.attributeData,o=null!=e.featureIds?this.i3slayer.objectIdField:null,a=null!=r&&h(this._symbologyFields)&&this._symbologyFields.length>0,n=a?[]:null,l=a?[]:null;if(a&&h(this._symbologyFields))for(const h of this._symbologyFields){const e=r[h];e&&(n.push(h),l.push(e))}e.cachedSymbology||(e.cachedSymbology=new Uint8Array(5*e.featureIds.length));const d={color:ut,castShadows:!0,pickable:!0,colorMixMode:ke.Multiply,edgeMaterial:null},u=this.fullOpacity,_=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):u;let m=null,g=et.OPAQUE,p=He,f=0;for(let b=0;b<e.featureIds.length;b++){if(null!=o&&(i[o]=e.featureIds[b]),a)for(let e=0;e<n.length;e++)i[n[e]]=Fe(l[e],b);const r=this._getSymbolInfo(s,t);let u=null,y=null;if(s&&"visualVariables"in s){if(this._colorVariable){const e=X(this._colorVariable,t,{color:_t,arcade:this._arcade});e&&(u=ut,u[0]=e.r/255,u[1]=e.g/255,u[2]=e.b/255,this._opacityVariable||null===e.a||(y=e.a))}this._opacityVariable&&(y=Y(this._opacityVariable,t,{arcade:this._arcade}))}if(r&&r.material){const e=r.material;u=c(u)||c(y)?de(u,y,e.color,e.alpha,it,ut):de(u,y,null,null,it,ut)}if(c(u)&&(u=ut,u[0]=1,u[1]=1,u[2]=1,u[3]=1),d.pickable=!0,d.castShadows=!r||r.castShadows,d.colorMixMode=r&&r.material?r.material.colorMixMode:ke.Multiply,d.edgeMaterial=r?r.edgeMaterial:null,h(this._symbologyOverride)&&(d.color=u,this._symbologyOverride(t,d),u=d.color),h(d.edgeMaterial)){const t=u[3]<=0?et.INVISIBLE:u[3]>=1&&(e.material.isOpaque||d.colorMixMode===ke.Replace)?et.OPAQUE:et.TRANSPARENT;d.edgeMaterial===m&&t===g||(p={...d.edgeMaterial,opacity:_,objectTransparency:t},m=d.edgeMaterial,g=t),e.cachedEdgeMaterials[b]=p}else e.cachedEdgeMaterials[b]=He;e.cachedSymbology[f+0]=Math.round(255*u[0]),e.cachedSymbology[f+1]=Math.round(255*u[1]),e.cachedSymbology[f+2]=Math.round(255*u[2]),e.cachedSymbology[f+3]=Math.round(255*u[3]),e.cachedSymbology[f+4]=d.colorMixMode|+d.castShadows<<rt.CastShadows|+d.pickable<<rt.Pickable,f+=5}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);if(this.nodeCrossfadingEnabled||Mt(t,this.fullOpacity),c(e.filteredIds)){return{hasEdges:t.some((e=>e!==He)),perFeatureEdgeMaterials:t}}let i=0,s=!1;const r=t.map(((t,r)=>e.featureIds[r]!==e.filteredIds[i]?He:(s=s||t!==He,i++,t)));return{hasEdges:s,perFeatureEdgeMaterials:r}}_setObjectSymbolColors(e){if(!this._hasSymbolColors)return;const t=e.objectHandle,i=this._getSymbolColors(e);this._collection.setComponentData(t,i),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>t.objectOpacity=e)),Mt(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))}))}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,(e=>{e.commonMaterialParameters.slicePlaneEnabled=this.slicePlaneEnabled,e.usePBR=this._usePBR(),this._updateMaterialOverlay(e)}))}_updateMaterialOverlay(e){}_updateEngineObject(e){this._setObjectSymbolColors(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),h(this._labeler)&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>{t.commonMaterialParameters.slicePlaneEnabled=e})),this._updateEdgeRendering(t,!1))}))}_updatePBR(){this._nodeId2Meta.forEach((e=>{c(e)||this._collection.updateMaterial(e.objectHandle,(e=>{e.usePBR=this._usePBR()}))})),this._hasLoadedPBRTextures=!0}_usePBR(){return!this._isIntegratedMesh&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){h(this._edgeView)&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_forAllFeatures(e,t,i=se.VISIBLE_ONLY){n(this._nodeId2Meta,(s=>{if(c(s))return!1;if(h(t)){switch(t(s)){case re.EXIT:return!0;case re.SKIP:return!1}}let r=re.CONTINUE;switch(i){case se.ALL:r=this._forAllFeaturesOfNode(s,e);break;case se.VISIBLE_ONLY:r=this._forVisibleFeaturesOfNode(s,e);break;case se.ALL_IN_CLIPPING_AREA:r=this._forAllFeaturesOfNodeInClippingArea(s,e)}return r===re.EXIT}))}_forAllFeaturesOfNode(e,t){let i=re.CONTINUE;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),i===re.EXIT)return i;return i}_forVisibleFeaturesOfNode(e,t){let i=re.CONTINUE;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,(r=>(i=t(s[r],r,e),i===re.CONTINUE))),i}_forAllFeaturesOfNodeInClippingArea(e,t){if(c(this._renderClippingArea))return this._forAllFeaturesOfNode(e,t);const i=this._boundingRectNodeTest(e,this._renderClippingArea);if(i===Pe.OUTSIDE)return re.CONTINUE;if(i===Pe.INSIDE)return this._forAllFeaturesOfNode(e,t);const s=re.CONTINUE,r=e.featureIds,o=e.objectHandle,a=Ge(this._renderClippingArea,this._collection.getObjectTransform(o));for(let n=0;n<r.length;n++){if(!this._boundingRectFeatureTest(e,n,a))continue;const i=t(r[n],n,e);if(i===re.EXIT)return i}return s}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=h(t.attributeInfo)&&t.attributeInfo.attributeData;if(h(s))for(const r of Object.keys(s))i[r]=Fe(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e){const t=this._highlights;if("number"==typeof e||e instanceof i?e=[e]:e instanceof r&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof i){const i=e,s=this.i3slayer.fieldsIndex,r=this._getObjectIdField(),o=i.map((e=>Be(s,e.attributes,r))),{set:a,handle:n}=t.acquireSet();return t.setFeatureIds(a,o),n}if("number"==typeof e[0]){const i=e,{set:s,handle:r}=t.acquireSet();return t.setFeatureIds(s,i),r}}return vt}_visibleGeometryChanged(e){this._elevationProvider&&(this._elevationProvider.objectChanged(e.node),null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=b((()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null}))))}get performanceInfo(){const e={displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null,index:0,nodes:this._nodeId2Meta.size,"Total GPU Memory Estimate":(this.gpuMemoryEstimate/1048576).toFixed(1)+"MB","Geometry Memory Estimate":(this.geoMemoryEstimate/1048576).toFixed(1)+"MB","Texture Memory Estimate":(this.texMemoryEstimate/1048576).toFixed(1)+"MB","Unloaded Memory Estimate":(this.getUnloadedMemory()/1048576).toFixed(1)+"MB"};return h(this._memCache)&&(e.MemCache=Math.round(100*this._memCache.hitRate)+"% hit"),this._controller&&(this._idbCacheEnabled&&(e.IDBCache=Math.round(100*this._idbCache.getHitRate())+"% hit"),this._controller.updateStats(e)),e}get test(){const e=this;return{controller:this._controller,labeler:this._labeler,get visibleObjectIds(){const t=[];return e._forAllFeatures((e=>(t.push(e),re.CONTINUE)),null,se.VISIBLE_ONLY),t.sort(((e,t)=>e-t)),t},get numNodes(){return e._nodeId2Meta.size}}}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return h(e)?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(((t,i)=>e(i,t)))}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);h(s)&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._setNodeOpacity(i,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,(e=>e.objectOpacity=t)),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(!h(this._edgeView)||!e.cachedEdgeMaterials)return;Mt(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t)}get hasModifications(){return this._isIntegratedMesh&&h(this._layerClippingArea)||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||!0!==this._i3sWasmLoaded)return;const i=this.i3slayer.uid,s=It(e);if(h(s)){const t={context:i,buffer:s.buffer};ne(t);const r=new Float64Array(s.buffer);e.forAll(((e,t)=>{const i=r[t],s=le(i);e.imModificationImpact=s,s!==Ce.Unmodified&&this._controller.invalidateGeometryVisibility(e.index)}))}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||h(this._labeler)&&this._labeler.updating||this._crossfadeHelper.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0}};return e([M()],s.prototype,"_hasLoadedPBRTextures",void 0),e([M()],s.prototype,"_asyncModuleLoading",void 0),e([M()],s.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([M()],s.prototype,"view",void 0),e([M()],s.prototype,"i3slayer",void 0),e([M()],s.prototype,"_controller",void 0),e([M()],s.prototype,"_labeler",void 0),e([M()],s.prototype,"updating",void 0),e([M()],s.prototype,"suspended",void 0),e([M()],s.prototype,"holeFilling",void 0),e([M($e)],s.prototype,"updatingProgress",void 0),e([M({readOnly:!0,aliasOf:"_controller.updatingProgress"})],s.prototype,"updatingProgressValue",void 0),e([M({readOnly:!0})],s.prototype,"hasTexturesOrVertexColors",null),e([M({readOnly:!0})],s.prototype,"rendererTextureUsage",null),e([M()],s.prototype,"filter",void 0),e([M({readOnly:!0})],s.prototype,"elevationOffset",null),e([M({type:Boolean})],s.prototype,"slicePlaneEnabled",void 0),e([M()],s.prototype,"supportedTextureEncodings",null),e([M()],s.prototype,"uncompressedTextureDownsamplingEnabled",null),e([M({type:[$]})],s.prototype,"_modifications",void 0),s=e([C("esri.views.3d.layers.I3SMeshView3D")],s),s},lt=H(),dt=k(),ht=k(),ct=Ke(),ut=[0,0,0,0],_t=new t([0,0,0,0]),mt=[0,0,0,0];function gt(e){const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function pt(e){return"geometryData"in e}function ft(e){return h(e)&&y(e.data)}function bt(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(h(t))for(const s of t)h(s)&&y(s.data)&&(i+=s.data.byteLength);return i}function yt(e,t){return t.byteSize>at?(tt.warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}function It(e){if(0===e.length)return null;const t=10*e.length,i=new Float64Array(t);return e.forAll(((e,t)=>{let s=e.serviceObb;c(s)&&(s=ct,N(s.center,e.mbs),s.halfSize[0]=s.halfSize[1]=s.halfSize[2]=e.mbs[3]);const r=10*t;i[r+0]=s.center[0],i[r+1]=s.center[1],i[r+2]=s.center[2],i[r+3]=s.halfSize[0],i[r+4]=s.halfSize[1],i[r+5]=s.halfSize[2],i[r+6]=s.quaternion[0],i[r+7]=s.quaternion[1],i[r+8]=s.quaternion[2],i[r+9]=s.quaternion[3]})),i}const vt={remove(){},pause(){},resume(){}};function Mt(e,t){e.forEach((e=>e.opacity=t))}export{nt as I3SMeshView3D};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{ByteSizeUnit as s}from"../../../core/byteSizeEstimations.js";import r from"../../../core/Collection.js";import o from"../../../core/has.js";import a from"../../../core/Logger.js";import{someMap as n}from"../../../core/MapUtils.js";import{unwrapOr as l,destroyMaybe as d,isSome as h,isNone as c,applySome as u,unwrap as _}from"../../../core/maybe.js";import m from"../../../core/PooledArray.js";import{throwIfAborted as g,createResolver as p}from"../../../core/promiseUtils.js";import{initial as f}from"../../../core/reactiveUtils.js";import{schedule as b}from"../../../core/scheduling.js";import{isArrayBuffer as y}from"../../../core/typedArrayUtil.js";import{getMetersPerVerticalUnitForSR as I}from"../../../core/unitUtils.js";import{init as v}from"../../../core/watchUtils.js";import{property as M}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as C}from"../../../core/accessorSupport/decorators/subclass.js";import{f as x}from"../../../chunks/mat3.js";import{c as O}from"../../../chunks/mat3f32.js";import{m as S,B as E}from"../../../chunks/mat4.js";import{b as j,c as w}from"../../../chunks/mat4f64.js";import{m as N,g as D}from"../../../chunks/vec3.js";import{c as R}from"../../../chunks/vec3f64.js";import{s as T}from"../../../chunks/vec4.js";import{projectBuffer as F,getProjectorName as A,localLinearScaleFactors as P,projectVectorToVector as V,projectBoundingSphere as U}from"../../../geometry/projection.js";import{create as H,empty as G,expandWithBuffer as L,toRect as B}from"../../../geometry/support/aaBoundingBox.js";import{create as k,intersects as q}from"../../../geometry/support/aaBoundingRect.js";import z from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as K}from"../../../layers/support/fieldUtils.js";import{areLabelsVisible as W}from"../../../layers/support/layerUtils.js";import $ from"../../../layers/support/SceneModification.js";import{getColor as X,getOpacity as Y}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{loadArcade as Q}from"../../../support/arcadeOnDemand.js";import J from"../../../symbols/Symbol3D.js";import{getMetersPerUnit as Z}from"../../../symbols/support/unitConversionUtils.js";import ee from"./I3SMeshViewLabeler.js";import{I3SMeshWorkerHandle as te,toWasmModification as ie}from"./I3SMeshWorkerHandle.js";import{ForAllFeaturesVisibilityMode as se,ForAllFeaturesReturnType as re}from"./II3SMeshView3D.js";import{initialize as oe,setModificationsSync as ae,filterObbsForModificationsSync as ne,interpretObbModificationResults as le}from"./SceneLayerWorker.js";import{overrideColor as de}from"./graphics/graphicUtils.js";import{TextureUsage as he,TextureEncoding as ce}from"./i3s/enums.js";import ue from"./i3s/Highlights.js";import{I3SAttributeOverrides as _e}from"./i3s/I3SAttributeOverrides.js";import{I3SCrossfadeHelper as me,NodeCrossfadeMetaData as ge}from"./i3s/I3SCrossfadeHelper.js";import pe from"./i3s/I3SElevationProvider.js";import{boundingBoxCornerPoints as fe}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as be}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as ye,selectEncoding as Ie,createTexture as ve,configureMaterial as Me}from"./i3s/I3SMaterialUtil.js";import{NodeIMModificationImpact as Ce,NodeState as xe}from"./i3s/I3SNode.js";import{computeGlobalTransformation as Oe,getLocalOrigin as Se}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Ee,checkSceneLayerValid as je,checkSceneLayerCompatibleWithView as we,getCacheKeySuffix as Ne,whenGraphicAttributes as De,computeVisibilityObb as Re,filterInPlace as Te,getCachedAttributeValue as Fe,intersectBoundingRectWithMbs as Ae,MbsIntersectResult as Pe,addWraparound as Ve,getSymbolInfo as Ue,transparentEdgeMaterial as He,getClipRect as Ge}from"./i3s/I3SUtil.js";import{IDBCache as Le}from"./i3s/IDBCache.js";import{attributeLookup as Be}from"./support/attributeUtils.js";import{ColorMixModeEnum as ke}from"./support/symbolColorUtils.js";import qe from"../support/debugFlags.js";import{toBoundingRect as ze}from"../support/extentUtils.js";import{create as Ke,clone as We}from"../support/orientedBoundingBox.js";import{updatingProgress as $e}from"../support/updatingProperties.js";import{glLayout as Xe}from"../support/buffer/glUtil.js";import{State as Ye}from"../webgl-engine/collections/Component/ComponentObject.js";import{createVertexBufferLayout as Qe}from"../webgl-engine/collections/Component/SourceGeometry.js";import{TextureCoordinateAttributeType as Je}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{loadBasis as Ze}from"../webgl-engine/lib/BasisUtil.js";import{Transparency as et}from"../webgl-engine/lib/edgeRendering/interfaces.js";const tt=a.getLogger("esri.views.3d.layers.SceneLayerView3D"),it=[1,1,1,1];class st extends ge{constructor(e,t,i,s,r,o,a){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=a,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0,this.cachedSymbology=null}}var rt;!function(e){e[e.CastShadows=4]="CastShadows",e[e.Pickable=5]="Pickable"}(rt||(rt={}));const ot=19,at=100*s.MEGABYTES,nt=t=>{let s=class extends t{constructor(...e){super(e),this._elevationProvider=null,this._intersectionHandler=null,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._idbCache=new Le("esri-scenelayer-cache","geometries"),this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.filter=null,this.slicePlaneEnabled=!1,this._modifications=new Array,this._layerUrl="",this._cacheKeySuffix=null,this._arcade=null,this._tmpAttributeOnlyGraphic=new i(null,null,{}),this._crossfadeHelper=new me(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerUid(){return this.i3slayer&&this.i3slayer.uid}get sublayerUid(){return null}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Ee(this._currentRenderer)?this._usePBR()||this._hasLoadedPBRTextures?he.AllTexturesPBR:he.AllTextures:this._usePBR()||this._hasLoadedPBRTextures?he.GeometryTexturesPBR:he.GeometryTextures}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null!=e&&"absolute-height"===e.mode){const t=I(this.i3slayer.spatialReference),i=Z(e.unit);return l(e.offset,0)*i/t}return 0}get supportedTextureEncodings(){return ye(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){var e;const t=null==(e=this.view)?void 0:e.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled,i=0==(this.supportedTextureEncodings&ce.DDS_S3TC);return t&&i}initialize(){this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const e=this.view.resourceController;if(this.attributeOverrides=new _e(this.i3slayer,e.memoryController),this._worker=new te((t=>e.schedule(t))),this.addResolvingPromise(this._worker.promise),this._worker.setLegacySchema(this.layerUid,this.i3slayer.store.defaultGeometrySchema),je(this.i3slayer),we(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new z({layerView:this}),this.gpuMemoryEstimate=0,this.texMemoryEstimate=0,this.geoMemoryEstimate=0,this._stage=this.view._stage,this._collection=this._stage.renderView.componentObjectCollection,this._highlights=new ue({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,se.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)}),this._isIntegratedMesh||!this.i3slayer.store.defaultGeometrySchema)this._hasSymbolColors=!1;else{const e=this.i3slayer.store.defaultGeometrySchema.featureAttributes;this._hasSymbolColors=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=this.i3slayer.store.defaultGeometrySchema.vertexAttributes.color&&(null==this.i3slayer.cachedDrawingInfo||!this.i3slayer.cachedDrawingInfo.color),this._isIntegratedMesh||(this._edgeView=this._stage.renderView.ensureEdgeView());const t=this.view.resourceController.memoryController.newCache(this.i3slayer.uid,(e=>this._deleteComponentObject(e)));this._memCache=t;const i=e=>h(this._controller.index)&&h(this._controller.index.rootNode)?this._controller.index.traverse(this._controller.index.rootNode,(t=>{const i=t.index,s=this._nodeId2Meta.get(i)||this._nodeId2MetaReloading.get(i);return e(t,h(s)?s.objectHandle:null)})):()=>{};this._intersectionHandler=new be({layerUid:this.layerUid,sublayerUid:this.sublayerUid,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:i}),this._elevationProvider=new pe({layerView:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR(),this.updatingHandles.add((()=>this.view.clippingArea),(()=>this._clippingAreaChanged()),f),this.updatingHandles.add((()=>this.fullOpacity),(e=>this._opacityChange(e))),this.updatingHandles.add((()=>this.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(e))),this.updatingHandles.add((()=>this.elevationOffset),((e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()})),this.updatingHandles.add((()=>this.filter),(()=>this._filterChange()),f),this.updatingHandles.add((()=>this.view.qualitySettings.physicallyBasedRenderingEnabled),(()=>this._updatePBR()));const s=()=>{this._reloadAll(),this.clearMemCache()};this.updatingHandles.add((()=>this.rendererTextureUsage),s),this.updatingHandles.add((()=>this.uncompressedTextureDownsamplingEnabled),s),this.updatingHandles.add((()=>this.suspended),(e=>this._suspendedChange(e)),f),this.updatingHandles.add((()=>this.i3slayer.labelsVisible),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this.i3slayer.labelingInfo),(()=>this._labelingChanged()),f),this.updatingHandles.add((()=>this._modifications),(()=>this._modificationsChanged()),f),this.handles.add([v(qe,"I3S_TREE_SHOW_TILES",(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&qe.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||qe.I3S_TREE_SHOW_TILES||(this._treeDebugger=d(this._treeDebugger))})),v(qe,"I3S_SHOW_MODIFICATIONS",(()=>this._showModifications()))]),this._cacheKeySuffix=Ne(this.i3slayer.spatialReference,this.view.renderSpatialReference),this._idbCache.init().catch((e=>tt.warn(`Failed to initialize IndexedDB cache: ${e}`)))}destroy(){this._clearAddTasks(),this.attributeOverrides=d(this.attributeOverrides),this._elevationProvider&&(this._elevationProvider.layerChanged(),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._worker;e&&(e.destroyContext(this.i3slayer.uid).then((()=>e.destroy())),this._worker=null),this._removeAllNodeDataFromStage(),this._memCache=d(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=d(this._labeler),this._treeDebugger=d(this._treeDebugger),this._controller=d(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_memEstimateTextureAdded(e){const t=e.estimatedTexMemRequired;return this.gpuMemoryEstimate+=t,this.texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(h(e)){const t=e.estimatedTexMemRequired;this.gpuMemoryEstimate-=t,this.texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){const t=this._collection.getObjectGPUMemoryUsage(e);return this.gpuMemoryEstimate+=t,this.geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){const t=this._collection.getObjectGPUMemoryUsage(e);this.gpuMemoryEstimate-=t,this.geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}getUsedMemory(){let e=h(this._labeler)?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach((t=>e+=h(t)?t.node.memory:0)),this._nodeId2MetaReloading.forEach((t=>e+=h(t)?t.node.memory:0)),e}getUnloadedMemory(){return(h(this._controller)?this._controller.unloadedMemoryEstimate:0)+(h(this._labeler)?this._labeler.unloadedMemoryEstimate:0)}ignoresMemoryFactor(){return!1}_labelingChanged(){if(!(W(this.i3slayer)&&this._supportsLabeling))return void(h(this._labeler)&&(this._labeler.destroy(),this._labeler=null));if(h(this._labeler))return;const e=new ee({view:this.view,layer:this.i3slayer,collection:this._collection});this._nodeId2Meta.forEach((t=>h(t)&&this._addMetaToLabeler(e,t))),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then((e=>(--this._asyncModuleLoading,e)),(e=>{throw--this._asyncModuleLoading,e}))}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=oe().then((()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()})),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=this.i3slayer.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const i=ie(this._layerClippingArea,this._modifications,t);ae({context:e,modifications:i,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const s=this.hasModifications?new m:null;this._nodeId2Meta.forEach(((e,t)=>{c(e)?this._nodeId2Meta.delete(t):e.node.hasModifications?(this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):h(s)&&s.push(e.node)})),h(s)&&this._nodeId2MetaReloading.forEach((e=>s.push(e.node))),h(s)&&s.length>0&&(this.updateNodeModificationStatus(s),s.forAll((e=>{if(e.imModificationImpact!==Ce.Culled){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),this._nodeId2Meta.delete(e.index),h(t)&&this._nodeId2MetaReloading.set(e.index,t)}}))),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(h(this._modificationGraphics)&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!qe.I3S_SHOW_MODIFICATIONS||0===this._modifications.length)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={type:"simple-fill",outline:{color:[255,255,255],width:1}};this._modificationGraphics=new Array;for(const s of this._modifications){s.geometry.spatialReference=this.i3slayer.spatialReference;const r={...t,color:e[s.type]};this._modificationGraphics.push(new i({geometry:s.geometry,symbol:r}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,((e,t)=>this._createAttributes(e,t)))}_suspendedChange(e){e?(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler)):(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(h(t)&&h(t.attributeInfo))return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);h(i)&&h(i.attributeInfo)&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);h(s)&&(await this.attributeOverrides.apply(s.featureIds,t,i),s.attributeInfo=t,this._attributeValuesChanged(s))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.filteredIds=null,h(this._labeler)&&this._labeler.setNodeMetaAttributes(e,((e,t)=>this._createAttributes(e,t))),this._updateEngineObject(e)}clearMemCache(){h(this._memCache)&&this._memCache.clear()}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach((t=>h(t)&&e.push(t.node))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach(((t,i)=>e.push(i))),this._nodeId2MetaReloading.forEach(((t,i)=>e.push(i)))}_preLoadBasis(){!o("disable-feature:i3s-basis")&&0!=(this.supportedTextureEncodings&ce.Basis)&&u(this.i3slayer.textureSetDefinitions,(e=>e.some((e=>e.formats.some((e=>"basis"===e.format||"ktx2"===e.format))))))&&Ze()}_getVertexBufferLayout(e,t){const i={hasTexture:gt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion};return Xe(Qe(this._getGeometryParameters(i)))}_getObjectIdField(){return this.i3slayer.objectIdField||"OBJECTID"}_findGraphicNodeAndIndex(e){const t=Be(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());let i=null;return n(this._nodeId2Meta,(e=>{if(c(e))return!1;const s=e.featureIds.indexOf(t);return-1!==s&&(i={node:e.node,index:s},!0)})),i}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(c(i))return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const a of t){const e=Be(o,a.attributes,r),t=i.featureIds.indexOf(e);-1!==t&&s.push(t)}return s}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const i=this._nodeId2Meta.get(t.node.index);if(c(i))return Promise.reject();const s=i.objectHandle,r=fe(t.index,this._collection,s,new Float64Array(24)),o=this.view.renderSpatialReference,a=this.view.spatialReference;if(F(r,o,0,r,a,0,8)){const e=G();return L(e,r,0,8),Promise.resolve({boundingBox:e,screenSpaceObjects:[]})}}whenGraphicAttributes(e,t){return De(this.i3slayer,e,this._getObjectIdField(),t,(()=>[...this._nodeId2Meta.values()].filter(h)))}getGraphicFromIntersectorTarget(e){if(null==e.nodeIndex||null==e.componentIndex)return null;const t=this._nodeId2Meta.get(e.nodeIndex);return c(t)||null==t.featureIds||e.componentIndex>=t.featureIds.length?null:this._createGraphic(e.componentIndex,t)}_getCacheKey(e){return`${this._layerUrl}/v${ot}/${e.id}${this._cacheKeySuffix}`}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(e){return h(this._memCache)?this._memCache.pop(this._getMemCacheKey(e.index)):null}deleteCachedGPUData(e){h(e)&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(c(this._memCache))return void this._deleteComponentObject(e);const i=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,e.node.memory,i)}loadMissingTextures(e,t,i,s){const r=e.filter(((e,i)=>{if(0==(e.usage&this.rendererTextureUsage))return!1;if(c(t))return!0;const s=Ie(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(c(r)||null==r.data||s&&r.encoding!==s.encoding)}));return 0===r.length?Promise.resolve(!1):i(r,s).then((i=>{let s=0;for(let r=0;r<e.length;r++)s<i.length&&i[s].id===e[r].id&&(t[r]=i[s],s++);return!0}))}loadCachedNodeData(e,t,i){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e),t).then((s=>null==s?null:s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e)),null):(e.geometryObb=s.geometryObb,this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then((i=>(i&&this._idbCache.initialized&&h(s.textureData)&&(s.byteSize=bt(s.transformedGeometry,s.textureData),s.textureData.every(ft)&&yt(e,s)&&this._idbCache.put(this._getCacheKey(e),s).catch((t=>tt.warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`)))),g(t),s)))))):Promise.resolve(null)}addNode(e,t,i){return pt(t)?this._addData(e,t.attributeDataInfo,(()=>this._transformNode(e,t,i).then((s=>this._safeReschedule((()=>{if(c(s))return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:o,featureIds:a,transformedGeometry:n}=s,l=this._controller.crsIndex,d=this.view.renderSpatialReference,u=Oe(e.mbs,this.elevationOffset,l,d);e.geometryObb=Ke([r.center.x,r.center.y,r.center.z],[r.extents.x,r.extents.y,r.extents.z],[r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w]),N(e.geometryObb.center,e.geometryObb.center,u),t.geometryData.componentOffsets=o,a&&(t.geometryData.featureIds=Array.prototype.slice.call(a));const _={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:n,globalTrafo:u,geometryObb:e.geometryObb,byteSize:bt(n,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&yt(e,_)){const t=h(_.textureData)?_.textureData.map((e=>ft(e)?e:null)):null;this._idbCache.put(this._getCacheKey(e),{..._,textureData:t}).catch((t=>tt.warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`)))}return this._addCachedNodeData(e,_,i)}),i))))):Promise.reject()}computeVisibilityObb(e){return Re(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications)}_transformNode(e,t,i){const s=t.geometryData.geometries,r=new Array(s.length);for(let c=0;c<s.length;++c)r[c]=this._getVertexBufferLayout(s[c],t.geometryDescriptor);const o=e.mbs,a=this.elevationOffset,n=this._controller.crsIndex,l=this._controller.crsVertex,d=this.view.renderSpatialReference,h=Se(o,a,n),u=Oe(o,a,n,d),_=A(n,l),m=A(l,d);if(c(_)||c(m))return Promise.resolve(null);const g={context:this.i3slayer.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,localOrigin:h,globalTrafo:u,mbs:o,obb:e.serviceObb,elevationOffset:a,needNormals:!this._isIntegratedMesh&&this._controller.isMeshPyramid,normalReferenceFrame:this.i3slayer.normalReferenceFrame||"none",indexToVertexProjector:_,vertexToRenderProjector:m};return this._worker.invoke(g,i)}get supportsNodeCrossFading(){var e,t;return!(null!=(e=this.view)&&null!=(t=e._stage)&&t.renderView.hasShadowsEnabled)}get nodeCrossfadingEnabled(){return this.supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this.supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){const t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,i){if(e.geometryObb=We(this._collection.getComponentObb(t.objectHandle)),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);h(this._labeler)&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,Ye.Visible),this._updateMaterial(t),this._setNewNodeOpacity(t),this._updateEngineObject(t),this._highlights.objectCreated(t),h(this._treeDebugger)&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,(()=>this._addCachedNodeData(e,t,s)))}async _addCachedNodeData(e,t,i){if(this.suspended||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(c(t))return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:a,globalTrafo:n}=t;await this.attributeOverrides.apply(r.featureIds,s.attributeInfo,i);const l=h(t.textureData)?t.textureData.filter((e=>h(e)&&0!=(e.usage&this.rendererTextureUsage))):[];!o("disable-feature:i3s-basis")&&l.some((e=>h(e)&&(e.encoding===ce.Basis||e.encoding===ce.KTX2)))&&await Ze(),e.memory=0;const{componentOffsets:d,geometries:u,featureIds:m}=r,g=this._collection,p=u[0],{layout:f,indices:b,interleavedVertexData:y,positionData:I,hasColors:v}=a,M=this._materialParameters(p,f),C=d||new Uint32Array([0,b?b.length:y.byteLength/f[0].stride]),N={vertices:{data:y,count:y.byteLength/f[0].stride,layoutParameters:M.geometryParams},positionData:{positions:I.data,indices:I.indices},indices:b,componentOffsets:C},D=p.transformation?j(p.transformation):w();S(D,n,D);const T=E(R(),D),F=x(O(),D),A=this.view.renderSpatialReference,U=this.view.basemapTerrain.spatialReference,H=R(),G=[1,1,1];P(T,A,G,U)||tt.errorOnce("Unsupported coordinate system for IM overlay"),V(T,A,H,U);const L=g.createObject({toMapSpace:[H[0],H[1],G[0],G[1]],geometry:N,obb:_(e.geometryObb),transform:{position:T,rotationScale:F}}),B=M.geometryParams.textureCoordinates===Je.Atlas,{textures:k,texturePromise:q}=this._initMaterialAndTextures(L,M.material,l,B);e.memory+=this._memEstimateGeometryAdded(L),e.memory+=k.reduce(((e,t)=>e+(h(t)?this._memEstimateTextureAdded(t):0)),0);const z=!!M.material.hasParametersFromSource,K="blend"!==M.material.alphaMode&&M.material.metallicRoughness.baseColorFactor[3]>=1,W=new st(e,m,L,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:z,isOpaque:K},k);s.meta=W,!this._hasTextures&&t.requiredTextures.some((({usage:e})=>0!=(e&he.ColorTextures)))&&(this._hasTextures=!0),this._hasData=!0,this._hasColors=this._hasColors||v,this._hasTextures=this._hasTextures||!!e.resources.texture,this.notifyChange("hasTexturesOrVertexColors");const $=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(W),q]).then((([t,s])=>(h(t)&&t.updateObjectVisibility(W.objectHandle,!1),this._safeReschedule((()=>{const i=this._addTasks.get(e.index);if(!i)return;if(h(this._labeler)&&this._addMetaToLabeler(this._labeler,W),this._addNodeMeta(e.index,W),i.meta=null,this.suspended)return void this._removeNodeStageData(e.index,this.elevationOffset);g.setObjectVisibility(L,Ye.Visible),h(t)&&t.updateObjectVisibility(W.objectHandle,!0),W.attributeInfo=i.attributeInfo;const s=W.cachedRendererVersion!==this._rendererVersion,r=$!==this.slicePlaneEnabled;this._setObjectSymbolColors(W);const o=this._applyFiltersToNode(W);(s||h(t)&&(r||o))&&this._addOrUpdateEdgeRendering(W),this._visibleGeometryChanged(W),this._highlights.objectCreated(W),this._updateMaterial(W),this._setNewNodeOpacity(W),h(this._treeDebugger)&&this._treeDebugger.update()}),i)))).catch((e=>{throw h(s.meta)&&(this._cacheGPUData(s.meta),s.meta=null),e}))}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){tt.error("Removing duplicated node");const t=this._nodeId2Meta.get(e);h(t)&&this._deleteComponentObject(t)}h(t)&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Mt(t.cachedEdgeMaterials,0)),this._nodeId2Meta.set(e,t)}_safeReschedule(e,t){return g(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=e.params.material,s=t.some((e=>"uvRegion"===e.name)),r=t.some((e=>"normalCompressed"===e.name)),o=gt(i);return{geometryParams:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s){const r=this._stage.renderView,o=i.map((e=>ve(e,t,s,r)));this._stage.addMany(o);let a=null;return this._collection.updateMaterial(e,(e=>{a=Me(e,t,o,i,this.view._stage.renderView.textureRepository,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR(),isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(e)})),{textures:o,texturePromise:a}}_getGeometryParameters(e){return{textureCoordinates:e.hasTexture?e.hasRegions?Je.Atlas:Je.Default:Je.None,colors:this._hasVertexColors,normals:e.hasNormals&&!this._isIntegratedMesh}}_addData(e,t,i){let s=this._addTasks.get(e.index);return s?s.attributeInfo=t:(s={...p(),attributeInfo:t,meta:null},this._addTasks.set(e.index,s),i().then(s.resolve,s.reject).then((()=>this._addTasks.delete(e.index))).catch((t=>{throw this._addTasks.delete(e.index),t}))),s.promise}_clearAddTasks(){this._addTasks.forEach((e=>{h(e.meta)&&(this._cacheGPUData(e.meta),e.meta=null)})),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=k();this._renderClippingArea=ze(this.view.clippingArea,i,e)?i:null;const s=k();this._layerClippingArea=ze(this.view.clippingArea,s,t)?s:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}_geometryFilterChange(){this._controller.geometryFilterChanged(this.hasGeometryFilter)}get hasGeometryFilter(){return!1}_filterChange(){this._applyFilters(!1)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach((e=>{h(e)&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e))}))}getFilters(){const e=[],t=this._renderClippingArea;return h(t)&&e.push(((e,i)=>this._boundingRectFilter(e,i,t))),e}addSqlFilter(e,t,i){if(h(t)){const s=t.fieldNames;e.push(((e,r)=>this._sqlFilter(e,r,t,s,i)))}}_sqlFilter(e,t,i,s,r){const o={},a=this._createLayerGraphic(o),n=this.i3slayer.objectIdField,l=t.featureIds,d=h(t.attributeInfo)&&t.attributeInfo.attributeData;s.every((e=>null!=d[e]||e===n))&&Te(e,l,(e=>{o[n]=l[e];for(const i of s)i!==n&&(o[i]=Fe(d[i],e));try{return i.testFeature(a)}catch(t){return r(t),!1}}))}_boundingRectNodeTest(e,t){return U(e.node.mbs,this._controller.crsIndex,mt,this.view.renderSpatialReference),Ae(t,mt)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,lt),B(lt,dt),q(i,dt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(r===Pe.INSIDE)return;if(r===Pe.OUTSIDE)return void(e.length=0);const o=s.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const a=this._transformClippingArea(ht,i,t.objectHandle);Te(e,t.featureIds,(e=>this._boundingRectFeatureTest(t,e,a)))}_transformClippingArea(e,t,i){const s=this._collection.getObjectTransform(i),r=s.position,o=s.rotationScale;return e[0]=(t[0]-r[0])/o[0],e[1]=(t[1]-r[1])/o[4],e[2]=(t[2]-r[0])/o[0],e[3]=(t[3]-r[1])/o[4],e}_addOrUpdateEdgeRendering(e,t=!0){const i=this._edgeView;if(c(i))return Promise.resolve(null);const s=e.objectHandle,r=i.hasObject(s),{hasEdges:o,perFeatureEdgeMaterials:a}=this._getFilteredEdgeMaterials(e),n={slicePlaneEnabled:this.slicePlaneEnabled};if(o&&r){if(this.nodeCrossfadingEnabled){Mt(a,this.getNodeOpacity(e))}return i.updateAllComponentMaterials(s,a,n,t),i.updateObjectVisibility(s,!0),Promise.resolve(i)}return o&&!r?this._collection.addEdges(s,i,a,n).then((t=>(e.edgeMemoryUsage=t,e.node.memory+=t,i))):(!o&&r&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,i.removeObject(s)),Promise.resolve(null))}_applyFiltersToNode(e){return!!this._applyFiltersToNodeComponents(e)&&(h(this._labeler)&&this._labeler.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,i=0===t.getComponentCount(e.objectHandle).invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!i;if(this._updateCachedFilteredIds(e),e.filteredIds===e.featureIds)return!i;const s=this._computeFilteredComponentIndices(e);return t.setAllComponentVisibilities(e.objectHandle,s),!0}_updateCachedFilteredIds(e){null!=e.filteredIds&&e.appliedFilters===this._filters||(e.filteredIds=this._computeFilteredIds(e),e.appliedFilters=this._filters)}_computeFilteredIds(e){const t=e.featureIds.slice();for(const i of this._filters)if(i(t,e),0===t.length)break;return t.length===e.featureIds.length?e.featureIds:t}_computeFilteredComponentIndices(e){const t=new Array;return e.featureIds.forEach(((i,s)=>{e.filteredIds[t.length]===i&&t.push(s)})),t}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach(((t,i)=>this._removeNodeStageData(i,e))),this._nodeId2MetaReloading.forEach(((t,i)=>this._removeNodeStageData(i,e,this._nodeId2MetaReloading)))}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading)}_removeNodeStageData(e,t,i=this._nodeId2Meta){const s=i.get(e);c(s)?i.delete(e):(this._collection.setObjectVisibility(s.objectHandle,Ye.Hidden),h(this._edgeView)&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1),this._visibleGeometryChanged(s),h(this._labeler)&&this._labeler.removeNodeMeta(s),i.delete(e),this._highlights.objectDeleted(s),i===this._nodeId2Meta?(this._cacheGPUData(s,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(s)):this._deleteComponentObject(s),h(this._treeDebugger)&&this._treeDebugger.update())}_deleteComponentObject(e){if(h(this._edgeView)&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(const t of e.textures)this._memEstimateTextureRemoved(t),this._stage.remove(t)}updateNodeState(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._collection.updateMaterial(i.objectHandle,(e=>e.polygonOffsetEnabled=t===xe.Hole))}_invalidateAllSymbols(){this._rendererVersion=Ve(this._rendererVersion,1),this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return Ve(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=Ve(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.i3slayer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&"arcadeRequired"in e&&e.arcadeRequired&&(this._arcade=await Q()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:tt.warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.getSymbols())"mesh-3d"!==t.type&&tt.error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasSymbolColors&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getSymbolColors(e){this._hasSymbolColors&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(e,i)=>{const s=5*e;T(i.externalColor,t[s+0]/255,t[s+1]/255,t[s+2]/255,t[s+3]/255),i.externalColorMixMode=t[s+4]&(1<<rt.CastShadows)-1,i.castShadows=0!=(t[s+4]&1<<rt.CastShadows),i.pickable=0!=(t[s+4]&1<<rt.Pickable)}}_getSymbolInfo(e,t){const i=e&&e.getSymbol(t,{arcade:this._arcade});if(!(i instanceof J))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=Ue(i);return this._symbolInfos.set(s,r),r}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=h(this._symbologyOverrideFields)&&this._symbologyOverrideFields.length>0?h(this._rendererFields)&&this._rendererFields.length>0?K(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasSymbolColors)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=h(e.attributeInfo)&&e.attributeInfo.attributeData,o=null!=e.featureIds?this.i3slayer.objectIdField:null,a=null!=r&&h(this._symbologyFields)&&this._symbologyFields.length>0,n=a?[]:null,l=a?[]:null;if(a&&h(this._symbologyFields))for(const h of this._symbologyFields){const e=r[h];e&&(n.push(h),l.push(e))}e.cachedSymbology||(e.cachedSymbology=new Uint8Array(5*e.featureIds.length));const d={color:ut,castShadows:!0,pickable:!0,colorMixMode:ke.Multiply,edgeMaterial:null},u=this.fullOpacity,_=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):u;let m=null,g=et.OPAQUE,p=He,f=0;for(let b=0;b<e.featureIds.length;b++){if(null!=o&&(i[o]=e.featureIds[b]),a)for(let e=0;e<n.length;e++)i[n[e]]=Fe(l[e],b);const r=this._getSymbolInfo(s,t);let u=null,y=null;if(s&&"visualVariables"in s){if(this._colorVariable){const e=X(this._colorVariable,t,{color:_t,arcade:this._arcade});e&&(u=ut,u[0]=e.r/255,u[1]=e.g/255,u[2]=e.b/255,this._opacityVariable||null===e.a||(y=e.a))}this._opacityVariable&&(y=Y(this._opacityVariable,t,{arcade:this._arcade}))}if(r&&r.material){const e=r.material;u=c(u)||c(y)?de(u,y,e.color,e.alpha,it,ut):de(u,y,null,null,it,ut)}if(c(u)&&(u=ut,u[0]=1,u[1]=1,u[2]=1,u[3]=1),d.pickable=!0,d.castShadows=!r||r.castShadows,d.colorMixMode=r&&r.material?r.material.colorMixMode:ke.Multiply,d.edgeMaterial=r?r.edgeMaterial:null,h(this._symbologyOverride)&&(d.color=u,this._symbologyOverride(t,d),u=d.color),h(d.edgeMaterial)){const t=u[3]<=0?et.INVISIBLE:u[3]>=1&&(e.material.isOpaque||d.colorMixMode===ke.Replace)?et.OPAQUE:et.TRANSPARENT;d.edgeMaterial===m&&t===g||(p={...d.edgeMaterial,opacity:_,objectTransparency:t},m=d.edgeMaterial,g=t),e.cachedEdgeMaterials[b]=p}else e.cachedEdgeMaterials[b]=He;e.cachedSymbology[f+0]=Math.round(255*u[0]),e.cachedSymbology[f+1]=Math.round(255*u[1]),e.cachedSymbology[f+2]=Math.round(255*u[2]),e.cachedSymbology[f+3]=Math.round(255*u[3]),e.cachedSymbology[f+4]=d.colorMixMode|+d.castShadows<<rt.CastShadows|+d.pickable<<rt.Pickable,f+=5}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);if(this.nodeCrossfadingEnabled||Mt(t,this.fullOpacity),c(e.filteredIds)){return{hasEdges:t.some((e=>e!==He)),perFeatureEdgeMaterials:t}}let i=0,s=!1;const r=t.map(((t,r)=>e.featureIds[r]!==e.filteredIds[i]?He:(s=s||t!==He,i++,t)));return{hasEdges:s,perFeatureEdgeMaterials:r}}_setObjectSymbolColors(e){if(!this._hasSymbolColors)return;const t=e.objectHandle,i=this._getSymbolColors(e);this._collection.setComponentData(t,i),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>t.objectOpacity=e)),Mt(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))}))}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,(e=>{e.commonMaterialParameters.slicePlaneEnabled=this.slicePlaneEnabled,e.usePBR=this._usePBR(),this._updateMaterialOverlay(e)}))}_updateMaterialOverlay(e){}_updateEngineObject(e){this._setObjectSymbolColors(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),h(this._labeler)&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach((t=>{c(t)||(this._collection.updateMaterial(t.objectHandle,(t=>{t.commonMaterialParameters.slicePlaneEnabled=e})),this._updateEdgeRendering(t,!1))}))}_updatePBR(){this._nodeId2Meta.forEach((e=>{c(e)||this._collection.updateMaterial(e.objectHandle,(e=>{e.usePBR=this._usePBR()}))})),this._hasLoadedPBRTextures=!0}_usePBR(){return!this._isIntegratedMesh&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){h(this._edgeView)&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_forAllFeatures(e,t,i=se.VISIBLE_ONLY){n(this._nodeId2Meta,(s=>{if(c(s))return!1;if(h(t)){switch(t(s)){case re.EXIT:return!0;case re.SKIP:return!1}}let r=re.CONTINUE;switch(i){case se.ALL:r=this._forAllFeaturesOfNode(s,e);break;case se.VISIBLE_ONLY:r=this._forVisibleFeaturesOfNode(s,e);break;case se.ALL_IN_CLIPPING_AREA:r=this._forAllFeaturesOfNodeInClippingArea(s,e)}return r===re.EXIT}))}_forAllFeaturesOfNode(e,t){let i=re.CONTINUE;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),i===re.EXIT)return i;return i}_forVisibleFeaturesOfNode(e,t){let i=re.CONTINUE;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,(r=>(i=t(s[r],r,e),i===re.CONTINUE))),i}_forAllFeaturesOfNodeInClippingArea(e,t){if(c(this._renderClippingArea))return this._forAllFeaturesOfNode(e,t);const i=this._boundingRectNodeTest(e,this._renderClippingArea);if(i===Pe.OUTSIDE)return re.CONTINUE;if(i===Pe.INSIDE)return this._forAllFeaturesOfNode(e,t);const s=re.CONTINUE,r=e.featureIds,o=e.objectHandle,a=Ge(this._renderClippingArea,this._collection.getObjectTransform(o));for(let n=0;n<r.length;n++){if(!this._boundingRectFeatureTest(e,n,a))continue;const i=t(r[n],n,e);if(i===re.EXIT)return i}return s}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=h(t.attributeInfo)&&t.attributeInfo.attributeData;if(h(s))for(const r of Object.keys(s))i[r]=Fe(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e){const t=this._highlights;if("number"==typeof e||e instanceof i?e=[e]:e instanceof r&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof i){const i=e,s=this.i3slayer.fieldsIndex,r=this._getObjectIdField(),o=i.map((e=>Be(s,e.attributes,r))),{set:a,handle:n}=t.acquireSet();return t.setFeatureIds(a,o),n}if("number"==typeof e[0]){const i=e,{set:s,handle:r}=t.acquireSet();return t.setFeatureIds(s,i),r}}return vt}_visibleGeometryChanged(e){this._elevationProvider&&(this._elevationProvider.objectChanged(e.node),null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=b((()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null}))))}get performanceInfo(){const e={displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null,index:0,nodes:this._nodeId2Meta.size,"Total GPU Memory Estimate":(this.gpuMemoryEstimate/1048576).toFixed(1)+"MB","Geometry Memory Estimate":(this.geoMemoryEstimate/1048576).toFixed(1)+"MB","Texture Memory Estimate":(this.texMemoryEstimate/1048576).toFixed(1)+"MB","Unloaded Memory Estimate":(this.getUnloadedMemory()/1048576).toFixed(1)+"MB"};return h(this._memCache)&&(e.MemCache=Math.round(100*this._memCache.hitRate)+"% hit"),this._controller&&(this._idbCacheEnabled&&(e.IDBCache=Math.round(100*this._idbCache.getHitRate())+"% hit"),this._controller.updateStats(e)),e}get test(){const e=this;return{controller:this._controller,labeler:this._labeler,get visibleObjectIds(){const t=[];return e._forAllFeatures((e=>(t.push(e),re.CONTINUE)),null,se.VISIBLE_ONLY),t.sort(((e,t)=>e-t)),t},get numNodes(){return e._nodeId2Meta.size}}}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return h(e)?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(((t,i)=>e(i,t)))}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);h(s)&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);h(i)&&this._setNodeOpacity(i,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,(e=>e.objectOpacity=t)),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(!h(this._edgeView)||!e.cachedEdgeMaterials)return;Mt(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t)}get hasModifications(){return this._isIntegratedMesh&&h(this._layerClippingArea)||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||!0!==this._i3sWasmLoaded)return;const i=this.i3slayer.uid,s=It(e);if(h(s)){const t={context:i,buffer:s.buffer};ne(t);const r=new Float64Array(s.buffer);e.forAll(((e,t)=>{const i=r[t],s=le(i);e.imModificationImpact=s,s!==Ce.Unmodified&&this._controller.invalidateGeometryVisibility(e.index)}))}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||h(this._labeler)&&this._labeler.updating||this._crossfadeHelper.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0}};return e([M()],s.prototype,"_hasLoadedPBRTextures",void 0),e([M()],s.prototype,"_asyncModuleLoading",void 0),e([M()],s.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([M()],s.prototype,"view",void 0),e([M()],s.prototype,"i3slayer",void 0),e([M()],s.prototype,"_controller",void 0),e([M()],s.prototype,"_labeler",void 0),e([M()],s.prototype,"updating",void 0),e([M()],s.prototype,"suspended",void 0),e([M()],s.prototype,"holeFilling",void 0),e([M($e)],s.prototype,"updatingProgress",void 0),e([M({readOnly:!0,aliasOf:"_controller.updatingProgress"})],s.prototype,"updatingProgressValue",void 0),e([M({readOnly:!0})],s.prototype,"hasTexturesOrVertexColors",null),e([M({readOnly:!0})],s.prototype,"rendererTextureUsage",null),e([M()],s.prototype,"filter",void 0),e([M({readOnly:!0})],s.prototype,"elevationOffset",null),e([M({type:Boolean})],s.prototype,"slicePlaneEnabled",void 0),e([M()],s.prototype,"supportedTextureEncodings",null),e([M()],s.prototype,"uncompressedTextureDownsamplingEnabled",null),e([M({type:[$]})],s.prototype,"_modifications",void 0),s=e([C("esri.views.3d.layers.I3SMeshView3D")],s),s},lt=H(),dt=k(),ht=k(),ct=Ke(),ut=[0,0,0,0],_t=new t([0,0,0,0]),mt=[0,0,0,0];function gt(e){const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function pt(e){return"geometryData"in e}function ft(e){return h(e)&&y(e.data)}function bt(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(h(t))for(const s of t)h(s)&&y(s.data)&&(i+=s.data.byteLength);return i}function yt(e,t){return t.byteSize>at?(tt.warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}function It(e){if(0===e.length)return null;const t=10*e.length,i=new Float64Array(t);return e.forAll(((e,t)=>{let s=e.serviceObb;c(s)&&(s=ct,D(s.center,e.mbs),s.halfSize[0]=s.halfSize[1]=s.halfSize[2]=e.mbs[3]);const r=10*t;i[r+0]=s.center[0],i[r+1]=s.center[1],i[r+2]=s.center[2],i[r+3]=s.halfSize[0],i[r+4]=s.halfSize[1],i[r+5]=s.halfSize[2],i[r+6]=s.quaternion[0],i[r+7]=s.quaternion[1],i[r+8]=s.quaternion[2],i[r+9]=s.quaternion[3]})),i}const vt={remove(){},pause(){},resume(){}};function Mt(e,t){e.forEach((e=>e.opacity=t))}export{nt as I3SMeshView3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{isNone as i,disposeMaybe as r,destroyMaybe as l}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{whenTrueOnce as o}from"../../../core/watchUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import h from"../../2d/engine/vectorTiles/SchemaHelper.js";import c from"../../2d/engine/vectorTiles/TileHandler3D.js";import p from"../../2d/engine/vectorTiles/VTLPainter3D.js";import m from"../../2d/engine/vectorTiles/style/StyleRepository.js";import{LayerView3D as d}from"./LayerView3D.js";import{TiledLayerView3D as y}from"./TiledLayerView3D.js";import{test as f}from"../terrain/terrainUtils.js";import u from"../../layers/LayerView.js";let g=class extends(y(d(u))){constructor(){super(...arguments),this.type="vector-tile-3d"}initialize(){if(i(this.layer.fullExtent))return void this.addResolvingPromise(Promise.reject(new t("vectortilelayerview:full-extent-undefined","This layer view's layer does not define a fullExtent.")));const e=f.force512VTL?this.layer.tileInfo:this.layer.compatibleTileInfo256,r=this._getTileInfoSupportError(e,this.layer.fullExtent);if(r)return this.addResolvingPromise(Promise.reject(r));const{basemapTerrain:l,spatialReference:n,pixelRatio:a}=this.view,d=o(this.view,"basemapTerrain.tilingSchemeLocked").then((()=>{const e=l.tilingScheme,t=e.pixelSize;let i;this.schemaHelper=new h(t,n.isGeographic),i=256===t?this.layer.compatibleTileInfo256:this.view.spatialReference.isGeographic?this.layer.compatibleTileInfo512:this.layer.tileInfo;const r=this._getTileInfoCompatibilityError(i,e);if(r)throw r;this._set("tileInfo",i)}));this._tileHandlerController=new AbortController;const y=this.view.resourceController;this._memCache=y.memoryController.newCache(this.layer.uid,(e=>{e.release()}));const{style:u}=this.layer.currentStyleInfo,g=new m(u),_=l.mapTileRequester;this._tileHandler=new c(this.layer,g,a,this._memCache,_);const v=this._tileHandlerController.signal,H=e=>y.schedule(e),w=this._tileHandler.start({signal:v,schedule:H}),C=this._tileHandler.spriteMosaic;C.then((e=>{!s(v)&&this._tileHandler&&(this.painter=new p(e,this._tileHandler.glyphMosaic))})),w.then((()=>this._tileHandlerController=null));const T=()=>{this._tileHandlerController&&this._tileHandlerController.abort(),this._tileHandlerController=new AbortController,this._memCache.clear();const{style:e}=this.layer.currentStyleInfo,t=new m(e),i=new c(this.layer,t,a,this._memCache,_),r=i.start({signal:this._tileHandlerController.signal,schedule:H}),l=i.spriteMosaic;r.then((()=>this._tileHandlerController=null)),this.updatingHandles.addPromise(Promise.all([r,l]).then((([,e])=>{const t=this._tileHandler,r=this.painter;this.painter=new p(e,i.glyphMosaic),this._tileHandler=i,this.emit("data-changed"),t.destroy(),r&&r.dispose()})))};this.updatingHandles.add((()=>[this.layer.currentStyleInfo,this.view.pixelRatio]),T);const j=Promise.all([d,w,C]);this.addResolvingPromise(j)}destroy(){this.painter=r(this.painter),this._tileHandlerController&&(this._tileHandlerController.abort(),this._tileHandlerController=null),l(this._tileHandler),this._memCache=l(this._memCache),this._tileHandler=null}get dataLevelRange(){const e=this.tileInfo.lods,t=e[0].scale,i=e[e.length-1].scale,r=this.levelRangeFromScaleRange(t,i);return 1===r.minLevel&&256===this.tileInfo.size[0]&&(r.minLevel=0),r}async fetchTile(e,t,i,r){return this._tileHandler.getVectorTile(e,t,i,r)}};e([n({aliasOf:"layer.fullExtent"})],g.prototype,"fullExtent",void 0),e([n()],g.prototype,"layer",void 0),e([n()],g.prototype,"tileInfo",void 0),e([n()],g.prototype,"dataLevelRange",null),e([n()],g.prototype,"updatingProgressValue",void 0),g=e([a("esri.views.3d.layers.VectorTileLayerView3D")],g);const _=g;export{_ as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{isNone as r,disposeMaybe as i,destroyMaybe as l}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{whenTrueOnce as o}from"../../../core/watchUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{SchemaHelper as h}from"../../2d/engine/vectorTiles/SchemaHelper.js";import c from"../../2d/engine/vectorTiles/TileHandler3D.js";import p from"../../2d/engine/vectorTiles/VTLPainter3D.js";import m from"../../2d/engine/vectorTiles/style/StyleRepository.js";import{LayerView3D as d}from"./LayerView3D.js";import{TiledLayerView3D as y}from"./TiledLayerView3D.js";import{test as f}from"../terrain/terrainUtils.js";import u from"../../layers/LayerView.js";let g=class extends(y(d(u))){constructor(){super(...arguments),this.type="vector-tile-3d"}initialize(){if(r(this.layer.fullExtent))return void this.addResolvingPromise(Promise.reject(new t("vectortilelayerview:full-extent-undefined","This layer view's layer does not define a fullExtent.")));const e=f.force512VTL?this.layer.tileInfo:this.layer.tileInfo.getOrCreateCompatible(256),i=this._getTileInfoSupportError(e,this.layer.fullExtent);if(i)return this.addResolvingPromise(Promise.reject(i));const{basemapTerrain:l,spatialReference:n,pixelRatio:a}=this.view,d=o(this.view,"basemapTerrain.tilingSchemeLocked").then((()=>{const e=l.tilingScheme,t=e.pixelSize;let r;this.schemaHelper=new h(t,n.isGeographic),r=256===t?this.layer.tileInfo.getOrCreateCompatible(256):this.view.spatialReference.isGeographic?this.layer.tileInfo.getOrCreateCompatible(512):this.layer.tileInfo;const i=this._getTileInfoCompatibilityError(r,e);if(i)throw i;this._set("tileInfo",r)}));this._tileHandlerController=new AbortController;const y=this.view.resourceController;this._memCache=y.memoryController.newCache(this.layer.uid,(e=>{e.release()}));const{style:u}=this.layer.currentStyleInfo,g=new m(u),_=l.mapTileRequester;this._tileHandler=new c(this.layer,g,a,this._memCache,_);const C=this._tileHandlerController.signal,v=e=>y.schedule(e),H=this._tileHandler.start({signal:C,schedule:v}),w=this._tileHandler.spriteMosaic;w.then((e=>{!s(C)&&this._tileHandler&&(this.painter=new p(e,this._tileHandler.glyphMosaic))})),H.then((()=>this._tileHandlerController=null));const j=()=>{this._tileHandlerController&&this._tileHandlerController.abort(),this._tileHandlerController=new AbortController,this._memCache.clear();const{style:e}=this.layer.currentStyleInfo,t=new m(e),r=new c(this.layer,t,a,this._memCache,_),i=r.start({signal:this._tileHandlerController.signal,schedule:v}),l=r.spriteMosaic;i.then((()=>this._tileHandlerController=null)),this.updatingHandles.addPromise(Promise.all([i,l]).then((([,e])=>{const t=this._tileHandler,i=this.painter;this.painter=new p(e,r.glyphMosaic),this._tileHandler=r,this.emit("data-changed"),t.destroy(),i&&i.dispose()})))};this.updatingHandles.add((()=>[this.layer.currentStyleInfo,this.view.pixelRatio]),j);const T=Promise.all([d,H,w]);this.addResolvingPromise(T)}destroy(){this.painter=i(this.painter),this._tileHandlerController&&(this._tileHandlerController.abort(),this._tileHandlerController=null),l(this._tileHandler),this._memCache=l(this._memCache),this._tileHandler=null}get dataLevelRange(){const e=this.tileInfo.lods,t=e[0].scale,r=e[e.length-1].scale,i=this.levelRangeFromScaleRange(t,r);return 1===i.minLevel&&256===this.tileInfo.size[0]&&(i.minLevel=0),i}async fetchTile(e,t,r,i){return this._tileHandler.getVectorTile(e,t,r,i)}};e([n({aliasOf:"layer.fullExtent"})],g.prototype,"fullExtent",void 0),e([n()],g.prototype,"layer",void 0),e([n()],g.prototype,"tileInfo",void 0),e([n()],g.prototype,"dataLevelRange",null),e([n()],g.prototype,"updatingProgressValue",void 0),g=e([a("esri.views.3d.layers.VectorTileLayerView3D")],g);const _=g;export{_ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{lerp as s}from"../../../../core/mathUtils.js";import{isNone as e,isSome as r}from"../../../../core/maybe.js";import a from"../../../../core/PooledArray.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as n}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{a as l}from"../../../../chunks/vec2f64.js";import{m as p,a as u,s as d,g as f}from"../../../../chunks/vec3.js";import{Z as m,c as g}from"../../../../chunks/vec3f64.js";import{s as b,t as v,b as y}from"../../../../chunks/vec4.js";import{c as _}from"../../../../chunks/vec4f64.js";import{getReferenceEllipsoid as G}from"../../../../geometry/projectionEllipsoid.js";import{create as S,empty as B,offset as w,width as D,height as N,expand as j,intersects as I}from"../../../../geometry/support/aaBoundingRect.js";import{c as V,a as P,e as C}from"../../../../chunks/boundedPlane.js";import{create as A}from"../../../../geometry/support/ray.js";import{d as O,g as x,e as M,c as T}from"../../../../chunks/sphere.js";import{drawAccelerationStruct as z,prepare as E,drawPoly as F}from"./deconflictorDebug.js";import{VisibilityGroup as X,VisibilityFlag as R}from"./enums.js";import L from"../../support/debugFlags.js";import{VertexAttribute as Y}from"../../webgl-engine/lib/basicInterfaces.js";import k from"../../webgl-engine/lib/Camera.js";import{applyPrecomputedScaleFactor as W}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{HUDMaterial as U}from"../../webgl-engine/materials/HUDMaterial.js";const H=g(),Z=_(),q=_(),J=g(),K=h(),Q=T(),$=A(),ii=g(),ti=S();class si{constructor(){this.aabr=S(),this.distance=0,this.culled=!1,this.visible=!1}}class ei{constructor(i,t,s={}){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this.info=s}}class ri{constructor(){this.active=new Map,this.visible=new Map}clear(){this.active.clear(),this.visible.clear()}}class ai{}class oi{constructor(){this.sortArray=new a({allocator:i=>i||new ai})}}var ci;!function(i){i[i.Idle=0]="Idle",i[i.Process=1]="Process",i[i.Sort=2]="Sort",i[i.Deconflict=3]="Deconflict",i[i.NumStates=4]="NumStates"}(ci||(ci={}));class ni{constructor(){this.camera=new k,this.slicePlane=V(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.copyFrom(i.camera),P(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let hi=class extends t{constructor(){super(...arguments),this._dirty=!1,this._runningViewState=new ni,this._state=ci.Idle,this.graphics=new ri,this.iterators=new oi,this.accBinsNumX=15,this.accBinsNumY=20,this.accBinsSizeX=0,this.accBinsSizeY=0,this.accBins=null,this.accNumTests=0}get dirty(){return this._dirty}get state(){return this._state}destroy(){this.graphics.clear(),this.iterators=null}setDirty(){!this._dirty&&this.graphics.active.size>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._state!==ci.Idle||this._dirty}get updatingProgress(){if(!this.updating)return 1;const i=this._state/ci.NumStates;return this._dirty?.5*i:i}get running(){return this.view.ready&&null!=this.view.state&&this.updating}runTask(i){switch(this._state){case ci.Idle:this._startUpdate(),i.madeProgress();case ci.Process:if(this._state=ci.Process,!this._processActiveGraphics(i))return;case ci.Sort:if(this._state=ci.Sort,!this._sortVisibleGraphics(i))return;case ci.Deconflict:if(this._state=ci.Deconflict,!this._deconflictVisibleGraphics(i))return;default:z(this,this.graphics.visible),this._state=ci.Idle,this.notifyChange("updating")}}modifyGraphics(i,t){t?i.forEach((i=>this.addToActiveGraphics(i))):i.forEach((i=>this.removeFromActiveGraphics(i))),this.setDirty()}layerSupportsDeconfliction(i){if(e(i)||"object3d"!==i.type)return!1;const t=i.stageObject;if(1!==(t?t.geometryRecords.length:0))return!1;return t.geometryRecords[0].material instanceof U}_startUpdate(){E(this.view),this._dirty=!1,this._runningViewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._runningViewState.camera;this._initBins(i,t),this._resetIterators()}addToActiveGraphics(i){i.info[this.visibilityGroup]=new si,this.graphics.active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){this._removeFromVisibleGraphics(i),li(i,this.visibilityGroup),delete i.info[this.visibilityGroup],this.graphics.active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}_addToVisibleGraphics(i){this.graphics.visible.set(i.graphics3DGraphic.graphic.uid,i)}_removeFromVisibleGraphics(i){this.graphics.visible.delete(i.graphics3DGraphic.graphic.uid)}_processActiveGraphics(i){const t=this._ensureActiveGraphicsIterator(),s=n(K,this._runningViewState.camera.projectionMatrix),e="global"===this.view.viewingMode&&1===this.view.map.ground.opacity&&this._runningViewState.camera.relativeElevation>0?Q:null;let a=0;for(r(e)&&(p(e,m,this._runningViewState.camera.viewMatrix),e[3]=G(this.view.spatialReference).radius,a=O(e,m));!i.done;){i.madeProgress();const r=t.next();if(!0===r.done)return this._resetActiveGraphicsIterator(),!0;const o=r.value,c=o&&o.info[this.visibilityGroup];c&&(this._collectGraphics3DGraphics(o,s,e,a),c.culled?this._removeFromVisibleGraphics(o):this._addToVisibleGraphics(o))}return!1}_sortVisibleGraphics(i){const t=this._ensureSortGraphicsIterator();for(;!i.done;){const s=t.next();if(i.madeProgress(),!0===s.done)return this._resetSortGraphicsIterator(),!0}return!1}_deconflictVisibleGraphics(i){const t=this._ensureVisibleGraphicsIterator(),s=this.visibilityGroup===X.LABEL;for(;!i.done;){i.madeProgress();const e=t.next();if(!0===e.done)return this._resetVisibleGraphicsIterator(),!0;const r=e.value,a=r.info[this.visibilityGroup];if(!a||a.culled)continue;const o=r.graphics3DGraphic,c=(!s||o.isVisible())&&!this._isConflicted(r);c&&this._addToBins(r),a.visible=c,this._setGraphicVisibility(r,c),F(a,c)}return!1}_resetIterators(){this.iterators.active=null,this.iterators.visible=null,this.iterators.sort=null}_ensureActiveGraphicsIterator(){return this.iterators.active||(this.iterators.active=pi(this.graphics.active)),this.iterators.active}_resetActiveGraphicsIterator(){this.iterators.active=null}_ensureVisibleGraphicsIterator(){return this.iterators.visible||(this.iterators.visible=pi(this.graphics.visible)),this.iterators.visible}_resetVisibleGraphicsIterator(){this.iterators.visible=null}_ensureSortGraphicsIterator(){return this.iterators.sort||(this.iterators.sort=ui(this.graphics.visible,this.iterators.sortArray,this.visibilityGroup)),this.iterators.sort}_resetSortGraphicsIterator(){this.iterators.sort=null}_collectGraphics3DGraphics(i,t,s,a){const o=i.graphics3DGraphic;if(o.destroyed)return;const c=i.info[this.visibilityGroup];if(!o.isVisible(X.GRAPHIC,R.DECONFLICTION))return void(c.culled=!0);const n=this.getGraphicsLayers(o);B(c.aabr);let h=null;for(const l of n){if(!this.layerSupportsDeconfliction(l))continue;const o=l.stageObject.geometryRecords[0].material;if(e(h)){if(h=this._getProjectionInfo(l,t,mi),h.isOutsideScreen||this._isCulledBySlice(i,H)||r(s)&&this._isCulledByHorizon(h,s,a))return void(c.culled=!0);!L.TESTS_DISABLE_OPTIMIZATIONS&&c.visible&&(h.distance*=.7)}this._expandBoundingRect(c,l,o,h)}e(h)?c.culled=!0:(c.distance=h.distance,c.culled=!1)}_getProjectionInfo(i,t,s){const e=this._runningViewState.camera,r=i.stageObject,a=r.geometryRecords[0],o=a.material,c=x(r.boundingVolumeWorldSpace.bounds);p(H,c,e.viewMatrix);const n=a.geometry.vertexAttributes,h=n.get(Y.NORMAL).data,l=n.get(Y.AUXPOS1).data;return o.applyShaderOffsetsView(H,h,r.transformation,l,e,s.scaleInfo,H),b(Z,H[0],H[1],H[2],1),v(q,Z,e.projectionMatrix),u(s.positionNDC,q,1/q[3]),o.applyShaderOffsetsNDC(s.positionNDC,l,e,s.positionNDC,J),s.distanceWithoutPolygonOffset=e.depthNDCToWorld(J[2]),s.distance=J[2]===s.positionNDC[2]?s.distanceWithoutPolygonOffset:e.depthNDCToWorld(s.positionNDC[2]),b(q,s.positionNDC[0],s.positionNDC[1],s.positionNDC[2],1),v(Z,q,t),y(Z,Z,1/Z[3]),d(s.positionView,H[0],H[1],H[2]),s}_isCulledByHorizon(i,t,s){return f($.direction,i.positionView),d($.origin,0,0,0),!!M(t,$,ii)&&i.distanceWithoutPolygonOffset>s}_isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._runningViewState.slicePlaneEnabled&&C(this._runningViewState.slicePlane,t)}_expandBoundingRect(i,t,e,{positionNDC:r,scaleInfo:a}){const o=this._runningViewState.camera,c=t.getScreenSize(di);W(c,a.factor,c),c[0]*=o.pixelRatio,c[1]*=o.pixelRatio;const n=w(e.calculateRelativeScreenBounds(c,a.factorAlignment.scale,ti),s(0,o.fullWidth,.5+.5*r[0]),s(0,o.fullHeight,.5+.5*r[1])),h=this.iconMarginFactor;if(0!==h){const i=h*Math.min(D(n),N(n));n[0]-=i,n[1]-=i,n[2]+=i,n[3]+=i}j(i.aabr,n,i.aabr)}_isConflicted(i){const t=i.graphics3DGraphic.graphic.uid,s=i.info[this.visibilityGroup];for(let e=Math.floor(s.aabr[0]/this.accBinsSizeX);e<=Math.floor(s.aabr[2]/this.accBinsSizeX);e++)if(!(e<0||e>=this.accBinsNumX))for(let i=Math.floor(s.aabr[1]/this.accBinsSizeY);i<=Math.floor(s.aabr[3]/this.accBinsSizeY);i++){if(i<0||i>=this.accBinsNumY)continue;const r=this.accBins[e][i];for(let i=0;i<r.length;i++){const e=r.data[i],a=e.info[this.visibilityGroup];if(a&&a.visible&&(e.graphics3DGraphic.graphic.uid!==t&&(this.accNumTests++,I(a.aabr,s.aabr))))return!0}}return!1}_initBins(i,t){if(null==this.accBins){this.accBins=[];for(let i=0;i<this.accBinsNumX;i++){this.accBins.push([]);const i=this.accBins[this.accBins.length-1];for(let t=0;t<this.accBinsNumY;t++)i.push(new a)}}else for(let s=0;s<this.accBinsNumX;s++)for(let i=0;i<this.accBinsNumY;i++)this.accBins[s][i].clear();this.accBinsSizeX=i/this.accBinsNumX,this.accBinsSizeY=t/this.accBinsNumY,this.accNumTests=0}_addToBins(i){const t=i.info[this.visibilityGroup],s=Math.floor(t.aabr[0]/this.accBinsSizeX),e=Math.floor(t.aabr[2]/this.accBinsSizeX),r=Math.floor(t.aabr[1]/this.accBinsSizeY),a=Math.floor(t.aabr[3]/this.accBinsSizeY);for(let o=s;o<=e;o++)if(!(o<0||o>=this.accBinsNumX))for(let t=r;t<=a;t++)t<0||t>=this.accBinsNumY||this.accBins[o][t].push(i)}_setGraphicVisibility(i,t){const s=i.graphics3DGraphic;s.destroyed||(s.setVisibilityFlag(R.DECONFLICTION,t,this.visibilityGroup),this.visibilityGroup===X.LABEL&&this.view.labeler.setLabelGraphicVisibility(s,t))}};function li(i,t){const s=i.graphics3DGraphic;s.destroyed||s.clearVisibilityFlag(R.DECONFLICTION,t)}function*pi(i){if(Map.prototype.entries){const t=i.entries();for(let i=t.next();!i.done;i=t.next())yield i.value[1]}else yield*i.values()}function*ui(i,t,s){t.clear(),i.forEach(((i,e)=>{const r=t.pushNew();r.id=e,r.prio=i.info?-i.info[s].distance:Number.MAX_VALUE})),yield;const e=t.iterableSort(((i,t)=>t.prio-i.prio));for(let r=e.next();!r.done;r=e.next())yield;t.forAll((t=>{const s=i.get(t.id);s&&(i.delete(t.id),i.set(t.id,s))})),t.clear()}i([o({constructOnly:!0})],hi.prototype,"view",void 0),i([o({type:Boolean,readOnly:!0})],hi.prototype,"updating",null),hi=i([c("esri.views.3d.layers.graphics.Deconflictor")],hi);const di=l();class fi{constructor(){this.positionView=g(),this.positionNDC=g(),this.distance=0,this.distanceWithoutPolygonOffset=0,this.scaleInfo={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},factorAlignment:{scale:0,factor:0,minPixelSize:0,paddingPixels:0}}}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1}}const mi=new fi;export{hi as Deconflictor,ei as DeconflictorGraphic,ni as DeconflictorViewState,ci as State};
5
+ import{_ as i}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{lerp as s}from"../../../../core/mathUtils.js";import{isNone as e,isSome as r}from"../../../../core/maybe.js";import a from"../../../../core/PooledArray.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as n}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{a as l}from"../../../../chunks/vec2f64.js";import{m as p,a as u,s as d,g as f}from"../../../../chunks/vec3.js";import{Z as m,c as g}from"../../../../chunks/vec3f64.js";import{s as b,t as v,b as y}from"../../../../chunks/vec4.js";import{c as _}from"../../../../chunks/vec4f64.js";import{getReferenceEllipsoid as G}from"../../../../geometry/projectionEllipsoid.js";import{create as S,empty as B,offset as w,width as D,height as N,expand as j,intersects as V}from"../../../../geometry/support/aaBoundingRect.js";import{c as I,a as P,e as C}from"../../../../chunks/boundedPlane.js";import{create as A}from"../../../../geometry/support/ray.js";import{d as x,g as O,e as M,c as T}from"../../../../chunks/sphere.js";import{drawAccelerationStruct as z,prepare as E,drawPoly as F}from"./deconflictorDebug.js";import{VisibilityGroup as X,VisibilityFlag as R}from"./enums.js";import L from"../../support/debugFlags.js";import Y from"../../webgl-engine/lib/Camera.js";import{applyPrecomputedScaleFactor as k}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{VertexAttribute as W}from"../../webgl-engine/lib/VertexAttribute.js";import{HUDMaterial as U}from"../../webgl-engine/materials/HUDMaterial.js";const H=g(),Z=_(),q=_(),J=g(),K=h(),Q=T(),$=A(),ii=g(),ti=S();class si{constructor(){this.aabr=S(),this.distance=0,this.culled=!1,this.visible=!1}}class ei{constructor(i,t,s={}){this.graphics3DGraphic=i,this.slicePlaneEnabled=t,this.info=s}}class ri{constructor(){this.active=new Map,this.visible=new Map}clear(){this.active.clear(),this.visible.clear()}}class ai{}class oi{constructor(){this.sortArray=new a({allocator:i=>i||new ai})}}var ci;!function(i){i[i.Idle=0]="Idle",i[i.Process=1]="Process",i[i.Sort=2]="Sort",i[i.Deconflict=3]="Deconflict",i[i.NumStates=4]="NumStates"}(ci||(ci={}));class ni{constructor(){this.camera=new Y,this.slicePlane=I(),this.slicePlaneEnabled=!1}copyFrom(i){this.camera.copyFrom(i.camera),P(i.slicePlane,this.slicePlane),this.slicePlaneEnabled=i.slicePlaneEnabled}}let hi=class extends t{constructor(){super(...arguments),this._dirty=!1,this._runningViewState=new ni,this._state=ci.Idle,this.graphics=new ri,this.iterators=new oi,this.accBinsNumX=15,this.accBinsNumY=20,this.accBinsSizeX=0,this.accBinsSizeY=0,this.accBins=null,this.accNumTests=0}get dirty(){return this._dirty}get state(){return this._state}destroy(){this.graphics.clear(),this.iterators=null}setDirty(){!this._dirty&&this.graphics.active.size>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._state!==ci.Idle||this._dirty}get updatingProgress(){if(!this.updating)return 1;const i=this._state/ci.NumStates;return this._dirty?.5*i:i}get running(){return this.view.ready&&null!=this.view.state&&this.updating}runTask(i){switch(this._state){case ci.Idle:this._startUpdate(),i.madeProgress();case ci.Process:if(this._state=ci.Process,!this._processActiveGraphics(i))return;case ci.Sort:if(this._state=ci.Sort,!this._sortVisibleGraphics(i))return;case ci.Deconflict:if(this._state=ci.Deconflict,!this._deconflictVisibleGraphics(i))return;default:z(this,this.graphics.visible),this._state=ci.Idle,this.notifyChange("updating")}}modifyGraphics(i,t){t?i.forEach((i=>this.addToActiveGraphics(i))):i.forEach((i=>this.removeFromActiveGraphics(i))),this.setDirty()}layerSupportsDeconfliction(i){if(e(i)||"object3d"!==i.type)return!1;const t=i.stageObject;if(1!==(t?t.geometryRecords.length:0))return!1;return t.geometryRecords[0].material instanceof U}_startUpdate(){E(this.view),this._dirty=!1,this._runningViewState.copyFrom(this.viewState);const{fullWidth:i,fullHeight:t}=this._runningViewState.camera;this._initBins(i,t),this._resetIterators()}addToActiveGraphics(i){i.info[this.visibilityGroup]=new si,this.graphics.active.set(i.graphics3DGraphic.graphic.uid,i),this.setDirty()}removeFromActiveGraphics(i){this._removeFromVisibleGraphics(i),li(i,this.visibilityGroup),delete i.info[this.visibilityGroup],this.graphics.active.delete(i.graphics3DGraphic.graphic.uid),this.setDirty()}_addToVisibleGraphics(i){this.graphics.visible.set(i.graphics3DGraphic.graphic.uid,i)}_removeFromVisibleGraphics(i){this.graphics.visible.delete(i.graphics3DGraphic.graphic.uid)}_processActiveGraphics(i){const t=this._ensureActiveGraphicsIterator(),s=n(K,this._runningViewState.camera.projectionMatrix),e="global"===this.view.viewingMode&&1===this.view.map.ground.opacity&&this._runningViewState.camera.relativeElevation>0?Q:null;let a=0;for(r(e)&&(p(e,m,this._runningViewState.camera.viewMatrix),e[3]=G(this.view.spatialReference).radius,a=x(e,m));!i.done;){i.madeProgress();const r=t.next();if(!0===r.done)return this._resetActiveGraphicsIterator(),!0;const o=r.value,c=o&&o.info[this.visibilityGroup];c&&(this._collectGraphics3DGraphics(o,s,e,a),c.culled?this._removeFromVisibleGraphics(o):this._addToVisibleGraphics(o))}return!1}_sortVisibleGraphics(i){const t=this._ensureSortGraphicsIterator();for(;!i.done;){const s=t.next();if(i.madeProgress(),!0===s.done)return this._resetSortGraphicsIterator(),!0}return!1}_deconflictVisibleGraphics(i){const t=this._ensureVisibleGraphicsIterator(),s=this.visibilityGroup===X.LABEL;for(;!i.done;){i.madeProgress();const e=t.next();if(!0===e.done)return this._resetVisibleGraphicsIterator(),!0;const r=e.value,a=r.info[this.visibilityGroup];if(!a||a.culled)continue;const o=r.graphics3DGraphic,c=(!s||o.isVisible())&&!this._isConflicted(r);c&&this._addToBins(r),a.visible=c,this._setGraphicVisibility(r,c),F(a,c)}return!1}_resetIterators(){this.iterators.active=null,this.iterators.visible=null,this.iterators.sort=null}_ensureActiveGraphicsIterator(){return this.iterators.active||(this.iterators.active=pi(this.graphics.active)),this.iterators.active}_resetActiveGraphicsIterator(){this.iterators.active=null}_ensureVisibleGraphicsIterator(){return this.iterators.visible||(this.iterators.visible=pi(this.graphics.visible)),this.iterators.visible}_resetVisibleGraphicsIterator(){this.iterators.visible=null}_ensureSortGraphicsIterator(){return this.iterators.sort||(this.iterators.sort=ui(this.graphics.visible,this.iterators.sortArray,this.visibilityGroup)),this.iterators.sort}_resetSortGraphicsIterator(){this.iterators.sort=null}_collectGraphics3DGraphics(i,t,s,a){const o=i.graphics3DGraphic;if(o.destroyed)return;const c=i.info[this.visibilityGroup];if(!o.isVisible(X.GRAPHIC,R.DECONFLICTION))return void(c.culled=!0);const n=this.getGraphicsLayers(o);B(c.aabr);let h=null;for(const l of n){if(!this.layerSupportsDeconfliction(l))continue;const o=l.stageObject.geometryRecords[0].material;if(e(h)){if(h=this._getProjectionInfo(l,t,mi),h.isOutsideScreen||this._isCulledBySlice(i,H)||r(s)&&this._isCulledByHorizon(h,s,a))return void(c.culled=!0);!L.TESTS_DISABLE_OPTIMIZATIONS&&c.visible&&(h.distance*=.7)}this._expandBoundingRect(c,l,o,h)}e(h)?c.culled=!0:(c.distance=h.distance,c.culled=!1)}_getProjectionInfo(i,t,s){const e=this._runningViewState.camera,r=i.stageObject,a=r.geometryRecords[0],o=a.material,c=O(r.boundingVolumeWorldSpace.bounds);p(H,c,e.viewMatrix);const n=a.geometry.vertexAttributes,h=n.get(W.NORMAL).data,l=n.get(W.AUXPOS1).data;return o.applyShaderOffsetsView(H,h,r.transformation,l,e,s.scaleInfo,H),b(Z,H[0],H[1],H[2],1),v(q,Z,e.projectionMatrix),u(s.positionNDC,q,1/q[3]),o.applyShaderOffsetsNDC(s.positionNDC,l,e,s.positionNDC,J),s.distanceWithoutPolygonOffset=e.depthNDCToWorld(J[2]),s.distance=J[2]===s.positionNDC[2]?s.distanceWithoutPolygonOffset:e.depthNDCToWorld(s.positionNDC[2]),b(q,s.positionNDC[0],s.positionNDC[1],s.positionNDC[2],1),v(Z,q,t),y(Z,Z,1/Z[3]),d(s.positionView,H[0],H[1],H[2]),s}_isCulledByHorizon(i,t,s){return f($.direction,i.positionView),d($.origin,0,0,0),!!M(t,$,ii)&&i.distanceWithoutPolygonOffset>s}_isCulledBySlice(i,t){return i.slicePlaneEnabled&&this._runningViewState.slicePlaneEnabled&&C(this._runningViewState.slicePlane,t)}_expandBoundingRect(i,t,e,{positionNDC:r,scaleInfo:a}){const o=this._runningViewState.camera,c=t.getScreenSize(di);k(c,a.factor,c),c[0]*=o.pixelRatio,c[1]*=o.pixelRatio;const n=w(e.calculateRelativeScreenBounds(c,a.factorAlignment.scale,ti),s(0,o.fullWidth,.5+.5*r[0]),s(0,o.fullHeight,.5+.5*r[1])),h=this.iconMarginFactor;if(0!==h){const i=h*Math.min(D(n),N(n));n[0]-=i,n[1]-=i,n[2]+=i,n[3]+=i}j(i.aabr,n,i.aabr)}_isConflicted(i){const t=i.graphics3DGraphic.graphic.uid,s=i.info[this.visibilityGroup];for(let e=Math.floor(s.aabr[0]/this.accBinsSizeX);e<=Math.floor(s.aabr[2]/this.accBinsSizeX);e++)if(!(e<0||e>=this.accBinsNumX))for(let i=Math.floor(s.aabr[1]/this.accBinsSizeY);i<=Math.floor(s.aabr[3]/this.accBinsSizeY);i++){if(i<0||i>=this.accBinsNumY)continue;const r=this.accBins[e][i];for(let i=0;i<r.length;i++){const e=r.data[i],a=e.info[this.visibilityGroup];if(a&&a.visible&&(e.graphics3DGraphic.graphic.uid!==t&&(this.accNumTests++,V(a.aabr,s.aabr))))return!0}}return!1}_initBins(i,t){if(null==this.accBins){this.accBins=[];for(let i=0;i<this.accBinsNumX;i++){this.accBins.push([]);const i=this.accBins[this.accBins.length-1];for(let t=0;t<this.accBinsNumY;t++)i.push(new a)}}else for(let s=0;s<this.accBinsNumX;s++)for(let i=0;i<this.accBinsNumY;i++)this.accBins[s][i].clear();this.accBinsSizeX=i/this.accBinsNumX,this.accBinsSizeY=t/this.accBinsNumY,this.accNumTests=0}_addToBins(i){const t=i.info[this.visibilityGroup],s=Math.floor(t.aabr[0]/this.accBinsSizeX),e=Math.floor(t.aabr[2]/this.accBinsSizeX),r=Math.floor(t.aabr[1]/this.accBinsSizeY),a=Math.floor(t.aabr[3]/this.accBinsSizeY);for(let o=s;o<=e;o++)if(!(o<0||o>=this.accBinsNumX))for(let t=r;t<=a;t++)t<0||t>=this.accBinsNumY||this.accBins[o][t].push(i)}_setGraphicVisibility(i,t){const s=i.graphics3DGraphic;s.destroyed||(s.setVisibilityFlag(R.DECONFLICTION,t,this.visibilityGroup),this.visibilityGroup===X.LABEL&&this.view.labeler.setLabelGraphicVisibility(s,t))}};function li(i,t){const s=i.graphics3DGraphic;s.destroyed||s.clearVisibilityFlag(R.DECONFLICTION,t)}function*pi(i){if(Map.prototype.entries){const t=i.entries();for(let i=t.next();!i.done;i=t.next())yield i.value[1]}else yield*i.values()}function*ui(i,t,s){t.clear(),i.forEach(((i,e)=>{const r=t.pushNew();r.id=e,r.prio=i.info?-i.info[s].distance:Number.MAX_VALUE})),yield;const e=t.iterableSort(((i,t)=>t.prio-i.prio));for(let r=e.next();!r.done;r=e.next())yield;t.forAll((t=>{const s=i.get(t.id);s&&(i.delete(t.id),i.set(t.id,s))})),t.clear()}i([o({constructOnly:!0})],hi.prototype,"view",void 0),i([o({type:Boolean,readOnly:!0})],hi.prototype,"updating",null),hi=i([c("esri.views.3d.layers.graphics.Deconflictor")],hi);const di=l();class fi{constructor(){this.positionView=g(),this.positionNDC=g(),this.distance=0,this.distanceWithoutPolygonOffset=0,this.scaleInfo={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},factorAlignment:{scale:0,factor:0,minPixelSize:0,paddingPixels:0}}}get isOutsideScreen(){const i=this.positionNDC;return i[0]<-1||i[1]<-1||i[2]<-1||i[0]>=1||i[1]>=1}}const mi=new fi;export{hi as Deconflictor,ei as DeconflictorGraphic,ni as DeconflictorViewState,ci as State};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as t}from"../../../../core/maybe.js";import{c as e}from"../../../../chunks/mat4.js";import{c as a}from"../../../../chunks/mat4f64.js";import{s as o}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{projectBuffer as n,computeTranslationToOriginAndRotation as r}from"../../../../geometry/projection.js";import{evaluateElevationInfoAtPoint as i,SampleElevationInfo as c}from"./elevationAlignmentUtils.js";import{updateVertexAttributeAuxpos1w as l}from"./graphicUtils.js";import m from"../../support/debugFlags.js";import{SamplePosition as f}from"../../support/ElevationProvider.js";import{VertexAttribute as p}from"../../webgl-engine/lib/basicInterfaces.js";function u(t,e,a,o){const s=t.stageObject,r=a.spatialReference,c=s.geometryRecords,l="absolute-height"!==e.mode;let u=0;for(const b of c){const t=b.geometry,c=b.getShaderTransformation();g[0]=c[12],g[1]=c[13],g[2]=c[14],t.invalidateBoundingInfo();const d=t.getMutableAttribute(p.POSITION),I=d.data,M=t.vertexAttributes.get(p.MAPPOS).data,A=d.size,O=I.length/A,j=new f(M,r);let v=0,y=!1,P=0;for(let s=0;s<O;s++){if(S[0]=I[v],S[1]=I[v+1],S[2]=I[v+2],i(j,a,e,o,E),l&&(P+=E.sampledElevation),m.TESTS_DISABLE_OPTIMIZATIONS)I[v]=j.array[j.offset],I[v+1]=j.array[j.offset+1],I[v+2]=E.z,n(I,r,v,I,o.spatialReference,v,1),I[v]-=g[0],I[v+1]-=g[1],I[v+2]-=g[2],y=!0;else{h[0]=I[v]+g[0],h[1]=I[v+1]+g[1],h[2]=I[v+2]+g[2],o.setAltitude(h,E.z),I[v]=h[0]-g[0],I[v+1]=h[1]-g[1],I[v+2]=h[2]-g[2];const t=T/o.unitInMeters;(Math.abs(S[0]-I[v])>=t||Math.abs(S[1]-I[v+1])>=t||Math.abs(S[2]-I[v+2])>=t)&&(y=!0)}v+=A,j.offset+=3}u+=P/O,y&&s.geometryVertexAttrsUpdated(b)}return u/c.length}function b(t,a,s,n){const c=t.stageObject,f=a.centerPointInElevationSR;let p=0;if(c.metadata.usesVerticalDistanceToGround)i(f,s,a,n,E),l(c,E.verticalDistanceToGround),p=E.sampledElevation;else{i(f,s,a,n,E);"absolute-height"!==a.mode&&(p=E.sampledElevation)}const u=e(d,c.transformation),b=o(A,u[12],u[13],u[14]);m.TESTS_DISABLE_OPTIMIZATIONS?(h[0]=f.x,h[1]=f.y,h[2]=E.z,r(f.spatialReference,h,u,n.spatialReference)&&(c.transformation=u)):n.setAltitudeOfTransformation(E.z,u);const I=T/n.unitInMeters;return(Math.abs(u[12]-b[0])>=I||Math.abs(u[13]-b[1])>=I||Math.abs(u[14]-b[2])>=I)&&(c.transformation=u),p}const d=a();function I(e,a,s,n){const c=e.graphics3DSymbolLayer.lodRenderer;if(t(c))return 0;const l=a.centerPointInElevationSR;i(l,s,a,n,E);const f="absolute-height"!==a.mode?E.sampledElevation:0,p=c.instanceData,u=e.instanceIndex,b=M;p.getGlobalTransform(u,b);const d=o(A,b[12],b[13],b[14]);m.TESTS_DISABLE_OPTIMIZATIONS?(h[0]=l.x,h[1]=l.y,h[2]=E.z,r(l.spatialReference,h,b,n.spatialReference)&&p.setGlobalTransform(u,b)):n.setAltitudeOfTransformation(E.z,b);const I=T/n.unitInMeters;return(m.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(b[12]-d[0])>=I||Math.abs(b[13]-d[1])>=I||Math.abs(b[14]-d[2])>=I)&&p.setGlobalTransform(u,b),f}const T=.01,h=s(),g=s(),S=s(),M=a(),A=s(),E=new c;export{I as perLodInstanceElevationAligner,b as perObjectElevationAligner,u as perVertexElevationAligner};
5
+ import{isNone as t}from"../../../../core/maybe.js";import{c as e}from"../../../../chunks/mat4.js";import{c as a}from"../../../../chunks/mat4f64.js";import{s as o}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{projectBuffer as r,computeTranslationToOriginAndRotation as n}from"../../../../geometry/projection.js";import{evaluateElevationInfoAtPoint as i,SampleElevationInfo as l}from"./elevationAlignmentUtils.js";import{updateVertexAttributeAuxpos1w as c}from"./graphicUtils.js";import m from"../../support/debugFlags.js";import{SamplePosition as f}from"../../support/ElevationProvider.js";import{VertexAttribute as u}from"../../webgl-engine/lib/VertexAttribute.js";function p(t,e,a,o){const s=t.stageObject,n=a.spatialReference,l=s.geometryRecords,c="absolute-height"!==e.mode;let p=0;for(const b of l){const t=b.geometry,l=b.getShaderTransformation();g[0]=l[12],g[1]=l[13],g[2]=l[14],t.invalidateBoundingInfo();const d=t.getMutableAttribute(u.POSITION),I=d.data,M=t.vertexAttributes.get(u.MAPPOS).data,A=d.size,O=I.length/A,j=new f(M,n);let v=0,y=!1,P=0;for(let s=0;s<O;s++){if(S[0]=I[v],S[1]=I[v+1],S[2]=I[v+2],i(j,a,e,o,E),c&&(P+=E.sampledElevation),m.TESTS_DISABLE_OPTIMIZATIONS)I[v]=j.array[j.offset],I[v+1]=j.array[j.offset+1],I[v+2]=E.z,r(I,n,v,I,o.spatialReference,v,1),I[v]-=g[0],I[v+1]-=g[1],I[v+2]-=g[2],y=!0;else{h[0]=I[v]+g[0],h[1]=I[v+1]+g[1],h[2]=I[v+2]+g[2],o.setAltitude(h,E.z),I[v]=h[0]-g[0],I[v+1]=h[1]-g[1],I[v+2]=h[2]-g[2];const t=T/o.unitInMeters;(Math.abs(S[0]-I[v])>=t||Math.abs(S[1]-I[v+1])>=t||Math.abs(S[2]-I[v+2])>=t)&&(y=!0)}v+=A,j.offset+=3}p+=P/O,y&&s.geometryVertexAttrsUpdated(b)}return p/l.length}function b(t,a,s,r){const l=t.stageObject,f=a.centerPointInElevationSR;let u=0;if(l.metadata.usesVerticalDistanceToGround)i(f,s,a,r,E),c(l,E.verticalDistanceToGround),u=E.sampledElevation;else{i(f,s,a,r,E);"absolute-height"!==a.mode&&(u=E.sampledElevation)}const p=e(d,l.transformation),b=o(A,p[12],p[13],p[14]);m.TESTS_DISABLE_OPTIMIZATIONS?(h[0]=f.x,h[1]=f.y,h[2]=E.z,n(f.spatialReference,h,p,r.spatialReference)&&(l.transformation=p)):r.setAltitudeOfTransformation(E.z,p);const I=T/r.unitInMeters;return(Math.abs(p[12]-b[0])>=I||Math.abs(p[13]-b[1])>=I||Math.abs(p[14]-b[2])>=I)&&(l.transformation=p),u}const d=a();function I(e,a,s,r){const l=e.graphics3DSymbolLayer.lodRenderer;if(t(l))return 0;const c=a.centerPointInElevationSR;i(c,s,a,r,E);const f="absolute-height"!==a.mode?E.sampledElevation:0,u=l.instanceData,p=e.instanceIndex,b=M;u.getGlobalTransform(p,b);const d=o(A,b[12],b[13],b[14]);m.TESTS_DISABLE_OPTIMIZATIONS?(h[0]=c.x,h[1]=c.y,h[2]=E.z,n(c.spatialReference,h,b,r.spatialReference)&&u.setGlobalTransform(p,b)):r.setAltitudeOfTransformation(E.z,b);const I=T/r.unitInMeters;return(m.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(b[12]-d[0])>=I||Math.abs(b[13]-d[1])>=I||Math.abs(b[14]-d[2])>=I)&&u.setGlobalTransform(p,b),f}const T=.01,h=s(),g=s(),S=s(),M=a(),A=s(),E=new l;export{I as perLodInstanceElevationAligner,b as perObjectElevationAligner,p as perVertexElevationAligner};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{get as t,isSome as r,isNone as s}from"../../../../core/maybe.js";import{e as n}from"../../../../chunks/earcut.js";import{a}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{a as o}from"../../../../chunks/mat4.js";import{I as l,c}from"../../../../chunks/mat4f64.js";import{g as h,n as m,s as p,f as d,c as u,m as f}from"../../../../chunks/vec3.js";import{d as g,c as y}from"../../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as _}from"../../../../geometry/projection.js";import{create as b,empty as E,expandWithBuffer as x,intersectsClippingArea as P}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f64 as v}from"../../../../geometry/support/buffer/BufferView.js";import{t as S,a as w}from"../../../../chunks/vec32.js";import{getDriverAxisSizeValue as j}from"../../../../renderers/support/renderingInfoUtils.js";import{ViewingMode as A}from"../../../ViewingMode.js";import{needsElevationUpdates3D as L,evaluateElevationInfoAtPoint as M,SampleElevationInfo as O}from"./elevationAlignmentUtils.js";import{ElevationContext as B}from"./ElevationContext.js";import{Graphics3DObject3DGraphicLayer as I}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as C}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as R,computeCentroid as T}from"./graphicUtils.js";import{ApplyRendererDiffResult as z}from"./interfaces.js";import{geometryAsPolygon as G,geometryToRenderInfo as D}from"./polygonUtils.js";import{createMaterial as U}from"../support/edgeUtils.js";import k from"../../support/debugFlags.js";import{SamplePosition as N}from"../../support/ElevationProvider.js";import{CullFaceOptions as F,VertexAttribute as H,PrimitiveType as V}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as Y}from"../../webgl-engine/lib/Geometry.js";import{Object3D as Z}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as W}from"../../webgl-engine/materials/DefaultMaterial.js";const q=["polygon","extent"];class J extends C{constructor(e,t,r,s){super(e,t,r,s),this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const t=R(this._getSymbolSize());if(t)throw new e("graphics3dextrudesymbollayer:invalid-size",t)}const r=t(this.symbolLayer,"material","color"),s=this._getCombinedOpacityAndColor(r),n=g(s),a=s[3],i=a<1||this.needsDrivenTransparentPass,o={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,diffuse:n,ambient:n,opacity:a,transparent:i,cullFace:i?F.None:F.Back,vertexColors:!0,slicePlaneEnabled:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0};this._material=new W(o),this._bottomMaterial=new W({...o,cullFace:F.Back}),this._context.stage.add(this._material),this._context.stage.add(this._bottomMaterial)}destroy(){super.destroy(),this._material&&(this._context.stage.remove(this._material),this._context.stage.remove(this._bottomMaterial))}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,q,this.symbolLayer.type))return null;const r=this._getVertexOpacityAndColor(e.renderingInfo,255),s=this.setGraphicElevationContext(t,new B);return this._createAs3DShape(t,e.renderingInfo,r,s,t.uid)}layerOpacityChanged(e,s){const n=t(this.symbolLayer,"material","color"),a=this._getCombinedOpacity(n),i=a<1||this.needsDrivenTransparentPass;this._material.setParameters({opacity:a,transparent:i}),this._bottomMaterial.setParameters({opacity:a,transparent:i});const o=this._getLayerOpacity();return e.forEach((e=>{const t=s(e);r(t)&&t.layerOpacityChanged(o,this._context.isAsync)})),!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,L)}slicePlaneEnabledChanged(e,t){return this._material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),this._bottomMaterial.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),e.forEach((e=>{const s=t(e);r(s)&&s.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){return this._material.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._bottomMaterial.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}pixelRatioChanged(){return!0}_getExtrusionSize(e){let t;var r;e.size&&this._drivenProperties.size?t=null!=(r=j(e.size,2))?r:0:t=this._getSymbolSize();return t/=this._context.renderCoordsHelper.unitInMeters,t}applyRendererDiff(){return z.Recreate_Graphics}_getSymbolSize(){var e;return null!=(e=this.symbolLayer.size)?e:1}_createAs3DShape(e,t,h,m,p){const d=G(e.geometry);if(s(d))return null;const u=D(d,this._context.elevationProvider,this._context.renderCoordsHelper,m);if(this._logGeometryCreationWarnings(u,d.rings,"rings","ExtrudeSymbol3DLayer"),0===d.rings.length||!d.rings.some((e=>e.length>0)))return null;const f=T(d);if(s(f))return null;const g=new Array,j=new Array,M=new Array,O=b(),B=c(),C=y(),R=this._context.renderCoordsHelper.viewingMode===A.Global;R||this._context.renderCoordsHelper.worldUpAtPosition(null,C),_(d.spatialReference,[f.x,f.y,0],B,this._context.renderCoordsHelper.spatialReference);const z=c();o(z,B);const k=i();a(k,z);const{polygons:N,mapPosition:F,position:H}=u,V=H.length/3,Y=new Float64Array(3*V*6),W=new Float64Array(3*V*6),q=new Float64Array(3*V*6),J=new Float64Array(1*V*6);let Q=0;for(let r=0;r<N.length;++r){const e=N[r],s=e.count;if(this._context.clippingExtent&&(E(O),x(O,e.mapPosition),!P(O,this._context.clippingExtent)))continue;const a=n(e.mapPosition,e.holeIndices,3);if(0===a.length)continue;const i=3*s*2+a.length,o=new Uint32Array(i),c=new Uint32Array(a.length),m=6*s,p=3*Y.BYTES_PER_ELEMENT,d=new v(Y.buffer,Q*p,p,(Q+m)*p),u=3*W.BYTES_PER_ELEMENT,f=new v(W.buffer,Q*u,u,(Q+m)*u),y=new Float64Array(q.buffer,3*Q*q.BYTES_PER_ELEMENT,3*m),_=new Float64Array(J.buffer,1*Q*J.BYTES_PER_ELEMENT,1*m),b=this._getExtrusionSize(t);K(H,F,a,e,d.typedBuffer,y,f.typedBuffer,_,0,o,c,b,C,R),S(d,d,z),w(f,f,k),Q+=6*s;const A=this._createExtrudeGeometry(o,o.length-c.length,{positions:d.typedBuffer,elevation:y,normals:f.typedBuffer,heights:_},h);g.push(A),j.push(this._material),M.push(l);const L=this._createExtrudeGeometry(c,0,{positions:d.typedBuffer,elevation:y,normals:f.typedBuffer,heights:_},h);g.push(L),j.push(this._bottomMaterial),M.push(l)}if(0===g.length)return null;const X=new Z({geometries:g,materials:j,transformations:M,metadata:{layerUid:this._context.layer.uid,graphicUid:p,isElevationSource:!0}});X.transformation=B;const $=U(this.symbolLayer,{opacity:this._getLayerOpacity()}),ee=r($)?{baseMaterial:this._material,edgeMaterials:[$],properties:{mergeGeometries:!0,slicePlaneEnabled:this._context.slicePlaneEnabled}}:null,te=new I(this,X,g,null,null,le,m,ee);return te.alignedSampledElevation=u.sampledElevation,te.needsElevationUpdates=L(m.mode),te}_createExtrudeGeometry(e,t,r,s){const n=new Uint32Array(e.length),a=[[H.POSITION,{size:3,data:r.positions,exclusive:!0}],[H.NORMAL,{size:3,data:r.normals,exclusive:!0}],[H.COLOR,{size:4,data:s,exclusive:!0}],[H.SIZE,{size:1,data:r.heights,exclusive:!0}]],i=[[H.POSITION,e],[H.NORMAL,e],[H.COLOR,n]];return r.elevation&&(a.push([H.MAPPOS,{size:3,data:r.elevation}]),i.push([H.MAPPOS,e])),new Y(a,i,V.Triangle,t)}}function K(e,t,r,s,n,a,i,o,l,c,h,m,p,d){const u=r.length/3;let f=0,g=2*s.count;Q(e,t,s.index,s.count,r,0,u,n,a,i,o,l,c,h,g,m,p,d),l+=2*s.count,g=0,ee(n,a,o,i,f,s.pathLengths[0],s.count,l,c,g,m),l+=4*s.pathLengths[0],g+=2*s.pathLengths[0],f+=s.pathLengths[0];for(let y=1;y<s.pathLengths.length;++y)ee(n,a,o,i,f,s.pathLengths[y],s.count,l,c,g,m),l+=4*s.pathLengths[y],g+=2*s.pathLengths[y],f+=s.pathLengths[y]}function Q(e,t,r,s,n,a,i,o,l,c,p,d,u,f,g,y,_,b){h(he,_);const E=y>0?1:-1;let x=3*r,P=d,v=3*P,S=d+s,w=3*S;for(let h=0;h<s;++h)b&&(he[0]=e[x+0],he[1]=e[x+1],he[2]=e[x+2],m(he,he)),o[v+0]=e[x+0],o[v+1]=e[x+1],o[v+2]=e[x+2],l[v+0]=t[x+0],l[v+1]=t[x+1],l[v+2]=t[x+2],c[v+0]=-E*he[0],c[v+1]=-E*he[1],c[v+2]=-E*he[2],p[P]=0,o[w+0]=e[x+0]+y*he[0],o[w+1]=e[x+1]+y*he[1],o[w+2]=e[x+2]+y*he[2],l[w+0]=t[x+0],l[w+1]=t[x+1],l[w+2]=t[x+2],c[w+0]=E*he[0],c[w+1]=E*he[1],c[w+2]=E*he[2],p[S]=y,v+=3,w+=3,x+=3,P+=1,S+=1;x=3*a,v=0,w=3*g;const j=y<0?de:pe,A=y<0?pe:de;for(let h=0;h<i;++h)f[v+0]=n[x+j[0]],f[v+1]=n[x+j[1]],f[v+2]=n[x+j[2]],u[w+0]=n[x+A[0]]+s,u[w+1]=n[x+A[1]]+s,u[w+2]=n[x+A[2]]+s,v+=3,w+=3,x+=3}function X(e,t,r,s,n,a,i){s[a]=s[i],i*=3,e[(a*=3)+0]=e[i+0],e[a+1]=e[i+1],e[a+2]=e[i+2],t[a+0]=t[i+0],t[a+1]=t[i+1],t[a+2]=t[i+2],r[a+0]=n[0],r[a+1]=n[1],r[a+2]=n[2]}const $=y();function ee(e,t,r,s,n,a,i,o,l,c,h){let m=n,p=n+1,d=n+i,u=n+i+1,f=o,g=o+1,y=o+2*a,_=o+2*a+1;h<0&&(m=n+i+1,u=n),c*=3;for(let b=0;b<a;++b)b===a-1&&(h>0?(p=n,u=n+i):(p=n,m=n+i)),ie(e,m,p,d,$),X(e,t,s,r,$,f,m),X(e,t,s,r,$,g,p),X(e,t,s,r,$,y,d),X(e,t,s,r,$,_,u),l[c++]=f,l[c++]=y,l[c++]=_,l[c++]=f,l[c++]=_,l[c++]=g,m++,p++,d++,u++,f+=2,g+=2,y+=2,_+=2}const te=y(),re=y(),se=y(),ne=y(),ae=y();function ie(e,t,r,s,n){t*=3,r*=3,s*=3,p(te,e[t++],e[t++],e[t++]),p(re,e[r++],e[r++],e[r++]),p(se,e[s++],e[s++],e[s++]),d(ne,re,te),d(ae,se,te),u(n,ae,ne),m(n,n)}const oe=y();function le(e,t,r,s){const n=e.stageObject,a=n.geometryRecords,i=a.length,l="absolute-height"!==t.mode;let h=0;const m=n.transformation,d=o(c(),m);for(let o=0;o<i;o+=2){const e=a[o].geometry,i=e.getMutableAttribute(H.POSITION).data,c=e.vertexAttributes.get(H.SIZE).data,u=e.vertexAttributes.get(H.MAPPOS).data,g=new N(u),y=i.length/3;let _=0,b=!1,E=0;const x=r.spatialReference;for(let n=0;n<y;n++){oe[0]=i[_],oe[1]=i[_+1],oe[2]=i[_+2],M(g,r,t,s,me),l&&(E+=me.sampledElevation),k.TESTS_DISABLE_OPTIMIZATIONS?(p(ce,g.array[g.offset+0],g.array[g.offset+1],me.z+c[_/3]),s.toRenderCoords(ce,x,ce),f(ce,ce,d)):(p(ce,i[_+0],i[_+1],i[_+2]),f(ce,ce,m),s.setAltitude(ce,me.z+c[_/3]),f(ce,ce,d)),i[_]=ce[0],i[_+1]=ce[1],i[_+2]=ce[2];const e=ue/s.unitInMeters;(Math.abs(oe[0]-i[_])>=e||Math.abs(oe[1]-i[_+1])>=e||Math.abs(oe[2]-i[_+2])>=e)&&(b=!0),g.offset+=3,_+=3}b&&(e.invalidateBoundingInfo(),n.geometryVertexAttrsUpdated(a[o]),a[o+1].geometry.invalidateBoundingInfo(),n.geometryVertexAttrsUpdated(a[o+1])),h+=E/y}return h/i}const ce=y(),he=y(),me=new O,pe=[0,2,1],de=[0,1,2],ue=.01;export{J as Graphics3DExtrudeSymbolLayer};
5
+ import e from"../../../../core/Error.js";import{get as t,isSome as r,isNone as s}from"../../../../core/maybe.js";import{e as n}from"../../../../chunks/earcut.js";import{a}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{a as o}from"../../../../chunks/mat4.js";import{I as l,c}from"../../../../chunks/mat4f64.js";import{g as h,n as m,s as p,f as d,c as u,m as f}from"../../../../chunks/vec3.js";import{d as g,c as y}from"../../../../chunks/vec3f64.js";import{computeTranslationToOriginAndRotation as _}from"../../../../geometry/projection.js";import{create as b,empty as E,expandWithBuffer as x,intersectsClippingArea as P}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f64 as v}from"../../../../geometry/support/buffer/BufferView.js";import{t as S,a as w}from"../../../../chunks/vec32.js";import{getDriverAxisSizeValue as j}from"../../../../renderers/support/renderingInfoUtils.js";import{ViewingMode as A}from"../../../ViewingMode.js";import{needsElevationUpdates3D as L,evaluateElevationInfoAtPoint as M,SampleElevationInfo as O}from"./elevationAlignmentUtils.js";import{ElevationContext as B}from"./ElevationContext.js";import{Graphics3DObject3DGraphicLayer as I}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as C}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as R,computeCentroid as T}from"./graphicUtils.js";import{ApplyRendererDiffResult as z}from"./interfaces.js";import{geometryAsPolygon as G,geometryToRenderInfo as D}from"./polygonUtils.js";import{createMaterial as U}from"../support/edgeUtils.js";import k from"../../support/debugFlags.js";import{SamplePosition as N}from"../../support/ElevationProvider.js";import{CullFaceOptions as F,PrimitiveType as V}from"../../webgl-engine/lib/basicInterfaces.js";import{Geometry as H}from"../../webgl-engine/lib/Geometry.js";import{Object3D as Y}from"../../webgl-engine/lib/Object3D.js";import{VertexAttribute as Z}from"../../webgl-engine/lib/VertexAttribute.js";import{DefaultMaterial as W}from"../../webgl-engine/materials/DefaultMaterial.js";const q=["polygon","extent"];class J extends C{constructor(e,t,r,s){super(e,t,r,s),this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const t=R(this._getSymbolSize());if(t)throw new e("graphics3dextrudesymbollayer:invalid-size",t)}const r=t(this.symbolLayer,"material","color"),s=this._getCombinedOpacityAndColor(r),n=g(s),a=s[3],i=a<1||this.needsDrivenTransparentPass,o={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,diffuse:n,ambient:n,opacity:a,transparent:i,cullFace:i?F.None:F.Back,vertexColors:!0,slicePlaneEnabled:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0};this._material=new W(o),this._bottomMaterial=new W({...o,cullFace:F.Back}),this._context.stage.add(this._material),this._context.stage.add(this._bottomMaterial)}destroy(){super.destroy(),this._material&&(this._context.stage.remove(this._material),this._context.stage.remove(this._bottomMaterial))}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,q,this.symbolLayer.type))return null;const r=this._getVertexOpacityAndColor(e.renderingInfo,255),s=this.setGraphicElevationContext(t,new B);return this._createAs3DShape(t,e.renderingInfo,r,s,t.uid)}layerOpacityChanged(e,s){const n=t(this.symbolLayer,"material","color"),a=this._getCombinedOpacity(n),i=a<1||this.needsDrivenTransparentPass;this._material.setParameters({opacity:a,transparent:i}),this._bottomMaterial.setParameters({opacity:a,transparent:i});const o=this._getLayerOpacity();return e.forEach((e=>{const t=s(e);r(t)&&t.layerOpacityChanged(o,this._context.isAsync)})),!0}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,L)}slicePlaneEnabledChanged(e,t){return this._material.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),this._bottomMaterial.setParameters({slicePlaneEnabled:this._context.slicePlaneEnabled}),e.forEach((e=>{const s=t(e);r(s)&&s.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)})),!0}physicalBasedRenderingChanged(){return this._material.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._bottomMaterial.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}pixelRatioChanged(){return!0}_getExtrusionSize(e){let t;var r;e.size&&this._drivenProperties.size?t=null!=(r=j(e.size,2))?r:0:t=this._getSymbolSize();return t/=this._context.renderCoordsHelper.unitInMeters,t}applyRendererDiff(){return z.Recreate_Graphics}_getSymbolSize(){var e;return null!=(e=this.symbolLayer.size)?e:1}_createAs3DShape(e,t,h,m,p){const d=G(e.geometry);if(s(d))return null;const u=D(d,this._context.elevationProvider,this._context.renderCoordsHelper,m);if(this._logGeometryCreationWarnings(u,d.rings,"rings","ExtrudeSymbol3DLayer"),0===d.rings.length||!d.rings.some((e=>e.length>0)))return null;const f=T(d);if(s(f))return null;const g=new Array,j=new Array,M=new Array,O=b(),B=c(),C=y(),R=this._context.renderCoordsHelper.viewingMode===A.Global;R||this._context.renderCoordsHelper.worldUpAtPosition(null,C),_(d.spatialReference,[f.x,f.y,0],B,this._context.renderCoordsHelper.spatialReference);const z=c();o(z,B);const k=i();a(k,z);const{polygons:N,mapPosition:F,position:V}=u,H=V.length/3,Z=new Float64Array(3*H*6),W=new Float64Array(3*H*6),q=new Float64Array(3*H*6),J=new Float64Array(1*H*6);let Q=0;for(let r=0;r<N.length;++r){const e=N[r],s=e.count;if(this._context.clippingExtent&&(E(O),x(O,e.mapPosition),!P(O,this._context.clippingExtent)))continue;const a=n(e.mapPosition,e.holeIndices,3);if(0===a.length)continue;const i=3*s*2+a.length,o=new Uint32Array(i),c=new Uint32Array(a.length),m=6*s,p=3*Z.BYTES_PER_ELEMENT,d=new v(Z.buffer,Q*p,p,(Q+m)*p),u=3*W.BYTES_PER_ELEMENT,f=new v(W.buffer,Q*u,u,(Q+m)*u),y=new Float64Array(q.buffer,3*Q*q.BYTES_PER_ELEMENT,3*m),_=new Float64Array(J.buffer,1*Q*J.BYTES_PER_ELEMENT,1*m),b=this._getExtrusionSize(t);K(V,F,a,e,d.typedBuffer,y,f.typedBuffer,_,0,o,c,b,C,R),S(d,d,z),w(f,f,k),Q+=6*s;const A=this._createExtrudeGeometry(o,o.length-c.length,{positions:d.typedBuffer,elevation:y,normals:f.typedBuffer,heights:_},h);g.push(A),j.push(this._material),M.push(l);const L=this._createExtrudeGeometry(c,0,{positions:d.typedBuffer,elevation:y,normals:f.typedBuffer,heights:_},h);g.push(L),j.push(this._bottomMaterial),M.push(l)}if(0===g.length)return null;const X=new Y({geometries:g,materials:j,transformations:M,metadata:{layerUid:this._context.layer.uid,graphicUid:p,isElevationSource:!0}});X.transformation=B;const $=U(this.symbolLayer,{opacity:this._getLayerOpacity()}),ee=r($)?{baseMaterial:this._material,edgeMaterials:[$],properties:{mergeGeometries:!0,slicePlaneEnabled:this._context.slicePlaneEnabled}}:null,te=new I(this,X,g,null,null,le,m,ee);return te.alignedSampledElevation=u.sampledElevation,te.needsElevationUpdates=L(m.mode),te}_createExtrudeGeometry(e,t,r,s){const n=new Uint32Array(e.length),a=[[Z.POSITION,{size:3,data:r.positions,exclusive:!0}],[Z.NORMAL,{size:3,data:r.normals,exclusive:!0}],[Z.COLOR,{size:4,data:s,exclusive:!0}],[Z.SIZE,{size:1,data:r.heights,exclusive:!0}]],i=[[Z.POSITION,e],[Z.NORMAL,e],[Z.COLOR,n]];return r.elevation&&(a.push([Z.MAPPOS,{size:3,data:r.elevation}]),i.push([Z.MAPPOS,e])),new H(a,i,V.Triangle,t)}}function K(e,t,r,s,n,a,i,o,l,c,h,m,p,d){const u=r.length/3;let f=0,g=2*s.count;Q(e,t,s.index,s.count,r,0,u,n,a,i,o,l,c,h,g,m,p,d),l+=2*s.count,g=0,ee(n,a,o,i,f,s.pathLengths[0],s.count,l,c,g,m),l+=4*s.pathLengths[0],g+=2*s.pathLengths[0],f+=s.pathLengths[0];for(let y=1;y<s.pathLengths.length;++y)ee(n,a,o,i,f,s.pathLengths[y],s.count,l,c,g,m),l+=4*s.pathLengths[y],g+=2*s.pathLengths[y],f+=s.pathLengths[y]}function Q(e,t,r,s,n,a,i,o,l,c,p,d,u,f,g,y,_,b){h(he,_);const E=y>0?1:-1;let x=3*r,P=d,v=3*P,S=d+s,w=3*S;for(let h=0;h<s;++h)b&&(he[0]=e[x+0],he[1]=e[x+1],he[2]=e[x+2],m(he,he)),o[v+0]=e[x+0],o[v+1]=e[x+1],o[v+2]=e[x+2],l[v+0]=t[x+0],l[v+1]=t[x+1],l[v+2]=t[x+2],c[v+0]=-E*he[0],c[v+1]=-E*he[1],c[v+2]=-E*he[2],p[P]=0,o[w+0]=e[x+0]+y*he[0],o[w+1]=e[x+1]+y*he[1],o[w+2]=e[x+2]+y*he[2],l[w+0]=t[x+0],l[w+1]=t[x+1],l[w+2]=t[x+2],c[w+0]=E*he[0],c[w+1]=E*he[1],c[w+2]=E*he[2],p[S]=y,v+=3,w+=3,x+=3,P+=1,S+=1;x=3*a,v=0,w=3*g;const j=y<0?de:pe,A=y<0?pe:de;for(let h=0;h<i;++h)f[v+0]=n[x+j[0]],f[v+1]=n[x+j[1]],f[v+2]=n[x+j[2]],u[w+0]=n[x+A[0]]+s,u[w+1]=n[x+A[1]]+s,u[w+2]=n[x+A[2]]+s,v+=3,w+=3,x+=3}function X(e,t,r,s,n,a,i){s[a]=s[i],i*=3,e[(a*=3)+0]=e[i+0],e[a+1]=e[i+1],e[a+2]=e[i+2],t[a+0]=t[i+0],t[a+1]=t[i+1],t[a+2]=t[i+2],r[a+0]=n[0],r[a+1]=n[1],r[a+2]=n[2]}const $=y();function ee(e,t,r,s,n,a,i,o,l,c,h){let m=n,p=n+1,d=n+i,u=n+i+1,f=o,g=o+1,y=o+2*a,_=o+2*a+1;h<0&&(m=n+i+1,u=n),c*=3;for(let b=0;b<a;++b)b===a-1&&(h>0?(p=n,u=n+i):(p=n,m=n+i)),ie(e,m,p,d,$),X(e,t,s,r,$,f,m),X(e,t,s,r,$,g,p),X(e,t,s,r,$,y,d),X(e,t,s,r,$,_,u),l[c++]=f,l[c++]=y,l[c++]=_,l[c++]=f,l[c++]=_,l[c++]=g,m++,p++,d++,u++,f+=2,g+=2,y+=2,_+=2}const te=y(),re=y(),se=y(),ne=y(),ae=y();function ie(e,t,r,s,n){t*=3,r*=3,s*=3,p(te,e[t++],e[t++],e[t++]),p(re,e[r++],e[r++],e[r++]),p(se,e[s++],e[s++],e[s++]),d(ne,re,te),d(ae,se,te),u(n,ae,ne),m(n,n)}const oe=y();function le(e,t,r,s){const n=e.stageObject,a=n.geometryRecords,i=a.length,l="absolute-height"!==t.mode;let h=0;const m=n.transformation,d=o(c(),m);for(let o=0;o<i;o+=2){const e=a[o].geometry,i=e.getMutableAttribute(Z.POSITION).data,c=e.vertexAttributes.get(Z.SIZE).data,u=e.vertexAttributes.get(Z.MAPPOS).data,g=new N(u),y=i.length/3;let _=0,b=!1,E=0;const x=r.spatialReference;for(let n=0;n<y;n++){oe[0]=i[_],oe[1]=i[_+1],oe[2]=i[_+2],M(g,r,t,s,me),l&&(E+=me.sampledElevation),k.TESTS_DISABLE_OPTIMIZATIONS?(p(ce,g.array[g.offset+0],g.array[g.offset+1],me.z+c[_/3]),s.toRenderCoords(ce,x,ce),f(ce,ce,d)):(p(ce,i[_+0],i[_+1],i[_+2]),f(ce,ce,m),s.setAltitude(ce,me.z+c[_/3]),f(ce,ce,d)),i[_]=ce[0],i[_+1]=ce[1],i[_+2]=ce[2];const e=ue/s.unitInMeters;(Math.abs(oe[0]-i[_])>=e||Math.abs(oe[1]-i[_+1])>=e||Math.abs(oe[2]-i[_+2])>=e)&&(b=!0),g.offset+=3,_+=3}b&&(e.invalidateBoundingInfo(),n.geometryVertexAttrsUpdated(a[o]),a[o+1].geometry.invalidateBoundingInfo(),n.geometryVertexAttrsUpdated(a[o+1])),h+=E/y}return h/i}const ce=y(),he=y(),me=new O,pe=[0,2,1],de=[0,1,2],ue=.01;export{J as Graphics3DExtrudeSymbolLayer};