@arcgis/core 4.33.0-next.20250210 → 4.33.0-next.20250212

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 (562) hide show
  1. package/AttributeBinsGraphic.js +1 -1
  2. package/Graphic.js +1 -1
  3. package/Ground.js +1 -1
  4. package/WebMap.js +1 -1
  5. package/WebScene.js +1 -1
  6. package/arcade/ArcadeModuleResolver.js +1 -1
  7. package/arcade/featureset/actions/Adapted.js +1 -1
  8. package/arcade/featureset/support/FeatureSet.js +1 -1
  9. package/arcade/featureset/support/Guid.js +1 -1
  10. package/arcade/featureset/support/cache.js +1 -1
  11. package/assets/esri/core/workers/RemoteClient.js +1 -1
  12. package/assets/esri/core/workers/chunks/{d31f7598629f7cc50233.js → 004853abf357f865b4fa.js} +1 -1
  13. package/assets/esri/core/workers/chunks/00e374e3b4781c4f9a3e.js +1 -0
  14. package/assets/esri/core/workers/chunks/{746c964cf07e4306f21f.js → 03f51ea011ffbcfb7c7d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{ad3e692681b50bd1acc2.js → 03fac4c79641603d8cba.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{0167cf867d8e46c818b0.js → 09260bbe1fd6ce5a53e6.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{3c23e567cfb7372c44ba.js → 0a5689348d544090006d.js} +1 -1
  18. package/assets/esri/core/workers/chunks/0b8bf1966653c326e95a.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d1718ad93e3271b0525e.js → 0e4350fda5328862f2fb.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{c26ffbff1115e76bcb0f.js → 1249fd2f83caeaefd8ce.js} +1 -1
  21. package/assets/esri/core/workers/chunks/135fb580d8afd8d60811.js +1 -0
  22. package/assets/esri/core/workers/chunks/{946a9890f3621d1dfbc5.js → 144e534d4ac1aafab60d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{cee3a38b92a48a58c4d0.js → 152becae48572299b07f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{f200dca22f9f9bbb8670.js → 17213c3fc63f580e5b73.js} +1 -1
  25. package/assets/esri/core/workers/chunks/1a286d43daa3b811c30d.js +1 -0
  26. package/assets/esri/core/workers/chunks/{e5e3b6d00d27b5bb354f.js → 1d282700e76285a1684c.js} +1 -1
  27. package/assets/esri/core/workers/chunks/2130e0c8d2410c87f880.js +1 -0
  28. package/assets/esri/core/workers/chunks/24e6476f32ad2014d39d.js +1 -0
  29. package/assets/esri/core/workers/chunks/2530e5d1f438db8a7b5c.js +1 -0
  30. package/assets/esri/core/workers/chunks/272662e4e28341419b4f.js +1 -0
  31. package/assets/esri/core/workers/chunks/{dfaf1da323906ee60549.js → 2876419a32537e24b7da.js} +1 -1
  32. package/assets/esri/core/workers/chunks/2b733e8043659466e194.js +1 -0
  33. package/assets/esri/core/workers/chunks/{5fbdb5fea7d6676fcf19.js → 2c1a85a801cb4d9d737e.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{7f87cf3d6a365d987f69.js → 30bd5b3204e09f516ea2.js} +1 -1
  35. package/assets/esri/core/workers/chunks/311c85bd94d5fb28e272.js +1 -0
  36. package/assets/esri/core/workers/chunks/33c6fd524711efd8ef13.js +1 -0
  37. package/assets/esri/core/workers/chunks/{594d923400fd74881833.js → 35392bf8f21005ad6170.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{c04091eea7089dc2e864.js → 35bcb0622234b38d85b4.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{92984981afcbb95828cd.js → 37cfd102b6ab5b959f9d.js} +1 -1
  40. package/assets/esri/core/workers/chunks/3835c2884c55e73dc202.js +1 -0
  41. package/assets/esri/core/workers/chunks/{de1f3c4b8000c2d73013.js → 39dca492cc5f089e1609.js} +1 -1
  42. package/assets/esri/core/workers/chunks/3ba85f1d660b8887f963.js +314 -0
  43. package/assets/esri/core/workers/chunks/{1d51c064045e9c47bd2e.js → 3bad184751fcb26c003c.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{5b85f9da022742f602e2.js → 3c8e5b5fb52611e30ed6.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{e468bf4ec7402942ad8c.js → 3ebdd0701e77bb28c75d.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{a559db8654b4f83fd79b.js → 3f6516af411256d90a03.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{c83b26ff96e39266adc2.js → 4300c80fa10c5d9141e8.js} +1 -1
  48. package/assets/esri/core/workers/chunks/4848a3e31632d15dc4ce.js +1 -0
  49. package/assets/esri/core/workers/chunks/{77764ca90bdd13ee2167.js → 486df1e042204b90b0dd.js} +2 -2
  50. package/assets/esri/core/workers/chunks/{77764ca90bdd13ee2167.js.LICENSE.txt → 486df1e042204b90b0dd.js.LICENSE.txt} +1 -1
  51. package/assets/esri/core/workers/chunks/491effb2c681493cc3a6.js +1 -0
  52. package/assets/esri/core/workers/chunks/{e93dea6b112ce8e2779b.js → 4b47549614d53ce1e384.js} +1 -1
  53. package/assets/esri/core/workers/chunks/52f61e1f5972a72b6b54.js +1 -0
  54. package/assets/esri/core/workers/chunks/{354531dc2f0dea2ad96f.js → 5693d9ce4472a4c5959f.js} +2 -2
  55. package/assets/esri/core/workers/chunks/{354531dc2f0dea2ad96f.js.LICENSE.txt → 5693d9ce4472a4c5959f.js.LICENSE.txt} +1 -1
  56. package/assets/esri/core/workers/chunks/{e56647e61296643c5f84.js → 5719471414810b6a9aec.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{1accbc048b74857269e4.js → 57924f4909f2cbe5d64c.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{b21b152fa15896577242.js → 5b56b271afb0fadf48b4.js} +2 -2
  59. package/assets/esri/core/workers/chunks/{b21b152fa15896577242.js.LICENSE.txt → 5b56b271afb0fadf48b4.js.LICENSE.txt} +1 -1
  60. package/assets/esri/core/workers/chunks/{b3aeda290470dcb2bdd2.js → 5cf08ee5114273163e09.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{2971266a49226e769360.js → 5e5045add6567588b90a.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{5721557a1d8eab23a55b.js → 5eceedac9b2b4d1ef133.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{76794184ba8c2e66745e.js → 629f4621ba6ffdcaa2f9.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{32d3657dcae89b740f8b.js → 6518954889df2e781c47.js} +2 -2
  65. package/assets/esri/core/workers/chunks/{32d3657dcae89b740f8b.js.LICENSE.txt → 6518954889df2e781c47.js.LICENSE.txt} +1 -1
  66. package/assets/esri/core/workers/chunks/6a9a1cd8134a903dd05a.js +1 -0
  67. package/assets/esri/core/workers/chunks/{220b12654b94c94f8d8a.js → 6fa1f1e431aae1794ce3.js} +1 -1
  68. package/assets/esri/core/workers/chunks/7485588bd24217669578.js +1 -0
  69. package/assets/esri/core/workers/chunks/74e0116ae84def626c87.js +1 -0
  70. package/assets/esri/core/workers/chunks/{c4374b6bc5c8dc6435c7.js → 7c81e08fc8a67dcd9dad.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{433576983754f690bcc7.js → 7e3b374f906441cd7fb0.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{8c32cee395da0a7b9a8e.js → 80d3aa3f27ad5b2b969b.js} +1 -1
  73. package/assets/esri/core/workers/chunks/82facb23dfaba2819bc7.js +1 -0
  74. package/assets/esri/core/workers/chunks/{de4384b5833a60e88e31.js → 84c1c3336011a1b79669.js} +1 -1
  75. package/assets/esri/core/workers/chunks/8722d05ae9b0aa5162a4.js +1 -0
  76. package/assets/esri/core/workers/chunks/8939479cd433cc53f6c1.js +1 -0
  77. package/assets/esri/core/workers/chunks/{28dd172faa85080511c5.js → 8a2f3ce46eeac853b3a9.js} +1 -1
  78. package/assets/esri/core/workers/chunks/8b6580329e1e35ea4190.js +1 -0
  79. package/assets/esri/core/workers/chunks/8bfeef7cffe1e65c9dab.js +1 -0
  80. package/assets/esri/core/workers/chunks/8de4280080296adb1757.js +1 -0
  81. package/assets/esri/core/workers/chunks/{b44cf0e4c2f93408cabc.js → 9205115bdb5bc03d0c02.js} +1 -1
  82. package/assets/esri/core/workers/chunks/92d76d59113b4139befe.js +1 -0
  83. package/assets/esri/core/workers/chunks/9421ae38fdf986b9b107.js +1 -0
  84. package/assets/esri/core/workers/chunks/{1f443b99653708470f31.js → 96d7f47ea8fbf345101c.js} +1 -1
  85. package/assets/esri/core/workers/chunks/99c136b800e5fc7e04f4.js +1 -0
  86. package/assets/esri/core/workers/chunks/{d339dee99c4820b63f39.js → 9b74635d80d029498da1.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{c2336d1f5b2b7bf6e7a7.js → 9bd6a4bf8150a6f618ea.js} +1 -1
  88. package/assets/esri/core/workers/chunks/9e7895e8201127ffe0a8.js +1 -0
  89. package/assets/esri/core/workers/chunks/{e6087eda5e3b7e5ad3e1.js → a12afed58acff17708ca.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{7b367bb0ed9c218ca595.js → a52690a27f8732739c02.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{cdd8983cf3a301805680.js → a52c282609a7e9c8ca9e.js} +1 -1
  92. package/assets/esri/core/workers/chunks/a56b3dffd9f38973f350.js +1 -0
  93. package/assets/esri/core/workers/chunks/{95ad76e58452b60fb79f.js → a864ef9b584c83ebf6ae.js} +1 -1
  94. package/assets/esri/core/workers/chunks/a9274c9132e7a2691abb.js +1 -0
  95. package/assets/esri/core/workers/chunks/{df3d1a8d3f11d52eb30d.js → afdbdc1569b56489c14d.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{308ec51ff4a66f7fcb0d.js → b0952b81d5be214262dd.js} +2 -2
  97. package/assets/esri/core/workers/chunks/{308ec51ff4a66f7fcb0d.js.LICENSE.txt → b0952b81d5be214262dd.js.LICENSE.txt} +1 -1
  98. package/assets/esri/core/workers/chunks/b253cf42e53f957b4b4e.js +1 -0
  99. package/assets/esri/core/workers/chunks/{89e3f7880abd014a62c0.js → b42d26123784997c66e8.js} +1 -1
  100. package/assets/esri/core/workers/chunks/b50176897ffadc53573e.js +1 -0
  101. package/assets/esri/core/workers/chunks/{4040158835f9036967cd.js → b83151b03bbeba466f82.js} +2 -2
  102. package/assets/esri/core/workers/chunks/{4040158835f9036967cd.js.LICENSE.txt → b83151b03bbeba466f82.js.LICENSE.txt} +1 -1
  103. package/assets/esri/core/workers/chunks/bf0bf2b912d668575a9b.js +1 -0
  104. package/assets/esri/core/workers/chunks/{94490937dca566fe2640.js → c061cad8323f0469e7e4.js} +1 -1
  105. package/assets/esri/core/workers/chunks/c3dc355d0f8d89b9b7b8.js +1 -0
  106. package/assets/esri/core/workers/chunks/{fef135e55706d84d1947.js → c4ce3c35b52b7999e877.js} +1 -1
  107. package/assets/esri/core/workers/chunks/c77ade444aa2f3f2b599.js +1 -0
  108. package/assets/esri/core/workers/chunks/ca6180e572e69540c183.js +1 -0
  109. package/assets/esri/core/workers/chunks/{16f82e9d98371431b46d.js → cc085918c63da416e59d.js} +1 -1
  110. package/assets/esri/core/workers/chunks/cc8eb975a543556f88ae.js +1 -0
  111. package/assets/esri/core/workers/chunks/{8e90c5fee4ad7c7275dc.js → cccd215b0a4890551957.js} +1 -1
  112. package/assets/esri/core/workers/chunks/ce88224af357957dd83a.js +1 -0
  113. package/assets/esri/core/workers/chunks/{07c5f3fc475c57f5a7a7.js → cf00df122df3db3b0c23.js} +1 -1
  114. package/assets/esri/core/workers/chunks/d074c916b414432a7b6a.js +1 -0
  115. package/assets/esri/core/workers/chunks/d342c56558f164e9e786.js +1 -0
  116. package/assets/esri/core/workers/chunks/{3c591f76e7d6204b7780.js → d3f7ff03ab5b40062d89.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{6e6422eda398774acbc7.js → d60da671aba70485050e.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{9d61590c4d21c7421925.js → d7b260d6187f29e0c136.js} +1 -1
  119. package/assets/esri/core/workers/chunks/de638753a30c9aa41bad.js +1 -0
  120. package/assets/esri/core/workers/chunks/de87009542886fad9a2f.js +2 -0
  121. package/assets/esri/core/workers/chunks/{b765670b47d209d7655a.js.LICENSE.txt → de87009542886fad9a2f.js.LICENSE.txt} +1 -1
  122. package/assets/esri/core/workers/chunks/{bb73cd34fbae935ccbcc.js → dff4a9d656b84fe3e052.js} +1 -1
  123. package/assets/esri/core/workers/chunks/e03e237e7e6ffc8b7f0d.js +1 -0
  124. package/assets/esri/core/workers/chunks/{0b62871b89dcb4c70457.js → e21941260bae30061c2c.js} +1 -1
  125. package/assets/esri/core/workers/chunks/e490f70f192780d7ad50.js +1 -0
  126. package/assets/esri/core/workers/chunks/e6633f0326a44477f630.js +1 -0
  127. package/assets/esri/core/workers/chunks/e71b780d1e6a32f303b7.js +1 -0
  128. package/assets/esri/core/workers/chunks/eac28b0f6fccfabcc3ca.js +1 -0
  129. package/assets/esri/core/workers/chunks/{01c3507d78398baaf61b.js → eb0ce7937813d1be1284.js} +1 -1
  130. package/assets/esri/core/workers/chunks/{f198f4ba7d3d52882d98.js → efded84870064c3d8210.js} +1 -1
  131. package/assets/esri/core/workers/chunks/f088e7db4e7ac85aaff1.js +1 -0
  132. package/assets/esri/core/workers/chunks/{15e08e8a8a72b177d74c.js → f0d28fe4deb7cd894765.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{c8a0089e080140db9076.js → f285ed5425b31123d2bc.js} +1 -1
  134. package/assets/esri/core/workers/chunks/f4ba823c8acd60c7c82d.js +1 -0
  135. package/assets/esri/core/workers/chunks/f52ed527b46c316eb369.js +1 -0
  136. package/assets/esri/core/workers/chunks/{140d0c4285c6978103ea.js → f5ce6af342c02a4b0d15.js} +7 -7
  137. package/assets/esri/core/workers/chunks/{1cbeac3301b6943bb28a.js → fc07d47d44c04f123650.js} +1 -1
  138. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  139. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  140. package/assets/esri/themes/base/_core.scss +4 -0
  141. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +0 -5
  142. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationLayers.scss +80 -0
  143. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationList.scss +14 -0
  144. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationSettings.scss +41 -0
  145. package/assets/esri/themes/base/widgets/_FilterBuilder.scss +1 -6
  146. package/assets/esri/themes/dark/main.css +1 -1
  147. package/assets/esri/themes/light/main.css +1 -1
  148. package/assets/esri/themes/light/view.css +1 -1
  149. package/chunks/Bufferer-B-V7yYm-.js +5 -0
  150. package/chunks/Distance2DCalculator-Coa0qAFt.js +5 -0
  151. package/chunks/Envelope.js +1 -1
  152. package/chunks/{GeodeticDistanceCalculator-BsWHOuqE.js → GeodeticDistanceCalculator-D4iQ-_NX.js} +1 -1
  153. package/chunks/Geometry.js +1 -1
  154. package/chunks/OperatorClip.js +1 -1
  155. package/chunks/OperatorCut.js +1 -1
  156. package/chunks/OperatorGeneralize.js +1 -1
  157. package/chunks/OperatorGeodesicBuffer.js +1 -1
  158. package/chunks/OperatorGeodeticArea.js +1 -1
  159. package/chunks/OperatorGeodeticDistance.js +1 -1
  160. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  161. package/chunks/OperatorProximity.js +1 -1
  162. package/chunks/OperatorProximityGeodesic.js +1 -1
  163. package/chunks/OperatorShapePreservingLength.js +1 -1
  164. package/chunks/OperatorShapePreservingProject.js +1 -1
  165. package/chunks/Point2D.js +1 -1
  166. package/chunks/ProjectionTransformation.js +1 -1
  167. package/chunks/QuadraticBezier.js +1 -1
  168. package/chunks/ShadowHighlight.glsl.js +2 -4
  169. package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
  170. package/chunks/disjointOperator.js +1 -1
  171. package/chunks/distanceOperator.js +1 -1
  172. package/chunks/lyr3DWorker.js +1 -1
  173. package/core/Accessor.js +1 -1
  174. package/core/Collection.js +1 -1
  175. package/core/Logger.js +1 -1
  176. package/core/ObjectPool.js +1 -1
  177. package/core/RandomLCG.js +1 -1
  178. package/core/XHRAdapter.js +1 -1
  179. package/core/accessorSupport/watch.js +1 -1
  180. package/core/pbf.js +1 -1
  181. package/core/sql/UnknownTimeZone.js +1 -1
  182. package/core/sql.js +1 -1
  183. package/core/workers/RemoteClient.js +1 -1
  184. package/editing/sharedTemplates/SharedTemplate.d.ts +4 -0
  185. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  186. package/editing/sharedTemplates/SharedTemplateMetadata.js +1 -1
  187. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  188. package/editing/sharedTemplates/executor/builders/bufferLineToPolygon.js +1 -1
  189. package/editing/sharedTemplates/executor/builders/bufferPointToPolygon.js +1 -1
  190. package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
  191. package/editing/sharedTemplates/executor/builders/equallySpaced.js +1 -1
  192. package/editing/sharedTemplates/executor/builders/offsetLine.js +1 -1
  193. package/editing/sharedTemplates/executor/builders/offsetPrimaryLine.js +1 -1
  194. package/editing/sharedTemplates/executor/builders/pointAtAllVerticesOfLine.js +1 -1
  195. package/editing/sharedTemplates/executor/builders/pointAtBeginningOfLine.js +1 -1
  196. package/editing/sharedTemplates/executor/builders/pointAtBeginningOfRadial.js +1 -1
  197. package/editing/sharedTemplates/executor/builders/pointAtEndOfLine.js +1 -1
  198. package/editing/sharedTemplates/executor/builders/pointAtInteriorVertices.js +1 -1
  199. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  200. package/editing/sharedTemplates/executor/builders/pointAtNotBeginningOfLine.js +1 -1
  201. package/editing/sharedTemplates/executor/builders/pointAtNotEndOfLine.js +1 -1
  202. package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
  203. package/editing/sharedTemplates/executor/builders/pointAtPolygonNotStart.js +1 -1
  204. package/editing/sharedTemplates/executor/builders/pointAtPolygonStart.js +1 -1
  205. package/editing/sharedTemplates/executor/builders/pointIdentity.js +1 -1
  206. package/editing/sharedTemplates/executor/builders/pointPrimaryIdentity.js +1 -1
  207. package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
  208. package/editing/sharedTemplates/executor/builders/polygonBoundaryTwoPoint.js +1 -1
  209. package/editing/sharedTemplates/executor/builders/polygonIdentity.js +1 -1
  210. package/editing/sharedTemplates/executor/builders/polygonPrimaryIdentity.js +1 -1
  211. package/editing/sharedTemplates/executor/builders/polygonVertices.js +1 -1
  212. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  213. package/editing/sharedTemplates/executor/builders/twoPointLines.js +1 -1
  214. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  215. package/editing/sharedTemplates/executor/support/createServiceEdit.js +1 -1
  216. package/editing/sharedTemplates/executor/support/executorUtils.js +1 -1
  217. package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
  218. package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
  219. package/editing/sharedTemplates/templateDefinitions/parts/builders/builderUtils.js +1 -1
  220. package/editing/templateUtils.js +1 -1
  221. package/geometry/SpatialReference.js +1 -1
  222. package/geometry/operators/extendOperator.js +1 -1
  223. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  224. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  225. package/geometry/operators/gx/operatorBuffer.js +1 -1
  226. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  227. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  228. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  229. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  230. package/geometry/operators/gx/operatorOffset.js +1 -1
  231. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  232. package/geometry/operators/gx/operatorSimplify.js +1 -1
  233. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  234. package/geometry/operators/gx/operatorUnion.js +1 -1
  235. package/geometry/operators/isNearOperator.js +1 -1
  236. package/geometry/operators/json/disjointOperator.js +1 -1
  237. package/geometry/operators/projectOperator.js +1 -1
  238. package/geometry/operators/reshapeOperator.js +1 -1
  239. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  240. package/geometry/operators/support/apiConverter.js +1 -1
  241. package/geometry/operators/support/initNoPeFactory.js +1 -1
  242. package/geometry/operators/support/jsonConverter.js +1 -1
  243. package/geometry/support/DoubleArray.js +1 -1
  244. package/geometry/support/MeshGeoreferencedVertexSpace.js +1 -1
  245. package/geometry/support/MeshTexture.js +1 -1
  246. package/geometry/support/MeshTransform.js +1 -1
  247. package/geometry/support/UCharArray.js +5 -0
  248. package/geometry/support/UShortArray.js +5 -0
  249. package/geometry/support/buffer/BufferPool.js +1 -1
  250. package/geometry/support/buffer/BufferView.js +1 -1
  251. package/geometry/support/buffer/internals/Mat3.js +1 -1
  252. package/geometry/support/buffer/internals/Mat4.js +1 -1
  253. package/geometry/support/buffer/internals/Scalar.js +1 -1
  254. package/geometry/support/buffer/internals/Vec2.js +1 -1
  255. package/geometry/support/buffer/internals/Vec3.js +1 -1
  256. package/geometry/support/buffer/internals/Vec4.js +1 -1
  257. package/geometry/support/meshUtils/exporters/gltf/glb.js +1 -1
  258. package/identity/OAuthInfo.js +1 -1
  259. package/interfaces.d.ts +124 -68
  260. package/layers/VectorTileLayer.js +1 -1
  261. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  262. package/layers/mixins/EditBusLayer.js +1 -1
  263. package/layers/mixins/PublishableLayer.js +1 -1
  264. package/layers/mixins/operationalLayers.js +1 -1
  265. package/layers/save/featureLayerUtils.js +1 -1
  266. package/layers/save/utils.js +1 -1
  267. package/layers/support/AggregateField.js +1 -1
  268. package/layers/support/CodedValueDomain.js +1 -1
  269. package/layers/support/Field.js +1 -1
  270. package/layers/support/ImageElement.js +1 -1
  271. package/layers/support/InheritedDomain.js +1 -1
  272. package/layers/support/LOD.js +1 -1
  273. package/layers/support/LabelClass.js +1 -1
  274. package/layers/support/LabelExpressionInfo.js +1 -1
  275. package/layers/support/OrderByInfo.js +1 -1
  276. package/layers/support/PurgeOptions.js +1 -1
  277. package/layers/support/RangeDomain.js +1 -1
  278. package/layers/support/Sublayer.js +1 -1
  279. package/layers/support/SubtypeSublayer.js +1 -1
  280. package/layers/support/TileInfo.js +1 -1
  281. package/layers/support/TilemapCache.js +1 -1
  282. package/layers/support/VideoElement.js +1 -1
  283. package/layers/support/commonProperties.js +1 -1
  284. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  285. package/layers/support/source/DataLayerSource.js +1 -1
  286. package/layers/support/wmsUtils.js +1 -1
  287. package/networks/Network.js +1 -1
  288. package/networks/RulesTable.js +1 -1
  289. package/networks/UtilityNetwork.js +1 -1
  290. package/networks/support/typeUtils.js +1 -1
  291. package/package.json +3 -3
  292. package/portal/Portal.js +1 -1
  293. package/renderers/support/RasterSymbolizer.js +1 -1
  294. package/rest/print.js +1 -1
  295. package/rest/support/AttachmentQuery.js +1 -1
  296. package/rest/support/ClosestFacilityParameters.js +1 -1
  297. package/rest/support/DirectionLine.js +1 -1
  298. package/rest/support/DirectionPoint.js +1 -1
  299. package/rest/support/JobInfo.js +1 -1
  300. package/rest/support/NetworkFeatureSet.js +1 -1
  301. package/rest/support/PointBarrier.js +1 -1
  302. package/rest/support/PolygonBarrier.js +1 -1
  303. package/rest/support/PolylineBarrier.js +1 -1
  304. package/rest/support/Query.js +1 -1
  305. package/rest/support/RelationshipQuery.js +1 -1
  306. package/rest/support/RouteInfo.js +1 -1
  307. package/rest/support/RouteParameters.js +1 -1
  308. package/rest/support/ServiceAreaParameters.js +1 -1
  309. package/rest/support/Stop.js +1 -1
  310. package/rest/support/TopFeaturesQuery.js +1 -1
  311. package/support/revision.js +1 -1
  312. package/symbols/ExtrudeSymbol3DLayer.js +1 -1
  313. package/symbols/FillSymbol3DLayer.js +1 -1
  314. package/symbols/IconSymbol3DLayer.js +1 -1
  315. package/symbols/LineSymbol3DLayer.js +1 -1
  316. package/symbols/ObjectSymbol3DLayer.js +1 -1
  317. package/symbols/PathSymbol3DLayer.js +1 -1
  318. package/symbols/TextSymbol3DLayer.js +1 -1
  319. package/symbols/WaterSymbol3DLayer.js +1 -1
  320. package/symbols/cim/OverrideHelper.js +1 -1
  321. package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
  322. package/symbols/cim/effects/EffectArrow.js +1 -1
  323. package/symbols/cim/effects/EffectBuffer.js +1 -1
  324. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  325. package/symbols/cim/effects/EffectCut.js +1 -1
  326. package/symbols/cim/effects/EffectDashes.js +1 -1
  327. package/symbols/cim/effects/EffectDonut.js +1 -1
  328. package/symbols/cim/effects/EffectJog.js +1 -1
  329. package/symbols/cim/effects/EffectMove.js +1 -1
  330. package/symbols/cim/effects/EffectOffset.js +1 -1
  331. package/symbols/cim/effects/EffectReverse.js +1 -1
  332. package/symbols/cim/effects/EffectRotate.js +1 -1
  333. package/symbols/cim/effects/EffectScale.js +1 -1
  334. package/symbols/cim/effects/EffectWave.js +1 -1
  335. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  336. package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
  337. package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
  338. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  339. package/symbols/cim/placements/PlacementOnLine.js +1 -1
  340. package/symbols/cim/placements/PlacementOnVertices.js +1 -1
  341. package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
  342. package/symbols/support/ElevationInfo.js +1 -1
  343. package/time/TimeExtent.js +1 -1
  344. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  345. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  346. package/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js +1 -1
  347. package/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js +1 -1
  348. package/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js +1 -1
  349. package/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js +1 -1
  350. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  351. package/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js +1 -1
  352. package/views/2d/engine/vectorTiles/style/StyleDefinition.js +1 -1
  353. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  354. package/views/2d/engine/webgl/DisplayEntity.js +1 -1
  355. package/views/2d/engine/webgl/DisplayRecord.js +1 -1
  356. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  357. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  358. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
  359. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  360. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  361. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  362. package/views/2d/layers/LayerView2D.js +1 -1
  363. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  364. package/views/2d/layers/RouteLayerView2D.js +1 -1
  365. package/views/2d/layers/features/FeatureContainer.js +1 -1
  366. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  367. package/views/2d/layers/features/FeatureStoreQueryAdapter.js +1 -1
  368. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  369. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  370. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  371. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  372. package/views/2d/layers/support/HighlightCounter.js +1 -1
  373. package/views/2d/tiling/TileCoverage.js +1 -1
  374. package/views/2d/tiling/TileKey.js +1 -1
  375. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  376. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  377. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  378. package/views/3d/layers/I3SMeshView3D.js +1 -1
  379. package/views/3d/layers/MediaLayerView3D.js +1 -1
  380. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  381. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  382. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  383. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  384. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  385. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  386. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  387. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  388. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  389. package/views/3d/layers/graphics/GraphicsCorePerformanceInfo.js +1 -1
  390. package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
  391. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  392. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  393. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  394. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandEncoder.js +1 -1
  395. package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
  396. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  397. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  398. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  399. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  400. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  401. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  402. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  403. package/views/3d/state/Frustum.js +1 -1
  404. package/views/3d/support/DisplayQualityProfile.js +1 -1
  405. package/views/3d/support/QualitySettings.js +1 -1
  406. package/views/3d/terrain/OverlayManager.js +1 -1
  407. package/views/3d/terrain/TerrainSurface.js +1 -1
  408. package/views/3d/terrain/TextureFader.js +1 -1
  409. package/views/3d/terrain/TilingScheme.js +1 -1
  410. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  411. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  412. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  413. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  414. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  415. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  416. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  417. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  418. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  419. package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
  420. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  421. package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
  422. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  423. package/views/SceneView.js +1 -1
  424. package/views/View.js +1 -1
  425. package/views/View2D.js +1 -1
  426. package/views/draw/DrawAction.js +1 -1
  427. package/views/draw/drawSurfaces.js +1 -1
  428. package/views/input/BrowserEventSource.js +1 -1
  429. package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
  430. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  431. package/views/layers/LayerView.js +1 -1
  432. package/views/support/Scheduler.js +1 -1
  433. package/views/support/imageReprojection.js +1 -1
  434. package/views/webgl/FramebufferObject.js +1 -1
  435. package/views/webgl/Parameters.js +1 -1
  436. package/views/webgl/RenderingContext.js +1 -1
  437. package/views/webgl/ShaderBuilder.js +1 -1
  438. package/views/webgl/Texture.js +1 -1
  439. package/webscene/Environment.js +1 -1
  440. package/webscene/SunLighting.js +1 -1
  441. package/webscene/VirtualLighting.js +1 -1
  442. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  443. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  444. package/widgets/AreaMeasurement2D.js +1 -1
  445. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  446. package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
  447. package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
  448. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  449. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  450. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  451. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  452. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  453. package/widgets/BatchAttributeForm.js +1 -1
  454. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  455. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  456. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  457. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  458. package/widgets/DistanceMeasurement2D.js +1 -1
  459. package/widgets/Editor/AddAssociationWorkflow.js +5 -0
  460. package/widgets/Editor/AddAssociationWorkflowData.js +5 -0
  461. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  462. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  463. package/widgets/Editor/EditorViewModel.js +1 -1
  464. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  465. package/widgets/Editor/UpdateWorkflow.js +1 -1
  466. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  467. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  468. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  469. package/widgets/Editor/modelUploadUtils.js +1 -1
  470. package/widgets/Editor/workflowUtils.js +1 -1
  471. package/widgets/Editor.js +1 -1
  472. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  473. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  474. package/widgets/Feature/FeatureViewModel.js +1 -1
  475. package/widgets/Feature/support/featureUtils.js +1 -1
  476. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  477. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +5 -0
  478. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +5 -0
  479. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  480. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +5 -0
  481. package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
  482. package/widgets/FeatureForm.js +1 -1
  483. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  484. package/widgets/LayerList/LayerListItem.js +1 -1
  485. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  486. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  487. package/widgets/OrientedImageryViewer/constants.js +1 -1
  488. package/widgets/OrientedImageryViewer/galleryUtils.js +5 -0
  489. package/widgets/OrientedImageryViewer/utils.js +1 -1
  490. package/widgets/OrientedImageryViewer.js +1 -1
  491. package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
  492. package/widgets/Search/SearchViewModel.js +1 -1
  493. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  494. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  495. package/widgets/Sketch/support/sketchUtils.js +1 -1
  496. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +2 -2
  497. package/widgets/Widget.js +1 -1
  498. package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
  499. package/widgets/support/FilterBuilder.js +1 -1
  500. package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
  501. package/widgets/support/FilterCondition.js +1 -1
  502. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +5 -0
  503. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  504. package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
  505. package/widgets/support/forms/expressions/FormExpressionArcadeExecutor.js +1 -1
  506. package/assets/esri/core/workers/chunks/00e0c53d89e074399f04.js +0 -1
  507. package/assets/esri/core/workers/chunks/08c4b585290efc98ca5d.js +0 -1
  508. package/assets/esri/core/workers/chunks/117e7a12af77c761efb5.js +0 -1
  509. package/assets/esri/core/workers/chunks/12d6baeffd55a98a7c75.js +0 -1
  510. package/assets/esri/core/workers/chunks/207c040b0e42358a5389.js +0 -1
  511. package/assets/esri/core/workers/chunks/21c12edc0632eb911e73.js +0 -1
  512. package/assets/esri/core/workers/chunks/24c94f97a76646d415ae.js +0 -1
  513. package/assets/esri/core/workers/chunks/2611adb4f328f95ee508.js +0 -1
  514. package/assets/esri/core/workers/chunks/26a2bd432e7a1b3870c3.js +0 -1
  515. package/assets/esri/core/workers/chunks/2def7db73a776e759dae.js +0 -1
  516. package/assets/esri/core/workers/chunks/2ff63a71213f618377d6.js +0 -1
  517. package/assets/esri/core/workers/chunks/324a5547c64a3bae670d.js +0 -1
  518. package/assets/esri/core/workers/chunks/369a2b8484a8807bde38.js +0 -1
  519. package/assets/esri/core/workers/chunks/44abd2cd17aae3299ede.js +0 -1
  520. package/assets/esri/core/workers/chunks/4b56c0c109e10d7409b8.js +0 -1
  521. package/assets/esri/core/workers/chunks/5660f13d78e9e4240034.js +0 -1
  522. package/assets/esri/core/workers/chunks/568bcf809fcfd4d9c713.js +0 -1
  523. package/assets/esri/core/workers/chunks/5be7cf1564e756c24066.js +0 -1
  524. package/assets/esri/core/workers/chunks/5e889a675cbaff03ad5a.js +0 -1
  525. package/assets/esri/core/workers/chunks/61795bde00f2e16d04f1.js +0 -1
  526. package/assets/esri/core/workers/chunks/62a1d60ad4bf6469c4dd.js +0 -1
  527. package/assets/esri/core/workers/chunks/6d79ec15d1858839f576.js +0 -1
  528. package/assets/esri/core/workers/chunks/6ea02ff25f051c08e6c3.js +0 -1
  529. package/assets/esri/core/workers/chunks/7966c245a073c85f04b1.js +0 -1
  530. package/assets/esri/core/workers/chunks/7bf08823f861628144a1.js +0 -1
  531. package/assets/esri/core/workers/chunks/86149b4a5a148744c7d1.js +0 -1
  532. package/assets/esri/core/workers/chunks/8bd51b5b392dfacc922f.js +0 -1
  533. package/assets/esri/core/workers/chunks/9b2fab133786e5d47631.js +0 -1
  534. package/assets/esri/core/workers/chunks/9bfb091cec7eed6c8111.js +0 -1
  535. package/assets/esri/core/workers/chunks/9c6380af3bc3130658e1.js +0 -1
  536. package/assets/esri/core/workers/chunks/a2409d4921c02614169a.js +0 -1
  537. package/assets/esri/core/workers/chunks/b18620fc15707e4413a1.js +0 -1
  538. package/assets/esri/core/workers/chunks/b1baf39daf5725404be5.js +0 -1
  539. package/assets/esri/core/workers/chunks/b43d88b6e7dc4ab13599.js +0 -1
  540. package/assets/esri/core/workers/chunks/b765670b47d209d7655a.js +0 -2
  541. package/assets/esri/core/workers/chunks/b9d9a1dc3c5d799e2685.js +0 -1
  542. package/assets/esri/core/workers/chunks/c1970657a287ec96001e.js +0 -1
  543. package/assets/esri/core/workers/chunks/c249ad935f54d3b49ae3.js +0 -1
  544. package/assets/esri/core/workers/chunks/cc75bbfd779f409943a3.js +0 -1
  545. package/assets/esri/core/workers/chunks/d27a199fd8e2ade69254.js +0 -1
  546. package/assets/esri/core/workers/chunks/d35efcbe439500bf18bc.js +0 -1
  547. package/assets/esri/core/workers/chunks/d599ba865da87b487b1b.js +0 -1
  548. package/assets/esri/core/workers/chunks/da1157e288dbc6ba842a.js +0 -1
  549. package/assets/esri/core/workers/chunks/ddc30044f61a2c2df3fe.js +0 -1
  550. package/assets/esri/core/workers/chunks/e37e5d2e233d7f6ccd52.js +0 -314
  551. package/assets/esri/core/workers/chunks/f14b318bab5efcf43419.js +0 -1
  552. package/assets/esri/core/workers/chunks/f29715459ecd46180829.js +0 -1
  553. package/assets/esri/core/workers/chunks/f4e48bbdbc9da10ec71a.js +0 -1
  554. package/assets/esri/core/workers/chunks/f62f657f9fef28f492e0.js +0 -1
  555. package/assets/esri/core/workers/chunks/f9070edd8e0b2a57af79.js +0 -1
  556. package/assets/esri/core/workers/chunks/faf9063420262ea40fd8.js +0 -1
  557. package/chunks/Bufferer-DjC-SKTJ.js +0 -5
  558. package/chunks/Distance2DCalculator-8-JrFGHH.js +0 -5
  559. package/editing/sharedTemplates/support/sharedTemplateUtils.js +0 -5
  560. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationSettings.js +0 -5
  561. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +0 -4
  562. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{DateOnly as t}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as r}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as s}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as i}from"../../../../../geometry/support/aaBoundingBox.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{getLabelPoint as o}from"../../../../../geometry/support/labelPoint.js";import{getCentroidOptimizedGeometry as n}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as d,unquantizeOptimizedGeometry as u}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as h}from"../../../../../layers/graphics/OptimizedFeature.js";import c from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as l,unknown as m}from"../../../../../time/timeZoneUtils.js";import{FeatureSetCache as y}from"./FeatureSetCache.js";const f=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],p=f[0],g=f[1],_=f[2],b=f[3],x=has("featurelayer-simplify-payload-size-factors")??[1,2,4],D=x[0],T=x[1],F=x[2],A=has("featurelayer-simplify-mobile-factor")??2,S=has("esri-mobile"),I=4294967295;function B(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class j{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=S?A:1;t>4e6?r=F*s:t>1e6?r=T*s:t>5e5?r=D*s:t>1e5&&(r=s);let i=0;return e>4e3?i=b*r:e>2e3?i=_*r:e>100?i=g:e>15&&(i=p),i}getBounds(e){if(B(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===I)return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(!t)return this.setBoundsXMin(I),!1;let r=1/0,s=1/0,a=-1/0,o=-1/0;return t.forEachVertex(((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),a=Math.max(a,e),o=Math.max(o,t)})),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(a),this.setBoundsYMax(o),i(e,r,s,a,o),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),a=this.getBoundsYMax();return i(e,t,r,s,a),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new h(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return d(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){return this.readGeometryForDisplay()?.quantize(e)??null}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createDeltaQuantizedGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&u(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&u(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new y(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some((t=>t.hasField(e)))}geometry(){const e=this.readGeometryWorldSpace(),t=d(e,this.geometryType,this.hasZ,this.hasM),r=a(t);if(r){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.outSpatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??l):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===m}field(s){let i=this.fields.get(s);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return t.fromReader(this.readAttribute(s,!1));case"time-only":case"esriFieldTypeTimeOnly":return r.fromReader(this.readAttribute(s,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(s,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(s,this.readAttribute(s,!0));default:return this.readAttribute(s,!1)}for(const a of this._joined)if(a.setIndex(this.getIndex()),i=a.fields.get(s),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return t.fromReader(a._readAttribute(s,!1));case"time-only":case"esriFieldTypeTimeOnly":return r.fromReader(a._readAttribute(s,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(a._readAttribute(s,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(s,a._readAttribute(s,!0));default:return this.readAttribute(s,!1)}throw new Error(`Field ${s} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map((e=>e.name))}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}return!0}_computeDisplayCentroid(e){if(null==this.getInTransform())return n(new c,e,this.hasM,this.hasZ);const t=s.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=o(t);return r?(r[1]*=-1,new c([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return d(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,r)}_createDeltaQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new c([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new c([2],[e-1,t+1,1,-1])}}export{j as FeatureSetReader};
5
+ import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{DateOnly as t}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as r}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as s}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as i}from"../../../../../geometry/support/aaBoundingBox.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{getLabelPoint as o}from"../../../../../geometry/support/labelPoint.js";import{getCentroidOptimizedGeometry as n}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as d,unquantizeOptimizedGeometry as u}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as h}from"../../../../../layers/graphics/OptimizedFeature.js";import c from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as l,unknown as m}from"../../../../../time/timeZoneUtils.js";import{FeatureSetCache as y}from"./FeatureSetCache.js";const f=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],p=f[0],g=f[1],_=f[2],b=f[3],x=has("featurelayer-simplify-payload-size-factors")??[1,2,4],D=x[0],T=x[1],F=x[2],A=has("featurelayer-simplify-mobile-factor")??2,S=has("esri-mobile"),I=4294967295;function B(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class j{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=S?A:1;t>4e6?r=F*s:t>1e6?r=T*s:t>5e5?r=D*s:t>1e5&&(r=s);let i=0;return e>4e3?i=b*r:e>2e3?i=_*r:e>100?i=g:e>15&&(i=p),i}getBounds(e){if(B(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===I)return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(!t)return this.setBoundsXMin(I),!1;let r=1/0,s=1/0,a=-1/0,o=-1/0;return t.forEachVertex(((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),a=Math.max(a,e),o=Math.max(o,t)})),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(a),this.setBoundsYMax(o),i(e,r,s,a,o),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),a=this.getBoundsYMax();return i(e,t,r,s,a),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){const e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new h(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return d(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){return this.readGeometryForDisplay()?.quantize(e)??null}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createDeltaQuantizedGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&u(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&u(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new y(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some((t=>t.hasField(e)))}geometry(){const e=this.readGeometryWorldSpace(),t=d(e,this.geometryType,this.hasZ,this.hasM),r=a(t);if(r){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.outSpatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??l):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===m}field(s){let i=this.fields.get(s);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return t.fromReader(this.readAttribute(s,!1));case"time-only":case"esriFieldTypeTimeOnly":return r.fromReader(this.readAttribute(s,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(s,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(s,this.readAttribute(s,!0));default:return this.readAttribute(s,!1)}for(const a of this._joined)if(a.setIndex(this.getIndex()),i=a.fields.get(s),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return t.fromReader(a._readAttribute(s,!1));case"time-only":case"esriFieldTypeTimeOnly":return r.fromReader(a._readAttribute(s,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(a._readAttribute(s,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(s,a._readAttribute(s,!0));default:return this.readAttribute(s,!1)}throw new Error(`Field ${s} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map((e=>e.name))}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}return!0}_computeDisplayCentroid(e){if(null==this.getInTransform())return n(new c,e,this.hasM,this.hasZ);const t=s.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=o(t);return r?(r[1]*=-1,new c([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return d(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,r)}_createDeltaQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new c([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new c([2],[e-1,t+1,1,-1])}}export{j as FeatureSetReader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const t=new Set;class e{constructor(){this._idToCounters=new Map}get empty(){return 0===this._idToCounters.size}addGroup(t,e){let o=!1;for(const s of t){let t=this._idToCounters.get(s);t||(t=new Map,this._idToCounters.set(s,t),o=!0);const n=t.get(e);null==n?(t.set(e,1),o=!0):t.set(e,n+1)}return o}deleteGroup(t,e){let o=!1;for(const s of t){const t=this._idToCounters.get(s);if(!t)continue;let n=t.get(e);null!=n&&(n--,n>0?t.set(e,n):(t.delete(e),o=!0),0===t.size&&(this._idToCounters.delete(s),o=!0))}return o}getHighlightNames(e){const o=this._idToCounters.get(e);if(!o)return t;const s=new Set;for(const[t,n]of o)n>0&&s.add(t);return s}ids(){return this._idToCounters.keys()}}export{e as HighlightCounter};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{getOrCreateMapValue as o}from"../../../../core/MapUtils.js";import s from"../../../../core/ReactiveMap.js";import"../../../../core/Logger.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";let i=class extends t{constructor(){super(...arguments),this._idToCounters=new s}get size(){return this._idToCounters.size}get objectIds(){return this._idToCounters.keys()}get highlightNamesByObjectId(){return n(this._idToCounters)}add(e,t){let s=!1;for(const r of e){const e=o(this._idToCounters,r,(()=>(s=!0,new Map))),i=e.get(t)??0;i||(s=!0),e.set(t,i+1)}return s}delete(e,t){let o=!1;for(const s of e){const e=this._idToCounters.get(s);if(!e)continue;let r=e.get(t);null!=r&&(r--,r>0?e.set(t,r):(e.delete(t),o=!0),0===e.size&&(this._idToCounters.delete(s),o=!0))}return o}};function*n(e){for(const[t,o]of e)yield[t,o.keys()]}i=e([r("esri.views.2d.layers.support.HighlightCounter")],i);export{i as HighlightCounter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import o from"../../../core/ObjectPool.js";import l from"./TileKey.js";class s{constructor(){this.spans=[]}acquire(o){this.lodInfo=o}release(){this.lodInfo=null,this.spans.length=0}*keys(){const o=this.lodInfo;for(const{row:s,colFrom:e,colTo:r}of this.spans)for(let t=e;t<=r;t++){const e=o.getWorldForColumn(t);yield new l(o.level,s,o.normalizeCol(t),e)}}forEach(o,l){const{spans:s,lodInfo:e}=this,{level:r}=e;if(0!==s.length)for(const{row:t,colFrom:n,colTo:c}of s)for(let s=n;s<=c;s++)o.call(l,r,t,e.normalizeCol(s),e.getWorldForColumn(s))}}s.pool=new o(s);export{s as default};
5
+ import o from"../../../core/ObjectPool.js";import l from"./TileKey.js";class s{constructor(){this.spans=[]}static{this.pool=new o(s)}acquire(o){this.lodInfo=o}release(){this.lodInfo=null,this.spans.length=0}*keys(){const o=this.lodInfo;for(const{row:s,colFrom:t,colTo:e}of this.spans)for(let r=t;r<=e;r++){const t=o.getWorldForColumn(r);yield new l(o.level,s,o.normalizeCol(r),t)}}forEach(o,l){const{spans:s,lodInfo:t}=this,{level:e}=t;if(0!==s.length)for(const{row:r,colFrom:n,colTo:c}of s)for(let s=n;s<=c;s++)o.call(l,e,r,t.normalizeCol(s),t.getWorldForColumn(s))}}export{s 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.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../core/ObjectPool.js";class e{static getId(t,e,l,o){return"object"==typeof t?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${e}/${l}/${o}`}constructor(t,e,l,o){this.set(t,e,l,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(t){this.set(t)}get hash(){const t=4095&this.row,e=4095&this.col,l=63&this.level;return(3&this.world)<<30|e<<22|t<<8|l}acquire(t,e,l,o){this.set(t,e,l,o)}contains(t){const e=t.level-this.level;return e>=0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}containsChild(t){const e=t.level-this.level;return e>0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new e(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,e,l,o){if(null==t)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof t)this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if("string"==typeof t){const[e,l,o,s]=t.split("/");this.level=parseFloat(e),this.row=parseFloat(l),this.col=parseFloat(o),this.world=parseFloat(s)}else this.level=+t,this.row=+e,this.col=+l,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new e(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(t,e,l){const o=this.clone();return o.col+=t,o.row+=e,l.normalizeKey(o),o}getChildKeys(){const t=this.level+1,l=this.row<<1,o=this.col<<1,s=this.world;return[new e(t,l,o,s),new e(t,l,o+1,s),new e(t,l+1,o,s),new e(t,l+1,o+1,s)]}compareRowMajor(t){return this.row<t.row?-1:this.row>t.row?1:this.col<t.col?-1:this.col>t.col?1:0}}e.pool=new t(e,null,null,25,50);export{e as default};
5
+ import t from"../../../core/ObjectPool.js";class e{static{this.pool=new t(e,null,null,25,50)}static getId(t,e,l,o){return"object"==typeof t?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${e}/${l}/${o}`}constructor(t,e,l,o){this.set(t,e,l,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(t){this.set(t)}get hash(){const t=4095&this.row,e=4095&this.col,l=63&this.level;return(3&this.world)<<30|e<<22|t<<8|l}acquire(t,e,l,o){this.set(t,e,l,o)}contains(t){const e=t.level-this.level;return e>=0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}containsChild(t){const e=t.level-this.level;return e>0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new e(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,e,l,o){if(null==t)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof t)this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if("string"==typeof t){const[e,l,o,s]=t.split("/");this.level=parseFloat(e),this.row=parseFloat(l),this.col=parseFloat(o),this.world=parseFloat(s)}else this.level=+t,this.row=+e,this.col=+l,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new e(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(t,e,l){const o=this.clone();return o.col+=t,o.row+=e,l.normalizeKey(o),o}getChildKeys(){const t=this.level+1,l=this.row<<1,o=this.col<<1,s=this.world;return[new e(t,l,o,s),new e(t,l,o+1,s),new e(t,l+1,o,s),new e(t,l+1,o+1,s)]}compareRowMajor(t){return this.row<t.row?-1:this.row>t.row?1:this.col<t.col?-1:this.col>t.col?1:0}}export{e 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{addFrameTask as o}from"../../../../core/scheduling.js";import{createScreenPoint as h,screenPointObjectToArray as p}from"../../../../core/screenUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as d,fromScaling as _,multiply as v}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{f as P,l as y,c as m,h as w,g,t as f,n as M,i as D}from"../../../../chunks/vec32.js";import{clone as V,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as T,ZEROS as E}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{d as k,a as S,n as x,f as j}from"../../../../chunks/boundedPlane.js";import{signedDistance as H,create as C,intersectRay as R,getNormal as O}from"../../../../geometry/support/plane.js";import{create as I}from"../../../../geometry/support/ray.js";import{sv3d as z,sm4d as G,sv2d as L}from"../../../../geometry/support/vectorStacks.js";import{getRotateHeadingTexture as U,getTiltRotateTexture as A}from"../images/Factory.js";import{ResizeManipulator as K}from"./ResizeManipulator.js";import{RotateManipulator as B}from"./RotateManipulator.js";import{getOutlineColor as F,planeColor as N}from"./settings.js";import{ShiftManipulator as q,OffsetMode as Z}from"./ShiftManipulator.js";import{pointerMoveTimerMs as W,planePreviewOutlineWidth as J,forceVerticalModifier as Q,forceHorizontalModifier as X,previewFadeDotThreshold as Y,previewFadeDurationSeconds as $,initialDepthOffsetFrac as tt}from"./sliceToolConfig.js";import{createGridVisualElement as et,createOutlineVisualElement as it,planeToShape as at,createRotatePlane as st,RotationAxis as nt,resizePlane as rt,calculatePlaneHalfSize as lt,SliceOrientation as ot,createPlane as ht,DidPointerMoveRecentlyFlag as pt,calculateBoundedPlaneTranslateRotate as ut,updateShiftRestartHandle as ct,updateRotateHeadingHandle as dt,updateRotateTiltHandle as _t,updateResizeHandle as vt,createShiftPlane as Pt}from"./sliceToolUtils.js";import{calculateInputRotationTransform as yt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as mt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreenNormalized as wt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as gt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as ft}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as Mt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as Dt}from"../../../support/screenUtils.js";var Vt;let bt=Vt=class extends gt{constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this._layersMode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=W,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=k(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=h(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=Mt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&S(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new q(this.view,Z.CENTER_ON_ARROW);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",(i=>{this._onShiftGrab(i),t(e)}))]);const i=!this.view._stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new B(this.view,((t,e)=>U(this.view.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i})));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",(e=>{this._onRotateHeadingGrab(e),t(a)}))]);const s=new B(this.view,((t,e)=>A(this.view.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i})));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",(e=>{this._onRotateTiltGrab(e),t(s)}))]),this.resizeManipulators=this._resizeHandles.map(((e,i)=>{const a=new K(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",(e=>{this._onResizeGrab(e,i),t(a)}))]),a})),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=et(this.view),this._previewPlaneOutlineVisualElement=it(this.view),this._previewPlaneOutlineVisualElement.width=J,this.addHandles(n((()=>[this.analysisViewData.plane,this.analysis.tiltEnabled]),(()=>this._updateManipulators()),r));const o=n((()=>this.state),(t=>{"sliced"===t&&this.finishToolCreation()}),l);this.addHandles([o,n((()=>this.view.state.camera),(()=>this._onCameraChange()))])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this._isPlacingSlicePlane||"exclude"===this.layersMode?"crosshair":null!=this._creatingPointerId?"grabbing":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get layersMode(){return this._layersMode}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _isPlacingSlicePlane(){return!this.inputState&&!this.analysisViewData.plane&&this.active}get _creatingPointerId(){return null!=this.inputState&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}enterExcludeLayerMode(){null!=this.analysisViewData.plane&&(this._layersMode="exclude",this.active||(this.view.activeTool=this))}exitExcludeLayerMode(){null!=this.analysisViewData.plane&&(this._layersMode="none",this.active&&(this.view.activeTool=null))}onDeactivate(){this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!kt(t))return;this._isPlacingSlicePlane?this._onClickPlacePlane(t)&&t.stopPropagation():this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t);break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!kt(t))return;this._onClickPlacePlane(t)&&t.stopPropagation();break;case"click":if(!kt(t))return;this._onClickExcludeLayer(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&null!=e&&"shift"===e.type){const i=Dt(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Dt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&null!=this.analysisViewData.plane){const e=Dt(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),S(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if("exclude"===this.layersMode)return!1;if(this._isPlacingSlicePlane){const i=Dt(t),a=k();if(this._pickPlane(i,!1,this._activeKeyModifiers,a)){if("pointer-drag"===t.type){const e=wt(this.view.state.camera,i,xt);this.inputState=Et(e,t.pointerId,a.origin,a)}return S(a,this._startPlane),this.analysis.shape=at(a,this.view,this.view.spatialReference,new e),!0}}return!1}_onClickExcludeLayer(t){return!("exclude"!==this.layersMode||!this.created)&&(this.view.hitTest(Dt(t)).then((t=>{if(t.results.length){const e=t.results[0],i="graphic"===e?.type&&e.graphic;if(i){const t=i.sourceLayer||i.layer;t&&this.analysis.excludedLayers.push(t)}}else t.ground.layer?this.analysis.excludedLayers.push(t.ground.layer):this.analysis.excludeGroundSurface=!0})),this.exitExcludeLayerMode(),!0)}_onKeyDown(t){return(t.key===Q||t.key===X)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==Q&&t.key!==X||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=wt(this.view.state.camera,t.screenPoint,xt);S(this.analysisViewData.plane,this._startPlane),this.inputState=Et(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return ft(t,((t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,k()):null;e.next(mt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next((()=>{null!=s&&this._updateBoundedPlane(s)}))}))}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(P(x(this.analysisViewData.plane),e.ray.direction)/y(e.ray.direction)))/i,1),s=-H(this._startPlane.plane,e.renderEnd),n=-H(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=m(z.get(),this._startPlane.origin),i=m(z.get(),x(this._startPlane));w(i,i,-t.depth),g(i,i,e);const a=j(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,k());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,nt.HEADING,C()),i=wt(this.view.state.camera,t.screenPoint,xt),a=b();R(e,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return ft(t,((t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,k()):null;e.next(mt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{null!=s&&this._updateBoundedPlane(s)}))}))}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,nt.TILT,C()),i=wt(this.view.state.camera,t.screenPoint,xt),a=b();R(e,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return ft(t,((t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,k()):null;e.next(mt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{null!=s&&this._updateBoundedPlane(s)}))}))}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=O(t.rotatePlane),a=yt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=d(G.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=f(z.get(),this._startPlane.basis1,e),a=f(z.get(),this._startPlane.basis2,e),s=j(this.analysisViewData.plane.origin,i,a,k());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=wt(this.view.state.camera,t.screenPoint,xt),a=z.get();R(this.analysisViewData.plane.plane,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:V(a)})}_createResizeDragPipeline(t){return ft(t,((t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=S(this.analysisViewData.plane,k());e.next(mt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next((()=>{this._updateBoundedPlane(s)}))}))}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=rt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,S(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(!this.analysisViewData.plane&&this.active){const a=null!=i?i:k();if(i=null!=i?S(i,St):null,this._pickPlane(t,!0,e,a)){const t=Y;let e=!1;null!=i&&(e=P(O(i.plane),O(a.plane))<t||P(M(z.get(),i.basis1),M(z.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=o({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*$),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=p(t,L.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=z.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(z.get()),l=this.view.state.camera;P(r,l.viewForward)>0&&w(r,r,-1);const o=lt(n,l),h=(e?1:-1)*o*tt,p=w(z.get(),r,h);g(p,p,n);const u=this.analysis.tiltEnabled?ot.TILTED:ot.HORIZONTAL_OR_VERTICAL,c=i[Q]?ot.VERTICAL:i[X]?ot.HORIZONTAL:u;return ht(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=pt,this.rotateHeadingManipulator.state|=pt,this.rotateTiltManipulator.state|=pt,this._prevPointerMoveTimeout=this._clock.setTimeout((()=>{this.shiftManipulator.state&=~pt,this.rotateHeadingManipulator.state&=~pt,this.rotateTiltManipulator.state&=~pt}),this._pointerMoveTimerMs)}_updateManipulators(){if(Vt.disableEngineLayers)return;let t,e=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=!1;else{if(null==this._previewPlane)return this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!1,void(this._previewPlaneGridVisualElement.visible=!1);t=this._previewPlane,e=!0}const i=ut(t,G.get());e?(this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.attached=!0,this._previewPlaneGridVisualElement.attached=!0,this._previewPlaneOutlineVisualElement.visible=!0,this._previewPlaneGridVisualElement.visible=!0):(this.shiftManipulator.available=!0,this.rotateHeadingManipulator.available=!0,this.rotateTiltManipulator.available=this.analysis.tiltEnabled,this.resizeManipulators.forEach((t=>t.available=!0)),ct(this.shiftManipulator,i,t,this.view.state.camera),dt(this.rotateHeadingManipulator,i,t,this.view.renderCoordsHelper),_t(this.rotateTiltManipulator,i,t),this.resizeManipulators.forEach(((e,a)=>vt(e,this._resizeHandles[a],i,t))),this._previewPlaneOutlineVisualElement.visible=!1,this._previewPlaneGridVisualElement.visible=!1);const a=D(z.get(),y(t.basis1),y(t.basis2),1),s=_(G.get(),a),n=v(s,i,s);this._previewPlaneOutlineVisualElement.transform=n,this._previewPlaneGridVisualElement.transform=n,this._updateMaterials()}_updateMaterials(){const t=F(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=T(N);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=E}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach((t=>{t.interactive=!0}));this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach((e=>{e.interactive=e===t}))}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};bt.disableEngineLayers=!1,t([u()],bt.prototype,"_clock",void 0),t([u({constructOnly:!0})],bt.prototype,"view",void 0),t([u()],bt.prototype,"analysisViewData",void 0),t([u({readOnly:!0})],bt.prototype,"state",null),t([u({readOnly:!0})],bt.prototype,"cursor",null),t([u()],bt.prototype,"analysis",null),t([u()],bt.prototype,"removeIncompleteOnCancel",void 0),t([u()],bt.prototype,"_layersMode",void 0),t([u()],bt.prototype,"layersMode",null),t([u({value:null})],bt.prototype,"inputState",null),t([u()],bt.prototype,"_isPlacingSlicePlane",null),t([u()],bt.prototype,"_creatingPointerId",null),bt=Vt=t([c("esri.views.3d.analysis.Slice.SliceTool")],bt);const Tt=bt;function Et(t,e,i,a){const s=Pt(i,x(a),t.direction,C()),n=b();return R(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function kt(t){return"mouse"!==t.pointerType||0===t.button}const St=k(),xt=I();export{Tt as default};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{addFrameTask as o}from"../../../../core/scheduling.js";import{createScreenPoint as h,screenPointObjectToArray as p}from"../../../../core/screenUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as d,fromScaling as _,multiply as v}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{f as P,l as y,c as m,h as w,g,t as f,n as M,i as D}from"../../../../chunks/vec32.js";import{clone as V,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as T,ZEROS as E}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{d as k,a as S,n as x,f as j}from"../../../../chunks/boundedPlane.js";import{signedDistance as H,create as C,intersectRay as R,getNormal as O}from"../../../../geometry/support/plane.js";import{create as I}from"../../../../geometry/support/ray.js";import{sv3d as z,sm4d as G,sv2d as L}from"../../../../geometry/support/vectorStacks.js";import{getRotateHeadingTexture as U,getTiltRotateTexture as A}from"../images/Factory.js";import{ResizeManipulator as K}from"./ResizeManipulator.js";import{RotateManipulator as B}from"./RotateManipulator.js";import{getOutlineColor as F,planeColor as N}from"./settings.js";import{ShiftManipulator as q,OffsetMode as Z}from"./ShiftManipulator.js";import{pointerMoveTimerMs as W,planePreviewOutlineWidth as J,forceVerticalModifier as Q,forceHorizontalModifier as X,previewFadeDotThreshold as Y,previewFadeDurationSeconds as $,initialDepthOffsetFrac as tt}from"./sliceToolConfig.js";import{createGridVisualElement as et,createOutlineVisualElement as it,planeToShape as at,createRotatePlane as st,RotationAxis as nt,resizePlane as rt,calculatePlaneHalfSize as lt,SliceOrientation as ot,createPlane as ht,DidPointerMoveRecentlyFlag as pt,calculateBoundedPlaneTranslateRotate as ut,updateShiftRestartHandle as ct,updateRotateHeadingHandle as dt,updateRotateTiltHandle as _t,updateResizeHandle as vt,createShiftPlane as Pt}from"./sliceToolUtils.js";import{calculateInputRotationTransform as yt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as mt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreenNormalized as wt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as gt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as ft}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as Mt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as Dt}from"../../../support/screenUtils.js";var Vt;let bt=class extends gt{static{Vt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this._layersMode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=W,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=k(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=h(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=Mt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&S(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new q(this.view,Z.CENTER_ON_ARROW);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",(i=>{this._onShiftGrab(i),t(e)}))]);const i=!this.view._stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new B(this.view,((t,e)=>U(this.view.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i})));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",(e=>{this._onRotateHeadingGrab(e),t(a)}))]);const s=new B(this.view,((t,e)=>A(this.view.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i})));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",(e=>{this._onRotateTiltGrab(e),t(s)}))]),this.resizeManipulators=this._resizeHandles.map(((e,i)=>{const a=new K(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",(e=>{this._onResizeGrab(e,i),t(a)}))]),a})),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=et(this.view),this._previewPlaneOutlineVisualElement=it(this.view),this._previewPlaneOutlineVisualElement.width=J,this.addHandles(n((()=>[this.analysisViewData.plane,this.analysis.tiltEnabled]),(()=>this._updateManipulators()),r));const o=n((()=>this.state),(t=>{"sliced"===t&&this.finishToolCreation()}),l);this.addHandles([o,n((()=>this.view.state.camera),(()=>this._onCameraChange()))])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this._isPlacingSlicePlane||"exclude"===this.layersMode?"crosshair":null!=this._creatingPointerId?"grabbing":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get layersMode(){return this._layersMode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _isPlacingSlicePlane(){return!this.inputState&&!this.analysisViewData.plane&&this.active}get _creatingPointerId(){return null!=this.inputState&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}enterExcludeLayerMode(){null!=this.analysisViewData.plane&&(this._layersMode="exclude",this.active||(this.view.activeTool=this))}exitExcludeLayerMode(){null!=this.analysisViewData.plane&&(this._layersMode="none",this.active&&(this.view.activeTool=null))}onDeactivate(){this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!kt(t))return;this._isPlacingSlicePlane?this._onClickPlacePlane(t)&&t.stopPropagation():this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t);break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!kt(t))return;this._onClickPlacePlane(t)&&t.stopPropagation();break;case"click":if(!kt(t))return;this._onClickExcludeLayer(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&null!=e&&"shift"===e.type){const i=Dt(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Dt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&null!=this.analysisViewData.plane){const e=Dt(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),S(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if("exclude"===this.layersMode)return!1;if(this._isPlacingSlicePlane){const i=Dt(t),a=k();if(this._pickPlane(i,!1,this._activeKeyModifiers,a)){if("pointer-drag"===t.type){const e=wt(this.view.state.camera,i,xt);this.inputState=Et(e,t.pointerId,a.origin,a)}return S(a,this._startPlane),this.analysis.shape=at(a,this.view,this.view.spatialReference,new e),!0}}return!1}_onClickExcludeLayer(t){return!("exclude"!==this.layersMode||!this.created)&&(this.view.hitTest(Dt(t)).then((t=>{if(t.results.length){const e=t.results[0],i="graphic"===e?.type&&e.graphic;if(i){const t=i.sourceLayer||i.layer;t&&this.analysis.excludedLayers.push(t)}}else t.ground.layer?this.analysis.excludedLayers.push(t.ground.layer):this.analysis.excludeGroundSurface=!0})),this.exitExcludeLayerMode(),!0)}_onKeyDown(t){return(t.key===Q||t.key===X)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==Q&&t.key!==X||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=wt(this.view.state.camera,t.screenPoint,xt);S(this.analysisViewData.plane,this._startPlane),this.inputState=Et(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return ft(t,((t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,k()):null;e.next(mt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next((()=>{null!=s&&this._updateBoundedPlane(s)}))}))}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(P(x(this.analysisViewData.plane),e.ray.direction)/y(e.ray.direction)))/i,1),s=-H(this._startPlane.plane,e.renderEnd),n=-H(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=m(z.get(),this._startPlane.origin),i=m(z.get(),x(this._startPlane));w(i,i,-t.depth),g(i,i,e);const a=j(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,k());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,nt.HEADING,C()),i=wt(this.view.state.camera,t.screenPoint,xt),a=b();R(e,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return ft(t,((t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,k()):null;e.next(mt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{null!=s&&this._updateBoundedPlane(s)}))}))}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,nt.TILT,C()),i=wt(this.view.state.camera,t.screenPoint,xt),a=b();R(e,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return ft(t,((t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,k()):null;e.next(mt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{null!=s&&this._updateBoundedPlane(s)}))}))}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=O(t.rotatePlane),a=yt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=d(G.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=f(z.get(),this._startPlane.basis1,e),a=f(z.get(),this._startPlane.basis2,e),s=j(this.analysisViewData.plane.origin,i,a,k());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=wt(this.view.state.camera,t.screenPoint,xt),a=z.get();R(this.analysisViewData.plane.plane,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:V(a)})}_createResizeDragPipeline(t){return ft(t,((t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=S(this.analysisViewData.plane,k());e.next(mt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next((()=>{this._updateBoundedPlane(s)}))}))}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=rt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,S(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(!this.analysisViewData.plane&&this.active){const a=null!=i?i:k();if(i=null!=i?S(i,St):null,this._pickPlane(t,!0,e,a)){const t=Y;let e=!1;null!=i&&(e=P(O(i.plane),O(a.plane))<t||P(M(z.get(),i.basis1),M(z.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=o({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*$),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=p(t,L.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=z.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(z.get()),l=this.view.state.camera;P(r,l.viewForward)>0&&w(r,r,-1);const o=lt(n,l),h=(e?1:-1)*o*tt,p=w(z.get(),r,h);g(p,p,n);const u=this.analysis.tiltEnabled?ot.TILTED:ot.HORIZONTAL_OR_VERTICAL,c=i[Q]?ot.VERTICAL:i[X]?ot.HORIZONTAL:u;return ht(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=pt,this.rotateHeadingManipulator.state|=pt,this.rotateTiltManipulator.state|=pt,this._prevPointerMoveTimeout=this._clock.setTimeout((()=>{this.shiftManipulator.state&=~pt,this.rotateHeadingManipulator.state&=~pt,this.rotateTiltManipulator.state&=~pt}),this._pointerMoveTimerMs)}_updateManipulators(){if(Vt.disableEngineLayers)return;let t,e=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=!1;else{if(null==this._previewPlane)return this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!1,void(this._previewPlaneGridVisualElement.visible=!1);t=this._previewPlane,e=!0}const i=ut(t,G.get());e?(this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.attached=!0,this._previewPlaneGridVisualElement.attached=!0,this._previewPlaneOutlineVisualElement.visible=!0,this._previewPlaneGridVisualElement.visible=!0):(this.shiftManipulator.available=!0,this.rotateHeadingManipulator.available=!0,this.rotateTiltManipulator.available=this.analysis.tiltEnabled,this.resizeManipulators.forEach((t=>t.available=!0)),ct(this.shiftManipulator,i,t,this.view.state.camera),dt(this.rotateHeadingManipulator,i,t,this.view.renderCoordsHelper),_t(this.rotateTiltManipulator,i,t),this.resizeManipulators.forEach(((e,a)=>vt(e,this._resizeHandles[a],i,t))),this._previewPlaneOutlineVisualElement.visible=!1,this._previewPlaneGridVisualElement.visible=!1);const a=D(z.get(),y(t.basis1),y(t.basis2),1),s=_(G.get(),a),n=v(s,i,s);this._previewPlaneOutlineVisualElement.transform=n,this._previewPlaneGridVisualElement.transform=n,this._updateMaterials()}_updateMaterials(){const t=F(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=T(N);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=E}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach((t=>{t.interactive=!0}));this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach((e=>{e.interactive=e===t}))}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};t([u()],bt.prototype,"_clock",void 0),t([u({constructOnly:!0})],bt.prototype,"view",void 0),t([u()],bt.prototype,"analysisViewData",void 0),t([u({readOnly:!0})],bt.prototype,"state",null),t([u({readOnly:!0})],bt.prototype,"cursor",null),t([u()],bt.prototype,"analysis",null),t([u()],bt.prototype,"removeIncompleteOnCancel",void 0),t([u()],bt.prototype,"_layersMode",void 0),t([u()],bt.prototype,"layersMode",null),t([u({value:null})],bt.prototype,"inputState",null),t([u()],bt.prototype,"_isPlacingSlicePlane",null),t([u()],bt.prototype,"_creatingPointerId",null),bt=Vt=t([c("esri.views.3d.analysis.Slice.SliceTool")],bt);const Tt=bt;function Et(t,e,i,a){const s=Pt(i,x(a),t.direction,C()),n=b();return R(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function kt(t){return"mouse"!==t.pointerType||0===t.button}const St=k(),xt=I();export{Tt 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{unitRGBAFromColor as t}from"../../../core/colorUtils.js";import{clamp as r,lerp as s}from"../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{watch as o,syncAndInitial as a}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{i as h,l as c,k as p}from"../../../chunks/vec32.js";import{s as u}from"../../../chunks/vec42.js";import{ZEROS as d}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as f}from"../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as l}from"../webgl.js";import{innerAtmosphereDepth as g,computeInnerAltitudeFade as b}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as _,ChapmanAtmosphereTechnique as P}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as j}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{ColorFormat as w}from"../webgl/formats.js";import{OpaqueEnvironment as T}from"../webgl-engine/effects/OpaqueEnvironment.js";import{RenderRequestType as v}from"../webgl-engine/lib/basicInterfaces.js";import{createQuadVAO as A,Layout as q}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as E}from"../webgl-engine/lib/textureUtils.js";import{A as C}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as x}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{PrimitiveType as D}from"../../webgl/enums.js";import R from"../../../webscene/background/ColorBackground.js";let M=class extends T{constructor(){super(...arguments),this.requireGeometryDepth=!0,this._compositingPassParameters=new C,this._vao=null,this._passParameters=new _,this._configuration=new j}initialize(){this.techniques.precompile(P,this._configuration),this.techniques.precompile(x),this._configuration.reduced=!0,this.techniques.precompile(P,this._configuration),this._configuration.reduced=!1,this.addHandles([o((()=>this.view.environment.background),(e=>{const r=e instanceof R?t(e.color):d;h(this._passParameters.backgroundColor,r[0]*r[3],r[1]*r[3],r[2]*r[3])}),a),o((()=>this.view._stage?.renderer?.fullResolutionAtmosphere),(e=>this._configuration.reduced=!e),a),o((()=>this.view.environment.atmosphereEnabled),(e=>e?this._enable():this._disable()),a)])}destroy(){this._vao=i(this._vao)}render(e){const t=e.find((({name:e})=>e===l.OPAQUE_ENVIRONMENT));if(!this.bindParameters.mainDepth)return t;const r=this.renderingContext;this._vao??=A(r,q.Pos2Tex);const i=t.getAttachment(r.gl.DEPTH_STENCIL_ATTACHMENT);this._update();const o=this.techniques.get(P,this._configuration);if(!o.compiled)return this.requestRender(v.UPDATE),t;if(!this._configuration.reduced)return t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(o,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(D.TRIANGLE_STRIP,0,4),t.attachDepth(i),t;const a=this.techniques.get(x);if(!a.compiled)return this.requestRender(v.UPDATE),t;const n=r.getViewport(),m=this.bindParameters.camera,h=c(m.eye)-f.radius;let p;const u=f.atmosphereHeight;if(h<u){const e=Math.min(1,Math.max(0,h/u));p=s(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(h-u)/(15*u)));p=s(.3,.6,e)}const d=E(Math.round(p*m.fullViewport[2])),g=E(Math.round(p*m.fullViewport[3]));r.setViewport(0,0,d,g);const b=this.fboCache.acquire(d,g,"chapman",w.RGBA);return r.bindFramebuffer(b.fbo),r.clearFramebuffer([0,0,0,1],!0,!0),r.bindTechnique(o,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(D.TRIANGLE_STRIP,0,4),r.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=b.getTexture(),t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(a,this.bindParameters,this._compositingPassParameters),r.screen.draw(),t.attachDepth(i),b.release(),t}_update(){const e=this.bindParameters.camera,t=p(e.eye),s=Math.sqrt(t),i=t-this._passParameters.radii[1]**2,o=r((s-this._passParameters.radii[0])/f.atmosphereHeight,0,1);u(this._passParameters.heightParameters,s,t,i,o);const a=this.view.basemapTerrain?.getLowerBoundRadius()??0;m(this._passParameters.radii,a,a+f.atmosphereHeight),this._passParameters.innerFadeDistance=2*Math.sqrt((2*a-g)*g),this._passParameters.altitudeFade=b(s-a)}};M=e([n("esri.views.3d.environment.ChapmanAtmosphere")],M);export{M as ChapmanAtmosphere};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{unitRGBAFromColor as t}from"../../../core/colorUtils.js";import{clamp as r,lerp as s}from"../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../core/maybe.js";import{watch as o,syncAndInitial as a}from"../../../core/reactiveUtils.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{i as h,l as c,k as p}from"../../../chunks/vec32.js";import{s as u}from"../../../chunks/vec42.js";import{ZEROS as d}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as f}from"../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as l}from"../webgl.js";import{innerAtmosphereDepth as g,computeInnerAltitudeFade as b}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as _,ChapmanAtmosphereTechnique as P}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as j}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{ColorFormat as w}from"../webgl/formats.js";import{OpaqueEnvironment as T}from"../webgl-engine/effects/OpaqueEnvironment.js";import{RenderRequestType as v}from"../webgl-engine/lib/basicInterfaces.js";import{createQuadVAO as A,Layout as q}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as x}from"../webgl-engine/lib/textureUtils.js";import{A as C}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as E}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{PrimitiveType as D}from"../../webgl/enums.js";import R from"../../../webscene/background/ColorBackground.js";let M=class extends T{constructor(){super(...arguments),this.requireGeometryDepth=!0,this._compositingPassParameters=new C,this._vao=null,this._passParameters=new _,this._configuration=new j}initialize(){this.techniques.precompile(P,this._configuration),this.techniques.precompile(E),this._configuration.reduced=!0,this.techniques.precompile(P,this._configuration),this._configuration.reduced=!1,this.addHandles([o((()=>this.view.environment.background),(e=>{const r=e instanceof R?t(e.color):d;h(this._passParameters.backgroundColor,r[0]*r[3],r[1]*r[3],r[2]*r[3])}),a),o((()=>this.view._stage?.renderer?.fullResolutionAtmosphere),(e=>this._configuration.reduced=!e),a),o((()=>this.view.environment.atmosphereEnabled),(e=>e?this._enable():this._disable()),a)])}destroy(){this._vao=i(this._vao)}render(e){const t=e.find((({name:e})=>e===l.OPAQUE_ENVIRONMENT));if(!this.bindParameters.mainDepth)return t;const r=this.renderingContext;this._vao??=A(r,q.Pos2Tex);const i=t.getAttachment(r.gl.DEPTH_STENCIL_ATTACHMENT);this._update();const o=this.techniques.get(P,this._configuration);if(!o.compiled)return this.requestRender(v.UPDATE),t;if(!this._configuration.reduced)return t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(o,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(D.TRIANGLE_STRIP,0,4),t.attachDepth(i),t;const a=this.techniques.get(E);if(!a.compiled)return this.requestRender(v.UPDATE),t;const n=r.getViewport(),m=this.bindParameters.camera,h=c(m.eye)-f.radius;let p;const u=f.atmosphereHeight;if(h<u){const e=Math.min(1,Math.max(0,h/u));p=s(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(h-u)/(15*u)));p=s(.3,.6,e)}const d=this.renderingContext.parameters.maxTextureSize,g=x(Math.round(p*m.fullViewport[2]),d),b=x(Math.round(p*m.fullViewport[3]),d);r.setViewport(0,0,g,b);const _=this.fboCache.acquire(g,b,"chapman",w.RGBA);return r.bindFramebuffer(_.fbo),r.clearFramebuffer([0,0,0,1],!0,!0),r.bindTechnique(o,this.bindParameters,this._passParameters),r.bindVAO(this._vao),r.drawArrays(D.TRIANGLE_STRIP,0,4),r.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=_.getTexture(),t.detachDepth(),r.bindFramebuffer(t.fbo),r.bindTechnique(a,this.bindParameters,this._compositingPassParameters),r.screen.draw(),t.attachDepth(i),_.release(),t}_update(){const e=this.bindParameters.camera,t=p(e.eye),s=Math.sqrt(t),i=t-this._passParameters.radii[1]**2,o=r((s-this._passParameters.radii[0])/f.atmosphereHeight,0,1);u(this._passParameters.heightParameters,s,t,i,o);const a=this.view.basemapTerrain?.getLowerBoundRadius()??0;m(this._passParameters.radii,a,a+f.atmosphereHeight),this._passParameters.innerFadeDistance=2*Math.sqrt((2*a-g)*g),this._passParameters.altitudeFade=b(s-a)}};M=e([n("esri.views.3d.environment.ChapmanAtmosphere")],M);export{M as ChapmanAtmosphere};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{neverReached as i}from"../../../core/compilerUtils.js";import{destroyHandle as e}from"../../../core/handleUtils.js";import{clone as n}from"../../../core/lang.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import{cast as s}from"../../../core/accessorSupport/decorators/cast.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{ensureOneOfType as g}from"../../../core/accessorSupport/ensureType.js";import{lightingTypes as h}from"./lightingUtils.js";import l from"./SunLighting.js";import c from"./VirtualLighting.js";import a from"../../../webscene/Environment.js";import p from"../../../webscene/SunLighting.js";import u from"../../../webscene/VirtualLighting.js";var m;let b=m=class extends a{constructor(t){super(t),this.lighting=this.castLighting(),this._computeWeatherAvailable=void 0,this.cachedCameraTrackingEnabled=null}static fromWebsceneEnvironment(t){const i=t.cloneConstructProperties();return new m({...i,lighting:i.lighting?"virtual"===i.lighting.type?c.fromWebsceneLighting(i.lighting):l.fromWebsceneLighting(i.lighting):void 0})}get weatherAvailable(){return this._computeWeatherAvailable?.()??!1}setComputeWeatherAvailable(t){this._computeWeatherAvailable=t}castLighting(t){return this._convertLightingWithDestroy(t)}applyLighting(t){this.lighting=this._convertLightingWithDestroy(t)}_convertLightingWithDestroy(t){const i=this._convertLighting(t);return i!==t&&this.addHandles(e(i)),i}_convertLighting(t){return t?t instanceof l||t instanceof c?t:t instanceof p?this.lighting&&"virtual"!==this.lighting.type?this.lighting.cloneWithWebsceneLighting(t):new l({...t.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):t instanceof u?this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t):new c({...t.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):g(h,t):new l}clone(){return new m({lighting:this.lighting.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:n(this.background)})}cloneWithWebsceneEnvironment(t){return new m({weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:n(this.background),...t.cloneConstructProperties(),lighting:this._getLighting(t)})}_getLighting(t){switch(t.lighting.type){case"sun":return this.lighting&&"sun"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t.lighting):l.fromWebsceneLighting(t.lighting);case"virtual":return this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t.lighting):c.fromWebsceneLighting(t.lighting);default:return i(t.lighting),l.fromWebsceneLighting(t.lighting)}}};t([r({nonNullable:!0})],b.prototype,"lighting",void 0),t([r()],b.prototype,"_computeWeatherAvailable",void 0),t([r({readOnly:!0})],b.prototype,"weatherAvailable",null),t([s("lighting")],b.prototype,"castLighting",null),b=m=t([o("esri.views.3d.environment.SceneViewEnvironment")],b);const d=b;export{d as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{neverReached as i}from"../../../core/compilerUtils.js";import{destroyHandle as e}from"../../../core/handleUtils.js";import{clone as n}from"../../../core/lang.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import{cast as s}from"../../../core/accessorSupport/decorators/cast.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{ensureOneOfType as g}from"../../../core/accessorSupport/ensureType.js";import{lightingTypes as h}from"./lightingUtils.js";import l from"./SunLighting.js";import c from"./VirtualLighting.js";import a from"../../../webscene/Environment.js";import p from"../../../webscene/SunLighting.js";import u from"../../../webscene/VirtualLighting.js";var m;let b=class extends a{static{m=this}constructor(t){super(t),this.lighting=this.castLighting(),this._computeWeatherAvailable=void 0,this.cachedCameraTrackingEnabled=null}static fromWebsceneEnvironment(t){const i=t.cloneConstructProperties();return new m({...i,lighting:i.lighting?"virtual"===i.lighting.type?c.fromWebsceneLighting(i.lighting):l.fromWebsceneLighting(i.lighting):void 0})}get weatherAvailable(){return this._computeWeatherAvailable?.()??!1}setComputeWeatherAvailable(t){this._computeWeatherAvailable=t}castLighting(t){return this._convertLightingWithDestroy(t)}applyLighting(t){this.lighting=this._convertLightingWithDestroy(t)}_convertLightingWithDestroy(t){const i=this._convertLighting(t);return i!==t&&this.addHandles(e(i)),i}_convertLighting(t){return t?t instanceof l||t instanceof c?t:t instanceof p?this.lighting&&"virtual"!==this.lighting.type?this.lighting.cloneWithWebsceneLighting(t):new l({...t.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):t instanceof u?this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t):new c({...t.cloneConstructProperties(),...this.lighting?.cloneNonPersistentConstructProperties()}):g(h,t):new l}clone(){return new m({lighting:this.lighting.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:n(this.background)})}cloneWithWebsceneEnvironment(t){return new m({weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:n(this.background),...t.cloneConstructProperties(),lighting:this._getLighting(t)})}_getLighting(t){switch(t.lighting.type){case"sun":return this.lighting&&"sun"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t.lighting):l.fromWebsceneLighting(t.lighting);case"virtual":return this.lighting&&"virtual"===this.lighting.type?this.lighting.cloneWithWebsceneLighting(t.lighting):c.fromWebsceneLighting(t.lighting);default:return i(t.lighting),l.fromWebsceneLighting(t.lighting)}}};t([r({nonNullable:!0})],b.prototype,"lighting",void 0),t([r()],b.prototype,"_computeWeatherAvailable",void 0),t([r({readOnly:!0})],b.prototype,"weatherAvailable",null),t([s("lighting")],b.prototype,"castLighting",null),b=m=t([o("esri.views.3d.environment.SceneViewEnvironment")],b);const d=b;export{d 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.33/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{isSome as s,removeUnordered as r}from"../../../core/arrayUtils.js";import{ByteSizeUnit as o}from"../../../core/ByteSizeUnit.js";import has from"../../../core/has.js";import a from"../../../core/Logger.js";import{destroyMaybe as n}from"../../../core/maybe.js";import l from"../../../core/PooledArray.js";import{ignoreAbortErrors as d,isAbortError as h,throwIfAborted as c,createResolver as u}from"../../../core/promiseUtils.js";import{initial as _,watch as m}from"../../../core/reactiveUtils.js";import{schedule as g}from"../../../core/scheduling.js";import{isArrayBuffer as p}from"../../../core/typedArrayUtil.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as y,invert as v}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as I}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{multiply as M,getTranslation as C}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{clone as x,create as E}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as O}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{i as w,t as j,q as R,a as S,g as T,h as A,d as D,H as N}from"../../../chunks/vec32.js";import{create as F}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as V}from"../../../chunks/vec42.js";import{fromValues as P}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as H}from"../../../core/support/UpdatingHandles.js";import{getSphericalPCPF as U}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{localLinearScaleFactors as G}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectBoundingSphere as L}from"../../../geometry/projection/projectBoundingSphere.js";import{projectBuffer as k}from"../../../geometry/projection/projectBuffer.js";import{getProjectorName as B}from"../../../geometry/projection/projectors.js";import{projectVectorToVector as q}from"../../../geometry/projection/projectVectorToVector.js";import{create as K,fromBuffer as W,toRect as z}from"../../../geometry/support/aaBoundingBox.js";import{create as $,intersects as Q}from"../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as X}from"../../../geometry/support/DoubleArray.js";import{compactFloatArray as Y}from"../../../geometry/support/FloatArray.js";import{compactIndices as J}from"../../../geometry/support/Indices.js";import{a as Z,f as ee,g as te}from"../../../chunks/sphere.js";import{newUByteArray as ie}from"../../../geometry/support/UByteArray.js";import{fallbackObjectIDAttribute as se}from"../../../layers/LayerConstants.js";import re from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as oe}from"../../../layers/support/fieldUtils.js";import ae from"../../../layers/support/SceneModification.js";import{getColor as ne,getOpacity as le}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{loadArcade as de}from"../../../support/arcadeOnDemand.js";import{isBasemapLayer as he}from"../../../support/basemapUtils.js";import{getElevationOffset as ce}from"../../../support/elevationInfoUtils.js";import{isQuery as ue}from"../../../support/guards.js";import _e from"../../../symbols/MeshSymbol3D.js";import me from"../../../symbols/SimpleFillSymbol.js";import ge from"./I3SMeshViewLabeler.js";import{I3SMeshViewPerformanceInfo as pe}from"./I3SMeshViewPerformanceInfo.js";import{I3SMeshWorkerHandle as fe,toWasmModification as be}from"./I3SMeshWorkerHandle.js";import{ElevationMode as ye,ForAllFeaturesReturnType as ve,ForAllFeaturesMode as Ie}from"./II3SMeshView3D.js";import{initialize as Me,setModificationsSync as Ce,filterObbsForModificationsSync as xe,interpretObbModificationResults as Ee}from"./SceneLayerWorker.js";import{overrideColor as Oe}from"./graphics/graphicUtils.js";import{areLabelsVisible as we}from"./graphics/Labeler.js";import{TextureUsage as je,TextureEncoding as Re}from"./i3s/enums.js";import Se from"./i3s/Highlights.js";import{I3SAsyncElevationUpdater as Te}from"./i3s/I3SAsyncElevationUpdater.js";import{I3SCrossfadeHelper as Ae,NodeCrossfadeMetaData as De}from"./i3s/I3SCrossfadeHelper.js";import{boundingBoxCornerPoints as Ne}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as Fe}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as Ve,selectEncoding as Pe,defaultMaterial as He,createTexture as Ue,configureMaterial as Ge}from"./i3s/I3SMaterialUtil.js";import{NodeIMModificationImpact as Le,NodeState as ke}from"./i3s/I3SNode.js";import{I3SOverrides as Be}from"./i3s/I3SOverrides.js";import{computeGlobalTransformation as qe}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Ke,checkSceneLayerValid as We,checkSceneLayerCompatibleWithView as ze,whenGraphicAttributes as $e,computeVisibilityObb as Qe,filterInPlace as Xe,getCachedAttributeValue as Ye,intersectBoundingRectWithMbs as Je,MbsIntersectResult as Ze,addWraparound as et,getSymbolInfo as tt,transparentEdgeMaterial as it,getClipRect as st}from"./i3s/I3SUtil.js";import{IDBCache as rt}from"./i3s/IDBCache.js";import{IDBMockCache as ot}from"./i3s/IDBMockCache.js";import{LayerElevationProvider as at}from"./i3s/LayerElevationProvider.js";import{attributeLookup as nt}from"./support/attributeUtils.js";import{emptyHighlightHandle as lt,normalizeHighlightTargetExceptQuery as dt}from"./support/highlightUtils.js";import{makeScheduleFunction as ht}from"./support/makeScheduleFunction.js";import{ColorMixModeEnum as ct}from"./support/symbolColorUtils.js";import{debugFlags as ut}from"../support/debugFlags.js";import{ElevationRange as _t}from"../support/ElevationRange.js";import{toBoundingRect as mt}from"../support/extentUtils.js";import{Obb as gt}from"../support/orientedBoundingBox.js";import{updatingProgress as pt}from"../support/updatingProperties.js";import{glLayout as ft}from"../support/buffer/glUtil.js";import{ObjectParameters as bt}from"../webgl-engine/collections/Component/ObjectParameters.js";import{createVertexBufferLayout as yt,GeometryParameters as vt}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as It}from"../webgl-engine/collections/Component/Transform.js";import{TextureCoordinateType as Mt}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{loadBasisTranscoder as Ct}from"../webgl-engine/lib/BasisUtil.js";import{Transparency as xt}from"../webgl-engine/lib/edgeRendering/interfaces.js";import{defaultHighlightName as Et}from"../../support/HighlightDefaults.js";const Ot="esri.views.3d.layers.I3SMeshView3D",wt=()=>a.getLogger(Ot),jt=[1,1,1,1];class Rt extends De{constructor(e,t,i,s,r,o,a,n,l){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=a,this.anchorIds=n,this.anchors=l,this.cachedElevationAnchors=null,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0}get cachedMemory(){return this.node.memory}get featureExtents(){return this._featureExtents??=new Float64Array(6*this.featureIds.length).fill(Number.POSITIVE_INFINITY),this._featureExtents}}var St;!function(e){e[e.CastShadows=4]="CastShadows",e[e.Pickable=5]="Pickable"}(St||(St={}));const Tt=26,At=100*o.MEGABYTES,Dt=t=>{let o=class extends t{constructor(){super(...arguments),this._applySSAO=!0,this._shadeNormals=!0,this._updatingHandles=new H,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._currentRenderer=null,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._visibleGeometryChangedSchedulerHandle=null,this._hasComponentData=!1,this._hasVertexColors=!1,this._nodeColorOverride=null,this.updating=!0,this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.slicePlaneEnabled=!1,this._modifications=new Array,this.ignoresMemoryFactor=!1,this._layerUrl="",this._cacheKeySuffix=null,this._planetRadiusInGlobalMode=0,this._elevationTask=null,this._filters=[],this._arcade=null,this._tmpAttributeOnlyGraphic=new i,this._crossfadeHelper=new Ae(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 layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get contentVisible(){return!this.suspended&&this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Ke(this._currentRenderer)?this._usePBR||this._hasLoadedPBRTextures?je.AllTexturesPBR:je.AllTextures:this._usePBR||this._hasLoadedPBRTextures?je.GeometryTexturesPBR:je.GeometryTextures}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;return null!=e&&"absolute-height"===e.mode?ce(e,this.i3slayer.spatialReference):0}get elevationInfo(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null==e)return new Yt(ye.Absolute,0);const t=ce(e,this.i3slayer.spatialReference);switch(e.mode){case"absolute-height":return new Yt(ye.Absolute,t);case"relative-to-ground":return new Yt(ye.RelativeToGround,t);case"on-the-ground":return new Yt(ye.OnTheGround,0);default:return new Yt(ye.Absolute,0)}}get supportedTextureEncodings(){return Ve(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){const e=this.view?.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled,t=!(this.supportedTextureEncodings&Re.DDS_S3TC);return e&&t}get clientGeometry(){return this.i3sOverrides.geometryOverrides}get elevationRange(){const e=this._nodeId2Meta,t=new _t;for(const i of e.values()){if(null==i)continue;const{node:{serviceMbsInIndexSR:e}}=i,[s,r,o,a]=e;t.expandElevationRangeValues(o-a,o+a)}return t.elevationRangeValid?t:null}get fullExtent(){return this.i3slayer.fullExtent}initialize(){const e=has("enable-feature:idb-mock-cache");this._idbCache=e?new ot(this.view,e):new rt("esri-scenelayer-cache","geometries"),this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const t=this.view.resourceController,i=t.memoryController;this.i3sOverrides=new Be({view:this.view,layer:this.i3slayer,memoryController:i}),this._worker=new fe(ht(t)),this.addResolvingPromise(this._worker.promise);const s=this.i3slayer.store;this.addResolvingPromise(this._worker.setLegacySchema(this.uid,s.defaultGeometrySchema).catch(d)),We(this.i3slayer),ze(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new re({layerView:this,worker:this._worker}),this._gpuMemoryEstimate=0,this._texMemoryEstimate=0,this._geoMemoryEstimate=0,this._stage=this.view._stage,this._collection=this._stage.renderView.componentObjectCollection,this.resetHighlights();const r=s.defaultGeometrySchema;if(this._isIntegratedMesh||!r)this._hasComponentData=!1;else{const e=r.featureAttributes;this._hasComponentData=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=(r?.vertexAttributes.color??null)&&!this.i3slayer.cachedDrawingInfo?.color;const o=this.view.resourceController.memoryController.newCache(`sl-${this.uid}`,(e=>this._deleteComponentObject(e)));this._memCache=o;const a=this._controller,l=this._nodeId2Meta,h=this._nodeId2MetaReloading,c=e=>{const t=a.index;if(!t)return;const i=t.rootNode;if(!i)return;const s=t=>{const i=t.index,s=l.get(i)||h.get(i);return e(t,s?.objectHandle??null)};t.traverse(i,s)};this._intersectionHandler=new Fe({layerUid:this.layerUid,sublayerUid:this.sublayerUid,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:c}),this._updatingHandles.add((()=>this.layerUid),(e=>this._intersectionHandler.layerUid=e)),this._updatingHandles.add((()=>this.sublayerUid),(e=>this._intersectionHandler.sublayerUid=e)),this._elevationProvider=new at({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR,this._updatingHandles.add((()=>this.view.clippingArea),(()=>this._clippingAreaChanged()),_),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.elevationInfo),((e,t)=>this._elevationInfoChanged(e,t)),_),this._updatingHandles.add((()=>!this.suspended&&this.elevationInfo.mode!==ye.Absolute),((e,t)=>{e?this.addHandles(this.view.basemapTerrain.on("elevation-change",(({extent:e})=>this._ensureElevationTask().addExtent(e))),ei):t&&this.removeHandles(ei)}),_),this._updatingHandles.add((()=>this._usePBR),(e=>this._updatePBR(e)));const u=()=>{this._reloadAll(),this.clearMemCache()};this._updatingHandles.add((()=>this.rendererTextureUsage),u),this._updatingHandles.add((()=>this.uncompressedTextureDownsamplingEnabled),u),this._updatingHandles.add((()=>this.contentVisible),(e=>this._contentVisibleChanged(e)),_),this._updatingHandles.add((()=>this.i3slayer.labelsVisible),(()=>this._labelingChanged()),_),this._updatingHandles.add((()=>this.i3slayer.labelingInfo),(()=>this._labelingChanged()),_),this._updatingHandles.add((()=>this._modifications),(()=>this._modificationsChanged()),_),this.addHandles([m((()=>ut.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&ut.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||ut.I3S_TREE_SHOW_TILES||(this._treeDebugger=n(this._treeDebugger))}),_),m((()=>ut.I3S_SHOW_MODIFICATIONS),(()=>this._showModifications()),_)]),this._cacheKeySuffix=this._getCacheKeySuffix(),this._idbCache.init().catch((e=>wt().warn(`Failed to initialize IndexedDB cache: ${e}`)));const{view:g}=this,{viewingMode:p,renderCoordsHelper:f}=g;this._planetRadiusInGlobalMode="local"===p?0:f.referenceEllipsoid.radius}destroy(){this._clearAddTasks(),this._elevationTask=n(this._elevationTask),this.i3sOverrides=n(this.i3sOverrides),this._elevationProvider&&(this._elevationProvider.objectsChanged(this.getVisibleObbs()),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._worker;e&&(e.destroyContext(this.uid).then((()=>e.destroy())),this._worker=null),this._removeAllNodeDataFromStage(),this._memCache=n(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=n(this._labeler),this._treeDebugger=n(this._treeDebugger),this._controller=n(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this._crossfadeHelper=n(this._crossfadeHelper),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null),this._updatingHandles=n(this._updatingHandles)}_memEstimateTextureAdded(e){const t=e.memoryEstimate;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(null!=e){const t=e.memoryEstimate;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)}get usedMemory(){let e=null!=this._labeler?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach((t=>e+=null!=t?t.node.memory:0)),this._nodeId2MetaReloading.forEach((t=>e+=null!=t?t.node.memory:0)),e}get unloadedMemory(){return(null!=this._controller?this._controller.unloadedMemoryEstimate:0)+(null!=this._labeler?this._labeler.unloadedMemoryEstimate:0)}_labelingChanged(){if(!(we(this.i3slayer)&&this._supportsLabeling))return void(null!=this._labeler&&(this._labeler.destroy(),this._labeler=null));if(null!=this._labeler)return;const e=new ge({view:this.view,layer:this.i3slayer,collection:this._collection,overrides:this.i3sOverrides});this._nodeId2Meta.forEach((t=>null!=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=Me().then((()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()})),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=this.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const i=be(this._layerClippingArea,this._modifications,t);Ce({context:e,modifications:i,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const s=this.hasModifications?new l:null;this._nodeId2Meta.forEach(((e,t)=>{null==e?(this._nodeId2Meta.delete(t),this._controller.updateLoadStatus(t,!1)):e.node.hasModifications?(this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):null!=s&&s.push(e.node)})),this.notifyChange("elevationRange"),null!=s&&this._nodeId2MetaReloading.forEach((e=>s.push(e.node))),null!=s&&s.length>0&&(this.updateNodeModificationStatus(s),s.forAll((e=>{if(e.imModificationImpact!==Le.Culled){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),null!=t?(this._nodeId2Meta.delete(e.index),this._nodeId2MetaReloading.set(e.index,t),this.notifyChange("elevationRange")):this._nodeId2Meta.has(e.index)&&(this._nodeId2Meta.delete(e.index),this._controller.updateLoadStatus(e.index,!1))}}))),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(null!=this._modificationGraphics&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!ut.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={outline:{color:[255,255,255],width:1}};this._modificationGraphics=new Array;for(const s of this._modifications){const r=s.geometry;r.spatialReference=this.i3slayer.spatialReference;const o=new me({...t,color:e[s.type]});this._modificationGraphics.push(new i({geometry:r,symbol:o}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,((e,t)=>this._createAttributes(e,t)))}_contentVisibleChanged(e){e?(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler)):(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);null!=i?.attributeInfo&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);null!=s&&(await this.i3sOverrides.applyAttributeOverrides(s.featureIds,t,i,this._controller.requiredAttributes),s.attributeInfo=t,this._controller.reschedule((()=>this._attributeValuesChanged(s)),i).catch((e=>{h(e)||wt().warn("Error while updating attribute values. Layer might not display correctly.",e)})))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.filteredIds=null,null!=this._labeler&&this._labeler.setNodeMetaAttributes(e,((e,t)=>this._createAttributes(e,t))),this._updateEngineObject(e)}clearMemCache(){null!=this._memCache&&this._memCache.clear(),this._addTasks.forEach((e=>e.allowMemCache=!1))}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach((t=>null!=t&&e.push(t.node))),e}getVisibleObbs(){const e=new Array;return this._nodeId2Meta.forEach((t=>t&&e.push(this._collection.getComponentObb(t.objectHandle)))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach(((t,i)=>e.push(i))),this._nodeId2MetaReloading.forEach(((t,i)=>e.push(i)))}_preLoadBasis(){!has("disable-feature:i3s-basis")&&this.supportedTextureEncodings&Re.Basis&&this.i3slayer.textureSetDefinitions?.some((e=>e.formats.some((e=>"basis"===e.format||"ktx2"===e.format))))&&Ct()}_getVertexBufferLayout(e,t){return ft(yt(this._getGeometryParameters({hasTexture:Bt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion})))}_getObjectIdField(){return this.i3slayer.objectIdField||se}_getGlobalIdField(){return this.i3slayer.associatedLayer?.globalIdField}_findGraphicNodeAndIndex(e){const t=nt(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());for(const i of this._nodeId2Meta.values()){const e=i?.featureIds.indexOf(t);if(null!=e&&e>=0)return{node:i.node,index:e}}return null}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(null==i)return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const a of t){const e=nt(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._getAABB(t.node.index,t.index);return null==i?Promise.reject():Promise.resolve({boundingBox:i,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return null==e.nodeIndex||null==e.componentIndex?null:this._getAABB(e.nodeIndex,e.componentIndex)}_getAABB(e,t){const i=this._nodeId2Meta.get(e);if(null==i?.featureIds||t>=i.featureIds.length)return null;const s=i.objectHandle,r=Ne(t,this._collection,s,X(24),0),o=this.view.renderSpatialReference,a=this.view.spatialReference;return k(r,o,0,r,a,0)?W(r):null}whenGraphicAttributes(e,t){return $e(this.i3slayer,e,this._getObjectIdField(),t,(()=>[...this._nodeId2Meta.values()].filter(s)))}getGraphicFromIntersectorTarget(e){if(null==e.nodeIndex||null==e.componentIndex)return null;const t=this._nodeId2Meta.get(e.nodeIndex);return null==t?.featureIds||e.componentIndex>=t.featureIds.length?null:this._createGraphic(e.componentIndex,t)}_getCacheKey(e){return`${this._layerUrl}/v${Tt}/${e}${this._cacheKeySuffix}`}_getCacheKeySuffix(){const e=this.view.renderSpatialReference;if(null==e)return ii;if(e===U(e))return si;return this.i3slayer.spatialReference.equals(e)?ti:null!=e.wkid?`@${e.wkid}`:null}_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 null!=this._memCache?this._memCache.pop(this._getMemCacheKey(e)):null}deleteCachedGPUData(e){null!=e&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(null==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,i)}loadMissingTextures(e,t,i,s){const r=e?.filter(((e,i)=>{if(!(e.usage&this.rendererTextureUsage))return!1;if(null==t)return!0;const s=Pe(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(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.id),t).then((s=>null==s?null:s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e.id)),null):(this.elevationInfo.mode===ye.Absolute&&(e.geometryObbInRenderSR=gt.fromData(s.geometryObbData)),this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then((i=>(i&&this._idbCache.initialized&&null!=s.textureData&&(s.byteSize=Wt(s.transformedGeometry,s.textureData),s.textureData.every(Kt)&&zt(e,s)&&this._idbCache.put(this._getCacheKey(e.id),s).catch((t=>wt().warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`)))),c(t),s)))))):Promise.resolve(null)}addNode(e,t,i){return qt(t)?null==t.geometryBuffer?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,(()=>this._transformNode(e,t,i).then((s=>this._safeReschedule((()=>{if(null==s)return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:o,featureIds:a,anchorIds:n,anchors:l,transformedGeometry:d,globalTrafo:h}=s,c=w(Jt,r.center.x,r.center.y,r.center.z);j(c,c,h);const u=new gt(c,[r.extents.x,r.extents.y,r.extents.z],O(r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w));this.elevationInfo.mode===ye.Absolute&&(e.geometryObbInRenderSR=u),t.geometryData.componentOffsets=o,a&&(t.geometryData.featureIds=Array.from(a)),t.geometryData.anchorIds=n,t.geometryData.anchors=l;const _={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:d,globalTrafo:h,geometryObbData:u.data,byteSize:Wt(d,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&zt(e,_)){const t=null!=_.textureData?_.textureData.map((e=>Kt(e)?e:null)):null;this._idbCache.put(this._getCacheKey(e.id),{..._,textureData:t}).catch((t=>wt().warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`)))}return this._addCachedNodeData(e,_,i)}),i))))):Promise.reject()}getElevationRange(e){const t=new _t,i=this._controller,{index:s}=i;if(!s)return t;const{rootNode:r}=s;if(!r)return t;const o=this._nodeId2Meta,a=e[3],n=i.viewportQueries,l=this._planetRadiusInGlobalMode,{view:d}=this,{renderCoordsHelper:h}=d,c=h.referenceEllipsoid.radius,u=this._collection,_=i=>{const{childrenLoaded:s}=i;if(0===s)return!1;const r=n.getAndUpdateVisibilityObbInRenderSR(i);let d=null,_=-1;if(r){if(_=r.radius,!r.intersectSphereWithMBS(e,_))return!1}else d=n.getServiceMbsInRenderSR(i),d&&(_=d[3]);if(_>=0&&a>=1*_)return null!=r?ai(t,r,l):null!=d&&d[3]>=0&&ni(t,d,l),!1;const m=oi;if(m.elevationRangeMin=1/0,m.elevationRangeMax=-1/0,(null!=r||null!=d)&&(null!=r?ai(m,r,l):null!=d&&ni(m,d,l),m.elevationRangeMin>=t.elevationRangeMin&&m.elevationRangeMax<=t.elevationRangeMax))return!1;const g=o.get(i.index);if(g){const{geometryObbInRenderSR:s}=i;if(!s||s.intersectSphereWithMBS(e)){if(s){if(a>0*s.radius)return ai(t,s,l),!1}const{objectHandle:e}=g,i=u.getObjectTransform(e),r=h.getAltitude(i.position);u.expandRangeWithComponentObjectElevationRange(e,r,c,t)}}return s-(g?1:0)>0};return s.traverse(r,_),t}computeVisibilityObb(e){return Qe(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications,this.view.renderCoordsHelper.sphericalPCPF)}_transformNode(e,t,i){const s=t.geometryData.geometries??[],r=new Array(s.length);for(let p=0;p<s.length;++p)r[p]=this._getVertexBufferLayout(s[p],t.geometryDescriptor);const o=this.i3slayer.normalReferenceFrame,a=t.normalReferenceFrame??o??"none",n=e.serviceMbsInIndexSR,l=this.elevationOffset,d=this._controller.crsIndex,h=this._controller.crsVertex,c=this.view.renderSpatialReference,u=qe(n,l,a,d,c),_=B(d,h),m=B(h,c);if(null==_||null==m)return Promise.resolve(null);const g={context:this.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,globalTrafo:u,mbs:n,obbData:e.serviceObbInIndexSR?.data,elevationOffset:l,needNormals:this._controller.isMeshPyramid,normalReferenceFrame:a,indexToVertexProjector:_,vertexToRenderProjector:m};return this._worker.invoke(g,i)}get _supportsNodeCrossFading(){return!this.view?._stage?.renderer.shadowsEnabled}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(this.elevationInfo.mode===ye.Absolute&&(e.geometryObbInRenderSR=this._collection.getComponentObb(t.objectHandle).clone()),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);null!=this._labeler&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,!0),this._updateMaterial(t),this._setNewNodeOpacity(t),this.elevationInfo.mode!==ye.Absolute&&this._ensureElevationTask().schedule(s),this._updateEngineObject(t),this._highlights.objectCreated(t),null!=this._treeDebugger&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,(()=>this._addCachedNodeData(e,t,s)))}async deleteCachedNodeData(e){if(this._idbCacheEnabled)return this._idbCache.remove(this._getCacheKey(e))}async _addCachedNodeData(e,t,i){if(!this.contentVisible||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(null==t)return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:o,globalTrafo:a}=t;await this.i3sOverrides.applyAttributeOverrides(r.featureIds,s.attributeInfo,i,this._controller.requiredAttributes);const n=null!=t.textureData?t.textureData.filter((e=>null!=e&&!!(e.usage&this.rendererTextureUsage))):[];!has("disable-feature:i3s-basis")&&n.some((e=>null!=e&&(e.encoding===Re.Basis||e.encoding===Re.KTX2)))&&await Ct(),e.memory=0;const{componentOffsets:l,geometries:d,featureIds:h,anchorIds:c,anchors:u}=r,_=this._collection,m=d[0],{layout:g,indices:p,interleavedVertexData:f,positionData:b,hasColors:O}=o,{material:w,geometryParameters:j}=this._materialParameters(m,g),T=l||new Uint32Array([0,p?p.length:f.byteLength/g[0].stride]),A={vertices:{data:f,count:f.byteLength/g[0].stride,layoutParameters:j},positionData:{positions:Y(b.data),indices:J(b.indices)},indices:p,componentOffsets:T},D=m.transformation?x(m.transformation):E();M(D,a,D);const N=C(F(),D),V=y(I(),D),H=this.view.renderSpatialReference,U=this.view.basemapTerrain.spatialReference,L=gt.fromData(t.geometryObbData).center,k=[1,1,1];G(L,H,k,U)||wt().errorOnce("Unsupported coordinate system for IM overlay");const B=F();q(L,H,B,U);const K=I();v(K,V);const W=F();R(W,S(W,L,N),K);const z=B[0]-W[0]*k[0],$=B[1]-W[1]*k[1],Q=_.createObject(new bt(P(z,$,k[0],k[1]),new It(N,V),gt.fromData(t.geometryObbData),A)),X=j.textureCoordinates===Mt.Atlas,{textures:Z,texturePromise:ee}=this._initMaterialAndTextures(Q,w,n,X);e.memory+=this._memEstimateGeometryAdded(Q),e.memory+=Z.reduce(((e,t)=>e+(null!=t?this._memEstimateTextureAdded(t):0)),0);const te=!!w.hasParametersFromSource,ie="blend"!==w.alphaMode&&w.metallicRoughness.baseColorFactor[3]>=1,se=new Rt(e,h,Q,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:te,isOpaque:ie},Z,c,u);s.meta=se,!this._hasTextures&&t.requiredTextures?.some((({usage:e})=>!!(e&je.ColorTextures)))&&(this._hasTextures=!0),this._hasData=!0,this._hasColors=this._hasColors||O,this._hasTextures=this._hasTextures||!!e.resources.texture,this.notifyChange("hasTexturesOrVertexColors");const re=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(se),ee]).then((([t,s])=>(this._addTasks.has(e.index)&&t?.updateObjectVisibility(se.objectHandle,!1).catch((e=>Nt(e,this.i3slayer.title))),this._safeReschedule((()=>{const i=this._addTasks.get(e.index);if(!i)return;if(this._addNodeMeta(e.index,se),i.meta=null,!this.contentVisible)return void this._removeNodeStageData(e.index,this.elevationOffset);_.setObjectVisibility(Q,!0),t?.updateObjectVisibility(se.objectHandle,!0).catch((e=>Nt(e,this.i3slayer.title))),se.attributeInfo=i.attributeInfo;const s=se.cachedRendererVersion!==this._rendererVersion,r=re!==this.slicePlaneEnabled;this._updateElevationOffsets(se);const o=se.elevationOffsets;this._updateComponentData(se);const a=this._applyFiltersToNode(se);(s||null!=t&&(r||a||o))&&this._addOrUpdateEdgeRendering(se),null!=this._labeler&&this._addMetaToLabeler(this._labeler,se),this._visibleGeometryChanged(se,Ft.ADD),this._highlights.objectCreated(se),this._updateMaterial(se),this._setNewNodeOpacity(se),null!=this._treeDebugger&&this._treeDebugger.update()}),i)))).catch((e=>{const{meta:t,allowMemCache:i}=s;throw s.meta=null,t&&i?this._cacheGPUData(t):t&&this._deleteComponentObject(t),e}))}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){wt().error("Removing duplicated node");const t=this._nodeId2Meta.get(e);null!=t&&this._deleteComponentObject(t)}else this._controller.updateLoadStatus(e,!0);null!=t&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Xt(t.cachedEdgeMaterials,0)),this._nodeId2Meta.set(e,t),this.notifyChange("elevationRange")}_updateElevationOffsets(e){const t=this.view.renderSpatialReference,i=this._controller.crsIndex,s=this.elevationInfo,r=this.view.basemapTerrain,o=r.spatialReference,a=s.mode;if(null==t||null==o||a===ye.Absolute)return void(e.elevationOffsets=null);const n=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];const l=Jt,d=Zt,h=a===ye.OnTheGround,c=this.view.renderCoordsHelper,u=e.featureIds.length,_=(()=>{if(e.cachedElevationAnchors)return e.cachedElevationAnchors;const s=X(3*u);e.cachedElevationAnchors=s;for(let r=0;r<u;r++){const a=3*r,h=e.anchorIds?.indexOf(r)??-1;e.anchors&&h>=0?(w(l,e.anchors[3*h],e.anchors[3*h+1],e.anchors[3*h+2]),T(l,l,Z(e.node.serviceMbsInIndexSR)),q(l,i,l,o),s[a]=l[0],s[a+1]=l[1],s[a+2]=c.getAltitude(l)):(this._collection.getComponentAabb(e.objectHandle,r,d,!0),w(l,(d[0]+d[3])/2,(d[1]+d[4])/2,d[2]),R(l,l,n.rotationScale),T(l,l,n.position),s[a+2]=c.getAltitude(l),q(l,t,l,o),s[a]=l[0],s[a+1]=l[1])}return s})(),m=s.offset,g=e.elevationOffsets,p=(e,t)=>{const i=h?_[3*e+2]:0;g[e]=m+(t??0)-i};r.getElevations(_,u,p)}_ensureElevationTask(){return null!=this._elevationTask||(this._elevationTask=new Te(this.view.resourceController.scheduler,(e=>this._controller.updateElevationChanged(e,this.view.basemapTerrain.spatialReference)?.filterInPlace((e=>null!=this._nodeId2Meta.get(e)))),(e=>this._nodeElevationAlignmentChanged(this._nodeId2Meta.get(e))),(()=>this.elevationInfo?.mode))),this._elevationTask}_elevationInfoChanged(e,t){const i=e.mode!==ye.Absolute,s=!!t&&t!==e&&t.mode!==ye.Absolute;this._intersectionHandler.updateElevationAlignState(i,this.view.state.viewingMode),i&&!s&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach((e=>this._nodeElevationAlignmentChanged(e)))}_nodeElevationAlignmentChanged(e){null!=e&&(this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),null!=this._labeler&&this._labeler.updateLabelPositions(e),this._updateSnappingSources(e,Ft.UPDATE),this._elevationProvider.objectChanged(this._collection.getComponentObb(e.objectHandle)))}_safeReschedule(e,t){return c(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=null!=e.params.material?e.params.material:He(),s=t.some((e=>"uvRegion"===e.name)),r=t.some((e=>"normalCompressed"===e.name)),o=Bt(i);return{geometryParameters:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s){const r=this._stage.renderView,o=i.map((e=>Ue(e,t,s,r)));this._stage.addMany(o);let a=null;return this._collection.updateMaterial(e,(e=>{a=Ge(e,t,o,i,this.view._stage.renderView.textures,{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 new vt(this._hasVertexColors,e.hasTexture?e.hasRegions?Mt.Atlas:Mt.Default:Mt.None,e.hasNormals,this._shadeNormals,this._applySSAO)}_addData(e,t,i){let s=this._addTasks.get(e.index);if(s)s.attributeInfo=t;else{const r=u();s=new Qt(t,null,r.promise),this._addTasks.set(e.index,s),i().then(r.resolve,r.reject).then((()=>this._addTasks.delete(e.index))).catch((t=>{throw this._addTasks.delete(e.index),t}))}return s.promise}_clearAddTasks(){this._addTasks.forEach((e=>{null!=e.meta&&(this._cacheGPUData(e.meta),e.meta=null)})),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=$();this._renderClippingArea=mt(this.view.clippingArea,i,e)?i:null;const s=$();this._layerClippingArea=mt(this.view.clippingArea,s,t)?s:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}get hasGeometryFilter(){return!1}_geometryFilterChange(){const e=this.hasGeometryFilter;this._controller.geometryFilterChanged(e),this._applyFilters(e)}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach((e=>{null!=e&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,Ft.UPDATE))}))}getFilters(){const e=[],t=this._renderClippingArea;return null!=t&&e.push(((e,i)=>this._boundingRectFilter(e,i,t))),e}addSqlFilter(e,t,i){if(null!=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=t.attributeInfo?.attributeData;s.every((e=>e===n||null!=d?.[e]))&&Xe(e,l,(e=>{o[n]=l[e];for(const i of s)i!==n&&(o[i]=d?Ye(d[i],e):null);try{return i.testFeature(a)}catch(t){return r(t),!1}}))}_boundingRectNodeTest(e,t){return L(e.node.serviceMbsInIndexSR,this._controller.crsIndex,kt,this.view.renderSpatialReference),Je(t,kt)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,Vt),z(Vt,Pt),Q(i,Pt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(r===Ze.INSIDE)return;if(r===Ze.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);Xe(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}async _addOrUpdateEdgeRendering(e,t=!0){const i=e.objectHandle,{hasEdges:s,perFeatureEdgeMaterials:r}=this._getFilteredEdgeMaterials(e);s&&!this._edgeView&&(this._edgeView=await this._stage.renderer.loadEdgeView());const o=this._edgeView;if(!o)return null;const a=o.hasObject(i);if(s){if(a){if(this.nodeCrossfadingEnabled){Xt(r,this.getNodeOpacity(e))}return o.updateAllComponentMaterials(i,r,this.slicePlaneEnabled,t).catch((e=>Nt(e,this.i3slayer.title))),o.updateObjectVisibility(i,!0).catch((e=>Nt(e,this.i3slayer.title))),o.updateAllVerticalOffsets(i,e.elevationOffsets).catch((e=>Nt(e,this.i3slayer.title))),o}const s=await this._collection.addEdges(i,o,r,this.slicePlaneEnabled,e.elevationOffsets);return e.edgeMemoryUsage=s,e.node.memory+=s,o}return a&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,o.removeObject(i)),null}_applyFiltersToNode(e){return!!this._applyFiltersToNodeComponents(e)&&(null!=this._labeler&&this._labeler.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,i=t.getComponentCount(e.objectHandle),s=null!=e.filteredIds,r=0===i.invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!r;if(this._updateCachedFilteredIds(e),s&&e.filteredIds===e.featureIds)return!r;const o=this._computeFilteredComponentIndices(e);return t.setAllComponentVisibilities(e.objectHandle,o),!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,i=e.filteredIds;return null!=i&&e.featureIds.forEach(((e,s)=>{i[t.length]===e&&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))),this._elevationTask=n(this._elevationTask)}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),null!=this._elevationTask&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,i=this._nodeId2Meta){i.has(e)&&this._controller.updateLoadStatus(e,!1);const s=i.get(e);null!=s?(this._collection.setObjectVisibility(s.objectHandle,!1),null!=this._edgeView&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1).catch((e=>Nt(e,this.i3slayer.title))),this._visibleGeometryChanged(s,Ft.REMOVE),null!=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),null!=this._treeDebugger&&this._treeDebugger.update()):i.delete(e)}_deleteComponentObject(e){if(null!=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);null!=i&&this._collection.updateMaterial(i.objectHandle,(e=>e.polygonOffsetEnabled=t===ke.Hole))}updateNodeIndex(e,t){if(this._nodeId2Meta.has(e)){const i=this._nodeId2Meta.get(e);this._nodeId2Meta.delete(e),this._nodeId2Meta.set(t,i),this.notifyChange("elevationRange")}const i=this._nodeId2MetaReloading.get(e);i&&(this._nodeId2MetaReloading.delete(e),this._nodeId2MetaReloading.set(t,i))}_invalidateAllSymbols(){this._rendererVersion=et(this._rendererVersion,1),this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return et(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=et(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 de()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:wt().warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.symbols)"mesh-3d"!==t.type&&wt().error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getComponentParameters(e){this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(i,s)=>{const r=5*i;V(s.externalColor,t[r]/255,t[r+1]/255,t[r+2]/255,t[r+3]/255);const o=this._stage.renderView.olidRenderHelper;if(o){const t=e.featureIds[i],r=he(this.view.map,this.layerUid);o.setUidToObjectAndLayerId(t,t,this.layerId,this.layerUid+"_"+this.sublayerId,this.layerPopupEnabledAndHasTemplate&&!r,e.node.resources.attributes,i,this.sublayerId),s.objectAndLayerIdColor=this._stage.renderView.getObjectAndLayerIdColor({graphicUid:t,layerUid:this.layerUid+"_"+this.sublayerId})}s.externalColorMixMode=t[r+4]&(1<<St.CastShadows)-1,s.castShadows=!!(t[r+4]&1<<St.CastShadows),s.pickable=!!(t[r+4]&1<<St.Pickable),s.elevationOffset=e.elevationOffsets?.[i]??0}}_getSymbolInfo(e,t){const i=e?.getSymbol(t,{arcade:this._arcade});if(!(i instanceof _e))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=tt(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=null!=this._symbologyOverrideFields&&this._symbologyOverrideFields.length>0?null!=this._rendererFields&&this._rendererFields.length>0?oe(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=e.attributeInfo?.attributeData,o=null!=e.featureIds?this.i3slayer.objectIdField:null,a=null!=r&&null!=this._symbologyFields&&this._symbologyFields.length>0;let n=null,l=null;if(a&&null!=this._symbologyFields){n=[],l=[];for(const e of this._symbologyFields){const t=r[e];t&&(n.push(e),l.push(t))}}e.cachedSymbology||(e.cachedSymbology=ie(5*e.featureIds.length));const d={color:Gt,castShadows:!0,pickable:!0,colorMixMode:ct.Multiply,edgeMaterial:null},h=this.fullOpacity,c=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):h;let u=null,_=xt.OPAQUE,m=it,g=0;for(let p=0;p<e.featureIds.length;p++){if(null!=o&&(i[o]=e.featureIds[p]),a&&n)for(let e=0;e<n.length;e++)i[n[e]]=Ye(l[e],p);const r=s?this._getSymbolInfo(s,t):null;let h=null,f=null;if(s&&"visualVariables"in s){if(this._colorVariable){const e=ne(this._colorVariable,t,{color:Lt,arcade:this._arcade});e&&(h=Gt,h[0]=e.r/255,h[1]=e.g/255,h[2]=e.b/255,this._opacityVariable||null===e.a||(f=e.a))}this._opacityVariable&&(f=le(this._opacityVariable,t,{arcade:this._arcade}))}if(r?.material){const e=r.material;h=null==h||null==f?Oe(h,f,e.color,e.alpha,jt,Gt):Oe(h,f,null,null,jt,Gt)}if(null==h&&(h=Gt,h[0]=1,h[1]=1,h[2]=1,h[3]=1),d.pickable=!0,d.castShadows=!r||r.castShadows,d.colorMixMode=r?.material?r.material.colorMixMode:ct.Multiply,d.edgeMaterial=r?r.edgeMaterial:null,null!=this._symbologyOverride&&(d.color=h,this._symbologyOverride(t,d),h=d.color),null!=this._nodeColorOverride&&(this._nodeColorOverride(e.node,h),d.colorMixMode=ct.Replace),null!=d.edgeMaterial){const t=h[3]>=1&&(e.material.isOpaque||d.colorMixMode===ct.Replace)?xt.OPAQUE:xt.TRANSPARENT;d.edgeMaterial===u&&t===_||(m={...d.edgeMaterial,opacity:c,objectTransparency:t},u=d.edgeMaterial,_=t),e.cachedEdgeMaterials[p]=m}else e.cachedEdgeMaterials[p]=it;e.cachedSymbology[g++]=Math.round(255*h[0]),e.cachedSymbology[g++]=Math.round(255*h[1]),e.cachedSymbology[g++]=Math.round(255*h[2]),e.cachedSymbology[g++]=Math.round(255*h[3]),e.cachedSymbology[g++]=d.colorMixMode|+d.castShadows<<St.CastShadows|+d.pickable<<St.Pickable}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);this.nodeCrossfadingEnabled||Xt(t,this.fullOpacity);const i=e.filteredIds;if(null==i){return{hasEdges:t.some((e=>e!==it)),perFeatureEdgeMaterials:t}}let s=0,r=!1;const o=t.map(((t,o)=>e.featureIds[o]!==i[s]?it:(r=r||t!==it,s++,t)));return{hasEdges:r,perFeatureEdgeMaterials:o}}_updateComponentData(e){if(!this._hasComponentData)return;const t=e.objectHandle,i=this._getComponentParameters(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=>{null!=t&&(this._collection.updateMaterial(t.objectHandle,(t=>t.objectOpacity=e)),Xt(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))}))}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,(e=>{e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.usePBR=this._usePBR,this._updateMaterialOverlay(e)}))}_updateMaterialOverlay(e){}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,Ft.UPDATE)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),null!=this._labeler&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach((t=>{null!=t&&(this._collection.updateMaterial(t.objectHandle,(t=>t.commonMaterialParameters.hasSlicePlane=e)),this._updateEdgeRendering(t,!1))}))}_updatePBR(e){this._nodeId2Meta.forEach((t=>{null!=t&&this._collection.updateMaterial(t.objectHandle,(t=>t.usePBR=e))})),this._hasLoadedPBRTextures=!0}get _usePBR(){return this._shadeNormals&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){null!=this._edgeView&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_ignoreClientNodeOverriddenFeatures(e){return this.i3sOverrides.hasGeometryChanges?(t,i,s)=>s.node.index>=0&&this.i3sOverrides.featureHasGeometryChanges(t)?ve.CONTINUE:e(t,i,s):e}_forAllFeatures(e,t,i){for(const s of this._nodeId2Meta.values()){if(null==s)continue;if(null!=t){switch(t(s)){case ve.EXIT:return;case ve.SKIP:continue}}let r=ve.CONTINUE;switch(i){case Ie.ALL:r=this._forAllFeaturesOfNode(s,e);break;case Ie.VISIBLE_ONLY:r=this._forAllVisibleFeaturesOfNode(s,e);break;case Ie.QUERYABLE:r=this._forAllQueryableFeaturesOfNode(s,e)}if(r===ve.EXIT)return}}_forAllFeaturesOfNode(e,t){let i=ve.CONTINUE;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),i===ve.EXIT)return i;return i}_forAllVisibleFeaturesOfNode(e,t){let i=ve.CONTINUE;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,(r=>(i=t(s[r],r,e),i===ve.CONTINUE))),i}_forAllQueryableFeaturesOfNode(e,t){const i=this._ignoreClientNodeOverriddenFeatures(t);if(null==this._renderClippingArea)return this._forAllFeaturesOfNode(e,i);const s=this._boundingRectNodeTest(e,this._renderClippingArea);if(s===Ze.OUTSIDE)return ve.CONTINUE;if(s===Ze.INSIDE)return this._forAllFeaturesOfNode(e,i);const r=ve.CONTINUE,o=e.featureIds,a=e.objectHandle,n=st(this._renderClippingArea,this._collection.getObjectTransform(a));for(let l=0;l<o.length;l++){if(!this._boundingRectFeatureTest(e,l,n))continue;const t=i(o[l],l,e);if(t===ve.EXIT)return t}return r}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=t.attributeInfo?.attributeData;if(null!=s)for(const r of Object.keys(s))i[r]=Ye(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e,t){if(ue(e))return lt;const s=dt(e);if(0===s.length)return lt;const r=t?.name??Et,o=s[0]instanceof i?this._featureIdsFromGraphics(s):"number"==typeof s[0]?s:null;if(!o)return lt;const{set:a,handle:n}=this._highlights.acquireSet(r);return this._highlights.setFeatureIds(a,o),n}_featureIdsFromGraphics(e){const t=this.i3slayer.fieldsIndex,i=this._getObjectIdField();return e.map((e=>nt(t,e.attributes,i)))}resetHighlights(){n(this._highlights),this._highlights=new Se({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,Ie.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)})}_visibleGeometryChanged(e,t){this._elevationProvider&&(null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=g((()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null}))),this._updateSnappingSources(e,t),this._elevationProvider.objectChanged(this._collection.getComponentObb(e.objectHandle)))}get performanceInfo(){return new pe(this.usedMemory,this._nodeId2Meta.size,Math.round(this._gpuMemoryEstimate/1048576),Math.round(this._geoMemoryEstimate/1048576),Math.round(this._texMemoryEstimate/1048576),Math.round(this.unloadedMemory/1048576),this._idbCacheEnabled?Math.round(100*this._idbCache.getHitRate()):0)}get test(){}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return null!=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(e)}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);null!=s&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);null!=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(null==this._edgeView||!e.cachedEdgeMaterials)return;Xt(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t).catch((e=>Nt(e,this.i3slayer.title)))}get hasModifications(){return this._isIntegratedMesh&&null!=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.uid,s=$t(e);if(s){const t={context:i,buffer:s.buffer};xe(t);const r=new Float64Array(s.buffer);e.forAll(((e,t)=>{const i=r[t],s=Ee(i);e.imModificationImpact=s,s!==Le.Unmodified&&this._controller.invalidateGeometryVisibility(e.index)}))}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||null!=this._labeler&&this._labeler.updating||this._crossfadeHelper?.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||null!=this._elevationTask&&this._elevationTask.running}trackSnappingSources(e){const t={events:e,fetchEdgeLocations:async(e,t,i)=>{const s=this._nodeId2Meta.get(e);if(null==s)throw new Error("invalid-node");const{origin:r,buffer:o}=await this._collection.extractEdgeInformation(s.objectHandle,t,i);return this._snappingLocationsApplyElevation(s,o,r),{type:"components",objectIds:s.featureIds,locations:o,origin:r}},remove:()=>r(this._snappingSourcesTrackers,t)};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach(((t,i)=>{if(null==t)return;const s=this._controller.getRenderMbs(t.node);s&&e.add(i,s)})),t}_snappingLocationsApplyElevation(e,t,i){if(!e.elevationOffsets||this.elevationInfo.mode===ye.Absolute)return;const s=t.position0,r=t.position1,o=t.componentIndex,a=F(),n=F(),l=(e,t)=>{T(e,e,i),this.view.renderCoordsHelper.worldUpAtPosition(e,n),T(e,e,A(n,n,t)),D(e,e,i)};for(let d=0;d<s.count;d++){const t=e.elevationOffsets[o.get(d)];s.getVec(d,a),l(a,t),s.setVec(d,a),r.getVec(d,a),l(a,t),r.setVec(d,a)}}_updateSnappingSources(e,t){const{index:i}=e.node,s=this._controller.getRenderMbs(e.node);if(null!=s)for(const r of this._snappingSourcesTrackers)t!==Ft.REMOVE&&t!==Ft.UPDATE||r.events.remove(i),t!==Ft.ADD&&t!==Ft.UPDATE||r.events.add(i,s)}};return e([f()],o.prototype,"_hasLoadedPBRTextures",void 0),e([f()],o.prototype,"_asyncModuleLoading",void 0),e([f()],o.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([f()],o.prototype,"view",void 0),e([f()],o.prototype,"i3slayer",void 0),e([f()],o.prototype,"_controller",void 0),e([f()],o.prototype,"_labeler",void 0),e([f()],o.prototype,"updating",void 0),e([f()],o.prototype,"suspended",void 0),e([f()],o.prototype,"contentVisible",null),e([f({readOnly:!0})],o.prototype,"legendEnabled",null),e([f()],o.prototype,"holeFilling",void 0),e([f(pt)],o.prototype,"updatingProgress",void 0),e([f()],o.prototype,"updatingProgressValue",null),e([f()],o.prototype,"hasTexturesOrVertexColors",null),e([f()],o.prototype,"rendererTextureUsage",null),e([f()],o.prototype,"elevationOffset",null),e([f()],o.prototype,"elevationInfo",null),e([f({type:Boolean})],o.prototype,"slicePlaneEnabled",void 0),e([f()],o.prototype,"supportedTextureEncodings",null),e([f()],o.prototype,"uncompressedTextureDownsamplingEnabled",null),e([f({type:[ae]})],o.prototype,"_modifications",void 0),e([f({readOnly:!0})],o.prototype,"clientGeometry",null),e([f()],o.prototype,"elevationRange",null),e([f()],o.prototype,"fullExtent",null),e([f()],o.prototype,"_elevationTask",void 0),e([f({readOnly:!0})],o.prototype,"_usePBR",null),o=e([b(Ot)],o),o};function Nt(e,t){h(e)||wt().warn("Error while processing edges. Edges on this layer might not display correctly",t,e)}var Ft;!function(e){e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.UPDATE=2]="UPDATE"}(Ft||(Ft={}));const Vt=K(),Pt=$(),Ht=$(),Ut=new gt,Gt=[0,0,0,0],Lt=new t([0,0,0,0]),kt=ee(0,0,0,0);function Bt(e){if(null==e)return!1;const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function qt(e){return"geometryData"in e}function Kt(e){return null!=e&&p(e.data)}function Wt(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(null!=t)for(const s of t)null!=s&&p(s.data)&&(i+=s.data.byteLength);return i}function zt(e,t){return t.byteSize>At?(wt().warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}function $t(e){if(0===e.length)return;const t=10*e.length,i=new Float64Array(t);let s=0;return e.forAll((e=>{let t=e.serviceObbInIndexSR;null==t&&(t=Ut,t.center=Z(e.serviceMbsInIndexSR),t.halfSize=[e.serviceMbsInIndexSR[3],e.serviceMbsInIndexSR[3],e.serviceMbsInIndexSR[3]]);const r=t.data;i[s++]=r[0],i[s++]=r[1],i[s++]=r[2],i[s++]=r[3],i[s++]=r[4],i[s++]=r[5],i[s++]=r[6],i[s++]=r[7],i[s++]=r[8],i[s++]=r[9]})),i}class Qt{constructor(e,t,i){this.attributeInfo=e,this.meta=t,this.promise=i,this.allowMemCache=!0}}function Xt(e,t){e.forEach((e=>e.opacity=t))}class Yt{constructor(e,t){this.mode=e,this.offset=t}}const Jt=F(),Zt=K(),ei="elevation-change",ti="",ii="@null",si="@ECEF",ri=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],oi=new _t;function ai(e,t,i){let s=e.elevationRangeMin,r=e.elevationRangeMax;const o=i;if(o>0){t.getCorners(ri);for(const e of ri){const t=N(e)-o;s=Math.min(s,t),r=Math.max(r,t)}}else{t.getCorners(ri);for(const e of ri){const t=e[2];s=Math.min(s,t),r=Math.max(r,t)}}e.expandElevationRangeValues(s,r)}function ni(e,t,i){const s=Z(t),r=i>0?N(s)-i:s[2],o=te(t);e.expandElevationRangeValues(r-o,r+o)}export{Dt as I3SMeshView3D};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{isSome as s,removeUnordered as r}from"../../../core/arrayUtils.js";import{ByteSizeUnit as o}from"../../../core/ByteSizeUnit.js";import has from"../../../core/has.js";import a from"../../../core/Logger.js";import{destroyMaybe as n}from"../../../core/maybe.js";import l from"../../../core/PooledArray.js";import{ignoreAbortErrors as d,isAbortError as h,throwIfAborted as c,createResolver as u}from"../../../core/promiseUtils.js";import{initial as _,watch as g}from"../../../core/reactiveUtils.js";import{schedule as m}from"../../../core/scheduling.js";import{isArrayBuffer as p}from"../../../core/typedArrayUtil.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as y,invert as v}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as I}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{multiply as M,getTranslation as C}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{clone as x,create as O}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as E}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{i as w,t as j,q as R,a as S,g as A,h as T,d as D,H as N}from"../../../chunks/vec32.js";import{create as F}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as V}from"../../../chunks/vec42.js";import{fromValues as P}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as H}from"../../../core/support/UpdatingHandles.js";import{getSphericalPCPF as U}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{localLinearScaleFactors as G}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectBoundingSphere as L}from"../../../geometry/projection/projectBoundingSphere.js";import{projectBuffer as k}from"../../../geometry/projection/projectBuffer.js";import{getProjectorName as B}from"../../../geometry/projection/projectors.js";import{projectVectorToVector as q}from"../../../geometry/projection/projectVectorToVector.js";import{create as K,fromBuffer as W,toRect as z}from"../../../geometry/support/aaBoundingBox.js";import{create as $,intersects as Q}from"../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as X}from"../../../geometry/support/DoubleArray.js";import{compactFloatArray as Y}from"../../../geometry/support/FloatArray.js";import{compactIndices as J}from"../../../geometry/support/Indices.js";import{a as Z,f as ee,g as te}from"../../../chunks/sphere.js";import{newUByteArray as ie}from"../../../geometry/support/UByteArray.js";import{fallbackObjectIDAttribute as se}from"../../../layers/LayerConstants.js";import re from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as oe}from"../../../layers/support/fieldUtils.js";import ae from"../../../layers/support/SceneModification.js";import{getColor as ne,getOpacity as le}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{loadArcade as de}from"../../../support/arcadeOnDemand.js";import{isBasemapLayer as he}from"../../../support/basemapUtils.js";import{getElevationOffset as ce}from"../../../support/elevationInfoUtils.js";import{isQuery as ue}from"../../../support/guards.js";import _e from"../../../symbols/MeshSymbol3D.js";import ge from"../../../symbols/SimpleFillSymbol.js";import me from"./I3SMeshViewLabeler.js";import{I3SMeshViewPerformanceInfo as pe}from"./I3SMeshViewPerformanceInfo.js";import{I3SMeshWorkerHandle as fe,toWasmModification as be}from"./I3SMeshWorkerHandle.js";import{ElevationMode as ye,ForAllFeaturesReturnType as ve,ForAllFeaturesMode as Ie}from"./II3SMeshView3D.js";import{initialize as Me,setModificationsSync as Ce,filterObbsForModificationsSync as xe,interpretObbModificationResults as Oe}from"./SceneLayerWorker.js";import{overrideColor as Ee}from"./graphics/graphicUtils.js";import{areLabelsVisible as we}from"./graphics/Labeler.js";import{TextureUsage as je,TextureEncoding as Re}from"./i3s/enums.js";import Se from"./i3s/Highlights.js";import{I3SAsyncElevationUpdater as Ae}from"./i3s/I3SAsyncElevationUpdater.js";import{I3SCrossfadeHelper as Te,NodeCrossfadeMetaData as De}from"./i3s/I3SCrossfadeHelper.js";import{boundingBoxCornerPoints as Ne}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as Fe}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as Ve,selectEncoding as Pe,defaultMaterial as He,createTexture as Ue,configureMaterial as Ge}from"./i3s/I3SMaterialUtil.js";import{NodeIMModificationImpact as Le,NodeState as ke}from"./i3s/I3SNode.js";import{I3SOverrides as Be}from"./i3s/I3SOverrides.js";import{computeGlobalTransformation as qe}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Ke,checkSceneLayerValid as We,checkSceneLayerCompatibleWithView as ze,whenGraphicAttributes as $e,computeVisibilityObb as Qe,filterInPlace as Xe,getCachedAttributeValue as Ye,intersectBoundingRectWithMbs as Je,MbsIntersectResult as Ze,addWraparound as et,getSymbolInfo as tt,transparentEdgeMaterial as it,getClipRect as st}from"./i3s/I3SUtil.js";import{IDBCache as rt}from"./i3s/IDBCache.js";import{IDBMockCache as ot}from"./i3s/IDBMockCache.js";import{LayerElevationProvider as at}from"./i3s/LayerElevationProvider.js";import{attributeLookup as nt}from"./support/attributeUtils.js";import{emptyHighlightHandle as lt,normalizeHighlightTargetExceptQuery as dt}from"./support/highlightUtils.js";import{makeScheduleFunction as ht}from"./support/makeScheduleFunction.js";import{ColorMixModeEnum as ct}from"./support/symbolColorUtils.js";import{debugFlags as ut}from"../support/debugFlags.js";import{ElevationRange as _t}from"../support/ElevationRange.js";import{toBoundingRect as gt}from"../support/extentUtils.js";import{Obb as mt}from"../support/orientedBoundingBox.js";import{updatingProgress as pt}from"../support/updatingProperties.js";import{glLayout as ft}from"../support/buffer/glUtil.js";import{ObjectParameters as bt}from"../webgl-engine/collections/Component/ObjectParameters.js";import{createVertexBufferLayout as yt,GeometryParameters as vt}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as It}from"../webgl-engine/collections/Component/Transform.js";import{TextureCoordinateType as Mt}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{loadBasisTranscoder as Ct}from"../webgl-engine/lib/BasisUtil.js";import{Transparency as xt}from"../webgl-engine/lib/edgeRendering/interfaces.js";import{defaultHighlightName as Ot}from"../../support/HighlightDefaults.js";const Et="esri.views.3d.layers.I3SMeshView3D",wt=()=>a.getLogger(Et),jt=[1,1,1,1];class Rt extends De{constructor(e,t,i,s,r,o,a,n,l){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=a,this.anchorIds=n,this.anchors=l,this.cachedElevationAnchors=null,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0}get cachedMemory(){return this.node.memory}get featureExtents(){return this._featureExtents??=new Float64Array(6*this.featureIds.length).fill(Number.POSITIVE_INFINITY),this._featureExtents}}var St;!function(e){e[e.CastShadows=4]="CastShadows",e[e.Pickable=5]="Pickable"}(St||(St={}));const At=26,Tt=100*o.MEGABYTES,Dt=t=>{let o=class extends t{constructor(){super(...arguments),this._applySSAO=!0,this._shadeNormals=!0,this._updatingHandles=new H,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._currentRenderer=null,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._visibleGeometryChangedSchedulerHandle=null,this._hasComponentData=!1,this._hasVertexColors=!1,this._nodeColorOverride=null,this.updating=!0,this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.slicePlaneEnabled=!1,this._modifications=new Array,this.ignoresMemoryFactor=!1,this._layerUrl="",this._cacheKeySuffix=null,this._planetRadiusInGlobalMode=0,this._elevationTask=null,this._filters=[],this._arcade=null,this._tmpAttributeOnlyGraphic=new i,this._crossfadeHelper=new Te(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 layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get contentVisible(){return!this.suspended&&this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Ke(this._currentRenderer)?this._usePBR||this._hasLoadedPBRTextures?je.AllTexturesPBR:je.AllTextures:this._usePBR||this._hasLoadedPBRTextures?je.GeometryTexturesPBR:je.GeometryTextures}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;return null!=e&&"absolute-height"===e.mode?ce(e,this.i3slayer.spatialReference):0}get elevationInfo(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null==e)return new Yt(ye.Absolute,0);const t=ce(e,this.i3slayer.spatialReference);switch(e.mode){case"absolute-height":return new Yt(ye.Absolute,t);case"relative-to-ground":return new Yt(ye.RelativeToGround,t);case"on-the-ground":return new Yt(ye.OnTheGround,0);default:return new Yt(ye.Absolute,0)}}get supportedTextureEncodings(){return Ve(this.view._stage.renderView.capabilities)}get clientGeometry(){return this.i3sOverrides.geometryOverrides}get elevationRange(){const e=this._nodeId2Meta,t=new _t;for(const i of e.values()){if(null==i)continue;const{node:{serviceMbsInIndexSR:e}}=i,[s,r,o,a]=e;t.expandElevationRangeValues(o-a,o+a)}return t.elevationRangeValid?t:null}get fullExtent(){return this.i3slayer.fullExtent}initialize(){const e=has("enable-feature:idb-mock-cache");this._idbCache=e?new ot(this.view,e):new rt("esri-scenelayer-cache","geometries"),this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const t=this.view.resourceController,i=t.memoryController;this.i3sOverrides=new Be({view:this.view,layer:this.i3slayer,memoryController:i}),this._worker=new fe(ht(t)),this.addResolvingPromise(this._worker.promise);const s=this.i3slayer.store;this.addResolvingPromise(this._worker.setLegacySchema(this.uid,s.defaultGeometrySchema).catch(d)),We(this.i3slayer),ze(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new re({layerView:this,worker:this._worker}),this._gpuMemoryEstimate=0,this._texMemoryEstimate=0,this._geoMemoryEstimate=0,this._stage=this.view._stage,this._collection=this._stage.renderView.componentObjectCollection,this.resetHighlights();const r=s.defaultGeometrySchema;if(this._isIntegratedMesh||!r)this._hasComponentData=!1;else{const e=r.featureAttributes;this._hasComponentData=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=(r?.vertexAttributes.color??null)&&!this.i3slayer.cachedDrawingInfo?.color;const o=this.view.resourceController.memoryController.newCache(`sl-${this.uid}`,(e=>this._deleteComponentObject(e)));this._memCache=o;const a=this._controller,l=this._nodeId2Meta,h=this._nodeId2MetaReloading,c=e=>{const t=a.index;if(!t)return;const i=t.rootNode;if(!i)return;const s=t=>{const i=t.index,s=l.get(i)||h.get(i);return e(t,s?.objectHandle??null)};t.traverse(i,s)};this._intersectionHandler=new Fe({layerUid:this.layerUid,sublayerUid:this.sublayerUid,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:c}),this._updatingHandles.add((()=>this.layerUid),(e=>this._intersectionHandler.layerUid=e)),this._updatingHandles.add((()=>this.sublayerUid),(e=>this._intersectionHandler.sublayerUid=e)),this._elevationProvider=new at({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR,this._updatingHandles.add((()=>this.view.clippingArea),(()=>this._clippingAreaChanged()),_),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.elevationInfo),((e,t)=>this._elevationInfoChanged(e,t)),_),this._updatingHandles.add((()=>!this.suspended&&this.elevationInfo.mode!==ye.Absolute),((e,t)=>{e?this.addHandles(this.view.basemapTerrain.on("elevation-change",(({extent:e})=>this._ensureElevationTask().addExtent(e))),ei):t&&this.removeHandles(ei)}),_),this._updatingHandles.add((()=>this._usePBR),(e=>this._updatePBR(e)));const u=()=>{this._reloadAll(),this.clearMemCache()};this._updatingHandles.add((()=>this.rendererTextureUsage),u),this._updatingHandles.add((()=>this.contentVisible),(e=>this._contentVisibleChanged(e)),_),this._updatingHandles.add((()=>this.i3slayer.labelsVisible),(()=>this._labelingChanged()),_),this._updatingHandles.add((()=>this.i3slayer.labelingInfo),(()=>this._labelingChanged()),_),this._updatingHandles.add((()=>this._modifications),(()=>this._modificationsChanged()),_),this.addHandles([g((()=>ut.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&ut.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||ut.I3S_TREE_SHOW_TILES||(this._treeDebugger=n(this._treeDebugger))}),_),g((()=>ut.I3S_SHOW_MODIFICATIONS),(()=>this._showModifications()),_)]),this._cacheKeySuffix=this._getCacheKeySuffix(),this._idbCache.init().catch((e=>wt().warn(`Failed to initialize IndexedDB cache: ${e}`)));const{view:m}=this,{viewingMode:p,renderCoordsHelper:f}=m;this._planetRadiusInGlobalMode="local"===p?0:f.referenceEllipsoid.radius}destroy(){this._clearAddTasks(),this._elevationTask=n(this._elevationTask),this.i3sOverrides=n(this.i3sOverrides),this._elevationProvider&&(this._elevationProvider.objectsChanged(this.getVisibleObbs()),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._worker;e&&(e.destroyContext(this.uid).then((()=>e.destroy())),this._worker=null),this._removeAllNodeDataFromStage(),this._memCache=n(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=n(this._labeler),this._treeDebugger=n(this._treeDebugger),this._controller=n(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this._crossfadeHelper=n(this._crossfadeHelper),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null),this._updatingHandles=n(this._updatingHandles)}_memEstimateTextureAdded(e){const t=e.usedMemory;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(null!=e){const t=e.usedMemory;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)}get usedMemory(){let e=null!=this._labeler?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach((t=>e+=null!=t?t.node.memory:0)),this._nodeId2MetaReloading.forEach((t=>e+=null!=t?t.node.memory:0)),e}get unloadedMemory(){return(null!=this._controller?this._controller.unloadedMemoryEstimate:0)+(null!=this._labeler?this._labeler.unloadedMemoryEstimate:0)}_labelingChanged(){if(!(we(this.i3slayer)&&this._supportsLabeling))return void(null!=this._labeler&&(this._labeler.destroy(),this._labeler=null));if(null!=this._labeler)return;const e=new me({view:this.view,layer:this.i3slayer,collection:this._collection,overrides:this.i3sOverrides});this._nodeId2Meta.forEach((t=>null!=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=Me().then((()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()})),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=this.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const i=be(this._layerClippingArea,this._modifications,t);Ce({context:e,modifications:i,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const s=this.hasModifications?new l:null;this._nodeId2Meta.forEach(((e,t)=>{null==e?(this._nodeId2Meta.delete(t),this._controller.updateLoadStatus(t,!1)):e.node.hasModifications?(this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):null!=s&&s.push(e.node)})),this.notifyChange("elevationRange"),null!=s&&this._nodeId2MetaReloading.forEach((e=>s.push(e.node))),null!=s&&s.length>0&&(this.updateNodeModificationStatus(s),s.forAll((e=>{if(e.imModificationImpact!==Le.Culled){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),null!=t?(this._nodeId2Meta.delete(e.index),this._nodeId2MetaReloading.set(e.index,t),this.notifyChange("elevationRange")):this._nodeId2Meta.has(e.index)&&(this._nodeId2Meta.delete(e.index),this._controller.updateLoadStatus(e.index,!1))}}))),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(null!=this._modificationGraphics&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!ut.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={outline:{color:[255,255,255],width:1}};this._modificationGraphics=new Array;for(const s of this._modifications){const r=s.geometry;r.spatialReference=this.i3slayer.spatialReference;const o=new ge({...t,color:e[s.type]});this._modificationGraphics.push(new i({geometry:r,symbol:o}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,((e,t)=>this._createAttributes(e,t)))}_contentVisibleChanged(e){e?(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler)):(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);null!=i?.attributeInfo&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);null!=s&&(await this.i3sOverrides.applyAttributeOverrides(s.featureIds,t,i,this._controller.requiredAttributes),s.attributeInfo=t,this._controller.reschedule((()=>this._attributeValuesChanged(s)),i).catch((e=>{h(e)||wt().warn("Error while updating attribute values. Layer might not display correctly.",e)})))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.filteredIds=null,null!=this._labeler&&this._labeler.setNodeMetaAttributes(e,((e,t)=>this._createAttributes(e,t))),this._updateEngineObject(e)}clearMemCache(){null!=this._memCache&&this._memCache.clear(),this._addTasks.forEach((e=>e.allowMemCache=!1))}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach((t=>null!=t&&e.push(t.node))),e}getVisibleObbs(){const e=new Array;return this._nodeId2Meta.forEach((t=>t&&e.push(this._collection.getComponentObb(t.objectHandle)))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach(((t,i)=>e.push(i))),this._nodeId2MetaReloading.forEach(((t,i)=>e.push(i)))}_preLoadBasis(){!has("disable-feature:i3s-basis")&&this.supportedTextureEncodings&Re.Basis&&this.i3slayer.textureSetDefinitions?.some((e=>e.formats.some((e=>"basis"===e.format||"ktx2"===e.format))))&&Ct()}_getVertexBufferLayout(e,t){return ft(yt(this._getGeometryParameters({hasTexture:Bt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion})))}_getObjectIdField(){return this.i3slayer.objectIdField||se}_getGlobalIdField(){return this.i3slayer.associatedLayer?.globalIdField}_findGraphicNodeAndIndex(e){const t=nt(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());for(const i of this._nodeId2Meta.values()){const e=i?.featureIds.indexOf(t);if(null!=e&&e>=0)return{node:i.node,index:e}}return null}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(null==i)return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const a of t){const e=nt(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._getAABB(t.node.index,t.index);return null==i?Promise.reject():Promise.resolve({boundingBox:i,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return null==e.nodeIndex||null==e.componentIndex?null:this._getAABB(e.nodeIndex,e.componentIndex)}_getAABB(e,t){const i=this._nodeId2Meta.get(e);if(null==i?.featureIds||t>=i.featureIds.length)return null;const s=i.objectHandle,r=Ne(t,this._collection,s,X(24),0),o=this.view.renderSpatialReference,a=this.view.spatialReference;return k(r,o,0,r,a,0)?W(r):null}whenGraphicAttributes(e,t){return $e(this.i3slayer,e,this._getObjectIdField(),t,(()=>[...this._nodeId2Meta.values()].filter(s)))}getGraphicFromIntersectorTarget(e){if(null==e.nodeIndex||null==e.componentIndex)return null;const t=this._nodeId2Meta.get(e.nodeIndex);return null==t?.featureIds||e.componentIndex>=t.featureIds.length?null:this._createGraphic(e.componentIndex,t)}_getCacheKey(e){return`${this._layerUrl}/v${At}/${e}${this._cacheKeySuffix}`}_getCacheKeySuffix(){const e=this.view.renderSpatialReference;if(null==e)return ii;if(e===U(e))return si;return this.i3slayer.spatialReference.equals(e)?ti:null!=e.wkid?`@${e.wkid}`:null}_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 null!=this._memCache?this._memCache.pop(this._getMemCacheKey(e)):null}deleteCachedGPUData(e){null!=e&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(null==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,i)}loadMissingTextures(e,t,i,s){const r=e?.filter(((e,i)=>{if(!(e.usage&this.rendererTextureUsage))return!1;if(null==t)return!0;const s=Pe(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(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.id),t).then((s=>null==s?null:s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e.id)),null):(this.elevationInfo.mode===ye.Absolute&&(e.geometryObbInRenderSR=mt.fromData(s.geometryObbData)),this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then((i=>(i&&this._idbCache.initialized&&null!=s.textureData&&(s.byteSize=Wt(s.transformedGeometry,s.textureData),s.textureData.every(Kt)&&zt(e,s)&&this._idbCache.put(this._getCacheKey(e.id),s).catch((t=>wt().warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`)))),c(t),s)))))):Promise.resolve(null)}addNode(e,t,i){return qt(t)?null==t.geometryBuffer?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,(()=>this._transformNode(e,t,i).then((s=>this._safeReschedule((()=>{if(null==s)return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:o,featureIds:a,anchorIds:n,anchors:l,transformedGeometry:d,globalTrafo:h}=s,c=w(Jt,r.center.x,r.center.y,r.center.z);j(c,c,h);const u=new mt(c,[r.extents.x,r.extents.y,r.extents.z],E(r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w));this.elevationInfo.mode===ye.Absolute&&(e.geometryObbInRenderSR=u),t.geometryData.componentOffsets=o,a&&(t.geometryData.featureIds=Array.from(a)),t.geometryData.anchorIds=n,t.geometryData.anchors=l;const _={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:d,globalTrafo:h,geometryObbData:u.data,byteSize:Wt(d,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&zt(e,_)){const t=null!=_.textureData?_.textureData.map((e=>Kt(e)?e:null)):null;this._idbCache.put(this._getCacheKey(e.id),{..._,textureData:t}).catch((t=>wt().warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`)))}return this._addCachedNodeData(e,_,i)}),i))))):Promise.reject()}getElevationRange(e){const t=new _t,i=this._controller,{index:s}=i;if(!s)return t;const{rootNode:r}=s;if(!r)return t;const o=this._nodeId2Meta,a=e[3],n=i.viewportQueries,l=this._planetRadiusInGlobalMode,{view:d}=this,{renderCoordsHelper:h}=d,c=h.referenceEllipsoid.radius,u=this._collection,_=i=>{const{childrenLoaded:s}=i;if(0===s)return!1;const r=n.getAndUpdateVisibilityObbInRenderSR(i);let d=null,_=-1;if(r){if(_=r.radius,!r.intersectSphereWithMBS(e,_))return!1}else d=n.getServiceMbsInRenderSR(i),d&&(_=d[3]);if(_>=0&&a>=1*_)return null!=r?ai(t,r,l):null!=d&&d[3]>=0&&ni(t,d,l),!1;const g=oi;if(g.elevationRangeMin=1/0,g.elevationRangeMax=-1/0,(null!=r||null!=d)&&(null!=r?ai(g,r,l):null!=d&&ni(g,d,l),g.elevationRangeMin>=t.elevationRangeMin&&g.elevationRangeMax<=t.elevationRangeMax))return!1;const m=o.get(i.index);if(m){const{geometryObbInRenderSR:s}=i;if(!s||s.intersectSphereWithMBS(e)){if(s){if(a>0*s.radius)return ai(t,s,l),!1}const{objectHandle:e}=m,i=u.getObjectTransform(e),r=h.getAltitude(i.position);u.expandRangeWithComponentObjectElevationRange(e,r,c,t)}}return s-(m?1:0)>0};return s.traverse(r,_),t}computeVisibilityObb(e){return Qe(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications,this.view.renderCoordsHelper.sphericalPCPF)}_transformNode(e,t,i){const s=t.geometryData.geometries??[],r=new Array(s.length);for(let p=0;p<s.length;++p)r[p]=this._getVertexBufferLayout(s[p],t.geometryDescriptor);const o=this.i3slayer.normalReferenceFrame,a=t.normalReferenceFrame??o??"none",n=e.serviceMbsInIndexSR,l=this.elevationOffset,d=this._controller.crsIndex,h=this._controller.crsVertex,c=this.view.renderSpatialReference,u=qe(n,l,a,d,c),_=B(d,h),g=B(h,c);if(null==_||null==g)return Promise.resolve(null);const m={context:this.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,globalTrafo:u,mbs:n,obbData:e.serviceObbInIndexSR?.data,elevationOffset:l,needNormals:this._controller.isMeshPyramid,normalReferenceFrame:a,indexToVertexProjector:_,vertexToRenderProjector:g};return this._worker.invoke(m,i)}get _supportsNodeCrossFading(){return!this.view?._stage?.renderer.shadowsEnabled}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(this.elevationInfo.mode===ye.Absolute&&(e.geometryObbInRenderSR=this._collection.getComponentObb(t.objectHandle).clone()),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);null!=this._labeler&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,!0),this._updateMaterial(t),this._setNewNodeOpacity(t),this.elevationInfo.mode!==ye.Absolute&&this._ensureElevationTask().schedule(s),this._updateEngineObject(t),this._highlights.objectCreated(t),null!=this._treeDebugger&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,(()=>this._addCachedNodeData(e,t,s)))}async deleteCachedNodeData(e){if(this._idbCacheEnabled)return this._idbCache.remove(this._getCacheKey(e))}async _addCachedNodeData(e,t,i){if(!this.contentVisible||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(null==t)return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:o,globalTrafo:a}=t;await this.i3sOverrides.applyAttributeOverrides(r.featureIds,s.attributeInfo,i,this._controller.requiredAttributes);const n=null!=t.textureData?t.textureData.filter((e=>null!=e&&!!(e.usage&this.rendererTextureUsage))):[];!has("disable-feature:i3s-basis")&&n.some((e=>null!=e&&(e.encoding===Re.Basis||e.encoding===Re.KTX2)))&&await Ct(),e.memory=0;const{componentOffsets:l,geometries:d,featureIds:h,anchorIds:c,anchors:u}=r,_=this._collection,g=d[0],{layout:m,indices:p,interleavedVertexData:f,positionData:b,hasColors:E}=o,{material:w,geometryParameters:j}=this._materialParameters(g,m),A=l||new Uint32Array([0,p?p.length:f.byteLength/m[0].stride]),T={vertices:{data:f,count:f.byteLength/m[0].stride,layoutParameters:j},positionData:{positions:Y(b.data),indices:J(b.indices)},indices:p,componentOffsets:A},D=g.transformation?x(g.transformation):O();M(D,a,D);const N=C(F(),D),V=y(I(),D),H=this.view.renderSpatialReference,U=this.view.basemapTerrain.spatialReference,L=mt.fromData(t.geometryObbData).center,k=[1,1,1];G(L,H,k,U)||wt().errorOnce("Unsupported coordinate system for IM overlay");const B=F();q(L,H,B,U);const K=I();v(K,V);const W=F();R(W,S(W,L,N),K);const z=B[0]-W[0]*k[0],$=B[1]-W[1]*k[1],Q=_.createObject(new bt(P(z,$,k[0],k[1]),new It(N,V),mt.fromData(t.geometryObbData),T)),X=j.textureCoordinates===Mt.Atlas,{textures:Z,texturePromise:ee}=this._initMaterialAndTextures(Q,w,n,X);e.memory+=this._memEstimateGeometryAdded(Q),e.memory+=Z.reduce(((e,t)=>e+(null!=t?this._memEstimateTextureAdded(t):0)),0);const te=!!w.hasParametersFromSource,ie="blend"!==w.alphaMode&&w.metallicRoughness.baseColorFactor[3]>=1,se=new Rt(e,h,Q,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:te,isOpaque:ie},Z,c,u);s.meta=se,!this._hasTextures&&t.requiredTextures?.some((({usage:e})=>!!(e&je.ColorTextures)))&&(this._hasTextures=!0),this._hasData=!0,this._hasColors=this._hasColors||E,this._hasTextures=this._hasTextures||!!e.resources.texture,this.notifyChange("hasTexturesOrVertexColors");const re=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(se),ee]).then((([t,s])=>(this._addTasks.has(e.index)&&t?.updateObjectVisibility(se.objectHandle,!1).catch((e=>Nt(e,this.i3slayer.title))),this._safeReschedule((()=>{const i=this._addTasks.get(e.index);if(!i)return;if(this._addNodeMeta(e.index,se),i.meta=null,!this.contentVisible)return void this._removeNodeStageData(e.index,this.elevationOffset);_.setObjectVisibility(Q,!0),t?.updateObjectVisibility(se.objectHandle,!0).catch((e=>Nt(e,this.i3slayer.title))),se.attributeInfo=i.attributeInfo;const s=se.cachedRendererVersion!==this._rendererVersion,r=re!==this.slicePlaneEnabled;this._updateElevationOffsets(se);const o=se.elevationOffsets;this._updateComponentData(se);const a=this._applyFiltersToNode(se);(s||null!=t&&(r||a||o))&&this._addOrUpdateEdgeRendering(se),null!=this._labeler&&this._addMetaToLabeler(this._labeler,se),this._visibleGeometryChanged(se,Ft.ADD),this._highlights.objectCreated(se),this._updateMaterial(se),this._setNewNodeOpacity(se),null!=this._treeDebugger&&this._treeDebugger.update()}),i)))).catch((e=>{const{meta:t,allowMemCache:i}=s;throw s.meta=null,t&&i?this._cacheGPUData(t):t&&this._deleteComponentObject(t),e}))}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){wt().error("Removing duplicated node");const t=this._nodeId2Meta.get(e);null!=t&&this._deleteComponentObject(t)}else this._controller.updateLoadStatus(e,!0);null!=t&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Xt(t.cachedEdgeMaterials,0)),this._nodeId2Meta.set(e,t),this.notifyChange("elevationRange")}_updateElevationOffsets(e){const t=this.view.renderSpatialReference,i=this._controller.crsIndex,s=this.elevationInfo,r=this.view.basemapTerrain,o=r.spatialReference,a=s.mode;if(null==t||null==o||a===ye.Absolute)return void(e.elevationOffsets=null);const n=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];const l=Jt,d=Zt,h=a===ye.OnTheGround,c=this.view.renderCoordsHelper,u=e.featureIds.length,_=(()=>{if(e.cachedElevationAnchors)return e.cachedElevationAnchors;const s=X(3*u);e.cachedElevationAnchors=s;for(let r=0;r<u;r++){const a=3*r,h=e.anchorIds?.indexOf(r)??-1;e.anchors&&h>=0?(w(l,e.anchors[3*h],e.anchors[3*h+1],e.anchors[3*h+2]),A(l,l,Z(e.node.serviceMbsInIndexSR)),q(l,i,l,o),s[a]=l[0],s[a+1]=l[1],s[a+2]=c.getAltitude(l)):(this._collection.getComponentAabb(e.objectHandle,r,d,!0),w(l,(d[0]+d[3])/2,(d[1]+d[4])/2,d[2]),R(l,l,n.rotationScale),A(l,l,n.position),s[a+2]=c.getAltitude(l),q(l,t,l,o),s[a]=l[0],s[a+1]=l[1])}return s})(),g=s.offset,m=e.elevationOffsets,p=(e,t)=>{const i=h?_[3*e+2]:0;m[e]=g+(t??0)-i};r.getElevations(_,u,p)}_ensureElevationTask(){return null!=this._elevationTask||(this._elevationTask=new Ae(this.view.resourceController.scheduler,(e=>this._controller.updateElevationChanged(e,this.view.basemapTerrain.spatialReference)?.filterInPlace((e=>null!=this._nodeId2Meta.get(e)))),(e=>this._nodeElevationAlignmentChanged(this._nodeId2Meta.get(e))),(()=>this.elevationInfo?.mode))),this._elevationTask}_elevationInfoChanged(e,t){const i=e.mode!==ye.Absolute,s=!!t&&t!==e&&t.mode!==ye.Absolute;this._intersectionHandler.updateElevationAlignState(i,this.view.state.viewingMode),i&&!s&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach((e=>this._nodeElevationAlignmentChanged(e)))}_nodeElevationAlignmentChanged(e){null!=e&&(this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),null!=this._labeler&&this._labeler.updateLabelPositions(e),this._updateSnappingSources(e,Ft.UPDATE),this._elevationProvider.objectChanged(this._collection.getComponentObb(e.objectHandle)))}_safeReschedule(e,t){return c(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=null!=e.params.material?e.params.material:He(),s=t.some((e=>"uvRegion"===e.name)),r=t.some((e=>"normalCompressed"===e.name)),o=Bt(i);return{geometryParameters:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s){const r=this._stage.renderView,o=i.map((e=>Ue(e,t,s,r)));this._stage.addMany(o);let a=null;return this._collection.updateMaterial(e,(e=>{a=Ge(e,t,o,i,this.view._stage.renderView.textures,{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 new vt(this._hasVertexColors,e.hasTexture?e.hasRegions?Mt.Atlas:Mt.Default:Mt.None,e.hasNormals,this._shadeNormals,this._applySSAO)}_addData(e,t,i){let s=this._addTasks.get(e.index);if(s)s.attributeInfo=t;else{const r=u();s=new Qt(t,null,r.promise),this._addTasks.set(e.index,s),i().then(r.resolve,r.reject).then((()=>this._addTasks.delete(e.index))).catch((t=>{throw this._addTasks.delete(e.index),t}))}return s.promise}_clearAddTasks(){this._addTasks.forEach((e=>{null!=e.meta&&(this._cacheGPUData(e.meta),e.meta=null)})),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=$();this._renderClippingArea=gt(this.view.clippingArea,i,e)?i:null;const s=$();this._layerClippingArea=gt(this.view.clippingArea,s,t)?s:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}get hasGeometryFilter(){return!1}_geometryFilterChange(){const e=this.hasGeometryFilter;this._controller.geometryFilterChanged(e),this._applyFilters(e)}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach((e=>{null!=e&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,Ft.UPDATE))}))}getFilters(){const e=[],t=this._renderClippingArea;return null!=t&&e.push(((e,i)=>this._boundingRectFilter(e,i,t))),e}addSqlFilter(e,t,i){if(null!=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=t.attributeInfo?.attributeData;s.every((e=>e===n||null!=d?.[e]))&&Xe(e,l,(e=>{o[n]=l[e];for(const i of s)i!==n&&(o[i]=d?Ye(d[i],e):null);try{return i.testFeature(a)}catch(t){return r(t),!1}}))}_boundingRectNodeTest(e,t){return L(e.node.serviceMbsInIndexSR,this._controller.crsIndex,kt,this.view.renderSpatialReference),Je(t,kt)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,Vt),z(Vt,Pt),Q(i,Pt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(r===Ze.INSIDE)return;if(r===Ze.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);Xe(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}async _addOrUpdateEdgeRendering(e,t=!0){const i=e.objectHandle,{hasEdges:s,perFeatureEdgeMaterials:r}=this._getFilteredEdgeMaterials(e);s&&!this._edgeView&&(this._edgeView=await this._stage.renderer.loadEdgeView());const o=this._edgeView;if(!o)return null;const a=o.hasObject(i);if(s){if(a){if(this.nodeCrossfadingEnabled){Xt(r,this.getNodeOpacity(e))}return o.updateAllComponentMaterials(i,r,this.slicePlaneEnabled,t).catch((e=>Nt(e,this.i3slayer.title))),o.updateObjectVisibility(i,!0).catch((e=>Nt(e,this.i3slayer.title))),o.updateAllVerticalOffsets(i,e.elevationOffsets).catch((e=>Nt(e,this.i3slayer.title))),o}const s=await this._collection.addEdges(i,o,r,this.slicePlaneEnabled,e.elevationOffsets);return e.edgeMemoryUsage=s,e.node.memory+=s,o}return a&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,o.removeObject(i)),null}_applyFiltersToNode(e){return!!this._applyFiltersToNodeComponents(e)&&(null!=this._labeler&&this._labeler.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,i=t.getComponentCount(e.objectHandle),s=null!=e.filteredIds,r=0===i.invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!r;if(this._updateCachedFilteredIds(e),s&&e.filteredIds===e.featureIds)return!r;const o=this._computeFilteredComponentIndices(e);return t.setAllComponentVisibilities(e.objectHandle,o),!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,i=e.filteredIds;return null!=i&&e.featureIds.forEach(((e,s)=>{i[t.length]===e&&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))),this._elevationTask=n(this._elevationTask)}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),null!=this._elevationTask&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,i=this._nodeId2Meta){i.has(e)&&this._controller.updateLoadStatus(e,!1);const s=i.get(e);null!=s?(this._collection.setObjectVisibility(s.objectHandle,!1),null!=this._edgeView&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1).catch((e=>Nt(e,this.i3slayer.title))),this._visibleGeometryChanged(s,Ft.REMOVE),null!=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),null!=this._treeDebugger&&this._treeDebugger.update()):i.delete(e)}_deleteComponentObject(e){if(null!=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);null!=i&&this._collection.updateMaterial(i.objectHandle,(e=>e.polygonOffsetEnabled=t===ke.Hole))}updateNodeIndex(e,t){if(this._nodeId2Meta.has(e)){const i=this._nodeId2Meta.get(e);this._nodeId2Meta.delete(e),this._nodeId2Meta.set(t,i),this.notifyChange("elevationRange")}const i=this._nodeId2MetaReloading.get(e);i&&(this._nodeId2MetaReloading.delete(e),this._nodeId2MetaReloading.set(t,i))}_invalidateAllSymbols(){this._rendererVersion=et(this._rendererVersion,1),this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return et(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=et(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 de()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:wt().warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.symbols)"mesh-3d"!==t.type&&wt().error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getComponentParameters(e){this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(i,s)=>{const r=5*i;V(s.externalColor,t[r]/255,t[r+1]/255,t[r+2]/255,t[r+3]/255);const o=this._stage.renderView.olidRenderHelper;if(o){const t=e.featureIds[i],r=he(this.view.map,this.layerUid);o.setUidToObjectAndLayerId(t,t,this.layerId,this.layerUid+"_"+this.sublayerId,this.layerPopupEnabledAndHasTemplate&&!r,e.node.resources.attributes,i,this.sublayerId),s.objectAndLayerIdColor=this._stage.renderView.getObjectAndLayerIdColor({graphicUid:t,layerUid:this.layerUid+"_"+this.sublayerId})}s.externalColorMixMode=t[r+4]&(1<<St.CastShadows)-1,s.castShadows=!!(t[r+4]&1<<St.CastShadows),s.pickable=!!(t[r+4]&1<<St.Pickable),s.elevationOffset=e.elevationOffsets?.[i]??0}}_getSymbolInfo(e,t){const i=e?.getSymbol(t,{arcade:this._arcade});if(!(i instanceof _e))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=tt(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=null!=this._symbologyOverrideFields&&this._symbologyOverrideFields.length>0?null!=this._rendererFields&&this._rendererFields.length>0?oe(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=e.attributeInfo?.attributeData,o=null!=e.featureIds?this.i3slayer.objectIdField:null,a=null!=r&&null!=this._symbologyFields&&this._symbologyFields.length>0;let n=null,l=null;if(a&&null!=this._symbologyFields){n=[],l=[];for(const e of this._symbologyFields){const t=r[e];t&&(n.push(e),l.push(t))}}e.cachedSymbology||(e.cachedSymbology=ie(5*e.featureIds.length));const d={color:Gt,castShadows:!0,pickable:!0,colorMixMode:ct.Multiply,edgeMaterial:null},h=this.fullOpacity,c=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):h;let u=null,_=xt.OPAQUE,g=it,m=0;for(let p=0;p<e.featureIds.length;p++){if(null!=o&&(i[o]=e.featureIds[p]),a&&n)for(let e=0;e<n.length;e++)i[n[e]]=Ye(l[e],p);const r=s?this._getSymbolInfo(s,t):null;let h=null,f=null;if(s&&"visualVariables"in s){if(this._colorVariable){const e=ne(this._colorVariable,t,{color:Lt,arcade:this._arcade});e&&(h=Gt,h[0]=e.r/255,h[1]=e.g/255,h[2]=e.b/255,this._opacityVariable||null===e.a||(f=e.a))}this._opacityVariable&&(f=le(this._opacityVariable,t,{arcade:this._arcade}))}if(r?.material){const e=r.material;h=null==h||null==f?Ee(h,f,e.color,e.alpha,jt,Gt):Ee(h,f,null,null,jt,Gt)}if(null==h&&(h=Gt,h[0]=1,h[1]=1,h[2]=1,h[3]=1),d.pickable=!0,d.castShadows=!r||r.castShadows,d.colorMixMode=r?.material?r.material.colorMixMode:ct.Multiply,d.edgeMaterial=r?r.edgeMaterial:null,null!=this._symbologyOverride&&(d.color=h,this._symbologyOverride(t,d),h=d.color),null!=this._nodeColorOverride&&(this._nodeColorOverride(e.node,h),d.colorMixMode=ct.Replace),null!=d.edgeMaterial){const t=h[3]>=1&&(e.material.isOpaque||d.colorMixMode===ct.Replace)?xt.OPAQUE:xt.TRANSPARENT;d.edgeMaterial===u&&t===_||(g={...d.edgeMaterial,opacity:c,objectTransparency:t},u=d.edgeMaterial,_=t),e.cachedEdgeMaterials[p]=g}else e.cachedEdgeMaterials[p]=it;e.cachedSymbology[m++]=Math.round(255*h[0]),e.cachedSymbology[m++]=Math.round(255*h[1]),e.cachedSymbology[m++]=Math.round(255*h[2]),e.cachedSymbology[m++]=Math.round(255*h[3]),e.cachedSymbology[m++]=d.colorMixMode|+d.castShadows<<St.CastShadows|+d.pickable<<St.Pickable}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);this.nodeCrossfadingEnabled||Xt(t,this.fullOpacity);const i=e.filteredIds;if(null==i){return{hasEdges:t.some((e=>e!==it)),perFeatureEdgeMaterials:t}}let s=0,r=!1;const o=t.map(((t,o)=>e.featureIds[o]!==i[s]?it:(r=r||t!==it,s++,t)));return{hasEdges:r,perFeatureEdgeMaterials:o}}_updateComponentData(e){if(!this._hasComponentData)return;const t=e.objectHandle,i=this._getComponentParameters(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=>{null!=t&&(this._collection.updateMaterial(t.objectHandle,(t=>t.objectOpacity=e)),Xt(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))}))}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,(e=>{e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.usePBR=this._usePBR,this._updateMaterialOverlay(e)}))}_updateMaterialOverlay(e){}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,Ft.UPDATE)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),null!=this._labeler&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach((t=>{null!=t&&(this._collection.updateMaterial(t.objectHandle,(t=>t.commonMaterialParameters.hasSlicePlane=e)),this._updateEdgeRendering(t,!1))}))}_updatePBR(e){this._nodeId2Meta.forEach((t=>{null!=t&&this._collection.updateMaterial(t.objectHandle,(t=>t.usePBR=e))})),this._hasLoadedPBRTextures=!0}get _usePBR(){return this._shadeNormals&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){null!=this._edgeView&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_ignoreClientNodeOverriddenFeatures(e){return this.i3sOverrides.hasGeometryChanges?(t,i,s)=>s.node.index>=0&&this.i3sOverrides.featureHasGeometryChanges(t)?ve.CONTINUE:e(t,i,s):e}_forAllFeatures(e,t,i){for(const s of this._nodeId2Meta.values()){if(null==s)continue;if(null!=t){switch(t(s)){case ve.EXIT:return;case ve.SKIP:continue}}let r=ve.CONTINUE;switch(i){case Ie.ALL:r=this._forAllFeaturesOfNode(s,e);break;case Ie.VISIBLE_ONLY:r=this._forAllVisibleFeaturesOfNode(s,e);break;case Ie.QUERYABLE:r=this._forAllQueryableFeaturesOfNode(s,e)}if(r===ve.EXIT)return}}_forAllFeaturesOfNode(e,t){let i=ve.CONTINUE;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),i===ve.EXIT)return i;return i}_forAllVisibleFeaturesOfNode(e,t){let i=ve.CONTINUE;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,(r=>(i=t(s[r],r,e),i===ve.CONTINUE))),i}_forAllQueryableFeaturesOfNode(e,t){const i=this._ignoreClientNodeOverriddenFeatures(t);if(null==this._renderClippingArea)return this._forAllFeaturesOfNode(e,i);const s=this._boundingRectNodeTest(e,this._renderClippingArea);if(s===Ze.OUTSIDE)return ve.CONTINUE;if(s===Ze.INSIDE)return this._forAllFeaturesOfNode(e,i);const r=ve.CONTINUE,o=e.featureIds,a=e.objectHandle,n=st(this._renderClippingArea,this._collection.getObjectTransform(a));for(let l=0;l<o.length;l++){if(!this._boundingRectFeatureTest(e,l,n))continue;const t=i(o[l],l,e);if(t===ve.EXIT)return t}return r}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=t.attributeInfo?.attributeData;if(null!=s)for(const r of Object.keys(s))i[r]=Ye(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e,t){if(ue(e))return lt;const s=dt(e);if(0===s.length)return lt;const r=t?.name??Ot,o=s[0]instanceof i?this._featureIdsFromGraphics(s):"number"==typeof s[0]?s:null;if(!o)return lt;const{set:a,handle:n}=this._highlights.acquireSet(r);return this._highlights.setFeatureIds(a,o),n}_featureIdsFromGraphics(e){const t=this.i3slayer.fieldsIndex,i=this._getObjectIdField();return e.map((e=>nt(t,e.attributes,i)))}resetHighlights(){n(this._highlights),this._highlights=new Se({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,Ie.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)})}_visibleGeometryChanged(e,t){this._elevationProvider&&(null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=m((()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null}))),this._updateSnappingSources(e,t),this._elevationProvider.objectChanged(this._collection.getComponentObb(e.objectHandle)))}get performanceInfo(){return new pe(this.usedMemory,this._nodeId2Meta.size,Math.round(this._gpuMemoryEstimate/1048576),Math.round(this._geoMemoryEstimate/1048576),Math.round(this._texMemoryEstimate/1048576),Math.round(this.unloadedMemory/1048576),this._idbCacheEnabled?Math.round(100*this._idbCache.getHitRate()):0)}get test(){}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return null!=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(e)}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);null!=s&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);null!=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(null==this._edgeView||!e.cachedEdgeMaterials)return;Xt(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t).catch((e=>Nt(e,this.i3slayer.title)))}get hasModifications(){return this._isIntegratedMesh&&null!=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.uid,s=$t(e);if(s){const t={context:i,buffer:s.buffer};xe(t);const r=new Float64Array(s.buffer);e.forAll(((e,t)=>{const i=r[t],s=Oe(i);e.imModificationImpact=s,s!==Le.Unmodified&&this._controller.invalidateGeometryVisibility(e.index)}))}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||null!=this._labeler&&this._labeler.updating||this._crossfadeHelper?.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||null!=this._elevationTask&&this._elevationTask.running}trackSnappingSources(e){const t={events:e,fetchEdgeLocations:async(e,t,i)=>{const s=this._nodeId2Meta.get(e);if(null==s)throw new Error("invalid-node");const{origin:r,buffer:o}=await this._collection.extractEdgeInformation(s.objectHandle,t,i);return this._snappingLocationsApplyElevation(s,o,r),{type:"components",objectIds:s.featureIds,locations:o,origin:r}},remove:()=>r(this._snappingSourcesTrackers,t)};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach(((t,i)=>{if(null==t)return;const s=this._controller.getRenderMbs(t.node);s&&e.add(i,s)})),t}_snappingLocationsApplyElevation(e,t,i){if(!e.elevationOffsets||this.elevationInfo.mode===ye.Absolute)return;const s=t.position0,r=t.position1,o=t.componentIndex,a=F(),n=F(),l=(e,t)=>{A(e,e,i),this.view.renderCoordsHelper.worldUpAtPosition(e,n),A(e,e,T(n,n,t)),D(e,e,i)};for(let d=0;d<s.count;d++){const t=e.elevationOffsets[o.get(d)];s.getVec(d,a),l(a,t),s.setVec(d,a),r.getVec(d,a),l(a,t),r.setVec(d,a)}}_updateSnappingSources(e,t){const{index:i}=e.node,s=this._controller.getRenderMbs(e.node);if(null!=s)for(const r of this._snappingSourcesTrackers)t!==Ft.REMOVE&&t!==Ft.UPDATE||r.events.remove(i),t!==Ft.ADD&&t!==Ft.UPDATE||r.events.add(i,s)}};return e([f()],o.prototype,"_hasLoadedPBRTextures",void 0),e([f()],o.prototype,"_asyncModuleLoading",void 0),e([f()],o.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([f()],o.prototype,"view",void 0),e([f()],o.prototype,"i3slayer",void 0),e([f()],o.prototype,"_controller",void 0),e([f()],o.prototype,"_labeler",void 0),e([f()],o.prototype,"updating",void 0),e([f()],o.prototype,"suspended",void 0),e([f()],o.prototype,"contentVisible",null),e([f({readOnly:!0})],o.prototype,"legendEnabled",null),e([f()],o.prototype,"holeFilling",void 0),e([f(pt)],o.prototype,"updatingProgress",void 0),e([f()],o.prototype,"updatingProgressValue",null),e([f()],o.prototype,"hasTexturesOrVertexColors",null),e([f()],o.prototype,"rendererTextureUsage",null),e([f()],o.prototype,"elevationOffset",null),e([f()],o.prototype,"elevationInfo",null),e([f({type:Boolean})],o.prototype,"slicePlaneEnabled",void 0),e([f()],o.prototype,"supportedTextureEncodings",null),e([f({type:[ae]})],o.prototype,"_modifications",void 0),e([f({readOnly:!0})],o.prototype,"clientGeometry",null),e([f()],o.prototype,"elevationRange",null),e([f()],o.prototype,"fullExtent",null),e([f()],o.prototype,"_elevationTask",void 0),e([f({readOnly:!0})],o.prototype,"_usePBR",null),o=e([b(Et)],o),o};function Nt(e,t){h(e)||wt().warn("Error while processing edges. Edges on this layer might not display correctly",t,e)}var Ft;!function(e){e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.UPDATE=2]="UPDATE"}(Ft||(Ft={}));const Vt=K(),Pt=$(),Ht=$(),Ut=new mt,Gt=[0,0,0,0],Lt=new t([0,0,0,0]),kt=ee(0,0,0,0);function Bt(e){if(null==e)return!1;const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function qt(e){return"geometryData"in e}function Kt(e){return null!=e&&p(e.data)}function Wt(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(null!=t)for(const s of t)null!=s&&p(s.data)&&(i+=s.data.byteLength);return i}function zt(e,t){return t.byteSize>Tt?(wt().warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}function $t(e){if(0===e.length)return;const t=10*e.length,i=new Float64Array(t);let s=0;return e.forAll((e=>{let t=e.serviceObbInIndexSR;null==t&&(t=Ut,t.center=Z(e.serviceMbsInIndexSR),t.halfSize=[e.serviceMbsInIndexSR[3],e.serviceMbsInIndexSR[3],e.serviceMbsInIndexSR[3]]);const r=t.data;i[s++]=r[0],i[s++]=r[1],i[s++]=r[2],i[s++]=r[3],i[s++]=r[4],i[s++]=r[5],i[s++]=r[6],i[s++]=r[7],i[s++]=r[8],i[s++]=r[9]})),i}class Qt{constructor(e,t,i){this.attributeInfo=e,this.meta=t,this.promise=i,this.allowMemCache=!0}}function Xt(e,t){e.forEach((e=>e.opacity=t))}class Yt{constructor(e,t){this.mode=e,this.offset=t}}const Jt=F(),Zt=K(),ei="elevation-change",ti="",ii="@null",si="@ECEF",ri=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],oi=new _t;function ai(e,t,i){let s=e.elevationRangeMin,r=e.elevationRangeMax;const o=i;if(o>0){t.getCorners(ri);for(const e of ri){const t=N(e)-o;s=Math.min(s,t),r=Math.max(r,t)}}else{t.getCorners(ri);for(const e of ri){const t=e[2];s=Math.min(s,t),r=Math.max(r,t)}}e.expandElevationRangeValues(s,r)}function ni(e,t,i){const s=Z(t),r=i>0?N(s)-i:s[2],o=te(t);e.expandElevationRangeValues(r-o,r+o)}export{Dt as I3SMeshView3D};