@arcgis/core 4.25.0-next.20220920 → 4.25.0-next.20220921

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 (460) hide show
  1. package/AggregateGraphic.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{9f31ab2247c9defb882c.js → 01ac91fc0bc6b4d4e3c6.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{8588cbecb8e808f451fe.js → 249e32af1f2d433fae4c.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{5b16b30ac3166f33e81e.js → 26690f4ec1f3cb8099c2.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{be93b0cef85665446944.js → 274b4cdf6c8d77e8a2e6.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{d5650f455ce5ba15ad10.js → 2cae0ec5f60ab42a49aa.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{f436c86f86236ea7ea04.js → 4641e10e0e8e9d257521.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{7a45333de9ded92619c2.js → 466008f793c2e11e854c.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{c9d655675552dcf6cef7.js → 4a699b41072ee88f0956.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{14ea96e398f4842abe4e.js → 4fdd18f5cdaa0d82ebc1.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{9662da3e1e37f3445186.js → 562b9619b8ee13734813.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{8bab21bc6164a593278f.js → 771b92e524802de840ba.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{4969b64dc17378d7781f.js → 7ce250cc6fbe68aef50d.js} +3 -3
  15. package/assets/esri/core/workers/chunks/{2c4938512dd726a177dd.js → 7fab18074b130b71a648.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{f67357b3c6c591c9da5e.js → 872f1cb3596fb80e387f.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{31de71018575457155e5.js → 8ee3da8677255b8c8709.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{2e44aee22e70857b893c.js → 93631b10452b0e0189b3.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{cb2dc84d972469445da6.js → 95cd9edca50ea163d50f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{d31bbb13af45ce8e45dc.js → acf9f753741b677afb44.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{1455944edeba1560eb07.js → afdafa77f5ca1b9e3acc.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{cf3e1ac63580bc495ea6.js → b4da35f1093f3731f9ac.js} +1 -1
  23. package/assets/esri/core/workers/chunks/bb0d86937faf0cd7d16d.js +1 -0
  24. package/assets/esri/core/workers/chunks/bf3e80023e156d5906c7.js +1 -0
  25. package/assets/esri/core/workers/chunks/{8ba83fee56dd4f306d87.js → c2a6ac7046134f725cf3.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{5d3fabe66e1bce1b30fb.js → cc7569489b572b8b3b53.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{fddd4ea487788e003fb1.js → d09f06eb4157a7c2c8ab.js} +1 -1
  28. package/assets/esri/core/workers/chunks/e064035f959d68e9603f.js +1 -0
  29. package/assets/esri/core/workers/chunks/{d92975e56a1290255252.js → e09df62cf35d636b0975.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{674fa5b93704ef08c9e8.js → e0c763e05feb1c2093ba.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{51289d2f5277af4023e9.js → ed33e019bc7775db2e50.js} +1 -1
  32. package/assets/esri/core/workers/chunks/ef95d6ab7b1c032ab4ad.js +1 -0
  33. package/assets/esri/core/workers/chunks/{169f4354a375db5de121.js → ffcbcb928b6cb8c596ad.js} +1 -1
  34. package/assets/esri/t9n/common_ar.json +1 -1
  35. package/assets/esri/t9n/common_bg.json +1 -1
  36. package/assets/esri/t9n/common_bs.json +1 -1
  37. package/assets/esri/t9n/common_ca.json +1 -1
  38. package/assets/esri/t9n/common_cs.json +1 -1
  39. package/assets/esri/t9n/common_da.json +1 -1
  40. package/assets/esri/t9n/common_de.json +1 -1
  41. package/assets/esri/t9n/common_el.json +1 -1
  42. package/assets/esri/t9n/common_es.json +1 -1
  43. package/assets/esri/t9n/common_et.json +1 -1
  44. package/assets/esri/t9n/common_fi.json +1 -1
  45. package/assets/esri/t9n/common_fr.json +1 -1
  46. package/assets/esri/t9n/common_he.json +1 -1
  47. package/assets/esri/t9n/common_hr.json +1 -1
  48. package/assets/esri/t9n/common_hu.json +1 -1
  49. package/assets/esri/t9n/common_id.json +1 -1
  50. package/assets/esri/t9n/common_it.json +1 -1
  51. package/assets/esri/t9n/common_ja.json +1 -1
  52. package/assets/esri/t9n/common_ko.json +1 -1
  53. package/assets/esri/t9n/common_lt.json +1 -1
  54. package/assets/esri/t9n/common_lv.json +1 -1
  55. package/assets/esri/t9n/common_nb.json +1 -1
  56. package/assets/esri/t9n/common_nl.json +1 -1
  57. package/assets/esri/t9n/common_pl.json +1 -1
  58. package/assets/esri/t9n/common_pt-BR.json +1 -1
  59. package/assets/esri/t9n/common_pt-PT.json +1 -1
  60. package/assets/esri/t9n/common_ro.json +1 -1
  61. package/assets/esri/t9n/common_ru.json +1 -1
  62. package/assets/esri/t9n/common_sk.json +1 -1
  63. package/assets/esri/t9n/common_sl.json +1 -1
  64. package/assets/esri/t9n/common_sr.json +1 -1
  65. package/assets/esri/t9n/common_sv.json +1 -1
  66. package/assets/esri/t9n/common_th.json +1 -1
  67. package/assets/esri/t9n/common_tr.json +1 -1
  68. package/assets/esri/t9n/common_uk.json +1 -1
  69. package/assets/esri/t9n/common_vi.json +1 -1
  70. package/assets/esri/t9n/common_zh-CN.json +1 -1
  71. package/assets/esri/t9n/common_zh-HK.json +1 -1
  72. package/assets/esri/t9n/common_zh-TW.json +1 -1
  73. package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
  74. package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
  75. package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
  76. package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
  77. package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
  78. package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
  79. package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
  80. package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
  81. package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
  82. package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
  83. package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
  84. package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
  85. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  86. package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
  87. package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
  88. package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
  89. package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
  90. package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
  91. package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
  92. package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
  93. package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
  94. package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
  95. package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
  96. package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
  97. package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
  98. package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
  99. package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
  100. package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
  101. package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
  102. package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
  103. package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
  104. package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
  105. package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
  106. package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
  107. package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
  108. package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
  109. package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
  110. package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
  111. package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
  112. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  113. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  114. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  115. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  116. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  117. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  118. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  119. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  120. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  121. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  122. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  123. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  124. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  125. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  126. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  127. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  128. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  129. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  130. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  131. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  132. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  133. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
  134. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  135. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  136. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  137. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  138. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  139. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  140. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  141. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  142. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  143. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  144. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  145. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  146. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  147. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  148. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  149. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  150. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  151. package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
  152. package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
  153. package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
  154. package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
  155. package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
  156. package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
  157. package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
  158. package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
  159. package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
  160. package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
  161. package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
  162. package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
  163. package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
  164. package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
  165. package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
  166. package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
  167. package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
  168. package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
  169. package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
  170. package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
  171. package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
  172. package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
  173. package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
  174. package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
  175. package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
  176. package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
  177. package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
  178. package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
  179. package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
  180. package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
  181. package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
  182. package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
  183. package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
  184. package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
  185. package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
  186. package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
  187. package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
  188. package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
  189. package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
  190. package/assets/esri/widgets/support/t9n/DatePicker_ar.json +1 -1
  191. package/assets/esri/widgets/support/t9n/DatePicker_bg.json +1 -1
  192. package/assets/esri/widgets/support/t9n/DatePicker_bs.json +1 -1
  193. package/assets/esri/widgets/support/t9n/DatePicker_ca.json +1 -1
  194. package/assets/esri/widgets/support/t9n/DatePicker_cs.json +1 -1
  195. package/assets/esri/widgets/support/t9n/DatePicker_da.json +1 -1
  196. package/assets/esri/widgets/support/t9n/DatePicker_de.json +1 -1
  197. package/assets/esri/widgets/support/t9n/DatePicker_el.json +1 -1
  198. package/assets/esri/widgets/support/t9n/DatePicker_es.json +1 -1
  199. package/assets/esri/widgets/support/t9n/DatePicker_et.json +1 -1
  200. package/assets/esri/widgets/support/t9n/DatePicker_fi.json +1 -1
  201. package/assets/esri/widgets/support/t9n/DatePicker_fr.json +1 -1
  202. package/assets/esri/widgets/support/t9n/DatePicker_he.json +1 -1
  203. package/assets/esri/widgets/support/t9n/DatePicker_hr.json +1 -1
  204. package/assets/esri/widgets/support/t9n/DatePicker_hu.json +1 -1
  205. package/assets/esri/widgets/support/t9n/DatePicker_id.json +1 -1
  206. package/assets/esri/widgets/support/t9n/DatePicker_it.json +1 -1
  207. package/assets/esri/widgets/support/t9n/DatePicker_ja.json +1 -1
  208. package/assets/esri/widgets/support/t9n/DatePicker_ko.json +1 -1
  209. package/assets/esri/widgets/support/t9n/DatePicker_lt.json +1 -1
  210. package/assets/esri/widgets/support/t9n/DatePicker_lv.json +1 -1
  211. package/assets/esri/widgets/support/t9n/DatePicker_nb.json +1 -1
  212. package/assets/esri/widgets/support/t9n/DatePicker_nl.json +1 -1
  213. package/assets/esri/widgets/support/t9n/DatePicker_pl.json +1 -1
  214. package/assets/esri/widgets/support/t9n/DatePicker_pt-BR.json +1 -1
  215. package/assets/esri/widgets/support/t9n/DatePicker_pt-PT.json +1 -1
  216. package/assets/esri/widgets/support/t9n/DatePicker_ro.json +1 -1
  217. package/assets/esri/widgets/support/t9n/DatePicker_ru.json +1 -1
  218. package/assets/esri/widgets/support/t9n/DatePicker_sk.json +1 -1
  219. package/assets/esri/widgets/support/t9n/DatePicker_sl.json +1 -1
  220. package/assets/esri/widgets/support/t9n/DatePicker_sr.json +1 -1
  221. package/assets/esri/widgets/support/t9n/DatePicker_sv.json +1 -1
  222. package/assets/esri/widgets/support/t9n/DatePicker_th.json +1 -1
  223. package/assets/esri/widgets/support/t9n/DatePicker_tr.json +1 -1
  224. package/assets/esri/widgets/support/t9n/DatePicker_uk.json +1 -1
  225. package/assets/esri/widgets/support/t9n/DatePicker_vi.json +1 -1
  226. package/assets/esri/widgets/support/t9n/DatePicker_zh-CN.json +1 -1
  227. package/assets/esri/widgets/support/t9n/DatePicker_zh-HK.json +1 -1
  228. package/assets/esri/widgets/support/t9n/DatePicker_zh-TW.json +1 -1
  229. package/assets/esri/widgets/support/t9n/TimePicker_ar.json +1 -1
  230. package/assets/esri/widgets/support/t9n/TimePicker_bg.json +1 -1
  231. package/assets/esri/widgets/support/t9n/TimePicker_bs.json +1 -1
  232. package/assets/esri/widgets/support/t9n/TimePicker_ca.json +1 -1
  233. package/assets/esri/widgets/support/t9n/TimePicker_cs.json +1 -1
  234. package/assets/esri/widgets/support/t9n/TimePicker_da.json +1 -1
  235. package/assets/esri/widgets/support/t9n/TimePicker_de.json +1 -1
  236. package/assets/esri/widgets/support/t9n/TimePicker_el.json +1 -1
  237. package/assets/esri/widgets/support/t9n/TimePicker_es.json +1 -1
  238. package/assets/esri/widgets/support/t9n/TimePicker_et.json +1 -1
  239. package/assets/esri/widgets/support/t9n/TimePicker_fi.json +1 -1
  240. package/assets/esri/widgets/support/t9n/TimePicker_fr.json +1 -1
  241. package/assets/esri/widgets/support/t9n/TimePicker_he.json +1 -1
  242. package/assets/esri/widgets/support/t9n/TimePicker_hr.json +1 -1
  243. package/assets/esri/widgets/support/t9n/TimePicker_hu.json +1 -1
  244. package/assets/esri/widgets/support/t9n/TimePicker_id.json +1 -1
  245. package/assets/esri/widgets/support/t9n/TimePicker_it.json +1 -1
  246. package/assets/esri/widgets/support/t9n/TimePicker_ja.json +1 -1
  247. package/assets/esri/widgets/support/t9n/TimePicker_ko.json +1 -1
  248. package/assets/esri/widgets/support/t9n/TimePicker_lt.json +1 -1
  249. package/assets/esri/widgets/support/t9n/TimePicker_lv.json +1 -1
  250. package/assets/esri/widgets/support/t9n/TimePicker_nb.json +1 -1
  251. package/assets/esri/widgets/support/t9n/TimePicker_nl.json +1 -1
  252. package/assets/esri/widgets/support/t9n/TimePicker_pl.json +1 -1
  253. package/assets/esri/widgets/support/t9n/TimePicker_pt-BR.json +1 -1
  254. package/assets/esri/widgets/support/t9n/TimePicker_pt-PT.json +1 -1
  255. package/assets/esri/widgets/support/t9n/TimePicker_ro.json +1 -1
  256. package/assets/esri/widgets/support/t9n/TimePicker_ru.json +1 -1
  257. package/assets/esri/widgets/support/t9n/TimePicker_sk.json +1 -1
  258. package/assets/esri/widgets/support/t9n/TimePicker_sl.json +1 -1
  259. package/assets/esri/widgets/support/t9n/TimePicker_sr.json +1 -1
  260. package/assets/esri/widgets/support/t9n/TimePicker_sv.json +1 -1
  261. package/assets/esri/widgets/support/t9n/TimePicker_th.json +1 -1
  262. package/assets/esri/widgets/support/t9n/TimePicker_tr.json +1 -1
  263. package/assets/esri/widgets/support/t9n/TimePicker_uk.json +1 -1
  264. package/assets/esri/widgets/support/t9n/TimePicker_vi.json +1 -1
  265. package/assets/esri/widgets/support/t9n/TimePicker_zh-CN.json +1 -1
  266. package/assets/esri/widgets/support/t9n/TimePicker_zh-HK.json +1 -1
  267. package/assets/esri/widgets/support/t9n/TimePicker_zh-TW.json +1 -1
  268. package/chunks/Compositing.glsl.js +4 -19
  269. package/chunks/HUDCompositing.glsl.js +7 -0
  270. package/chunks/Laserlines.glsl.js +5 -5
  271. package/chunks/OITCompositing.glsl.js +13 -0
  272. package/chunks/OverlayCompositing.glsl.js +8 -0
  273. package/chunks/Precipitation.glsl.js +1 -1
  274. package/chunks/ShadowHighlight.glsl.js +1 -1
  275. package/chunks/boundedPlane.js +1 -1
  276. package/chunks/cameraUtilsPlanar.js +1 -1
  277. package/chunks/cameraUtilsSpherical.js +1 -1
  278. package/chunks/mat3.js +1 -1
  279. package/chunks/quat.js +1 -1
  280. package/chunks/quat2.js +1 -1
  281. package/chunks/quatf64.js +1 -1
  282. package/chunks/sphere.js +1 -1
  283. package/chunks/vec3.js +1 -1
  284. package/chunks/vec3f32.js +1 -1
  285. package/chunks/vec4f64.js +1 -1
  286. package/core/VectorStack.js +1 -1
  287. package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
  288. package/core/libs/gl-matrix-2/factories/vec3f32.js +1 -1
  289. package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
  290. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  291. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  292. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  293. package/core/perspectiveUtils.js +1 -1
  294. package/geohash/GeohashTree.js +1 -1
  295. package/geometry/support/MeshTransform.js +1 -1
  296. package/geometry/support/axisAngle.js +1 -1
  297. package/geometry/support/axisAngleDegrees.js +1 -1
  298. package/geometry/support/lineSegment.js +1 -1
  299. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  300. package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
  301. package/geometry/support/meshUtils/georeference.js +1 -1
  302. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  303. package/geometry/support/meshUtils/projection.js +1 -1
  304. package/geometry/support/meshUtils/rotate.js +1 -1
  305. package/geometry/support/plane.js +1 -1
  306. package/interfaces.d.ts +70 -0
  307. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  308. package/layers/graphics/featureConversionUtils.js +1 -1
  309. package/layers/mixins/EditBusLayer.js +1 -1
  310. package/layers/support/AggregateField.js +1 -1
  311. package/layers/support/ControlPointsGeoreference.js +1 -1
  312. package/layers/support/OutStatistic.js +1 -1
  313. package/layers/support/VoxelVolume.js +1 -1
  314. package/layers/support/voxelPlaneUtils.js +1 -1
  315. package/package.json +1 -1
  316. package/rest/support/AggregateFeatureSet.js +5 -0
  317. package/support/revision.js +1 -1
  318. package/views/2d/ViewState.js +1 -1
  319. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  320. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  321. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  322. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  323. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  324. package/views/2d/engine/webgl/WGLTile.js +1 -1
  325. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  326. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  327. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  328. package/views/2d/layers/features/schemaUtils.js +1 -1
  329. package/views/2d/layers/features/support/BinStore.js +1 -1
  330. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  331. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  332. package/views/2d/layers/support/DebugOverlay.js +1 -1
  333. package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
  334. package/views/2d/layers/support/clusterUtils.js +1 -1
  335. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  336. package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
  337. package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
  338. package/views/3d/analysis/Dimensioning/lengthDimensionUtils.js +1 -1
  339. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  340. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  341. package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
  342. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  343. package/views/3d/camera/constraintUtils/distance.js +1 -1
  344. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  345. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  346. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  347. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  348. package/views/3d/glTF/internal/Resource.js +1 -1
  349. package/views/3d/interactive/Manipulator3D.js +1 -1
  350. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  351. package/views/3d/interactive/editingTools/settings.js +1 -1
  352. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  353. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  354. package/views/3d/interactive/manipulatorUtils.js +1 -1
  355. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  356. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  357. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  358. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  359. package/views/3d/layers/I3SMeshView3D.js +1 -1
  360. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  361. package/views/3d/layers/PointCloudWorker.js +1 -1
  362. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  363. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  364. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  365. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  366. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  367. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  368. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  369. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  370. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  371. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  372. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  373. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  374. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  375. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  376. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  377. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  378. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  379. package/views/3d/layers/support/edgeUtils.js +1 -1
  380. package/views/3d/layers/support/uvUtils.js +1 -1
  381. package/views/3d/state/Frustum.js +1 -1
  382. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  383. package/views/3d/state/controllers/RotateController.js +1 -1
  384. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  385. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  386. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  387. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  388. package/views/3d/state/utils/navigationUtils.js +1 -1
  389. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  390. package/views/3d/support/orientedBoundingBox.js +1 -1
  391. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  392. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  393. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  394. package/views/3d/support/sunUtils.js +1 -1
  395. package/views/3d/terrain/OverlayRenderer.js +1 -1
  396. package/views/3d/terrain/PatchRenderData.js +1 -1
  397. package/views/3d/terrain/TerrainSurface.js +1 -1
  398. package/views/3d/terrain/Tile.js +1 -1
  399. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  400. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  401. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  402. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  403. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  404. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  405. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  406. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  407. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  408. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  409. package/views/3d/webgl-engine/lib/GeometryRecord.js +1 -1
  410. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  411. package/views/3d/webgl-engine/lib/Highlight.js +1 -1
  412. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  413. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  414. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  415. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  416. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  417. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  418. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  419. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  420. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  421. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  422. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  423. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  424. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  425. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  426. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  427. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  428. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  429. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  430. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  431. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  432. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  433. package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
  434. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  435. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  436. package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +5 -0
  437. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +5 -0
  438. package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +5 -0
  439. package/views/3d/webgl-engine/shaders/OITCompositingTechnique.js +5 -0
  440. package/views/3d/webgl-engine/shaders/OverlayCompositing.glsl.js +5 -0
  441. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +5 -0
  442. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  443. package/views/interactive/coordinateHelper.js +1 -1
  444. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  445. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  446. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  447. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  448. package/views/layers/FeatureLayerView.js +1 -1
  449. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  450. package/views/support/Scheduler.js +1 -1
  451. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  452. package/views/support/geometry3dUtils.js +1 -1
  453. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  454. package/widgets/ElevationProfile/support/constants.js +1 -1
  455. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  456. package/widgets/Feature/FeatureRelationship.js +1 -1
  457. package/assets/esri/core/workers/chunks/0059699bf824f851d51c.js +0 -1
  458. package/assets/esri/core/workers/chunks/36dd5654df5c7f00406d.js +0 -1
  459. package/assets/esri/core/workers/chunks/de128d8a643b4297940b.js +0 -1
  460. package/assets/esri/core/workers/chunks/e00327925ca82b63fded.js +0 -1
@@ -170,7 +170,7 @@
170
170
  gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
171
171
  ${e.transparencyPassType===D.A.Color?N.H`gl_FragColor = premultiplyAlpha(gl_FragColor);`:N.H``}
172
172
  }
173
- `)),t.include(p.s,e),t}const H=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,a,n,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]=a,c[6]=n,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,create:i,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},fromValues:o,createView:function(e,t){return new Float32Array(e,t,9)}},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 a(){return i()}function n(){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=a(),d=n(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},fromValues:o,createView:function(e,t){return new Float32Array(e,t,2)},zeros:a,ones:n,unitX:s,unitY:l,ZEROS:c,ONES:d,UNIT_X:u,UNIT_Y:h},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>a,b:()=>l,n:()=>s,s:()=>n,t:()=>o});var i=r(72220);function o(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const o=e.count,a=r[0],n=r[1],s=r[2],l=r[4],c=r[5],d=r[6],u=r[8],h=r[9],f=r[10],m=r[12],p=r[13],g=r[14],_=e.typedBuffer,v=e.typedBufferStride,x=t.typedBuffer,T=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*v,r=e*T,i=x[r],o=x[r+1],b=x[r+2];_[t]=a*i+l*o+u*b+m,_[t+1]=n*i+c*o+h*b+p,_[t+2]=s*i+d*o+f*b+g}}function a(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const o=e.count,a=r[0],n=r[1],s=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],f=r[8],m=e.typedBuffer,p=e.typedBufferStride,g=t.typedBuffer,_=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*p,r=e*_,i=g[r],o=g[r+1],v=g[r+2];m[t]=a*i+l*o+u*v,m[t+1]=n*i+c*o+h*v,m[t+2]=s*i+d*o+f*v}}function n(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,a=e.typedBufferStride,n=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*a,i=e*s;o[t]=r*n[i],o[t+1]=r*n[i+1],o[t+2]=r*n[i+2]}}function s(e,t){const r=Math.min(e.count,t.count),i=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,n=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*o,r=e*n,s=a[r],l=a[r+1],c=a[r+2],d=s*s+l*l+c*c;if(d>0){const e=1/Math.sqrt(d);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function l(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,a=e.typedBufferStride,n=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*a,i=e*s;o[t]=n[i]>>r,o[t+1]=n[i+1]>>r,o[t+2]=n[i+2]>>r}}Object.freeze(Object.defineProperty({__proto__:null,transformMat4:o,transformMat3:a,scale:n,normalize:s,shiftRight:l},Symbol.toStringTag,{value:"Module"}))},56067:(e,t,r)=>{function i(e,t,r){const i=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,n=t.typedBufferStride,s=r?r.count:t.count;let l=(r&&r.dstIndex?r.dstIndex:0)*o,c=(r&&r.srcIndex?r.srcIndex:0)*n;for(let e=0;e<s;++e)i[l]=a[c],i[l+1]=a[c+1],i[l+2]=a[c+2],l+=o,c+=n}function o(e,t,r,i,o){const a=e.typedBuffer,n=e.typedBufferStride,s=o?.count??e.count;let l=(o?.dstIndex??0)*n;for(let e=0;e<s;++e)a[l]=t,a[l+1]=r,a[l+2]=i,l+=n}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,fill:o},Symbol.toStringTag,{value:"Module"}))},88669:(e,t,r)=>{function i(){return[0,0,0,0]}function o(e,t,r,i){return[e,t,r,i]}function a(e,t){return new Float64Array(e,t,4)}function n(){return o(1,1,1,1)}function s(){return o(1,0,0,0)}function l(){return o(0,1,0,0)}function c(){return o(0,0,1,0)}function d(){return o(0,0,0,1)}r.d(t,{a:()=>a,c:()=>i,f:()=>o});const u=n(),h=s(),f=l(),m=c(),p=d();Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){return[e[0],e[1],e[2],e[3]]},fromValues:o,fromArray:function(e){const t=[0,0,0,0],r=Math.min(4,e.length);for(let i=0;i<r;++i)t[i]=e[i];return t},createView:a,zeros:function(){return[0,0,0,0]},ones:n,unitX:s,unitY:l,unitZ:c,unitW:d,ZEROS:[0,0,0,0],ONES:u,UNIT_X:h,UNIT_Y:f,UNIT_Z:m,UNIT_W:p},Symbol.toStringTag,{value:"Module"}))},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(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const a=/^devext.arcgis.com$/,n=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,a,n,/^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),a=r(17896),n=r(65617),s=r(12981);function l(e){return e?{origin:(0,n.a)(e.origin),vector:(0,n.a)(e.vector)}:{origin:(0,n.c)(),vector:(0,n.c)()}}function c(e,t,r=l()){return(0,a.c)(r.origin,e),(0,a.b)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,o,n){const{vector:l,origin:c}=e,d=(0,a.b)(s.WM.get(),t,c),u=(0,a.e)(l,d)/(0,a.p)(l);return(0,a.g)(n,l,(0,i.uZ)(u,0,1)),(0,a.a)(n,n,e.origin)}(e,t,0,0,r)}(0,n.c)(),(0,n.c)(),new o.x((()=>l()))},32533:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>ei,gltfToEngineResources:()=>ri,parseUrl:()=>ti});var i=r(32243),o=r(70586),a=r(21787),n=r(46521),s=r(52138),l=r(13598),c=r(17896),d=r(65617),u=r(60437),h=r(56481),f=r(20773),m=r(11077),p=r(8323),g=r(40270),_=r(88246),v=r(91911),x=r(14682),T=r(1265);function b(e){if((0,o.Wi)(e))return null;const t=(0,o.pC)(e.offset)?e.offset:T.Z,r=(0,o.pC)(e.rotation)?e.rotation:0,i=(0,o.pC)(e.scale)?e.scale:T.O,n=(0,x.f)(1,0,0,0,1,0,t[0],t[1],1),s=(0,x.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,x.f)(i[0],0,0,0,i[1],0,0,0,1),c=(0,x.c)();return(0,a.m)(c,s,l),(0,a.m)(c,n,c),c}var A=r(3172),E=r(66643),w=r(43090),S=r(20102),C=r(92604),R=r(95330),y=r(23670);async function M(e,t){const{data:r}=await(0,A.default)(e,{responseType:"image",...t});return r}var O=r(47026),N=r(44553),P=r(11726);class I{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this.center=(0,d.c)(),this._children=void 0,(0,P.hu)(e.length>=1),(0,P.hu)(r.length%this._numIndexPerPrimitive==0),(0,P.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,P.hu)(3===i.size||4===i.size);const{data:o,size:a}=i,n=e.length;let s=a*r[this._numIndexPerPrimitive*e[0]];D.clear(),D.push(s),this.bbMin=(0,d.f)(o[s],o[s+1],o[s+2]),this.bbMax=(0,d.a)(this.bbMin);for(let t=0;t<n;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=a*r[i+e],D.push(s);let t=o[s];this.bbMin[0]=Math.min(t,this.bbMin[0]),this.bbMax[0]=Math.max(t,this.bbMax[0]),t=o[s+1],this.bbMin[1]=Math.min(t,this.bbMin[1]),this.bbMax[1]=Math.max(t,this.bbMax[1]),t=o[s+2],this.bbMin[2]=Math.min(t,this.bbMin[2]),this.bbMax[2]=Math.max(t,this.bbMax[2])}}(0,c.h)(this.center,this.bbMin,this.bbMax,.5),this.radius=.5*Math.max(Math.max(this.bbMax[0]-this.bbMin[0],this.bbMax[1]-this.bbMin[1]),this.bbMax[2]-this.bbMin[2]);let l=this.radius*this.radius;for(let e=0;e<D.length;++e){s=D.getItemAt(e);const t=o[s]-this.center[0],r=o[s+1]-this.center[1],i=o[s+2]-this.center[2],a=t*t+r*r+i*i;if(a<=l)continue;const n=Math.sqrt(a),c=.5*(n-this.radius);this.radius=this.radius+c,l=this.radius*this.radius;const d=c/n;this.center[0]+=t*d,this.center[1]+=r*d,this.center[2]+=i*d}D.clear()}getCenter(){return this.center}getBSRadius(){return this.radius}getBBMin(){return this.bbMin}getBBMax(){return this.bbMax}getChildren(){if(this._children)return this._children;if((0,c.d)(this.bbMin,this.bbMax)>1){const e=(0,c.h)((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:o,size:a}=this.position;for(let n=0;n<t;++n){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[n];let l=a*this.indices[s],c=o[l],d=o[l+1],u=o[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=a*this.indices[s+e];const t=o[l],r=o[l+1],i=o[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[n]=t,++i[t]}let n=0;for(let e=0;e<8;++e)i[e]>0&&++n;if(n<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[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];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array(8);for(let e=0;e<8;++e)void 0!==s[e]&&(this._children[e]=new I(s[e],this._numIndexPerPrimitive,this.indices,this.position))}return this._children}static prune(){D.prune()}}const D=new N.Z({deallocator:null});var L=r(17662),F=r(4726),H=r(22807),B=r(16996);function U(e,t,r){return(0,c.b)(z,t,e),(0,c.b)(V,r,e),(0,c.l)((0,c.f)(z,z,V))/2}r(12981),new H.x(B.Ue),new H.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 z=(0,d.c)(),V=(0,d.c)(),G=(0,d.c)(),W=(0,d.c)(),k=(0,d.c)(),$=(0,d.c)();var q=r(54388),X=r(35065);class j extends L.c{constructor(e,t=[],r=O.MX.Triangle,i=null,o=-1){super(),this._primitiveType=r,this.objectAndLayerIdColor=i,this.edgeIndicesLength=o,this.type=F.U.Geometry,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[t,r]of e)r&&this._vertexAttributes.set(t,{...r});if(null==t||0===t.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,q.p)(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,r]of t)r&&(this._indices.set(e,(0,q.mi)(r)),e===X.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}cloneShallow(){const e=new j([],void 0,this._primitiveType,this.objectAndLayerIdColor,void 0),{_vertexAttributes:t,_indices:r}=e;return this._vertexAttributes.forEach(((e,r)=>t.set(r,e))),this._indices.forEach(((e,t)=>r.set(t,e))),e.screenToWorldRatio=this.screenToWorldRatio,e._boundingInfo=this._boundingInfo,e}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){const t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t.data=Array.from(t.data),t.exclusive=!0),t}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get primitiveType(){return this._primitiveType}get faceCount(){return this.indexCount/3}get boundingInfo(){return(0,o.Wi)(this._boundingInfo)&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return this.primitiveType===O.MX.Triangle?this._computeAttachmentOriginTriangles(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(X.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,c.s)(r,0,0,0),(0,c.s)($,0,0,0);let a=0,n=0;for(let e=0;e<t.length-2;e+=3){const s=t[e+0]*i,l=t[e+1]*i,d=t[e+2]*i;(0,c.s)(G,o[s+0],o[s+1],o[s+2]),(0,c.s)(W,o[l+0],o[l+1],o[l+2]),(0,c.s)(k,o[d+0],o[d+1],o[d+2]);const u=U(G,W,k);u?((0,c.a)(G,G,W),(0,c.a)(G,G,k),(0,c.g)(G,G,1/3*u),(0,c.a)(r,r,G),a+=u):((0,c.a)($,$,G),(0,c.a)($,$,W),(0,c.a)($,$,k),n+=3)}return!(0===n&&0===a||(0!==a?((0,c.g)(r,r,1/a),0):0===n||((0,c.g)(r,$,1/n),0)))}(this.vertexAttributes.get(X.T.POSITION),t,e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(X.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,c.s)(r,0,0,0);let a=-1,n=0;for(let e=0;e<t.length;e++){const s=t[e]*i;a!==s&&(r[0]+=o[s+0],r[1]+=o[s+1],r[2]+=o[s+2],n++),a=s}return n>1&&(0,c.g)(r,r,1/n),n>0}(this.vertexAttributes.get(X.T.POSITION),t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(X.T.POSITION);if(!e||0===e.length)return null;const t=this.primitiveType===O.MX.Triangle?3:1;(0,P.hu)(e.length%t==0,"Indexing error: "+e.length+" not divisible by "+t);const r=(0,q.p)(e.length/t),i=this.vertexAttributes.get(X.T.POSITION);return i?new I(r,t,e,i):null}}var J=r(74085),Y=r(32448),Z=r(22021),K=r(1533),Q=r(17452),ee=r(85958),te=r(88669),re=r(74709);function ie(e,t=!0){e.attributes.add(X.T.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.code.add(re.H`
173
+ `)),t.include(p.s,e),t}const H=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,a,n,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]=a,c[6]=n,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,create:i,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},fromValues:o,createView:function(e,t){return new Float32Array(e,t,9)}},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 a(){return i()}function n(){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=a(),d=n(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},fromValues:o,createView:function(e,t){return new Float32Array(e,t,2)},zeros:a,ones:n,unitX:s,unitY:l,ZEROS:c,ONES:d,UNIT_X:u,UNIT_Y:h},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>a,b:()=>l,n:()=>s,s:()=>n,t:()=>o});var i=r(72220);function o(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const o=e.count,a=r[0],n=r[1],s=r[2],l=r[4],c=r[5],d=r[6],u=r[8],h=r[9],f=r[10],m=r[12],p=r[13],g=r[14],_=e.typedBuffer,v=e.typedBufferStride,x=t.typedBuffer,T=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*v,r=e*T,i=x[r],o=x[r+1],b=x[r+2];_[t]=a*i+l*o+u*b+m,_[t+1]=n*i+c*o+h*b+p,_[t+2]=s*i+d*o+f*b+g}}function a(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const o=e.count,a=r[0],n=r[1],s=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],f=r[8],m=e.typedBuffer,p=e.typedBufferStride,g=t.typedBuffer,_=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*p,r=e*_,i=g[r],o=g[r+1],v=g[r+2];m[t]=a*i+l*o+u*v,m[t+1]=n*i+c*o+h*v,m[t+2]=s*i+d*o+f*v}}function n(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,a=e.typedBufferStride,n=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*a,i=e*s;o[t]=r*n[i],o[t+1]=r*n[i+1],o[t+2]=r*n[i+2]}}function s(e,t){const r=Math.min(e.count,t.count),i=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,n=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*o,r=e*n,s=a[r],l=a[r+1],c=a[r+2],d=s*s+l*l+c*c;if(d>0){const e=1/Math.sqrt(d);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function l(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,a=e.typedBufferStride,n=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*a,i=e*s;o[t]=n[i]>>r,o[t+1]=n[i+1]>>r,o[t+2]=n[i+2]>>r}}Object.freeze(Object.defineProperty({__proto__:null,transformMat4:o,transformMat3:a,scale:n,normalize:s,shiftRight:l},Symbol.toStringTag,{value:"Module"}))},56067:(e,t,r)=>{function i(e,t,r){const i=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,n=t.typedBufferStride,s=r?r.count:t.count;let l=(r&&r.dstIndex?r.dstIndex:0)*o,c=(r&&r.srcIndex?r.srcIndex:0)*n;for(let e=0;e<s;++e)i[l]=a[c],i[l+1]=a[c+1],i[l+2]=a[c+2],l+=o,c+=n}function o(e,t,r,i,o){const a=e.typedBuffer,n=e.typedBufferStride,s=o?.count??e.count;let l=(o?.dstIndex??0)*n;for(let e=0;e<s;++e)a[l]=t,a[l+1]=r,a[l+2]=i,l+=n}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,fill:o},Symbol.toStringTag,{value:"Module"}))},88669:(e,t,r)=>{function i(){return[0,0,0,0]}function o(e,t,r,i){return[e,t,r,i]}function a(e,t){return new Float64Array(e,t,4)}function n(){return o(1,1,1,1)}function s(){return o(1,0,0,0)}function l(){return o(0,1,0,0)}function c(){return o(0,0,1,0)}function d(){return o(0,0,0,1)}r.d(t,{b:()=>a,c:()=>i,f:()=>o});const u=n(),h=s(),f=l(),m=c(),p=d();Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(e){return[e[0],e[1],e[2],e[3]]},fromValues:o,fromArray:function(e){const t=[0,0,0,0],r=Math.min(4,e.length);for(let i=0;i<r;++i)t[i]=e[i];return t},createView:a,zeros:function(){return[0,0,0,0]},ones:n,unitX:s,unitY:l,unitZ:c,unitW:d,ZEROS:[0,0,0,0],ONES:u,UNIT_X:h,UNIT_Y:f,UNIT_Z:m,UNIT_W:p},Symbol.toStringTag,{value:"Module"}))},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(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const a=/^devext.arcgis.com$/,n=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,a,n,/^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),a=r(17896),n=r(65617),s=r(12981);function l(e){return e?{origin:(0,n.a)(e.origin),vector:(0,n.a)(e.vector)}:{origin:(0,n.c)(),vector:(0,n.c)()}}function c(e,t,r=l()){return(0,a.c)(r.origin,e),(0,a.b)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,o,n){const{vector:l,origin:c}=e,d=(0,a.b)(s.WM.get(),t,c),u=(0,a.e)(l,d)/(0,a.z)(l);return(0,a.g)(n,l,(0,i.uZ)(u,0,1)),(0,a.a)(n,n,e.origin)}(e,t,0,0,r)}(0,n.c)(),(0,n.c)(),new o.x((()=>l()))},32533:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>ei,gltfToEngineResources:()=>ri,parseUrl:()=>ti});var i=r(32243),o=r(70586),a=r(21787),n=r(46521),s=r(52138),l=r(13598),c=r(17896),d=r(65617),u=r(60437),h=r(56481),f=r(20773),m=r(11077),p=r(8323),g=r(40270),_=r(88246),v=r(91911),x=r(14682),T=r(1265);function b(e){if((0,o.Wi)(e))return null;const t=(0,o.pC)(e.offset)?e.offset:T.Z,r=(0,o.pC)(e.rotation)?e.rotation:0,i=(0,o.pC)(e.scale)?e.scale:T.O,n=(0,x.f)(1,0,0,0,1,0,t[0],t[1],1),s=(0,x.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,x.f)(i[0],0,0,0,i[1],0,0,0,1),c=(0,x.c)();return(0,a.m)(c,s,l),(0,a.m)(c,n,c),c}var A=r(3172),E=r(66643),w=r(43090),S=r(20102),C=r(92604),R=r(95330),y=r(23670);async function M(e,t){const{data:r}=await(0,A.default)(e,{responseType:"image",...t});return r}var O=r(47026),N=r(44553),P=r(11726);class I{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this.center=(0,d.c)(),this._children=void 0,(0,P.hu)(e.length>=1),(0,P.hu)(r.length%this._numIndexPerPrimitive==0),(0,P.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,P.hu)(3===i.size||4===i.size);const{data:o,size:a}=i,n=e.length;let s=a*r[this._numIndexPerPrimitive*e[0]];D.clear(),D.push(s),this.bbMin=(0,d.f)(o[s],o[s+1],o[s+2]),this.bbMax=(0,d.a)(this.bbMin);for(let t=0;t<n;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=a*r[i+e],D.push(s);let t=o[s];this.bbMin[0]=Math.min(t,this.bbMin[0]),this.bbMax[0]=Math.max(t,this.bbMax[0]),t=o[s+1],this.bbMin[1]=Math.min(t,this.bbMin[1]),this.bbMax[1]=Math.max(t,this.bbMax[1]),t=o[s+2],this.bbMin[2]=Math.min(t,this.bbMin[2]),this.bbMax[2]=Math.max(t,this.bbMax[2])}}(0,c.h)(this.center,this.bbMin,this.bbMax,.5),this.radius=.5*Math.max(Math.max(this.bbMax[0]-this.bbMin[0],this.bbMax[1]-this.bbMin[1]),this.bbMax[2]-this.bbMin[2]);let l=this.radius*this.radius;for(let e=0;e<D.length;++e){s=D.getItemAt(e);const t=o[s]-this.center[0],r=o[s+1]-this.center[1],i=o[s+2]-this.center[2],a=t*t+r*r+i*i;if(a<=l)continue;const n=Math.sqrt(a),c=.5*(n-this.radius);this.radius=this.radius+c,l=this.radius*this.radius;const d=c/n;this.center[0]+=t*d,this.center[1]+=r*d,this.center[2]+=i*d}D.clear()}getCenter(){return this.center}getBSRadius(){return this.radius}getBBMin(){return this.bbMin}getBBMax(){return this.bbMax}getChildren(){if(this._children)return this._children;if((0,c.d)(this.bbMin,this.bbMax)>1){const e=(0,c.h)((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:o,size:a}=this.position;for(let n=0;n<t;++n){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[n];let l=a*this.indices[s],c=o[l],d=o[l+1],u=o[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=a*this.indices[s+e];const t=o[l],r=o[l+1],i=o[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[n]=t,++i[t]}let n=0;for(let e=0;e<8;++e)i[e]>0&&++n;if(n<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[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];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array(8);for(let e=0;e<8;++e)void 0!==s[e]&&(this._children[e]=new I(s[e],this._numIndexPerPrimitive,this.indices,this.position))}return this._children}static prune(){D.prune()}}const D=new N.Z({deallocator:null});var L=r(17662),F=r(4726),H=r(22807),B=r(16996);function U(e,t,r){return(0,c.b)(z,t,e),(0,c.b)(V,r,e),(0,c.l)((0,c.f)(z,z,V))/2}r(12981),new H.x(B.Ue),new H.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 z=(0,d.c)(),V=(0,d.c)(),G=(0,d.c)(),W=(0,d.c)(),k=(0,d.c)(),$=(0,d.c)();var q=r(54388),X=r(35065);class j extends L.c{constructor(e,t=[],r=O.MX.Triangle,i=null,o=-1){super(),this._primitiveType=r,this.objectAndLayerIdColor=i,this.edgeIndicesLength=o,this.type=F.U.Geometry,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[t,r]of e)r&&this._vertexAttributes.set(t,{...r});if(null==t||0===t.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,q.p)(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,r]of t)r&&(this._indices.set(e,(0,q.mi)(r)),e===X.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}cloneShallow(){const e=new j([],void 0,this._primitiveType,this.objectAndLayerIdColor,void 0),{_vertexAttributes:t,_indices:r}=e;return this._vertexAttributes.forEach(((e,r)=>t.set(r,e))),this._indices.forEach(((e,t)=>r.set(t,e))),e.screenToWorldRatio=this.screenToWorldRatio,e._boundingInfo=this._boundingInfo,e}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){const t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t.data=Array.from(t.data),t.exclusive=!0),t}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get primitiveType(){return this._primitiveType}get faceCount(){return this.indexCount/3}get boundingInfo(){return(0,o.Wi)(this._boundingInfo)&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return this.primitiveType===O.MX.Triangle?this._computeAttachmentOriginTriangles(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(X.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,c.s)(r,0,0,0),(0,c.s)($,0,0,0);let a=0,n=0;for(let e=0;e<t.length-2;e+=3){const s=t[e+0]*i,l=t[e+1]*i,d=t[e+2]*i;(0,c.s)(G,o[s+0],o[s+1],o[s+2]),(0,c.s)(W,o[l+0],o[l+1],o[l+2]),(0,c.s)(k,o[d+0],o[d+1],o[d+2]);const u=U(G,W,k);u?((0,c.a)(G,G,W),(0,c.a)(G,G,k),(0,c.g)(G,G,1/3*u),(0,c.a)(r,r,G),a+=u):((0,c.a)($,$,G),(0,c.a)($,$,W),(0,c.a)($,$,k),n+=3)}return!(0===n&&0===a||(0!==a?((0,c.g)(r,r,1/a),0):0===n||((0,c.g)(r,$,1/n),0)))}(this.vertexAttributes.get(X.T.POSITION),t,e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(X.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,c.s)(r,0,0,0);let a=-1,n=0;for(let e=0;e<t.length;e++){const s=t[e]*i;a!==s&&(r[0]+=o[s+0],r[1]+=o[s+1],r[2]+=o[s+2],n++),a=s}return n>1&&(0,c.g)(r,r,1/n),n>0}(this.vertexAttributes.get(X.T.POSITION),t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(X.T.POSITION);if(!e||0===e.length)return null;const t=this.primitiveType===O.MX.Triangle?3:1;(0,P.hu)(e.length%t==0,"Indexing error: "+e.length+" not divisible by "+t);const r=(0,q.p)(e.length/t),i=this.vertexAttributes.get(X.T.POSITION);return i?new I(r,t,e,i):null}}var J=r(74085),Y=r(32448),Z=r(22021),K=r(1533),Q=r(17452),ee=r(85958),te=r(88669),re=r(74709);function ie(e,t=!0){e.attributes.add(X.T.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.code.add(re.H`
174
174
  void main(void) {
175
175
  gl_Position = vec4(position, 0.0, 1.0);
176
176
  ${t?re.H`uv = position * 0.5 + vec2(0.5);`:""}
@@ -178,7 +178,7 @@
178
178
  `)}var oe=r(71250),ae=r(33680),ne=r(98069);class se extends re.K{constructor(){super(...arguments),this.color=(0,te.f)(1,1,1,1)}}Object.freeze(Object.defineProperty({__proto__:null,TextureOnlyPassParameters:se,build:function(){const e=new ae.kG;return e.include(ie),e.fragment.uniforms.add([new ne.A("tex",(e=>e.texture)),new oe.N("uColor",(e=>e.color))]),e.fragment.code.add(re.H`void main() {
179
179
  vec4 texColor = texture2D(tex, uv);
180
180
  gl_FragColor = texColor * uColor;
181
- }`),e}},Symbol.toStringTag,{value:"Module"}));var le=r(99880);let ce;var de;!function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"}(de||(de={}));var ue=r(35371),he=r(75656),fe=r(80442);function me(e,t,r,i,o=0){const a=e.gl,n=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);void 0===r&&console.error(`There is no location for vertex attribute '${e.name}' defined.`);const i=o*e.stride;if(e.count<=4)a.vertexAttribPointer(r,e.count,e.type,e.normalized,e.stride,e.offset+i),a.enableVertexAttribArray(r),e.divisor>0&&n&&n.vertexAttribDivisor(r,e.divisor);else if(9===e.count)for(let t=0;t<3;t++)a.vertexAttribPointer(r+t,3,e.type,e.normalized,e.stride,e.offset+12*t+i),a.enableVertexAttribArray(r+t),e.divisor>0&&n&&n.vertexAttribDivisor(r+t,e.divisor);else if(16===e.count)for(let t=0;t<4;t++)a.vertexAttribPointer(r+t,4,e.type,e.normalized,e.stride,e.offset+16*t+i),a.enableVertexAttribArray(r+t),e.divisor>0&&n&&n.vertexAttribDivisor(r+t,e.divisor);else console.error("Unsupported vertex attribute element count: "+e.count)}}function pe(e,t,r,i){const o=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);if(e.count<=4)o.disableVertexAttribArray(r),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r,0);else if(9===e.count)for(let t=0;t<3;t++)o.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r+t,0);else if(16===e.count)for(let t=0;t<4;t++)o.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r+t,0);else console.error("Unsupported vertex attribute element count: "+e.count)}e.unbindBuffer(ue.w0.ARRAY_BUFFER)}function ge(e){switch(e){case ue.VI.ALPHA:case ue.VI.LUMINANCE:case ue.VI.RED:case ue.VI.RED_INTEGER:case ue.lP.R8:case ue.lP.R8I:case ue.lP.R8UI:case ue.lP.R8_SNORM:case ue.Tg.STENCIL_INDEX8:return 1;case ue.VI.LUMINANCE_ALPHA:case ue.VI.RG:case ue.VI.RG_INTEGER:case ue.lP.RGBA4:case ue.lP.R16F:case ue.lP.R16I:case ue.lP.R16UI:case ue.lP.RG8:case ue.lP.RG8I:case ue.lP.RG8UI:case ue.lP.RG8_SNORM:case ue.lP.RGB565:case ue.lP.RGB5_A1:case ue.Tg.DEPTH_COMPONENT16:return 2;case ue.VI.DEPTH_COMPONENT:case ue.VI.RGB:case ue.VI.RGB_INTEGER:case ue.lP.RGB8:case ue.lP.RGB8I:case ue.lP.RGB8UI:case ue.lP.RGB8_SNORM:case ue.lP.SRGB8:case ue.Tg.DEPTH_COMPONENT24:return 3;case ue.VI.DEPTH_STENCIL:case ue.VI.RGBA:case ue.VI.RGBA_INTEGER:case ue.lP.RGBA8:case ue.lP.R32F:case ue.lP.R11F_G11F_B10F:case ue.lP.RG16F:case ue.lP.R32I:case ue.lP.R32UI:case ue.lP.RG16I:case ue.lP.RG16UI:case ue.lP.RGBA8I:case ue.lP.RGBA8UI:case ue.lP.RGBA8_SNORM:case ue.lP.SRGB8_ALPHA8:case ue.lP.RGB9_E5:case ue.lP.RGB10_A2UI:case ue.lP.RGB10_A2:case ue.Tg.DEPTH_STENCIL:case ue.Tg.DEPTH_COMPONENT32F:case ue.Tg.DEPTH24_STENCIL8:return 4;case ue.Tg.DEPTH32F_STENCIL8:return 5;case ue.lP.RGB16F:case ue.lP.RGB16I:case ue.lP.RGB16UI:return 6;case ue.lP.RG32F:case ue.lP.RG32I:case ue.lP.RG32UI:case ue.lP.RGBA16F:case ue.lP.RGBA16I:case ue.lP.RGBA16UI:return 8;case ue.lP.RGB32F:case ue.lP.RGB32I:case ue.lP.RGB32UI:return 12;case ue.lP.RGBA32F:case ue.lP.RGBA32I:case ue.lP.RGBA32UI:return 16;case ue.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case ue.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case ue.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case ue.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case ue.q_.COMPRESSED_R11_EAC:case ue.q_.COMPRESSED_SIGNED_R11_EAC:case ue.q_.COMPRESSED_RGB8_ETC2:case ue.q_.COMPRESSED_SRGB8_ETC2:case ue.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case ue.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case ue.q_.COMPRESSED_RG11_EAC:case ue.q_.COMPRESSED_SIGNED_RG11_EAC:case ue.q_.COMPRESSED_RGBA8_ETC2_EAC:case ue.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function _e(e){if((0,o.Wi)(e))return 0;if("descriptor"in e)return e.glName?_e(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return ge(t)*i*r}let ve=null,xe=null;async function Te(){return(0,o.Wi)(xe)&&(xe=function(){if((0,o.Wi)(ce)){const e=e=>(0,le.V)(`esri/libs/basisu/${e}`);ce=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 ce}(),ve=await xe),xe}function be(e,t,r,i,o){const a=ge(t?ue.q_.COMPRESSED_RGBA8_ETC2_EAC:ue.q_.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function Ae(e){return e.getNumImages()>=1&&!e.isUASTC()}function Ee(e){return e.getFaces()>=1&&e.isETC1S()}function we(e,t,r,i,o,a,n,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[de.ETC2_RGBA,ue.q_.COMPRESSED_RGBA8_ETC2_EAC]:[de.ETC1_RGB,ue.q_.COMPRESSED_RGB8_ETC2]:c?i?[de.BC3_RGBA,ue.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[de.BC1_RGB,ue.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[de.RGBA32,ue.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(n(e,d))),s(e,d,f[e]);const m=f.length>1,p=m?ue.cw.LINEAR_MIPMAP_LINEAR:ue.cw.LINEAR,g={...t,samplingMode:p,hasMipmap:m,internalFormat:u,width:o,height:a};return new he.x(e,g,{type:"compressed",levels:f})}const Se=C.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Ce(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Re=Ce("DXT1"),ye=Ce("DXT3"),Me=Ce("DXT5");var Oe=r(83475),Ne=r(21968);new Ne.G(X.T.POSITION,3,ue.g.FLOAT,0,12),new Ne.G(X.T.POSITION,3,ue.g.FLOAT,0,20),new Ne.G(X.T.UV0,2,ue.g.FLOAT,12,20),new Ne.G(X.T.POSITION,3,ue.g.FLOAT,0,32),new Ne.G(X.T.NORMAL,3,ue.g.FLOAT,12,32),new Ne.G(X.T.UV0,2,ue.g.FLOAT,24,32),new Ne.G(X.T.POSITION,3,ue.g.FLOAT,0,16),new Ne.G(X.T.COLOR,4,ue.g.UNSIGNED_BYTE,12,16);const Pe=[new Ne.G(X.T.POSITION,2,ue.g.FLOAT,0,8)],Ie=[new Ne.G(X.T.POSITION,2,ue.g.FLOAT,0,16),new Ne.G(X.T.UV0,2,ue.g.FLOAT,8,16)],De=C.Z.getLogger("esri.views.webgl.VertexArrayObject");class Le extends class{constructor(e,t,r,i,o=null){this._context=e,this._locations=t,this._layout=r,this._buffers=i,this._indexBuffer=o,this._glName=null,this._initialized=!1,e.instanceCounter.increment(ue._g.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((e,t)=>e+this._buffers[t].size),(0,o.pC)(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(this._context){if(this._glName){const e=this._context?.capabilities?.vao;e?(e.deleteVertexArray(this._glName),this._glName=null):De.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const e in this._buffers)this._buffers[e]?.dispose(),delete this._buffers[e];this._indexBuffer=(0,o.M2)(this._indexBuffer)}this._context.instanceCounter.decrement(ue._g.VertexArrayObject,this),this._context=(0,o.wN)(this._context)}else(this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&De.warn("Leaked WebGL VAO")}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||De.error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const r in e){const i=e[r];i||De.error("Vertex buffer is uninitialized!");const o=t[r];o||De.error("Vertex element descriptor is empty!"),me(this._context,this._locations,i,o)}(0,o.pC)(r)&&(this._context.capabilities.vao?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:t}=this;e||De.error("Vertex buffer dictionary is empty!");for(const r in e){const i=e[r];i||De.error("Vertex buffer is uninitialized!");const o=t[r];pe(this._context,this._locations,i,o)}(0,o.pC)(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}{}var Fe=r(67676),He=r(49300),Be=r(54738);const Ue=C.Z.getLogger("esri.views.webgl.BufferObject");class ze{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(ue._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,He.zu)(this._context.gl),i&&this.setData(i)}static createIndex(e,t,r){return new ze(e,ue.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new ze(e,ue.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==Be.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new ze(e,ue.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=ue.l1.STREAM_READ,r){if(e.type!==Be.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new ze(e,ue.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=ue.l1.STREAM_DRAW,r){if(e.type!==Be.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new ze(e,ue.w0.PIXEL_UNPACK_BUFFER,t,r)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===ue.w0.ELEMENT_ARRAY_BUFFER?this._indexType===ue.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===ue.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===ue.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(ue._g.BufferObject,this),this._context=(0,o.wN)(this._context)):this._glName&&Ue.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&Ue.error("Buffer size needs to be positive!"),this.bufferType===ue.w0.ELEMENT_ARRAY_BUFFER&&(0,o.pC)(t))switch(this._indexType=t,t){case ue.g.UNSIGNED_SHORT:e*=2;break;case ue.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===ue.w0.ELEMENT_ARRAY_BUFFER&&((0,K.Uc)(e)&&(t/=2,this._indexType=ue.g.UNSIGNED_SHORT),(0,K.ZY)(e)&&(t/=4,this._indexType=ue.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;(0,o.pC)(t)?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,He.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t=0,r=0,i=e.byteLength){if(!e)return;(t<0||t>=this._size)&&Ue.error("offset is out of range!");let o=t,a=r,n=i,s=e.byteLength;this.bufferType===ue.w0.ELEMENT_ARRAY_BUFFER&&((0,K.Uc)(e)?(s/=2,o*=2,a*=2,n*=2):(0,K.ZY)(e)&&(s/=4,o*=4,a*=4,n*=4)),void 0===i&&(i=s-1),r>=i&&Ue.error("end must be bigger than start!"),t+r-i>this._size&&Ue.error("An attempt to write beyond the end of the buffer!");const l=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const c=this._context.gl,d=ArrayBuffer.isView(e)?e.buffer:e,u=0===a&&n===e.byteLength?d:d.slice(a,n);c.bufferSubData(this.bufferType,o,u),(0,He.zu)(c),this._isVAOAware&&this._context.bindVAO(l)}setSubDataFromView(e,t,r,i){if(!e)return;(t<0||t>=this._size)&&Ue.error("offset is out of range!"),r>=i&&Ue.error("end must be bigger than start!"),t+r-i>this._size&&Ue.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 a=this._context.gl;if(this._context.type===Be.zO.WEBGL2)a.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);a.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,He.zu)(a),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==Be.zO.WEBGL2)return void Ue.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void Ue.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,Fe.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void Ue.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteSize&&Ue.warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;this._context.bindBuffer(this,ue.w0.COPY_READ_BUFFER),a.getBufferSubData(ue.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(ue.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===Be.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):Ue.error("Get buffer subdata is supported in WebGL2 only!")}}class Ve{constructor(e,t){this._context=e,this._desc=t,this.type="renderbuffer",this._context.instanceCounter.increment(ue._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:a,multisampled:n}=t;if(n){if(this._context.type!==Be.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,a,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,a,i,o)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}resize(e,t){const r=this._desc;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(ue._g.Renderbuffer,this),this._context=(0,o.wN)(this._context))}}class Ge{constructor(e,t,r=null,i=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._depthStencilTexture=null,this._initialized=!1,this._desc={...t},e.instanceCounter.increment(ue._g.FramebufferObject,this),(0,o.pC)(r)){Array.isArray(r)||(r=[r]);for(let e=0;e<r.length;++e){const t=r[e],i=ue.VY.COLOR_ATTACHMENT0+e;let o;$e(t)?(We(t)?(o=t.descriptor,this._colorAttachments.set(i,t)):(o=t,this._colorAttachments.set(i,new he.x(this._context,o))),qe(o,this._desc)):(ke(t)?(o=t.descriptor,this._colorAttachments.set(i,t)):(o=t,this._colorAttachments.set(i,new Ve(this._context,o))),Xe(o,this._desc)),this._validateColorAttachmentPoint(i)}}if((0,o.pC)(i)){let e,t;if($e(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),We(i)?(t=i.descriptor,this._depthStencilTexture=i):(t=i,this._depthStencilTexture=new he.x(this._context,t)),qe(t,this._desc);else{ke(i)?(t=i.descriptor,e=i):(t=i,e=new Ve(this._context,t));const r=this._desc.depthStencilTarget??ue.OU.DEPTH_STENCIL_RENDER_BUFFER;r===ue.OU.STENCIL_RENDER_BUFFER?this._stencilAttachment=e:r===ue.OU.DEPTH_RENDER_BUFFER||r===ue.OU.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=e:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),this._desc.depthStencilTarget=r,Xe(t,this._desc)}}}dispose(){if(!this._desc)return;const e=this._context.getBoundFramebufferObject();this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(ue._g.FramebufferObject,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const e=this._colorAttachments.get(ue.VY.COLOR_ATTACHMENT0);return e&&We(e)?e:null}get colorAttachment(){return this._colorAttachments.get(ue.VY.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width??0}get height(){return this._desc.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+_e(r)),0)+_e(this.depthStencilAttachment)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&We(t)?t:null}attachColorTexture(e,t=ue.VY.COLOR_ATTACHMENT0){e&&(this._validateColorAttachmentPoint(t),qe(e.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e))}detachColorTexture(e=ue.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(We(t)){const r=t;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}}setColorTextureTarget(e,t=ue.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);We(r)&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencilTexture(e){if((0,o.Wi)(e))return;const t=e.descriptor;t.pixelFormat!==ue.VI.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==ue.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!"),qe(t,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==ue.OU.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=ue.OU.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,ue.Lu)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,ue.Lu)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if((0,o.Wi)(e))return;const t=e.descriptor;if(t.internalFormat!==ue.Tg.DEPTH_STENCIL&&t.internalFormat!==ue.Tg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),Xe(t,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=t.internalFormat===ue.Tg.DEPTH_STENCIL?ue.OU.DEPTH_STENCIL_RENDER_BUFFER:ue.OU.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._desc.depthStencilTarget===ue.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(ue.qi.FRAMEBUFFER,r,t.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===ue.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(ue.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}return this._depthAttachment=null,t}detachAll(){this._colorAttachments.forEach(((e,t)=>this._detachColorAttachment(t))),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,t,r,i,o,a,n){(e<0||t<0||o<0||a<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=this._desc,l=n.descriptor;n.descriptor.target!==ue.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||null==l?.width||null==l?.height||e+r>s.width||t+i>s.height||o+r>l.width||a+i>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,d=c.bindTexture(n,he.x.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(he.x.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(ue.No.TEXTURE_2D,0,o,a,e,t,r,i),c.bindTexture(d,he.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,a,n){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),n||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,a,n)}async readPixelsAsync(e,t,r,i,o,a,n){if(this._context.type!==Be.zO.WEBGL2)return(0,He.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,a,n);const s=this._context.gl,l=ze.createPixelPack(this._context,ue.l1.STREAM_READ,n.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,a,0),this._context.unbindBuffer(ue.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(n),l.dispose()}resize(e,t){const r=this._desc;if(r.width!==e||r.height!==t){if(!this._initialized)return r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,t));r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(e,t):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,t),this._stencilAttachment&&this._stencilAttachment.resize(e,t)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=ue.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=this._context,i=t.createFramebuffer(),o=this._desc,a=o.colorTarget??ue.Lm.RENDER_BUFFER,n=o.width??1,s=o.height??1;if(t.bindFramebuffer(e,i),0===this._colorAttachments.size)if(a===ue.Lm.TEXTURE||a===ue.Lm.CUBEMAP)this._colorAttachments.set(ue.VY.COLOR_ATTACHMENT0,function(e,t,r){return new he.x(e,{target:r,pixelFormat:ue.VI.RGBA,dataType:ue.Br.UNSIGNED_BYTE,samplingMode:ue.cw.NEAREST,wrapMode:ue.e8.CLAMP_TO_EDGE,width:t.width,height:t.height})}(r,o,this.descriptor.colorTarget===ue.Lm.CUBEMAP?ue.No.TEXTURE_CUBE_MAP:ue.No.TEXTURE_2D));else{const e=new Ve(r,{internalFormat:ue.lP.RGBA4,width:n,height:s});this._colorAttachments.set(ue.VY.COLOR_ATTACHMENT0,e)}this._colorAttachments.forEach(((r,i)=>{r&&(We(r)?this._framebufferTexture2D(r.glName,i,je(r),e):t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,r.glName))}));const l=o.depthStencilTarget??ue.OU.NONE;switch(l){case ue.OU.DEPTH_RENDER_BUFFER:case ue.OU.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new Ve(r,{internalFormat:o.depthStencilTarget===ue.OU.DEPTH_RENDER_BUFFER?ue.Tg.DEPTH_COMPONENT16:ue.Tg.DEPTH_STENCIL,width:n,height:s}));const i=l===ue.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,this._depthAttachment.glName);break}case ue.OU.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new Ve(r,{internalFormat:ue.Tg.STENCIL_INDEX8,width:n,height:s})),t.framebufferRenderbuffer(e,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,this._stencilAttachment.glName);break;case ue.OU.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){r.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const e={target:ue.No.TEXTURE_2D,pixelFormat:ue.VI.DEPTH_STENCIL,dataType:ue.Br.UNSIGNED_INT_24_8,samplingMode:ue.cw.NEAREST,wrapMode:ue.e8.CLAMP_TO_EDGE,width:n,height:s};this._depthStencilTexture=new he.x(r,e)}this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,je(this._depthStencilTexture),e)}(0,He.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=i,this._initialized=!0}_framebufferTexture2D(e,t=ue.VY.COLOR_ATTACHMENT0,r=ue.No.TEXTURE_2D,i=ue.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_detachColorAttachment(e){(0,He.hZ)()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const t=this._context.gl,r=this._colorAttachments.get(e);return We(r)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)):this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(ue.qi.FRAMEBUFFER,e,t.RENDERBUFFER,null)),this._colorAttachments.delete(e),r}_disposeColorAttachments(){this._colorAttachments.forEach(((e,t)=>{this._detachColorAttachment(t),e.dispose()})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===ue.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(ue.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(ue.qi.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(-1===Ge._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;Ge._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else Ge._MAX_COLOR_ATTACHMENTS=1}const t=e-ue.VY.COLOR_ATTACHMENT0;t+1>Ge._MAX_COLOR_ATTACHMENTS&&C.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${Ge._MAX_COLOR_ATTACHMENTS} color attachments`)}}function We(e){return null!=e&&"type"in e&&"texture"===e.type}function ke(e){return null!=e&&"type"in e&&"renderbuffer"===e.type}function $e(e){return We(e)||null!=e&&"pixelFormat"in e}function qe(e,t){e.target!==ue.No.TEXTURE_2D&&e.target!==ue.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function Xe(e,t){void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function je(e){return e.descriptor.target===ue.No.TEXTURE_CUBE_MAP?ue.No.TEXTURE_CUBE_MAP_POSITIVE_X:ue.No.TEXTURE_2D}Ge._MAX_COLOR_ATTACHMENTS=-1;var Je,Ye,Ze=r(46314);class Ke extends L.c{constructor(e,t){super(),this._data=e,this.type=F.U.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new Y.Z,this._passParameters=new se,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:ue.e8.REPEAT,t:ue.e8.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||O.CE.STRETCH,this.estimatedTexMemRequired=Ke._estimateTexMemRequired(this._data,this.params),this._startPreload()}_startPreload(){const e=this._data;(0,o.Wi)(e)||(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,Q.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,Q.HK)(e.src)||(0,Q.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if((0,o.Wi)(e))return 0;if((0,K.eP)(e)||(0,K.lq)(e))return t.encoding===Ke.KTX2_ENCODING?function(e,t){if((0,o.Wi)(ve))return e.byteLength;const r=new ve.KTX2File(new Uint8Array(e)),i=Ee(r)?be(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,t.mipmap):t.encoding===Ke.BASIS_ENCODING?function(e,t){if((0,o.Wi)(ve))return e.byteLength;const r=new ve.BasisFile(new Uint8Array(e)),i=Ae(r)?be(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?Ke._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this._data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){return{target:ue.No.TEXTURE_2D,pixelFormat:ue.VI.RGBA,dataType:ue.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?ue.cw.LINEAR_MIPMAP_LINEAR:ue.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:this.params.maxAnisotropy??(this.params.mipmap?e.parameters.maxMaxAnisotropy:1)}}get glTexture(){return this._glTexture}load(e,t){if((0,o.pC)(this._glTexture))return this._glTexture;if((0,o.pC)(this._loadingPromise))return this._loadingPromise;const r=this._data;return(0,o.Wi)(r)?(this._glTexture=new he.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof r?this._loadFromURL(e,t,r):r instanceof Image?this._loadFromImageElement(e,t,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,t,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r,t):((0,K.eP)(r)||(0,K.lq)(r))&&this.params.encoding===Ke.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,r)):((0,K.eP)(r)||(0,K.lq)(r))&&this.params.encoding===Ke.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,r)):((0,K.eP)(r)||(0,K.lq)(r))&&this.params.encoding===Ke.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,r)):(0,K.lq)(r)?this._loadFromPixelData(e,r):(0,K.eP)(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e,t,r){if(!(this._data instanceof HTMLVideoElement)||(0,o.Wi)(this._glTexture))return r;if(this._data.readyState<Je.HAVE_CURRENT_DATA||r===this._data.currentTime)return r;if((0,o.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:r,vao:i,sourceTexture:o}=this._powerOfTwoStretchInfo;o.setData(this._data),this._drawStretchedTexture(e,t,r,i,o,this._glTexture)}else{const{videoWidth:e,videoHeight:t}=this._data,{width:r,height:i}=this._glTexture.descriptor;e!==r||t!==i?this._glTexture.updateData(0,0,0,Math.min(e,r),Math.min(t,i),this._data):this._glTexture.setData(this._data)}return this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.params.updateCallback&&this.params.updateCallback(),this._data.currentTime}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const{textureData:i,internalFormat:a,width:n,height:s}=(0,o.s3)(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,a;switch(i){case Re:o=8,a=ue.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ye:o=16,a=ue.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Me:o=16,a=ue.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 n=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&&(n=Math.max(1,r[7])),1===n||(0,Z.wt)(s)&&(0,Z.wt)(l)||(Se.warn("Ignoring mipmaps of non power of two sized compressed texture."),n=1);let f=r[1]+4;const m=[];for(let t=0;t<n;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,f,h),m.push(u),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:a,width:c,height:d}}(r,t.hasMipmap??!1));return t.samplingMode=i.levels.length>1?ue.cw.LINEAR_MIPMAP_LINEAR:ue.cw.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=a,t.width=n,t.height=s,new he.x(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){(0,o.Wi)(ve)&&(ve=await Te());const i=new ve.KTX2File(new Uint8Array(r));if(!Ee(i))return null;i.startTranscoding();const a=we(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(),a}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){(0,o.Wi)(ve)&&(ve=await Te());const i=new ve.BasisFile(new Uint8Array(r));if(!Ae(i))return null;i.startTranscoding();const a=we(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(),a}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,P.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?ue.VI.LUMINANCE:3===this.params.components?ue.VI.RGB:ue.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new he.x(e,r,t),this._glTexture}_loadFromURL(e,t,r){return this._loadAsync((async i=>{const o=await M(r,{signal:i});return(0,R.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromImageElement(e,t,r){return r.complete?this._loadFromImage(e,r,t):this._loadAsync((async i=>{const o=await(0,ee.fY)(r,r.src,!1,i);return(0,R.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromVideoElement(e,t,r){return r.readyState>=Je.HAVE_CURRENT_DATA?this._loadFromImage(e,r,t):this._loadFromVideoElementAsync(e,t,r)}_loadFromVideoElementAsync(e,t,r){return this._loadAsync((i=>new Promise(((a,n)=>{const s=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),(0,o.hw)(d)},l=()=>{r.readyState>=Je.HAVE_CURRENT_DATA&&(s(),a(this._loadFromImage(e,r,t)))},c=e=>{s(),n(e||new S.Z("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const d=(0,R.fu)(i,(()=>c((0,R.zE)())))}))))}_loadFromImage(e,t,r){const i=Ke._getDataDimensions(t);this.params.width=i.width,this.params.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this.params.components?ue.VI.RGB:ue.VI.RGBA,!this._requiresPowerOfTwo(e,o)||(0,Z.wt)(i.width)&&(0,Z.wt)(i.height)?(o.width=i.width,o.height=i.height,this._glTexture=new he.x(e,o,t),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(e,t,i,o,r),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}_requiresPowerOfTwo(e,t){const r=ue.e8.CLAMP_TO_EDGE,i="number"==typeof t.wrapMode?t.wrapMode===r:t.wrapMode.s===r&&t.wrapMode.t===r;return!(0,Ze.Z)(e.gl)&&(t.hasMipmap||!i)}_makePowerOfTwoTexture(e,t,r,i,o){const{width:a,height:n}=r,s=(0,Z.Sf)(a),l=(0,Z.Sf)(n);let c;switch(i.width=s,i.height=l,this.params.powerOfTwoResizeMode){case O.CE.PAD:i.textureCoordinateScaleFactor=[a/s,n/l],c=new he.x(e,i),c.updateData(0,0,0,a,n,t);break;case O.CE.STRETCH:case null:case void 0:c=this._stretchToPowerOfTwo(e,t,i,o());break;default:(0,J.Bg)(this.params.powerOfTwoResizeMode)}return i.hasMipmap&&c.generateMipmap(),c}_stretchToPowerOfTwo(e,t,r,i){const o=new he.x(e,r),a=new Ge(e,{colorTarget:ue.Lm.TEXTURE,depthStencilTarget:ue.OU.NONE},o),n=new he.x(e,{target:ue.No.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:ue.Br.UNSIGNED_BYTE,wrapMode:ue.e8.CLAMP_TO_EDGE,samplingMode:ue.cw.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},t),s=function(e,t=Pe,r=Oe.i,i=-1,o=1){let a=null;return a=t===Ie?new Float32Array([i,i,0,0,o,i,1,0,i,o,0,1,o,o,1,1]):new Float32Array([i,i,o,i,i,o,o,o]),new Le(e,r,{geometry:t},{geometry:ze.createVertex(e,ue.l1.STATIC_DRAW,a)})}(e),l=e.getBoundFramebufferObject();return this._drawStretchedTexture(e,i,a,s,n,o),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:s,sourceTexture:n,framebuffer:a}:(s.dispose(!0),n.dispose(),a.detachColorTexture(),a.dispose()),e.bindFramebuffer(l),o}_drawStretchedTexture(e,t,r,i,o,a){this._passParameters.texture=o,e.bindFramebuffer(r);const n=e.getViewport();e.setViewport(0,0,a.descriptor.width,a.descriptor.height),e.bindTechnique(t,this._passParameters,null),e.bindVAO(i),e.drawArrays(ue.MX.TRIANGLE_STRIP,0,function(e,t){return e.vertexBuffers[t].size/function(e){return e[0].stride}(e.layout[t])}(i,"geometry")),e.bindFramebuffer(null),e.setViewport(n.x,n.y,n.width,n.height),this._passParameters.texture=null}unload(){if((0,o.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:e,vao:t,sourceTexture:r}=this._powerOfTwoStretchInfo;t.dispose(!0),r.dispose(),e.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if((0,o.pC)(this._glTexture)&&(this._glTexture.dispose(),this._glTexture=null),(0,o.pC)(this._loadingController)){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}Ke.DDS_ENCODING="image/vnd-ms.dds",Ke.KTX2_ENCODING="image/ktx2",Ke.BASIS_ENCODING="image/x.basis",(Ye=Je||(Je={}))[Ye.HAVE_NOTHING=0]="HAVE_NOTHING",Ye[Ye.HAVE_METADATA=1]="HAVE_METADATA",Ye[Ye.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Ye[Ye.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Ye[Ye.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var Qe=r(64822),et=r(65576),tt=r(55039),rt=r(64267),it=r(19419),ot=r(85504),at=r(60537),nt=r(82791),st=r(93144);function lt(e,t,r=ue.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]}}}const ct={face:ue.LR.BACK,mode:ue.Wf.CCW},dt={face:ue.LR.FRONT,mode:ue.Wf.CCW},ut=e=>e===O.Vr.Back?ct:e===O.Vr.Front?dt:null,ht={zNear:0,zFar:1},ft={r:!0,g:!0,b:!0,a:!0};function mt(e){return wt.intern(e)}function pt(e){return Ct.intern(e)}function gt(e){return yt.intern(e)}function _t(e){return Ot.intern(e)}function vt(e){return Pt.intern(e)}function xt(e){return Dt.intern(e)}function Tt(e){return Ft.intern(e)}function bt(e){return Bt.intern(e)}class At{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 Et(e){return"["+e.join(",")+"]"}const wt=new At(St,(e=>({__tag:"Blending",...e})));function St(e){return e?Et([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 Ct=new At(Rt,(e=>({__tag:"Culling",...e})));function Rt(e){return e?Et([e.face,e.mode]):null}const yt=new At(Mt,(e=>({__tag:"PolygonOffset",...e})));function Mt(e){return e?Et([e.factor,e.units]):null}const Ot=new At(Nt,(e=>({__tag:"DepthTest",...e})));function Nt(e){return e?Et([e.func]):null}const Pt=new At(It,(e=>({__tag:"StencilTest",...e})));function It(e){return e?Et([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const Dt=new At(Lt,(e=>({__tag:"DepthWrite",...e})));function Lt(e){return e?Et([e.zNear,e.zFar]):null}const Ft=new At(Ht,(e=>({__tag:"ColorWrite",...e})));function Ht(e){return e?Et([e.r,e.g,e.b,e.a]):null}const Bt=new At(Ut,(e=>({__tag:"StencilWrite",...e})));function Ut(e){return e?Et([e.mask]):null}const zt=new At((function(e){return e?Et([St(e.blending),Rt(e.culling),Mt(e.polygonOffset),Nt(e.depthTest),It(e.stencilTest),Lt(e.depthWrite),Ht(e.colorWrite),Ut(e.stencilWrite)]):null}),(e=>({blending:mt(e.blending),culling:pt(e.culling),polygonOffset:gt(e.polygonOffset),depthTest:_t(e.depthTest),stencilTest:vt(e.stencilTest),depthWrite:xt(e.depthWrite),colorWrite:Tt(e.colorWrite),stencilWrite:bt(e.stencilWrite)}))),Vt=function(e,t,r,i,o=ue.db.ADD,a=ue.db.ADD,n=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:o,opAlpha:a,color:{r:n[0],g:n[1],b:n[2],a:n[3]}}}(ue.zi.SRC_ALPHA,ue.zi.ONE,ue.zi.ONE_MINUS_SRC_ALPHA,ue.zi.ONE_MINUS_SRC_ALPHA),Gt=lt(ue.zi.ONE,ue.zi.ONE),Wt=lt(ue.zi.ZERO,ue.zi.ONE_MINUS_SRC_ALPHA);function kt(e){return e===st.A.FrontFace?null:e===st.A.Alpha?Wt:Gt}const $t={factor:-1,units:-2};function qt(e,t=ue.wb.LESS){return e===st.A.NONE||e===st.A.FrontFace?t:ue.wb.LEQUAL}var Xt,jt;(jt=Xt||(Xt={}))[jt.INTEGRATED_MESH=0]="INTEGRATED_MESH",jt[jt.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",jt[jt.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",jt[jt.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",jt[jt.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",jt[jt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",jt[jt.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",jt[jt.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",jt[jt.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",jt[jt.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",jt[jt.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",jt[jt.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",jt[jt.LASERLINES=12]="LASERLINES",jt[jt.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",jt[jt.HUD_MATERIAL=14]="HUD_MATERIAL",jt[jt.LABEL_MATERIAL=15]="LABEL_MATERIAL",jt[jt.LINE_CALLOUTS=16]="LINE_CALLOUTS",jt[jt.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",jt[jt.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",jt[jt.DRAPED_WATER=19]="DRAPED_WATER",jt[jt.VOXEL=20]="VOXEL",jt[jt.MAX_SLOTS=21]="MAX_SLOTS";var Jt=r(51305),Yt=r(94961),Zt=r(72119),Kt=r(29268);const Qt=(0,d.c)(),er=(0,d.c)(),tr=(0,d.c)(),rr=new class{constructor(e=0){this.offset=e,this.sphere=(0,Kt.c)(),this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let o=i[0]*e+i[4]*t+i[8]*r+i[12],a=i[1]*e+i[5]*t+i[9]*r+i[13],n=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(o*o+a*a+n*n);o+=o*s,a+=a*s,n+=n*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*o+l[4]*a+l[8]*n+l[12],this.tmpVertex[1]=l[1]*o+l[5]*a+l[9]*n+l[13],this.tmpVertex[2]=l[2]*o+l[6]*a+l[10]*n+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*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=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,d.c)(),this._mbs=(0,Kt.c)(),this._obb={center:(0,d.c)(),halfSize:(0,Zt.c)(),quaternion:null},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=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,o=t,a=r+this.componentLocalOriginLength,n=this._totalOffset/Math.sqrt(i*i+o*o+a*a);return this._tmpVertex[0]=e+i*n,this._tmpVertex[1]=t+o*n,this._tmpVertex[2]=r+a*n,this._tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,o=e[3],a=e[4],n=e[5]+this.componentLocalOriginLength,s=t*o<0?0:Math.min(Math.abs(t),Math.abs(o)),l=r*a<0?0:Math.min(Math.abs(r),Math.abs(a)),c=i*n<0?0:Math.min(Math.abs(i),Math.abs(n)),d=Math.sqrt(s*s+l*l+c*c);if(d<this._totalOffset)return e[0]-=t<0?this._totalOffset:0,e[1]-=r<0?this._totalOffset:0,e[2]-=i<0?this._totalOffset:0,e[3]+=o>0?this._totalOffset:0,e[4]+=a>0?this._totalOffset:0,e[5]+=n>0?this._totalOffset:0,e;const u=Math.max(Math.abs(t),Math.abs(o)),h=Math.max(Math.abs(r),Math.abs(a)),f=Math.max(Math.abs(i),Math.abs(n)),m=Math.sqrt(u*u+h*h+f*f),p=this._totalOffset/m,g=this._totalOffset/d;return e[0]+=t*(t>0?p:g),e[1]+=r*(r>0?p:g),e[2]+=i*(i>0?p:g),e[3]+=o*(o<0?p:g),e[4]+=a*(a<0?p:g),e[5]+=n*(n<0?p:g),e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this._totalOffset/t;return this._mbs[0]=e[0]+e[0]*r,this._mbs[1]=e[1]+e[1]*r,this._mbs[2]=e[2]+e[2]*r,this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){const t=e.center,r=this._totalOffset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this._obb.center[0]=t[0]+t[0]*r,this._obb.center[1]=t[1]+t[1]*r,this._obb.center[2]=t[2]+t[2]*r,(0,c.q)(this._obb.halfSize,e.halfSize,e.quaternion),(0,c.a)(this._obb.halfSize,this._obb.halfSize,e.center);const i=this._totalOffset/Math.sqrt(this._obb.halfSize[0]*this._obb.halfSize[0]+this._obb.halfSize[1]*this._obb.halfSize[1]+this._obb.halfSize[2]*this._obb.halfSize[2]);return this._obb.halfSize[0]+=this._obb.halfSize[0]*i,this._obb.halfSize[1]+=this._obb.halfSize[1]*i,this._obb.halfSize[2]+=this._obb.halfSize[2]*i,(0,c.b)(this._obb.halfSize,this._obb.halfSize,e.center),(0,Jt.c)(ir,e.quaternion),(0,c.q)(this._obb.halfSize,this._obb.halfSize,ir),this._obb.halfSize[0]*=this._obb.halfSize[0]<0?-1:1,this._obb.halfSize[1]*=this._obb.halfSize[1]<0?-1:1,this._obb.halfSize[2]*=this._obb.halfSize[2]<0?-1:1,this._obb.quaternion=e.quaternion,this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],o=t+this.localOrigin[1],a=r+this.localOrigin[2],n=this.offset/Math.sqrt(i*i+o*o+a*a);return this.tmpVertex[0]=e+i*n,this.tmpVertex[1]=t+o*n,this.tmpVertex[2]=r+a*n,this.tmpVertex}applyToAabb(e){for(let t=0;t<3;++t)Qt[t]=e[0+t]+this.localOrigin[t],er[t]=e[3+t]+this.localOrigin[t],tr[t]=Qt[t];const t=this.applyToVertex(Qt[0],Qt[1],Qt[2]);for(let r=0;r<3;++r)e[r]=t[r],e[r+3]=t[r];const r=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t+0]=Math.min(e[t+0],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let t=0;t<3;++t)tr[t]=0==(e&1<<t)?Qt[t]:er[t];r(tr)}let i=0;for(let e=0;e<3;++e)Qt[e]*er[e]<0&&(i|=1<<e);if(0!==i&&7!==i)for(let e=0;e<8;++e)if(0==(i&e)){for(let t=0;t<3;++t)i[t]?tr[t]=0:tr[t]=0!=(e&1<<t)?Qt[t]:er[t];r(tr)}for(let t=0;t<3;++t)e[t+0]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const ir=(0,Yt.a)();function or(e,t,r,i){const o=r.typedBuffer,a=r.typedBufferStride,n=e.length;i*=a;for(let r=0;r<n;++r){const n=2*e[r];o[i]=t[n],o[i+1]=t[n+1],i+=a}}function ar(e,t,r,i,o){const a=r.typedBuffer,n=r.typedBufferStride,s=e.length;if(i*=n,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];a[i]=t[o],a[i+1]=t[o+1],a[i+2]=t[o+2],i+=n}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)a[i]=t[s],a[i+1]=t[s+1],a[i+2]=t[s+2],i+=n}}function nr(e,t,r,i,o,a=1){if(!r)return void ar(e,t,i,o,a);const n=i.typedBuffer,s=i.typedBufferStride,l=e.length,c=r[0],d=r[1],u=r[2],h=r[4],f=r[5],m=r[6],p=r[8],g=r[9],_=r[10],v=r[12],x=r[13],T=r[14];if(o*=s,1===a)for(let r=0;r<l;++r){const i=3*e[r],a=t[i],l=t[i+1],b=t[i+2];n[o]=c*a+h*l+p*b+v,n[o+1]=d*a+f*l+g*b+x,n[o+2]=u*a+m*l+_*b+T,o+=s}else for(let r=0;r<l;++r){const i=3*e[r],l=t[i],b=t[i+1],A=t[i+2],E=c*l+h*b+p*A+v,w=d*l+f*b+g*A+x,S=u*l+m*b+_*A+T;for(let e=0;e<a;++e)n[o]=E,n[o+1]=w,n[o+2]=S,o+=s}}function sr(e,t,r,i,o,a=1){if(!r)return void ar(e,t,i,o,a);const n=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=n[0],h=n[1],f=n[2],m=n[4],p=n[5],g=n[6],_=n[8],v=n[9],x=n[10],T=!(0,s.x)(n),b=1e-6,A=1-b;if(o*=c,1===a)for(let r=0;r<d;++r){const i=3*e[r],a=t[i],n=t[i+1],s=t[i+2];let d=u*a+m*n+_*s,E=h*a+p*n+v*s,w=f*a+g*n+x*s;if(T){const e=d*d+E*E+w*w;if(e<A&&e>b){const t=1/Math.sqrt(e);d*=t,E*=t,w*=t}}l[o+0]=d,l[o+1]=E,l[o+2]=w,o+=c}else for(let r=0;r<d;++r){const i=3*e[r],n=t[i],s=t[i+1],d=t[i+2];let E=u*n+m*s+_*d,w=h*n+p*s+v*d,S=f*n+g*s+x*d;if(T){const e=E*E+w*w+S*S;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,w*=t,S*=t}}for(let e=0;e<a;++e)l[o+0]=E,l[o+1]=w,l[o+2]=S,o+=c}}function lr(e,t,r,i,o,a=1){if(!r)return void function(e,t,r,i,o=1){const a=r.typedBuffer,n=r.typedBufferStride,s=e.length;if(i*=n,1===o)for(let r=0;r<s;++r){const o=4*e[r];a[i]=t[o],a[i+1]=t[o+1],a[i+2]=t[o+2],a[i+3]=t[o+3],i+=n}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)a[i]=t[s],a[i+1]=t[s+1],a[i+2]=t[s+2],a[i+3]=t[s+3],i+=n}}(e,t,i,o,a);const n=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=n[0],h=n[1],f=n[2],m=n[4],p=n[5],g=n[6],_=n[8],v=n[9],x=n[10],T=!(0,s.x)(n),b=1e-6,A=1-b;if(o*=c,1===a)for(let r=0;r<d;++r){const i=4*e[r],a=t[i],n=t[i+1],s=t[i+2],d=t[i+3];let E=u*a+m*n+_*s,w=h*a+p*n+v*s,S=f*a+g*n+x*s;if(T){const e=E*E+w*w+S*S;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,w*=t,S*=t}}l[o+0]=E,l[o+1]=w,l[o+2]=S,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],n=t[i],s=t[i+1],d=t[i+2],E=t[i+3];let w=u*n+m*s+_*d,S=h*n+p*s+v*d,C=f*n+g*s+x*d;if(T){const e=w*w+S*S+C*C;if(e<A&&e>b){const t=1/Math.sqrt(e);w*=t,S*=t,C*=t}}for(let e=0;e<a;++e)l[o+0]=w,l[o+1]=S,l[o+2]=C,l[o+3]=E,o+=c}}function cr(e,t,r,i,o,a=1){const n=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,1===a){if(4===r)for(let r=0;r<l;++r){const i=4*e[r];n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=t[i+3],o+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=255,o+=s}}else if(4===r)for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<a;++e)n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=t[i+3],o+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<a;++e)n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=255,o+=s}}function dr(e,t,r,i,o=1){const a=t.typedBuffer,n=t.typedBufferStride;if(i*=n,1===o)for(let t=0;t<r;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n}var ur=r(37782),hr=r(135),fr=r(15719),mr=r(96310),pr=r(89243);class gr{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}var _r=r(67498);class vr{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new N.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.generateBind(_r.P.Pass,this),this.bindDraw=t.generateBind(_r.P.Draw,this),this._fragmentUniforms=(0,He.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get isCompiled(){return this._glProgram.isCompiled}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((0,o.Wi)(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)})),(0,o.pC)(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)}}ue.wb.LESS,ue.wb.ALWAYS;const xr={mask:255},Tr={function:{func:ue.wb.ALWAYS,ref:O.hU.OutlineVisualElementMask,mask:O.hU.OutlineVisualElementMask},operation:{fail:ue.xS.KEEP,zFail:ue.xS.KEEP,zPass:ue.xS.ZERO}},br={function:{func:ue.wb.ALWAYS,ref:O.hU.OutlineVisualElementMask,mask:O.hU.OutlineVisualElementMask},operation:{fail:ue.xS.KEEP,zFail:ue.xS.KEEP,zPass:ue.xS.REPLACE}};ue.wb.EQUAL,O.hU.OutlineVisualElementMask,O.hU.OutlineVisualElementMask,ue.xS.KEEP,ue.xS.KEEP,ue.xS.KEEP,ue.wb.NOTEQUAL,O.hU.OutlineVisualElementMask,O.hU.OutlineVisualElementMask,ue.xS.KEEP,ue.xS.KEEP,ue.xS.KEEP;var Ar=r(32078);class Er extends fr.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,d.f)(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=O.Vr.Back,this.emissiveFactor=(0,d.f)(0,0,0),this.instancedDoublePrecision=!1,this.normals="default",this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,d.f)(.2,.2,.2),this.diffuse=(0,d.f)(.8,.8,.8),this.externalColor=(0,te.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvSizeValue=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.vvSymbolAnchor=[0,0,0],this.vvSymbolRotationMatrix=(0,n.c)(),this.vvOpacityEnabled=!1,this.vvOpacityValues=[],this.vvOpacityOpacities=[],this.transparent=!1,this.writeDepth=!0,this.customDepthTest=O.Gv.Less,this.textureAlphaMode=O.JJ.Blend,this.textureAlphaCutoff=mr.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=nt.yD.Occlude}}class wr extends class{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,o.M2)(this._program),this._pipeline=this._configuration=null}reload(e){(0,o.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.isCompiled}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 ue.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}{initializeConfiguration(e,t){t.spherical=e.viewingMode===Qe.JY.Global,t.doublePrecisionRequiresObfuscation=(0,pr.I)(e.rctx),t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?hr.N.Default:hr.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,wr.shader)}_initializeProgram(e,t){return new vr(e.rctx,t.get().build(this.configuration),Oe.i)}_convertDepthTestFunction(e){return e===O.Gv.Lequal?ue.wb.LEQUAL:ue.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===st.A.NONE,o=e===st.A.FrontFace;return function(e){return zt.intern(e)}({blending:r.output!==tt.H.Color&&r.output!==tt.H.Alpha||!r.transparent?null:i?Vt:kt(e),culling:Sr(r)&&ut(r.cullFace),depthTest:{func:qt(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:i||o?r.writeDepth&&ht:null,colorWrite:ft,stencilWrite:r.hasOccludees?xr:null,stencilTest:r.hasOccludees?t?br:Tr:null,polygonOffset:i||o?null:(a=r.enableOffset,a?$t:null)});var a}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 Sr(e){return e.cullFace!==O.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}wr.shader=new gr(Ar.D,(()=>r.e(9291).then(r.bind(r,79291))));var Cr=r(43697),Rr=r(51354);class yr extends Rr.m{}(0,Cr._)([(0,Rr.o)({constValue:!0})],yr.prototype,"hasSliceHighlight",void 0),(0,Cr._)([(0,Rr.o)({constValue:!1})],yr.prototype,"hasSliceInVertexProgram",void 0),(0,Cr._)([(0,Rr.o)({constValue:!1})],yr.prototype,"instancedDoublePrecision",void 0),(0,Cr._)([(0,Rr.o)({constValue:!1})],yr.prototype,"useLegacyTerrainShading",void 0),(0,Cr._)([(0,Rr.o)({constValue:!1})],yr.prototype,"hasModelTransformation",void 0),(0,Cr._)([(0,Rr.o)({constValue:_r.P.Pass})],yr.prototype,"pbrTextureBindType",void 0);class Mr extends yr{constructor(){super(...arguments),this.output=tt.H.Color,this.alphaDiscardMode=O.JJ.Opaque,this.doubleSidedMode=it.q.None,this.pbrMode=ot.f7.Disabled,this.cullFace=O.Vr.None,this.transparencyPassType=st.A.NONE,this.normalType=rt.h.Attribute,this.textureCoordinateType=hr.N.None,this.customDepthTest=O.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.hasMultipassTerrain=!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,Cr._)([(0,Rr.o)({count:tt.H.COUNT})],Mr.prototype,"output",void 0),(0,Cr._)([(0,Rr.o)({count:O.JJ.COUNT})],Mr.prototype,"alphaDiscardMode",void 0),(0,Cr._)([(0,Rr.o)({count:it.q.COUNT})],Mr.prototype,"doubleSidedMode",void 0),(0,Cr._)([(0,Rr.o)({count:ot.f7.COUNT})],Mr.prototype,"pbrMode",void 0),(0,Cr._)([(0,Rr.o)({count:O.Vr.COUNT})],Mr.prototype,"cullFace",void 0),(0,Cr._)([(0,Rr.o)({count:st.A.COUNT})],Mr.prototype,"transparencyPassType",void 0),(0,Cr._)([(0,Rr.o)({count:rt.h.COUNT})],Mr.prototype,"normalType",void 0),(0,Cr._)([(0,Rr.o)({count:hr.N.COUNT})],Mr.prototype,"textureCoordinateType",void 0),(0,Cr._)([(0,Rr.o)({count:O.Gv.COUNT})],Mr.prototype,"customDepthTest",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"spherical",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasVertexColors",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasSymbolColors",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasVerticalOffset",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasSlicePlane",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasSliceHighlight",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasColorTexture",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasMetallicRoughnessTexture",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasEmissionTexture",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasOcclusionTexture",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasNormalTexture",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasScreenSizePerspective",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasVertexTangents",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasOccludees",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasMultipassTerrain",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasModelTransformation",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"offsetBackfaces",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"vvSize",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"vvColor",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"receiveShadows",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"receiveAmbientOcclusion",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"textureAlphaPremultiplied",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"instanced",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"instancedColor",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"instancedDoublePrecision",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"writeDepth",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"transparent",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"enableOffset",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"cullAboveGround",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"snowCover",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasColorTextureTransform",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasEmissionTextureTransform",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasNormalTextureTransform",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasOcclusionTextureTransform",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Cr._)([(0,Rr.o)({constValue:!0})],Mr.prototype,"hasVvInstancing",void 0),(0,Cr._)([(0,Rr.o)({constValue:!1})],Mr.prototype,"useCustomDTRExponentForWater",void 0),(0,Cr._)([(0,Rr.o)({constValue:!1})],Mr.prototype,"supportsTextureAtlas",void 0),(0,Cr._)([(0,Rr.o)({constValue:!0})],Mr.prototype,"useFillLights",void 0);var Or=r(41846);class Nr extends wr{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=rt.h.Attribute,t.doubleSidedMode=it.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,Nr.shader)}}Nr.shader=new gr(Or.R,(()=>r.e(8096).then(r.bind(r,38096))));class Pr extends nt.F5{constructor(e){super(e,Dr),this.supportsEdges=!0,this._configuration=new Mr,this._vertexBufferLayout=function(e){const t=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId,r=(0,et.U$)().vec3f(X.T.POSITION).vec3f(X.T.NORMAL);return e.hasVertexTangents&&r.vec4f(X.T.TANGENT),t&&r.vec2f(X.T.UV0),e.hasVertexColors&&r.vec4u8(X.T.COLOR),e.hasSymbolColors&&r.vec4u8(X.T.SYMBOLCOLOR),(0,fe.Z)("enable-feature:objectAndLayerId-rendering")&&r.vec4u8(X.T.OBJECTANDLAYERIDCOLOR),r}(this.parameters),this._instanceBufferLayout=e.instanced?function(e){let t=(0,et.U$)();return t=e.instancedDoublePrecision?t.vec3f(X.T.MODELORIGINHI).vec3f(X.T.MODELORIGINLO).mat3f(X.T.MODEL).mat3f(X.T.MODELNORMAL):t.mat4f(X.T.MODEL).mat4f(X.T.MODELNORMAL),(0,o.pC)(e.instanced)&&e.instanced.includes("color")&&(t=t.vec4f(X.T.INSTANCECOLOR)),(0,o.pC)(e.instanced)&&e.instanced.includes("featureAttribute")&&(t=t.vec4f(X.T.INSTANCEFEATUREATTRIBUTE)),(0,o.pC)(e.instanced)&&e.instanced.includes("objectAndLayerIdColor")&&(t=t.vec4u8(X.T.OBJECTANDLAYERIDCOLOR_INSTANCED)),t}(this.parameters):null}isVisibleForOutput(e){return e!==tt.H.Shadow&&e!==tt.H.ShadowExludeHighlight&&e!==tt.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{instanced:t,hasVertexColors:r,hasSymbolColors:i,vvColorEnabled:a}=e,n=(0,o.pC)(t)&&t.includes("color"),s="replace"===e.colorMixMode,l=e.opacity>0,c=e.externalColor&&e.externalColor[3]>0;return r&&(n||a||i)?!!s||l:r?s?c:l:n||a||i?!!s||l:s?c:l}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.instanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.hasVerticalOffset=(0,o.pC)(this.parameters.verticalOffset),this._configuration.hasScreenSizePerspective=(0,o.pC)(this.parameters.screenSizePerspective),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType="screenDerivative"===this.parameters.normals?rt.h.ScreenDerivative:rt.h.Attribute,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,(0,o.pC)(this.parameters.customDepthTest)&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?O.Vr.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=(0,o.pC)(this.parameters.modelTransformation),e!==tt.H.Color&&e!==tt.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=it.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?it.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?it.q.WindingOrder:it.q.None,this._configuration.instancedColor=(0,o.pC)(this.parameters.instanced)&&this.parameters.instanced.includes("color"),this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.ready&&this.parameters.receiveSSAO,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?ot.f7.Schematic:ot.f7.Normal:ot.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(0,o.pC)(e.weather)&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,a,n,s){if((0,o.pC)(this.parameters.verticalOffset)){const e=i.camera;(0,c.s)(Vr,r[12],r[13],r[14]);let t=null;switch(i.viewingMode){case Qe.JY.Global:t=(0,c.n)(Ur,Vr);break;case Qe.JY.Local:t=(0,c.c)(Ur,Br)}let o=0;const s=(0,c.b)(Gr,Vr,e.eye),l=(0,c.l)(s),d=(0,c.g)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,c.e)(t,d)),o+=(0,ur.Hx)(e,l,this.parameters.verticalOffset,u,this.parameters.screenSizePerspective),(0,c.g)(t,t,o),(0,c.t)(zr,t,i.transform.inverseRotation),a=(0,c.b)(Fr,a,zr),n=(0,c.b)(Hr,n,zr)}var l;(0,ur.Bw)(e,t,i,a,n,(l=i.verticalOffset,(0,o.pC)(l)?(rr.offset=l,rr):null),s)}requiresSlot(e,t){return!(t!==tt.H.Color&&t!==tt.H.Alpha&&t!==tt.H.Depth&&t!==tt.H.Normal&&t!==tt.H.Shadow&&t!==tt.H.ShadowHighlight&&t!==tt.H.ShadowExludeHighlight&&t!==tt.H.Highlight&&t!==tt.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?Xt.TRANSPARENT_MATERIAL:Xt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Xt.OPAQUE_MATERIAL)&&e!==Xt.DRAPED_MATERIAL&&t!==tt.H.ObjectAndLayerIdColor)}createGLMaterial(e){return new Ir(e)}createBufferWriter(){return new Lr(this._vertexBufferLayout,this._instanceBufferLayout)}}class Ir extends at.F{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,c.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?Nr:wr,e)}_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){return this._output!==tt.H.Color&&this._output!==tt.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this._updateParameters(e)}}const Dr=new class extends Er{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}};class Lr{constructor(e,t){this.vertexBufferLayout=e,this.instanceBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(X.T.POSITION).length}write(e,t,r,i){!function(e,t,r,i,a,n){for(const s of t.fieldNames){const t=e.vertexAttributes.get(s),l=e.indices.get(s);if(t&&l)switch(s){case X.T.POSITION:{(0,P.hu)(3===t.size);const e=a.getField(s,h.ct);e&&nr(l,t.data,r,e,n);break}case X.T.NORMAL:{(0,P.hu)(3===t.size);const e=a.getField(s,h.ct);e&&sr(l,t.data,i,e,n);break}case X.T.UV0:{(0,P.hu)(2===t.size);const e=a.getField(s,h.Eu);e&&or(l,t.data,e,n);break}case X.T.COLOR:{(0,P.hu)(3===t.size||4===t.size);const e=a.getField(s,h.mc);e&&cr(l,t.data,t.size,e,n);break}case X.T.SYMBOLCOLOR:{(0,P.hu)(3===t.size||4===t.size);const e=a.getField(s,h.mc);e&&cr(l,t.data,t.size,e,n);break}case X.T.TANGENT:{(0,P.hu)(4===t.size);const e=a.getField(s,h.ek);e&&lr(l,t.data,i,e,n);break}}else if(s===X.T.OBJECTANDLAYERIDCOLOR&&(0,o.pC)(e.objectAndLayerIdColor)&&4===e.objectAndLayerIdColor.length){const t=e.indices.get(X.T.POSITION);if(t){const r=t.length,i=a.getField(s,h.mc);dr(e.objectAndLayerIdColor,i,r,n)}}}}(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,i)}}const Fr=(0,d.c)(),Hr=(0,d.c)(),Br=(0,d.f)(0,0,1),Ur=(0,d.c)(),zr=(0,d.c)(),Vr=(0,d.c)(),Gr=(0,d.c)(),Wr=C.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function kr(e){throw new S.Z("",`Request for object resource failed: ${e}`)}function $r(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Wr.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&&(Wr.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Wr.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Wr.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Wr.warn("Indexed geometries must specify faces"),i=!1;break}default:Wr.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Wr.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Wr.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function qr(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;(0,o.pC)(r)&&((0,u.pp)(t,r.getBBMin()),(0,u.pp)(t,r.getBBMax()))})),t}function Xr(e){switch(e){case"mask":return O.JJ.Mask;case"maskAndTransparency":return O.JJ.MaskBlend;case"none":return O.JJ.Opaque;default:return O.JJ.Blend}}function jr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Jr=new y.G(1,2,"wosr");var Yr=r(57758),Zr=r(10816),Kr=r(75488),Qr=r(56067);async function ei(e,t){const r=ti((0,i.pJ)(e));if("wosr"===r.fileType){const e=function(e,t){const r=[],i=[],a=[],n=[],s=e.resource,l=y.G.parse(s.version||"1.0","wosr");Jr.validate(l);const c=s.model.name,u=s.model.geometries,h=s.materialDefinitions,f=e.textures;let m=0;const p=new Map;for(let e=0;e<u.length;e++){const s=u[e];if(!$r(s))continue;const l=jr(s),c=s.params.vertexAttributes,g=[];for(const e in c){const t=c[e],r=t.values;g.push([e,{data:r,size:t.valuesPerElement,exclusive:!0}])}const _=[];if("PerAttributeArray"!==s.params.topology){const e=s.params.faces;for(const t in e)_.push([t,e[t].values])}const v=f&&f[l.texture];if(v&&!p.has(l.texture)){const{image:e,params:t}=v,r=new Ke(e,t);n.push(r),p.set(l.texture,r)}const x=p.get(l.texture),T=x?x.id:void 0;let b=a[l.material]?a[l.material][l.texture]:null;if(!b){const e=h[l.material.substring(l.material.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=v&&v.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,n=v?Xr(v.alphaChannelUsage):void 0,s={ambient:(0,d.d)(e.diffuse),diffuse:(0,d.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:n,textureAlphaCutoff:.33,textureId:T,initTextureTransparent:!0,doubleSided:!0,cullFace:O.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!v&&!!v.params.preMultiplyAlpha};(0,o.pC)(t)&&t.materialParamsMixin&&Object.assign(s,t.materialParamsMixin),b=new Pr(s),a[l.material]||(a[l.material]={}),a[l.material][l.texture]=b}i.push(b);const A=new j(g,_);m+=_.position?_.position.length:0,r.push(A)}return{name:c,stageResources:{textures:n,materials:i,geometries:r},pivotOffset:s.model.pivotOffset,boundingBox:qr(r),numberOfVertices:m,lodThreshold:null}}(await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=(0,o.pC)(t)&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,E.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,R.r9)(i.error),kr(i.error.details.url)}(e,r,t);const i=await(0,E.q6)((0,A.default)(e,(0,o.Wg)(t)));if(!0===i.ok)return i.value.data;(0,R.r9)(i.error),kr(i.error)}(e,t),i=await async function(e,t){const r=[];for(const i in e){const a=e[i],n=a.images[0].data;if(!n){Wr.warn("Externally referenced texture data is not yet supported");continue}const s=a.encoding+";base64,"+n,l="/textureDefinitions/"+i,c="rgba"===a.channels?a.alphaChannelUsage||"transparency":"none",d={noUnpackFlip:!0,wrap:{s:ue.e8.REPEAT,t:ue.e8.REPEAT},preMultiplyAlpha:Xr(c)!==O.JJ.Opaque},u=(0,o.pC)(t)&&t.disableTextures?Promise.resolve(null):M(s,t);r.push(u.then((e=>({refId:l,image:e,params:d,alphaChannelUsage:c}))))}const i=await Promise.all(r),a={};for(const e of i)a[e.refId]=e;return a}(r.textureDefinitions,t);let a=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];a+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:a+(0,w.Ul)(r)}}(r.url,t)),t);return{lods:[e],referenceBoundingBox:e.boundingBox,isEsriSymbolResource:!1,isWosr:!0}}const a=await(t.cache?t.cache.loadGLTF(r.url,t,t.usePBR):(0,_.z)(new g.C(t.streamDataRequester),r.url,t,t.usePBR)),n=(0,o.U2)(a.model.meta,"ESRI_proxyEllipsoid"),u=a.meta.isEsriSymbolResource&&(0,o.pC)(n)&&a.meta.uri.includes("/RealisticTrees/");u&&!a.customMeta.esriTreeRendering&&(a.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const a of i.parts){const i=a.attributes.normal;if((0,o.Wi)(i))return;const n=a.attributes.position,u=n.count,f=(0,d.c)(),m=(0,d.c)(),g=(0,d.c)(),_=(0,p.gS)(h.mc,u),v=(0,p.gS)(h.ct,u),x=(0,s.a)((0,l.c)(),a.transform);for(let o=0;o<u;o++){n.getVec(o,m),i.getVec(o,f),(0,c.m)(m,m,a.transform),(0,c.b)(g,m,t.center),(0,c.C)(g,g,t.radius);const s=g[2],l=(0,c.l)(g),d=Math.min(.45+.55*l*l,1);(0,c.C)(g,g,t.radius),(0,c.m)(g,g,x),(0,c.n)(g,g),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.h)(g,g,f,s>-1?.2:Math.min(-4*s-3.8,1)),v.setVec(o,g),_.set(o,0,255*d),_.set(o,1,255*d),_.set(o,2,255*d),_.set(o,3,255)}a.attributes.normal=v,a.attributes.color=_}}}(a,n));const f=a.meta.isEsriSymbolResource?{usePBR:t.usePBR,isSchematic:!1,treeRendering:u,mrrFactors:[0,1,.2]}:{usePBR:t.usePBR,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},m={...t.materialParamsMixin,treeRendering:u};if(null!=r.specifiedLodIndex){const e=ri(a,f,m,r.specifiedLodIndex);let t=e[0].boundingBox;return 0!==r.specifiedLodIndex&&(t=ri(a,f,m,0)[0].boundingBox),{lods:e,referenceBoundingBox:t,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}const v=ri(a,f,m);return{lods:v,referenceBoundingBox:v[0].boundingBox,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}function ti(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}}function ri(e,t,r,i){const s=e.model,l=(0,n.c)(),c=new Array,d=new Map,g=new Map;return s.lods.forEach(((e,n)=>{if(void 0!==i&&n!==i)return;const _={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:(0,o.pC)(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:(0,u.cS)()};c.push(_),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),n=s.materials.get(e.material),c=(0,o.pC)(e.attributes.texCoord0),x=(0,o.pC)(e.attributes.normal),T=function(e){switch(e){case"BLEND":return O.JJ.Blend;case"MASK":return O.JJ.Mask;case"OPAQUE":case null:case void 0:return O.JJ.Opaque}}(n.alphaMode);if(!d.has(i)){if(c){if((0,o.pC)(n.textureColor)&&!g.has(n.textureColor)){const e=s.textures.get(n.textureColor),t={...e.parameters,preMultiplyAlpha:T!==O.JJ.Opaque};g.set(n.textureColor,new Ke(e.data,t))}if((0,o.pC)(n.textureNormal)&&!g.has(n.textureNormal)){const e=s.textures.get(n.textureNormal);g.set(n.textureNormal,new Ke(e.data,e.parameters))}if((0,o.pC)(n.textureOcclusion)&&!g.has(n.textureOcclusion)){const e=s.textures.get(n.textureOcclusion);g.set(n.textureOcclusion,new Ke(e.data,e.parameters))}if((0,o.pC)(n.textureEmissive)&&!g.has(n.textureEmissive)){const e=s.textures.get(n.textureEmissive);g.set(n.textureEmissive,new Ke(e.data,e.parameters))}if((0,o.pC)(n.textureMetallicRoughness)&&!g.has(n.textureMetallicRoughness)){const e=s.textures.get(n.textureMetallicRoughness);g.set(n.textureMetallicRoughness,new Ke(e.data,e.parameters))}}const a=n.color[0]**(1/Yr.K),l=n.color[1]**(1/Yr.K),u=n.color[2]**(1/Yr.K),h=n.emissiveFactor[0]**(1/Yr.K),f=n.emissiveFactor[1]**(1/Yr.K),m=n.emissiveFactor[2]**(1/Yr.K),p=(0,o.pC)(n.textureColor)&&c?g.get(n.textureColor):null;d.set(i,new Pr({...t,transparent:T===O.JJ.Blend,customDepthTest:O.Gv.Lequal,textureAlphaMode:T,textureAlphaCutoff:n.alphaCutoff,diffuse:[a,l,u],ambient:[a,l,u],opacity:n.opacity,doubleSided:n.doubleSided,doubleSidedType:"winding-order",cullFace:n.doubleSided?O.Vr.None:O.Vr.Back,hasVertexColors:!!e.attributes.color,hasVertexTangents:!!e.attributes.tangent,normals:x?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:(0,o.pC)(p)?p.id:void 0,colorMixMode:n.colorMixMode,normalTextureId:(0,o.pC)(n.textureNormal)&&c?g.get(n.textureNormal).id:void 0,textureAlphaPremultiplied:(0,o.pC)(p)&&!!p.params.preMultiplyAlpha,occlusionTextureId:(0,o.pC)(n.textureOcclusion)&&c?g.get(n.textureOcclusion).id:void 0,emissiveTextureId:(0,o.pC)(n.textureEmissive)&&c?g.get(n.textureEmissive).id:void 0,metallicRoughnessTextureId:(0,o.pC)(n.textureMetallicRoughness)&&c?g.get(n.textureMetallicRoughness).id:void 0,emissiveFactor:[h,f,m],mrrFactors:[n.metallicFactor,n.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:b(n.colorTextureTransform),normalTextureTransformMatrix:b(n.normalTextureTransform),occlusionTextureTransformMatrix:b(n.occlusionTextureTransform),emissiveTextureTransformMatrix:b(n.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:b(n.metallicRoughnessTextureTransform),...r}))}const A=function(e,t){switch(t){case ue.MX.TRIANGLES:return(0,v.nh)(e);case ue.MX.TRIANGLE_STRIP:return(0,v.DA)(e);case ue.MX.TRIANGLE_FAN:return(0,v.jX)(e)}}(e.indices||e.attributes.position.count,e.primitiveType),E=e.attributes.position.count,w=(0,p.gS)(h.ct,E);(0,f.t)(w,e.attributes.position,e.transform);const S=[[X.T.POSITION,{data:w.typedBuffer,size:w.elementCount,exclusive:!0}]],C=[[X.T.POSITION,A]];if((0,o.pC)(e.attributes.normal)){const t=(0,p.gS)(h.ct,E);(0,a.b)(l,e.transform),(0,f.a)(t,e.attributes.normal,l),S.push([X.T.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),C.push([X.T.NORMAL,A])}if((0,o.pC)(e.attributes.tangent)){const t=(0,p.gS)(h.ek,E);(0,a.b)(l,e.transform),(0,m.t)(t,e.attributes.tangent,l),S.push([X.T.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),C.push([X.T.TANGENT,A])}if((0,o.pC)(e.attributes.texCoord0)){const t=(0,p.gS)(h.Eu,E);(0,Zr.n)(t,e.attributes.texCoord0),S.push([X.T.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),C.push([X.T.UV0,A])}if((0,o.pC)(e.attributes.color)){const t=(0,p.gS)(h.mc,E);if(4===e.attributes.color.elementCount)e.attributes.color instanceof h.ek?(0,m.s)(t,e.attributes.color,255):e.attributes.color instanceof h.mc?(0,Kr.c)(t,e.attributes.color):e.attributes.color instanceof h.v6&&(0,m.s)(t,e.attributes.color,1/256);else{(0,Kr.f)(t,255,255,255,255);const r=new h.ne(t.buffer,0,4);e.attributes.color instanceof h.ct?(0,f.s)(r,e.attributes.color,255):e.attributes.color instanceof h.ne?(0,Qr.c)(r,e.attributes.color):e.attributes.color instanceof h.mw&&(0,f.s)(r,e.attributes.color,1/256)}S.push([X.T.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),C.push([X.T.COLOR,A])}const R=new j(S,C);_.stageResources.geometries.push(R),_.stageResources.materials.push(d.get(i)),c&&((0,o.pC)(n.textureColor)&&_.stageResources.textures.push(g.get(n.textureColor)),(0,o.pC)(n.textureNormal)&&_.stageResources.textures.push(g.get(n.textureNormal)),(0,o.pC)(n.textureOcclusion)&&_.stageResources.textures.push(g.get(n.textureOcclusion)),(0,o.pC)(n.textureEmissive)&&_.stageResources.textures.push(g.get(n.textureEmissive)),(0,o.pC)(n.textureMetallicRoughness)&&_.stageResources.textures.push(g.get(n.textureMetallicRoughness))),_.numberOfVertices+=E;const y=R.boundingInfo;(0,o.pC)(y)&&((0,u.pp)(_.boundingBox,y.getBBMin()),(0,u.pp)(_.boundingBox,y.getBBMax()))}))})),c}},65576:(e,t,r)=>{r.d(t,{U$:()=>s});var i=r(56481),o=r(79583);class a{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fieldNames){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new a(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t,r,i){const o=this.stride;if(o%4==0){const a=new Uint32Array(e.buffer,t*o,i*o/4);new Uint32Array(this.buffer,r*o,i*o/4).set(a)}else{const a=new Uint8Array(e.buffer,t*o,i*o);new Uint8Array(this.buffer,r*o,i*o).set(a)}}}class n{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,t){return this._appendField(e,i.Eu,t),this}vec2f64(e,t){return this._appendField(e,i.q6,t),this}vec3f(e,t){return this._appendField(e,i.ct,t),this}vec3f64(e,t){return this._appendField(e,i.fP,t),this}vec4f(e,t){return this._appendField(e,i.ek,t),this}vec4f64(e,t){return this._appendField(e,i.Cd,t),this}mat3f(e,t){return this._appendField(e,i.gK,t),this}mat3f64(e,t){return this._appendField(e,i.ey,t),this}mat4f(e,t){return this._appendField(e,i.bj,t),this}mat4f64(e,t){return this._appendField(e,i.O1,t),this}vec4u8(e,t){return this._appendField(e,i.mc,t),this}f32(e,t){return this._appendField(e,i.ly,t),this}f64(e,t){return this._appendField(e,i.oS,t),this}u8(e,t){return this._appendField(e,i.D_,t),this}u16(e,t){return this._appendField(e,i.av,t),this}i8(e,t){return this._appendField(e,i.Hz,t),this}vec2i8(e,t){return this._appendField(e,i.Vs,t),this}vec2i16(e,t){return this._appendField(e,i.or,t),this}vec2u8(e,t){return this._appendField(e,i.xA,t),this}vec4u16(e,t){return this._appendField(e,i.v6,t),this}u32(e,t){return this._appendField(e,i.Nu,t),this}_appendField(e,t,r){const i=t.ElementCount*(0,o.n1)(t.ElementType),a=this.stride;this.fields.set(e,{size:i,constructor:t,offset:a,optional:r}),this.stride+=i,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.includes(e)}createBuffer(e){return new a(this,e)}createView(e){return new a(this,e)}clone(){const e=new n;return e.stride=this.stride,e.fields=new Map,this.fields.forEach(((t,r)=>e.fields.set(r,t))),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}}function s(){return new n}},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>d});var i=r(55039),o=r(2095),a=r(19693),n=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new a.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
181
+ }`),e}},Symbol.toStringTag,{value:"Module"}));var le=r(99880);let ce;var de;!function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"}(de||(de={}));var ue=r(35371),he=r(75656),fe=r(80442);function me(e,t,r,i,o=0){const a=e.gl,n=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);void 0===r&&console.error(`There is no location for vertex attribute '${e.name}' defined.`);const i=o*e.stride;if(e.count<=4)a.vertexAttribPointer(r,e.count,e.type,e.normalized,e.stride,e.offset+i),a.enableVertexAttribArray(r),e.divisor>0&&n&&n.vertexAttribDivisor(r,e.divisor);else if(9===e.count)for(let t=0;t<3;t++)a.vertexAttribPointer(r+t,3,e.type,e.normalized,e.stride,e.offset+12*t+i),a.enableVertexAttribArray(r+t),e.divisor>0&&n&&n.vertexAttribDivisor(r+t,e.divisor);else if(16===e.count)for(let t=0;t<4;t++)a.vertexAttribPointer(r+t,4,e.type,e.normalized,e.stride,e.offset+16*t+i),a.enableVertexAttribArray(r+t),e.divisor>0&&n&&n.vertexAttribDivisor(r+t,e.divisor);else console.error("Unsupported vertex attribute element count: "+e.count)}}function pe(e,t,r,i){const o=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);if(e.count<=4)o.disableVertexAttribArray(r),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r,0);else if(9===e.count)for(let t=0;t<3;t++)o.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r+t,0);else if(16===e.count)for(let t=0;t<4;t++)o.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r+t,0);else console.error("Unsupported vertex attribute element count: "+e.count)}e.unbindBuffer(ue.w0.ARRAY_BUFFER)}function ge(e){switch(e){case ue.VI.ALPHA:case ue.VI.LUMINANCE:case ue.VI.RED:case ue.VI.RED_INTEGER:case ue.lP.R8:case ue.lP.R8I:case ue.lP.R8UI:case ue.lP.R8_SNORM:case ue.Tg.STENCIL_INDEX8:return 1;case ue.VI.LUMINANCE_ALPHA:case ue.VI.RG:case ue.VI.RG_INTEGER:case ue.lP.RGBA4:case ue.lP.R16F:case ue.lP.R16I:case ue.lP.R16UI:case ue.lP.RG8:case ue.lP.RG8I:case ue.lP.RG8UI:case ue.lP.RG8_SNORM:case ue.lP.RGB565:case ue.lP.RGB5_A1:case ue.Tg.DEPTH_COMPONENT16:return 2;case ue.VI.DEPTH_COMPONENT:case ue.VI.RGB:case ue.VI.RGB_INTEGER:case ue.lP.RGB8:case ue.lP.RGB8I:case ue.lP.RGB8UI:case ue.lP.RGB8_SNORM:case ue.lP.SRGB8:case ue.Tg.DEPTH_COMPONENT24:return 3;case ue.VI.DEPTH_STENCIL:case ue.VI.RGBA:case ue.VI.RGBA_INTEGER:case ue.lP.RGBA8:case ue.lP.R32F:case ue.lP.R11F_G11F_B10F:case ue.lP.RG16F:case ue.lP.R32I:case ue.lP.R32UI:case ue.lP.RG16I:case ue.lP.RG16UI:case ue.lP.RGBA8I:case ue.lP.RGBA8UI:case ue.lP.RGBA8_SNORM:case ue.lP.SRGB8_ALPHA8:case ue.lP.RGB9_E5:case ue.lP.RGB10_A2UI:case ue.lP.RGB10_A2:case ue.Tg.DEPTH_STENCIL:case ue.Tg.DEPTH_COMPONENT32F:case ue.Tg.DEPTH24_STENCIL8:return 4;case ue.Tg.DEPTH32F_STENCIL8:return 5;case ue.lP.RGB16F:case ue.lP.RGB16I:case ue.lP.RGB16UI:return 6;case ue.lP.RG32F:case ue.lP.RG32I:case ue.lP.RG32UI:case ue.lP.RGBA16F:case ue.lP.RGBA16I:case ue.lP.RGBA16UI:return 8;case ue.lP.RGB32F:case ue.lP.RGB32I:case ue.lP.RGB32UI:return 12;case ue.lP.RGBA32F:case ue.lP.RGBA32I:case ue.lP.RGBA32UI:return 16;case ue.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case ue.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case ue.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case ue.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case ue.q_.COMPRESSED_R11_EAC:case ue.q_.COMPRESSED_SIGNED_R11_EAC:case ue.q_.COMPRESSED_RGB8_ETC2:case ue.q_.COMPRESSED_SRGB8_ETC2:case ue.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case ue.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case ue.q_.COMPRESSED_RG11_EAC:case ue.q_.COMPRESSED_SIGNED_RG11_EAC:case ue.q_.COMPRESSED_RGBA8_ETC2_EAC:case ue.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function _e(e){if((0,o.Wi)(e))return 0;if("descriptor"in e)return e.glName?_e(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return ge(t)*i*r}let ve=null,xe=null;async function Te(){return(0,o.Wi)(xe)&&(xe=function(){if((0,o.Wi)(ce)){const e=e=>(0,le.V)(`esri/libs/basisu/${e}`);ce=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 ce}(),ve=await xe),xe}function be(e,t,r,i,o){const a=ge(t?ue.q_.COMPRESSED_RGBA8_ETC2_EAC:ue.q_.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function Ae(e){return e.getNumImages()>=1&&!e.isUASTC()}function Ee(e){return e.getFaces()>=1&&e.isETC1S()}function we(e,t,r,i,o,a,n,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[de.ETC2_RGBA,ue.q_.COMPRESSED_RGBA8_ETC2_EAC]:[de.ETC1_RGB,ue.q_.COMPRESSED_RGB8_ETC2]:c?i?[de.BC3_RGBA,ue.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[de.BC1_RGB,ue.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[de.RGBA32,ue.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(n(e,d))),s(e,d,f[e]);const m=f.length>1,p=m?ue.cw.LINEAR_MIPMAP_LINEAR:ue.cw.LINEAR,g={...t,samplingMode:p,hasMipmap:m,internalFormat:u,width:o,height:a};return new he.x(e,g,{type:"compressed",levels:f})}const Se=C.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Ce(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Re=Ce("DXT1"),ye=Ce("DXT3"),Me=Ce("DXT5");var Oe=r(83475),Ne=r(21968);new Ne.G(X.T.POSITION,3,ue.g.FLOAT,0,12),new Ne.G(X.T.POSITION,3,ue.g.FLOAT,0,20),new Ne.G(X.T.UV0,2,ue.g.FLOAT,12,20),new Ne.G(X.T.POSITION,3,ue.g.FLOAT,0,32),new Ne.G(X.T.NORMAL,3,ue.g.FLOAT,12,32),new Ne.G(X.T.UV0,2,ue.g.FLOAT,24,32),new Ne.G(X.T.POSITION,3,ue.g.FLOAT,0,16),new Ne.G(X.T.COLOR,4,ue.g.UNSIGNED_BYTE,12,16);const Pe=[new Ne.G(X.T.POSITION,2,ue.g.FLOAT,0,8)],Ie=[new Ne.G(X.T.POSITION,2,ue.g.FLOAT,0,16),new Ne.G(X.T.UV0,2,ue.g.FLOAT,8,16)],De=C.Z.getLogger("esri.views.webgl.VertexArrayObject");class Le extends class{constructor(e,t,r,i,o=null){this._context=e,this._locations=t,this._layout=r,this._buffers=i,this._indexBuffer=o,this._glName=null,this._initialized=!1,e.instanceCounter.increment(ue._g.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((e,t)=>e+this._buffers[t].size),(0,o.pC)(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(this._context){if(this._glName){const e=this._context?.capabilities?.vao;e?(e.deleteVertexArray(this._glName),this._glName=null):De.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const e in this._buffers)this._buffers[e]?.dispose(),delete this._buffers[e];this._indexBuffer=(0,o.M2)(this._indexBuffer)}this._context.instanceCounter.decrement(ue._g.VertexArrayObject,this),this._context=(0,o.wN)(this._context)}else(this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&De.warn("Leaked WebGL VAO")}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||De.error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const r in e){const i=e[r];i||De.error("Vertex buffer is uninitialized!");const o=t[r];o||De.error("Vertex element descriptor is empty!"),me(this._context,this._locations,i,o)}(0,o.pC)(r)&&(this._context.capabilities.vao?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:t}=this;e||De.error("Vertex buffer dictionary is empty!");for(const r in e){const i=e[r];i||De.error("Vertex buffer is uninitialized!");const o=t[r];pe(this._context,this._locations,i,o)}(0,o.pC)(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}{}var Fe=r(67676),He=r(49300),Be=r(54738);const Ue=C.Z.getLogger("esri.views.webgl.BufferObject");class ze{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(ue._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,He.zu)(this._context.gl),i&&this.setData(i)}static createIndex(e,t,r){return new ze(e,ue.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new ze(e,ue.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==Be.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new ze(e,ue.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=ue.l1.STREAM_READ,r){if(e.type!==Be.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new ze(e,ue.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=ue.l1.STREAM_DRAW,r){if(e.type!==Be.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new ze(e,ue.w0.PIXEL_UNPACK_BUFFER,t,r)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===ue.w0.ELEMENT_ARRAY_BUFFER?this._indexType===ue.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===ue.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===ue.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(ue._g.BufferObject,this),this._context=(0,o.wN)(this._context)):this._glName&&Ue.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&Ue.error("Buffer size needs to be positive!"),this.bufferType===ue.w0.ELEMENT_ARRAY_BUFFER&&(0,o.pC)(t))switch(this._indexType=t,t){case ue.g.UNSIGNED_SHORT:e*=2;break;case ue.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===ue.w0.ELEMENT_ARRAY_BUFFER&&((0,K.Uc)(e)&&(t/=2,this._indexType=ue.g.UNSIGNED_SHORT),(0,K.ZY)(e)&&(t/=4,this._indexType=ue.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;(0,o.pC)(t)?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,He.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t=0,r=0,i=e.byteLength){if(!e)return;(t<0||t>=this._size)&&Ue.error("offset is out of range!");let o=t,a=r,n=i,s=e.byteLength;this.bufferType===ue.w0.ELEMENT_ARRAY_BUFFER&&((0,K.Uc)(e)?(s/=2,o*=2,a*=2,n*=2):(0,K.ZY)(e)&&(s/=4,o*=4,a*=4,n*=4)),void 0===i&&(i=s-1),r>=i&&Ue.error("end must be bigger than start!"),t+r-i>this._size&&Ue.error("An attempt to write beyond the end of the buffer!");const l=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const c=this._context.gl,d=ArrayBuffer.isView(e)?e.buffer:e,u=0===a&&n===e.byteLength?d:d.slice(a,n);c.bufferSubData(this.bufferType,o,u),(0,He.zu)(c),this._isVAOAware&&this._context.bindVAO(l)}setSubDataFromView(e,t,r,i){if(!e)return;(t<0||t>=this._size)&&Ue.error("offset is out of range!"),r>=i&&Ue.error("end must be bigger than start!"),t+r-i>this._size&&Ue.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 a=this._context.gl;if(this._context.type===Be.zO.WEBGL2)a.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);a.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,He.zu)(a),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==Be.zO.WEBGL2)return void Ue.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void Ue.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,Fe.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void Ue.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteSize&&Ue.warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;this._context.bindBuffer(this,ue.w0.COPY_READ_BUFFER),a.getBufferSubData(ue.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(ue.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===Be.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):Ue.error("Get buffer subdata is supported in WebGL2 only!")}}class Ve{constructor(e,t){this._context=e,this._desc=t,this.type="renderbuffer",this._context.instanceCounter.increment(ue._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:a,multisampled:n}=t;if(n){if(this._context.type!==Be.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,a,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,a,i,o)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}resize(e,t){const r=this._desc;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(ue._g.Renderbuffer,this),this._context=(0,o.wN)(this._context))}}class Ge{constructor(e,t,r=null,i=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._depthStencilTexture=null,this._initialized=!1,this._desc={...t},e.instanceCounter.increment(ue._g.FramebufferObject,this),(0,o.pC)(r)){Array.isArray(r)||(r=[r]);for(let e=0;e<r.length;++e){const t=r[e],i=ue.VY.COLOR_ATTACHMENT0+e;let o;$e(t)?(We(t)?(o=t.descriptor,this._colorAttachments.set(i,t)):(o=t,this._colorAttachments.set(i,new he.x(this._context,o))),qe(o,this._desc)):(ke(t)?(o=t.descriptor,this._colorAttachments.set(i,t)):(o=t,this._colorAttachments.set(i,new Ve(this._context,o))),Xe(o,this._desc)),this._validateColorAttachmentPoint(i)}}if((0,o.pC)(i)){let e,t;if($e(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),We(i)?(t=i.descriptor,this._depthStencilTexture=i):(t=i,this._depthStencilTexture=new he.x(this._context,t)),qe(t,this._desc);else{ke(i)?(t=i.descriptor,e=i):(t=i,e=new Ve(this._context,t));const r=this._desc.depthStencilTarget??ue.OU.DEPTH_STENCIL_RENDER_BUFFER;r===ue.OU.STENCIL_RENDER_BUFFER?this._stencilAttachment=e:r===ue.OU.DEPTH_RENDER_BUFFER||r===ue.OU.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=e:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),this._desc.depthStencilTarget=r,Xe(t,this._desc)}}}dispose(){if(!this._desc)return;const e=this._context.getBoundFramebufferObject();this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(ue._g.FramebufferObject,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const e=this._colorAttachments.get(ue.VY.COLOR_ATTACHMENT0);return e&&We(e)?e:null}get colorAttachment(){return this._colorAttachments.get(ue.VY.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width??0}get height(){return this._desc.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+_e(r)),0)+_e(this.depthStencilAttachment)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&We(t)?t:null}attachColorTexture(e,t=ue.VY.COLOR_ATTACHMENT0){e&&(this._validateColorAttachmentPoint(t),qe(e.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e))}detachColorTexture(e=ue.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(We(t)){const r=t;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}}setColorTextureTarget(e,t=ue.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);We(r)&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencilTexture(e){if((0,o.Wi)(e))return;const t=e.descriptor;t.pixelFormat!==ue.VI.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==ue.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!"),qe(t,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==ue.OU.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=ue.OU.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,ue.Lu)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,ue.Lu)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if((0,o.Wi)(e))return;const t=e.descriptor;if(t.internalFormat!==ue.Tg.DEPTH_STENCIL&&t.internalFormat!==ue.Tg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),Xe(t,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=t.internalFormat===ue.Tg.DEPTH_STENCIL?ue.OU.DEPTH_STENCIL_RENDER_BUFFER:ue.OU.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._desc.depthStencilTarget===ue.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(ue.qi.FRAMEBUFFER,r,t.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===ue.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(ue.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}return this._depthAttachment=null,t}detachAll(){this._colorAttachments.forEach(((e,t)=>this._detachColorAttachment(t))),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,t,r,i,o,a,n){(e<0||t<0||o<0||a<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=this._desc,l=n.descriptor;n.descriptor.target!==ue.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||null==l?.width||null==l?.height||e+r>s.width||t+i>s.height||o+r>l.width||a+i>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,d=c.bindTexture(n,he.x.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(he.x.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(ue.No.TEXTURE_2D,0,o,a,e,t,r,i),c.bindTexture(d,he.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,a,n){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),n||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,a,n)}async readPixelsAsync(e,t,r,i,o,a,n){if(this._context.type!==Be.zO.WEBGL2)return(0,He.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,a,n);const s=this._context.gl,l=ze.createPixelPack(this._context,ue.l1.STREAM_READ,n.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,a,0),this._context.unbindBuffer(ue.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(n),l.dispose()}resize(e,t){const r=this._desc;if(r.width!==e||r.height!==t){if(!this._initialized)return r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,t));r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(e,t):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,t),this._stencilAttachment&&this._stencilAttachment.resize(e,t)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=ue.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=this._context,i=t.createFramebuffer(),o=this._desc,a=o.colorTarget??ue.Lm.RENDER_BUFFER,n=o.width??1,s=o.height??1;if(t.bindFramebuffer(e,i),0===this._colorAttachments.size)if(a===ue.Lm.TEXTURE||a===ue.Lm.CUBEMAP)this._colorAttachments.set(ue.VY.COLOR_ATTACHMENT0,function(e,t,r){return new he.x(e,{target:r,pixelFormat:ue.VI.RGBA,dataType:ue.Br.UNSIGNED_BYTE,samplingMode:ue.cw.NEAREST,wrapMode:ue.e8.CLAMP_TO_EDGE,width:t.width,height:t.height})}(r,o,this.descriptor.colorTarget===ue.Lm.CUBEMAP?ue.No.TEXTURE_CUBE_MAP:ue.No.TEXTURE_2D));else{const e=new Ve(r,{internalFormat:ue.lP.RGBA4,width:n,height:s});this._colorAttachments.set(ue.VY.COLOR_ATTACHMENT0,e)}this._colorAttachments.forEach(((r,i)=>{r&&(We(r)?this._framebufferTexture2D(r.glName,i,je(r),e):t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,r.glName))}));const l=o.depthStencilTarget??ue.OU.NONE;switch(l){case ue.OU.DEPTH_RENDER_BUFFER:case ue.OU.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new Ve(r,{internalFormat:o.depthStencilTarget===ue.OU.DEPTH_RENDER_BUFFER?ue.Tg.DEPTH_COMPONENT16:ue.Tg.DEPTH_STENCIL,width:n,height:s}));const i=l===ue.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,this._depthAttachment.glName);break}case ue.OU.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new Ve(r,{internalFormat:ue.Tg.STENCIL_INDEX8,width:n,height:s})),t.framebufferRenderbuffer(e,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,this._stencilAttachment.glName);break;case ue.OU.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){r.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const e={target:ue.No.TEXTURE_2D,pixelFormat:ue.VI.DEPTH_STENCIL,dataType:ue.Br.UNSIGNED_INT_24_8,samplingMode:ue.cw.NEAREST,wrapMode:ue.e8.CLAMP_TO_EDGE,width:n,height:s};this._depthStencilTexture=new he.x(r,e)}this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,je(this._depthStencilTexture),e)}(0,He.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=i,this._initialized=!0}_framebufferTexture2D(e,t=ue.VY.COLOR_ATTACHMENT0,r=ue.No.TEXTURE_2D,i=ue.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_detachColorAttachment(e){(0,He.hZ)()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const t=this._context.gl,r=this._colorAttachments.get(e);return We(r)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)):this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(ue.qi.FRAMEBUFFER,e,t.RENDERBUFFER,null)),this._colorAttachments.delete(e),r}_disposeColorAttachments(){this._colorAttachments.forEach(((e,t)=>{this._detachColorAttachment(t),e.dispose()})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===ue.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(ue.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(ue.qi.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(-1===Ge._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;Ge._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else Ge._MAX_COLOR_ATTACHMENTS=1}const t=e-ue.VY.COLOR_ATTACHMENT0;t+1>Ge._MAX_COLOR_ATTACHMENTS&&C.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${Ge._MAX_COLOR_ATTACHMENTS} color attachments`)}}function We(e){return null!=e&&"type"in e&&"texture"===e.type}function ke(e){return null!=e&&"type"in e&&"renderbuffer"===e.type}function $e(e){return We(e)||null!=e&&"pixelFormat"in e}function qe(e,t){e.target!==ue.No.TEXTURE_2D&&e.target!==ue.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function Xe(e,t){void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function je(e){return e.descriptor.target===ue.No.TEXTURE_CUBE_MAP?ue.No.TEXTURE_CUBE_MAP_POSITIVE_X:ue.No.TEXTURE_2D}Ge._MAX_COLOR_ATTACHMENTS=-1;var Je,Ye,Ze=r(46314);class Ke extends L.c{constructor(e,t){super(),this._data=e,this.type=F.U.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new Y.Z,this._passParameters=new se,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:ue.e8.REPEAT,t:ue.e8.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||O.CE.STRETCH,this.estimatedTexMemRequired=Ke._estimateTexMemRequired(this._data,this.params),this._startPreload()}_startPreload(){const e=this._data;(0,o.Wi)(e)||(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,Q.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,Q.HK)(e.src)||(0,Q.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if((0,o.Wi)(e))return 0;if((0,K.eP)(e)||(0,K.lq)(e))return t.encoding===Ke.KTX2_ENCODING?function(e,t){if((0,o.Wi)(ve))return e.byteLength;const r=new ve.KTX2File(new Uint8Array(e)),i=Ee(r)?be(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,t.mipmap):t.encoding===Ke.BASIS_ENCODING?function(e,t){if((0,o.Wi)(ve))return e.byteLength;const r=new ve.BasisFile(new Uint8Array(e)),i=Ae(r)?be(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?Ke._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this._data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){return{target:ue.No.TEXTURE_2D,pixelFormat:ue.VI.RGBA,dataType:ue.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?ue.cw.LINEAR_MIPMAP_LINEAR:ue.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:this.params.maxAnisotropy??(this.params.mipmap?e.parameters.maxMaxAnisotropy:1)}}get glTexture(){return this._glTexture}load(e,t){if((0,o.pC)(this._glTexture))return this._glTexture;if((0,o.pC)(this._loadingPromise))return this._loadingPromise;const r=this._data;return(0,o.Wi)(r)?(this._glTexture=new he.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof r?this._loadFromURL(e,t,r):r instanceof Image?this._loadFromImageElement(e,t,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,t,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r,t):((0,K.eP)(r)||(0,K.lq)(r))&&this.params.encoding===Ke.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,r)):((0,K.eP)(r)||(0,K.lq)(r))&&this.params.encoding===Ke.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,r)):((0,K.eP)(r)||(0,K.lq)(r))&&this.params.encoding===Ke.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,r)):(0,K.lq)(r)?this._loadFromPixelData(e,r):(0,K.eP)(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e,t,r){if(!(this._data instanceof HTMLVideoElement)||(0,o.Wi)(this._glTexture))return r;if(this._data.readyState<Je.HAVE_CURRENT_DATA||r===this._data.currentTime)return r;if((0,o.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:r,vao:i,sourceTexture:o}=this._powerOfTwoStretchInfo;o.setData(this._data),this._drawStretchedTexture(e,t,r,i,o,this._glTexture)}else{const{videoWidth:e,videoHeight:t}=this._data,{width:r,height:i}=this._glTexture.descriptor;e!==r||t!==i?this._glTexture.updateData(0,0,0,Math.min(e,r),Math.min(t,i),this._data):this._glTexture.setData(this._data)}return this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.params.updateCallback&&this.params.updateCallback(),this._data.currentTime}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const{textureData:i,internalFormat:a,width:n,height:s}=(0,o.s3)(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,a;switch(i){case Re:o=8,a=ue.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ye:o=16,a=ue.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Me:o=16,a=ue.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 n=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&&(n=Math.max(1,r[7])),1===n||(0,Z.wt)(s)&&(0,Z.wt)(l)||(Se.warn("Ignoring mipmaps of non power of two sized compressed texture."),n=1);let f=r[1]+4;const m=[];for(let t=0;t<n;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,f,h),m.push(u),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:a,width:c,height:d}}(r,t.hasMipmap??!1));return t.samplingMode=i.levels.length>1?ue.cw.LINEAR_MIPMAP_LINEAR:ue.cw.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=a,t.width=n,t.height=s,new he.x(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){(0,o.Wi)(ve)&&(ve=await Te());const i=new ve.KTX2File(new Uint8Array(r));if(!Ee(i))return null;i.startTranscoding();const a=we(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(),a}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){(0,o.Wi)(ve)&&(ve=await Te());const i=new ve.BasisFile(new Uint8Array(r));if(!Ae(i))return null;i.startTranscoding();const a=we(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(),a}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,P.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?ue.VI.LUMINANCE:3===this.params.components?ue.VI.RGB:ue.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new he.x(e,r,t),this._glTexture}_loadFromURL(e,t,r){return this._loadAsync((async i=>{const o=await M(r,{signal:i});return(0,R.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromImageElement(e,t,r){return r.complete?this._loadFromImage(e,r,t):this._loadAsync((async i=>{const o=await(0,ee.fY)(r,r.src,!1,i);return(0,R.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromVideoElement(e,t,r){return r.readyState>=Je.HAVE_CURRENT_DATA?this._loadFromImage(e,r,t):this._loadFromVideoElementAsync(e,t,r)}_loadFromVideoElementAsync(e,t,r){return this._loadAsync((i=>new Promise(((a,n)=>{const s=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),(0,o.hw)(d)},l=()=>{r.readyState>=Je.HAVE_CURRENT_DATA&&(s(),a(this._loadFromImage(e,r,t)))},c=e=>{s(),n(e||new S.Z("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const d=(0,R.fu)(i,(()=>c((0,R.zE)())))}))))}_loadFromImage(e,t,r){const i=Ke._getDataDimensions(t);this.params.width=i.width,this.params.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this.params.components?ue.VI.RGB:ue.VI.RGBA,!this._requiresPowerOfTwo(e,o)||(0,Z.wt)(i.width)&&(0,Z.wt)(i.height)?(o.width=i.width,o.height=i.height,this._glTexture=new he.x(e,o,t),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(e,t,i,o,r),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}_requiresPowerOfTwo(e,t){const r=ue.e8.CLAMP_TO_EDGE,i="number"==typeof t.wrapMode?t.wrapMode===r:t.wrapMode.s===r&&t.wrapMode.t===r;return!(0,Ze.Z)(e.gl)&&(t.hasMipmap||!i)}_makePowerOfTwoTexture(e,t,r,i,o){const{width:a,height:n}=r,s=(0,Z.Sf)(a),l=(0,Z.Sf)(n);let c;switch(i.width=s,i.height=l,this.params.powerOfTwoResizeMode){case O.CE.PAD:i.textureCoordinateScaleFactor=[a/s,n/l],c=new he.x(e,i),c.updateData(0,0,0,a,n,t);break;case O.CE.STRETCH:case null:case void 0:c=this._stretchToPowerOfTwo(e,t,i,o());break;default:(0,J.Bg)(this.params.powerOfTwoResizeMode)}return i.hasMipmap&&c.generateMipmap(),c}_stretchToPowerOfTwo(e,t,r,i){const o=new he.x(e,r),a=new Ge(e,{colorTarget:ue.Lm.TEXTURE,depthStencilTarget:ue.OU.NONE},o),n=new he.x(e,{target:ue.No.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:ue.Br.UNSIGNED_BYTE,wrapMode:ue.e8.CLAMP_TO_EDGE,samplingMode:ue.cw.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},t),s=function(e,t=Pe,r=Oe.i,i=-1,o=1){let a=null;return a=t===Ie?new Float32Array([i,i,0,0,o,i,1,0,i,o,0,1,o,o,1,1]):new Float32Array([i,i,o,i,i,o,o,o]),new Le(e,r,{geometry:t},{geometry:ze.createVertex(e,ue.l1.STATIC_DRAW,a)})}(e),l=e.getBoundFramebufferObject();return this._drawStretchedTexture(e,i,a,s,n,o),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:s,sourceTexture:n,framebuffer:a}:(s.dispose(!0),n.dispose(),a.detachColorTexture(),a.dispose()),e.bindFramebuffer(l),o}_drawStretchedTexture(e,t,r,i,o,a){this._passParameters.texture=o,e.bindFramebuffer(r);const n=e.getViewport();e.setViewport(0,0,a.descriptor.width,a.descriptor.height),e.bindTechnique(t,this._passParameters,null),e.bindVAO(i),e.drawArrays(ue.MX.TRIANGLE_STRIP,0,function(e,t){return e.vertexBuffers[t].size/function(e){return e[0].stride}(e.layout[t])}(i,"geometry")),e.bindFramebuffer(null),e.setViewport(n.x,n.y,n.width,n.height),this._passParameters.texture=null}unload(){if((0,o.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:e,vao:t,sourceTexture:r}=this._powerOfTwoStretchInfo;t.dispose(!0),r.dispose(),e.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if((0,o.pC)(this._glTexture)&&(this._glTexture.dispose(),this._glTexture=null),(0,o.pC)(this._loadingController)){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}Ke.DDS_ENCODING="image/vnd-ms.dds",Ke.KTX2_ENCODING="image/ktx2",Ke.BASIS_ENCODING="image/x.basis",(Ye=Je||(Je={}))[Ye.HAVE_NOTHING=0]="HAVE_NOTHING",Ye[Ye.HAVE_METADATA=1]="HAVE_METADATA",Ye[Ye.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Ye[Ye.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Ye[Ye.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var Qe=r(64822),et=r(65576),tt=r(55039),rt=r(64267),it=r(19419),ot=r(85504),at=r(60537),nt=r(82791),st=r(93144);function lt(e,t,r=ue.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]}}}const ct={face:ue.LR.BACK,mode:ue.Wf.CCW},dt={face:ue.LR.FRONT,mode:ue.Wf.CCW},ut=e=>e===O.Vr.Back?ct:e===O.Vr.Front?dt:null,ht={zNear:0,zFar:1},ft={r:!0,g:!0,b:!0,a:!0};function mt(e){return wt.intern(e)}function pt(e){return Ct.intern(e)}function gt(e){return yt.intern(e)}function _t(e){return Ot.intern(e)}function vt(e){return Pt.intern(e)}function xt(e){return Dt.intern(e)}function Tt(e){return Ft.intern(e)}function bt(e){return Bt.intern(e)}class At{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 Et(e){return"["+e.join(",")+"]"}const wt=new At(St,(e=>({__tag:"Blending",...e})));function St(e){return e?Et([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 Ct=new At(Rt,(e=>({__tag:"Culling",...e})));function Rt(e){return e?Et([e.face,e.mode]):null}const yt=new At(Mt,(e=>({__tag:"PolygonOffset",...e})));function Mt(e){return e?Et([e.factor,e.units]):null}const Ot=new At(Nt,(e=>({__tag:"DepthTest",...e})));function Nt(e){return e?Et([e.func]):null}const Pt=new At(It,(e=>({__tag:"StencilTest",...e})));function It(e){return e?Et([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const Dt=new At(Lt,(e=>({__tag:"DepthWrite",...e})));function Lt(e){return e?Et([e.zNear,e.zFar]):null}const Ft=new At(Ht,(e=>({__tag:"ColorWrite",...e})));function Ht(e){return e?Et([e.r,e.g,e.b,e.a]):null}const Bt=new At(Ut,(e=>({__tag:"StencilWrite",...e})));function Ut(e){return e?Et([e.mask]):null}const zt=new At((function(e){return e?Et([St(e.blending),Rt(e.culling),Mt(e.polygonOffset),Nt(e.depthTest),It(e.stencilTest),Lt(e.depthWrite),Ht(e.colorWrite),Ut(e.stencilWrite)]):null}),(e=>({blending:mt(e.blending),culling:pt(e.culling),polygonOffset:gt(e.polygonOffset),depthTest:_t(e.depthTest),stencilTest:vt(e.stencilTest),depthWrite:xt(e.depthWrite),colorWrite:Tt(e.colorWrite),stencilWrite:bt(e.stencilWrite)}))),Vt=function(e,t,r,i,o=ue.db.ADD,a=ue.db.ADD,n=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:o,opAlpha:a,color:{r:n[0],g:n[1],b:n[2],a:n[3]}}}(ue.zi.SRC_ALPHA,ue.zi.ONE,ue.zi.ONE_MINUS_SRC_ALPHA,ue.zi.ONE_MINUS_SRC_ALPHA),Gt=lt(ue.zi.ONE,ue.zi.ONE),Wt=lt(ue.zi.ZERO,ue.zi.ONE_MINUS_SRC_ALPHA);function kt(e){return e===st.A.FrontFace?null:e===st.A.Alpha?Wt:Gt}const $t={factor:-1,units:-2};function qt(e,t=ue.wb.LESS){return e===st.A.NONE||e===st.A.FrontFace?t:ue.wb.LEQUAL}var Xt,jt;(jt=Xt||(Xt={}))[jt.INTEGRATED_MESH=0]="INTEGRATED_MESH",jt[jt.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",jt[jt.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",jt[jt.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",jt[jt.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",jt[jt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",jt[jt.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",jt[jt.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",jt[jt.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",jt[jt.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",jt[jt.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",jt[jt.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",jt[jt.LASERLINES=12]="LASERLINES",jt[jt.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",jt[jt.HUD_MATERIAL=14]="HUD_MATERIAL",jt[jt.LABEL_MATERIAL=15]="LABEL_MATERIAL",jt[jt.LINE_CALLOUTS=16]="LINE_CALLOUTS",jt[jt.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",jt[jt.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",jt[jt.DRAPED_WATER=19]="DRAPED_WATER",jt[jt.VOXEL=20]="VOXEL",jt[jt.MAX_SLOTS=21]="MAX_SLOTS";var Jt=r(51305),Yt=r(94961),Zt=r(72119),Kt=r(29268);const Qt=(0,d.c)(),er=(0,d.c)(),tr=(0,d.c)(),rr=new class{constructor(e=0){this.offset=e,this.sphere=(0,Kt.c)(),this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let o=i[0]*e+i[4]*t+i[8]*r+i[12],a=i[1]*e+i[5]*t+i[9]*r+i[13],n=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(o*o+a*a+n*n);o+=o*s,a+=a*s,n+=n*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*o+l[4]*a+l[8]*n+l[12],this.tmpVertex[1]=l[1]*o+l[5]*a+l[9]*n+l[13],this.tmpVertex[2]=l[2]*o+l[6]*a+l[10]*n+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*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=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,d.c)(),this._mbs=(0,Kt.c)(),this._obb={center:(0,d.c)(),halfSize:(0,Zt.b)(),quaternion:null},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=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,o=t,a=r+this.componentLocalOriginLength,n=this._totalOffset/Math.sqrt(i*i+o*o+a*a);return this._tmpVertex[0]=e+i*n,this._tmpVertex[1]=t+o*n,this._tmpVertex[2]=r+a*n,this._tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,o=e[3],a=e[4],n=e[5]+this.componentLocalOriginLength,s=t*o<0?0:Math.min(Math.abs(t),Math.abs(o)),l=r*a<0?0:Math.min(Math.abs(r),Math.abs(a)),c=i*n<0?0:Math.min(Math.abs(i),Math.abs(n)),d=Math.sqrt(s*s+l*l+c*c);if(d<this._totalOffset)return e[0]-=t<0?this._totalOffset:0,e[1]-=r<0?this._totalOffset:0,e[2]-=i<0?this._totalOffset:0,e[3]+=o>0?this._totalOffset:0,e[4]+=a>0?this._totalOffset:0,e[5]+=n>0?this._totalOffset:0,e;const u=Math.max(Math.abs(t),Math.abs(o)),h=Math.max(Math.abs(r),Math.abs(a)),f=Math.max(Math.abs(i),Math.abs(n)),m=Math.sqrt(u*u+h*h+f*f),p=this._totalOffset/m,g=this._totalOffset/d;return e[0]+=t*(t>0?p:g),e[1]+=r*(r>0?p:g),e[2]+=i*(i>0?p:g),e[3]+=o*(o<0?p:g),e[4]+=a*(a<0?p:g),e[5]+=n*(n<0?p:g),e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this._totalOffset/t;return this._mbs[0]=e[0]+e[0]*r,this._mbs[1]=e[1]+e[1]*r,this._mbs[2]=e[2]+e[2]*r,this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){const t=e.center,r=this._totalOffset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this._obb.center[0]=t[0]+t[0]*r,this._obb.center[1]=t[1]+t[1]*r,this._obb.center[2]=t[2]+t[2]*r,(0,c.k)(this._obb.halfSize,e.halfSize,e.quaternion),(0,c.a)(this._obb.halfSize,this._obb.halfSize,e.center);const i=this._totalOffset/Math.sqrt(this._obb.halfSize[0]*this._obb.halfSize[0]+this._obb.halfSize[1]*this._obb.halfSize[1]+this._obb.halfSize[2]*this._obb.halfSize[2]);return this._obb.halfSize[0]+=this._obb.halfSize[0]*i,this._obb.halfSize[1]+=this._obb.halfSize[1]*i,this._obb.halfSize[2]+=this._obb.halfSize[2]*i,(0,c.b)(this._obb.halfSize,this._obb.halfSize,e.center),(0,Jt.a)(ir,e.quaternion),(0,c.k)(this._obb.halfSize,this._obb.halfSize,ir),this._obb.halfSize[0]*=this._obb.halfSize[0]<0?-1:1,this._obb.halfSize[1]*=this._obb.halfSize[1]<0?-1:1,this._obb.halfSize[2]*=this._obb.halfSize[2]<0?-1:1,this._obb.quaternion=e.quaternion,this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],o=t+this.localOrigin[1],a=r+this.localOrigin[2],n=this.offset/Math.sqrt(i*i+o*o+a*a);return this.tmpVertex[0]=e+i*n,this.tmpVertex[1]=t+o*n,this.tmpVertex[2]=r+a*n,this.tmpVertex}applyToAabb(e){for(let t=0;t<3;++t)Qt[t]=e[0+t]+this.localOrigin[t],er[t]=e[3+t]+this.localOrigin[t],tr[t]=Qt[t];const t=this.applyToVertex(Qt[0],Qt[1],Qt[2]);for(let r=0;r<3;++r)e[r]=t[r],e[r+3]=t[r];const r=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t+0]=Math.min(e[t+0],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let t=0;t<3;++t)tr[t]=0==(e&1<<t)?Qt[t]:er[t];r(tr)}let i=0;for(let e=0;e<3;++e)Qt[e]*er[e]<0&&(i|=1<<e);if(0!==i&&7!==i)for(let e=0;e<8;++e)if(0==(i&e)){for(let t=0;t<3;++t)i[t]?tr[t]=0:tr[t]=0!=(e&1<<t)?Qt[t]:er[t];r(tr)}for(let t=0;t<3;++t)e[t+0]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const ir=(0,Yt.c)();function or(e,t,r,i){const o=r.typedBuffer,a=r.typedBufferStride,n=e.length;i*=a;for(let r=0;r<n;++r){const n=2*e[r];o[i]=t[n],o[i+1]=t[n+1],i+=a}}function ar(e,t,r,i,o){const a=r.typedBuffer,n=r.typedBufferStride,s=e.length;if(i*=n,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];a[i]=t[o],a[i+1]=t[o+1],a[i+2]=t[o+2],i+=n}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)a[i]=t[s],a[i+1]=t[s+1],a[i+2]=t[s+2],i+=n}}function nr(e,t,r,i,o,a=1){if(!r)return void ar(e,t,i,o,a);const n=i.typedBuffer,s=i.typedBufferStride,l=e.length,c=r[0],d=r[1],u=r[2],h=r[4],f=r[5],m=r[6],p=r[8],g=r[9],_=r[10],v=r[12],x=r[13],T=r[14];if(o*=s,1===a)for(let r=0;r<l;++r){const i=3*e[r],a=t[i],l=t[i+1],b=t[i+2];n[o]=c*a+h*l+p*b+v,n[o+1]=d*a+f*l+g*b+x,n[o+2]=u*a+m*l+_*b+T,o+=s}else for(let r=0;r<l;++r){const i=3*e[r],l=t[i],b=t[i+1],A=t[i+2],E=c*l+h*b+p*A+v,w=d*l+f*b+g*A+x,S=u*l+m*b+_*A+T;for(let e=0;e<a;++e)n[o]=E,n[o+1]=w,n[o+2]=S,o+=s}}function sr(e,t,r,i,o,a=1){if(!r)return void ar(e,t,i,o,a);const n=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=n[0],h=n[1],f=n[2],m=n[4],p=n[5],g=n[6],_=n[8],v=n[9],x=n[10],T=!(0,s.x)(n),b=1e-6,A=1-b;if(o*=c,1===a)for(let r=0;r<d;++r){const i=3*e[r],a=t[i],n=t[i+1],s=t[i+2];let d=u*a+m*n+_*s,E=h*a+p*n+v*s,w=f*a+g*n+x*s;if(T){const e=d*d+E*E+w*w;if(e<A&&e>b){const t=1/Math.sqrt(e);d*=t,E*=t,w*=t}}l[o+0]=d,l[o+1]=E,l[o+2]=w,o+=c}else for(let r=0;r<d;++r){const i=3*e[r],n=t[i],s=t[i+1],d=t[i+2];let E=u*n+m*s+_*d,w=h*n+p*s+v*d,S=f*n+g*s+x*d;if(T){const e=E*E+w*w+S*S;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,w*=t,S*=t}}for(let e=0;e<a;++e)l[o+0]=E,l[o+1]=w,l[o+2]=S,o+=c}}function lr(e,t,r,i,o,a=1){if(!r)return void function(e,t,r,i,o=1){const a=r.typedBuffer,n=r.typedBufferStride,s=e.length;if(i*=n,1===o)for(let r=0;r<s;++r){const o=4*e[r];a[i]=t[o],a[i+1]=t[o+1],a[i+2]=t[o+2],a[i+3]=t[o+3],i+=n}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)a[i]=t[s],a[i+1]=t[s+1],a[i+2]=t[s+2],a[i+3]=t[s+3],i+=n}}(e,t,i,o,a);const n=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=n[0],h=n[1],f=n[2],m=n[4],p=n[5],g=n[6],_=n[8],v=n[9],x=n[10],T=!(0,s.x)(n),b=1e-6,A=1-b;if(o*=c,1===a)for(let r=0;r<d;++r){const i=4*e[r],a=t[i],n=t[i+1],s=t[i+2],d=t[i+3];let E=u*a+m*n+_*s,w=h*a+p*n+v*s,S=f*a+g*n+x*s;if(T){const e=E*E+w*w+S*S;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,w*=t,S*=t}}l[o+0]=E,l[o+1]=w,l[o+2]=S,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],n=t[i],s=t[i+1],d=t[i+2],E=t[i+3];let w=u*n+m*s+_*d,S=h*n+p*s+v*d,C=f*n+g*s+x*d;if(T){const e=w*w+S*S+C*C;if(e<A&&e>b){const t=1/Math.sqrt(e);w*=t,S*=t,C*=t}}for(let e=0;e<a;++e)l[o+0]=w,l[o+1]=S,l[o+2]=C,l[o+3]=E,o+=c}}function cr(e,t,r,i,o,a=1){const n=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,1===a){if(4===r)for(let r=0;r<l;++r){const i=4*e[r];n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=t[i+3],o+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=255,o+=s}}else if(4===r)for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<a;++e)n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=t[i+3],o+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<a;++e)n[o]=t[i],n[o+1]=t[i+1],n[o+2]=t[i+2],n[o+3]=255,o+=s}}function dr(e,t,r,i,o=1){const a=t.typedBuffer,n=t.typedBufferStride;if(i*=n,1===o)for(let t=0;t<r;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n}var ur=r(37782),hr=r(135),fr=r(15719),mr=r(96310),pr=r(89243);class gr{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}var _r=r(67498);class vr{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new N.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.generateBind(_r.P.Pass,this),this.bindDraw=t.generateBind(_r.P.Draw,this),this._fragmentUniforms=(0,He.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get isCompiled(){return this._glProgram.isCompiled}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((0,o.Wi)(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)})),(0,o.pC)(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)}}ue.wb.LESS,ue.wb.ALWAYS;const xr={mask:255},Tr={function:{func:ue.wb.ALWAYS,ref:O.hU.OutlineVisualElementMask,mask:O.hU.OutlineVisualElementMask},operation:{fail:ue.xS.KEEP,zFail:ue.xS.KEEP,zPass:ue.xS.ZERO}},br={function:{func:ue.wb.ALWAYS,ref:O.hU.OutlineVisualElementMask,mask:O.hU.OutlineVisualElementMask},operation:{fail:ue.xS.KEEP,zFail:ue.xS.KEEP,zPass:ue.xS.REPLACE}};ue.wb.EQUAL,O.hU.OutlineVisualElementMask,O.hU.OutlineVisualElementMask,ue.xS.KEEP,ue.xS.KEEP,ue.xS.KEEP,ue.wb.NOTEQUAL,O.hU.OutlineVisualElementMask,O.hU.OutlineVisualElementMask,ue.xS.KEEP,ue.xS.KEEP,ue.xS.KEEP;var Ar=r(32078);class Er extends fr.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,d.f)(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=O.Vr.Back,this.emissiveFactor=(0,d.f)(0,0,0),this.instancedDoublePrecision=!1,this.normals="default",this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,d.f)(.2,.2,.2),this.diffuse=(0,d.f)(.8,.8,.8),this.externalColor=(0,te.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvSizeValue=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.vvSymbolAnchor=[0,0,0],this.vvSymbolRotationMatrix=(0,n.c)(),this.vvOpacityEnabled=!1,this.vvOpacityValues=[],this.vvOpacityOpacities=[],this.transparent=!1,this.writeDepth=!0,this.customDepthTest=O.Gv.Less,this.textureAlphaMode=O.JJ.Blend,this.textureAlphaCutoff=mr.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=nt.yD.Occlude}}class wr extends class{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,o.M2)(this._program),this._pipeline=this._configuration=null}reload(e){(0,o.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.isCompiled}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 ue.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}{initializeConfiguration(e,t){t.spherical=e.viewingMode===Qe.JY.Global,t.doublePrecisionRequiresObfuscation=(0,pr.I)(e.rctx),t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?hr.N.Default:hr.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,wr.shader)}_initializeProgram(e,t){return new vr(e.rctx,t.get().build(this.configuration),Oe.i)}_convertDepthTestFunction(e){return e===O.Gv.Lequal?ue.wb.LEQUAL:ue.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===st.A.NONE,o=e===st.A.FrontFace;return function(e){return zt.intern(e)}({blending:r.output!==tt.H.Color&&r.output!==tt.H.Alpha||!r.transparent?null:i?Vt:kt(e),culling:Sr(r)&&ut(r.cullFace),depthTest:{func:qt(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:i||o?r.writeDepth&&ht:null,colorWrite:ft,stencilWrite:r.hasOccludees?xr:null,stencilTest:r.hasOccludees?t?br:Tr:null,polygonOffset:i||o?null:(a=r.enableOffset,a?$t:null)});var a}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 Sr(e){return e.cullFace!==O.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}wr.shader=new gr(Ar.D,(()=>r.e(9291).then(r.bind(r,79291))));var Cr=r(43697),Rr=r(51354);class yr extends Rr.m{}(0,Cr._)([(0,Rr.o)({constValue:!0})],yr.prototype,"hasSliceHighlight",void 0),(0,Cr._)([(0,Rr.o)({constValue:!1})],yr.prototype,"hasSliceInVertexProgram",void 0),(0,Cr._)([(0,Rr.o)({constValue:!1})],yr.prototype,"instancedDoublePrecision",void 0),(0,Cr._)([(0,Rr.o)({constValue:!1})],yr.prototype,"useLegacyTerrainShading",void 0),(0,Cr._)([(0,Rr.o)({constValue:!1})],yr.prototype,"hasModelTransformation",void 0),(0,Cr._)([(0,Rr.o)({constValue:_r.P.Pass})],yr.prototype,"pbrTextureBindType",void 0);class Mr extends yr{constructor(){super(...arguments),this.output=tt.H.Color,this.alphaDiscardMode=O.JJ.Opaque,this.doubleSidedMode=it.q.None,this.pbrMode=ot.f7.Disabled,this.cullFace=O.Vr.None,this.transparencyPassType=st.A.NONE,this.normalType=rt.h.Attribute,this.textureCoordinateType=hr.N.None,this.customDepthTest=O.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.hasMultipassTerrain=!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,Cr._)([(0,Rr.o)({count:tt.H.COUNT})],Mr.prototype,"output",void 0),(0,Cr._)([(0,Rr.o)({count:O.JJ.COUNT})],Mr.prototype,"alphaDiscardMode",void 0),(0,Cr._)([(0,Rr.o)({count:it.q.COUNT})],Mr.prototype,"doubleSidedMode",void 0),(0,Cr._)([(0,Rr.o)({count:ot.f7.COUNT})],Mr.prototype,"pbrMode",void 0),(0,Cr._)([(0,Rr.o)({count:O.Vr.COUNT})],Mr.prototype,"cullFace",void 0),(0,Cr._)([(0,Rr.o)({count:st.A.COUNT})],Mr.prototype,"transparencyPassType",void 0),(0,Cr._)([(0,Rr.o)({count:rt.h.COUNT})],Mr.prototype,"normalType",void 0),(0,Cr._)([(0,Rr.o)({count:hr.N.COUNT})],Mr.prototype,"textureCoordinateType",void 0),(0,Cr._)([(0,Rr.o)({count:O.Gv.COUNT})],Mr.prototype,"customDepthTest",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"spherical",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasVertexColors",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasSymbolColors",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasVerticalOffset",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasSlicePlane",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasSliceHighlight",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasColorTexture",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasMetallicRoughnessTexture",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasEmissionTexture",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasOcclusionTexture",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasNormalTexture",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasScreenSizePerspective",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasVertexTangents",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasOccludees",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasMultipassTerrain",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasModelTransformation",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"offsetBackfaces",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"vvSize",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"vvColor",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"receiveShadows",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"receiveAmbientOcclusion",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"textureAlphaPremultiplied",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"instanced",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"instancedColor",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"instancedDoublePrecision",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"writeDepth",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"transparent",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"enableOffset",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"cullAboveGround",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"snowCover",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasColorTextureTransform",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasEmissionTextureTransform",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasNormalTextureTransform",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasOcclusionTextureTransform",void 0),(0,Cr._)([(0,Rr.o)()],Mr.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Cr._)([(0,Rr.o)({constValue:!0})],Mr.prototype,"hasVvInstancing",void 0),(0,Cr._)([(0,Rr.o)({constValue:!1})],Mr.prototype,"useCustomDTRExponentForWater",void 0),(0,Cr._)([(0,Rr.o)({constValue:!1})],Mr.prototype,"supportsTextureAtlas",void 0),(0,Cr._)([(0,Rr.o)({constValue:!0})],Mr.prototype,"useFillLights",void 0);var Or=r(41846);class Nr extends wr{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=rt.h.Attribute,t.doubleSidedMode=it.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,Nr.shader)}}Nr.shader=new gr(Or.R,(()=>r.e(8096).then(r.bind(r,38096))));class Pr extends nt.F5{constructor(e){super(e,Dr),this.supportsEdges=!0,this._configuration=new Mr,this._vertexBufferLayout=function(e){const t=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId,r=(0,et.U$)().vec3f(X.T.POSITION).vec3f(X.T.NORMAL);return e.hasVertexTangents&&r.vec4f(X.T.TANGENT),t&&r.vec2f(X.T.UV0),e.hasVertexColors&&r.vec4u8(X.T.COLOR),e.hasSymbolColors&&r.vec4u8(X.T.SYMBOLCOLOR),(0,fe.Z)("enable-feature:objectAndLayerId-rendering")&&r.vec4u8(X.T.OBJECTANDLAYERIDCOLOR),r}(this.parameters),this._instanceBufferLayout=e.instanced?function(e){let t=(0,et.U$)();return t=e.instancedDoublePrecision?t.vec3f(X.T.MODELORIGINHI).vec3f(X.T.MODELORIGINLO).mat3f(X.T.MODEL).mat3f(X.T.MODELNORMAL):t.mat4f(X.T.MODEL).mat4f(X.T.MODELNORMAL),(0,o.pC)(e.instanced)&&e.instanced.includes("color")&&(t=t.vec4f(X.T.INSTANCECOLOR)),(0,o.pC)(e.instanced)&&e.instanced.includes("featureAttribute")&&(t=t.vec4f(X.T.INSTANCEFEATUREATTRIBUTE)),(0,o.pC)(e.instanced)&&e.instanced.includes("objectAndLayerIdColor")&&(t=t.vec4u8(X.T.OBJECTANDLAYERIDCOLOR_INSTANCED)),t}(this.parameters):null}isVisibleForOutput(e){return e!==tt.H.Shadow&&e!==tt.H.ShadowExludeHighlight&&e!==tt.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{instanced:t,hasVertexColors:r,hasSymbolColors:i,vvColorEnabled:a}=e,n=(0,o.pC)(t)&&t.includes("color"),s="replace"===e.colorMixMode,l=e.opacity>0,c=e.externalColor&&e.externalColor[3]>0;return r&&(n||a||i)?!!s||l:r?s?c:l:n||a||i?!!s||l:s?c:l}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.instanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.hasVerticalOffset=(0,o.pC)(this.parameters.verticalOffset),this._configuration.hasScreenSizePerspective=(0,o.pC)(this.parameters.screenSizePerspective),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType="screenDerivative"===this.parameters.normals?rt.h.ScreenDerivative:rt.h.Attribute,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,(0,o.pC)(this.parameters.customDepthTest)&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?O.Vr.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=(0,o.pC)(this.parameters.modelTransformation),e!==tt.H.Color&&e!==tt.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=it.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?it.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?it.q.WindingOrder:it.q.None,this._configuration.instancedColor=(0,o.pC)(this.parameters.instanced)&&this.parameters.instanced.includes("color"),this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.ready&&this.parameters.receiveSSAO,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?ot.f7.Schematic:ot.f7.Normal:ot.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(0,o.pC)(e.weather)&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,a,n,s){if((0,o.pC)(this.parameters.verticalOffset)){const e=i.camera;(0,c.s)(Vr,r[12],r[13],r[14]);let t=null;switch(i.viewingMode){case Qe.JY.Global:t=(0,c.n)(Ur,Vr);break;case Qe.JY.Local:t=(0,c.c)(Ur,Br)}let o=0;const s=(0,c.b)(Gr,Vr,e.eye),l=(0,c.l)(s),d=(0,c.g)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,c.e)(t,d)),o+=(0,ur.Hx)(e,l,this.parameters.verticalOffset,u,this.parameters.screenSizePerspective),(0,c.g)(t,t,o),(0,c.t)(zr,t,i.transform.inverseRotation),a=(0,c.b)(Fr,a,zr),n=(0,c.b)(Hr,n,zr)}var l;(0,ur.Bw)(e,t,i,a,n,(l=i.verticalOffset,(0,o.pC)(l)?(rr.offset=l,rr):null),s)}requiresSlot(e,t){return!(t!==tt.H.Color&&t!==tt.H.Alpha&&t!==tt.H.Depth&&t!==tt.H.Normal&&t!==tt.H.Shadow&&t!==tt.H.ShadowHighlight&&t!==tt.H.ShadowExludeHighlight&&t!==tt.H.Highlight&&t!==tt.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?Xt.TRANSPARENT_MATERIAL:Xt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Xt.OPAQUE_MATERIAL)&&e!==Xt.DRAPED_MATERIAL&&t!==tt.H.ObjectAndLayerIdColor)}createGLMaterial(e){return new Ir(e)}createBufferWriter(){return new Lr(this._vertexBufferLayout,this._instanceBufferLayout)}}class Ir extends at.F{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,c.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?Nr:wr,e)}_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){return this._output!==tt.H.Color&&this._output!==tt.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this._updateParameters(e)}}const Dr=new class extends Er{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}};class Lr{constructor(e,t){this.vertexBufferLayout=e,this.instanceBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(X.T.POSITION).length}write(e,t,r,i){!function(e,t,r,i,a,n){for(const s of t.fieldNames){const t=e.vertexAttributes.get(s),l=e.indices.get(s);if(t&&l)switch(s){case X.T.POSITION:{(0,P.hu)(3===t.size);const e=a.getField(s,h.ct);e&&nr(l,t.data,r,e,n);break}case X.T.NORMAL:{(0,P.hu)(3===t.size);const e=a.getField(s,h.ct);e&&sr(l,t.data,i,e,n);break}case X.T.UV0:{(0,P.hu)(2===t.size);const e=a.getField(s,h.Eu);e&&or(l,t.data,e,n);break}case X.T.COLOR:{(0,P.hu)(3===t.size||4===t.size);const e=a.getField(s,h.mc);e&&cr(l,t.data,t.size,e,n);break}case X.T.SYMBOLCOLOR:{(0,P.hu)(3===t.size||4===t.size);const e=a.getField(s,h.mc);e&&cr(l,t.data,t.size,e,n);break}case X.T.TANGENT:{(0,P.hu)(4===t.size);const e=a.getField(s,h.ek);e&&lr(l,t.data,i,e,n);break}}else if(s===X.T.OBJECTANDLAYERIDCOLOR&&(0,o.pC)(e.objectAndLayerIdColor)&&4===e.objectAndLayerIdColor.length){const t=e.indices.get(X.T.POSITION);if(t){const r=t.length,i=a.getField(s,h.mc);dr(e.objectAndLayerIdColor,i,r,n)}}}}(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,i)}}const Fr=(0,d.c)(),Hr=(0,d.c)(),Br=(0,d.f)(0,0,1),Ur=(0,d.c)(),zr=(0,d.c)(),Vr=(0,d.c)(),Gr=(0,d.c)(),Wr=C.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function kr(e){throw new S.Z("",`Request for object resource failed: ${e}`)}function $r(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Wr.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&&(Wr.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Wr.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Wr.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Wr.warn("Indexed geometries must specify faces"),i=!1;break}default:Wr.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Wr.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Wr.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function qr(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;(0,o.pC)(r)&&((0,u.pp)(t,r.getBBMin()),(0,u.pp)(t,r.getBBMax()))})),t}function Xr(e){switch(e){case"mask":return O.JJ.Mask;case"maskAndTransparency":return O.JJ.MaskBlend;case"none":return O.JJ.Opaque;default:return O.JJ.Blend}}function jr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Jr=new y.G(1,2,"wosr");var Yr=r(57758),Zr=r(10816),Kr=r(75488),Qr=r(56067);async function ei(e,t){const r=ti((0,i.pJ)(e));if("wosr"===r.fileType){const e=function(e,t){const r=[],i=[],a=[],n=[],s=e.resource,l=y.G.parse(s.version||"1.0","wosr");Jr.validate(l);const c=s.model.name,u=s.model.geometries,h=s.materialDefinitions,f=e.textures;let m=0;const p=new Map;for(let e=0;e<u.length;e++){const s=u[e];if(!$r(s))continue;const l=jr(s),c=s.params.vertexAttributes,g=[];for(const e in c){const t=c[e],r=t.values;g.push([e,{data:r,size:t.valuesPerElement,exclusive:!0}])}const _=[];if("PerAttributeArray"!==s.params.topology){const e=s.params.faces;for(const t in e)_.push([t,e[t].values])}const v=f&&f[l.texture];if(v&&!p.has(l.texture)){const{image:e,params:t}=v,r=new Ke(e,t);n.push(r),p.set(l.texture,r)}const x=p.get(l.texture),T=x?x.id:void 0;let b=a[l.material]?a[l.material][l.texture]:null;if(!b){const e=h[l.material.substring(l.material.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=v&&v.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,n=v?Xr(v.alphaChannelUsage):void 0,s={ambient:(0,d.d)(e.diffuse),diffuse:(0,d.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:n,textureAlphaCutoff:.33,textureId:T,initTextureTransparent:!0,doubleSided:!0,cullFace:O.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!v&&!!v.params.preMultiplyAlpha};(0,o.pC)(t)&&t.materialParamsMixin&&Object.assign(s,t.materialParamsMixin),b=new Pr(s),a[l.material]||(a[l.material]={}),a[l.material][l.texture]=b}i.push(b);const A=new j(g,_);m+=_.position?_.position.length:0,r.push(A)}return{name:c,stageResources:{textures:n,materials:i,geometries:r},pivotOffset:s.model.pivotOffset,boundingBox:qr(r),numberOfVertices:m,lodThreshold:null}}(await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=(0,o.pC)(t)&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,E.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,R.r9)(i.error),kr(i.error.details.url)}(e,r,t);const i=await(0,E.q6)((0,A.default)(e,(0,o.Wg)(t)));if(!0===i.ok)return i.value.data;(0,R.r9)(i.error),kr(i.error)}(e,t),i=await async function(e,t){const r=[];for(const i in e){const a=e[i],n=a.images[0].data;if(!n){Wr.warn("Externally referenced texture data is not yet supported");continue}const s=a.encoding+";base64,"+n,l="/textureDefinitions/"+i,c="rgba"===a.channels?a.alphaChannelUsage||"transparency":"none",d={noUnpackFlip:!0,wrap:{s:ue.e8.REPEAT,t:ue.e8.REPEAT},preMultiplyAlpha:Xr(c)!==O.JJ.Opaque},u=(0,o.pC)(t)&&t.disableTextures?Promise.resolve(null):M(s,t);r.push(u.then((e=>({refId:l,image:e,params:d,alphaChannelUsage:c}))))}const i=await Promise.all(r),a={};for(const e of i)a[e.refId]=e;return a}(r.textureDefinitions,t);let a=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];a+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:a+(0,w.Ul)(r)}}(r.url,t)),t);return{lods:[e],referenceBoundingBox:e.boundingBox,isEsriSymbolResource:!1,isWosr:!0}}const a=await(t.cache?t.cache.loadGLTF(r.url,t,t.usePBR):(0,_.z)(new g.C(t.streamDataRequester),r.url,t,t.usePBR)),n=(0,o.U2)(a.model.meta,"ESRI_proxyEllipsoid"),u=a.meta.isEsriSymbolResource&&(0,o.pC)(n)&&a.meta.uri.includes("/RealisticTrees/");u&&!a.customMeta.esriTreeRendering&&(a.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const a of i.parts){const i=a.attributes.normal;if((0,o.Wi)(i))return;const n=a.attributes.position,u=n.count,f=(0,d.c)(),m=(0,d.c)(),g=(0,d.c)(),_=(0,p.gS)(h.mc,u),v=(0,p.gS)(h.ct,u),x=(0,s.a)((0,l.c)(),a.transform);for(let o=0;o<u;o++){n.getVec(o,m),i.getVec(o,f),(0,c.v)(m,m,a.transform),(0,c.b)(g,m,t.center),(0,c.C)(g,g,t.radius);const s=g[2],l=(0,c.l)(g),d=Math.min(.45+.55*l*l,1);(0,c.C)(g,g,t.radius),(0,c.v)(g,g,x),(0,c.n)(g,g),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.h)(g,g,f,s>-1?.2:Math.min(-4*s-3.8,1)),v.setVec(o,g),_.set(o,0,255*d),_.set(o,1,255*d),_.set(o,2,255*d),_.set(o,3,255)}a.attributes.normal=v,a.attributes.color=_}}}(a,n));const f=a.meta.isEsriSymbolResource?{usePBR:t.usePBR,isSchematic:!1,treeRendering:u,mrrFactors:[0,1,.2]}:{usePBR:t.usePBR,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},m={...t.materialParamsMixin,treeRendering:u};if(null!=r.specifiedLodIndex){const e=ri(a,f,m,r.specifiedLodIndex);let t=e[0].boundingBox;return 0!==r.specifiedLodIndex&&(t=ri(a,f,m,0)[0].boundingBox),{lods:e,referenceBoundingBox:t,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}const v=ri(a,f,m);return{lods:v,referenceBoundingBox:v[0].boundingBox,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}function ti(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}}function ri(e,t,r,i){const s=e.model,l=(0,n.c)(),c=new Array,d=new Map,g=new Map;return s.lods.forEach(((e,n)=>{if(void 0!==i&&n!==i)return;const _={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:(0,o.pC)(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:(0,u.cS)()};c.push(_),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),n=s.materials.get(e.material),c=(0,o.pC)(e.attributes.texCoord0),x=(0,o.pC)(e.attributes.normal),T=function(e){switch(e){case"BLEND":return O.JJ.Blend;case"MASK":return O.JJ.Mask;case"OPAQUE":case null:case void 0:return O.JJ.Opaque}}(n.alphaMode);if(!d.has(i)){if(c){if((0,o.pC)(n.textureColor)&&!g.has(n.textureColor)){const e=s.textures.get(n.textureColor),t={...e.parameters,preMultiplyAlpha:T!==O.JJ.Opaque};g.set(n.textureColor,new Ke(e.data,t))}if((0,o.pC)(n.textureNormal)&&!g.has(n.textureNormal)){const e=s.textures.get(n.textureNormal);g.set(n.textureNormal,new Ke(e.data,e.parameters))}if((0,o.pC)(n.textureOcclusion)&&!g.has(n.textureOcclusion)){const e=s.textures.get(n.textureOcclusion);g.set(n.textureOcclusion,new Ke(e.data,e.parameters))}if((0,o.pC)(n.textureEmissive)&&!g.has(n.textureEmissive)){const e=s.textures.get(n.textureEmissive);g.set(n.textureEmissive,new Ke(e.data,e.parameters))}if((0,o.pC)(n.textureMetallicRoughness)&&!g.has(n.textureMetallicRoughness)){const e=s.textures.get(n.textureMetallicRoughness);g.set(n.textureMetallicRoughness,new Ke(e.data,e.parameters))}}const a=n.color[0]**(1/Yr.K),l=n.color[1]**(1/Yr.K),u=n.color[2]**(1/Yr.K),h=n.emissiveFactor[0]**(1/Yr.K),f=n.emissiveFactor[1]**(1/Yr.K),m=n.emissiveFactor[2]**(1/Yr.K),p=(0,o.pC)(n.textureColor)&&c?g.get(n.textureColor):null;d.set(i,new Pr({...t,transparent:T===O.JJ.Blend,customDepthTest:O.Gv.Lequal,textureAlphaMode:T,textureAlphaCutoff:n.alphaCutoff,diffuse:[a,l,u],ambient:[a,l,u],opacity:n.opacity,doubleSided:n.doubleSided,doubleSidedType:"winding-order",cullFace:n.doubleSided?O.Vr.None:O.Vr.Back,hasVertexColors:!!e.attributes.color,hasVertexTangents:!!e.attributes.tangent,normals:x?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:(0,o.pC)(p)?p.id:void 0,colorMixMode:n.colorMixMode,normalTextureId:(0,o.pC)(n.textureNormal)&&c?g.get(n.textureNormal).id:void 0,textureAlphaPremultiplied:(0,o.pC)(p)&&!!p.params.preMultiplyAlpha,occlusionTextureId:(0,o.pC)(n.textureOcclusion)&&c?g.get(n.textureOcclusion).id:void 0,emissiveTextureId:(0,o.pC)(n.textureEmissive)&&c?g.get(n.textureEmissive).id:void 0,metallicRoughnessTextureId:(0,o.pC)(n.textureMetallicRoughness)&&c?g.get(n.textureMetallicRoughness).id:void 0,emissiveFactor:[h,f,m],mrrFactors:[n.metallicFactor,n.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:b(n.colorTextureTransform),normalTextureTransformMatrix:b(n.normalTextureTransform),occlusionTextureTransformMatrix:b(n.occlusionTextureTransform),emissiveTextureTransformMatrix:b(n.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:b(n.metallicRoughnessTextureTransform),...r}))}const A=function(e,t){switch(t){case ue.MX.TRIANGLES:return(0,v.nh)(e);case ue.MX.TRIANGLE_STRIP:return(0,v.DA)(e);case ue.MX.TRIANGLE_FAN:return(0,v.jX)(e)}}(e.indices||e.attributes.position.count,e.primitiveType),E=e.attributes.position.count,w=(0,p.gS)(h.ct,E);(0,f.t)(w,e.attributes.position,e.transform);const S=[[X.T.POSITION,{data:w.typedBuffer,size:w.elementCount,exclusive:!0}]],C=[[X.T.POSITION,A]];if((0,o.pC)(e.attributes.normal)){const t=(0,p.gS)(h.ct,E);(0,a.d)(l,e.transform),(0,f.a)(t,e.attributes.normal,l),S.push([X.T.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),C.push([X.T.NORMAL,A])}if((0,o.pC)(e.attributes.tangent)){const t=(0,p.gS)(h.ek,E);(0,a.d)(l,e.transform),(0,m.t)(t,e.attributes.tangent,l),S.push([X.T.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),C.push([X.T.TANGENT,A])}if((0,o.pC)(e.attributes.texCoord0)){const t=(0,p.gS)(h.Eu,E);(0,Zr.n)(t,e.attributes.texCoord0),S.push([X.T.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),C.push([X.T.UV0,A])}if((0,o.pC)(e.attributes.color)){const t=(0,p.gS)(h.mc,E);if(4===e.attributes.color.elementCount)e.attributes.color instanceof h.ek?(0,m.s)(t,e.attributes.color,255):e.attributes.color instanceof h.mc?(0,Kr.c)(t,e.attributes.color):e.attributes.color instanceof h.v6&&(0,m.s)(t,e.attributes.color,1/256);else{(0,Kr.f)(t,255,255,255,255);const r=new h.ne(t.buffer,0,4);e.attributes.color instanceof h.ct?(0,f.s)(r,e.attributes.color,255):e.attributes.color instanceof h.ne?(0,Qr.c)(r,e.attributes.color):e.attributes.color instanceof h.mw&&(0,f.s)(r,e.attributes.color,1/256)}S.push([X.T.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),C.push([X.T.COLOR,A])}const R=new j(S,C);_.stageResources.geometries.push(R),_.stageResources.materials.push(d.get(i)),c&&((0,o.pC)(n.textureColor)&&_.stageResources.textures.push(g.get(n.textureColor)),(0,o.pC)(n.textureNormal)&&_.stageResources.textures.push(g.get(n.textureNormal)),(0,o.pC)(n.textureOcclusion)&&_.stageResources.textures.push(g.get(n.textureOcclusion)),(0,o.pC)(n.textureEmissive)&&_.stageResources.textures.push(g.get(n.textureEmissive)),(0,o.pC)(n.textureMetallicRoughness)&&_.stageResources.textures.push(g.get(n.textureMetallicRoughness))),_.numberOfVertices+=E;const y=R.boundingInfo;(0,o.pC)(y)&&((0,u.pp)(_.boundingBox,y.getBBMin()),(0,u.pp)(_.boundingBox,y.getBBMax()))}))})),c}},65576:(e,t,r)=>{r.d(t,{U$:()=>s});var i=r(56481),o=r(79583);class a{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fieldNames){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new a(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t,r,i){const o=this.stride;if(o%4==0){const a=new Uint32Array(e.buffer,t*o,i*o/4);new Uint32Array(this.buffer,r*o,i*o/4).set(a)}else{const a=new Uint8Array(e.buffer,t*o,i*o);new Uint8Array(this.buffer,r*o,i*o).set(a)}}}class n{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,t){return this._appendField(e,i.Eu,t),this}vec2f64(e,t){return this._appendField(e,i.q6,t),this}vec3f(e,t){return this._appendField(e,i.ct,t),this}vec3f64(e,t){return this._appendField(e,i.fP,t),this}vec4f(e,t){return this._appendField(e,i.ek,t),this}vec4f64(e,t){return this._appendField(e,i.Cd,t),this}mat3f(e,t){return this._appendField(e,i.gK,t),this}mat3f64(e,t){return this._appendField(e,i.ey,t),this}mat4f(e,t){return this._appendField(e,i.bj,t),this}mat4f64(e,t){return this._appendField(e,i.O1,t),this}vec4u8(e,t){return this._appendField(e,i.mc,t),this}f32(e,t){return this._appendField(e,i.ly,t),this}f64(e,t){return this._appendField(e,i.oS,t),this}u8(e,t){return this._appendField(e,i.D_,t),this}u16(e,t){return this._appendField(e,i.av,t),this}i8(e,t){return this._appendField(e,i.Hz,t),this}vec2i8(e,t){return this._appendField(e,i.Vs,t),this}vec2i16(e,t){return this._appendField(e,i.or,t),this}vec2u8(e,t){return this._appendField(e,i.xA,t),this}vec4u16(e,t){return this._appendField(e,i.v6,t),this}u32(e,t){return this._appendField(e,i.Nu,t),this}_appendField(e,t,r){const i=t.ElementCount*(0,o.n1)(t.ElementType),a=this.stride;this.fields.set(e,{size:i,constructor:t,offset:a,optional:r}),this.stride+=i,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.includes(e)}createBuffer(e){return new a(this,e)}createView(e){return new a(this,e)}clone(){const e=new n;return e.stride=this.stride,e.fields=new Map,this.fields.forEach(((t,r)=>e.fields.set(r,t))),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}}function s(){return new n}},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>d});var i=r(55039),o=r(2095),a=r(19693),n=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new a.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
182
182
  return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
183
183
  }`)}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(n.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.H.Depth:case i.H.Shadow:case i.H.ShadowHighlight:case i.H.ShadowExludeHighlight:return e.include(o.up,t),s(e),l(e),c(e),void r.code.add(n.H`void forwardLinearDepth() {
184
184
  linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
@@ -249,7 +249,7 @@ return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGH
249
249
  }`,a=t.hasSliceHighlight?c.H`
250
250
  ${o}
251
251
  #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
252
- `:c.H`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.code.add(i),e.fragment.code.add(i),e.fragment.code.add(a)}(e,t,[new l.B("slicePlaneOrigin",((e,r)=>function(e,t,r){if((0,i.Wi)(r.slicePlane))return s.Z;const o=u(e,t,r),a=h(o,r.slicePlane),l=f(e,o,r);return(0,i.pC)(l)?(0,n.m)(g,a,l):a}(t,e,r))),new l.B("slicePlaneBasis1",((e,r)=>m(t,e,r,(0,i.Wg)(r.slicePlane)?.basis1))),new l.B("slicePlaneBasis2",((e,r)=>m(t,e,r,(0,i.Wg)(r.slicePlane)?.basis2)))])}function u(e,t,r){return e.instancedDoublePrecision?(0,n.s)(p,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function h(e,t){return(0,i.pC)(e)?(0,n.b)(g,t.origin,e):t.origin}function f(e,t,r){return e.hasSliceTranslatedView?(0,i.pC)(t)?(0,o.v)(v,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function m(e,t,r,o){if((0,i.Wi)(o)||(0,i.Wi)(r.slicePlane))return s.Z;const a=u(e,t,r),l=h(a,r.slicePlane),c=f(e,a,r);return(0,i.pC)(c)?((0,n.a)(_,o,l),(0,n.m)(g,l,c),(0,n.m)(_,_,c),(0,n.b)(_,_,g)):o}const p=(0,s.c)(),g=(0,s.c)(),_=(0,s.c)(),v=(0,a.c)()},77171:(e,t,r)=>{r.d(t,{w:()=>a});var i=r(1391),o=r(74709);function a(e,t){if((0,i.bA)(e),t.hasModelTransformation)return e.vertex.code.add(o.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, mat4 model, vec3 pos, vec2 nearFar, out float depth) {
252
+ `:c.H`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.code.add(i),e.fragment.code.add(i),e.fragment.code.add(a)}(e,t,[new l.B("slicePlaneOrigin",((e,r)=>function(e,t,r){if((0,i.Wi)(r.slicePlane))return s.Z;const o=u(e,t,r),a=h(o,r.slicePlane),l=f(e,o,r);return(0,i.pC)(l)?(0,n.v)(g,a,l):a}(t,e,r))),new l.B("slicePlaneBasis1",((e,r)=>m(t,e,r,(0,i.Wg)(r.slicePlane)?.basis1))),new l.B("slicePlaneBasis2",((e,r)=>m(t,e,r,(0,i.Wg)(r.slicePlane)?.basis2)))])}function u(e,t,r){return e.instancedDoublePrecision?(0,n.s)(p,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function h(e,t){return(0,i.pC)(e)?(0,n.b)(g,t.origin,e):t.origin}function f(e,t,r){return e.hasSliceTranslatedView?(0,i.pC)(t)?(0,o.v)(v,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function m(e,t,r,o){if((0,i.Wi)(o)||(0,i.Wi)(r.slicePlane))return s.Z;const a=u(e,t,r),l=h(a,r.slicePlane),c=f(e,a,r);return(0,i.pC)(c)?((0,n.a)(_,o,l),(0,n.v)(g,l,c),(0,n.v)(_,_,c),(0,n.b)(_,_,g)):o}const p=(0,s.c)(),g=(0,s.c)(),_=(0,s.c)(),v=(0,a.c)()},77171:(e,t,r)=>{r.d(t,{w:()=>a});var i=r(1391),o=r(74709);function a(e,t){if((0,i.bA)(e),t.hasModelTransformation)return e.vertex.code.add(o.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, mat4 model, vec3 pos, vec2 nearFar, out float depth) {
253
253
  vec4 eye = view * (model * vec4(pos, 1.0));
254
254
  depth = calculateLinearDepth(nearFar, eye.z);
255
255
  return proj * eye;