@arcgis/core 4.28.0-next.20230821 → 4.28.0-next.20230823

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 (668) hide show
  1. package/Basemap.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/arcade/functions/geomasync.js +1 -1
  4. package/arcade/portalUtils.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/0746319459dbcd3ab6f7.js +1 -0
  7. package/assets/esri/core/workers/chunks/{587437526ea77f764986.js → 0759d4ab9695096d2bbd.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{d0c4367a197b193e95d4.js → 10c014a6d8767ae8a666.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{5ffabd1a90c5b08109aa.js → 196937631ac20795e0ae.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{e05b54a0b834b4e4268e.js → 1c2b69dfcd0db58150e2.js} +1 -1
  11. package/assets/esri/core/workers/chunks/1c2f7c95825fdac790be.js +1 -0
  12. package/assets/esri/core/workers/chunks/1f9c80815f90fd0886d7.js +1 -0
  13. package/assets/esri/core/workers/chunks/217910f88fe2c03e6bdd.js +1 -0
  14. package/assets/esri/core/workers/chunks/238966b2fc6cc3dfcc05.js +1 -0
  15. package/assets/esri/core/workers/chunks/2c9f709d64954b3c1650.js +1 -0
  16. package/assets/esri/core/workers/chunks/35faede04d4539aab6e8.js +1 -0
  17. package/assets/esri/core/workers/chunks/3e3edcbacf8eaf275b97.js +1 -0
  18. package/assets/esri/core/workers/chunks/{b78dc6cbe14e5817b4d9.js → 4968018bc693c053fdd2.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{c35b850fbfcb28133235.js → 49a1ba3e7ea204adeddb.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{12b8fe0374fa9ab4ca09.js → 49cf3ae224f56f45f65b.js} +1 -1
  21. package/assets/esri/core/workers/chunks/5330040eeacc9c03fbdb.js +1 -0
  22. package/assets/esri/core/workers/chunks/54aaa21144431b29b6ed.js +1 -0
  23. package/assets/esri/core/workers/chunks/{6c40f16e6d10321295d8.js → 5b13d28cf5efc312a21c.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{d6c96a20e9640b433719.js → 67c6618339d323460d45.js} +57 -57
  25. package/assets/esri/core/workers/chunks/{dd86f43505b636eb41c0.js → 7714c16f9c8860efd461.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{752d389c7bdcbe7004dc.js → 83e0af5522a672c2c73b.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{873111ddf4813cdd4903.js → 872d0d4bf364be43a92e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/8a784ddd5607f1ddbb5b.js +1 -0
  29. package/assets/esri/core/workers/chunks/{0cad2b991d0d0fd07846.js → 8c9c4162617f31e3f5f2.js} +1 -1
  30. package/assets/esri/core/workers/chunks/8db3ee2931be5cca3f5e.js +1 -0
  31. package/assets/esri/core/workers/chunks/{fd3920159ab9748402a2.js → 92350664e2719a9e860e.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{ff755962fd1c771f5be5.js → a3b461174984a1cb92b3.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{dd4c6d000222798a0317.js → a47aff9c97c5ce52d0dc.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{028534e3d4e13c9ea687.js → a645f08a7678f2ca037c.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{d9fe6cfbc9ad2920ca9c.js → aca45e54ec925002df9a.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{40ff0e7c948615b8bfc0.js → b07d32a60307d04391fc.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{fdc703330bf194a48e0e.js → b086e798f43dacb0175f.js} +1 -1
  38. package/assets/esri/core/workers/chunks/bd0b9647880cbbec95e2.js +1 -0
  39. package/assets/esri/core/workers/chunks/{ab420bacdd63ee8fbd8b.js → bf9b5e2803a5444bd944.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{c58ca2685eb7e559f428.js → c0a2a737a3085690afc5.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{e04e8af4224fff8c3ec3.js → c34615c0b7ad83d1ad24.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{05ab09713d599687afa3.js → d105ee2e394e2c48303c.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{ef03b78659c72de93076.js → d183144fa504064d23d3.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{4f5207abb034375927c7.js → d8495c6dcd4d9bec8dd6.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{1a485d63330f5e7fe4e3.js → dba61fa8cbb57dde54b2.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{8a306e3aa210861b8c17.js → deb0bd575c63d9dbcde5.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{d0a2f9ca338b60f2ba2a.js → e302fe771d92ccf945a3.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{cb0a5bc6deaa98026bb5.js → ed0dea88b2865fc6e06b.js} +1 -1
  49. package/assets/esri/core/workers/chunks/ed733eea5d065131b159.js +1 -0
  50. package/assets/esri/core/workers/chunks/{1c51c52fb2233153d7ae.js → f3ec53ee9567bb7e4d2f.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{4922a0fed7cbc6895882.js → f701a5afa1b730c51a49.js} +1 -1
  52. package/assets/esri/t9n/common.json +1 -1
  53. package/assets/esri/t9n/common_ar.json +1 -1
  54. package/assets/esri/t9n/common_bg.json +1 -1
  55. package/assets/esri/t9n/common_ca.json +1 -1
  56. package/assets/esri/t9n/common_cs.json +1 -1
  57. package/assets/esri/t9n/common_da.json +1 -1
  58. package/assets/esri/t9n/common_de.json +1 -1
  59. package/assets/esri/t9n/common_el.json +1 -1
  60. package/assets/esri/t9n/common_en.json +1 -1
  61. package/assets/esri/t9n/common_es.json +1 -1
  62. package/assets/esri/t9n/common_et.json +1 -1
  63. package/assets/esri/t9n/common_fi.json +1 -1
  64. package/assets/esri/t9n/common_fr.json +1 -1
  65. package/assets/esri/t9n/common_he.json +1 -1
  66. package/assets/esri/t9n/common_hr.json +1 -1
  67. package/assets/esri/t9n/common_hu.json +1 -1
  68. package/assets/esri/t9n/common_id.json +1 -1
  69. package/assets/esri/t9n/common_it.json +1 -1
  70. package/assets/esri/t9n/common_ja.json +1 -1
  71. package/assets/esri/t9n/common_ko.json +1 -1
  72. package/assets/esri/t9n/common_lt.json +1 -1
  73. package/assets/esri/t9n/common_lv.json +1 -1
  74. package/assets/esri/t9n/common_nb.json +1 -1
  75. package/assets/esri/t9n/common_nl.json +1 -1
  76. package/assets/esri/t9n/common_pl.json +1 -1
  77. package/assets/esri/t9n/common_pt-BR.json +1 -1
  78. package/assets/esri/t9n/common_pt-PT.json +1 -1
  79. package/assets/esri/t9n/common_ro.json +1 -1
  80. package/assets/esri/t9n/common_ru.json +1 -1
  81. package/assets/esri/t9n/common_sk.json +1 -1
  82. package/assets/esri/t9n/common_sl.json +1 -1
  83. package/assets/esri/t9n/common_sr.json +1 -1
  84. package/assets/esri/t9n/common_sv.json +1 -1
  85. package/assets/esri/t9n/common_th.json +1 -1
  86. package/assets/esri/t9n/common_tr.json +1 -1
  87. package/assets/esri/t9n/common_uk.json +1 -1
  88. package/assets/esri/t9n/common_vi.json +1 -1
  89. package/assets/esri/t9n/common_zh-CN.json +1 -1
  90. package/assets/esri/t9n/common_zh-TW.json +1 -1
  91. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +10 -17
  92. package/assets/esri/themes/dark/main.css +1 -1
  93. package/assets/esri/themes/light/main.css +1 -1
  94. package/assets/esri/themes/light/view.css +1 -1
  95. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ar.json +1 -0
  96. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_bg.json +1 -0
  97. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_bs.json +1 -0
  98. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ca.json +1 -0
  99. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_cs.json +1 -0
  100. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_da.json +1 -0
  101. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_de.json +1 -0
  102. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_el.json +1 -0
  103. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_es.json +1 -0
  104. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_et.json +1 -0
  105. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_fi.json +1 -0
  106. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_fr.json +1 -0
  107. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_he.json +1 -0
  108. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_hr.json +1 -0
  109. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_hu.json +1 -0
  110. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_id.json +1 -0
  111. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_it.json +1 -0
  112. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ja.json +1 -0
  113. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ko.json +1 -0
  114. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_lt.json +1 -0
  115. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_lv.json +1 -0
  116. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_nb.json +1 -0
  117. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_nl.json +1 -0
  118. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_pl.json +1 -0
  119. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_pt-BR.json +1 -0
  120. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_pt-PT.json +1 -0
  121. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ro.json +1 -0
  122. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_ru.json +1 -0
  123. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sk.json +1 -0
  124. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sl.json +1 -0
  125. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sr.json +1 -0
  126. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_sv.json +1 -0
  127. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_th.json +1 -0
  128. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_tr.json +1 -0
  129. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_uk.json +1 -0
  130. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_vi.json +1 -0
  131. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_zh-CN.json +1 -0
  132. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_zh-HK.json +1 -0
  133. package/assets/esri/widgets/DirectionalPad/t9n/DirectionalPad_zh-TW.json +1 -0
  134. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  135. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  136. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  137. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  138. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  139. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  140. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  141. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  142. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  143. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  144. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  145. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  146. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  147. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  148. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  149. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  150. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  151. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  152. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  153. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  154. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  155. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  156. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  157. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  158. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  159. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  160. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  161. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  162. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  163. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  164. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  173. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ar.json +1 -1
  174. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bg.json +1 -1
  175. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bs.json +1 -1
  176. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ca.json +1 -1
  177. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_cs.json +1 -1
  178. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_da.json +1 -1
  179. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_de.json +1 -1
  180. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_el.json +1 -1
  181. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_es.json +1 -1
  182. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_et.json +1 -1
  183. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fi.json +1 -1
  184. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fr.json +1 -1
  185. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_he.json +1 -1
  186. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hr.json +1 -1
  187. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hu.json +1 -1
  188. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_id.json +1 -1
  189. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_it.json +1 -1
  190. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ja.json +1 -1
  191. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ko.json +1 -1
  192. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lt.json +1 -1
  193. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lv.json +1 -1
  194. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nb.json +1 -1
  195. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nl.json +1 -1
  196. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pl.json +1 -1
  197. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-BR.json +1 -1
  198. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-PT.json +1 -1
  199. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ro.json +1 -1
  200. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ru.json +1 -1
  201. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sk.json +1 -1
  202. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sl.json +1 -1
  203. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sr.json +1 -1
  204. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sv.json +1 -1
  205. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_th.json +1 -1
  206. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_tr.json +1 -1
  207. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_uk.json +1 -1
  208. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_vi.json +1 -1
  209. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-CN.json +1 -1
  210. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-HK.json +1 -1
  211. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-TW.json +1 -1
  212. package/chunks/ChapmanAtmosphere.glsl.js +1 -1
  213. package/chunks/Clouds.glsl.js +1 -1
  214. package/chunks/CloudsComposition.glsl.js +2 -2
  215. package/chunks/ComponentShader.glsl.js +36 -36
  216. package/chunks/Fog.glsl.js +1 -1
  217. package/chunks/LaserlinePath.glsl.js +1 -1
  218. package/chunks/Laserlines.glsl.js +1 -1
  219. package/chunks/LineSeries.js +1 -1
  220. package/chunks/NativeLine.glsl.js +8 -20
  221. package/chunks/PointRenderer.glsl.js +1 -1
  222. package/chunks/Precipitation.glsl.js +2 -2
  223. package/chunks/SSAOBlur.glsl.js +1 -1
  224. package/chunks/ShadowCastAccumulate.glsl.js +1 -1
  225. package/chunks/ShadowCastVisualize.glsl.js +2 -2
  226. package/chunks/ShadowHighlight.glsl.js +1 -1
  227. package/chunks/Stars.glsl.js +1 -1
  228. package/chunks/Terrain.glsl.js +35 -35
  229. package/chunks/TextureOnly.glsl.js +1 -1
  230. package/chunks/Theme.js +1 -1
  231. package/chunks/boundedPlane.js +1 -1
  232. package/chunks/cameraUtilsPlanar.js +1 -1
  233. package/chunks/cameraUtilsSpherical.js +1 -1
  234. package/chunks/chartUtilsAm5.js +1 -1
  235. package/chunks/mat3.js +1 -1
  236. package/chunks/mat3f64.js +1 -1
  237. package/chunks/mat4.js +1 -1
  238. package/chunks/mat4f64.js +1 -1
  239. package/chunks/quat.js +1 -1
  240. package/chunks/quat2.js +1 -1
  241. package/chunks/quatf64.js +1 -1
  242. package/chunks/sphere.js +1 -1
  243. package/chunks/terrainUtilsPlanar.js +1 -1
  244. package/chunks/vec3.js +1 -1
  245. package/chunks/vec3f64.js +1 -1
  246. package/chunks/vec4.js +1 -1
  247. package/chunks/vec4f64.js +1 -1
  248. package/core/VectorStack.js +1 -1
  249. package/core/accessorSupport/decorators/persistable.js +1 -1
  250. package/core/accessorSupport/testSupport.js +1 -1
  251. package/core/colorUtils.js +1 -1
  252. package/core/libs/gl-matrix-2/factories/mat3f64.js +1 -1
  253. package/core/libs/gl-matrix-2/factories/mat4f64.js +1 -1
  254. package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
  255. package/core/libs/gl-matrix-2/factories/vec3f64.js +1 -1
  256. package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
  257. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  258. package/core/libs/gl-matrix-2/math/mat4.js +1 -1
  259. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  260. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  261. package/core/mathUtils.js +1 -1
  262. package/core/perspectiveUtils.js +1 -1
  263. package/form/elements/inputs/DatePickerInput.d.ts +4 -0
  264. package/form/elements/inputs/DatePickerInput.js +5 -0
  265. package/form/elements/inputs/DateTimeOffsetPickerInput.d.ts +4 -0
  266. package/form/elements/inputs/DateTimeOffsetPickerInput.js +5 -0
  267. package/form/elements/inputs/TimePickerInput.d.ts +4 -0
  268. package/form/elements/inputs/TimePickerInput.js +5 -0
  269. package/form/elements/support/inputs.js +1 -1
  270. package/geometry/projection/computeTranslationToOriginAndRotation.js +1 -1
  271. package/geometry/projection/projectDirection.js +1 -1
  272. package/geometry/support/MeshTransform.js +1 -1
  273. package/geometry/support/axisAngle.js +1 -1
  274. package/geometry/support/axisAngleDegrees.js +1 -1
  275. package/geometry/support/clipRay.js +1 -1
  276. package/geometry/support/coordinateSystem.js +1 -1
  277. package/geometry/support/frustum.js +1 -1
  278. package/geometry/support/lineSegment.js +1 -1
  279. package/geometry/support/meshUtils/centerAt.js +1 -1
  280. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  281. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  282. package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
  283. package/geometry/support/meshUtils/georeference.js +1 -1
  284. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  285. package/geometry/support/meshUtils/merge.js +1 -1
  286. package/geometry/support/meshUtils/offset.js +1 -1
  287. package/geometry/support/meshUtils/primitives.js +1 -1
  288. package/geometry/support/meshUtils/projection.js +1 -1
  289. package/geometry/support/meshUtils/rotate.js +1 -1
  290. package/geometry/support/meshUtils/scale.js +1 -1
  291. package/geometry/support/meshVertexSpaceUtils.js +1 -1
  292. package/geometry/support/plane.js +1 -1
  293. package/geometry/support/ray.js +1 -1
  294. package/geometry/support/triangle.js +1 -1
  295. package/geometry/support/vector.js +1 -1
  296. package/interfaces.d.ts +405 -7
  297. package/layers/VoxelWasmPerSceneView.js +1 -1
  298. package/layers/mixins/SceneService.js +1 -1
  299. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  300. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  301. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  302. package/layers/orientedImagery/transformations/utils.js +1 -1
  303. package/layers/support/ControlPointsGeoreference.js +1 -1
  304. package/layers/support/ImageElement.js +1 -1
  305. package/layers/support/SceneFilter.js +1 -1
  306. package/layers/support/layerUtils.js +1 -1
  307. package/layers/video/VideoCameraSensorModel.js +1 -1
  308. package/layers/voxel/VoxelVolume.js +1 -1
  309. package/layers/voxel/voxelPlaneUtils.js +1 -1
  310. package/package.json +1 -1
  311. package/portal/support/resourceExtension.js +1 -1
  312. package/portal/support/resourceUtils.js +1 -1
  313. package/portal/support/utils.js +5 -0
  314. package/smartMapping/popup/support/utils.js +1 -1
  315. package/smartMapping/raster/renderers/classBreaks.js +1 -1
  316. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  317. package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
  318. package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
  319. package/support/revision.js +1 -1
  320. package/symbols/cim/CIMImageColorSubstitutionHelper.js +1 -1
  321. package/symbols/support/previewSymbol3D.js +1 -1
  322. package/views/2d/ViewState.js +1 -1
  323. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  324. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  325. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  326. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  327. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  328. package/views/2d/engine/webgl/Overlay.js +1 -1
  329. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  330. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  331. package/views/2d/engine/webgl/WGLTile.js +1 -1
  332. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  333. package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
  334. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  335. package/views/2d/interactive/editingTools/manipulations/RotateManipulation.js +1 -1
  336. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  337. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  338. package/views/2d/layers/support/DebugOverlay.js +1 -1
  339. package/views/2d/navigation/actions/Pan.js +1 -1
  340. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  341. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  342. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  343. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  344. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  345. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  346. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  347. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  348. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  349. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  350. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  351. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  352. package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
  353. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  354. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  355. package/views/3d/analysis/images/Factory.js +5 -0
  356. package/views/3d/analysis/support/measurementUtils.js +1 -1
  357. package/views/3d/analysis/support/viewUtils.js +1 -1
  358. package/views/3d/animation/pointToPoint/Animation.js +1 -1
  359. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  360. package/views/3d/camera/constraintUtils/altitude.js +1 -1
  361. package/views/3d/camera/constraintUtils/common.js +1 -1
  362. package/views/3d/camera/constraintUtils/distance.js +1 -1
  363. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  364. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  365. package/views/3d/camera/intersectionUtils.js +1 -1
  366. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  367. package/views/3d/environment/CloudsGenerator.js +1 -1
  368. package/views/3d/environment/CloudsParameters.js +1 -1
  369. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  370. package/views/3d/environment/Fog.js +1 -1
  371. package/views/3d/environment/LocalAtmosphere.js +1 -1
  372. package/views/3d/environment/MarsAtmosphere.js +1 -1
  373. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  374. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  375. package/views/3d/environment/Stars.js +1 -1
  376. package/views/3d/environment/StarsTechnique.js +1 -1
  377. package/views/3d/externalRenderers.js +1 -1
  378. package/views/3d/glTF/internal/Resource.js +1 -1
  379. package/views/3d/interactive/Manipulator3D.js +1 -1
  380. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  381. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  382. package/views/3d/interactive/editingTools/lineGraphicVisualElementUtils.js +1 -1
  383. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  384. package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
  385. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  386. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  387. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  388. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  389. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  390. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
  391. package/views/3d/interactive/editingTools/transformGraphic/undoRecords.js +1 -1
  392. package/views/3d/interactive/manipulatorUtils.js +1 -1
  393. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  394. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  395. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  396. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  397. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  398. package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
  399. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  400. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  401. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  402. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  403. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  404. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  405. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  406. package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
  407. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  408. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  409. package/views/3d/interactive/visualElements/support/Segment.js +1 -1
  410. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  411. package/views/3d/layers/I3SMeshView3D.js +1 -1
  412. package/views/3d/layers/MediaLayerView3D.js +1 -1
  413. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  414. package/views/3d/layers/PointCloudWorker.js +1 -1
  415. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  416. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  417. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  418. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  419. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  420. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  421. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  422. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  423. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  424. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  425. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  426. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  427. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  428. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  429. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  430. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  431. package/views/3d/layers/graphics/LabelParameters.js +1 -1
  432. package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
  433. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  434. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  435. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  436. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  437. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  438. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  439. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  440. package/views/3d/layers/i3s/I3SProjectionUtil.js +1 -1
  441. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  442. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  443. package/views/3d/layers/i3s/LoDUtil.js +1 -1
  444. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  445. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  446. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  447. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  448. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  449. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  450. package/views/3d/layers/support/edgeUtils.js +1 -1
  451. package/views/3d/layers/support/patternUtils.js +1 -1
  452. package/views/3d/layers/support/uvUtils.js +1 -1
  453. package/views/3d/state/Frustum.js +1 -1
  454. package/views/3d/state/NearFarHeuristic.js +1 -1
  455. package/views/3d/state/ViewStateManager.js +1 -1
  456. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  457. package/views/3d/state/controllers/RotateController.js +1 -1
  458. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  459. package/views/3d/state/controllers/global/ZoomController.js +1 -1
  460. package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
  461. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  462. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  463. package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
  464. package/views/3d/state/controllers/momentum/PanPlanarMomentumController.js +1 -1
  465. package/views/3d/state/controllers/momentum/PanSphericalMomentumController.js +1 -1
  466. package/views/3d/state/controllers/momentum/RotationMomentumController.js +1 -1
  467. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  468. package/views/3d/state/controllers/momentum/ZoomSphericalMomentumController.js +1 -1
  469. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  470. package/views/3d/state/utils/navigationUtils.js +1 -1
  471. package/views/3d/state/utils/viewUtils.js +1 -1
  472. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  473. package/views/3d/support/LaserLineRenderer.js +1 -1
  474. package/views/3d/support/LaserlinePathData.js +1 -1
  475. package/views/3d/support/RenderCoordsHelper.js +1 -1
  476. package/views/3d/support/StreamTextureCollection.js +1 -1
  477. package/views/3d/support/TextureCollection.js +1 -1
  478. package/views/3d/support/cameraUtils.js +1 -1
  479. package/views/3d/support/cameraUtilsInternal.js +1 -1
  480. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  481. package/views/3d/support/geometryUtils/ray.js +1 -1
  482. package/views/3d/support/intersectionUtils.js +1 -1
  483. package/views/3d/support/mathUtils.js +1 -1
  484. package/views/3d/support/orientedBoundingBox.js +1 -1
  485. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  486. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  487. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  488. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  489. package/views/3d/support/sunUtils.js +1 -1
  490. package/views/3d/support/viewpointUtils.js +1 -1
  491. package/views/3d/terrain/Overlay.js +1 -1
  492. package/views/3d/terrain/OverlayContent.js +5 -0
  493. package/views/3d/terrain/OverlayManager.js +1 -1
  494. package/views/3d/terrain/OverlayRenderTarget.js +1 -1
  495. package/views/3d/terrain/OverlayRenderer.js +1 -1
  496. package/views/3d/terrain/PatchGeometry.js +1 -1
  497. package/views/3d/terrain/PatchRenderData.js +1 -1
  498. package/views/3d/terrain/SphericalPatch.js +1 -1
  499. package/views/3d/terrain/TerrainRenderer.js +1 -1
  500. package/views/3d/terrain/TerrainSurface.js +1 -1
  501. package/views/3d/terrain/TextureReference.js +1 -1
  502. package/views/3d/terrain/Tile.js +1 -1
  503. package/views/3d/terrain/TileCompositor.js +1 -1
  504. package/views/3d/terrain/TileOverlayData.js +1 -1
  505. package/views/3d/terrain/TileRenderInfo.js +1 -1
  506. package/views/3d/terrain/interfaces.js +1 -1
  507. package/views/3d/terrain/support/MultiSizeFramebuffer.js +1 -1
  508. package/views/3d/webgl-engine/Stage.js +1 -1
  509. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  510. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  511. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  512. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  513. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  514. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  515. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  516. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +1 -1
  517. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +1 -1
  518. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
  519. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +32 -53
  520. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +6 -6
  521. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
  522. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +9 -9
  523. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  524. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  525. package/views/3d/webgl-engine/effects/highlight/HighlightPassParameters.js +1 -1
  526. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  527. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  528. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  529. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  530. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  531. package/views/3d/webgl-engine/lib/CascadeCamera.js +1 -1
  532. package/views/3d/webgl-engine/lib/ContentObject.js +1 -1
  533. package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
  534. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  535. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  536. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  537. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  538. package/views/3d/webgl-engine/lib/ITexture.js +5 -0
  539. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  540. package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
  541. package/views/3d/webgl-engine/lib/LocalOriginManager.js +1 -1
  542. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  543. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  544. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  545. package/views/3d/webgl-engine/lib/Path.js +1 -1
  546. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  547. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  548. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  549. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  550. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  551. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  552. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  553. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  554. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  555. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  556. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  557. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  558. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  559. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderParameters.js +1 -1
  560. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  561. package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
  562. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  563. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  564. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  565. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  566. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  567. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  568. package/views/3d/webgl-engine/lib/octreeUtils.js +1 -1
  569. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  570. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  571. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  572. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  573. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  574. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  575. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  576. package/views/3d/webgl-engine/materials/LineDrawParameters.js +1 -1
  577. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  578. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  579. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  580. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  581. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  582. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  583. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  584. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  585. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  586. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  587. package/views/3d/webgl-engine/parts/Model.js +1 -1
  588. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  589. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  590. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  591. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
  592. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  593. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  594. package/views/GroundView.js +1 -1
  595. package/views/SceneView.js +1 -1
  596. package/views/draw/DrawManipulator.js +1 -1
  597. package/views/draw/support/createUtils.js +1 -1
  598. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  599. package/views/interactive/GraphicManipulator.js +1 -1
  600. package/views/interactive/ManipulatorCollection.js +1 -1
  601. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  602. package/views/interactive/coordinateHelper.js +1 -1
  603. package/views/interactive/dragEventPipeline.js +1 -1
  604. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  605. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  606. package/views/interactive/sketch/constraints.js +1 -1
  607. package/views/interactive/sketch/normalizedPoint.js +1 -1
  608. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  609. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  610. package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
  611. package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
  612. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  613. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  614. package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
  615. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  616. package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
  617. package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
  618. package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
  619. package/views/interactive/support/viewUtils.js +1 -1
  620. package/views/interactive/tooltip/constraintUtils.js +1 -1
  621. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  622. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  623. package/views/navigation/gamepadAndKeyboardUtils.js +1 -1
  624. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  625. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  626. package/views/support/geometry3dUtils.js +1 -1
  627. package/views/support/layerViewUtils.js +1 -1
  628. package/webdoc/support/saveUtils.js +1 -1
  629. package/webscene/Slide.js +1 -1
  630. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  631. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  632. package/widgets/Editor/EditorViewModel.js +1 -1
  633. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  634. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  635. package/widgets/Editor/UpdateWorkflow.js +1 -1
  636. package/widgets/Editor/workflowUtils.js +1 -1
  637. package/widgets/Editor.js +1 -1
  638. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  639. package/widgets/ElevationProfile/support/constants.js +1 -1
  640. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  641. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  642. package/widgets/OrientedImageryViewer.js +1 -1
  643. package/widgets/Sketch.js +1 -1
  644. package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.d.ts +4 -0
  645. package/widgets/smartMapping/BinaryColorSizeSlider.d.ts +4 -0
  646. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  647. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  648. package/widgets/support/templateUtils.js +5 -0
  649. package/assets/esri/core/workers/chunks/19857e5420cdf23c5f2e.js +0 -1
  650. package/assets/esri/core/workers/chunks/26289742b9280f0b5247.js +0 -1
  651. package/assets/esri/core/workers/chunks/46f6b77e586d78aeb75c.js +0 -1
  652. package/assets/esri/core/workers/chunks/4e39252f40bc57be9d12.js +0 -1
  653. package/assets/esri/core/workers/chunks/54513578f735d274a20e.js +0 -1
  654. package/assets/esri/core/workers/chunks/8dab0acdbbd5c282645a.js +0 -1
  655. package/assets/esri/core/workers/chunks/8e4b01a0cb8c8926f2b6.js +0 -1
  656. package/assets/esri/core/workers/chunks/a3a1d4f32e518e97d071.js +0 -1
  657. package/assets/esri/core/workers/chunks/b2d4a56197dcabdbae35.js +0 -1
  658. package/assets/esri/core/workers/chunks/be0565d923afba7ca300.js +0 -1
  659. package/assets/esri/core/workers/chunks/c99fa4189a114370b004.js +0 -1
  660. package/assets/esri/core/workers/chunks/daa79c14150c12d8bc3d.js +0 -1
  661. package/assets/esri/core/workers/chunks/ebd006fcd568a7731115.js +0 -1
  662. package/assets/esri/core/workers/chunks/f67388c4b7103fda6633.js +0 -1
  663. package/views/3d/analysis/Slice/images/Factory.js +0 -5
  664. /package/assets/esri/views/3d/analysis/{Slice/images → images}/heading-rotate.ts.svg +0 -0
  665. /package/assets/esri/views/3d/analysis/{Slice/images → images}/tilt-rotate.ts.svg +0 -0
  666. /package/views/3d/analysis/{Slice/images → images}/generateTextures.js +0 -0
  667. /package/views/3d/analysis/{Slice/images → images}/heading-rotate-svg.js +0 -0
  668. /package/views/3d/analysis/{Slice/images → images}/tilt-rotate-svg.js +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1370],{32078:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>U});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),d=r(37099),u=r(76056),h=r(135),m=r(11317),f=r(15719),p=r(92555),g=r(89136),v=r(15817),_=r(77813),T=r(89753),x=r(5802),E=r(42001),b=r(19419),A=r(26322),S=r(85504),R=r(22539),w=r(57806),y=r(92302),C=r(96310),M=r(85787),O=r(90692),I=r(93669),P=r(172),N=r(71250),L=r(21437),D=r(74709),F=r(33680),H=r(98069),B=r(93144),G=r(35065);function U(e){const t=new F.kG,{vertex:r,fragment:U,varyings:z}=t;if((0,I.Sv)(r,e),t.include(d.f),z.add("vpos","vec3"),t.include(y.k,e),t.include(l.fQ,e),t.include(p.L,e),e.hasColorTextureTransform&&t.include(w.av),e.output===n.H.Color||e.output===n.H.Alpha){e.hasNormalTextureTransform&&t.include(w.NI),e.hasEmissionTextureTransform&&t.include(w.R5),e.hasOcclusionTextureTransform&&t.include(w.jF),e.hasMetallicRoughnessTextureTransform&&t.include(w.DT),(0,I.hY)(r,e),t.include(c.O,e),t.include(s.w,e);const n=e.normalType===c.r.Attribute||e.normalType===c.r.Compressed;n&&e.offsetBackfaces&&t.include(o.w),t.include(v.Q,e),t.include(f.Bb,e),e.instancedColor&&t.attributes.add(G.T.INSTANCECOLOR,"vec4"),z.add("vPositionLocal","vec3"),t.include(h.D,e),t.include(i.qj,e),t.include(u.R,e),t.include(m.c,e),r.uniforms.add(new N.N("externalColor",(e=>e.externalColor))),z.add("vcolorExt","vec4"),e.multipassEnabled&&z.add("depth","float"),r.code.add(D.H`
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1370],{32078:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>U});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),u=r(37099),d=r(76056),h=r(135),m=r(11317),f=r(15719),p=r(92555),g=r(89136),v=r(15817),_=r(77813),T=r(89753),x=r(5802),E=r(42001),b=r(19419),A=r(26322),S=r(85504),R=r(22539),w=r(57806),y=r(92302),C=r(96310),M=r(85787),O=r(90692),I=r(93669),P=r(172),N=r(71250),L=r(21437),D=r(74709),F=r(33680),H=r(98069),B=r(93144),G=r(35065);function U(e){const t=new F.kG,{vertex:r,fragment:U,varyings:z}=t;if((0,I.Sv)(r,e),t.include(u.f),z.add("vpos","vec3"),t.include(y.k,e),t.include(l.fQ,e),t.include(p.L,e),e.hasColorTextureTransform&&t.include(w.av),e.output===n.H.Color||e.output===n.H.Alpha){e.hasNormalTextureTransform&&t.include(w.NI),e.hasEmissionTextureTransform&&t.include(w.R5),e.hasOcclusionTextureTransform&&t.include(w.jF),e.hasMetallicRoughnessTextureTransform&&t.include(w.DT),(0,I.hY)(r,e),t.include(c.O,e),t.include(s.w,e);const n=e.normalType===c.r.Attribute||e.normalType===c.r.Compressed;n&&e.offsetBackfaces&&t.include(o.w),t.include(v.Q,e),t.include(f.Bb,e),e.instancedColor&&t.attributes.add(G.T.INSTANCECOLOR,"vec4"),z.add("vPositionLocal","vec3"),t.include(h.D,e),t.include(i.qj,e),t.include(d.R,e),t.include(m.c,e),r.uniforms.add(new N.N("externalColor",(e=>e.externalColor))),z.add("vcolorExt","vec4"),e.multipassEnabled&&z.add("depth","float"),r.code.add(D.H`
2
2
  void main(void) {
3
3
  forwardNormalizedVertexColor();
4
4
  vcolorExt = externalColor;
@@ -91,7 +91,7 @@
91
91
  fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
92
92
  ${e.transparencyPassType===B.A.Color?D.H`fragColor = premultiplyAlpha(fragColor);`:""}
93
93
  }
94
- `)}return t.include(g.s,e),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},41846:(e,t,r)=>{r.d(t,{R:()=>H,b:()=>F});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),d=r(37099),u=r(76056),h=r(135),m=r(11317),f=r(92555),p=r(89136),g=r(77813),v=r(89753),_=r(5802),T=r(42001),x=r(26322),E=r(85504),b=r(22539),A=r(92302),S=r(96310),R=r(85787),w=r(90692),y=r(93669),C=r(172),M=r(71250),O=r(21437),I=r(74709),P=r(33680),N=r(98069),L=r(93144),D=r(35065);function F(e){const t=new P.kG,{vertex:r,fragment:F,varyings:H}=t;return(0,y.Sv)(r,e),t.include(d.f),H.add("vpos","vec3"),t.include(A.k,e),t.include(l.fQ,e),t.include(f.L,e),e.output!==n.H.Color&&e.output!==n.H.Alpha||((0,y.hY)(t.vertex,e),t.include(c.O,e),t.include(s.w,e),e.offsetBackfaces&&t.include(o.w),e.instancedColor&&t.attributes.add(D.T.INSTANCECOLOR,"vec4"),H.add("vNormalWorld","vec3"),H.add("localvpos","vec3"),e.multipassEnabled&&H.add("depth","float"),t.include(h.D,e),t.include(i.qj,e),t.include(u.R,e),t.include(m.c,e),r.uniforms.add(new M.N("externalColor",(e=>e.externalColor))),H.add("vcolorExt","vec4"),r.code.add(I.H`
94
+ `)}return t.include(g.s,e),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},41846:(e,t,r)=>{r.d(t,{R:()=>H,b:()=>F});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),u=r(37099),d=r(76056),h=r(135),m=r(11317),f=r(92555),p=r(89136),g=r(77813),v=r(89753),_=r(5802),T=r(42001),x=r(26322),E=r(85504),b=r(22539),A=r(92302),S=r(96310),R=r(85787),w=r(90692),y=r(93669),C=r(172),M=r(71250),O=r(21437),I=r(74709),P=r(33680),N=r(98069),L=r(93144),D=r(35065);function F(e){const t=new P.kG,{vertex:r,fragment:F,varyings:H}=t;return(0,y.Sv)(r,e),t.include(u.f),H.add("vpos","vec3"),t.include(A.k,e),t.include(l.fQ,e),t.include(f.L,e),e.output!==n.H.Color&&e.output!==n.H.Alpha||((0,y.hY)(t.vertex,e),t.include(c.O,e),t.include(s.w,e),e.offsetBackfaces&&t.include(o.w),e.instancedColor&&t.attributes.add(D.T.INSTANCECOLOR,"vec4"),H.add("vNormalWorld","vec3"),H.add("localvpos","vec3"),e.multipassEnabled&&H.add("depth","float"),t.include(h.D,e),t.include(i.qj,e),t.include(d.R,e),t.include(m.c,e),r.uniforms.add(new M.N("externalColor",(e=>e.externalColor))),H.add("vcolorExt","vec4"),r.code.add(I.H`
95
95
  void main(void) {
96
96
  forwardNormalizedVertexColor();
97
97
  vcolorExt = externalColor;
@@ -170,7 +170,7 @@
170
170
  fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
171
171
  ${e.transparencyPassType===L.A.Color?I.H`fragColor = premultiplyAlpha(fragColor);`:I.H``}
172
172
  }
173
- `)),t.include(p.s,e),t}const H=Object.freeze(Object.defineProperty({__proto__:null,build:F},Symbol.toStringTag,{value:"Module"}))},25377:(e,t,r)=>{r.d(t,{S:()=>v,b:()=>f,g:()=>p});var i=r(4307),o=r(97323),n=r(51666),a=r(5543),s=r(20787),l=r(19693),c=r(21437),d=r(74709),u=r(33680),h=r(98069);const m=16;function f(){const e=new u.kG,t=e.fragment;return e.include(n.k),t.include(a.S),e.include(s.G),t.uniforms.add(new c.p("radius",((e,t)=>p(t.camera)))),t.code.add(d.H`vec3 sphere[16];
173
+ `)),t.include(p.s,e),t}const H=Object.freeze(Object.defineProperty({__proto__:null,build:F},Symbol.toStringTag,{value:"Module"}))},25377:(e,t,r)=>{r.d(t,{S:()=>v,b:()=>f,g:()=>p});var i=r(4307),o=r(97323),n=r(51666),a=r(5543),s=r(20787),l=r(19693),c=r(21437),u=r(74709),d=r(33680),h=r(98069);const m=16;function f(){const e=new d.kG,t=e.fragment;return e.include(n.k),t.include(a.S),e.include(s.G),t.uniforms.add(new c.p("radius",((e,t)=>p(t.camera)))),t.code.add(u.H`vec3 sphere[16];
174
174
  void fillSphere() {
175
175
  sphere[0] = vec3(0.186937, 0.0, 0.0);
176
176
  sphere[1] = vec3(0.700542, 0.0, 0.0);
@@ -192,12 +192,12 @@ sphere[15] = vec3(0.417709, -0.386701, 0.442449);
192
192
  float fallOffFunction(float vv, float vn, float bias) {
193
193
  float f = max(radius * radius - vv, 0.0);
194
194
  return f * f * f * max(vn - bias, 0.0);
195
- }`),t.code.add(d.H`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) {
195
+ }`),t.code.add(u.H`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) {
196
196
  vec3 v = Q - C;
197
197
  float vv = dot(v, v);
198
198
  float vn = dot(normalize(v), n_C);
199
199
  return fallOffFunction(vv, vn, 0.1);
200
- }`),t.uniforms.add(new l.A("nearFar",((e,t)=>t.camera.nearFar)),new h.A("normalMap",(e=>e.normalTexture)),new h.A("depthMap",(e=>e.depthTexture)),new l.A("zScale",((e,t)=>(0,s.R)(t))),new c.p("projScale",(e=>e.projScale)),new h.A("rnm",(e=>e.noiseTexture)),new l.A("rnmScale",((e,t)=>(0,i.s)(g,t.camera.fullWidth/e.noiseTexture.descriptor.width,t.camera.fullHeight/e.noiseTexture.descriptor.height))),new c.p("intensity",(e=>e.intensity)),new l.A("screenSize",((e,t)=>(0,i.s)(g,t.camera.fullWidth,t.camera.fullHeight)))),e.outputs.add("fragOcclusion","float"),t.code.add(d.H`
200
+ }`),t.uniforms.add(new l.A("nearFar",((e,t)=>t.camera.nearFar)),new h.A("normalMap",(e=>e.normalTexture)),new h.A("depthMap",(e=>e.depthTexture)),new l.A("zScale",((e,t)=>(0,s.R)(t))),new c.p("projScale",(e=>e.projScale)),new h.A("rnm",(e=>e.noiseTexture)),new l.A("rnmScale",((e,t)=>(0,i.s)(g,t.camera.fullWidth/e.noiseTexture.descriptor.width,t.camera.fullHeight/e.noiseTexture.descriptor.height))),new c.p("intensity",(e=>e.intensity)),new l.A("screenSize",((e,t)=>(0,i.s)(g,t.camera.fullWidth,t.camera.fullHeight)))),e.outputs.add("fragOcclusion","float"),t.code.add(u.H`
201
201
  void main(void) {
202
202
  fillSphere();
203
203
  vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0);
@@ -222,7 +222,7 @@ return fallOffFunction(vv, vn, 0.1);
222
222
  // bug or deviation from CE somewhere else?
223
223
  float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y);
224
224
 
225
- for(int i = 0; i < ${d.H.int(m)}; ++i) {
225
+ for(int i = 0; i < ${u.H.int(m)}; ++i) {
226
226
  vec2 unitOffset = reflect(sphere[i], fres).xy;
227
227
  vec2 offset = vec2(-unitOffset * radius * ps);
228
228
 
@@ -248,14 +248,14 @@ return fallOffFunction(vv, vn, 0.1);
248
248
  }
249
249
 
250
250
  // output the result
251
- float A = max(1.0 - sum * intensity / float(${d.H.int(m)}), 0.0);
251
+ float A = max(1.0 - sum * intensity / float(${u.H.int(m)}), 0.0);
252
252
 
253
253
  // Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2
254
254
  A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2;
255
255
 
256
256
  fragOcclusion = A;
257
257
  }
258
- `),e}function p(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const g=(0,o.a)(),v=Object.freeze(Object.defineProperty({__proto__:null,build:f,getRadius:p},Symbol.toStringTag,{value:"Module"}))},59915:(e,t,r)=>{r.d(t,{S:()=>p,b:()=>f});var i=r(17896),o=r(51666),n=r(5543),a=r(98925),s=r(19693),l=r(21437),c=r(74709),d=r(33680),u=r(16374),h=r(98069);const m=4;function f(){const e=new d.kG,t=e.fragment;e.include(o.k);const r=(m+1)/2,f=1/(2*r*r);return t.include(n.S),t.uniforms.add(new h.A("depthMap",(e=>e.depthTexture)),new u.R("tex",(e=>e.colorTexture)),new a.q("blurSize",(e=>e.blurSize)),new l.p("projScale",((e,t)=>{const r=(0,i.h)(t.camera.eye,t.camera.center);return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),new s.A("nearFar",((e,t)=>t.camera.nearFar))),t.code.add(c.H`
258
+ `),e}function p(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const g=(0,o.a)(),v=Object.freeze(Object.defineProperty({__proto__:null,build:f,getRadius:p},Symbol.toStringTag,{value:"Module"}))},59915:(e,t,r)=>{r.d(t,{S:()=>p,b:()=>f});var i=r(17896),o=r(51666),n=r(5543),a=r(98925),s=r(19693),l=r(21437),c=r(74709),u=r(33680),d=r(16374),h=r(98069);const m=4;function f(){const e=new u.kG,t=e.fragment;e.include(o.k);const r=(m+1)/2,f=1/(2*r*r);return t.include(n.S),t.uniforms.add(new h.A("depthMap",(e=>e.depthTexture)),new d.R("tex",(e=>e.colorTexture)),new a.q("blurSize",(e=>e.blurSize)),new l.p("projScale",((e,t)=>{const r=(0,i.m)(t.camera.eye,t.camera.center);return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),new s.A("nearFar",((e,t)=>t.camera.nearFar))),t.code.add(c.H`
259
259
  void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
260
260
  float c = texture(tex, uv).r;
261
261
  float d = linearDepthFromTexture(depthMap, uv, nearFar);
@@ -282,9 +282,9 @@ return fallOffFunction(vv, vn, 0.1);
282
282
 
283
283
  fragBlur = b / w_total;
284
284
  }
285
- `),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>d,Z:()=>c,c:()=>i,f:()=>o});const c=n(),d=a(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:u,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>d,e:()=>l,n:()=>u,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],d=r[4],u=r[5],h=r[6],m=r[8],f=r[9],p=r[10],g=r[12],v=r[13],_=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+d*i+m*a+g,e[x+1]=l*r+u*i+f*a+v,e[x+2]=c*r+h*i+p*a+_,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,v=0;for(let r=0;r<a;r++){const r=t[g],i=t[g+1],a=t[g+2];e[v]=s*r+d*i+m*a,e[v+1]=l*r+u*i+f*a,e[v+2]=c*r+h*i+p*a,g+=n,v+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},23670:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(20102);let o=class{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),a=/^\s*\d+\s*$/;if(!r||!r.match||!a.test(r))throw new i.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n||!n.match||!a.test(n))throw new i.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new o(s,l,t)}}},43090:(e,t,r)=>{function i(e){return 32+e.length}function o(e){if(!e)return 0;let t=l;for(const r in e)if(e.hasOwnProperty(r)){const o=e[r];switch(typeof o){case"string":t+=i(o);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function n(e){if(!e)return 0;if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return 32+8*t;let r=c;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=l;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e){switch(typeof e){case"object":return n(e);case"string":return i(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(e,t){return c+e.length*t}r.d(t,{Ul:()=>n,do:()=>s,f2:()=>o});const l=32,c=32},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>d,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.a)(e.origin),vector:(0,a.a)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.i)(r.origin,e),(0,n.g)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,d=(0,n.g)(s.WM.get(),t,c),u=(0,n.d)(l,d)/(0,n.p)(l);return(0,n.b)(a,l,(0,i.uZ)(u,0,1)),(0,n.e)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},31370:(e,t,r)=>{r.d(t,{fetch:()=>Wt});var i=r(32243),o=r(21787),n=r(46521),a=r(52138),s=r(13598),l=r(17896),c=r(65617),d=r(60437),u=r(1533);function h(e,t=!1){return e<=u.DB?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),f=r(20773),p=r(11077),g=r(10816),v=r(56067),_=r(75488),T=r(40270),x=r(91695),E=r(91911),b=r(15317),A=r(14682),S=r(1265);function R(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,n=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,a,s),(0,o.m)(l,n,l),l}class w{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class y{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new w,this.numberOfVertices=0}}var C=r(3172),M=r(66643),O=r(43090),I=r(20102),P=r(92604);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var L=r(95330),D=r(23670);async function F(e,t){const{data:r}=await(0,C.Z)(e,{responseType:"image",...t});return r}var H=r(51417),B=r(47026),G=r(22631),U=r(80442),z=r(32448),V=r(70586),W=r(17452),j=r(85958),k=r(99880);let q;var X,$;($=X||(X={}))[$.ETC1_RGB=0]="ETC1_RGB",$[$.ETC2_RGBA=1]="ETC2_RGBA",$[$.BC1_RGB=2]="BC1_RGB",$[$.BC3_RGBA=3]="BC3_RGBA",$[$.BC4_R=4]="BC4_R",$[$.BC5_RG=5]="BC5_RG",$[$.BC7_M6_RGB=6]="BC7_M6_RGB",$[$.BC7_M5_RGBA=7]="BC7_M5_RGBA",$[$.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",$[$.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",$[$.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",$[$.ATC_RGB=11]="ATC_RGB",$[$.ATC_RGBA=12]="ATC_RGBA",$[$.FXT1_RGB=17]="FXT1_RGB",$[$.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",$[$.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",$[$.ETC2_EAC_R11=20]="ETC2_EAC_R11",$[$.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",$[$.RGBA32=13]="RGBA32",$[$.RGB565=14]="RGB565",$[$.BGR565=15]="BGR565",$[$.RGBA4444=16]="RGBA4444";var Y=r(35371),J=r(57088),Z=r(45762);let K=null,Q=null;async function ee(){return null==Q&&(Q=function(){if(null==q){const e=e=>(0,k.V)(`esri/libs/basisu/${e}`);q=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return q}(),K=await Q),Q}function te(e,t,r,i,o){const n=(0,Z.RG)(t?Y.q_.COMPRESSED_RGBA8_ETC2_EAC:Y.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function re(e){return e.getNumImages()>=1&&!e.isUASTC()}function ie(e){return e.getFaces()>=1&&e.isETC1S()}function oe(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[X.ETC2_RGBA,Y.q_.COMPRESSED_RGBA8_ETC2_EAC]:[X.ETC1_RGB,Y.q_.COMPRESSED_RGB8_ETC2]:c?i?[X.BC3_RGBA,Y.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[X.BC1_RGB,Y.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[X.RGBA32,Y.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?Y.cw.LINEAR_MIPMAP_LINEAR:Y.cw.LINEAR,t.width=o,t.height=n,new J.x(e,t,{type:"compressed",levels:m})}var ne=r(17662),ae=r(4726);const se=P.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function le(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ce=le("DXT1"),de=le("DXT3"),ue=le("DXT5");var he,me,fe=r(11726),pe=r(47859);class ge extends ne.c{constructor(e,t){super(),this._data=e,this.type=ae.U.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new z.Z,this.parameters=t||{},this.parameters.mipmap=!1!==this.parameters.mipmap,this.parameters.noUnpackFlip=this.parameters.noUnpackFlip||!1,this.parameters.preMultiplyAlpha=this.parameters.preMultiplyAlpha||!1,this.parameters.wrap=this.parameters.wrap||{s:Y.e8.REPEAT,t:Y.e8.REPEAT},this._startPreload(e)}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,W.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,W.HK)(e.src)||(0,W.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}dispose(){this._data=void 0}_createDescriptor(e){const t=new pe.X;return t.wrapMode=this.parameters.wrap??Y.e8.REPEAT,t.flipped=!this.parameters.noUnpackFlip,t.samplingMode=this.parameters.mipmap?Y.cw.LINEAR_MIPMAP_LINEAR:Y.cw.LINEAR,t.hasMipmap=!!this.parameters.mipmap,t.preMultiplyAlpha=!!this.parameters.preMultiplyAlpha,t.maxAnisotropy=this.parameters.maxAnisotropy??(this.parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.gpuMemoryUsage||function(e,t){if(null==e)return 0;if((0,u.eP)(e)||(0,u.lq)(e))return t.encoding===B.Ti.KTX2_ENCODING?function(e,t){if(null==K)return e.byteLength;const r=new K.KTX2File(new Uint8Array(e)),i=ie(r)?te(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.Ti.BASIS_ENCODING?function(e,t){if(null==K)return e.byteLength;const r=new K.BasisFile(new Uint8Array(e)),i=re(r)?te(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?ve(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this.parameters)}load(e){if(null!=this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new J.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,u.eP)(t)||(0,u.lq)(t))&&this.parameters.encoding===B.Ti.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,t)):((0,u.eP)(t)||(0,u.lq)(t))&&this.parameters.encoding===B.Ti.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,t)):((0,u.eP)(t)||(0,u.lq)(t))&&this.parameters.encoding===B.Ti.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,t)):(0,u.lq)(t)?this._loadFromPixelData(e,t):(0,u.eP)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e){return this._data instanceof HTMLVideoElement&&null!=this._glTexture?this._data.readyState<he.HAVE_CURRENT_DATA||e===this._data.currentTime?e:(this._glTexture.setData(this._data),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.parameters.updateCallback&&this.parameters.updateCallback(),this._data.currentTime):e}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return se.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return se.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case ce:o=8,n=Y.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case de:o=16,n=Y.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case ue:o=16,n=Y.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return se.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(se.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,m,h),f.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:c,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?Y.cw.LINEAR_MIPMAP_LINEAR:Y.cw.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new J.x(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==K&&(K=await ee());const i=new K.KTX2File(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=oe(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==K&&(K=await ee());const i=new K.BasisFile(new Uint8Array(r));if(!re(i))return null;i.startTranscoding();const o=oe(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,fe.hu)(this.parameters.width>0&&this.parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.parameters.components?Y.VI.LUMINANCE:3===this.parameters.components?Y.VI.RGB:Y.VI.RGBA,r.width=this.parameters.width??0,r.height=this.parameters.height??0,this._glTexture=new J.x(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await F(t,{signal:r});return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,j.fY)(t,t.src,!1,r);return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=he.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,V.hw)(l)},a=()=>{t.readyState>=he.HAVE_CURRENT_DATA&&(n(),i(this._loadFromImage(e,t)))},s=e=>{n(),o(e||new I.Z("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,L.fu)(r,(()=>s((0,L.zE)())))}))))}_loadFromImage(e,t){const r=ve(t);this.parameters.width=r.width,this.parameters.height=r.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this.parameters.components?Y.VI.RGB:Y.VI.RGBA,i.width=r.width,i.height=r.height,this._glTexture=new J.x(e,i,t),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,V.M2)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function ve(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(me=he||(he={}))[me.HAVE_NOTHING=0]="HAVE_NOTHING",me[me.HAVE_METADATA=1]="HAVE_METADATA",me[me.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",me[me.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",me[me.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var _e=r(35065),Te=r(64822),xe=r(65576),Ee=r(55039),be=r(60624),Ae=r(19419),Se=r(85504),Re=r(60537),we=r(82791),ye=r(93144),Ce=r(27097);const Me=(0,Ce.wK)(Y.zi.SRC_ALPHA,Y.zi.ONE,Y.zi.ONE_MINUS_SRC_ALPHA,Y.zi.ONE_MINUS_SRC_ALPHA),Oe=(0,Ce.if)(Y.zi.ONE,Y.zi.ONE),Ie=(0,Ce.if)(Y.zi.ZERO,Y.zi.ONE_MINUS_SRC_ALPHA);function Pe(e){return e===ye.A.FrontFace?null:e===ye.A.Alpha?Ie:Oe}const Ne={factor:-1,units:-2};function Le(e,t=Y.wb.LESS){return e===ye.A.NONE||e===ye.A.FrontFace?t:Y.wb.LEQUAL}var De=r(97995),Fe=r(8310),He=r(87951);const Be=new class{constructor(e=0){this.offset=e,this.sphere=(0,Fe.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,l.s)(Ge,e,t,r),n=(0,l.m)(o,o,i),a=this.offset/(0,l.l)(n);(0,l.q)(n,n,n,a);const s=this.objectTransform.inverse;return(0,l.m)(this.tmpVertex,n,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,l.l)(e);(0,l.q)(e,e,e,r);const i=this.offset/(0,l.l)(t);(0,l.q)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,l.l)(e),r=this.offset/t;return(0,l.q)(this.sphere,e,e,r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,Fe.c)(),this._obb=(0,He.Ue)(),this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,l.l)(e)}applyToVertex(e,t,r){const i=(0,l.s)(Ge,e,t,r),o=(0,l.s)(Ue,e,t,r+this.componentLocalOriginLength),n=this._totalOffset/(0,l.l)(o);return(0,l.q)(this._tmpVertex,i,o,n),this._tmpVertex}applyToAabb(e){const t=(0,l.s)(Ge,e[0],e[1],e[2]+this.componentLocalOriginLength),r=(0,l.s)(Ue,e[3],e[4],e[5]+this.componentLocalOriginLength),i=(0,l.r)(ze,t),o=(0,l.r)(Ve,r),n=(0,l.u)(We,t),a=(0,l.u)(je,r),s=(0,l.v)(ke,n,a);s[0]=i[0]*o[0]<0?0:s[0],s[1]=i[1]*o[1]<0?0:s[1],s[2]=i[2]*o[2]<0?0:s[2];const c=(0,l.l)(s);if(c<this._totalOffset)return e[0]-=t[0]<0?this._totalOffset:0,e[1]-=t[1]<0?this._totalOffset:0,e[2]-=t[2]<0?this._totalOffset:0,e[3]+=r[0]>0?this._totalOffset:0,e[4]+=r[1]>0?this._totalOffset:0,e[5]+=r[2]>0?this._totalOffset:0,e;const d=(0,l.w)(ke,n,a),u=(0,l.l)(d),h=this._totalOffset/u,m=this._totalOffset/c;return e[0]+=t[0]*(t[0]>0?h:m),e[1]+=t[1]*(t[1]>0?h:m),e[2]+=t[2]*(t[2]>0?h:m),e[3]+=r[0]*(r[0]<0?h:m),e[4]+=r[1]*(r[1]<0?h:m),e[5]+=r[2]*(r[2]<0?h:m),e}applyToMbs(e){const t=(0,l.l)(e),r=this._totalOffset/t;return(0,l.q)(this._mbs,e,e,r),this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){return(0,He.gI)(e,this._totalOffset,this._totalOffset,Te.JY.Global,this._obb),this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=(0,l.s)(Ge,e,t,r),o=(0,l.e)(Ue,i,this.localOrigin),n=this.offset/(0,l.l)(o);return(0,l.q)(this.tmpVertex,i,o,n),this.tmpVertex}applyToAabb(e){const t=ze,r=Ve,i=We;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const n=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let o=0;o<3;++o)i[o]=0==(e&1<<o)?t[o]:r[o];n(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0==(a&e)){for(let o=0;o<3;++o)i[o]=0!=(a&1<<o)?0:0!=(e&1<<o)?t[o]:r[o];n(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Ge=(0,c.c)(),Ue=(0,c.c)(),ze=(0,c.c)(),Ve=(0,c.c)(),We=(0,c.c)(),je=(0,c.c)(),ke=(0,c.c)();function qe(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length;i*=n;for(let r=0;r<a;++r){const a=2*e[r];o[i]=t[a],o[i+1]=t[a+1],i+=n}}function Xe(e,t,r,i,o){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],i+=a}}function $e(e,t,r,i,o=1){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===o)for(let r=0;r<s;++r){const o=4*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],n[i+3]=t[o+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],n[i+3]=t[s+3],i+=a}}function Ye(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}function Je(e,t,r,i,o,n,s){switch(e){case _e.T.POSITION:{(0,fe.hu)(3===t.size);const o=n.getField(e,m.ct);(0,fe.hu)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,i,o,n=1){if(!r)return void Xe(e,t,i,o,n);const s=i.typedBuffer,l=i.typedBufferStride,c=e.length,d=r[0],u=r[1],h=r[2],m=r[4],f=r[5],p=r[6],g=r[8],v=r[9],_=r[10],T=r[12],x=r[13],E=r[14];o*=l;let b=0,A=0,S=0;const R=(0,a.y)(r)?e=>{b=t[e]+T,A=t[e+1]+x,S=t[e+2]+E}:e=>{const r=t[e],i=t[e+1],o=t[e+2];b=d*r+m*i+g*o+T,A=u*r+f*i+v*o+x,S=h*r+p*i+_*o+E};if(1===n)for(let t=0;t<c;++t)R(3*e[t]),s[o]=b,s[o+1]=A,s[o+2]=S,o+=l;else for(let t=0;t<c;++t){R(3*e[t]);for(let e=0;e<n;++e)s[o]=b,s[o+1]=A,s[o+2]=S,o+=l}}(r,t.data,i,o,s);break}case _e.T.NORMAL:{(0,fe.hu)(3===t.size);const i=n.getField(e,m.ct);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o,n=1){if(!r)return void Xe(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],v=s[8],_=s[9],T=s[10],x=!(0,a.z)(s),E=1e-6,b=1-E;o*=c;let A=0,S=0,R=0;const w=(0,a.y)(s)?e=>{A=t[e],S=t[e+1],R=t[e+2]}:e=>{const r=t[e],i=t[e+1],o=t[e+2];A=u*r+f*i+v*o,S=h*r+p*i+_*o,R=m*r+g*i+T*o};if(1===n)if(x)for(let t=0;t<d;++t){w(3*e[t]);const r=A*A+S*S+R*R;if(r<b&&r>E){const e=1/Math.sqrt(r);l[o]=A*e,l[o+1]=S*e,l[o+2]=R*e}else l[o]=A,l[o+1]=S,l[o+2]=R;o+=c}else for(let t=0;t<d;++t)w(3*e[t]),l[o]=A,l[o+1]=S,l[o+2]=R,o+=c;else for(let t=0;t<d;++t){if(w(3*e[t]),x){const e=A*A+S*S+R*R;if(e<b&&e>E){const t=1/Math.sqrt(e);A*=t,S*=t,R*=t}}for(let e=0;e<n;++e)l[o]=A,l[o+1]=S,l[o+2]=R,o+=c}}(r,t.data,o,i,s);break}case _e.T.NORMALCOMPRESSED:{(0,fe.hu)(2===t.size);const i=n.getField(e,m.or);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&qe(r,t.data,i,s);break}case _e.T.UV0:{(0,fe.hu)(2===t.size);const i=n.getField(e,m.Eu);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&qe(r,t.data,i,s);break}case _e.T.COLOR:case _e.T.SYMBOLCOLOR:{const i=n.getField(e,m.mc);(0,fe.hu)(!!i,`No buffer view for ${e}`),(0,fe.hu)(3===t.size||4===t.size),!i||3!==t.size&&4!==t.size||function(e,t,r,i,o,n=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,r!==t.length||4!==r)if(1!==n)if(4!==r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}else for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else{if(4===r){for(let r=0;r<l;++r){const i=4*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}return}for(let r=0;r<l;++r){const i=3*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}else{a[o]=t[0],a[o+1]=t[1],a[o+2]=t[2],a[o+3]=t[3];const e=new Uint32Array(i.typedBuffer.buffer,i.start),r=s/4,c=e[o/=4];o+=r;const d=l*n;for(let t=1;t<d;++t)e[o]=c,o+=r}}(r,t.data,t.size,i,s);break}case _e.T.COLORFEATUREATTRIBUTE:{const i=n.getField(e,m.ly);(0,fe.hu)(!!i,`No buffer view for ${e}`),(0,fe.hu)(1===t.size),i&&1===t.size&&function(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length,s=t[0];i*=n;for(let e=0;e<a;++e)o[i]=s,i+=n}(r,t.data,i,s);break}case _e.T.TANGENT:{(0,fe.hu)(4===t.size);const i=n.getField(e,m.ek);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o,n=1){if(!r)return void $e(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],v=s[8],_=s[9],T=s[10],x=!(0,a.z)(s),E=1e-6,b=1-E;if(o*=c,1===n)for(let r=0;r<d;++r){const i=4*e[r],n=t[i],a=t[i+1],s=t[i+2],d=t[i+3];let A=u*n+f*a+v*s,S=h*n+p*a+_*s,R=m*n+g*a+T*s;if(x){const e=A*A+S*S+R*R;if(e<b&&e>E){const t=1/Math.sqrt(e);A*=t,S*=t,R*=t}}l[o]=A,l[o+1]=S,l[o+2]=R,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],a=t[i],s=t[i+1],d=t[i+2],A=t[i+3];let S=u*a+f*s+v*d,R=h*a+p*s+_*d,w=m*a+g*s+T*d;if(x){const e=S*S+R*R+w*w;if(e<b&&e>E){const t=1/Math.sqrt(e);S*=t,R*=t,w*=t}}for(let e=0;e<n;++e)l[o]=S,l[o+1]=R,l[o+2]=w,l[o+3]=A,o+=c}}(r,t.data,o,i,s);break}case _e.T.PROFILERIGHT:case _e.T.PROFILEUP:case _e.T.PROFILEVERTEXANDNORMAL:case _e.T.FEATUREVALUE:{(0,fe.hu)(4===t.size);const i=n.getField(e,m.ek);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&$e(r,t.data,i,s)}}}class Ze{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.indices.get(_e.T.POSITION).length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)Je(a,t,s,r,i,o,n);else if(a===_e.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(_e.T.POSITION);if((0,fe.hu)(!!t,`No buffer view for ${a}`),t){const r=t.length,i=o.getField(a,m.mc);Ye(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var Ke=r(57790),Qe=r(88669),et=r(135),tt=r(15719),rt=r(96310),it=r(78869),ot=r(14589),nt=r(83475),at=r(59377);Y.wb.LESS,Y.wb.ALWAYS;const st={mask:255},lt={function:{func:Y.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:Y.xS.KEEP,zFail:Y.xS.KEEP,zPass:Y.xS.ZERO}},ct={function:{func:Y.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:Y.xS.KEEP,zFail:Y.xS.KEEP,zPass:Y.xS.REPLACE}};Y.wb.EQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,Y.xS.KEEP,Y.xS.KEEP,Y.xS.KEEP,Y.wb.NOTEQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,Y.xS.KEEP,Y.xS.KEEP,Y.xS.KEEP;const dt=[1,1,.5],ut=[0,.6,.2],ht=[0,1,.2];var mt=r(32078);class ft extends tt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.g)(dt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=be.r.Attribute,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,Qe.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.Gv.Less,this.textureAlphaMode=B.JJ.Blend,this.textureAlphaCutoff=rt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=we.yD.Occlude,this.isDecoration=!1}}class pt extends ot.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===Te.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?et.N.Default:et.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,pt.shader)}_initializeProgram(e,t){return new at.$(e.rctx,t.get().build(this.configuration),nt.i)}_convertDepthTestFunction(e){return e===B.Gv.Lequal?Y.wb.LEQUAL:Y.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===ye.A.NONE,o=e===ye.A.FrontFace;return(0,Ce.sm)({blending:r.output!==Ee.H.Color&&r.output!==Ee.H.Alpha||!r.transparent?null:i?Me:Pe(e),culling:gt(r)?(0,Ce.zp)(r.cullFace):null,depthTest:{func:Le(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ce.LZ:null,colorWrite:Ce.BK,stencilWrite:r.hasOccludees?st:null,stencilTest:r.hasOccludees?t?ct:lt:null,polygonOffset:i||o?null:(n=r.enableOffset,n?Ne:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function gt(e){return e.cullFace!==B.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}pt.shader=new it.J(mt.D,(()=>r.e(9291).then(r.bind(r,79291))));var vt=r(43697),_t=r(51354),Tt=r(47624),xt=r(67498);class Et extends Tt.PO{}(0,vt._)([(0,_t.o)({constValue:!0})],Et.prototype,"hasSliceHighlight",void 0),(0,vt._)([(0,_t.o)({constValue:!1})],Et.prototype,"hasSliceInVertexProgram",void 0),(0,vt._)([(0,_t.o)({constValue:xt.P.Pass})],Et.prototype,"pbrTextureBindType",void 0);class bt extends Et{constructor(){super(...arguments),this.output=Ee.H.Color,this.alphaDiscardMode=B.JJ.Opaque,this.doubleSidedMode=Ae.q.None,this.pbrMode=Se.f7.Disabled,this.cullFace=B.Vr.None,this.transparencyPassType=ye.A.NONE,this.normalType=be.r.Attribute,this.textureCoordinateType=et.N.None,this.customDepthTest=B.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,vt._)([(0,_t.o)({count:Ee.H.COUNT})],bt.prototype,"output",void 0),(0,vt._)([(0,_t.o)({count:B.JJ.COUNT})],bt.prototype,"alphaDiscardMode",void 0),(0,vt._)([(0,_t.o)({count:Ae.q.COUNT})],bt.prototype,"doubleSidedMode",void 0),(0,vt._)([(0,_t.o)({count:Se.f7.COUNT})],bt.prototype,"pbrMode",void 0),(0,vt._)([(0,_t.o)({count:B.Vr.COUNT})],bt.prototype,"cullFace",void 0),(0,vt._)([(0,_t.o)({count:ye.A.COUNT})],bt.prototype,"transparencyPassType",void 0),(0,vt._)([(0,_t.o)({count:be.r.COUNT})],bt.prototype,"normalType",void 0),(0,vt._)([(0,_t.o)({count:et.N.COUNT})],bt.prototype,"textureCoordinateType",void 0),(0,vt._)([(0,_t.o)({count:B.Gv.COUNT})],bt.prototype,"customDepthTest",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"spherical",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasVertexColors",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasSymbolColors",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasVerticalOffset",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasSlicePlane",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasSliceHighlight",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasColorTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasMetallicRoughnessTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasEmissionTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasOcclusionTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasNormalTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasScreenSizePerspective",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasVertexTangents",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasOccludees",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"multipassEnabled",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasModelTransformation",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"offsetBackfaces",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"vvSize",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"vvColor",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"receiveShadows",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"receiveAmbientOcclusion",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"textureAlphaPremultiplied",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"instanced",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"instancedColor",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"instancedDoublePrecision",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"writeDepth",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"transparent",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"enableOffset",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"cullAboveGround",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"snowCover",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasColorTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasEmissionTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasNormalTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasOcclusionTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,vt._)([(0,_t.o)({constValue:!0})],bt.prototype,"hasVvInstancing",void 0),(0,vt._)([(0,_t.o)({constValue:!1})],bt.prototype,"useCustomDTRExponentForWater",void 0),(0,vt._)([(0,_t.o)({constValue:!1})],bt.prototype,"supportsTextureAtlas",void 0),(0,vt._)([(0,_t.o)({constValue:!0})],bt.prototype,"useFillLights",void 0);var At=r(41846);class St extends pt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=be.r.Attribute,t.doubleSidedMode=Ae.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,St.shader)}}St.shader=new it.J(At.R,(()=>r.e(8096).then(r.bind(r,38096))));class Rt extends we.F5{constructor(e){super(e,yt),this.supportsEdges=!0,this._configuration=new bt,this._vertexBufferLayout=function(e){const t=(0,xe.U$)().vec3f(_e.T.POSITION);return e.normalType===be.r.Compressed?t.vec2i16(_e.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(_e.T.NORMAL),e.hasVertexTangents&&t.vec4f(_e.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(_e.T.UV0),e.hasVertexColors&&t.vec4u8(_e.T.COLOR),e.hasSymbolColors&&t.vec4u8(_e.T.SYMBOLCOLOR),(0,U.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(_e.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Ee.H.Shadow&&e!==Ee.H.ShadowExcludeHighlight&&e!==Ee.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?B.Vr.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==Ee.H.Color&&e!==Ee.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ae.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ae.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ae.q.WindingOrder:Ae.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Se.f7.Schematic:Se.f7.Normal:Se.f7.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(Nt,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case Te.JY.Global:n=(0,l.n)(It,Nt);break;case Te.JY.Local:n=(0,l.i)(It,Ot)}let a=0;const s=(0,l.g)(Lt,Nt,e.eye),c=(0,l.l)(s),d=(0,l.b)(s,s,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,l.d)(n,d)),a+=(0,Ke.Hx)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,l.b)(n,n,a),(0,l.t)(Pt,n,r.transform.inverseRotation),i=(0,l.g)(Ct,i,Pt),o=(0,l.g)(Mt,o,Pt)}(0,Ke.Bw)(e,r,i,o,function(e){return null!=e?(Be.offset=e,Be):null}(r.verticalOffset),n)}produces(e,t){return!(t!==Ee.H.Color&&t!==Ee.H.Alpha&&t!==Ee.H.Depth&&t!==Ee.H.Normal&&t!==Ee.H.Shadow&&t!==Ee.H.ShadowHighlight&&t!==Ee.H.ShadowExcludeHighlight&&t!==Ee.H.Highlight&&t!==Ee.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?De.r.TRANSPARENT_MATERIAL:De.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:De.r.OPAQUE_MATERIAL)&&e!==De.r.DRAPED_MATERIAL)}createGLMaterial(e){return new wt(e)}createBufferWriter(){return new Ze(this._vertexBufferLayout)}}class wt extends Re.F{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==Ee.H.Color&&this._output!==Ee.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?St:pt,e)}}const yt=new class extends ft{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},Ct=(0,c.c)(),Mt=(0,c.c)(),Ot=(0,c.f)(0,0,1),It=(0,c.c)(),Pt=(0,c.c)(),Nt=(0,c.c)(),Lt=(0,c.c)(),Dt=P.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Ft(e){throw new I.Z("",`Request for object resource failed: ${e}`)}function Ht(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Dt.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Dt.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Dt.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Dt.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Dt.warn("Indexed geometries must specify faces"),i=!1;break}default:Dt.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Dt.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Dt.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Bt(e){const t=(0,d.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,d.pp)(t,r.bbMin),(0,d.pp)(t,r.bbMax))})),t}function Gt(e){switch(e){case"mask":return B.JJ.Mask;case"maskAndTransparency":return B.JJ.MaskBlend;case"none":return B.JJ.Opaque;default:return B.JJ.Blend}}function Ut(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const zt=new D.G(1,2,"wosr");var Vt=r(57758);async function Wt(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=null!=t&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,M.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),Ft(i.error.details.url)}(e,r,t);const i=await(0,M.q6)((0,C.Z)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),Ft(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],n=o.images[0].data;if(!n){Dt.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:Y.e8.REPEAT,t:Y.e8.REPEAT},preMultiplyAlpha:Gt(l)!==B.JJ.Opaque},d=null!=t&&t.disableTextures?Promise.resolve(null):F(a,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,O.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new N,a=e.resource,s=D.G.parse(a.version||"1.0","wosr");zt.validate(s);const l=a.model.name,d=a.model.geometries,u=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<d.length;e++){const a=d[e];if(!Ht(a))continue;const s=Ut(a),l=a.params.vertexAttributes,p=[];for(const e in l){const t=l[e],r=t.values;p.push([e,new H.a(r,t.valuesPerElement,!0)])}const g=[];if("PerAttributeArray"!==a.params.topology){const e=a.params.faces;for(const t in e)g.push([t,e[t].values])}const v=s.texture,_=h&&h[v];if(_&&!f.has(v)){const{image:e,parameters:t}=_,r=new ge(e,t);i.push(r),f.set(v,r)}const T=f.get(v),x=T?T.id:void 0,E=s.material;let b=n.get(E,v);if(null==b){const e=u[E.substring(E.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=_&&_.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=_?Gt(_.alphaChannelUsage):void 0,a={ambient:(0,c.g)(e.diffuse),diffuse:(0,c.g)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:B.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:_?.parameters.preMultiplyAlpha??!1};null!=t&&t.materialParamsMixin&&Object.assign(a,t.materialParamsMixin),b=new Rt(a),n.set(E,v,b)}o.push(b);const A=new G.Z(b,p,g);m+=g.find((e=>e[0]===_e.T.POSITION))?.[1].length??0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Bt(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),u=n.model.meta?.ESRI_proxyEllipsoid,A=n.meta.isEsriSymbolResource&&null!=u&&n.meta.uri.includes("/RealisticTrees/");A&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,d=n.count,u=(0,c.c)(),h=(0,c.c)(),f=(0,c.c)(),p=new Uint8Array(4*d),g=new Float64Array(3*d),v=(0,a.a)((0,s.c)(),o.transform);let _=0,T=0;for(let a=0;a<d;a++){n.getVec(a,h),i.getVec(a,u),(0,l.m)(h,h,o.transform),(0,l.g)(f,h,t.center),(0,l.E)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),d=Math.min(.45+.55*c*c,1);(0,l.E)(f,f,t.radius),null!==v&&(0,l.m)(f,f,v),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.f)(f,f,u,s>-1?.2:Math.min(-4*s-3.8,1)),g[_]=f[0],g[_+1]=f[1],g[_+2]=f[2],_+=3,p[T]=255*d,p[T+1]=255*d,p[T+2]=255*d,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(g),o.attributes.color=new m.mc(p)}}}(n,u));const S=!!t.usePBR,w=n.meta.isEsriSymbolResource?{usePBR:S,isSchematic:!1,treeRendering:A,mrrFactors:[...ht]}:{usePBR:S,isSchematic:!1,treeRendering:!1,mrrFactors:[...dt]},I={...t.materialParamsMixin,treeRendering:A},{engineResources:P,referenceBoundingBox:U}=function(e,t,r,i){const n=e.model,a=new Array,s=new Map,u=new Map,T=n.lods.length,x=(0,d.cS)();return n.lods.forEach(((e,A)=>{const S=!0===i.skipHighLods&&(T>1&&0===A||T>3&&1===A)||!1===i.skipHighLods&&null!=i.singleLodIndex&&A!==i.singleLodIndex;if(S&&0!==A)return;const w=new y(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=S?new Rt({}):function(e,t,r,i,o,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),d=e.materials.get(t.material),u=null!=t.attributes.texCoord0,h=null!=t.attributes.normal;if(null==d)return null;const m=function(e){switch(e){case"BLEND":return B.JJ.Blend;case"MASK":return B.JJ.Mask;case"OPAQUE":case null:case void 0:return B.JJ.Opaque}}(d.alphaMode);if(!n.has(s)){if(u){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new ge((0,b.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,b.$A)(e)&&r,encoding:(0,b.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(d.textureColor,m!==B.JJ.Opaque),t(d.textureNormal),t(d.textureOcclusion),t(d.textureEmissive),t(d.textureMetallicRoughness)}const r=d.color[0]**(1/Vt.K),f=d.color[1]**(1/Vt.K),p=d.color[2]**(1/Vt.K),g=d.emissiveFactor[0]**(1/Vt.K),v=d.emissiveFactor[1]**(1/Vt.K),_=d.emissiveFactor[2]**(1/Vt.K),T=null!=d.textureColor&&u?a.get(d.textureColor):null,x=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==o&&(null==n||(0,l.k)(n,c.Z))&&null==a&&(null==i||1===i)&&(null==r||1===r||0===r)}({normalTexture:d.textureNormal,metallicRoughnessTexture:d.textureMetallicRoughness,metallicFactor:d.metallicFactor,roughnessFactor:d.roughnessFactor,emissiveTexture:d.textureEmissive,emissiveFactor:d.emissiveFactor,occlusionTexture:d.textureOcclusion});n.set(s,new Rt({...i,transparent:m===B.JJ.Blend,customDepthTest:B.Gv.Lequal,textureAlphaMode:m,textureAlphaCutoff:d.alphaCutoff,diffuse:[r,f,p],ambient:[r,f,p],opacity:d.opacity,doubleSided:d.doubleSided,doubleSidedType:"winding-order",cullFace:d.doubleSided?B.Vr.None:B.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:h?be.r.Attribute:be.r.ScreenDerivative,castShadows:!0,textureId:null!=T?T.id:void 0,colorMixMode:d.colorMixMode,normalTextureId:null!=d.textureNormal&&u?a.get(d.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=d.textureOcclusion&&u?a.get(d.textureOcclusion).id:void 0,emissiveTextureId:null!=d.textureEmissive&&u?a.get(d.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=d.textureMetallicRoughness&&u?a.get(d.textureMetallicRoughness).id:void 0,emissiveFactor:[g,v,_],mrrFactors:x?[...ut]:[d.metallicFactor,d.roughnessFactor,i.mrrFactors[2]],isSchematic:x,colorTextureTransformMatrix:R(d.colorTextureTransform),normalTextureTransformMatrix:R(d.normalTextureTransform),occlusionTextureTransformMatrix:R(d.occlusionTextureTransform),emissiveTextureTransformMatrix:R(d.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:R(d.metallicRoughnessTextureTransform),...o}))}const f=n.get(s);if(r.stageResources.materials.push(f),u){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(d.textureColor),e(d.textureNormal),e(d.textureOcclusion),e(d.textureEmissive),e(d.textureMetallicRoughness)}return f}(n,e,w,t,r,s,u),{geometry:a,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,E.p)(e.indices||r,e.primitiveType),n=h(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,f.t)(n,a,e.transform,3,s);const l=[[_e.T.POSITION,new H.a(n,3,!0)]],c=[[_e.T.POSITION,i]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.d)(jt,e.transform),(0,f.a)(t,n,jt,3,a),l.push([_e.T.NORMAL,new H.a(t,3,!0)]),c.push([_e.T.NORMAL,i])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.d)(jt,e.transform),(0,p.t)(t,n,jt,4,a),l.push([_e.T.TANGENT,new H.a(t,4,!0)]),c.push([_e.T.TANGENT,i])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,g.n)(t,o,2,n),l.push([_e.T.UV0,new H.a(t,2,!0)]),c.push([_e.T.UV0,i])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,f.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,v.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,f.s)(t,e.attributes.color,1/256,4)),l.push([_e.T.COLOR,new H.a(t,4,!0)]),c.push([_e.T.COLOR,i])}return{geometry:new G.Z(t,l,c),vertexCount:r}}(e,null!=i?i:new Rt({})),y=a.boundingInfo;null!=y&&0===A&&((0,d.pp)(x,y.bbMin),(0,d.pp)(x,y.bbMax)),null!=i&&(w.stageResources.geometries.push(a),w.numberOfVertices+=T)})),S||a.push(w)})),{engineResources:a,referenceBoundingBox:x}}(n,w,I,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:P,referenceBoundingBox:U,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}const jt=(0,n.c)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>d});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
285
+ `),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>u,Z:()=>c,c:()=>i,f:()=>o});const c=n(),u=a(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>u,e:()=>l,n:()=>d,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[4],d=r[5],h=r[6],m=r[8],f=r[9],p=r[10],g=r[12],v=r[13],_=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+u*i+m*a+g,e[x+1]=l*r+d*i+f*a+v,e[x+2]=c*r+h*i+p*a+_,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[3],d=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,v=0;for(let r=0;r<a;r++){const r=t[g],i=t[g+1],a=t[g+2];e[v]=s*r+u*i+m*a,e[v+1]=l*r+d*i+f*a,e[v+2]=c*r+h*i+p*a,g+=n,v+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function u(e,t){d(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function d(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:d,normalizeView:u,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},23670:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(20102);let o=class{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),a=/^\s*\d+\s*$/;if(!r||!r.match||!a.test(r))throw new i.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n||!n.match||!a.test(n))throw new i.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new o(s,l,t)}}},43090:(e,t,r)=>{function i(e){return 32+e.length}function o(e){if(!e)return 0;let t=l;for(const r in e)if(e.hasOwnProperty(r)){const o=e[r];switch(typeof o){case"string":t+=i(o);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function n(e){if(!e)return 0;if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return 32+8*t;let r=c;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=l;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e){switch(typeof e){case"object":return n(e);case"string":return i(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(e,t){return c+e.length*t}r.d(t,{Ul:()=>n,do:()=>s,f2:()=>o});const l=32,c=32},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>u,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.g)(e.origin),vector:(0,a.g)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.f)(r.vector,t,e),r}function u(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,u=(0,n.f)(s.WM.get(),t,c),d=(0,n.j)(l,u)/(0,n.o)(l);return(0,n.i)(a,l,(0,i.uZ)(d,0,1)),(0,n.g)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},31370:(e,t,r)=>{r.d(t,{fetch:()=>Wt});var i=r(32243),o=r(21787),n=r(46521),a=r(52138),s=r(13598),l=r(17896),c=r(65617),u=r(60437),d=r(1533);function h(e,t=!1){return e<=d.DB?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),f=r(20773),p=r(11077),g=r(10816),v=r(56067),_=r(75488),T=r(40270),x=r(91695),E=r(91911),b=r(15317),A=r(14682),S=r(1265);function R(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,n=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,a,s),(0,o.m)(l,n,l),l}class w{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class y{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new w,this.numberOfVertices=0}}var C=r(3172),M=r(66643),O=r(43090),I=r(20102),P=r(92604);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var L=r(95330),D=r(23670);async function F(e,t){const{data:r}=await(0,C.Z)(e,{responseType:"image",...t});return r}var H=r(51417),B=r(47026),G=r(22631),U=r(80442),z=r(32448),V=r(70586),W=r(17452),j=r(85958),k=r(99880);let q;var X,$;($=X||(X={}))[$.ETC1_RGB=0]="ETC1_RGB",$[$.ETC2_RGBA=1]="ETC2_RGBA",$[$.BC1_RGB=2]="BC1_RGB",$[$.BC3_RGBA=3]="BC3_RGBA",$[$.BC4_R=4]="BC4_R",$[$.BC5_RG=5]="BC5_RG",$[$.BC7_M6_RGB=6]="BC7_M6_RGB",$[$.BC7_M5_RGBA=7]="BC7_M5_RGBA",$[$.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",$[$.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",$[$.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",$[$.ATC_RGB=11]="ATC_RGB",$[$.ATC_RGBA=12]="ATC_RGBA",$[$.FXT1_RGB=17]="FXT1_RGB",$[$.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",$[$.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",$[$.ETC2_EAC_R11=20]="ETC2_EAC_R11",$[$.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",$[$.RGBA32=13]="RGBA32",$[$.RGB565=14]="RGB565",$[$.BGR565=15]="BGR565",$[$.RGBA4444=16]="RGBA4444";var Y=r(35371),J=r(57088),Z=r(45762);let K=null,Q=null;async function ee(){return null==Q&&(Q=function(){if(null==q){const e=e=>(0,k.V)(`esri/libs/basisu/${e}`);q=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return q}(),K=await Q),Q}function te(e,t,r,i,o){const n=(0,Z.RG)(t?Y.q_.COMPRESSED_RGBA8_ETC2_EAC:Y.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function re(e){return e.getNumImages()>=1&&!e.isUASTC()}function ie(e){return e.getFaces()>=1&&e.isETC1S()}function oe(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=l?i?[X.ETC2_RGBA,Y.q_.COMPRESSED_RGBA8_ETC2_EAC]:[X.ETC1_RGB,Y.q_.COMPRESSED_RGB8_ETC2]:c?i?[X.BC3_RGBA,Y.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[X.BC1_RGB,Y.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[X.RGBA32,Y.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,u))),s(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?Y.cw.LINEAR_MIPMAP_LINEAR:Y.cw.LINEAR,t.width=o,t.height=n,new J.x(e,t,{type:"compressed",levels:m})}var ne=r(17662),ae=r(4726);const se=P.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function le(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ce=le("DXT1"),ue=le("DXT3"),de=le("DXT5");var he,me,fe=r(11726),pe=r(47859);class ge extends ne.c{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=ae.U.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new z.Z,this._parameters=t||{},this._parameters.mipmap=!1!==this._parameters.mipmap,this._parameters.noUnpackFlip=this._parameters.noUnpackFlip||!1,this._parameters.preMultiplyAlpha=this._parameters.preMultiplyAlpha||!1,this._parameters.wrap=this._parameters.wrap||{s:Y.e8.REPEAT,t:Y.e8.REPEAT},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,W.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,W.HK)(e.src)||(0,W.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new pe.X;return t.wrapMode=this._parameters.wrap??Y.e8.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?Y.cw.LINEAR_MIPMAP_LINEAR:Y.cw.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.gpuMemoryUsage||function(e,t){if(null==e)return 0;if((0,d.eP)(e)||(0,d.lq)(e))return t.encoding===B.Ti.KTX2_ENCODING?function(e,t){if(null==K)return e.byteLength;const r=new K.KTX2File(new Uint8Array(e)),i=ie(r)?te(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.Ti.BASIS_ENCODING?function(e,t){if(null==K)return e.byteLength;const r=new K.BasisFile(new Uint8Array(e)),i=re(r)?te(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?ve(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new J.x(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===B.Ti.DDS_ENCODING?this._loadFromDDSData(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===B.Ti.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===B.Ti.BASIS_ENCODING?this._loadFromBasis(e,t):(0,d.lq)(t)?this._loadFromPixelData(e,t):(0,d.eP)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<he.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return se.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return se.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case ce:o=8,n=Y.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ue:o=16,n=Y.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case de:o=16,n=Y.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return se.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(se.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,u=l;let d,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,d=new Uint8Array(e,m,h),f.push(d),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:c,height:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?Y.cw.LINEAR_MIPMAP_LINEAR:Y.cw.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new J.x(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==K&&(K=await ee());const i=new K.KTX2File(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=oe(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==K&&(K=await ee());const i=new K.BasisFile(new Uint8Array(r));if(!re(i))return null;i.startTranscoding();const o=oe(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,fe.hu)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?Y.VI.LUMINANCE:3===this._parameters.components?Y.VI.RGB:Y.VI.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new J.x(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await F(t,{signal:r});return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,j.fY)(t,t.src,!1,r);return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=he.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,V.hw)(l)},a=()=>{t.readyState>=he.HAVE_CURRENT_DATA&&(n(),i(this._loadFromImage(e,t)))},s=e=>{n(),o(e||new I.Z("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,L.fu)(r,(()=>s((0,L.zE)())))}))))}_loadFromImage(e,t){const r=ve(t);this._parameters.width=r.width,this._parameters.height=r.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this._parameters.components?Y.VI.RGB:Y.VI.RGBA,i.width=r.width,i.height=r.height,this._glTexture=new J.x(e,i,t),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,V.M2)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function ve(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(me=he||(he={}))[me.HAVE_NOTHING=0]="HAVE_NOTHING",me[me.HAVE_METADATA=1]="HAVE_METADATA",me[me.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",me[me.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",me[me.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var _e=r(35065),Te=r(64822),xe=r(65576),Ee=r(55039),be=r(60624),Ae=r(19419),Se=r(85504),Re=r(60537),we=r(82791),ye=r(93144),Ce=r(27097);const Me=(0,Ce.wK)(Y.zi.SRC_ALPHA,Y.zi.ONE,Y.zi.ONE_MINUS_SRC_ALPHA,Y.zi.ONE_MINUS_SRC_ALPHA),Oe=(0,Ce.if)(Y.zi.ONE,Y.zi.ONE),Ie=(0,Ce.if)(Y.zi.ZERO,Y.zi.ONE_MINUS_SRC_ALPHA);function Pe(e){return e===ye.A.FrontFace?null:e===ye.A.Alpha?Ie:Oe}const Ne={factor:-1,units:-2};function Le(e,t=Y.wb.LESS){return e===ye.A.NONE||e===ye.A.FrontFace?t:Y.wb.LEQUAL}var De=r(97995),Fe=r(8310),He=r(87951);const Be=new class{constructor(e=0){this.offset=e,this.sphere=(0,Fe.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,l.s)(Ge,e,t,r),n=(0,l.e)(o,o,i),a=this.offset/(0,l.l)(n);(0,l.y)(n,n,n,a);const s=this.objectTransform.inverse;return(0,l.e)(this.tmpVertex,n,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,l.l)(e);(0,l.y)(e,e,e,r);const i=this.offset/(0,l.l)(t);(0,l.y)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,l.l)(e),r=this.offset/t;return(0,l.y)(this.sphere,e,e,r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,Fe.c)(),this._obb=(0,He.Ue)(),this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,l.l)(e)}applyToVertex(e,t,r){const i=(0,l.s)(Ge,e,t,r),o=(0,l.s)(Ue,e,t,r+this.componentLocalOriginLength),n=this._totalOffset/(0,l.l)(o);return(0,l.y)(this._tmpVertex,i,o,n),this._tmpVertex}applyToAabb(e){const t=(0,l.s)(Ge,e[0],e[1],e[2]+this.componentLocalOriginLength),r=(0,l.s)(Ue,e[3],e[4],e[5]+this.componentLocalOriginLength),i=(0,l.z)(ze,t),o=(0,l.z)(Ve,r),n=(0,l.v)(We,t),a=(0,l.v)(je,r),s=(0,l.w)(ke,n,a);s[0]=i[0]*o[0]<0?0:s[0],s[1]=i[1]*o[1]<0?0:s[1],s[2]=i[2]*o[2]<0?0:s[2];const c=(0,l.l)(s);if(c<this._totalOffset)return e[0]-=t[0]<0?this._totalOffset:0,e[1]-=t[1]<0?this._totalOffset:0,e[2]-=t[2]<0?this._totalOffset:0,e[3]+=r[0]>0?this._totalOffset:0,e[4]+=r[1]>0?this._totalOffset:0,e[5]+=r[2]>0?this._totalOffset:0,e;const u=(0,l.D)(ke,n,a),d=(0,l.l)(u),h=this._totalOffset/d,m=this._totalOffset/c;return e[0]+=t[0]*(t[0]>0?h:m),e[1]+=t[1]*(t[1]>0?h:m),e[2]+=t[2]*(t[2]>0?h:m),e[3]+=r[0]*(r[0]<0?h:m),e[4]+=r[1]*(r[1]<0?h:m),e[5]+=r[2]*(r[2]<0?h:m),e}applyToMbs(e){const t=(0,l.l)(e),r=this._totalOffset/t;return(0,l.y)(this._mbs,e,e,r),this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){return(0,He.gI)(e,this._totalOffset,this._totalOffset,Te.JY.Global,this._obb),this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=(0,l.s)(Ge,e,t,r),o=(0,l.g)(Ue,i,this.localOrigin),n=this.offset/(0,l.l)(o);return(0,l.y)(this.tmpVertex,i,o,n),this.tmpVertex}applyToAabb(e){const t=ze,r=Ve,i=We;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const n=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let o=0;o<3;++o)i[o]=0==(e&1<<o)?t[o]:r[o];n(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0==(a&e)){for(let o=0;o<3;++o)i[o]=0!=(a&1<<o)?0:0!=(e&1<<o)?t[o]:r[o];n(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Ge=(0,c.c)(),Ue=(0,c.c)(),ze=(0,c.c)(),Ve=(0,c.c)(),We=(0,c.c)(),je=(0,c.c)(),ke=(0,c.c)();function qe(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length;i*=n;for(let r=0;r<a;++r){const a=2*e[r];o[i]=t[a],o[i+1]=t[a+1],i+=n}}function Xe(e,t,r,i,o){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],i+=a}}function $e(e,t,r,i,o=1){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===o)for(let r=0;r<s;++r){const o=4*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],n[i+3]=t[o+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],n[i+3]=t[s+3],i+=a}}function Ye(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}function Je(e,t,r,i,o,n,s){switch(e){case _e.T.POSITION:{(0,fe.hu)(3===t.size);const o=n.getField(e,m.ct);(0,fe.hu)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,i,o,n=1){if(!r)return void Xe(e,t,i,o,n);const s=i.typedBuffer,l=i.typedBufferStride,c=e.length,u=r[0],d=r[1],h=r[2],m=r[4],f=r[5],p=r[6],g=r[8],v=r[9],_=r[10],T=r[12],x=r[13],E=r[14];o*=l;let b=0,A=0,S=0;const R=(0,a.y)(r)?e=>{b=t[e]+T,A=t[e+1]+x,S=t[e+2]+E}:e=>{const r=t[e],i=t[e+1],o=t[e+2];b=u*r+m*i+g*o+T,A=d*r+f*i+v*o+x,S=h*r+p*i+_*o+E};if(1===n)for(let t=0;t<c;++t)R(3*e[t]),s[o]=b,s[o+1]=A,s[o+2]=S,o+=l;else for(let t=0;t<c;++t){R(3*e[t]);for(let e=0;e<n;++e)s[o]=b,s[o+1]=A,s[o+2]=S,o+=l}}(r,t.data,i,o,s);break}case _e.T.NORMAL:{(0,fe.hu)(3===t.size);const i=n.getField(e,m.ct);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o,n=1){if(!r)return void Xe(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],v=s[8],_=s[9],T=s[10],x=!(0,a.z)(s),E=1e-6,b=1-E;o*=c;let A=0,S=0,R=0;const w=(0,a.y)(s)?e=>{A=t[e],S=t[e+1],R=t[e+2]}:e=>{const r=t[e],i=t[e+1],o=t[e+2];A=d*r+f*i+v*o,S=h*r+p*i+_*o,R=m*r+g*i+T*o};if(1===n)if(x)for(let t=0;t<u;++t){w(3*e[t]);const r=A*A+S*S+R*R;if(r<b&&r>E){const e=1/Math.sqrt(r);l[o]=A*e,l[o+1]=S*e,l[o+2]=R*e}else l[o]=A,l[o+1]=S,l[o+2]=R;o+=c}else for(let t=0;t<u;++t)w(3*e[t]),l[o]=A,l[o+1]=S,l[o+2]=R,o+=c;else for(let t=0;t<u;++t){if(w(3*e[t]),x){const e=A*A+S*S+R*R;if(e<b&&e>E){const t=1/Math.sqrt(e);A*=t,S*=t,R*=t}}for(let e=0;e<n;++e)l[o]=A,l[o+1]=S,l[o+2]=R,o+=c}}(r,t.data,o,i,s);break}case _e.T.NORMALCOMPRESSED:{(0,fe.hu)(2===t.size);const i=n.getField(e,m.or);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&qe(r,t.data,i,s);break}case _e.T.UV0:{(0,fe.hu)(2===t.size);const i=n.getField(e,m.Eu);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&qe(r,t.data,i,s);break}case _e.T.COLOR:case _e.T.SYMBOLCOLOR:{const i=n.getField(e,m.mc);(0,fe.hu)(!!i,`No buffer view for ${e}`),(0,fe.hu)(3===t.size||4===t.size),!i||3!==t.size&&4!==t.size||function(e,t,r,i,o,n=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,r!==t.length||4!==r)if(1!==n)if(4!==r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}else for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else{if(4===r){for(let r=0;r<l;++r){const i=4*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}return}for(let r=0;r<l;++r){const i=3*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}else{a[o]=t[0],a[o+1]=t[1],a[o+2]=t[2],a[o+3]=t[3];const e=new Uint32Array(i.typedBuffer.buffer,i.start),r=s/4,c=e[o/=4];o+=r;const u=l*n;for(let t=1;t<u;++t)e[o]=c,o+=r}}(r,t.data,t.size,i,s);break}case _e.T.COLORFEATUREATTRIBUTE:{const i=n.getField(e,m.ly);(0,fe.hu)(!!i,`No buffer view for ${e}`),(0,fe.hu)(1===t.size),i&&1===t.size&&function(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length,s=t[0];i*=n;for(let e=0;e<a;++e)o[i]=s,i+=n}(r,t.data,i,s);break}case _e.T.TANGENT:{(0,fe.hu)(4===t.size);const i=n.getField(e,m.ek);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o,n=1){if(!r)return void $e(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],v=s[8],_=s[9],T=s[10],x=!(0,a.z)(s),E=1e-6,b=1-E;if(o*=c,1===n)for(let r=0;r<u;++r){const i=4*e[r],n=t[i],a=t[i+1],s=t[i+2],u=t[i+3];let A=d*n+f*a+v*s,S=h*n+p*a+_*s,R=m*n+g*a+T*s;if(x){const e=A*A+S*S+R*R;if(e<b&&e>E){const t=1/Math.sqrt(e);A*=t,S*=t,R*=t}}l[o]=A,l[o+1]=S,l[o+2]=R,l[o+3]=u,o+=c}else for(let r=0;r<u;++r){const i=4*e[r],a=t[i],s=t[i+1],u=t[i+2],A=t[i+3];let S=d*a+f*s+v*u,R=h*a+p*s+_*u,w=m*a+g*s+T*u;if(x){const e=S*S+R*R+w*w;if(e<b&&e>E){const t=1/Math.sqrt(e);S*=t,R*=t,w*=t}}for(let e=0;e<n;++e)l[o]=S,l[o+1]=R,l[o+2]=w,l[o+3]=A,o+=c}}(r,t.data,o,i,s);break}case _e.T.PROFILERIGHT:case _e.T.PROFILEUP:case _e.T.PROFILEVERTEXANDNORMAL:case _e.T.FEATUREVALUE:{(0,fe.hu)(4===t.size);const i=n.getField(e,m.ek);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&$e(r,t.data,i,s)}}}class Ze{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.indices.get(_e.T.POSITION).length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)Je(a,t,s,r,i,o,n);else if(a===_e.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(_e.T.POSITION);if((0,fe.hu)(!!t,`No buffer view for ${a}`),t){const r=t.length,i=o.getField(a,m.mc);Ye(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var Ke=r(57790),Qe=r(88669),et=r(135),tt=r(15719),rt=r(96310),it=r(78869),ot=r(14589),nt=r(83475),at=r(59377);Y.wb.LESS,Y.wb.ALWAYS;const st={mask:255},lt={function:{func:Y.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:Y.xS.KEEP,zFail:Y.xS.KEEP,zPass:Y.xS.ZERO}},ct={function:{func:Y.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:Y.xS.KEEP,zFail:Y.xS.KEEP,zPass:Y.xS.REPLACE}};Y.wb.EQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,Y.xS.KEEP,Y.xS.KEEP,Y.xS.KEEP,Y.wb.NOTEQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,Y.xS.KEEP,Y.xS.KEEP,Y.xS.KEEP;const ut=[1,1,.5],dt=[0,.6,.2],ht=[0,1,.2];var mt=r(32078);class ft extends tt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.e)(ut),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=be.r.Attribute,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,Qe.a)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.Gv.Less,this.textureAlphaMode=B.JJ.Blend,this.textureAlphaCutoff=rt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=we.yD.Occlude,this.isDecoration=!1}}class pt extends ot.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===Te.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?et.N.Default:et.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,pt.shader)}_initializeProgram(e,t){return new at.$(e.rctx,t.get().build(this.configuration),nt.i)}_convertDepthTestFunction(e){return e===B.Gv.Lequal?Y.wb.LEQUAL:Y.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===ye.A.NONE,o=e===ye.A.FrontFace;return(0,Ce.sm)({blending:r.output!==Ee.H.Color&&r.output!==Ee.H.Alpha||!r.transparent?null:i?Me:Pe(e),culling:gt(r)?(0,Ce.zp)(r.cullFace):null,depthTest:{func:Le(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ce.LZ:null,colorWrite:Ce.BK,stencilWrite:r.hasOccludees?st:null,stencilTest:r.hasOccludees?t?ct:lt:null,polygonOffset:i||o?null:(n=r.enableOffset,n?Ne:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function gt(e){return e.cullFace!==B.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}pt.shader=new it.J(mt.D,(()=>r.e(9291).then(r.bind(r,79291))));var vt=r(43697),_t=r(51354),Tt=r(47624),xt=r(67498);class Et extends Tt.PO{}(0,vt._)([(0,_t.o)({constValue:!0})],Et.prototype,"hasSliceHighlight",void 0),(0,vt._)([(0,_t.o)({constValue:!1})],Et.prototype,"hasSliceInVertexProgram",void 0),(0,vt._)([(0,_t.o)({constValue:xt.P.Pass})],Et.prototype,"pbrTextureBindType",void 0);class bt extends Et{constructor(){super(...arguments),this.output=Ee.H.Color,this.alphaDiscardMode=B.JJ.Opaque,this.doubleSidedMode=Ae.q.None,this.pbrMode=Se.f7.Disabled,this.cullFace=B.Vr.None,this.transparencyPassType=ye.A.NONE,this.normalType=be.r.Attribute,this.textureCoordinateType=et.N.None,this.customDepthTest=B.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,vt._)([(0,_t.o)({count:Ee.H.COUNT})],bt.prototype,"output",void 0),(0,vt._)([(0,_t.o)({count:B.JJ.COUNT})],bt.prototype,"alphaDiscardMode",void 0),(0,vt._)([(0,_t.o)({count:Ae.q.COUNT})],bt.prototype,"doubleSidedMode",void 0),(0,vt._)([(0,_t.o)({count:Se.f7.COUNT})],bt.prototype,"pbrMode",void 0),(0,vt._)([(0,_t.o)({count:B.Vr.COUNT})],bt.prototype,"cullFace",void 0),(0,vt._)([(0,_t.o)({count:ye.A.COUNT})],bt.prototype,"transparencyPassType",void 0),(0,vt._)([(0,_t.o)({count:be.r.COUNT})],bt.prototype,"normalType",void 0),(0,vt._)([(0,_t.o)({count:et.N.COUNT})],bt.prototype,"textureCoordinateType",void 0),(0,vt._)([(0,_t.o)({count:B.Gv.COUNT})],bt.prototype,"customDepthTest",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"spherical",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasVertexColors",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasSymbolColors",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasVerticalOffset",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasSlicePlane",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasSliceHighlight",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasColorTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasMetallicRoughnessTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasEmissionTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasOcclusionTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasNormalTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasScreenSizePerspective",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasVertexTangents",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasOccludees",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"multipassEnabled",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasModelTransformation",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"offsetBackfaces",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"vvSize",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"vvColor",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"receiveShadows",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"receiveAmbientOcclusion",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"textureAlphaPremultiplied",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"instanced",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"instancedColor",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"instancedDoublePrecision",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"writeDepth",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"transparent",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"enableOffset",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"cullAboveGround",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"snowCover",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasColorTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasEmissionTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasNormalTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasOcclusionTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,vt._)([(0,_t.o)({constValue:!0})],bt.prototype,"hasVvInstancing",void 0),(0,vt._)([(0,_t.o)({constValue:!1})],bt.prototype,"useCustomDTRExponentForWater",void 0),(0,vt._)([(0,_t.o)({constValue:!1})],bt.prototype,"supportsTextureAtlas",void 0),(0,vt._)([(0,_t.o)({constValue:!0})],bt.prototype,"useFillLights",void 0);var At=r(41846);class St extends pt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=be.r.Attribute,t.doubleSidedMode=Ae.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,St.shader)}}St.shader=new it.J(At.R,(()=>r.e(8096).then(r.bind(r,38096))));class Rt extends we.F5{constructor(e){super(e,yt),this.supportsEdges=!0,this._configuration=new bt,this._vertexBufferLayout=function(e){const t=(0,xe.U$)().vec3f(_e.T.POSITION);return e.normalType===be.r.Compressed?t.vec2i16(_e.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(_e.T.NORMAL),e.hasVertexTangents&&t.vec4f(_e.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(_e.T.UV0),e.hasVertexColors&&t.vec4u8(_e.T.COLOR),e.hasSymbolColors&&t.vec4u8(_e.T.SYMBOLCOLOR),(0,U.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(_e.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Ee.H.Shadow&&e!==Ee.H.ShadowExcludeHighlight&&e!==Ee.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?B.Vr.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==Ee.H.Color&&e!==Ee.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ae.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ae.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ae.q.WindingOrder:Ae.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Se.f7.Schematic:Se.f7.Normal:Se.f7.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(Nt,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case Te.JY.Global:n=(0,l.n)(It,Nt);break;case Te.JY.Local:n=(0,l.c)(It,Ot)}let a=0;const s=(0,l.f)(Lt,Nt,e.eye),c=(0,l.l)(s),u=(0,l.i)(s,s,1/c);let d=null;this.parameters.screenSizePerspective&&(d=(0,l.j)(n,u)),a+=(0,Ke.Hx)(e,c,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective),(0,l.i)(n,n,a),(0,l.t)(Pt,n,r.transform.inverseRotation),i=(0,l.f)(Ct,i,Pt),o=(0,l.f)(Mt,o,Pt)}(0,Ke.Bw)(e,r,i,o,function(e){return null!=e?(Be.offset=e,Be):null}(r.verticalOffset),n)}produces(e,t){return!(t!==Ee.H.Color&&t!==Ee.H.Alpha&&t!==Ee.H.Depth&&t!==Ee.H.Normal&&t!==Ee.H.Shadow&&t!==Ee.H.ShadowHighlight&&t!==Ee.H.ShadowExcludeHighlight&&t!==Ee.H.Highlight&&t!==Ee.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?De.r.TRANSPARENT_MATERIAL:De.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:De.r.OPAQUE_MATERIAL)&&e!==De.r.DRAPED_MATERIAL)}createGLMaterial(e){return new wt(e)}createBufferWriter(){return new Ze(this._vertexBufferLayout)}}class wt extends Re.F{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==Ee.H.Color&&this._output!==Ee.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?St:pt,e)}}const yt=new class extends ft{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},Ct=(0,c.c)(),Mt=(0,c.c)(),Ot=(0,c.f)(0,0,1),It=(0,c.c)(),Pt=(0,c.c)(),Nt=(0,c.c)(),Lt=(0,c.c)(),Dt=P.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Ft(e){throw new I.Z("",`Request for object resource failed: ${e}`)}function Ht(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Dt.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Dt.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Dt.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Dt.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Dt.warn("Indexed geometries must specify faces"),i=!1;break}default:Dt.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Dt.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Dt.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Bt(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.pp)(t,r.bbMin),(0,u.pp)(t,r.bbMax))})),t}function Gt(e){switch(e){case"mask":return B.JJ.Mask;case"maskAndTransparency":return B.JJ.MaskBlend;case"none":return B.JJ.Opaque;default:return B.JJ.Blend}}function Ut(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const zt=new D.G(1,2,"wosr");var Vt=r(57758);async function Wt(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=null!=t&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,M.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),Ft(i.error.details.url)}(e,r,t);const i=await(0,M.q6)((0,C.Z)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),Ft(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],n=o.images[0].data;if(!n){Dt.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:Y.e8.REPEAT,t:Y.e8.REPEAT},preMultiplyAlpha:Gt(l)!==B.JJ.Opaque},u=null!=t&&t.disableTextures?Promise.resolve(null):F(a,t);r.push(u.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,O.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new N,a=e.resource,s=D.G.parse(a.version||"1.0","wosr");zt.validate(s);const l=a.model.name,u=a.model.geometries,d=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<u.length;e++){const a=u[e];if(!Ht(a))continue;const s=Ut(a),l=a.params.vertexAttributes,p=[];for(const e in l){const t=l[e],r=t.values;p.push([e,new H.a(r,t.valuesPerElement,!0)])}const g=[];if("PerAttributeArray"!==a.params.topology){const e=a.params.faces;for(const t in e)g.push([t,e[t].values])}const v=s.texture,_=h&&h[v];if(_&&!f.has(v)){const{image:e,parameters:t}=_,r=new ge(e,t);i.push(r),f.set(v,r)}const T=f.get(v),x=T?T.id:void 0,E=s.material;let b=n.get(E,v);if(null==b){const e=d[E.substring(E.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=_&&_.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=_?Gt(_.alphaChannelUsage):void 0,a={ambient:(0,c.e)(e.diffuse),diffuse:(0,c.e)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:B.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:_?.parameters.preMultiplyAlpha??!1};null!=t&&t.materialParamsMixin&&Object.assign(a,t.materialParamsMixin),b=new Rt(a),n.set(E,v,b)}o.push(b);const A=new G.Z(b,p,g);m+=g.find((e=>e[0]===_e.T.POSITION))?.[1].length??0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Bt(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),d=n.model.meta?.ESRI_proxyEllipsoid,A=n.meta.isEsriSymbolResource&&null!=d&&n.meta.uri.includes("/RealisticTrees/");A&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,u=n.count,d=(0,c.c)(),h=(0,c.c)(),f=(0,c.c)(),p=new Uint8Array(4*u),g=new Float64Array(3*u),v=(0,a.i)((0,s.a)(),o.transform);let _=0,T=0;for(let a=0;a<u;a++){n.getVec(a,h),i.getVec(a,d),(0,l.e)(h,h,o.transform),(0,l.f)(f,h,t.center),(0,l.B)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),u=Math.min(.45+.55*c*c,1);(0,l.B)(f,f,t.radius),null!==v&&(0,l.e)(f,f,v),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.p)(f,f,d,s>-1?.2:Math.min(-4*s-3.8,1)),g[_]=f[0],g[_+1]=f[1],g[_+2]=f[2],_+=3,p[T]=255*u,p[T+1]=255*u,p[T+2]=255*u,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(g),o.attributes.color=new m.mc(p)}}}(n,d));const S=!!t.usePBR,w=n.meta.isEsriSymbolResource?{usePBR:S,isSchematic:!1,treeRendering:A,mrrFactors:[...ht]}:{usePBR:S,isSchematic:!1,treeRendering:!1,mrrFactors:[...ut]},I={...t.materialParamsMixin,treeRendering:A},{engineResources:P,referenceBoundingBox:U}=function(e,t,r,i){const n=e.model,a=new Array,s=new Map,d=new Map,T=n.lods.length,x=(0,u.cS)();return n.lods.forEach(((e,A)=>{const S=!0===i.skipHighLods&&(T>1&&0===A||T>3&&1===A)||!1===i.skipHighLods&&null!=i.singleLodIndex&&A!==i.singleLodIndex;if(S&&0!==A)return;const w=new y(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=S?new Rt({}):function(e,t,r,i,o,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),d=null!=t.attributes.texCoord0,h=null!=t.attributes.normal;if(null==u)return null;const m=function(e){switch(e){case"BLEND":return B.JJ.Blend;case"MASK":return B.JJ.Mask;case"OPAQUE":case null:case void 0:return B.JJ.Opaque}}(u.alphaMode);if(!n.has(s)){if(d){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new ge((0,b.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,b.$A)(e)&&r,encoding:(0,b.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,m!==B.JJ.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/Vt.K),f=u.color[1]**(1/Vt.K),p=u.color[2]**(1/Vt.K),g=u.emissiveFactor[0]**(1/Vt.K),v=u.emissiveFactor[1]**(1/Vt.K),_=u.emissiveFactor[2]**(1/Vt.K),T=null!=u.textureColor&&d?a.get(u.textureColor):null,x=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==o&&(null==n||(0,l.h)(n,c.Z))&&null==a&&(null==i||1===i)&&(null==r||1===r||0===r)}({normalTexture:u.textureNormal,metallicRoughnessTexture:u.textureMetallicRoughness,metallicFactor:u.metallicFactor,roughnessFactor:u.roughnessFactor,emissiveTexture:u.textureEmissive,emissiveFactor:u.emissiveFactor,occlusionTexture:u.textureOcclusion});n.set(s,new Rt({...i,transparent:m===B.JJ.Blend,customDepthTest:B.Gv.Lequal,textureAlphaMode:m,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,p],ambient:[r,f,p],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?B.Vr.None:B.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:h?be.r.Attribute:be.r.ScreenDerivative,castShadows:!0,textureId:null!=T?T.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&d?a.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&d?a.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&d?a.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&d?a.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[g,v,_],mrrFactors:x?[...dt]:[u.metallicFactor,u.roughnessFactor,i.mrrFactors[2]],isSchematic:x,colorTextureTransformMatrix:R(u.colorTextureTransform),normalTextureTransformMatrix:R(u.normalTextureTransform),occlusionTextureTransformMatrix:R(u.occlusionTextureTransform),emissiveTextureTransformMatrix:R(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:R(u.metallicRoughnessTextureTransform),...o}))}const f=n.get(s);if(r.stageResources.materials.push(f),d){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}(n,e,w,t,r,s,d),{geometry:a,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,E.p)(e.indices||r,e.primitiveType),n=h(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,f.t)(n,a,e.transform,3,s);const l=[[_e.T.POSITION,new H.a(n,3,!0)]],c=[[_e.T.POSITION,i]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.n)(jt,e.transform),(0,f.a)(t,n,jt,3,a),l.push([_e.T.NORMAL,new H.a(t,3,!0)]),c.push([_e.T.NORMAL,i])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.n)(jt,e.transform),(0,p.t)(t,n,jt,4,a),l.push([_e.T.TANGENT,new H.a(t,4,!0)]),c.push([_e.T.TANGENT,i])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,g.n)(t,o,2,n),l.push([_e.T.UV0,new H.a(t,2,!0)]),c.push([_e.T.UV0,i])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,f.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,v.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,f.s)(t,e.attributes.color,1/256,4)),l.push([_e.T.COLOR,new H.a(t,4,!0)]),c.push([_e.T.COLOR,i])}return{geometry:new G.Z(t,l,c),vertexCount:r}}(e,null!=i?i:new Rt({})),y=a.boundingInfo;null!=y&&0===A&&((0,u.pp)(x,y.bbMin),(0,u.pp)(x,y.bbMax)),null!=i&&(w.stageResources.geometries.push(a),w.numberOfVertices+=T)})),S||a.push(w)})),{engineResources:a,referenceBoundingBox:x}}(n,w,I,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:P,referenceBoundingBox:U,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}const jt=(0,n.a)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>u});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
286
286
  return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
287
- }`)}function d(e,t){const{vertex:r}=e;switch(t.output){case i.H.Color:if(t.receiveShadows)return s(e),void r.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.H.Depth:case i.H.Shadow:case i.H.ShadowHighlight:case i.H.ShadowExcludeHighlight:return e.include(o.up,t),s(e),l(e),c(e),void r.code.add(a.H`void forwardLinearDepth() {
287
+ }`)}function u(e,t){const{vertex:r}=e;switch(t.output){case i.H.Color:if(t.receiveShadows)return s(e),void r.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.H.Depth:case i.H.Shadow:case i.H.ShadowHighlight:case i.H.ShadowExcludeHighlight:return e.include(o.up,t),s(e),l(e),c(e),void r.code.add(a.H`void forwardLinearDepth() {
288
288
  linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
289
289
  }`)}r.code.add(a.H`void forwardLinearDepth() {}`)}},62707:(e,t,r)=>{r.d(t,{w:()=>o});var i=r(74709);function o(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
290
290
  vec3 camToVert = posWorld - camPosWorld;
@@ -358,13 +358,13 @@ return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGH
358
358
  }`,n=t.hasSliceHighlight?l.H`
359
359
  ${o}
360
360
  #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
361
- `:l.H`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.code.add(i),e.fragment.code.add(i),e.fragment.code.add(n)}(e,t,new s.B("slicePlaneOrigin",((e,r)=>function(e,t,r){if(null==r.slicePlane)return a.Z;const i=d(e,t,r),o=u(i,r.slicePlane),s=h(e,i,r);return null!=s?(0,n.m)(p,o,s):o}(t,e,r))),new s.B("slicePlaneBasis1",((e,r)=>m(t,e,r,r.slicePlane?.basis1))),new s.B("slicePlaneBasis2",((e,r)=>m(t,e,r,r.slicePlane?.basis2))))}function d(e,t,r){return e.instancedDoublePrecision?(0,n.s)(f,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function u(e,t){return null!=e?(0,n.g)(p,t.origin,e):t.origin}function h(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,i.w)(v,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function m(e,t,r,i){if(null==i||null==r.slicePlane)return a.Z;const o=d(e,t,r),s=u(o,r.slicePlane),l=h(e,o,r);return null!=l?((0,n.e)(g,i,s),(0,n.m)(p,s,l),(0,n.m)(g,g,l),(0,n.g)(g,g,p)):i}const f=(0,a.c)(),p=(0,a.c)(),g=(0,a.c)(),v=(0,o.c)()},77171:(e,t,r)=>{r.d(t,{w:()=>n});var i=r(1391),o=r(74709);function n(e){(0,i.bA)(e),e.vertex.code.add(o.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
361
+ `:l.H`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.code.add(i),e.fragment.code.add(i),e.fragment.code.add(n)}(e,t,new s.B("slicePlaneOrigin",((e,r)=>function(e,t,r){if(null==r.slicePlane)return a.Z;const i=u(e,t,r),o=d(i,r.slicePlane),s=h(e,i,r);return null!=s?(0,n.e)(p,o,s):o}(t,e,r))),new s.B("slicePlaneBasis1",((e,r)=>m(t,e,r,r.slicePlane?.basis1))),new s.B("slicePlaneBasis2",((e,r)=>m(t,e,r,r.slicePlane?.basis2))))}function u(e,t,r){return e.instancedDoublePrecision?(0,n.s)(f,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function d(e,t){return null!=e?(0,n.f)(p,t.origin,e):t.origin}function h(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,i.w)(v,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function m(e,t,r,i){if(null==i||null==r.slicePlane)return a.Z;const o=u(e,t,r),s=d(o,r.slicePlane),l=h(e,o,r);return null!=l?((0,n.g)(g,i,s),(0,n.e)(p,s,l),(0,n.e)(g,g,l),(0,n.f)(g,g,p)):i}const f=(0,a.c)(),p=(0,a.c)(),g=(0,a.c)(),v=(0,o.a)()},77171:(e,t,r)=>{r.d(t,{w:()=>n});var i=r(1391),o=r(74709);function n(e){(0,i.bA)(e),e.vertex.code.add(o.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
362
362
  vec4 eye = view * vec4(pos, 1.0);
363
363
  depth = calculateLinearDepth(nearFar,eye.z);
364
364
  return proj * eye;
365
365
  }`),e.vertex.code.add(o.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
366
366
  return proj * (view * vec4(pos, 1.0));
367
- }`)}},47624:(e,t,r)=>{r.d(t,{PO:()=>T,fQ:()=>E});var i=r(43697),o=r(21787),n=r(46521),a=r(13598),s=r(17896),l=r(65617),c=r(55039),d=r(89243),u=r(93669),h=r(70582),m=r(74709),f=r(19850),p=r(8319),g=r(51354),v=r(35065),_=r(9820);class T extends g.m{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}(0,i._)([(0,g.o)()],T.prototype,"instancedDoublePrecision",void 0),(0,i._)([(0,g.o)()],T.prototype,"hasModelTransformation",void 0);const x=(0,n.c)();function E(e,t){const r=t.hasModelTransformation,i=t.instancedDoublePrecision;r&&(e.vertex.uniforms.add(new p.g("model",(e=>e.modelTransformation??a.I))),e.vertex.uniforms.add(new f.c("normalLocalOriginFromModel",(e=>((0,o.d)(x,e.modelTransformation??a.I),x))))),t.instanced&&i&&(e.attributes.add(v.T.INSTANCEMODELORIGINHI,"vec3"),e.attributes.add(v.T.INSTANCEMODELORIGINLO,"vec3"),e.attributes.add(v.T.INSTANCEMODEL,"mat3"),e.attributes.add(v.T.INSTANCEMODELNORMAL,"mat3"));const n=e.vertex;i&&(n.include(d.$,t),n.uniforms.add(new h.B("viewOriginHi",((e,t)=>(0,_.U8)((0,s.s)(b,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),b))),new h.B("viewOriginLo",((e,t)=>(0,_.GB)((0,s.s)(b,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),b))))),n.code.add(m.H`
367
+ }`)}},47624:(e,t,r)=>{r.d(t,{PO:()=>T,fQ:()=>E});var i=r(43697),o=r(21787),n=r(46521),a=r(13598),s=r(17896),l=r(65617),c=r(55039),u=r(89243),d=r(93669),h=r(70582),m=r(74709),f=r(19850),p=r(8319),g=r(51354),v=r(35065),_=r(9820);class T extends g.m{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}(0,i._)([(0,g.o)()],T.prototype,"instancedDoublePrecision",void 0),(0,i._)([(0,g.o)()],T.prototype,"hasModelTransformation",void 0);const x=(0,n.a)();function E(e,t){const r=t.hasModelTransformation,i=t.instancedDoublePrecision;r&&(e.vertex.uniforms.add(new p.g("model",(e=>e.modelTransformation??a.I))),e.vertex.uniforms.add(new f.c("normalLocalOriginFromModel",(e=>((0,o.n)(x,e.modelTransformation??a.I),x))))),t.instanced&&i&&(e.attributes.add(v.T.INSTANCEMODELORIGINHI,"vec3"),e.attributes.add(v.T.INSTANCEMODELORIGINLO,"vec3"),e.attributes.add(v.T.INSTANCEMODEL,"mat3"),e.attributes.add(v.T.INSTANCEMODELNORMAL,"mat3"));const n=e.vertex;i&&(n.include(u.$,t),n.uniforms.add(new h.B("viewOriginHi",((e,t)=>(0,_.U8)((0,s.s)(b,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),b))),new h.B("viewOriginLo",((e,t)=>(0,_.GB)((0,s.s)(b,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),b))))),n.code.add(m.H`
368
368
  vec3 getVertexInLocalOriginSpace() {
369
369
  return ${r?i?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":i?"instanceModel * localPosition().xyz":"localPosition().xyz"};
370
370
  }
@@ -378,7 +378,7 @@ return proj * (view * vec4(pos, 1.0));
378
378
  vec3 dpNormal(vec4 _normal) {
379
379
  return normalize(${r?i?"normalLocalOriginFromModel * normalize(instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":i?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
380
380
  }
381
- `),t.output===c.H.Normal&&((0,u._8)(n),n.code.add(m.H`
381
+ `),t.output===c.H.Normal&&((0,d._8)(n),n.code.add(m.H`
382
382
  vec3 dpNormalView(vec4 _normal) {
383
383
  ${i?"return normalize((viewNormal * vec4(instanceModelNormal * _normal.xyz, 1.0)).xyz);":"return normalize((viewNormal * _normal).xyz);"}
384
384
  }
@@ -434,14 +434,14 @@ vuv0 = getUV0();
434
434
  vuv0 = uv0;
435
435
  vuvRegion = uvRegion;
436
436
  }`);default:(0,n.Bg)(t.textureCoordinateType);case i.None:return void e.vertex.code.add(a.H`void forwardTextureCoordinates() {}`);case i.COUNT:return}}(o=i||(i={}))[o.None=0]="None",o[o.Default=1]="Default",o[o.Atlas=2]="Atlas",o[o.Compressed=3]="Compressed",o[o.COUNT=4]="COUNT"},11317:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(74709),o=r(35065);function n(e,t){t.hasVertexColors?(e.attributes.add(o.T.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(i.H`void forwardVertexColor() {}
437
- void forwardNormalizedVertexColor() {}`)}},15719:(e,t,r)=>{r.d(t,{Bb:()=>d,d4:()=>u});var i=r(74085),o=r(46521),n=(r(88669),r(60624)),a=r(2095),s=r(74709),l=r(52114),c=r(19850);function d(e,t){switch(t.normalType){case n.r.Attribute:case n.r.Compressed:e.include(n.O,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new l.j("transformNormalGlobalFromModel",(e=>e.transformNormalGlobalFromModel)),new c.c("transformNormalViewFromGlobal",(e=>e.transformNormalViewFromGlobal))),e.vertex.code.add(s.H`void forwardNormal() {
437
+ void forwardNormalizedVertexColor() {}`)}},15719:(e,t,r)=>{r.d(t,{Bb:()=>u,d4:()=>d});var i=r(74085),o=r(46521),n=(r(88669),r(60624)),a=r(2095),s=r(74709),l=r(52114),c=r(19850);function u(e,t){switch(t.normalType){case n.r.Attribute:case n.r.Compressed:e.include(n.O,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new l.j("transformNormalGlobalFromModel",(e=>e.transformNormalGlobalFromModel)),new c.c("transformNormalViewFromGlobal",(e=>e.transformNormalViewFromGlobal))),e.vertex.code.add(s.H`void forwardNormal() {
438
438
  vNormalWorld = transformNormalGlobalFromModel * normalModel();
439
439
  vNormalView = transformNormalViewFromGlobal * vNormalWorld;
440
440
  }`);break;case n.r.Ground:e.include(a.up,t),e.varyings.add("vNormalWorld","vec3"),e.vertex.code.add(s.H`
441
441
  void forwardNormal() {
442
442
  vNormalWorld = ${t.spherical?s.H`normalize(vPositionWorldCameraRelative);`:s.H`vec3(0.0, 0.0, 1.0);`}
443
443
  }
444
- `);break;case n.r.ScreenDerivative:e.vertex.code.add(s.H`void forwardNormal() {}`);break;default:(0,i.Bg)(t.normalType);case n.r.COUNT:}}class u extends a.su{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.c)()}}},2095:(e,t,r)=>{r.d(t,{su:()=>p,up:()=>f});var i=r(46521),o=r(13598),n=r(65617),a=r(37099),s=r(89243),l=r(70582),c=r(172),d=r(74709),u=r(52114),h=r(19850),m=r(8319);function f(e,t){e.include(a.f);const r=e.vertex;r.include(s.$,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add(new c.J("transformWorldFromViewTH",(e=>e.transformWorldFromViewTH)),new c.J("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL)),new h.c("transformViewFromCameraRelativeRS",(e=>e.transformViewFromCameraRelativeRS)),new m.g("transformProjFromView",(e=>e.transformProjFromView)),new u.j("transformWorldFromModelRS",(e=>e.transformWorldFromModelRS)),new l.B("transformWorldFromModelTH",(e=>e.transformWorldFromModelTH)),new l.B("transformWorldFromModelTL",(e=>e.transformWorldFromModelTL))),r.code.add(d.H`vec3 positionWorldCameraRelative() {
444
+ `);break;case n.r.ScreenDerivative:e.vertex.code.add(s.H`void forwardNormal() {}`);break;default:(0,i.Bg)(t.normalType);case n.r.COUNT:}}class d extends a.su{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.a)()}}},2095:(e,t,r)=>{r.d(t,{su:()=>p,up:()=>f});var i=r(46521),o=r(13598),n=r(65617),a=r(37099),s=r(89243),l=r(70582),c=r(172),u=r(74709),d=r(52114),h=r(19850),m=r(8319);function f(e,t){e.include(a.f);const r=e.vertex;r.include(s.$,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add(new c.J("transformWorldFromViewTH",(e=>e.transformWorldFromViewTH)),new c.J("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL)),new h.c("transformViewFromCameraRelativeRS",(e=>e.transformViewFromCameraRelativeRS)),new m.g("transformProjFromView",(e=>e.transformProjFromView)),new d.j("transformWorldFromModelRS",(e=>e.transformWorldFromModelRS)),new l.B("transformWorldFromModelTH",(e=>e.transformWorldFromModelTH)),new l.B("transformWorldFromModelTL",(e=>e.transformWorldFromModelTL))),r.code.add(u.H`vec3 positionWorldCameraRelative() {
445
445
  vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
446
446
  vec3 transform_CameraRelativeFromModel = dpAdd(
447
447
  transformWorldFromModelTL,
@@ -450,21 +450,21 @@ transformWorldFromModelTH,
450
450
  -transformWorldFromViewTH
451
451
  );
452
452
  return transform_CameraRelativeFromModel + rotatedModelPosition;
453
- }`),r.code.add(d.H`
453
+ }`),r.code.add(u.H`
454
454
  void forwardPosition(float fOffset) {
455
455
  vPositionWorldCameraRelative = positionWorldCameraRelative();
456
456
  if (fOffset != 0.0) {
457
- vPositionWorldCameraRelative += fOffset * ${t.spherical?d.H`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:d.H`vec3(0.0, 0.0, 1.0)`};
457
+ vPositionWorldCameraRelative += fOffset * ${t.spherical?u.H`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:u.H`vec3(0.0, 0.0, 1.0)`};
458
458
  }
459
459
 
460
460
  vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
461
461
  gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
462
462
  }
463
- `),e.fragment.uniforms.add(new c.J("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL))),r.code.add(d.H`vec3 positionWorld() {
463
+ `),e.fragment.uniforms.add(new c.J("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL))),r.code.add(u.H`vec3 positionWorld() {
464
464
  return transformWorldFromViewTL + vPositionWorldCameraRelative;
465
- }`),e.fragment.code.add(d.H`vec3 positionWorld() {
465
+ }`),e.fragment.code.add(u.H`vec3 positionWorld() {
466
466
  return transformWorldFromViewTL + vPositionWorldCameraRelative;
467
- }`)}class p extends d.K{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,n.c)(),this.transformWorldFromViewTL=(0,n.c)(),this.transformViewFromCameraRelativeRS=(0,i.c)(),this.transformProjFromView=(0,o.c)()}}},91982:(e,t,r)=>{r.d(t,{i:()=>s});var i=r(74085),o=r(135),n=r(74709);function a(e){e.fragment.code.add(n.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
467
+ }`)}class p extends u.K{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,n.c)(),this.transformWorldFromViewTL=(0,n.c)(),this.transformViewFromCameraRelativeRS=(0,i.a)(),this.transformProjFromView=(0,o.a)()}}},91982:(e,t,r)=>{r.d(t,{i:()=>s});var i=r(74085),o=r(135),n=r(74709);function a(e){e.fragment.code.add(n.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
468
468
  vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
469
469
  vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
470
470
  float maxdUV = 0.125;
@@ -494,7 +494,7 @@ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
494
494
  return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
495
495
  }`),e.vertex.code.add(l.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
496
496
  return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
497
- }`)}const d=(0,a.c)();var u=r(93669),h=r(71250);function m(e,t){const r=e.vertex;t.hasVerticalOffset?(function(e){e.uniforms.add(new h.N("verticalOffset",((e,t)=>{const{minWorldLength:r,maxWorldLength:o,screenLength:n}=e.verticalOffset,a=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,i.s)(f,n*s,a,r,o)})))}(r),t.hasScreenSizePerspective&&(e.include(c),function(e){e.uniforms.add(new s.J("screenSizePerspectiveAlignment",(e=>function(e){return(0,n.s)(d,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}(e.screenSizePerspectiveAlignment||e.screenSizePerspective))))}(r),(0,u.hY)(e.vertex,t)),r.code.add(l.H`
497
+ }`)}const u=(0,a.c)();var d=r(93669),h=r(71250);function m(e,t){const r=e.vertex;t.hasVerticalOffset?(function(e){e.uniforms.add(new h.N("verticalOffset",((e,t)=>{const{minWorldLength:r,maxWorldLength:o,screenLength:n}=e.verticalOffset,a=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,i.s)(f,n*s,a,r,o)})))}(r),t.hasScreenSizePerspective&&(e.include(c),function(e){e.uniforms.add(new s.J("screenSizePerspectiveAlignment",(e=>function(e){return(0,n.s)(u,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}(e.screenSizePerspectiveAlignment||e.screenSizePerspective))))}(r),(0,d.hY)(e.vertex,t)),r.code.add(l.H`
498
498
  vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
499
499
  float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
500
500
  ${t.spherical?l.H`vec3 worldNormal = normalize(worldPos + localOrigin);`:l.H`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
@@ -510,11 +510,11 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
510
510
  vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
511
511
  return worldPos + calculateVerticalOffset(worldPos, localOrigin);
512
512
  }
513
- `)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const f=(0,o.c)()},89136:(e,t,r)=>{r.d(t,{s:()=>R});var i=r(1391),o=r(55039),n=r(51546),a=r(77171),s=r(60624),l=r(74709),c=r(35065);function d(e,t){const r=t.output===o.H.ObjectAndLayerIdColor,i=t.objectAndLayerIdColorInstanced;r&&(e.varyings.add("objectAndLayerIdColorVarying","vec4"),i?e.attributes.add(c.T.INSTANCEOBJECTANDLAYERIDCOLOR,"vec4"):e.attributes.add(c.T.OBJECTANDLAYERIDCOLOR,"vec4")),e.vertex.code.add(l.H`
513
+ `)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const f=(0,o.c)()},89136:(e,t,r)=>{r.d(t,{s:()=>R});var i=r(1391),o=r(55039),n=r(51546),a=r(77171),s=r(60624),l=r(74709),c=r(35065);function u(e,t){const r=t.output===o.H.ObjectAndLayerIdColor,i=t.objectAndLayerIdColorInstanced;r&&(e.varyings.add("objectAndLayerIdColorVarying","vec4"),i?e.attributes.add(c.T.INSTANCEOBJECTANDLAYERIDCOLOR,"vec4"):e.attributes.add(c.T.OBJECTANDLAYERIDCOLOR,"vec4")),e.vertex.code.add(l.H`
514
514
  void forwardObjectAndLayerIdColor() {
515
515
  ${r?i?l.H`objectAndLayerIdColorVarying = instanceObjectAndLayerIdColor * 0.003921568627451;`:l.H`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;`:l.H``} }`),e.fragment.code.add(l.H`
516
516
  void outputObjectAndLayerIdColor() {
517
- ${r?l.H`fragColor = objectAndLayerIdColorVarying;`:l.H``} }`)}var u=r(135),h=r(15719),m=r(41687),f=r(20285);function p(e,t){switch(t.output){case o.H.Shadow:case o.H.ShadowHighlight:case o.H.ShadowExcludeHighlight:e.fragment.include(m.f),e.fragment.code.add(l.H`float _calculateFragDepth(const in float depth) {
517
+ ${r?l.H`fragColor = objectAndLayerIdColorVarying;`:l.H``} }`)}var d=r(135),h=r(15719),m=r(41687),f=r(20285);function p(e,t){switch(t.output){case o.H.Shadow:case o.H.ShadowHighlight:case o.H.ShadowExcludeHighlight:e.fragment.include(m.f),e.fragment.code.add(l.H`float _calculateFragDepth(const in float depth) {
518
518
  const float SLOPE_SCALE = 2.0;
519
519
  const float BIAS = 20.0 * .000015259;
520
520
  float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
@@ -524,14 +524,14 @@ void outputDepth(float _linearDepth) {
524
524
  fragColor = floatToRgba4(_calculateFragDepth(_linearDepth));
525
525
  }`);break;case o.H.Depth:e.fragment.include(f.n),e.fragment.code.add(l.H`void outputDepth(float _linearDepth) {
526
526
  fragColor = float2rgba(_linearDepth);
527
- }`)}}var g=r(88669),v=r(98069);const _=(0,g.f)(1,1,0,1),T=(0,g.f)(1,0,1,1);function x(e){e.fragment.uniforms.add(new v.A("depthTexture",((e,t)=>t.mainDepth))),e.fragment.constants.add("occludedHighlightFlag","vec4",_).add("unoccludedHighlightFlag","vec4",T),e.fragment.code.add(l.H`void outputHighlight() {
527
+ }`)}}var g=r(88669),v=r(98069);const _=(0,g.a)(1,1,0,1),T=(0,g.a)(1,0,1,1);function x(e){e.fragment.uniforms.add(new v.A("depthTexture",((e,t)=>t.mainDepth))),e.fragment.constants.add("occludedHighlightFlag","vec4",_).add("unoccludedHighlightFlag","vec4",T),e.fragment.code.add(l.H`void outputHighlight() {
528
528
  float sceneDepth = float(texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x);
529
529
  if (gl_FragCoord.z > sceneDepth + 5e-7) {
530
530
  fragColor = occludedHighlightFlag;
531
531
  } else {
532
532
  fragColor = unoccludedHighlightFlag;
533
533
  }
534
- }`)}var E=r(92302),b=r(85787),A=r(93669),S=r(47026);function R(e,t){const{vertex:r,fragment:c}=e,m=t.hasColorTexture&&t.alphaDiscardMode!==S.JJ.Opaque;switch(t.output){case o.H.Depth:case o.H.Shadow:case o.H.ShadowHighlight:case o.H.ShadowExcludeHighlight:case o.H.ObjectAndLayerIdColor:(0,A.Sv)(r,t),e.include(a.w,t),e.include(u.D,t),e.include(E.k,t),e.include(p,t),e.include(n.f5,t),e.include(d,t),(0,i.Zu)(e),e.varyings.add("depth","float"),m&&c.uniforms.add(new v.A("tex",(e=>e.texture))),r.code.add(l.H`void main(void) {
534
+ }`)}var E=r(92302),b=r(85787),A=r(93669),S=r(47026);function R(e,t){const{vertex:r,fragment:c}=e,m=t.hasColorTexture&&t.alphaDiscardMode!==S.JJ.Opaque;switch(t.output){case o.H.Depth:case o.H.Shadow:case o.H.ShadowHighlight:case o.H.ShadowExcludeHighlight:case o.H.ObjectAndLayerIdColor:(0,A.Sv)(r,t),e.include(a.w,t),e.include(d.D,t),e.include(E.k,t),e.include(p,t),e.include(n.f5,t),e.include(u,t),(0,i.Zu)(e),e.varyings.add("depth","float"),m&&c.uniforms.add(new v.A("tex",(e=>e.texture))),r.code.add(l.H`void main(void) {
535
535
  vpos = getVertexInLocalOriginSpace();
536
536
  vpos = subtractOrigin(vpos);
537
537
  vpos = addVerticalOffset(vpos, localOrigin);
@@ -546,7 +546,7 @@ forwardObjectAndLayerIdColor();
546
546
  discardOrAdjustAlpha(texColor);`:""}
547
547
  ${t.output===o.H.ObjectAndLayerIdColor?l.H`outputObjectAndLayerIdColor();`:l.H`outputDepth(depth);`}
548
548
  }
549
- `);break;case o.H.Normal:{(0,A.Sv)(r,t),e.include(a.w,t),e.include(s.O,t),e.include(h.Bb,t),e.include(u.D,t),e.include(E.k,t),m&&c.uniforms.add(new v.A("tex",(e=>e.texture))),t.normalType===s.r.ScreenDerivative&&e.varyings.add("vPositionView","vec3");const i=t.normalType===s.r.Attribute||t.normalType===s.r.Compressed;r.code.add(l.H`
549
+ `);break;case o.H.Normal:{(0,A.Sv)(r,t),e.include(a.w,t),e.include(s.O,t),e.include(h.Bb,t),e.include(d.D,t),e.include(E.k,t),m&&c.uniforms.add(new v.A("tex",(e=>e.texture))),t.normalType===s.r.ScreenDerivative&&e.varyings.add("vPositionView","vec3");const i=t.normalType===s.r.Attribute||t.normalType===s.r.Compressed;r.code.add(l.H`
550
550
  void main(void) {
551
551
  vpos = getVertexInLocalOriginSpace();
552
552
 
@@ -573,7 +573,7 @@ forwardObjectAndLayerIdColor();
573
573
  }`}
574
574
  fragColor = vec4(0.5 + 0.5 * normal, 1.0);
575
575
  }
576
- `);break}case o.H.Highlight:(0,A.Sv)(r,t),e.include(a.w,t),e.include(u.D,t),e.include(E.k,t),m&&c.uniforms.add(new v.A("tex",(e=>e.texture))),r.code.add(l.H`void main(void) {
576
+ `);break}case o.H.Highlight:(0,A.Sv)(r,t),e.include(a.w,t),e.include(d.D,t),e.include(E.k,t),m&&c.uniforms.add(new v.A("tex",(e=>e.texture))),r.code.add(l.H`void main(void) {
577
577
  vpos = getVertexInLocalOriginSpace();
578
578
  vpos = subtractOrigin(vpos);
579
579
  vpos = addVerticalOffset(vpos, localOrigin);
@@ -596,7 +596,7 @@ return linearDepthFromFloat(rgba2float(depth), nearFar);
596
596
  float linearDepthFromTexture(sampler2D depthTex, vec2 uv, vec2 nearFar) {
597
597
  ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));
598
598
  return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0), nearFar);
599
- }`)}},15817:(e,t,r)=>{r.d(t,{Q:()=>u});var i=r(135),o=r(91982),n=r(19419),a=r(74709),s=r(16374),l=r(98069),c=r(67498),d=r(35065);function u(e,t){const r=e.fragment;t.hasVertexTangents?(e.attributes.add(d.T.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),t.doubleSidedMode===n.q.WindingOrder?r.code.add(a.H`mat3 computeTangentSpace(vec3 normal) {
599
+ }`)}},15817:(e,t,r)=>{r.d(t,{Q:()=>d});var i=r(135),o=r(91982),n=r(19419),a=r(74709),s=r(16374),l=r(98069),c=r(67498),u=r(35065);function d(e,t){const r=e.fragment;t.hasVertexTangents?(e.attributes.add(u.T.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),t.doubleSidedMode===n.q.WindingOrder?r.code.add(a.H`mat3 computeTangentSpace(vec3 normal) {
600
600
  float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
601
601
  vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
602
602
  vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
@@ -620,17 +620,17 @@ return mat3(T, B, normal);
620
620
  }`),t.textureCoordinateType!==i.N.None&&(e.include(o.i,t),r.uniforms.add(t.pbrTextureBindType===c.P.Pass?new l.A("normalTexture",(e=>e.textureNormal)):new s.R("normalTexture",(e=>e.textureNormal))),r.code.add(a.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
621
621
  vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;
622
622
  return tangentSpace * rawNormal;
623
- }`))}},77813:(e,t,r)=>{r.d(t,{K:()=>de});var i=r(74709),o=r(98069),n=r(43697),a=r(70586),s=r(17445),l=r(76882),c=r(5600),d=(r(75215),r(67676)),u=(r(80442),r(52011)),h=r(4307);r(69801);var m=r(35371),f=r(92604),p=r(1533),g=r(49300),v=r(7575);const _=f.Z.getLogger("esri.views.webgl.BufferObject");class T{static createIndex(e,t,r){return new T(e,m.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new T(e,m.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==v.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new T(e,m.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=m.l1.STREAM_READ,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new T(e,m.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=m.l1.STREAM_DRAW,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new T(e,m.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(m._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,g.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteLength(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER?this._indexType===m.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===m.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(m._g.BufferObject,this),this._context=null):this._glName&&_.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_.error("Buffer size needs to be positive!"),this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case m.g.UNSIGNED_SHORT:e*=2;break;case m.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&((0,p.Uc)(e)&&(t/=2,this._indexType=m.g.UNSIGNED_SHORT),(0,p.ZY)(e)&&(t/=4,this._indexType=m.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,g.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteLength)&&_.error("offset is out of range!"),r>=i&&_.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteLength&&_.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===v.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,g.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==v.zO.WEBGL2)return void _.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,d.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void _.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteLength&&_.warn("Potential problem getting subdata: requested data exceeds buffer size!");const n=this._context.gl;this._context.bindBuffer(this,m.w0.COPY_READ_BUFFER),n.getBufferSubData(m.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(m.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===v.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_.error("Get buffer subdata is supported in WebGL2 only!")}}var x=r(4375),E=r(45762);class b{constructor(e,t,r=t){this.internalFormat=e,this.width=t,this.height=r,this.multisampled=!1,this.samples=1}}class A{constructor(e,t){this._context=e,this._descriptor=t,this.type=x.B.RenderBuffer,this._context.instanceCounter.increment(m._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:a}=t;if(a){if(this._context.type!==v.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get gpuMemoryUsage(){return(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,E.RG)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m._g.Renderbuffer,this),this._context=null)}}var S=r(57088);const R=f.Z.getLogger("esri.views.webgl.FramebufferObject");class w{constructor(e,t,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(m._g.FramebufferObject,this);const i=y(t)?t:new S.x(this._context,t);if(this._colorAttachments.set(m.VY.COLOR_ATTACHMENT0,i),this._validateTextureDescriptor(i.descriptor),this._validateColorAttachmentPoint(m.VY.COLOR_ATTACHMENT0),null!=r)if(function(e){return y(e)||null!=e&&"pixelFormat"in e}(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=y(r)?r:new S.x(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=function(e){return null!=e&&"type"in e&&e.type===x.B.RenderBuffer}(r)?r:new A(this._context,r);this._depthStencilBuffer=e,this._validateRenderBufferDescriptor(e.descriptor)}}dispose(){if(0===this._colorAttachments.size&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach(((e,t)=>this.detachColorTexture(t)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(m._g.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+r.gpuMemoryUsage),this.depthStencil?.gpuMemoryUsage??0)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&y(t)?t:null}attachColorTexture(e,t=m.VY.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=m.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(t)return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),t}setColorTextureTarget(e,t=m.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);r&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencil(e){if(e)switch(e.type){case x.B.Texture:return this._attachDepthStencilTexture(e);case x.B.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==m.VI.DEPTH_STENCIL&&t.pixelFormat!==m.VI.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==m.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,m.Lu)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,m.Lu)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderBufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(m.qi.FRAMEBUFFER,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer?.dispose(),this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);t.framebufferRenderbuffer(m.qi.FRAMEBUFFER,r,t.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;a.descriptor.target!==m.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||n+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,S.x.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(S.x.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(m.No.TEXTURE_2D,0,o,n,e,t,r,i),l.bindTexture(c,S.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a){if(this._context.type!==v.zO.WEBGL2)return(0,g.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,n,a);const s=this._context.gl,l=T.createPixelPack(this._context,m.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(m.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};C(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((e=>e.resize(r.width,r.height))),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(C(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=m.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();t.bindFramebuffer(e,r),this._colorAttachments.forEach(((t,r)=>this._framebufferTexture2D(t.glName,r,M(t),e)));const i=this._depthStencilBuffer;if(i){const r=this._getGLAttachmentPoint(i.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,i.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,M(this._depthStencilTexture),e);(0,g.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=m.VY.COLOR_ATTACHMENT0,r=m.No.TEXTURE_2D,i=m.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(m.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,a.M2)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=(0,a.M2)(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==m.No.TEXTURE_2D&&e.target!==m.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),C(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){C(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.Tg.DEPTH_COMPONENT16:case m.Tg.DEPTH_COMPONENT24:case m.Tg.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case m.Tg.DEPTH24_STENCIL8:case m.Tg.DEPTH32F_STENCIL8:case m.Tg.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case m.Tg.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(-1===w._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;w._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else w._MAX_COLOR_ATTACHMENTS=1}const t=e-m.VY.COLOR_ATTACHMENT0;t+1>w._MAX_COLOR_ATTACHMENTS&&f.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${w._MAX_COLOR_ATTACHMENTS} color attachments`)}}function y(e){return null!=e&&"type"in e&&e.type===x.B.Texture}function C(e,t){const r=Math.max(e.width,e.height);if(r>t){R.warn(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function M(e){return e.descriptor.target===m.No.TEXTURE_CUBE_MAP?m.No.TEXTURE_CUBE_MAP_POSITIVE_X:m.No.TEXTURE_2D}w._MAX_COLOR_ATTACHMENTS=-1;var O,I,P=r(47859);(I=O||(O={}))[I.RED=0]="RED",I[I.RG=1]="RG",I[I.RGBA4=2]="RGBA4",I[I.RGBA=3]="RGBA",I[I.RGBA_MIPMAP=4]="RGBA_MIPMAP",I[I.R16F=5]="R16F",I[I.RGBA16F=6]="RGBA16F";const N=new P.X;N.pixelFormat=m.VI.RED,N.internalFormat=m.lP.R8,N.wrapMode=m.e8.CLAMP_TO_EDGE;const L=new P.X;L.pixelFormat=m.VI.RG,L.internalFormat=m.lP.RG8,L.wrapMode=m.e8.CLAMP_TO_EDGE;const D=new P.X;D.internalFormat=m.lP.RGBA4,D.dataType=m.Br.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.e8.CLAMP_TO_EDGE;(new P.X).wrapMode=m.e8.CLAMP_TO_EDGE;const F=new P.X;F.wrapMode=m.e8.CLAMP_TO_EDGE,F.samplingMode=m.cw.LINEAR_MIPMAP_LINEAR,F.hasMipmap=!0,F.maxAnisotropy=8;const H=new P.X;H.pixelFormat=m.VI.RED,H.dataType=m.Br.HALF_FLOAT,H.internalFormat=m.lP.R16F,H.samplingMode=m.cw.NEAREST;const B=new P.X;var G;B.dataType=m.Br.HALF_FLOAT,B.internalFormat=m.lP.RGBA16F,B.samplingMode=m.cw.NEAREST,O.RED,O.RG,O.RGBA4,O.RGBA,O.RGBA_MIPMAP,O.R16F,O.RGBA16F,function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH24_BUFFER=1]="DEPTH24_BUFFER",e[e.DEPTH16_BUFFER=2]="DEPTH16_BUFFER"}(G||(G={}));const U=new P.X;U.pixelFormat=m.VI.DEPTH_STENCIL,U.dataType=m.Br.UNSIGNED_INT_24_8,U.samplingMode=m.cw.NEAREST,U.wrapMode=m.e8.CLAMP_TO_EDGE,G.DEPTH_STENCIL_TEXTURE,G.DEPTH24_BUFFER,new b(m.Tg.DEPTH_COMPONENT24,4),G.DEPTH16_BUFFER,new b(m.Tg.DEPTH_COMPONENT16,4);var z=r(55039),V=r(92036);class W extends V.Z{consumes(e){return!1}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}}class j extends W{}var k=r(78869),q=r(14589),X=r(83475),$=r(59377),Y=r(59915),J=r(27097);class Z extends q.A{initializeProgram(e){return new $.$(e.rctx,Z.shader.get().build(),X.i)}initializePipeline(){return(0,J.sm)({colorWrite:J.BK})}}Z.shader=new k.J(Y.S,(()=>r.e(8092).then(r.bind(r,88092))));var K=r(97323);class Q extends i.K{constructor(){super(...arguments),this.projScale=1}}class ee extends Q{constructor(){super(...arguments),this.intensity=1}}class te extends i.K{}class re extends te{constructor(){super(...arguments),this.blurSize=(0,K.a)()}}var ie,oe=r(25377);class ne extends q.A{initializeProgram(e){return new $.$(e.rctx,ne.shader.get().build(),X.i)}initializePipeline(){return(0,J.sm)({colorWrite:J.BK})}}ne.shader=new k.J(oe.S,(()=>r.e(9243).then(r.bind(r,49243)))),r(95720),function(e){e[e.Antialiasing=0]="Antialiasing",e[e.HighQualityTransparency=1]="HighQualityTransparency",e[e.HighResolutionVoxel=2]="HighResolutionVoxel",e[e.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",e[e.SSAO=4]="SSAO",e[e.WaterReflection=5]="WaterReflection",e[e.HighResolutionShadows=6]="HighResolutionShadows",e[e.PhysicalPixelRendering=7]="PhysicalPixelRendering"}(ie||(ie={}));var ae=r(97995);const se=2;let le=class extends j{constructor(e){super(e),this.renderSlots=[ae.r.SSAO],this._context=null,this._passParameters=new ee,this._drawParameters=new re}produces(){return null!=this._enableTime&&null!=this._context}consumes(e){return this.produces()&&(e===z.H.Depth||e===z.H.Normal)}initializeRenderContext(e){this._context=e,this.addHandles([(0,s.YP)((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(ie.SSAO)),(e=>e?this._enable():this._disable()),s.tX)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=(0,a.M2)(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),(e=>e.charCodeAt(0))),t=new P.X;t.wrapMode=m.e8.CLAMP_TO_EDGE,t.pixelFormat=m.VI.RGB,t.wrapMode=m.e8.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new S.x(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(ne)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(Z)),this._enableTime=(0,l.HA)(0),this._context?.requestRender()}render(e,t,r,i){const o=e.bindParameters,n=o.linearDepth?.colorTexture;if(null==this._enableTime||null==this._context||null==n||!r?.normalTexture)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const a=e.rctx,s=o.camera,l=this.view.qualitySettings.fadeDuration,c=l>0?Math.min(l,e.time-this._enableTime)/l:1;this._passParameters.normalTexture=r.normalTexture,this._passParameters.depthTexture=n,this._passParameters.projScale=1/s.computeRenderPixelSizeAtDist(1),this._passParameters.intensity=4*ce/(0,oe.g)(s)**6*c;const d=s.fullViewport[2],u=s.fullViewport[3],f=d/se,p=u/se,g=this._context.fbos,v=g.acquire(O.RED,d,u);a.bindFramebuffer(v.fbo),a.setViewport(0,0,d,u),a.bindTechnique(this._ssaoTechnique,this._passParameters,o).bindDraw(this._drawParameters,o,this._passParameters),a.screen.draw();const _=a.bindTechnique(this._blurTechnique,this._passParameters,o);a.setViewport(0,0,f,p);const T=g.acquire(O.RED,f,p);a.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=v.colorTexture,(0,h.s)(this._drawParameters.blurSize,0,se/u),_.bindDraw(this._drawParameters,o,this._passParameters),a.setViewport(0,0,f,p),a.screen.draw(),v.release();const x=g.acquire(O.RED,f,p);return a.bindFramebuffer(x.fbo),a.setViewport(0,0,d,u),a.setClearColor(1,1,1,0),a.clear(m.lk.COLOR_BUFFER_BIT),a.setViewport(0,0,f,p),this._drawParameters.colorTexture=T.colorTexture,(0,h.s)(this._drawParameters.blurSize,se/d,0),_.bindDraw(this._drawParameters,o,this._passParameters),a.screen.draw(),a.setViewport4fv(s.fullViewport),T.release(),c<1&&this._context.requestRender(),x}};(0,n._)([(0,c.Cb)({constructOnly:!0})],le.prototype,"view",void 0),(0,n._)([(0,c.Cb)()],le.prototype,"_context",void 0),le=(0,n._)([(0,u.j)("esri.views.3d.webgl-engine.lib.SSAO")],le);const ce=.5;function de(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new o.A("ssaoTex",((e,t)=>t.ssao?.colorTexture))),r.constants.add("blurSizePixelsInverse","float",1/se),r.code.add(i.H`float evaluateAmbientOcclusionInverse() {
623
+ }`))}},77813:(e,t,r)=>{r.d(t,{K:()=>ue});var i=r(74709),o=r(98069),n=r(43697),a=r(70586),s=r(17445),l=r(76882),c=r(5600),u=(r(75215),r(67676)),d=(r(80442),r(52011)),h=r(4307);r(69801);var m=r(35371),f=r(92604),p=r(1533),g=r(49300),v=r(7575);const _=f.Z.getLogger("esri.views.webgl.BufferObject");class T{static createIndex(e,t,r){return new T(e,m.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new T(e,m.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==v.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new T(e,m.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=m.l1.STREAM_READ,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new T(e,m.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=m.l1.STREAM_DRAW,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new T(e,m.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(m._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,g.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteLength(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER?this._indexType===m.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===m.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(m._g.BufferObject,this),this._context=null):this._glName&&_.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_.error("Buffer size needs to be positive!"),this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case m.g.UNSIGNED_SHORT:e*=2;break;case m.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&((0,p.Uc)(e)&&(t/=2,this._indexType=m.g.UNSIGNED_SHORT),(0,p.ZY)(e)&&(t/=4,this._indexType=m.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,g.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteLength)&&_.error("offset is out of range!"),r>=i&&_.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteLength&&_.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===v.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,g.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==v.zO.WEBGL2)return void _.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,u.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void _.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteLength&&_.warn("Potential problem getting subdata: requested data exceeds buffer size!");const n=this._context.gl;this._context.bindBuffer(this,m.w0.COPY_READ_BUFFER),n.getBufferSubData(m.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(m.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===v.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_.error("Get buffer subdata is supported in WebGL2 only!")}}var x=r(4375),E=r(45762);class b{constructor(e,t,r=t){this.internalFormat=e,this.width=t,this.height=r,this.multisampled=!1,this.samples=1}}class A{constructor(e,t){this._context=e,this._descriptor=t,this.type=x.B.RenderBuffer,this._context.instanceCounter.increment(m._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:a}=t;if(a){if(this._context.type!==v.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get gpuMemoryUsage(){return(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,E.RG)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m._g.Renderbuffer,this),this._context=null)}}var S=r(57088);const R=f.Z.getLogger("esri.views.webgl.FramebufferObject");class w{constructor(e,t,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(m._g.FramebufferObject,this);const i=y(t)?t:new S.x(this._context,t);if(this._colorAttachments.set(m.VY.COLOR_ATTACHMENT0,i),this._validateTextureDescriptor(i.descriptor),this._validateColorAttachmentPoint(m.VY.COLOR_ATTACHMENT0),null!=r)if(function(e){return y(e)||null!=e&&"pixelFormat"in e}(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=y(r)?r:new S.x(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=function(e){return null!=e&&"type"in e&&e.type===x.B.RenderBuffer}(r)?r:new A(this._context,r);this._depthStencilBuffer=e,this._validateRenderBufferDescriptor(e.descriptor)}}dispose(){if(0===this._colorAttachments.size&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach(((e,t)=>this.detachColorTexture(t)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(m._g.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+r.gpuMemoryUsage),this.depthStencil?.gpuMemoryUsage??0)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&y(t)?t:null}attachColorTexture(e,t=m.VY.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=m.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(t)return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),t}setColorTextureTarget(e,t=m.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);r&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencil(e){if(e)switch(e.type){case x.B.Texture:return this._attachDepthStencilTexture(e);case x.B.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==m.VI.DEPTH_STENCIL&&t.pixelFormat!==m.VI.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==m.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,m.Lu)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,m.Lu)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderBufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(m.qi.FRAMEBUFFER,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer?.dispose(),this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);t.framebufferRenderbuffer(m.qi.FRAMEBUFFER,r,t.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;a.descriptor.target!==m.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||n+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,S.x.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(S.x.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(m.No.TEXTURE_2D,0,o,n,e,t,r,i),l.bindTexture(c,S.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a){if(this._context.type!==v.zO.WEBGL2)return(0,g.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,n,a);const s=this._context.gl,l=T.createPixelPack(this._context,m.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(m.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};C(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((e=>e.resize(r.width,r.height))),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(C(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=m.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();t.bindFramebuffer(e,r),this._colorAttachments.forEach(((t,r)=>this._framebufferTexture2D(t.glName,r,M(t),e)));const i=this._depthStencilBuffer;if(i){const r=this._getGLAttachmentPoint(i.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,i.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,M(this._depthStencilTexture),e);(0,g.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=m.VY.COLOR_ATTACHMENT0,r=m.No.TEXTURE_2D,i=m.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(m.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,a.M2)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=(0,a.M2)(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==m.No.TEXTURE_2D&&e.target!==m.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),C(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){C(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.Tg.DEPTH_COMPONENT16:case m.Tg.DEPTH_COMPONENT24:case m.Tg.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case m.Tg.DEPTH24_STENCIL8:case m.Tg.DEPTH32F_STENCIL8:case m.Tg.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case m.Tg.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(-1===w._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;w._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else w._MAX_COLOR_ATTACHMENTS=1}const t=e-m.VY.COLOR_ATTACHMENT0;t+1>w._MAX_COLOR_ATTACHMENTS&&f.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${w._MAX_COLOR_ATTACHMENTS} color attachments`)}}function y(e){return null!=e&&"type"in e&&e.type===x.B.Texture}function C(e,t){const r=Math.max(e.width,e.height);if(r>t){R.warn(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function M(e){return e.descriptor.target===m.No.TEXTURE_CUBE_MAP?m.No.TEXTURE_CUBE_MAP_POSITIVE_X:m.No.TEXTURE_2D}w._MAX_COLOR_ATTACHMENTS=-1;var O,I,P=r(47859);(I=O||(O={}))[I.RED=0]="RED",I[I.RG=1]="RG",I[I.RGBA4=2]="RGBA4",I[I.RGBA=3]="RGBA",I[I.RGBA_MIPMAP=4]="RGBA_MIPMAP",I[I.R16F=5]="R16F",I[I.RGBA16F=6]="RGBA16F";const N=new P.X;N.pixelFormat=m.VI.RED,N.internalFormat=m.lP.R8,N.wrapMode=m.e8.CLAMP_TO_EDGE;const L=new P.X;L.pixelFormat=m.VI.RG,L.internalFormat=m.lP.RG8,L.wrapMode=m.e8.CLAMP_TO_EDGE;const D=new P.X;D.internalFormat=m.lP.RGBA4,D.dataType=m.Br.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.e8.CLAMP_TO_EDGE;(new P.X).wrapMode=m.e8.CLAMP_TO_EDGE;const F=new P.X;F.wrapMode=m.e8.CLAMP_TO_EDGE,F.samplingMode=m.cw.LINEAR_MIPMAP_LINEAR,F.hasMipmap=!0,F.maxAnisotropy=8;const H=new P.X;H.pixelFormat=m.VI.RED,H.dataType=m.Br.HALF_FLOAT,H.internalFormat=m.lP.R16F,H.samplingMode=m.cw.NEAREST;const B=new P.X;var G;B.dataType=m.Br.HALF_FLOAT,B.internalFormat=m.lP.RGBA16F,B.samplingMode=m.cw.NEAREST,O.RED,O.RG,O.RGBA4,O.RGBA,O.RGBA_MIPMAP,O.R16F,O.RGBA16F,function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH24_BUFFER=1]="DEPTH24_BUFFER",e[e.DEPTH16_BUFFER=2]="DEPTH16_BUFFER"}(G||(G={}));const U=new P.X;U.pixelFormat=m.VI.DEPTH_STENCIL,U.dataType=m.Br.UNSIGNED_INT_24_8,U.samplingMode=m.cw.NEAREST,U.wrapMode=m.e8.CLAMP_TO_EDGE,G.DEPTH_STENCIL_TEXTURE,G.DEPTH24_BUFFER,new b(m.Tg.DEPTH_COMPONENT24,4),G.DEPTH16_BUFFER,new b(m.Tg.DEPTH_COMPONENT16,4);var z=r(55039),V=r(92036);class W extends V.Z{consumes(e){return!1}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}}class j extends W{}var k=r(78869),q=r(14589),X=r(83475),$=r(59377),Y=r(59915),J=r(27097);class Z extends q.A{initializeProgram(e){return new $.$(e.rctx,Z.shader.get().build(),X.i)}initializePipeline(){return(0,J.sm)({colorWrite:J.BK})}}Z.shader=new k.J(Y.S,(()=>r.e(8092).then(r.bind(r,88092))));var K=r(97323);class Q extends i.K{constructor(){super(...arguments),this.projScale=1}}class ee extends Q{constructor(){super(...arguments),this.intensity=1}}class te extends i.K{}class re extends te{constructor(){super(...arguments),this.blurSize=(0,K.a)()}}var ie,oe=r(25377);class ne extends q.A{initializeProgram(e){return new $.$(e.rctx,ne.shader.get().build(),X.i)}initializePipeline(){return(0,J.sm)({colorWrite:J.BK})}}ne.shader=new k.J(oe.S,(()=>r.e(9243).then(r.bind(r,49243)))),r(95720),function(e){e[e.Antialiasing=0]="Antialiasing",e[e.HighQualityTransparency=1]="HighQualityTransparency",e[e.HighResolutionVoxel=2]="HighResolutionVoxel",e[e.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",e[e.SSAO=4]="SSAO",e[e.WaterReflection=5]="WaterReflection",e[e.HighResolutionShadows=6]="HighResolutionShadows",e[e.PhysicalPixelRendering=7]="PhysicalPixelRendering"}(ie||(ie={}));var ae=r(97995);const se=2;let le=class extends j{constructor(e){super(e),this.renderSlots=[ae.r.SSAO],this._context=null,this._passParameters=new ee,this._drawParameters=new re}produces(){return null!=this._enableTime&&null!=this._context}consumes(e){return this.produces()&&(e===z.H.Depth||e===z.H.Normal)}initializeRenderContext(e){this._context=e,this.addHandles([(0,s.YP)((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(ie.SSAO)),(e=>e?this._enable():this._disable()),s.tX)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=(0,a.M2)(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),(e=>e.charCodeAt(0))),t=new P.X;t.wrapMode=m.e8.CLAMP_TO_EDGE,t.pixelFormat=m.VI.RGB,t.wrapMode=m.e8.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new S.x(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(ne)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(Z)),this._enableTime=(0,l.HA)(0),this._context?.requestRender()}render(e,t,r,i){const o=e.bindParameters,n=o.linearDepth?.colorTexture;if(null==this._enableTime||null==this._context||null==n||!r?.normalTexture)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const a=e.rctx,s=o.camera,l=this.view.qualitySettings.fadeDuration,c=l>0?Math.min(l,e.time-this._enableTime)/l:1;this._passParameters.normalTexture=r.normalTexture,this._passParameters.depthTexture=n,this._passParameters.projScale=1/s.computeRenderPixelSizeAtDist(1),this._passParameters.intensity=4*ce/(0,oe.g)(s)**6*c;const u=s.fullViewport[2],d=s.fullViewport[3],f=u/se,p=d/se,g=this._context.fbos,v=g.acquire(O.RED,u,d);a.bindFramebuffer(v.fbo),a.setViewport(0,0,u,d),a.bindTechnique(this._ssaoTechnique,this._passParameters,o).bindDraw(this._drawParameters,o,this._passParameters),a.screen.draw();const _=a.bindTechnique(this._blurTechnique,this._passParameters,o);a.setViewport(0,0,f,p);const T=g.acquire(O.RED,f,p);a.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=v.colorTexture,(0,h.s)(this._drawParameters.blurSize,0,se/d),_.bindDraw(this._drawParameters,o,this._passParameters),a.setViewport(0,0,f,p),a.screen.draw(),v.release();const x=g.acquire(O.RED,f,p);return a.bindFramebuffer(x.fbo),a.setViewport(0,0,u,d),a.setClearColor(1,1,1,0),a.clear(m.lk.COLOR_BUFFER_BIT),a.setViewport(0,0,f,p),this._drawParameters.colorTexture=T.colorTexture,(0,h.s)(this._drawParameters.blurSize,se/u,0),_.bindDraw(this._drawParameters,o,this._passParameters),a.screen.draw(),a.setViewport4fv(s.fullViewport),T.release(),c<1&&this._context.requestRender(),x}};(0,n._)([(0,c.Cb)({constructOnly:!0})],le.prototype,"view",void 0),(0,n._)([(0,c.Cb)()],le.prototype,"_context",void 0),le=(0,n._)([(0,d.j)("esri.views.3d.webgl-engine.lib.SSAO")],le);const ce=.5;function ue(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new o.A("ssaoTex",((e,t)=>t.ssao?.colorTexture))),r.constants.add("blurSizePixelsInverse","float",1/se),r.code.add(i.H`float evaluateAmbientOcclusionInverse() {
624
624
  vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
625
625
  return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
626
626
  }
627
627
  float evaluateAmbientOcclusion() {
628
628
  return 1.0 - evaluateAmbientOcclusionInverse();
629
629
  }`)):r.code.add(i.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
630
- float evaluateAmbientOcclusion() { return 0.0; }`)}},89753:(e,t,r)=>{r.d(t,{XP:()=>w,PN:()=>S,sC:()=>R});var i=r(74085),o=r(17896),n=r(65617),a=r(98766),s=r(88669),l=r(85504),c=r(172),d=r(71250),u=r(74709);function h(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new c.J("lightingAmbientSH0",((e,t)=>(0,o.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
630
+ float evaluateAmbientOcclusion() { return 0.0; }`)}},89753:(e,t,r)=>{r.d(t,{XP:()=>w,PN:()=>S,sC:()=>R});var i=r(74085),o=r(17896),n=r(65617),a=r(98766),s=r(88669),l=r(85504),c=r(172),u=r(71250),d=r(74709);function h(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new c.J("lightingAmbientSH0",((e,t)=>(0,o.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0])))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
631
631
  vec3 ambientLight = 0.282095 * lightingAmbientSH0;
632
632
  return ambientLight * (1.0 - ambientOcclusion);
633
- }`)):1===i?(r.uniforms.add(new d.N("lightingAmbientSH_R",((e,t)=>(0,a.s)(f,t.lighting.sh.r[0],t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3]))),new d.N("lightingAmbientSH_G",((e,t)=>(0,a.s)(f,t.lighting.sh.g[0],t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3]))),new d.N("lightingAmbientSH_B",((e,t)=>(0,a.s)(f,t.lighting.sh.b[0],t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
633
+ }`)):1===i?(r.uniforms.add(new u.N("lightingAmbientSH_R",((e,t)=>(0,a.s)(f,t.lighting.sh.r[0],t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3]))),new u.N("lightingAmbientSH_G",((e,t)=>(0,a.s)(f,t.lighting.sh.g[0],t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3]))),new u.N("lightingAmbientSH_B",((e,t)=>(0,a.s)(f,t.lighting.sh.b[0],t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3])))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
634
634
  vec4 sh0 = vec4(
635
635
  0.282095,
636
636
  0.488603 * normal.x,
@@ -643,7 +643,7 @@ dot(lightingAmbientSH_G, sh0),
643
643
  dot(lightingAmbientSH_B, sh0)
644
644
  );
645
645
  return ambientLight * (1.0 - ambientOcclusion);
646
- }`)):2===i&&(r.uniforms.add(new c.J("lightingAmbientSH0",((e,t)=>(0,o.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0]))),new d.N("lightingAmbientSH_R1",((e,t)=>(0,a.s)(f,t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3],t.lighting.sh.r[4]))),new d.N("lightingAmbientSH_G1",((e,t)=>(0,a.s)(f,t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3],t.lighting.sh.g[4]))),new d.N("lightingAmbientSH_B1",((e,t)=>(0,a.s)(f,t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3],t.lighting.sh.b[4]))),new d.N("lightingAmbientSH_R2",((e,t)=>(0,a.s)(f,t.lighting.sh.r[5],t.lighting.sh.r[6],t.lighting.sh.r[7],t.lighting.sh.r[8]))),new d.N("lightingAmbientSH_G2",((e,t)=>(0,a.s)(f,t.lighting.sh.g[5],t.lighting.sh.g[6],t.lighting.sh.g[7],t.lighting.sh.g[8]))),new d.N("lightingAmbientSH_B2",((e,t)=>(0,a.s)(f,t.lighting.sh.b[5],t.lighting.sh.b[6],t.lighting.sh.b[7],t.lighting.sh.b[8])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
646
+ }`)):2===i&&(r.uniforms.add(new c.J("lightingAmbientSH0",((e,t)=>(0,o.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0]))),new u.N("lightingAmbientSH_R1",((e,t)=>(0,a.s)(f,t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3],t.lighting.sh.r[4]))),new u.N("lightingAmbientSH_G1",((e,t)=>(0,a.s)(f,t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3],t.lighting.sh.g[4]))),new u.N("lightingAmbientSH_B1",((e,t)=>(0,a.s)(f,t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3],t.lighting.sh.b[4]))),new u.N("lightingAmbientSH_R2",((e,t)=>(0,a.s)(f,t.lighting.sh.r[5],t.lighting.sh.r[6],t.lighting.sh.r[7],t.lighting.sh.r[8]))),new u.N("lightingAmbientSH_G2",((e,t)=>(0,a.s)(f,t.lighting.sh.g[5],t.lighting.sh.g[6],t.lighting.sh.g[7],t.lighting.sh.g[8]))),new u.N("lightingAmbientSH_B2",((e,t)=>(0,a.s)(f,t.lighting.sh.b[5],t.lighting.sh.b[6],t.lighting.sh.b[7],t.lighting.sh.b[8])))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
647
647
  vec3 ambientLight = 0.282095 * lightingAmbientSH0;
648
648
  vec4 sh1 = vec4(
649
649
  0.488603 * normal.x,
@@ -668,24 +668,24 @@ dot(lightingAmbientSH_G2, sh2),
668
668
  dot(lightingAmbientSH_B2, sh2)
669
669
  );
670
670
  return ambientLight * (1.0 - ambientOcclusion);
671
- }`),t.pbrMode!==l.f7.Normal&&t.pbrMode!==l.f7.Schematic||r.code.add(u.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
671
+ }`),t.pbrMode!==l.f7.Normal&&t.pbrMode!==l.f7.Schematic||r.code.add(d.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
672
672
  vec3 calculateAmbientRadiance(float ambientOcclusion)
673
673
  {
674
674
  vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
675
675
  return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
676
- }`))}const m=(0,n.c)(),f=(0,s.c)();var p=r(77813),g=r(5802),v=r(26322),_=r(27754),T=r(79884),x=r(67498);class E extends T.x{constructor(e,t){super(e,"bool",x.P.Pass,((r,i,o)=>r.setUniform1b(e,t(i,o))))}}var b=r(21437);r(22021),(0,n.c)();const A=.4;function S(e){e.constants.add("ambientBoostFactor","float",A)}function R(e){e.uniforms.add(new b.p("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function w(e,t){const r=e.fragment;switch(e.include(p.K,t),t.pbrMode!==l.f7.Disabled&&e.include(v.T,t),e.include(h,t),e.include(_.e),r.code.add(u.H`
676
+ }`))}const m=(0,n.c)(),f=(0,s.c)();var p=r(77813),g=r(5802),v=r(26322),_=r(27754),T=r(79884),x=r(67498);class E extends T.x{constructor(e,t){super(e,"bool",x.P.Pass,((r,i,o)=>r.setUniform1b(e,t(i,o))))}}var b=r(21437);r(22021),(0,n.c)();const A=.4;function S(e){e.constants.add("ambientBoostFactor","float",A)}function R(e){e.uniforms.add(new b.p("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function w(e,t){const r=e.fragment;switch(e.include(p.K,t),t.pbrMode!==l.f7.Disabled&&e.include(v.T,t),e.include(h,t),e.include(_.e),r.code.add(d.H`
677
677
  const float GAMMA_SRGB = 2.1;
678
678
  const float INV_GAMMA_SRGB = 0.4761904;
679
679
  ${t.pbrMode===l.f7.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
680
- `),S(r),R(r),(0,g.Pe)(r),r.code.add(u.H`
680
+ `),S(r),R(r),(0,g.Pe)(r),r.code.add(d.H`
681
681
  float additionalDirectedAmbientLight(vec3 vPosWorld) {
682
- float vndl = dot(${t.spherical?u.H`normalize(vPosWorld)`:u.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
682
+ float vndl = dot(${t.spherical?d.H`normalize(vPosWorld)`:d.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
683
683
  return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
684
684
  }
685
- `),(0,g.F1)(r),r.code.add(u.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
685
+ `),(0,g.F1)(r),r.code.add(d.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
686
686
  float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
687
687
  return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
688
- }`),t.pbrMode){case l.f7.Disabled:case l.f7.WaterOnIntegratedMesh:case l.f7.Water:e.include(g.kR),r.code.add(u.H`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)
688
+ }`),t.pbrMode){case l.f7.Disabled:case l.f7.WaterOnIntegratedMesh:case l.f7.Water:e.include(g.kR),r.code.add(d.H`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)
689
689
  {
690
690
  vec3 mainLighting = evaluateMainLighting(normalWorld, shadow);
691
691
  vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
@@ -694,7 +694,7 @@ vec3 totalLight = mainLighting + ambientLighting + additionalLight;
694
694
  totalLight = min(totalLight, vec3(PI));
695
695
  vec3 outColor = vec3((albedoLinear / PI) * totalLight);
696
696
  return pow(outColor, vec3(INV_GAMMA_SRGB));
697
- }`);break;case l.f7.Normal:case l.f7.Schematic:r.code.add(u.H`const float fillLightIntensity = 0.25;
697
+ }`);break;case l.f7.Normal:case l.f7.Schematic:r.code.add(d.H`const float fillLightIntensity = 0.25;
698
698
  const float horizonLightDiffusion = 0.4;
699
699
  const float additionalAmbientIrradianceFactor = 0.02;
700
700
  vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance)
@@ -712,16 +712,16 @@ inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0);
712
712
  inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
713
713
  inputs.ssao = ssao;
714
714
  inputs.metalness = mrr[0];
715
- inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(u.H`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
715
+ inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(d.H`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
716
716
  inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
717
- inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new E("hasFillLights",((e,t)=>t.enableFillLights))):r.constants.add("hasFillLights","bool",!1),r.code.add(u.H`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]);
717
+ inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new E("hasFillLights",((e,t)=>t.enableFillLights))):r.constants.add("hasFillLights","bool",!1),r.code.add(d.H`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]);
718
718
  ambientDir = ambientDir != vec3(0.0)? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
719
719
  inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
720
720
  vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity;
721
721
  vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
722
722
  vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
723
723
  inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
724
- inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add(new b.p("lightingSpecularStrength",((e,t)=>t.lighting.mainLight.specularStrength)),new b.p("lightingEnvironmentStrength",((e,t)=>t.lighting.mainLight.environmentStrength))),r.code.add(u.H`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView;
724
+ inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add(new b.p("lightingSpecularStrength",((e,t)=>t.lighting.mainLight.specularStrength)),new b.p("lightingEnvironmentStrength",((e,t)=>t.lighting.mainLight.environmentStrength))),r.code.add(d.H`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView;
725
725
  vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
726
726
  inputs.NdotH_Horizon = dot(normal, horizonRingH);
727
727
  vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow);
@@ -729,15 +729,15 @@ vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistrib
729
729
  vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
730
730
  inputs.skyRadianceToSurface = ambientLightRadianceComponent + mainLightRadianceComponent + horizonLightRadianceComponent;
731
731
  inputs.groundRadianceToSurface = GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) + mainLightRadianceComponent;
732
- inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(u.H`
732
+ inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(d.H`
733
733
  vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
734
734
  vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
735
735
  vec3 emissionComponent = pow(_emission, vec3(GAMMA_SRGB));
736
736
  vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
737
- ${t.pbrMode===l.f7.Schematic?u.H`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:u.H`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`}
737
+ ${t.pbrMode===l.f7.Schematic?d.H`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:d.H`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`}
738
738
  return outColor;
739
739
  }
740
- `);break;case l.f7.Terrain:case l.f7.TerrainWithWater:e.include(g.kR),r.code.add(u.H`const float roughnessTerrain = 0.5;
740
+ `);break;case l.f7.Terrain:case l.f7.TerrainWithWater:e.include(g.kR),r.code.add(d.H`const float roughnessTerrain = 0.5;
741
741
  const float specularityTerrain = 0.5;
742
742
  const vec3 fresnelReflectionTerrain = vec3(0.04);
743
743
  vec3 evaluateTerrainLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) {
@@ -847,20 +847,20 @@ outColor.x = gamutMapChanel(inColor.x, p) ;
847
847
  outColor.y = gamutMapChanel(inColor.y, p) ;
848
848
  outColor.z = gamutMapChanel(inColor.z, p) ;
849
849
  return outColor;
850
- }`))}},85504:(e,t,r)=>{r.d(t,{f7:()=>i,jV:()=>h});var i,o,n=r(91982),a=r(70582),s=r(172),l=r(74709),c=r(16374),d=r(98069),u=r(67498);function h(e,t){const r=e.fragment,o=t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture;if(t.pbrMode===i.Normal&&o&&e.include(n.i,t),t.pbrMode!==i.Schematic)if(t.pbrMode!==i.Disabled){if(t.pbrMode===i.Normal){r.code.add(l.H`vec3 mrr;
850
+ }`))}},85504:(e,t,r)=>{r.d(t,{f7:()=>i,jV:()=>h});var i,o,n=r(91982),a=r(70582),s=r(172),l=r(74709),c=r(16374),u=r(98069),d=r(67498);function h(e,t){const r=e.fragment,o=t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture;if(t.pbrMode===i.Normal&&o&&e.include(n.i,t),t.pbrMode!==i.Schematic)if(t.pbrMode!==i.Disabled){if(t.pbrMode===i.Normal){r.code.add(l.H`vec3 mrr;
851
851
  vec3 emission;
852
- float occlusion;`);const e=t.pbrTextureBindType;t.hasMetallicRoughnessTexture&&(r.uniforms.add(e===u.P.Pass?new d.A("texMetallicRoughness",(e=>e.textureMetallicRoughness)):new c.R("texMetallicRoughness",(e=>e.textureMetallicRoughness))),r.code.add(l.H`void applyMetallnessAndRoughness(vec2 uv) {
852
+ float occlusion;`);const e=t.pbrTextureBindType;t.hasMetallicRoughnessTexture&&(r.uniforms.add(e===d.P.Pass?new u.A("texMetallicRoughness",(e=>e.textureMetallicRoughness)):new c.R("texMetallicRoughness",(e=>e.textureMetallicRoughness))),r.code.add(l.H`void applyMetallnessAndRoughness(vec2 uv) {
853
853
  vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
854
854
  mrr[0] *= metallicRoughness.b;
855
855
  mrr[1] *= metallicRoughness.g;
856
- }`)),t.hasEmissionTexture&&(r.uniforms.add(e===u.P.Pass?new d.A("texEmission",(e=>e.textureEmissive)):new c.R("texEmission",(e=>e.textureEmissive))),r.code.add(l.H`void applyEmission(vec2 uv) {
856
+ }`)),t.hasEmissionTexture&&(r.uniforms.add(e===d.P.Pass?new u.A("texEmission",(e=>e.textureEmissive)):new c.R("texEmission",(e=>e.textureEmissive))),r.code.add(l.H`void applyEmission(vec2 uv) {
857
857
  emission *= textureLookup(texEmission, uv).rgb;
858
- }`)),t.hasOcclusionTexture?(r.uniforms.add(e===u.P.Pass?new d.A("texOcclusion",(e=>e.textureOcclusion)):new c.R("texOcclusion",(e=>e.textureOcclusion))),r.code.add(l.H`void applyOcclusion(vec2 uv) {
858
+ }`)),t.hasOcclusionTexture?(r.uniforms.add(e===d.P.Pass?new u.A("texOcclusion",(e=>e.textureOcclusion)):new c.R("texOcclusion",(e=>e.textureOcclusion))),r.code.add(l.H`void applyOcclusion(vec2 uv) {
859
859
  occlusion *= textureLookup(texOcclusion, uv).r;
860
860
  }
861
861
  float getBakedOcclusion() {
862
862
  return occlusion;
863
- }`)):r.code.add(l.H`float getBakedOcclusion() { return 1.0; }`),e===u.P.Pass?r.uniforms.add(new s.J("emissionFactor",(e=>e.emissiveFactor)),new s.J("mrrFactors",(e=>e.mrrFactors))):r.uniforms.add(new a.B("emissionFactor",(e=>e.emissiveFactor)),new a.B("mrrFactors",(e=>e.mrrFactors))),r.code.add(l.H`
863
+ }`)):r.code.add(l.H`float getBakedOcclusion() { return 1.0; }`),e===d.P.Pass?r.uniforms.add(new s.J("emissionFactor",(e=>e.emissiveFactor)),new s.J("mrrFactors",(e=>e.mrrFactors))):r.uniforms.add(new a.B("emissionFactor",(e=>e.emissiveFactor)),new a.B("mrrFactors",(e=>e.mrrFactors))),r.code.add(l.H`
864
864
  void applyPBRFactors() {
865
865
  mrr = mrrFactors;
866
866
  emission = emissionFactor;
@@ -879,7 +879,7 @@ void applyPBRFactors() {}
879
879
  float getBakedOcclusion() { return 1.0; }`)}r(60537),(o=i||(i={}))[o.Disabled=0]="Disabled",o[o.Normal=1]="Normal",o[o.Schematic=2]="Schematic",o[o.Water=3]="Water",o[o.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",o[o.Terrain=5]="Terrain",o[o.TerrainWithWater=6]="TerrainWithWater",o[o.COUNT=7]="COUNT"},27754:(e,t,r)=>{r.d(t,{e:()=>o});var i=r(74709);function o(e){e.vertex.code.add(i.H`const float PI = 3.141592653589793;`),e.fragment.code.add(i.H`const float PI = 3.141592653589793;
880
880
  const float LIGHT_NORMALIZATION = 1.0 / PI;
881
881
  const float INV_PI = 0.3183098861837907;
882
- const float HALF_PI = 1.570796326794897;`)}},22539:(e,t,r)=>{r.d(t,{XE:()=>m,hb:()=>h}),r(13598),r(65617);var i=r(41687),o=r(71250),n=r(15736),a=r(74709),s=r(79884),l=r(67498);class c extends s.x{constructor(e,t,r){super(e,"mat4",l.P.Draw,((r,i,o,n)=>r.setUniformMatrix4fv(e,t(i,o,n))),r)}}class d extends s.x{constructor(e,t,r){super(e,"mat4",l.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))),r)}}var u=r(98069);function h(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new d("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),f(e))}function m(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new c("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),f(e))}function f(e){const t=e.fragment;t.include(i.f),t.uniforms.add(new u.A("shadowMapTex",((e,t)=>t.shadowMap.depthTexture)),new n._("numCascades",((e,t)=>t.shadowMap.numCascades)),new o.N("cascadeDistances",((e,t)=>t.shadowMap.cascadeDistances))),t.code.add(a.H`int chooseCascade(float depth, out mat4 mat) {
882
+ const float HALF_PI = 1.570796326794897;`)}},22539:(e,t,r)=>{r.d(t,{XE:()=>m,hb:()=>h}),r(13598),r(65617);var i=r(41687),o=r(71250),n=r(15736),a=r(74709),s=r(79884),l=r(67498);class c extends s.x{constructor(e,t,r){super(e,"mat4",l.P.Draw,((r,i,o,n)=>r.setUniformMatrix4fv(e,t(i,o,n))),r)}}class u extends s.x{constructor(e,t,r){super(e,"mat4",l.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))),r)}}var d=r(98069);function h(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new u("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),f(e))}function m(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new c("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),f(e))}function f(e){const t=e.fragment;t.include(i.f),t.uniforms.add(new d.A("shadowMapTex",((e,t)=>t.shadowMap.depthTexture)),new n._("numCascades",((e,t)=>t.shadowMap.numCascades)),new o.N("cascadeDistances",((e,t)=>t.shadowMap.cascadeDistances))),t.code.add(a.H`int chooseCascade(float depth, out mat4 mat) {
883
883
  vec4 distance = cascadeDistances;
884
884
  int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
885
885
  mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
@@ -919,7 +919,7 @@ if (lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0
919
919
  ivec2 size = textureSize(shadowMapTex, 0);
920
920
  vec2 uv = cascadeCoordinates(i, size, lvpos);
921
921
  return filterShadow(uv, lvpos, size, shadowMapTex);
922
- }`)}},57806:(e,t,r)=>{r.d(t,{DT:()=>d,NI:()=>s,R5:()=>l,av:()=>a,jF:()=>c});var i=r(14682),o=r(74709),n=r(19850);function a(e){e.vertex.uniforms.add(new n.c("colorTextureTransformMatrix",(e=>null!=e.colorTextureTransformMatrix?e.colorTextureTransformMatrix:(0,i.c)()))),e.varyings.add("colorUV","vec2"),e.vertex.code.add(o.H`void forwardColorUV(){
922
+ }`)}},57806:(e,t,r)=>{r.d(t,{DT:()=>u,NI:()=>s,R5:()=>l,av:()=>a,jF:()=>c});var i=r(14682),o=r(74709),n=r(19850);function a(e){e.vertex.uniforms.add(new n.c("colorTextureTransformMatrix",(e=>null!=e.colorTextureTransformMatrix?e.colorTextureTransformMatrix:(0,i.c)()))),e.varyings.add("colorUV","vec2"),e.vertex.code.add(o.H`void forwardColorUV(){
923
923
  colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
924
924
  }`)}function s(e){e.vertex.uniforms.add(new n.c("normalTextureTransformMatrix",(e=>null!=e.normalTextureTransformMatrix?e.normalTextureTransformMatrix:(0,i.c)()))),e.varyings.add("normalUV","vec2"),e.vertex.code.add(o.H`void forwardNormalUV(){
925
925
  normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
@@ -927,9 +927,9 @@ normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
927
927
  emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
928
928
  }`)}function c(e){e.vertex.uniforms.add(new n.c("occlusionTextureTransformMatrix",(e=>null!=e.occlusionTextureTransformMatrix?e.occlusionTextureTransformMatrix:(0,i.c)()))),e.varyings.add("occlusionUV","vec2"),e.vertex.code.add(o.H`void forwardOcclusionUV(){
929
929
  occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
930
- }`)}function d(e){e.vertex.uniforms.add(new n.c("metallicRoughnessTextureTransformMatrix",(e=>null!=e.metallicRoughnessTextureTransformMatrix?e.metallicRoughnessTextureTransformMatrix:(0,i.c)()))),e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.code.add(o.H`void forwardMetallicRoughnessUV(){
930
+ }`)}function u(e){e.vertex.uniforms.add(new n.c("metallicRoughnessTextureTransformMatrix",(e=>null!=e.metallicRoughnessTextureTransformMatrix?e.metallicRoughnessTextureTransformMatrix:(0,i.c)()))),e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.code.add(o.H`void forwardMetallicRoughnessUV(){
931
931
  metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
932
- }`)}},92302:(e,t,r)=>{r.d(t,{k:()=>b});var i=r(172),o=r(79884),n=r(67498);class a extends o.x{constructor(e,t,r){super(e,"vec4",n.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))),r)}}class s extends o.x{constructor(e,t,r){super(e,"float",n.P.Pass,((r,i,o)=>r.setUniform1fv(e,t(i,o))),r)}}var l=r(74709),c=r(19850),d=r(35065),u=(r(80442),r(22021),r(21787),r(46521),r(52138),r(13598)),h=(r(17896),r(65617)),m=(r(99282),r(43697)),f=r(92036),p=r(5600),g=(r(75215),r(67676),r(52011));let v=class extends f.Z{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1}};var _,T,x;(0,m._)([(0,p.Cb)()],v.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"LABELS_SHOW_BORDER",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"TEXT_SHOW_BASELINE",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"TEXT_SHOW_BORDER",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"SHOW_POI",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"LINE_WIREFRAMES",void 0),v=(0,m._)([(0,g.j)("esri.views.3d.support.DebugFlags")],v),new v,(x=_||(_={}))[x.Undefined=0]="Undefined",x[x.DefinedSize=1]="DefinedSize",x[x.DefinedScale=2]="DefinedScale",function(e){e[e.Undefined=0]="Undefined",e[e.DefinedAngle=1]="DefinedAngle"}(T||(T={})),(0,u.c)(),(0,h.c)(),(0,u.c)(),r(82791);const E=8;function b(e,t){const{vertex:r,attributes:o}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&o.add(d.T.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new i.J("vvSizeMinSize",(e=>e.vvSize.minSize))),r.uniforms.add(new i.J("vvSizeMaxSize",(e=>e.vvSize.maxSize))),r.uniforms.add(new i.J("vvSizeOffset",(e=>e.vvSize.offset))),r.uniforms.add(new i.J("vvSizeFactor",(e=>e.vvSize.factor))),r.uniforms.add(new c.c("vvSymbolRotationMatrix",(e=>e.vvSymbolRotationMatrix))),r.uniforms.add(new i.J("vvSymbolAnchor",(e=>e.vvSymbolAnchor))),r.code.add(l.H`vec3 vvScale(vec4 _featureAttribute) {
932
+ }`)}},92302:(e,t,r)=>{r.d(t,{k:()=>b});var i=r(172),o=r(79884),n=r(67498);class a extends o.x{constructor(e,t,r){super(e,"vec4",n.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))),r)}}class s extends o.x{constructor(e,t,r){super(e,"float",n.P.Pass,((r,i,o)=>r.setUniform1fv(e,t(i,o))),r)}}var l=r(74709),c=r(19850),u=r(35065),d=(r(80442),r(22021),r(21787),r(46521),r(52138),r(13598)),h=(r(17896),r(65617)),m=(r(99282),r(43697)),f=r(92036),p=r(5600),g=(r(75215),r(67676),r(52011));let v=class extends f.Z{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1}};var _,T,x;(0,m._)([(0,p.Cb)()],v.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"LABELS_SHOW_BORDER",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"TEXT_SHOW_BASELINE",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"TEXT_SHOW_BORDER",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"SHOW_POI",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,m._)([(0,p.Cb)()],v.prototype,"LINE_WIREFRAMES",void 0),v=(0,m._)([(0,g.j)("esri.views.3d.support.DebugFlags")],v),new v,(x=_||(_={}))[x.Undefined=0]="Undefined",x[x.DefinedSize=1]="DefinedSize",x[x.DefinedScale=2]="DefinedScale",function(e){e[e.Undefined=0]="Undefined",e[e.DefinedAngle=1]="DefinedAngle"}(T||(T={})),(0,d.a)(),(0,h.c)(),(0,d.a)(),r(82791);const E=8;function b(e,t){const{vertex:r,attributes:o}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&o.add(u.T.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new i.J("vvSizeMinSize",(e=>e.vvSize.minSize))),r.uniforms.add(new i.J("vvSizeMaxSize",(e=>e.vvSize.maxSize))),r.uniforms.add(new i.J("vvSizeOffset",(e=>e.vvSize.offset))),r.uniforms.add(new i.J("vvSizeFactor",(e=>e.vvSize.factor))),r.uniforms.add(new c.c("vvSymbolRotationMatrix",(e=>e.vvSymbolRotationMatrix))),r.uniforms.add(new i.J("vvSymbolAnchor",(e=>e.vvSymbolAnchor))),r.code.add(l.H`vec3 vvScale(vec4 _featureAttribute) {
933
933
  return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
934
934
  }
935
935
  vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
@@ -977,9 +977,9 @@ vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),t.vvColor?(r.c
977
977
  #define discardOrAdjustAlpha(color) { if (color.a < ${o.H.float(i.b)}) { discard; } }
978
978
  `)}r(79884),r(67498);var a=r(21437),s=r(47026);function l(e,t){!function(e,t,r){const i=e.fragment;switch(t.alphaDiscardMode!==s.JJ.Mask&&t.alphaDiscardMode!==s.JJ.MaskBlend||i.uniforms.add(r),t.alphaDiscardMode){case s.JJ.Blend:return e.include(n);case s.JJ.Opaque:i.code.add(o.H`void discardOrAdjustAlpha(inout vec4 color) {
979
979
  color.a = 1.0;
980
- }`);break;case s.JJ.Mask:i.code.add(o.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case s.JJ.MaskBlend:e.fragment.code.add(o.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}(e,t,new a.p("textureAlphaCutoff",(e=>e.textureAlphaCutoff)))}},20787:(e,t,r)=>{r.d(t,{G:()=>d,R:()=>h});var i=r(4307),o=r(97323),n=r(98766),a=r(88669),s=r(19693),l=r(71250),c=r(74709);function d(e){e.fragment.uniforms.add(new l.N("projInfo",((e,t)=>function(e){const t=e.camera.projectionMatrix;return 0===t[11]?(0,n.s)(u,2/(e.camera.fullWidth*t[0]),2/(e.camera.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,n.s)(u,-2/(e.camera.fullWidth*t[0]),-2/(e.camera.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(t)))),e.fragment.uniforms.add(new s.A("zScale",((e,t)=>h(t)))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
980
+ }`);break;case s.JJ.Mask:i.code.add(o.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case s.JJ.MaskBlend:e.fragment.code.add(o.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}(e,t,new a.p("textureAlphaCutoff",(e=>e.textureAlphaCutoff)))}},20787:(e,t,r)=>{r.d(t,{G:()=>u,R:()=>h});var i=r(4307),o=r(97323),n=r(98766),a=r(88669),s=r(19693),l=r(71250),c=r(74709);function u(e){e.fragment.uniforms.add(new l.N("projInfo",((e,t)=>function(e){const t=e.camera.projectionMatrix;return 0===t[11]?(0,n.s)(d,2/(e.camera.fullWidth*t[0]),2/(e.camera.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,n.s)(d,-2/(e.camera.fullWidth*t[0]),-2/(e.camera.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(t)))),e.fragment.uniforms.add(new s.A("zScale",((e,t)=>h(t)))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
981
981
  return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
982
- }`)}const u=(0,a.c)();function h(e){return 0===e.camera.projectionMatrix[11]?(0,i.s)(m,0,1):(0,i.s)(m,1,0)}const m=(0,o.a)()},89243:(e,t,r)=>{r.d(t,{$:()=>o});var i=r(74709);function o({code:e},t){t.doublePrecisionRequiresObfuscation?e.add(i.H`vec3 dpPlusFrc(vec3 a, vec3 b) {
982
+ }`)}const d=(0,a.c)();function h(e){return 0===e.camera.projectionMatrix[11]?(0,i.s)(m,0,1):(0,i.s)(m,1,0)}const m=(0,o.a)()},89243:(e,t,r)=>{r.d(t,{$:()=>o});var i=r(74709);function o({code:e},t){t.doublePrecisionRequiresObfuscation?e.add(i.H`vec3 dpPlusFrc(vec3 a, vec3 b) {
983
983
  return mix(a, a + b, vec3(notEqual(b, vec3(0))));
984
984
  }
985
985
  vec3 dpMinusFrc(vec3 a, vec3 b) {
@@ -1093,4 +1093,4 @@ const vec4 RGBA_2_FLOAT_FACTORS = vec4(
1093
1093
  );
1094
1094
  float rgba2float(vec4 rgba) {
1095
1095
  return dot(rgba, RGBA_2_FLOAT_FACTORS);
1096
- }`)}},93669:(e,t,r)=>{r.d(t,{hY:()=>m,Sv:()=>f,_8:()=>v});var i=r(52138),o=r(13598),n=r(17896),a=r(65617),s=r(70582),l=r(172),c=(r(21437),r(79884)),d=r(67498);class u extends c.x{constructor(e,t){super(e,"mat4",d.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(8319);function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,n.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new u("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,e.origin))),new s.B("localOrigin",(e=>e.origin)));const r=e=>(0,n.s)(g,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new h.g("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,r(t)))),new l.J("localOrigin",((e,t)=>r(t))))}const p=(0,o.c)(),g=(0,a.c)();function v(e){e.uniforms.add(new h.g("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},98925:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Draw,((r,i,o,n)=>r.setUniform2fv(e,t(i,o,n))))}}},19693:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Draw,((r,i,o,n)=>r.setUniform3fv(e,t(i,o,n))))}}},172:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec4",o.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"float",o.P.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"int",o.P.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat4",o.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},33680:(e,t,r)=>{r.d(t,{kG:()=>c});var i=r(20102),o=r(92604),n=r(67498),a=r(11726);const s=o.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class l{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){s.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class c extends l{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new f,this.extensions=new p,this.constants=new v,this.outputs=new g}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s="vertex"===e?T:_,l=this.constants.generateSource().concat(o.constants.generateSource()),c=this.outputs.generateSource(e);return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${n.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${c.join("\n")}\n\n${a.join("\n")}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,t,o,n)}}}class d{constructor(){this._entries=new Map}add(...e){for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else s.error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class u{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class h extends l{constructor(){super(...arguments),this.uniforms=new d,this.code=new u,this.constants=new v}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,a.hu)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push("vertex"===e?`out ${r} ${i};`:`in ${r} ${i};`))),t}}class p{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?p.ALLOWLIST_VERTEX:p.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}p.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],p.ALLOWLIST_VERTEX=[];class g{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?(0,a.hu)(i.name===e&&i.type===t,`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}generateSource(e){if("vertex"===e)return[];if(0===this._entries.size)return g.DEFAULT_OUTPUT;const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}g.DEFAULT_OUTPUT=["layout(location = 0) out vec4 fragColor;"];class v{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=v._numberToFloatStr(r);break;case"int":i=v._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>v._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",T="precision highp float;\nprecision highp sampler2D;"},16374:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},98069:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},79884:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(67498);class o{constructor(e,t,r,o,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={[i.P.Pass]:null,[i.P.Draw]:null},o)switch(r){case i.P.Pass:this.bind[i.P.Pass]=o;break;case i.P.Draw:this.bind[i.P.Draw]=o}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>o,K:()=>i});const i=class{};function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}var n;(n=o||(o={})).int=function(e){return Math.round(e).toString()},n.float=function(e){return e.toPrecision(8)}},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},78869:(e,t,r)=>{r.d(t,{J:()=>i});class i{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},14589:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(70586),o=r(35371);class n{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,i.M2)(this._program),this._pipeline=this._configuration=null}reload(e){(0,i.M2)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return o.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}},51354:(e,t,r)=>{r.d(t,{m:()=>o,o:()=>n});var i=r(74709);class o extends i.K{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function n(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits??[0];let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);t._parameterBits=a;const l=a[s],c=(1<<n)-1<<l;a[s]+=n,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw new Error("Configuration value for "+r+" must be boolean or number, got "+typeof e)}})}}}},17662:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(99001);class o{constructor(){this.id=(0,i.D)()}unload(){}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(35065);const o=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.NORMALCOMPRESSED,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.COLORFEATUREATTRIBUTE,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR,7],[i.T.INSTANCEOBJECTANDLAYERIDCOLOR,7],[i.T.INSTANCEMODEL,8],[i.T.INSTANCEMODELNORMAL,12],[i.T.INSTANCEMODELORIGINHI,11],[i.T.INSTANCEMODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>l});var i=r(70586),o=r(95330),n=r(74709),a=r(47026);class s{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}get _markerTextureRepository(){return this._techniqueRepository.constructionContext.markerTextureRepository}ensureTechnique(e,t){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return a.Rw.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Rw.LOADED:a.Rw.LOADING}get textureBindParameters(){return new c(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textureRepository.acquire(e);if((0,o.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends n.K{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},22631:(e,t,r)=>{r.d(t,{Z:()=>C});var i=r(13598),o=r(17896),n=r(24882),a=r(1533);function s(e){if(e.length<a.DB)return Array.from(e);if((0,a.kJ)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,a.Uc)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var l=r(47026),c=r(44553),d=r(65617),u=r(11726);class h{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this._children=void 0,(0,u.hu)(e.length>=1),(0,u.hu)(r.length%this._numIndexPerPrimitive==0),(0,u.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,u.hu)(3===i.size||4===i.size);const{data:n,size:a}=i,s=e.length;let l=a*r[this._numIndexPerPrimitive*e[0]];m.clear(),m.push(l);const c=(0,d.f)(n[l],n[l+1],n[l+2]),h=(0,d.a)(c);for(let t=0;t<s;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){l=a*r[i+e],m.push(l);let t=n[l];c[0]=Math.min(t,c[0]),h[0]=Math.max(t,h[0]),t=n[l+1],c[1]=Math.min(t,c[1]),h[1]=Math.max(t,h[1]),t=n[l+2],c[2]=Math.min(t,c[2]),h[2]=Math.max(t,h[2])}}this.bbMin=c,this.bbMax=h;const f=(0,o.f)((0,d.c)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(h[0]-c[0],h[1]-c[1]),h[2]-c[2]);let p=this.radius*this.radius;for(let e=0;e<m.length;++e){l=m.at(e);const t=n[l]-f[0],r=n[l+1]-f[1],i=n[l+2]-f[2],o=t*t+r*r+i*i;if(o<=p)continue;const a=Math.sqrt(o),s=.5*(a-this.radius);this.radius=this.radius+s,p=this.radius*this.radius;const c=s/a;f[0]+=t*c,f[1]+=r*c,f[2]+=i*c}this.center=f,m.clear()}getChildren(){if(this._children||(0,o.a)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,o.f)((0,d.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:n,size:a}=this.position;for(let o=0;o<t;++o){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[o];let l=a*this.indices[s],c=n[l],d=n[l+1],u=n[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=a*this.indices[s+e];const t=n[l],r=n[l+1],i=n[l+2];t<c&&(c=t),r<d&&(d=r),i<u&&(u=i)}c<e[0]&&(t|=1),d<e[1]&&(t|=2),u<e[2]&&(t|=4),r[o]=t,++i[t]}let s=0;for(let e=0;e<8;++e)i[e]>0&&++s;if(s<2)return;const l=new Array(8);for(let e=0;e<8;++e)l[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];l[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==l[e]&&this._children.push(new h(l[e],this._numIndexPerPrimitive,this.indices,this.position));return this._children}static prune(){m.prune()}}const m=new c.Z({deallocator:null});var f=r(17662),p=r(4726),g=r(22807),v=r(16996);function _(e,t,r){return(0,o.g)(T,t,e),(0,o.g)(x,r,e),(0,o.l)((0,o.c)(T,T,x))/2}r(12981),new g.x(v.Ue),new g.x((()=>{return e?{p0:(0,d.a)(e.p0),p1:(0,d.a)(e.p1),p2:(0,d.a)(e.p2)}:{p0:(0,d.c)(),p1:(0,d.c)(),p2:(0,d.c)()};var e}));const T=(0,d.c)(),x=(0,d.c)(),E=(0,d.c)(),b=(0,d.c)(),A=(0,d.c)(),S=(0,d.c)();var R=r(99001);class w{constructor(e){this.channel=e,this.id=(0,R.D)()}}var y=r(35065);r(9820),(0,d.c)(),new Float32Array(6);class C extends f.c{constructor(e,t,r=[],i=null,o=p.U.Mesh,a=null,s=-1){super(),this.material=e,this.mapPositions=i,this.type=o,this.objectAndLayerIdColor=a,this.edgeIndicesLength=s,this.visible=!0,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[e,r]of t)r&&this._vertexAttributes.set(e,{...r});if(null==r||0===r.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,n.KF)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,t]of r)t&&(this._indices.set(e,(0,n.mi)(t)),e===y.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}instantiate(e={}){const t=new C(e.material||this.material,[],void 0,this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._vertexAttributes.forEach(((e,r)=>{e.exclusive=!1,t._vertexAttributes.set(r,e)})),this._indices.forEach(((e,r)=>t._indices.set(r,e))),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){let t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:s(t.data)},this._vertexAttributes.set(e,t)),t}setAttributeData(e,t){const r=this._vertexAttributes.get(e);r&&this._vertexAttributes.set(e,{...r,exclusive:!0,data:t})}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===p.U.Mesh?this._computeAttachmentOriginTriangles(e):this.type===p.U.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.m)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(y.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:n}=e;(0,o.s)(r,0,0,0),(0,o.s)(S,0,0,0);let a=0,s=0;for(let e=0;e<t.length-2;e+=3){const l=t[e]*i,c=t[e+1]*i,d=t[e+2]*i;(0,o.s)(E,n[l],n[l+1],n[l+2]),(0,o.s)(b,n[c],n[c+1],n[c+2]),(0,o.s)(A,n[d],n[d+1],n[d+2]);const u=_(E,b,A);u?((0,o.e)(E,E,b),(0,o.e)(E,E,A),(0,o.b)(E,E,1/3*u),(0,o.e)(r,r,E),a+=u):((0,o.e)(S,S,E),(0,o.e)(S,S,b),(0,o.e)(S,S,A),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.b)(r,r,1/a),0):0===s||((0,o.b)(r,S,1/s),0)))}(this.vertexAttributes.get(y.T.POSITION),t,e)}_computeAttachmentOriginLines(e){const t=this.vertexAttributes.get(y.T.POSITION),r=this.indices.get(y.T.POSITION);return function(e,t,r,i){if(!e)return!1;(0,o.s)(i,0,0,0),(0,o.s)(S,0,0,0);let n=0,a=0;const{size:s,data:l}=e,c=t?t.length-1:l.length/s-1,d=c+(r?2:0);for(let e=0;e<d;e+=2){const r=e<c?e:c,d=e<c?e+1:0,u=(t?t[r]:r)*s,h=(t?t[d]:d)*s;E[0]=l[u],E[1]=l[u+1],E[2]=l[u+2],b[0]=l[h],b[1]=l[h+1],b[2]=l[h+2],(0,o.b)(E,(0,o.e)(E,E,b),.5);const m=(0,o.j)(E,b);m>0?((0,o.e)(i,i,(0,o.b)(E,E,m)),n+=m):0===n&&((0,o.e)(S,S,E),a++)}return 0!==n?((0,o.b)(i,i,1/n),!0):0!==a&&((0,o.b)(i,S,1/a),!0)}(t,r,r&&function(e,t,r){return!(!("isClosed"in e)||!e.isClosed)&&(r?r.length>2:t.data.length>6)}(this.material.parameters,t,r),e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(y.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:n}=e;(0,o.s)(r,0,0,0);let a=-1,s=0;for(let e=0;e<t.length;e++){const o=t[e]*i;a!==o&&(r[0]+=n[o],r[1]+=n[o+1],r[2]+=n[o+2],s++),a=o}return s>1&&(0,o.b)(r,r,1/s),s>0}(this.vertexAttributes.get(y.T.POSITION),t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(y.T.POSITION),t=this.vertexAttributes.get(y.T.POSITION);if(!e||0===e.length||!t)return null;const r=this.type===p.U.Mesh?3:1;(0,u.hu)(e.length%r==0,"Indexing error: "+e.length+" not divisible by "+r);const i=(0,n.KF)(e.length/r);return new h(i,r,e,t)}get transformation(){return this._transformation??i.I}set transformation(e){this._transformation=e&&e!==i.I?(0,i.b)(e):null}addHighlight(){const e=new w(l.V_.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}},82791:(e,t,r)=>{r.d(t,{F5:()=>u,yD:()=>i});var i,o,n=r(65617),a=(r(74709),r(47026)),s=r(17662),l=r(4726),c=r(83475),d=r(57790);class u extends s.c{constructor(e,t){super(),this.type=l.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=c.i,this._pp0=(0,n.f)(0,0,1),this._pp1=(0,n.f)(0,0,0),this._parameters=(0,d.Uf)(e,t),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,d.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&(!this.isDecoration||e.bindParameters.decorations===a.Iq.ON)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get isDecoration(){return this.parameters.isDecoration}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){null!=this.repository&&this.repository.materialChanged(this)}intersectDraped(e,t,r,i,o,n){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque"},59377:(e,t,r)=>{r.d(t,{$:()=>n});var i=r(44553),o=r(49300);class n{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new i.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=(0,o.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t||null==t.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),null!=this._fragmentUniforms&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},97995:(e,t,r)=>{var i;r.d(t,{r:()=>i}),function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",e[e.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",e[e.ANTIALIASING=10]="ANTIALIASING",e[e.SSAO=11]="SSAO",e[e.HIGHLIGHT=12]="HIGHLIGHT",e[e.SHADOW_HIGHLIGHT=13]="SHADOW_HIGHLIGHT",e[e.POSTPROCESSING_ENVIRONMENT_OPAQUE=14]="POSTPROCESSING_ENVIRONMENT_OPAQUE",e[e.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=15]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",e[e.LASERLINES=16]="LASERLINES",e[e.LASERLINES_CONTRAST_CONTROL=17]="LASERLINES_CONTRAST_CONTROL",e[e.HUD_MATERIAL=18]="HUD_MATERIAL",e[e.LABEL_MATERIAL=19]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=20]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=21]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=22]="DRAPED_MATERIAL",e[e.DRAPED_WATER=23]="DRAPED_WATER",e[e.VOXEL=24]="VOXEL",e[e.MAX_SLOTS=25]="MAX_SLOTS"}(i||(i={}))},93144:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},47026:(e,t,r)=>{var i,o,n,a,s,l,c,d,u;r.d(t,{Gv:()=>o,Iq:()=>d,JJ:()=>c,Rw:()=>a,Ti:()=>u,V_:()=>l,Vr:()=>i,hU:()=>s}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(n||(n={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(l||(l={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(c||(c={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(d||(d={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(u||(u={}))},57790:(e,t,r)=>{r.d(t,{FZ:()=>w,Uf:()=>A,Bw:()=>f,LO:()=>S,Hx:()=>b});var i=r(67676),o=r(22021),n=r(17896),a=r(65617),s=r(60437),l=r(4726);function c(e,t,r,i){return function(e,t){return(0,o.t7)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}(e,function(e,t,r){const i=r.parameters;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d}(t,r,i))}r(64822),(0,o.Vl)(10),(0,o.Vl)(12),(0,o.Vl)(70),(0,o.Vl)(40);const d={scale:0,factor:0,minScaleFactor:0};var u=r(11726),h=r(35065);const m=(0,s.Ue)();function f(e,t,r,i,o,n){if(e.visible)if(e.boundingInfo){(0,u.hu)(e.type===l.U.Mesh);const a=t.tolerance;g(e.boundingInfo,r,i,a,o,n)}else{const t=e.indices.get(h.T.POSITION),a=e.vertexAttributes.get(h.T.POSITION);_(r,i,0,t.length/3,t,a,void 0,o,n)}}const p=(0,a.c)();function g(e,t,r,i,o,a){if(null==e)return;const l=function(e,t,r){return(0,n.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,p);if((0,s.op)(m,e.bbMin),(0,s.Tn)(m,e.bbMax),null!=o&&o.applyToAabb(m),function(e,t,r,i){return function(e,t,r,i,o){const n=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(n,a),l=Math.max(n,a);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(m,t,l,i)){const{primitiveIndices:n,indices:s,position:l}=e,c=n?n.length:s.length/3;if(c>y){const n=e.getChildren();if(void 0!==n){for(const e of n)g(e,t,r,i,o,a);return}}_(t,r,0,c,s,l,n,o,a)}}const v=(0,a.c)();function _(e,t,r,i,o,n,a,s,l){if(a)return function(e,t,r,i,o,n,a,s,l){const{data:c,stride:d}=n,u=e[0],h=e[1],m=e[2],f=t[0]-u,p=t[1]-h,g=t[2]-m;for(let e=r;e<i;++e){const t=a[e];let r=3*t,i=d*o[r++],n=c[i++],_=c[i++],T=c[i];i=d*o[r++];let x=c[i++],b=c[i++],A=c[i];i=d*o[r];let S=c[i++],R=c[i++],w=c[i];null!=s&&([n,_,T]=s.applyToVertex(n,_,T,e),[x,b,A]=s.applyToVertex(x,b,A,e),[S,R,w]=s.applyToVertex(S,R,w,e));const y=x-n,C=b-_,M=A-T,O=S-n,I=R-_,P=w-T,N=p*P-I*g,L=g*O-P*f,D=f*I-O*p,F=y*N+C*L+M*D;if(Math.abs(F)<=Number.EPSILON)continue;const H=u-n,B=h-_,G=m-T,U=H*N+B*L+G*D;if(F>0){if(U<0||U>F)continue}else if(U>0||U<F)continue;const z=B*M-C*G,V=G*y-M*H,W=H*C-y*B,j=f*z+p*V+g*W;if(F>0){if(j<0||U+j>F)continue}else if(j>0||U+j<F)continue;const k=(O*z+I*V+P*W)/F;k>=0&&l(k,E(y,C,M,O,I,P,v),t,!1)}}(e,t,r,i,o,n,a,s,l);const{data:c,stride:d}=n,u=e[0],h=e[1],m=e[2],f=t[0]-u,p=t[1]-h,g=t[2]-m;for(let e=r,t=3*r;e<i;++e){let r=d*o[t++],i=c[r++],n=c[r++],a=c[r];r=d*o[t++];let _=c[r++],T=c[r++],x=c[r];r=d*o[t++];let b=c[r++],A=c[r++],S=c[r];null!=s&&([i,n,a]=s.applyToVertex(i,n,a,e),[_,T,x]=s.applyToVertex(_,T,x,e),[b,A,S]=s.applyToVertex(b,A,S,e));const R=_-i,w=T-n,y=x-a,C=b-i,M=A-n,O=S-a,I=p*O-M*g,P=g*C-O*f,N=f*M-C*p,L=R*I+w*P+y*N;if(Math.abs(L)<=Number.EPSILON)continue;const D=u-i,F=h-n,H=m-a,B=D*I+F*P+H*N;if(L>0){if(B<0||B>L)continue}else if(B>0||B<L)continue;const G=F*y-w*H,U=H*R-y*D,z=D*w-R*F,V=f*G+p*U+g*z;if(L>0){if(V<0||B+V>L)continue}else if(V>0||B+V<L)continue;const W=(C*G+M*U+O*z)/L;W>=0&&l(W,E(R,w,y,C,M,O,v),e,!1)}}const T=(0,a.c)(),x=(0,a.c)();function E(e,t,r,i,o,a,s){return(0,n.s)(T,e,t,r),(0,n.s)(x,i,o,a),(0,n.c)(s,T,x),(0,n.n)(s,s),s}function b(e,t,r,i,n){let a=(r.screenLength||0)*e.pixelRatio;null!=n&&(a=c(a,i,t,n));const s=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.uZ)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function A(e,t){const r=t?A(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=R(i)),null==i&&t in r||(r[t]=i)}return r}function S(e,t){let r=!1;for(const o in t){const n=t[o];void 0!==n&&(Array.isArray(n)?null===e[o]?(e[o]=n.slice(),r=!0):(0,i.Vx)(e[o],n)&&(r=!0):e[o]!==n&&(r=!0,e[o]=n))}return r}function R(e){const t=[];return e.forEach((e=>t.push(e))),t}const w={multiply:1,ignore:2,replace:3,tint:4},y=1e3},95720:(e,t,r)=>{var i;r.d(t,{n:()=>i}),function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(i||(i={}))},4375:(e,t,r)=>{var i;r.d(t,{B:()=>i}),function(e){e[e.Texture=0]="Texture",e[e.RenderBuffer=1]="RenderBuffer"}(i||(i={}))},57088:(e,t,r)=>{r.d(t,{x:()=>u});var i=r(20102),o=(r(80442),r(22021)),n=r(49300),a=r(7575),s=r(35371),l=r(4375),c=r(47859);class d extends c.X{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case s.lP.R16F:case s.lP.R16I:case s.lP.R16UI:case s.lP.R32F:case s.lP.R32I:case s.lP.R32UI:case s.lP.R8_SNORM:case s.lP.R8:case s.lP.R8I:case s.lP.R8UI:this.pixelFormat=s.VI.RED}}static validate(e,t){return new d(e,t)}}let u=class{constructor(e,t=null,r=null){if(this.type=l.B.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=d.validate(e,t);if(!r)throw new i.Z("Texture descriptor invalid");this._descriptor=r}if(this._descriptor.context.instanceCounter.increment(s._g.Texture,this),this._descriptor.context.type!==a.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),v(this._descriptor.target)))throw new i.Z("3D and array textures are not supported in WebGL1");this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get gpuMemoryUsage(){return T.delete(this),(0,c.G)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._descriptor.context.instanceCounter.decrement(s._g.Texture,this),this._glName=null)}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.Z("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=s.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=s.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._descriptor.context||!this._descriptor.context.gl)return;const r=this._descriptor.context.gl;(0,n.zu)(r),this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const o=this._descriptor,a=t??o.target,l=v(a);null===e&&(o.width=o.width||4,o.height=o.height||4,l&&(o.depth=o.depth??1));const c=this._descriptor.context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),h(this._descriptor.context,o),this._configurePixelStorage(),(0,n.zu)(r);const d=this._deriveInternalFormat();if(g(e)){let t="width"in e?e.width:e.codedWidth,i="height"in e?e.height:e.codedHeight;const s=1;e instanceof HTMLVideoElement&&(t=e.videoWidth,i=e.videoHeight),o.width&&o.height,l&&o.depth,o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,d,o.hasMipmap,t,i,s),this._texImage(a,0,d,t,i,s,e),(0,n.zu)(r),o.hasMipmap&&this.generateMipmap(),o.width||(o.width=t),o.height||(o.height=i),l&&!o.depth&&(o.depth=s)}else{const{width:t,height:c,depth:u}=o;if(null==t||null==c)throw new i.Z("Width and height must be specified!");if(l&&null==u)throw new i.Z("Depth must be specified!");if(o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,d,o.hasMipmap,t,c,u),p(e)){const n=e.levels,l=_(a,t,c,u),h=Math.min(l-1,n.length-1);null!=this._descriptor.context.gl2?r.texParameteri(o.target,this._descriptor.context.gl2.TEXTURE_MAX_LEVEL,h):o.hasMipmap=o.hasMipmap&&l===n.length;const m=d;if(!(m in s.q_))throw new i.Z("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const o=n[Math.min(e,n.length-1)];this._compressedTexImage(a,e,m,t,r,i,o)}),h)}else this._texImage(a,0,d,t,c,u,e),(0,n.zu)(r),o.hasMipmap&&this.generateMipmap()}m(r,this._descriptor),f(r,this._descriptor),function(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}(this._descriptor.context,this._descriptor),(0,n.zu)(r),this._descriptor.context.bindTexture(c,u.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,o,n,a,s=0){a||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor.context.gl,c=this._descriptor.context.gl2,d=this._descriptor,h=this._deriveInternalFormat(),{pixelFormat:m,dataType:f,target:v,isImmutable:_}=d;if(_&&!this._wasImmutablyAllocated)throw new i.Z("Cannot update immutable texture before allocation!");const T=this._descriptor.context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES,!0);if((t<0||r<0||o>d.width||n>d.height||t+o>d.width||r+n>d.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),s){if(!c)return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(c.UNPACK_SKIP_ROWS,s)}if(g(a)?c?c.texSubImage2D(v,e,t,r,o,n,m,f,a):l.texSubImage2D(v,e,t,r,m,f,a):p(a)?l.compressedTexSubImage2D(v,e,t,r,o,n,h,a.levels[e]):l.texSubImage2D(v,e,t,r,o,n,m,f,a),s){if(!c)return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(c.UNPACK_SKIP_ROWS,0)}this._descriptor.context.bindTexture(T,u.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,o,n,a,s,l){l||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const c=this._descriptor.context.gl2;if(null==c)throw new i.Z("3D textures are not supported in WebGL1");const d=this._descriptor,h=this._deriveInternalFormat(),{pixelFormat:m,dataType:f,isImmutable:g,target:_}=d;if(g&&!this._wasImmutablyAllocated)throw new i.Z("Cannot update immutable texture before allocation!");v(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const T=this._descriptor.context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);if(this._descriptor.context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||o<0||n>d.width||a>d.height||s>d.depth||t+n>d.width||r+a>d.height||o+s>d.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),p(l))l=l.levels[e],c.compressedTexSubImage3D(_,e,t,r,o,n,a,s,h,l);else{const i=l;c.texSubImage3D(_,e,t,r,o,n,a,s,m,f,i)}this._descriptor.context.bindTexture(T,u.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.Z("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,h(this._descriptor.context,e)}e.samplingMode===s.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=s.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===s.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=s.cw.NEAREST_MIPMAP_NEAREST);const t=this._descriptor.context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,u.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,h(this._descriptor.context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor.context.gl,t=this._descriptor;this._samplingModeDirty&&(m(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(f(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.context.type===a.zO.WEBGL1)return this._descriptor.internalFormat=this._descriptor.pixelFormat;if(null!=this._descriptor.internalFormat)return this._descriptor.internalFormat===s.VI.DEPTH_STENCIL&&(this._descriptor.internalFormat=s.VI.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case s.Br.FLOAT:switch(this._descriptor.pixelFormat){case s.VI.RGBA:return this._descriptor.internalFormat=s.lP.RGBA32F;case s.VI.RGB:return this._descriptor.internalFormat=s.lP.RGB32F;default:throw new i.Z("Unable to derive format")}case s.Br.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case s.VI.RGBA:return this._descriptor.internalFormat=s.lP.RGBA8;case s.VI.RGB:return this._descriptor.internalFormat=s.lP.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===s.VI.DEPTH_STENCIL?s.VI.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,o,n,a){const l=this._descriptor.context.gl2;if(null==l)throw new i.Z("Immutable textures are not supported in WebGL1");if(!(t in s.lP))throw new i.Z("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?_(e,o,n,a):1;if(v(e)){if(null==a)throw new i.Z("Missing depth dimension for 3D texture upload");l.texStorage3D(e,c,t,o,n,a)}else l.texStorage2D(e,c,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,s,l){const c=this._descriptor.context.gl,d=v(e),{isImmutable:u,pixelFormat:h,dataType:m}=this._descriptor,f=this._descriptor.context.type===a.zO.WEBGL2,p=f?c:null;if(f||!g(l))if(u){if(null!=l){const r=l;if(d){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");p.texSubImage3D(e,t,0,0,0,o,n,s,h,m,r)}else c.texSubImage2D(e,t,0,0,o,n,h,m,r)}}else{const a=l;if(d){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");p.texImage3D(e,t,r,o,n,s,0,h,m,a)}else c.texImage2D(e,t,r,o,n,0,h,m,a)}else c.texImage2D(e,0,r,h,m,l)}_compressedTexImage(e,t,r,o,n,s,l){const c=this._descriptor.context.gl;let d=null;const u=v(e),h=this._descriptor.isImmutable;if(u){if(this._descriptor.context.type!==a.zO.WEBGL2)throw new i.Z("3D textures are not supported in WebGL1");d=c}if(h){if(null!=l)if(u){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");d.compressedTexSubImage3D(e,t,0,0,0,o,n,s,r,l)}else c.compressedTexSubImage2D(e,t,0,0,o,n,r,l)}else if(u){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");d.compressedTexImage3D(e,t,r,o,n,s,0,l)}else c.compressedTexImage2D(e,t,r,o,n,0,l)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:l}=this._descriptor;const c=l===s.No.TEXTURE_3D;if(null==r||null==o||c&&null==n)throw new i.Z("Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||c&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),c&&(n=Math.max(1,n>>1))}};function h(e,t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=e.type===a.zO.WEBGL2;r||!t.isImmutable&&!v(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||null!=t.width&&(0,o.wt)(t.width)&&null!=t.height&&(0,o.wt)(t.height)||("number"==typeof t.wrapMode?t.wrapMode!==s.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===s.e8.CLAMP_TO_EDGE&&t.wrapMode.t===s.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}function m(e,t){let r=t.samplingMode,i=t.samplingMode;r===s.cw.LINEAR_MIPMAP_NEAREST||r===s.cw.LINEAR_MIPMAP_LINEAR?(r=s.cw.LINEAR,t.hasMipmap||(i=s.cw.LINEAR)):r!==s.cw.NEAREST_MIPMAP_NEAREST&&r!==s.cw.NEAREST_MIPMAP_LINEAR||(r=s.cw.NEAREST,t.hasMipmap||(i=s.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}function f(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}function p(e){return null!=e&&"type"in e&&"compressed"===e.type}function g(e){return null!=e&&!p(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function v(e){return e===s.No.TEXTURE_3D||e===s.No.TEXTURE_2D_ARRAY}function _(e,t,r,i=1){let o=Math.max(t,r);return e===s.No.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}u.TEXTURE_UNIT_FOR_UPDATES=0;const T=new Map},47859:(e,t,r)=>{r.d(t,{G:()=>a,X:()=>n});var i=r(35371),o=r(45762);class n{constructor(e=0,t=e){this.width=e,this.height=t,this.target=i.No.TEXTURE_2D,this.pixelFormat=i.VI.RGBA,this.dataType=i.Br.UNSIGNED_BYTE,this.samplingMode=i.cw.LINEAR,this.wrapMode=i.e8.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}}function a(e){return e.width<=0||e.height<=0?0:e.width*e.height*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,o.RG)(e.internalFormat))}},45762:(e,t,r)=>{r.d(t,{RG:()=>o}),r(80442);var i=r(35371);function o(e){switch(e){case i.VI.ALPHA:case i.VI.LUMINANCE:case i.VI.RED:case i.VI.RED_INTEGER:case i.lP.R8:case i.lP.R8I:case i.lP.R8UI:case i.lP.R8_SNORM:case i.Tg.STENCIL_INDEX8:return 1;case i.VI.LUMINANCE_ALPHA:case i.VI.RG:case i.VI.RG_INTEGER:case i.lP.RGBA4:case i.lP.R16F:case i.lP.R16I:case i.lP.R16UI:case i.lP.RG8:case i.lP.RG8I:case i.lP.RG8UI:case i.lP.RG8_SNORM:case i.lP.RGB565:case i.lP.RGB5_A1:case i.Tg.DEPTH_COMPONENT16:return 2;case i.VI.DEPTH_COMPONENT:case i.VI.RGB:case i.VI.RGB_INTEGER:case i.lP.RGB8:case i.lP.RGB8I:case i.lP.RGB8UI:case i.lP.RGB8_SNORM:case i.lP.SRGB8:case i.Tg.DEPTH_COMPONENT24:return 3;case i.VI.DEPTH_STENCIL:case i.VI.DEPTH24_STENCIL8:case i.VI.RGBA:case i.VI.RGBA_INTEGER:case i.lP.RGBA8:case i.lP.R32F:case i.lP.R11F_G11F_B10F:case i.lP.RG16F:case i.lP.R32I:case i.lP.R32UI:case i.lP.RG16I:case i.lP.RG16UI:case i.lP.RGBA8I:case i.lP.RGBA8UI:case i.lP.RGBA8_SNORM:case i.lP.SRGB8_ALPHA8:case i.lP.RGB9_E5:case i.lP.RGB10_A2UI:case i.lP.RGB10_A2:case i.Tg.DEPTH_STENCIL:case i.Tg.DEPTH_COMPONENT32F:case i.Tg.DEPTH24_STENCIL8:return 4;case i.Tg.DEPTH32F_STENCIL8:return 5;case i.lP.RGB16F:case i.lP.RGB16I:case i.lP.RGB16UI:return 6;case i.lP.RG32F:case i.lP.RG32I:case i.lP.RG32UI:case i.lP.RGBA16F:case i.lP.RGBA16I:case i.lP.RGBA16UI:return 8;case i.lP.RGB32F:case i.lP.RGB32I:case i.lP.RGB32UI:return 12;case i.lP.RGBA32F:case i.lP.RGBA32I:case i.lP.RGBA32UI:return 16;case i.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.q_.COMPRESSED_R11_EAC:case i.q_.COMPRESSED_SIGNED_R11_EAC:case i.q_.COMPRESSED_RGB8_ETC2:case i.q_.COMPRESSED_SRGB8_ETC2:case i.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.q_.COMPRESSED_RG11_EAC:case i.q_.COMPRESSED_SIGNED_RG11_EAC:case i.q_.COMPRESSED_RGBA8_ETC2_EAC:case i.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},49300:(e,t,r)=>{r.d(t,{hZ:()=>s,zu:()=>l});var i=r(20102),o=r(80442);const n=r(92604).Z.getLogger("esri.views.webgl.checkWebGLError"),a=!!(0,o.Z)("enable-feature:webgl-debug");function s(){return a}function l(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),o=(new Error).stack;n.error(new i.Z("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}},7575:(e,t,r)=>{r.d(t,{Sh:()=>a,kr:()=>n,zO:()=>i});var i,o=r(80442);function n(e,t,r={}){const o=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];for(const t of o){const i=e.getContext(t,r);if(i)return i}return null}function a(e){if("3d"===e)return[i.WEBGL2];const t=(0,o.Z)("esri-force-webgl");return t===i.WEBGL1||t===i.WEBGL2?[t]:(0,o.Z)("mac")&&(0,o.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1]}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(i||(i={}))},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],t[i]=n[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],n[1]=e[i]-n[0],t[i]=n[1];return t}r.d(t,{GB:()=>o,U8:()=>i});const n=new Float32Array(2)},27097:(e,t,r)=>{r.d(t,{BK:()=>u,LZ:()=>d,if:()=>n,sm:()=>x,wK:()=>a,zp:()=>c});var i=r(47026),o=r(35371);function n(e,t,r=o.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function a(e,t,r,i,n=o.db.ADD,a=o.db.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const s={face:o.LR.BACK,mode:o.Wf.CCW},l={face:o.LR.FRONT,mode:o.Wf.CCW},c=e=>e===i.Vr.Back?s:e===i.Vr.Front?l:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return A.intern(e)}function m(e){return R.intern(e)}function f(e){return y.intern(e)}function p(e){return M.intern(e)}function g(e){return I.intern(e)}function v(e){return N.intern(e)}function _(e){return D.intern(e)}function T(e){return H.intern(e)}function x(e){return G.intern(e)}class E{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function b(e){return"["+e.join(",")+"]"}const A=new E(S,(e=>({__tag:"Blending",...e})));function S(e){return e?b([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const R=new E(w,(e=>({__tag:"Culling",...e})));function w(e){return e?b([e.face,e.mode]):null}const y=new E(C,(e=>({__tag:"PolygonOffset",...e})));function C(e){return e?b([e.factor,e.units]):null}const M=new E(O,(e=>({__tag:"DepthTest",...e})));function O(e){return e?b([e.func]):null}const I=new E(P,(e=>({__tag:"StencilTest",...e})));function P(e){return e?b([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const N=new E(L,(e=>({__tag:"DepthWrite",...e})));function L(e){return e?b([e.zNear,e.zFar]):null}const D=new E(F,(e=>({__tag:"ColorWrite",...e})));function F(e){return e?b([e.r,e.g,e.b,e.a]):null}const H=new E(B,(e=>({__tag:"StencilWrite",...e})));function B(e){return e?b([e.mask]):null}const G=new E((function(e){return e?b([S(e.blending),w(e.culling),C(e.polygonOffset),O(e.depthTest),P(e.stencilTest),L(e.depthWrite),F(e.colorWrite),B(e.stencilWrite)]):null}),(e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:f(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:T(e.stencilWrite)})))}}]);
1096
+ }`)}},93669:(e,t,r)=>{r.d(t,{hY:()=>m,Sv:()=>f,_8:()=>v});var i=r(52138),o=r(13598),n=r(17896),a=r(65617),s=r(70582),l=r(172),c=(r(21437),r(79884)),u=r(67498);class d extends c.x{constructor(e,t){super(e,"mat4",u.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(8319);function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,n.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new d("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,e.origin))),new s.B("localOrigin",(e=>e.origin)));const r=e=>(0,n.s)(g,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new h.g("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,r(t)))),new l.J("localOrigin",((e,t)=>r(t))))}const p=(0,o.a)(),g=(0,a.c)();function v(e){e.uniforms.add(new h.g("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},98925:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Draw,((r,i,o,n)=>r.setUniform2fv(e,t(i,o,n))))}}},19693:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Draw,((r,i,o,n)=>r.setUniform3fv(e,t(i,o,n))))}}},172:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec4",o.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"float",o.P.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"int",o.P.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat4",o.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},33680:(e,t,r)=>{r.d(t,{kG:()=>c});var i=r(20102),o=r(92604),n=r(67498),a=r(11726);const s=o.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class l{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){s.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class c extends l{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new f,this.extensions=new p,this.constants=new v,this.outputs=new g}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s="vertex"===e?T:_,l=this.constants.generateSource().concat(o.constants.generateSource()),c=this.outputs.generateSource(e);return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${n.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${c.join("\n")}\n\n${a.join("\n")}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.P.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,t,o,n)}}}class u{constructor(){this._entries=new Map}add(...e){for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else s.error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class h extends l{constructor(){super(...arguments),this.uniforms=new u,this.code=new d,this.constants=new v}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,a.hu)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push("vertex"===e?`out ${r} ${i};`:`in ${r} ${i};`))),t}}class p{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?p.ALLOWLIST_VERTEX:p.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}p.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],p.ALLOWLIST_VERTEX=[];class g{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?(0,a.hu)(i.name===e&&i.type===t,`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}generateSource(e){if("vertex"===e)return[];if(0===this._entries.size)return g.DEFAULT_OUTPUT;const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}g.DEFAULT_OUTPUT=["layout(location = 0) out vec4 fragColor;"];class v{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=v._numberToFloatStr(r);break;case"int":i=v._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>v._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",T="precision highp float;\nprecision highp sampler2D;"},16374:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},98069:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},79884:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(67498);class o{constructor(e,t,r,o,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={[i.P.Pass]:null,[i.P.Draw]:null},o)switch(r){case i.P.Pass:this.bind[i.P.Pass]=o;break;case i.P.Draw:this.bind[i.P.Draw]=o}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>o,K:()=>i});const i=class{};function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}var n;(n=o||(o={})).int=function(e){return Math.round(e).toString()},n.float=function(e){return e.toPrecision(8)}},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},78869:(e,t,r)=>{r.d(t,{J:()=>i});class i{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},14589:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(70586),o=r(35371);class n{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,i.M2)(this._program),this._pipeline=this._configuration=null}reload(e){(0,i.M2)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return o.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}},51354:(e,t,r)=>{r.d(t,{m:()=>o,o:()=>n});var i=r(74709);class o extends i.K{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function n(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits??[0];let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);t._parameterBits=a;const l=a[s],c=(1<<n)-1<<l;a[s]+=n,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw new Error("Configuration value for "+r+" must be boolean or number, got "+typeof e)}})}}}},17662:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(99001);class o{constructor(){this.id=(0,i.D)()}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(35065);const o=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.NORMALCOMPRESSED,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.COLORFEATUREATTRIBUTE,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR,7],[i.T.INSTANCEOBJECTANDLAYERIDCOLOR,7],[i.T.INSTANCEMODEL,8],[i.T.INSTANCEMODELNORMAL,12],[i.T.INSTANCEMODELORIGINHI,11],[i.T.INSTANCEMODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>l});var i=r(70586),o=r(95330),n=r(74709),a=r(47026);class s{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}get _markerTextureRepository(){return this._techniqueRepository.constructionContext.markerTextureRepository}ensureTechnique(e,t){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return a.Rw.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRepository,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Rw.LOADED:a.Rw.LOADING}get textureBindParameters(){return new c(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textureRepository.acquire(e);if((0,o.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends n.K{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},22631:(e,t,r)=>{r.d(t,{Z:()=>C});var i=r(13598),o=r(17896),n=r(24882),a=r(1533);function s(e){if(e.length<a.DB)return Array.from(e);if((0,a.kJ)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,a.Uc)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var l=r(47026),c=r(44553),u=r(65617),d=r(11726);class h{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this._children=void 0,(0,d.hu)(e.length>=1),(0,d.hu)(r.length%this._numIndexPerPrimitive==0),(0,d.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,d.hu)(3===i.size||4===i.size);const{data:n,size:a}=i,s=e.length;let l=a*r[this._numIndexPerPrimitive*e[0]];m.clear(),m.push(l);const c=(0,u.f)(n[l],n[l+1],n[l+2]),h=(0,u.g)(c);for(let t=0;t<s;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){l=a*r[i+e],m.push(l);let t=n[l];c[0]=Math.min(t,c[0]),h[0]=Math.max(t,h[0]),t=n[l+1],c[1]=Math.min(t,c[1]),h[1]=Math.max(t,h[1]),t=n[l+2],c[2]=Math.min(t,c[2]),h[2]=Math.max(t,h[2])}}this.bbMin=c,this.bbMax=h;const f=(0,o.p)((0,u.c)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(h[0]-c[0],h[1]-c[1]),h[2]-c[2]);let p=this.radius*this.radius;for(let e=0;e<m.length;++e){l=m.at(e);const t=n[l]-f[0],r=n[l+1]-f[1],i=n[l+2]-f[2],o=t*t+r*r+i*i;if(o<=p)continue;const a=Math.sqrt(o),s=.5*(a-this.radius);this.radius=this.radius+s,p=this.radius*this.radius;const c=s/a;f[0]+=t*c,f[1]+=r*c,f[2]+=i*c}this.center=f,m.clear()}getChildren(){if(this._children||(0,o.a)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,o.p)((0,u.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:n,size:a}=this.position;for(let o=0;o<t;++o){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[o];let l=a*this.indices[s],c=n[l],u=n[l+1],d=n[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=a*this.indices[s+e];const t=n[l],r=n[l+1],i=n[l+2];t<c&&(c=t),r<u&&(u=r),i<d&&(d=i)}c<e[0]&&(t|=1),u<e[1]&&(t|=2),d<e[2]&&(t|=4),r[o]=t,++i[t]}let s=0;for(let e=0;e<8;++e)i[e]>0&&++s;if(s<2)return;const l=new Array(8);for(let e=0;e<8;++e)l[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];l[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==l[e]&&this._children.push(new h(l[e],this._numIndexPerPrimitive,this.indices,this.position));return this._children}static prune(){m.prune()}}const m=new c.Z({deallocator:null});var f=r(17662),p=r(4726),g=r(22807),v=r(16996);function _(e,t,r){return(0,o.f)(T,t,e),(0,o.f)(x,r,e),(0,o.l)((0,o.b)(T,T,x))/2}r(12981),new g.x(v.Ue),new g.x((()=>{return e?{p0:(0,u.g)(e.p0),p1:(0,u.g)(e.p1),p2:(0,u.g)(e.p2)}:{p0:(0,u.c)(),p1:(0,u.c)(),p2:(0,u.c)()};var e}));const T=(0,u.c)(),x=(0,u.c)(),E=(0,u.c)(),b=(0,u.c)(),A=(0,u.c)(),S=(0,u.c)();var R=r(99001);class w{constructor(e){this.channel=e,this.id=(0,R.D)()}}var y=r(35065);r(9820),(0,u.c)(),new Float32Array(6);class C extends f.c{constructor(e,t,r=[],i=null,o=p.U.Mesh,a=null,s=-1){super(),this.material=e,this.mapPositions=i,this.type=o,this.objectAndLayerIdColor=a,this.edgeIndicesLength=s,this.visible=!0,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[e,r]of t)r&&this._vertexAttributes.set(e,{...r});if(null==r||0===r.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,n.KF)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,t]of r)t&&(this._indices.set(e,(0,n.mi)(t)),e===y.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}instantiate(e={}){const t=new C(e.material||this.material,[],void 0,this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._vertexAttributes.forEach(((e,r)=>{e.exclusive=!1,t._vertexAttributes.set(r,e)})),this._indices.forEach(((e,r)=>t._indices.set(r,e))),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){let t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:s(t.data)},this._vertexAttributes.set(e,t)),t}setAttributeData(e,t){const r=this._vertexAttributes.get(e);r&&this._vertexAttributes.set(e,{...r,exclusive:!0,data:t})}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===p.U.Mesh?this._computeAttachmentOriginTriangles(e):this.type===p.U.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.e)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(y.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:n}=e;(0,o.s)(r,0,0,0),(0,o.s)(S,0,0,0);let a=0,s=0;for(let e=0;e<t.length-2;e+=3){const l=t[e]*i,c=t[e+1]*i,u=t[e+2]*i;(0,o.s)(E,n[l],n[l+1],n[l+2]),(0,o.s)(b,n[c],n[c+1],n[c+2]),(0,o.s)(A,n[u],n[u+1],n[u+2]);const d=_(E,b,A);d?((0,o.g)(E,E,b),(0,o.g)(E,E,A),(0,o.i)(E,E,1/3*d),(0,o.g)(r,r,E),a+=d):((0,o.g)(S,S,E),(0,o.g)(S,S,b),(0,o.g)(S,S,A),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.i)(r,r,1/a),0):0===s||((0,o.i)(r,S,1/s),0)))}(this.vertexAttributes.get(y.T.POSITION),t,e)}_computeAttachmentOriginLines(e){const t=this.vertexAttributes.get(y.T.POSITION),r=this.indices.get(y.T.POSITION);return function(e,t,r,i){if(!e)return!1;(0,o.s)(i,0,0,0),(0,o.s)(S,0,0,0);let n=0,a=0;const{size:s,data:l}=e,c=t?t.length-1:l.length/s-1,u=c+(r?2:0);for(let e=0;e<u;e+=2){const r=e<c?e:c,u=e<c?e+1:0,d=(t?t[r]:r)*s,h=(t?t[u]:u)*s;E[0]=l[d],E[1]=l[d+1],E[2]=l[d+2],b[0]=l[h],b[1]=l[h+1],b[2]=l[h+2],(0,o.i)(E,(0,o.g)(E,E,b),.5);const m=(0,o.q)(E,b);m>0?((0,o.g)(i,i,(0,o.i)(E,E,m)),n+=m):0===n&&((0,o.g)(S,S,E),a++)}return 0!==n?((0,o.i)(i,i,1/n),!0):0!==a&&((0,o.i)(i,S,1/a),!0)}(t,r,r&&function(e,t,r){return!(!("isClosed"in e)||!e.isClosed)&&(r?r.length>2:t.data.length>6)}(this.material.parameters,t,r),e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(y.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:n}=e;(0,o.s)(r,0,0,0);let a=-1,s=0;for(let e=0;e<t.length;e++){const o=t[e]*i;a!==o&&(r[0]+=n[o],r[1]+=n[o+1],r[2]+=n[o+2],s++),a=o}return s>1&&(0,o.i)(r,r,1/s),s>0}(this.vertexAttributes.get(y.T.POSITION),t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(y.T.POSITION),t=this.vertexAttributes.get(y.T.POSITION);if(!e||0===e.length||!t)return null;const r=this.type===p.U.Mesh?3:1;(0,d.hu)(e.length%r==0,"Indexing error: "+e.length+" not divisible by "+r);const i=(0,n.KF)(e.length/r);return new h(i,r,e,t)}get transformation(){return this._transformation??i.I}set transformation(e){this._transformation=e&&e!==i.I?(0,i.b)(e):null}addHighlight(){const e=new w(l.V_.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}},82791:(e,t,r)=>{r.d(t,{F5:()=>d,yD:()=>i});var i,o,n=r(65617),a=(r(74709),r(47026)),s=r(17662),l=r(4726),c=r(83475),u=r(57790);class d extends s.c{constructor(e,t){super(),this.type=l.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=c.i,this._pp0=(0,n.f)(0,0,1),this._pp1=(0,n.f)(0,0,0),this._parameters=(0,u.Uf)(e,t),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,u.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&(!this.isDecoration||e.bindParameters.decorations===a.Iq.ON)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get isDecoration(){return this.parameters.isDecoration}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){null!=this.repository&&this.repository.materialChanged(this)}intersectDraped(e,t,r,i,o,n){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque"},59377:(e,t,r)=>{r.d(t,{$:()=>n});var i=r(44553),o=r(49300);class n{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new i.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=(0,o.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t||null==t.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),null!=this._fragmentUniforms&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},97995:(e,t,r)=>{var i;r.d(t,{r:()=>i}),function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",e[e.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",e[e.ANTIALIASING=10]="ANTIALIASING",e[e.SSAO=11]="SSAO",e[e.HIGHLIGHT=12]="HIGHLIGHT",e[e.SHADOW_HIGHLIGHT=13]="SHADOW_HIGHLIGHT",e[e.POSTPROCESSING_ENVIRONMENT_OPAQUE=14]="POSTPROCESSING_ENVIRONMENT_OPAQUE",e[e.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=15]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",e[e.LASERLINES=16]="LASERLINES",e[e.LASERLINES_CONTRAST_CONTROL=17]="LASERLINES_CONTRAST_CONTROL",e[e.HUD_MATERIAL=18]="HUD_MATERIAL",e[e.LABEL_MATERIAL=19]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=20]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=21]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=22]="DRAPED_MATERIAL",e[e.DRAPED_WATER=23]="DRAPED_WATER",e[e.VOXEL=24]="VOXEL",e[e.MAX_SLOTS=25]="MAX_SLOTS"}(i||(i={}))},93144:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},47026:(e,t,r)=>{var i,o,n,a,s,l,c,u,d;r.d(t,{Gv:()=>o,Iq:()=>u,JJ:()=>c,Rw:()=>a,Ti:()=>d,V_:()=>l,Vr:()=>i,hU:()=>s}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(n||(n={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(l||(l={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(c||(c={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(u||(u={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(d||(d={}))},57790:(e,t,r)=>{r.d(t,{FZ:()=>w,Uf:()=>A,Bw:()=>f,LO:()=>S,Hx:()=>b});var i=r(67676),o=r(22021),n=r(17896),a=r(65617),s=r(60437),l=r(4726);function c(e,t,r,i){return function(e,t){return(0,o.t7)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}(e,function(e,t,r){const i=r.parameters;return u.scale=Math.min(i.divisor/(t-i.offset),1),u.factor=function(e){return Math.abs(e*e*e)}(e),u}(t,r,i))}r(64822),(0,o.Vl)(10),(0,o.Vl)(12),(0,o.Vl)(70),(0,o.Vl)(40);const u={scale:0,factor:0,minScaleFactor:0};var d=r(11726),h=r(35065);const m=(0,s.Ue)();function f(e,t,r,i,o,n){if(e.visible)if(e.boundingInfo){(0,d.hu)(e.type===l.U.Mesh);const a=t.tolerance;g(e.boundingInfo,r,i,a,o,n)}else{const t=e.indices.get(h.T.POSITION),a=e.vertexAttributes.get(h.T.POSITION);_(r,i,0,t.length/3,t,a,void 0,o,n)}}const p=(0,a.c)();function g(e,t,r,i,o,a){if(null==e)return;const l=function(e,t,r){return(0,n.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,p);if((0,s.op)(m,e.bbMin),(0,s.Tn)(m,e.bbMax),null!=o&&o.applyToAabb(m),function(e,t,r,i){return function(e,t,r,i,o){const n=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(n,a),l=Math.max(n,a);const c=(e[1]-i-t[1])*r[1],u=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,u)),l<0)return!1;if(s=Math.max(s,Math.min(c,u)),s>l)return!1;const d=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(d,h)),!(l<0)&&(s=Math.max(s,Math.min(d,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(m,t,l,i)){const{primitiveIndices:n,indices:s,position:l}=e,c=n?n.length:s.length/3;if(c>y){const n=e.getChildren();if(void 0!==n){for(const e of n)g(e,t,r,i,o,a);return}}_(t,r,0,c,s,l,n,o,a)}}const v=(0,a.c)();function _(e,t,r,i,o,n,a,s,l){if(a)return function(e,t,r,i,o,n,a,s,l){const{data:c,stride:u}=n,d=e[0],h=e[1],m=e[2],f=t[0]-d,p=t[1]-h,g=t[2]-m;for(let e=r;e<i;++e){const t=a[e];let r=3*t,i=u*o[r++],n=c[i++],_=c[i++],T=c[i];i=u*o[r++];let x=c[i++],b=c[i++],A=c[i];i=u*o[r];let S=c[i++],R=c[i++],w=c[i];null!=s&&([n,_,T]=s.applyToVertex(n,_,T,e),[x,b,A]=s.applyToVertex(x,b,A,e),[S,R,w]=s.applyToVertex(S,R,w,e));const y=x-n,C=b-_,M=A-T,O=S-n,I=R-_,P=w-T,N=p*P-I*g,L=g*O-P*f,D=f*I-O*p,F=y*N+C*L+M*D;if(Math.abs(F)<=Number.EPSILON)continue;const H=d-n,B=h-_,G=m-T,U=H*N+B*L+G*D;if(F>0){if(U<0||U>F)continue}else if(U>0||U<F)continue;const z=B*M-C*G,V=G*y-M*H,W=H*C-y*B,j=f*z+p*V+g*W;if(F>0){if(j<0||U+j>F)continue}else if(j>0||U+j<F)continue;const k=(O*z+I*V+P*W)/F;k>=0&&l(k,E(y,C,M,O,I,P,v),t,!1)}}(e,t,r,i,o,n,a,s,l);const{data:c,stride:u}=n,d=e[0],h=e[1],m=e[2],f=t[0]-d,p=t[1]-h,g=t[2]-m;for(let e=r,t=3*r;e<i;++e){let r=u*o[t++],i=c[r++],n=c[r++],a=c[r];r=u*o[t++];let _=c[r++],T=c[r++],x=c[r];r=u*o[t++];let b=c[r++],A=c[r++],S=c[r];null!=s&&([i,n,a]=s.applyToVertex(i,n,a,e),[_,T,x]=s.applyToVertex(_,T,x,e),[b,A,S]=s.applyToVertex(b,A,S,e));const R=_-i,w=T-n,y=x-a,C=b-i,M=A-n,O=S-a,I=p*O-M*g,P=g*C-O*f,N=f*M-C*p,L=R*I+w*P+y*N;if(Math.abs(L)<=Number.EPSILON)continue;const D=d-i,F=h-n,H=m-a,B=D*I+F*P+H*N;if(L>0){if(B<0||B>L)continue}else if(B>0||B<L)continue;const G=F*y-w*H,U=H*R-y*D,z=D*w-R*F,V=f*G+p*U+g*z;if(L>0){if(V<0||B+V>L)continue}else if(V>0||B+V<L)continue;const W=(C*G+M*U+O*z)/L;W>=0&&l(W,E(R,w,y,C,M,O,v),e,!1)}}const T=(0,a.c)(),x=(0,a.c)();function E(e,t,r,i,o,a,s){return(0,n.s)(T,e,t,r),(0,n.s)(x,i,o,a),(0,n.b)(s,T,x),(0,n.n)(s,s),s}function b(e,t,r,i,n){let a=(r.screenLength||0)*e.pixelRatio;null!=n&&(a=c(a,i,t,n));const s=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.uZ)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function A(e,t){const r=t?A(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=R(i)),null==i&&t in r||(r[t]=i)}return r}function S(e,t){let r=!1;for(const o in t){const n=t[o];void 0!==n&&(Array.isArray(n)?null===e[o]?(e[o]=n.slice(),r=!0):(0,i.Vx)(e[o],n)&&(r=!0):e[o]!==n&&(r=!0,e[o]=n))}return r}function R(e){const t=[];return e.forEach((e=>t.push(e))),t}const w={multiply:1,ignore:2,replace:3,tint:4},y=1e3},95720:(e,t,r)=>{var i;r.d(t,{n:()=>i}),function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(i||(i={}))},4375:(e,t,r)=>{var i;r.d(t,{B:()=>i}),function(e){e[e.Texture=0]="Texture",e[e.RenderBuffer=1]="RenderBuffer"}(i||(i={}))},57088:(e,t,r)=>{r.d(t,{x:()=>d});var i=r(20102),o=(r(80442),r(22021)),n=r(49300),a=r(7575),s=r(35371),l=r(4375),c=r(47859);class u extends c.X{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case s.lP.R16F:case s.lP.R16I:case s.lP.R16UI:case s.lP.R32F:case s.lP.R32I:case s.lP.R32UI:case s.lP.R8_SNORM:case s.lP.R8:case s.lP.R8I:case s.lP.R8UI:this.pixelFormat=s.VI.RED}}static validate(e,t){return new u(e,t)}}let d=class{constructor(e,t=null,r=null){if(this.type=l.B.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=u.validate(e,t);if(!r)throw new i.Z("Texture descriptor invalid");this._descriptor=r}if(this._descriptor.context.instanceCounter.increment(s._g.Texture,this),this._descriptor.context.type!==a.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),v(this._descriptor.target)))throw new i.Z("3D and array textures are not supported in WebGL1");this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get gpuMemoryUsage(){return T.delete(this),(0,c.G)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._descriptor.context.instanceCounter.decrement(s._g.Texture,this),this._glName=null)}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.Z("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=s.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=s.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._descriptor.context||!this._descriptor.context.gl)return;const r=this._descriptor.context.gl;(0,n.zu)(r),this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const o=this._descriptor,a=t??o.target,l=v(a);null===e&&(o.width=o.width||4,o.height=o.height||4,l&&(o.depth=o.depth??1));const c=this._descriptor.context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),h(this._descriptor.context,o),this._configurePixelStorage(),(0,n.zu)(r);const u=this._deriveInternalFormat();if(g(e)){let t="width"in e?e.width:e.codedWidth,i="height"in e?e.height:e.codedHeight;const s=1;e instanceof HTMLVideoElement&&(t=e.videoWidth,i=e.videoHeight),o.width&&o.height,l&&o.depth,o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,u,o.hasMipmap,t,i,s),this._texImage(a,0,u,t,i,s,e),(0,n.zu)(r),o.hasMipmap&&this.generateMipmap(),o.width||(o.width=t),o.height||(o.height=i),l&&!o.depth&&(o.depth=s)}else{const{width:t,height:c,depth:d}=o;if(null==t||null==c)throw new i.Z("Width and height must be specified!");if(l&&null==d)throw new i.Z("Depth must be specified!");if(o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,u,o.hasMipmap,t,c,d),p(e)){const n=e.levels,l=_(a,t,c,d),h=Math.min(l-1,n.length-1);null!=this._descriptor.context.gl2?r.texParameteri(o.target,this._descriptor.context.gl2.TEXTURE_MAX_LEVEL,h):o.hasMipmap=o.hasMipmap&&l===n.length;const m=u;if(!(m in s.q_))throw new i.Z("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const o=n[Math.min(e,n.length-1)];this._compressedTexImage(a,e,m,t,r,i,o)}),h)}else this._texImage(a,0,u,t,c,d,e),(0,n.zu)(r),o.hasMipmap&&this.generateMipmap()}m(r,this._descriptor),f(r,this._descriptor),function(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}(this._descriptor.context,this._descriptor),(0,n.zu)(r),this._descriptor.context.bindTexture(c,d.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,o,n,a,s=0){a||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor.context.gl,c=this._descriptor.context.gl2,u=this._descriptor,h=this._deriveInternalFormat(),{pixelFormat:m,dataType:f,target:v,isImmutable:_}=u;if(_&&!this._wasImmutablyAllocated)throw new i.Z("Cannot update immutable texture before allocation!");const T=this._descriptor.context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES,!0);if((t<0||r<0||o>u.width||n>u.height||t+o>u.width||r+n>u.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),s){if(!c)return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(c.UNPACK_SKIP_ROWS,s)}if(g(a)?c?c.texSubImage2D(v,e,t,r,o,n,m,f,a):l.texSubImage2D(v,e,t,r,m,f,a):p(a)?l.compressedTexSubImage2D(v,e,t,r,o,n,h,a.levels[e]):l.texSubImage2D(v,e,t,r,o,n,m,f,a),s){if(!c)return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(c.UNPACK_SKIP_ROWS,0)}this._descriptor.context.bindTexture(T,d.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,o,n,a,s,l){l||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const c=this._descriptor.context.gl2;if(null==c)throw new i.Z("3D textures are not supported in WebGL1");const u=this._descriptor,h=this._deriveInternalFormat(),{pixelFormat:m,dataType:f,isImmutable:g,target:_}=u;if(g&&!this._wasImmutablyAllocated)throw new i.Z("Cannot update immutable texture before allocation!");v(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const T=this._descriptor.context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);if(this._descriptor.context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||o<0||n>u.width||a>u.height||s>u.depth||t+n>u.width||r+a>u.height||o+s>u.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),p(l))l=l.levels[e],c.compressedTexSubImage3D(_,e,t,r,o,n,a,s,h,l);else{const i=l;c.texSubImage3D(_,e,t,r,o,n,a,s,m,f,i)}this._descriptor.context.bindTexture(T,d.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.Z("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,h(this._descriptor.context,e)}e.samplingMode===s.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=s.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===s.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=s.cw.NEAREST_MIPMAP_NEAREST);const t=this._descriptor.context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,d.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,h(this._descriptor.context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor.context.gl,t=this._descriptor;this._samplingModeDirty&&(m(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(f(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.context.type===a.zO.WEBGL1)return this._descriptor.internalFormat=this._descriptor.pixelFormat;if(null!=this._descriptor.internalFormat)return this._descriptor.internalFormat===s.VI.DEPTH_STENCIL&&(this._descriptor.internalFormat=s.VI.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case s.Br.FLOAT:switch(this._descriptor.pixelFormat){case s.VI.RGBA:return this._descriptor.internalFormat=s.lP.RGBA32F;case s.VI.RGB:return this._descriptor.internalFormat=s.lP.RGB32F;default:throw new i.Z("Unable to derive format")}case s.Br.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case s.VI.RGBA:return this._descriptor.internalFormat=s.lP.RGBA8;case s.VI.RGB:return this._descriptor.internalFormat=s.lP.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===s.VI.DEPTH_STENCIL?s.VI.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,o,n,a){const l=this._descriptor.context.gl2;if(null==l)throw new i.Z("Immutable textures are not supported in WebGL1");if(!(t in s.lP))throw new i.Z("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?_(e,o,n,a):1;if(v(e)){if(null==a)throw new i.Z("Missing depth dimension for 3D texture upload");l.texStorage3D(e,c,t,o,n,a)}else l.texStorage2D(e,c,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,s,l){const c=this._descriptor.context.gl,u=v(e),{isImmutable:d,pixelFormat:h,dataType:m}=this._descriptor,f=this._descriptor.context.type===a.zO.WEBGL2,p=f?c:null;if(f||!g(l))if(d){if(null!=l){const r=l;if(u){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");p.texSubImage3D(e,t,0,0,0,o,n,s,h,m,r)}else c.texSubImage2D(e,t,0,0,o,n,h,m,r)}}else{const a=l;if(u){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");p.texImage3D(e,t,r,o,n,s,0,h,m,a)}else c.texImage2D(e,t,r,o,n,0,h,m,a)}else c.texImage2D(e,0,r,h,m,l)}_compressedTexImage(e,t,r,o,n,s,l){const c=this._descriptor.context.gl;let u=null;const d=v(e),h=this._descriptor.isImmutable;if(d){if(this._descriptor.context.type!==a.zO.WEBGL2)throw new i.Z("3D textures are not supported in WebGL1");u=c}if(h){if(null!=l)if(d){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");u.compressedTexSubImage3D(e,t,0,0,0,o,n,s,r,l)}else c.compressedTexSubImage2D(e,t,0,0,o,n,r,l)}else if(d){if(null==s)throw new i.Z("Missing depth dimension for 3D texture upload");u.compressedTexImage3D(e,t,r,o,n,s,0,l)}else c.compressedTexImage2D(e,t,r,o,n,0,l)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:l}=this._descriptor;const c=l===s.No.TEXTURE_3D;if(null==r||null==o||c&&null==n)throw new i.Z("Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||c&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),c&&(n=Math.max(1,n>>1))}};function h(e,t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=e.type===a.zO.WEBGL2;r||!t.isImmutable&&!v(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||null!=t.width&&(0,o.wt)(t.width)&&null!=t.height&&(0,o.wt)(t.height)||("number"==typeof t.wrapMode?t.wrapMode!==s.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===s.e8.CLAMP_TO_EDGE&&t.wrapMode.t===s.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}function m(e,t){let r=t.samplingMode,i=t.samplingMode;r===s.cw.LINEAR_MIPMAP_NEAREST||r===s.cw.LINEAR_MIPMAP_LINEAR?(r=s.cw.LINEAR,t.hasMipmap||(i=s.cw.LINEAR)):r!==s.cw.NEAREST_MIPMAP_NEAREST&&r!==s.cw.NEAREST_MIPMAP_LINEAR||(r=s.cw.NEAREST,t.hasMipmap||(i=s.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}function f(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}function p(e){return null!=e&&"type"in e&&"compressed"===e.type}function g(e){return null!=e&&!p(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function v(e){return e===s.No.TEXTURE_3D||e===s.No.TEXTURE_2D_ARRAY}function _(e,t,r,i=1){let o=Math.max(t,r);return e===s.No.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}d.TEXTURE_UNIT_FOR_UPDATES=0;const T=new Map},47859:(e,t,r)=>{r.d(t,{G:()=>a,X:()=>n});var i=r(35371),o=r(45762);class n{constructor(e=0,t=e){this.width=e,this.height=t,this.target=i.No.TEXTURE_2D,this.pixelFormat=i.VI.RGBA,this.dataType=i.Br.UNSIGNED_BYTE,this.samplingMode=i.cw.LINEAR,this.wrapMode=i.e8.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}}function a(e){return e.width<=0||e.height<=0?0:e.width*e.height*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,o.RG)(e.internalFormat))}},45762:(e,t,r)=>{r.d(t,{RG:()=>o}),r(80442);var i=r(35371);function o(e){switch(e){case i.VI.ALPHA:case i.VI.LUMINANCE:case i.VI.RED:case i.VI.RED_INTEGER:case i.lP.R8:case i.lP.R8I:case i.lP.R8UI:case i.lP.R8_SNORM:case i.Tg.STENCIL_INDEX8:return 1;case i.VI.LUMINANCE_ALPHA:case i.VI.RG:case i.VI.RG_INTEGER:case i.lP.RGBA4:case i.lP.R16F:case i.lP.R16I:case i.lP.R16UI:case i.lP.RG8:case i.lP.RG8I:case i.lP.RG8UI:case i.lP.RG8_SNORM:case i.lP.RGB565:case i.lP.RGB5_A1:case i.Tg.DEPTH_COMPONENT16:return 2;case i.VI.DEPTH_COMPONENT:case i.VI.RGB:case i.VI.RGB_INTEGER:case i.lP.RGB8:case i.lP.RGB8I:case i.lP.RGB8UI:case i.lP.RGB8_SNORM:case i.lP.SRGB8:case i.Tg.DEPTH_COMPONENT24:return 3;case i.VI.DEPTH_STENCIL:case i.VI.DEPTH24_STENCIL8:case i.VI.RGBA:case i.VI.RGBA_INTEGER:case i.lP.RGBA8:case i.lP.R32F:case i.lP.R11F_G11F_B10F:case i.lP.RG16F:case i.lP.R32I:case i.lP.R32UI:case i.lP.RG16I:case i.lP.RG16UI:case i.lP.RGBA8I:case i.lP.RGBA8UI:case i.lP.RGBA8_SNORM:case i.lP.SRGB8_ALPHA8:case i.lP.RGB9_E5:case i.lP.RGB10_A2UI:case i.lP.RGB10_A2:case i.Tg.DEPTH_STENCIL:case i.Tg.DEPTH_COMPONENT32F:case i.Tg.DEPTH24_STENCIL8:return 4;case i.Tg.DEPTH32F_STENCIL8:return 5;case i.lP.RGB16F:case i.lP.RGB16I:case i.lP.RGB16UI:return 6;case i.lP.RG32F:case i.lP.RG32I:case i.lP.RG32UI:case i.lP.RGBA16F:case i.lP.RGBA16I:case i.lP.RGBA16UI:return 8;case i.lP.RGB32F:case i.lP.RGB32I:case i.lP.RGB32UI:return 12;case i.lP.RGBA32F:case i.lP.RGBA32I:case i.lP.RGBA32UI:return 16;case i.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.q_.COMPRESSED_R11_EAC:case i.q_.COMPRESSED_SIGNED_R11_EAC:case i.q_.COMPRESSED_RGB8_ETC2:case i.q_.COMPRESSED_SRGB8_ETC2:case i.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.q_.COMPRESSED_RG11_EAC:case i.q_.COMPRESSED_SIGNED_RG11_EAC:case i.q_.COMPRESSED_RGBA8_ETC2_EAC:case i.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},49300:(e,t,r)=>{r.d(t,{hZ:()=>s,zu:()=>l});var i=r(20102),o=r(80442);const n=r(92604).Z.getLogger("esri.views.webgl.checkWebGLError"),a=!!(0,o.Z)("enable-feature:webgl-debug");function s(){return a}function l(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),o=(new Error).stack;n.error(new i.Z("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}},7575:(e,t,r)=>{r.d(t,{Sh:()=>a,kr:()=>n,zO:()=>i});var i,o=r(80442);function n(e,t,r={}){const o=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];for(const t of o){const i=e.getContext(t,r);if(i)return i}return null}function a(e){if("3d"===e)return[i.WEBGL2];const t=(0,o.Z)("esri-force-webgl");return t===i.WEBGL1||t===i.WEBGL2?[t]:(0,o.Z)("mac")&&(0,o.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1]}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(i||(i={}))},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],t[i]=n[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],n[1]=e[i]-n[0],t[i]=n[1];return t}r.d(t,{GB:()=>o,U8:()=>i});const n=new Float32Array(2)},27097:(e,t,r)=>{r.d(t,{BK:()=>d,LZ:()=>u,if:()=>n,sm:()=>x,wK:()=>a,zp:()=>c});var i=r(47026),o=r(35371);function n(e,t,r=o.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function a(e,t,r,i,n=o.db.ADD,a=o.db.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const s={face:o.LR.BACK,mode:o.Wf.CCW},l={face:o.LR.FRONT,mode:o.Wf.CCW},c=e=>e===i.Vr.Back?s:e===i.Vr.Front?l:null,u={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function h(e){return A.intern(e)}function m(e){return R.intern(e)}function f(e){return y.intern(e)}function p(e){return M.intern(e)}function g(e){return I.intern(e)}function v(e){return N.intern(e)}function _(e){return D.intern(e)}function T(e){return H.intern(e)}function x(e){return G.intern(e)}class E{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function b(e){return"["+e.join(",")+"]"}const A=new E(S,(e=>({__tag:"Blending",...e})));function S(e){return e?b([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const R=new E(w,(e=>({__tag:"Culling",...e})));function w(e){return e?b([e.face,e.mode]):null}const y=new E(C,(e=>({__tag:"PolygonOffset",...e})));function C(e){return e?b([e.factor,e.units]):null}const M=new E(O,(e=>({__tag:"DepthTest",...e})));function O(e){return e?b([e.func]):null}const I=new E(P,(e=>({__tag:"StencilTest",...e})));function P(e){return e?b([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const N=new E(L,(e=>({__tag:"DepthWrite",...e})));function L(e){return e?b([e.zNear,e.zFar]):null}const D=new E(F,(e=>({__tag:"ColorWrite",...e})));function F(e){return e?b([e.r,e.g,e.b,e.a]):null}const H=new E(B,(e=>({__tag:"StencilWrite",...e})));function B(e){return e?b([e.mask]):null}const G=new E((function(e){return e?b([S(e.blending),w(e.culling),C(e.polygonOffset),O(e.depthTest),P(e.stencilTest),L(e.depthWrite),F(e.colorWrite),B(e.stencilWrite)]):null}),(e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:f(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:T(e.stencilWrite)})))}}]);