@arcgis/core 4.25.0-next.20220919 → 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.
- package/AggregateGraphic.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{9f31ab2247c9defb882c.js → 01ac91fc0bc6b4d4e3c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{d26108352874af0b6762.js → 053564e659222e8f0efb.js} +1 -1
- package/assets/esri/core/workers/chunks/1c65fd714f637ac1ee8c.js +1 -0
- package/assets/esri/core/workers/chunks/{8588cbecb8e808f451fe.js → 249e32af1f2d433fae4c.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b16b30ac3166f33e81e.js → 26690f4ec1f3cb8099c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{be93b0cef85665446944.js → 274b4cdf6c8d77e8a2e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{52dcfd6b8b1dfa864e44.js → 2cae0ec5f60ab42a49aa.js} +1 -1
- package/assets/esri/core/workers/chunks/43e4560d65e5ddeeef6f.js +1 -0
- package/assets/esri/core/workers/chunks/{f436c86f86236ea7ea04.js → 4641e10e0e8e9d257521.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a45333de9ded92619c2.js → 466008f793c2e11e854c.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9d655675552dcf6cef7.js → 4a699b41072ee88f0956.js} +1 -1
- package/assets/esri/core/workers/chunks/{14ea96e398f4842abe4e.js → 4fdd18f5cdaa0d82ebc1.js} +1 -1
- package/assets/esri/core/workers/chunks/{9662da3e1e37f3445186.js → 562b9619b8ee13734813.js} +1 -1
- package/assets/esri/core/workers/chunks/{5c1a5615c865c10209c2.js → 5880fa48bad79a7c93ab.js} +1 -1
- package/assets/esri/core/workers/chunks/58824250492b89ec24ea.js +1 -0
- package/assets/esri/core/workers/chunks/64a6b837f1d5d7ad7619.js +1 -0
- package/assets/esri/core/workers/chunks/{421241543afbc9a619ea.js → 64de93865088bbe0398f.js} +1 -1
- package/assets/esri/core/workers/chunks/{99d56a707039d645622c.js → 6a20d8740ec2a5b2c579.js} +1 -1
- package/assets/esri/core/workers/chunks/{8bab21bc6164a593278f.js → 771b92e524802de840ba.js} +1 -1
- package/assets/esri/core/workers/chunks/{dbb1bf97c85848bb8ce1.js → 7ce250cc6fbe68aef50d.js} +32 -32
- package/assets/esri/core/workers/chunks/{2c4938512dd726a177dd.js → 7fab18074b130b71a648.js} +1 -1
- package/assets/esri/core/workers/chunks/{f67357b3c6c591c9da5e.js → 872f1cb3596fb80e387f.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ee81834b3217720cb48.js → 8874e69378a27d155f9d.js} +1 -1
- package/assets/esri/core/workers/chunks/{31de71018575457155e5.js → 8ee3da8677255b8c8709.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e44aee22e70857b893c.js → 93631b10452b0e0189b3.js} +1 -1
- package/assets/esri/core/workers/chunks/{cb2dc84d972469445da6.js → 95cd9edca50ea163d50f.js} +1 -1
- package/assets/esri/core/workers/chunks/{d31bbb13af45ce8e45dc.js → acf9f753741b677afb44.js} +1 -1
- package/assets/esri/core/workers/chunks/{1455944edeba1560eb07.js → afdafa77f5ca1b9e3acc.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf3e1ac63580bc495ea6.js → b4da35f1093f3731f9ac.js} +1 -1
- package/assets/esri/core/workers/chunks/{09f4296dcb80e3ae4b3d.js → b8eba8c9d5424a7ae5f2.js} +1 -1
- package/assets/esri/core/workers/chunks/bb0d86937faf0cd7d16d.js +1 -0
- package/assets/esri/core/workers/chunks/bf3e80023e156d5906c7.js +1 -0
- package/assets/esri/core/workers/chunks/{8ba83fee56dd4f306d87.js → c2a6ac7046134f725cf3.js} +1 -1
- package/assets/esri/core/workers/chunks/{5d3fabe66e1bce1b30fb.js → cc7569489b572b8b3b53.js} +1 -1
- package/assets/esri/core/workers/chunks/{fddd4ea487788e003fb1.js → d09f06eb4157a7c2c8ab.js} +1 -1
- package/assets/esri/core/workers/chunks/d1be3ab7846e3a555b6c.js +1 -0
- package/assets/esri/core/workers/chunks/e064035f959d68e9603f.js +1 -0
- package/assets/esri/core/workers/chunks/{d92975e56a1290255252.js → e09df62cf35d636b0975.js} +1 -1
- package/assets/esri/core/workers/chunks/{674fa5b93704ef08c9e8.js → e0c763e05feb1c2093ba.js} +1 -1
- package/assets/esri/core/workers/chunks/e20e99f8f76f5002437e.js +1 -0
- package/assets/esri/core/workers/chunks/{51289d2f5277af4023e9.js → ed33e019bc7775db2e50.js} +1 -1
- package/assets/esri/core/workers/chunks/ef95d6ab7b1c032ab4ad.js +1 -0
- package/assets/esri/core/workers/chunks/{48aa432e1bf60c68de14.js → f0c4b408a0b88adf6576.js} +1 -1
- package/assets/esri/core/workers/chunks/{169f4354a375db5de121.js → ffcbcb928b6cb8c596ad.js} +1 -1
- package/assets/esri/t9n/common_ar.json +1 -1
- package/assets/esri/t9n/common_bg.json +1 -1
- package/assets/esri/t9n/common_bs.json +1 -1
- package/assets/esri/t9n/common_ca.json +1 -1
- package/assets/esri/t9n/common_cs.json +1 -1
- package/assets/esri/t9n/common_da.json +1 -1
- package/assets/esri/t9n/common_de.json +1 -1
- package/assets/esri/t9n/common_el.json +1 -1
- package/assets/esri/t9n/common_es.json +1 -1
- package/assets/esri/t9n/common_et.json +1 -1
- package/assets/esri/t9n/common_fi.json +1 -1
- package/assets/esri/t9n/common_fr.json +1 -1
- package/assets/esri/t9n/common_he.json +1 -1
- package/assets/esri/t9n/common_hr.json +1 -1
- package/assets/esri/t9n/common_hu.json +1 -1
- package/assets/esri/t9n/common_id.json +1 -1
- package/assets/esri/t9n/common_it.json +1 -1
- package/assets/esri/t9n/common_ja.json +1 -1
- package/assets/esri/t9n/common_ko.json +1 -1
- package/assets/esri/t9n/common_lt.json +1 -1
- package/assets/esri/t9n/common_lv.json +1 -1
- package/assets/esri/t9n/common_nb.json +1 -1
- package/assets/esri/t9n/common_nl.json +1 -1
- package/assets/esri/t9n/common_pl.json +1 -1
- package/assets/esri/t9n/common_pt-BR.json +1 -1
- package/assets/esri/t9n/common_pt-PT.json +1 -1
- package/assets/esri/t9n/common_ro.json +1 -1
- package/assets/esri/t9n/common_ru.json +1 -1
- package/assets/esri/t9n/common_sk.json +1 -1
- package/assets/esri/t9n/common_sl.json +1 -1
- package/assets/esri/t9n/common_sr.json +1 -1
- package/assets/esri/t9n/common_sv.json +1 -1
- package/assets/esri/t9n/common_th.json +1 -1
- package/assets/esri/t9n/common_tr.json +1 -1
- package/assets/esri/t9n/common_uk.json +1 -1
- package/assets/esri/t9n/common_vi.json +1 -1
- package/assets/esri/t9n/common_zh-CN.json +1 -1
- package/assets/esri/t9n/common_zh-HK.json +1 -1
- package/assets/esri/t9n/common_zh-TW.json +1 -1
- package/assets/esri/themes/base/widgets/_Daylight.scss +1 -0
- package/assets/esri/themes/base/widgets/_Directions.scss +1 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
- package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
- package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_ar.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_bg.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_bs.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_ca.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_cs.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_da.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_de.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_el.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_es.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_et.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_fi.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_fr.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_he.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_hr.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_hu.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_id.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_it.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_ja.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_ko.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_lt.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_lv.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_nb.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_nl.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_pl.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_pt-BR.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_pt-PT.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_ro.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_ru.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_sk.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_sl.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_sr.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_sv.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_th.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_tr.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_uk.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_vi.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_zh-CN.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_zh-HK.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_zh-TW.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_ar.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_bg.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_bs.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_ca.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_cs.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_da.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_de.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_el.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_es.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_et.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_fi.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_fr.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_he.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_hr.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_hu.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_id.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_it.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_ja.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_ko.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_lt.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_lv.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_nb.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_nl.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_pl.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_pt-BR.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_pt-PT.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_ro.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_ru.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_sk.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_sl.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_sr.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_sv.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_th.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_tr.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_uk.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_vi.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_zh-CN.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_zh-HK.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_zh-TW.json +1 -1
- package/chunks/CheckerBoard.glsl.js +3 -3
- package/chunks/ColorMaterial.glsl.js +5 -5
- package/chunks/ComponentShader.glsl.js +1 -1
- package/chunks/Compositing.glsl.js +4 -19
- package/chunks/DefaultMaterial.glsl.js +2 -2
- package/chunks/HUDCompositing.glsl.js +7 -0
- package/chunks/HeatmapDensity.glsl.js +4 -4
- package/chunks/ImageMaterial.glsl.js +1 -1
- package/chunks/Laserlines.glsl.js +5 -5
- package/chunks/LineMarker.glsl.js +1 -1
- package/chunks/MeasurementArrow.glsl.js +3 -3
- package/chunks/NativeLine.glsl.js +1 -1
- package/chunks/OITCompositing.glsl.js +13 -0
- package/chunks/OverlayCompositing.glsl.js +8 -0
- package/chunks/Path.glsl.js +3 -3
- package/chunks/Pattern.glsl.js +1 -1
- package/chunks/Precipitation.glsl.js +3 -3
- package/chunks/RealisticTree.glsl.js +2 -2
- package/chunks/RibbonLine.glsl.js +25 -25
- package/chunks/ShadedColorMaterial.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +1 -1
- package/chunks/SlicePlaneMaterial.glsl.js +2 -2
- package/chunks/Terrain.glsl.js +4 -4
- package/chunks/WaterSurface.glsl.js +1 -1
- package/chunks/ar.js +1 -1
- package/chunks/bg_BG.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/bs_BA.js +1 -1
- package/chunks/ca_ES.js +1 -1
- package/chunks/cameraUtilsPlanar.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/cs_CZ.js +1 -1
- package/chunks/da_DK.js +1 -1
- package/chunks/de_CH.js +1 -1
- package/chunks/de_DE.js +1 -1
- package/chunks/el_GR.js +1 -1
- package/chunks/en_CA.js +1 -1
- package/chunks/en_US.js +1 -1
- package/chunks/es_ES.js +1 -1
- package/chunks/et_EE.js +1 -1
- package/chunks/fi_FI.js +1 -1
- package/chunks/fr_FR.js +1 -1
- package/chunks/he_IL.js +1 -1
- package/chunks/hr_HR.js +1 -1
- package/chunks/hu_HU.js +1 -1
- package/chunks/id_ID.js +1 -1
- package/chunks/index.js +1 -1
- package/chunks/it_IT.js +1 -1
- package/chunks/ja_JP.js +1 -1
- package/chunks/ko_KR.js +1 -1
- package/chunks/lt_LT.js +1 -1
- package/chunks/lv_LV.js +1 -1
- package/chunks/mat3.js +1 -1
- package/chunks/nb_NO.js +1 -1
- package/chunks/nl_NL.js +1 -1
- package/chunks/pl_PL.js +1 -1
- package/chunks/pt_BR.js +1 -1
- package/chunks/pt_PT.js +1 -1
- package/chunks/quat.js +1 -1
- package/chunks/quat2.js +1 -1
- package/chunks/quatf64.js +1 -1
- package/chunks/ro_RO.js +1 -1
- package/chunks/ru_RU.js +1 -1
- package/chunks/sk_SK.js +1 -1
- package/chunks/sl_SL.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/sr_RS.js +1 -1
- package/chunks/sv_SE.js +1 -1
- package/chunks/th_TH.js +1 -1
- package/chunks/tr_TR.js +1 -1
- package/chunks/uk_UA.js +1 -1
- package/chunks/vec3.js +1 -1
- package/chunks/vec3f32.js +1 -1
- package/chunks/vec4f64.js +1 -1
- package/chunks/vi_VN.js +1 -1
- package/chunks/zh_Hans.js +1 -1
- package/chunks/zh_Hant.js +1 -1
- package/core/VectorStack.js +1 -1
- package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
- package/core/libs/gl-matrix-2/factories/vec3f32.js +1 -1
- package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
- package/core/libs/gl-matrix-2/math/mat3.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/perspectiveUtils.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/geohash/GeohashTree.js +1 -1
- package/geometry/support/MeshTransform.js +1 -1
- package/geometry/support/axisAngle.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
- package/geometry/support/meshUtils/georeference.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/geometry/support/meshUtils/projection.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +70 -0
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/mixins/OperationalLayer.js +1 -1
- package/layers/support/AggregateField.js +1 -1
- package/layers/support/ControlPointsGeoreference.js +1 -1
- package/layers/support/ExportImageServiceParameters.js +1 -1
- package/layers/support/OutStatistic.js +1 -1
- package/layers/support/VoxelVolume.js +1 -1
- package/layers/support/voxelPlaneUtils.js +1 -1
- package/package.json +1 -1
- package/rest/support/AggregateFeatureSet.js +5 -0
- package/support/revision.js +1 -1
- package/views/2d/ViewState.js +1 -1
- package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
- package/views/2d/engine/imagery/RasterVFTile.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/webgl/OverlayContainer.js +1 -1
- package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
- package/views/2d/engine/webgl/WGLTile.js +1 -1
- package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/schemaUtils.js +1 -1
- package/views/2d/layers/features/support/BinStore.js +1 -1
- package/views/2d/layers/features/support/ClusterStore.js +1 -1
- package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
- package/views/2d/layers/imagery/ImageryView2D.js +1 -1
- package/views/2d/layers/support/DebugOverlay.js +1 -1
- package/views/2d/layers/support/ExportStrategy.js +1 -1
- package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
- package/views/2d/layers/support/clusterUtils.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimensioning/DimensioningTool.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionComputation.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimensioning/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/CloudsCompositionParameters.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/CloudsPresets.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/weatherUtils.js +1 -1
- package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
- package/views/3d/externalRenderers/RenderContext.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/editingTools/settings.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
- package/views/3d/interactive/manipulatorUtils.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/ImageryLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/elevationAlignPointsInFeatures.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/I3STreeDebugger.js +1 -1
- package/views/3d/layers/support/edgeUtils.js +1 -1
- package/views/3d/layers/support/uvUtils.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/local/ZoomController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +13 -13
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +9 -9
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
- package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
- package/views/3d/webgl-engine/lib/AnimationTimer.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryRecord.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Highlight.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/Update.js +5 -0
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
- package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +5 -0
- package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/OITCompositingTechnique.js +5 -0
- package/views/3d/webgl-engine/shaders/OverlayCompositing.glsl.js +5 -0
- package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +5 -0
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/snapping/LineSnapper.js +1 -1
- package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/SnappingCandidateElevationAligner.js +1 -1
- package/views/interactive/snapping/featureSources/SnappingResultElevationFilter.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/snappingResultElevationUtils.js +5 -0
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/widgets/Directions/support/resources.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
- package/widgets/ElevationProfile/support/constants.js +1 -1
- package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Weather/LabeledSlider.js +1 -1
- package/widgets/Weather.js +1 -1
- package/assets/esri/core/workers/chunks/0059699bf824f851d51c.js +0 -1
- package/assets/esri/core/workers/chunks/01a6005569d0820992a0.js +0 -1
- package/assets/esri/core/workers/chunks/2eb547a0be305f2c816c.js +0 -1
- package/assets/esri/core/workers/chunks/36dd5654df5c7f00406d.js +0 -1
- package/assets/esri/core/workers/chunks/36e0a0d5f86b2b4b88f9.js +0 -1
- package/assets/esri/core/workers/chunks/8b8a813f5e6d6551a816.js +0 -1
- package/assets/esri/core/workers/chunks/bf84189bd9bf3de81df9.js +0 -1
- package/assets/esri/core/workers/chunks/cd7f5c3d328166f28f59.js +0 -1
- package/assets/esri/core/workers/chunks/de128d8a643b4297940b.js +0 -1
- package/assets/esri/core/workers/chunks/e208d9c34f5db4481441.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2533],{32078:(e,t,r)=>{r.d(t,{D:()=>k,b:()=>W});var i=r(70586),o=r(13598),a=r(1391),n=r(62707),s=r(55039),l=r(51546),c=r(77171),d=r(47624),u=r(64267),h=r(37099),f=r(76056),m=r(135),p=r(11317),g=r(15719),_=r(92555),v=r(89136),x=r(15817),T=r(66242),b=r(89753),A=r(5802),E=r(83603),w=r(19419),S=r(26322),C=r(85504),R=r(22539),y=r(57806),M=r(82550),O=r(96310),N=r(85787),P=r(90692),I=r(93669),D=r(172),L=r(71250),F=r(21437),H=r(74709),B=r(8319),U=r(33680),z=r(98069),V=r(93144),G=r(35065);function W(e){const t=new U.kG,{vertex:r,fragment:W,varyings:k}=t;return(0,I.Sv)(
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2533],{32078:(e,t,r)=>{r.d(t,{D:()=>k,b:()=>W});var i=r(70586),o=r(13598),a=r(1391),n=r(62707),s=r(55039),l=r(51546),c=r(77171),d=r(47624),u=r(64267),h=r(37099),f=r(76056),m=r(135),p=r(11317),g=r(15719),_=r(92555),v=r(89136),x=r(15817),T=r(66242),b=r(89753),A=r(5802),E=r(83603),w=r(19419),S=r(26322),C=r(85504),R=r(22539),y=r(57806),M=r(82550),O=r(96310),N=r(85787),P=r(90692),I=r(93669),D=r(172),L=r(71250),F=r(21437),H=r(74709),B=r(8319),U=r(33680),z=r(98069),V=r(93144),G=r(35065);function W(e){const t=new U.kG,{vertex:r,fragment:W,varyings:k}=t;return(0,I.Sv)(r,e),t.include(h.f),k.add("vpos","vec3"),t.include(M.k,e),t.include(d.f,e),t.include(_.L,e),e.hasColorTextureTransform&&t.include(y.av),e.output!==s.H.Color&&e.output!==s.H.Alpha||(e.hasNormalTextureTransform&&t.include(y.NI),e.hasEmissionTextureTransform&&t.include(y.R5),e.hasOcclusionTextureTransform&&t.include(y.jF),e.hasMetallicRoughnessTextureTransform&&t.include(y.DT),(0,I.hY)(r,e),t.include(u.O,e),t.include(c.w,e),e.normalType===u.h.Attribute&&e.offsetBackfaces&&t.include(n.w),t.include(x.Q,e),t.include(g.Bb,e),e.instancedColor&&t.attributes.add(G.T.INSTANCECOLOR,"vec4"),k.add("localvpos","vec3"),t.include(m.D,e),t.include(a.qj,e),t.include(f.R,e),t.include(p.c,e),r.uniforms.add(new L.N("externalColor",(e=>e.externalColor))),k.add("vcolorExt","vec4"),e.hasMultipassTerrain&&k.add("depth","float"),e.hasModelTransformation&&r.uniforms.add(new B.g("model",(e=>(0,i.pC)(e.modelTransformation)?e.modelTransformation:o.I))),r.code.add(H.H`
|
|
2
2
|
void main(void) {
|
|
3
3
|
forwardNormalizedVertexColor();
|
|
4
4
|
vcolorExt = externalColor;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
${e.hasVertexColors?H.H`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:H.H`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
|
|
41
41
|
gl_FragColor = vec4(opacity_);
|
|
42
42
|
}
|
|
43
|
-
`)),e.output===s.H.Color&&(t.include(l.f5,e),t.include(b.XP,e),t.include(T.K,e),t.include(N.z,e),t.include(e.instancedDoublePrecision?R.hb:R.XE,e),t.include(E.l,e),(0,I.hY)(W,e),W.uniforms.add([r.uniforms.get("localOrigin"),new D.J("ambient",(e=>e.ambient)),new D.J("diffuse",(e=>e.diffuse)),new F.p("opacity",(e=>e.opacity)),new F.p("layerOpacity",(e=>e.layerOpacity))]),e.hasColorTexture&&W.uniforms.add(new z.A("tex",(e=>e.texture))),t.include(C.jV,e),t.include(S.T,e),W.include(P.y),t.include(w.k,e),(0,b.PN)(
|
|
43
|
+
`)),e.output===s.H.Color&&(t.include(l.f5,e),t.include(b.XP,e),t.include(T.K,e),t.include(N.z,e),t.include(e.instancedDoublePrecision?R.hb:R.XE,e),t.include(E.l,e),(0,I.hY)(W,e),W.uniforms.add([r.uniforms.get("localOrigin"),new D.J("ambient",(e=>e.ambient)),new D.J("diffuse",(e=>e.diffuse)),new F.p("opacity",(e=>e.opacity)),new F.p("layerOpacity",(e=>e.layerOpacity))]),e.hasColorTexture&&W.uniforms.add(new z.A("tex",(e=>e.texture))),t.include(C.jV,e),t.include(S.T,e),W.include(P.y),t.include(w.k,e),(0,b.PN)(W),(0,b.sC)(W),(0,A.F1)(W),W.code.add(H.H`
|
|
44
44
|
void main() {
|
|
45
45
|
discardBySlice(vpos);
|
|
46
46
|
${e.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""}
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
|
|
92
92
|
${e.transparencyPassType===V.A.Color?H.H`gl_FragColor = premultiplyAlpha(gl_FragColor);`:""}
|
|
93
93
|
}
|
|
94
|
-
`)),t.include(v.s,e),t}const k=Object.freeze(Object.defineProperty({__proto__:null,build:W},Symbol.toStringTag,{value:"Module"}))},41846:(e,t,r)=>{r.d(t,{R:()=>H,b:()=>F});var i=r(1391),o=r(62707),a=r(55039),n=r(51546),s=r(77171),l=r(47624),c=r(64267),d=r(37099),u=r(76056),h=r(135),f=r(11317),m=r(92555),p=r(89136),g=r(66242),_=r(89753),v=r(5802),x=r(83603),T=r(26322),b=r(85504),A=r(22539),E=r(82550),w=r(96310),S=r(85787),C=r(90692),R=r(93669),y=r(172),M=r(71250),O=r(21437),N=r(74709),P=r(33680),I=r(98069),D=r(93144),L=r(35065);function F(e){const t=new P.kG,{vertex:r,fragment:F,varyings:H}=t;return(0,R.Sv)(
|
|
94
|
+
`)),t.include(v.s,e),t}const k=Object.freeze(Object.defineProperty({__proto__:null,build:W},Symbol.toStringTag,{value:"Module"}))},41846:(e,t,r)=>{r.d(t,{R:()=>H,b:()=>F});var i=r(1391),o=r(62707),a=r(55039),n=r(51546),s=r(77171),l=r(47624),c=r(64267),d=r(37099),u=r(76056),h=r(135),f=r(11317),m=r(92555),p=r(89136),g=r(66242),_=r(89753),v=r(5802),x=r(83603),T=r(26322),b=r(85504),A=r(22539),E=r(82550),w=r(96310),S=r(85787),C=r(90692),R=r(93669),y=r(172),M=r(71250),O=r(21437),N=r(74709),P=r(33680),I=r(98069),D=r(93144),L=r(35065);function F(e){const t=new P.kG,{vertex:r,fragment:F,varyings:H}=t;return(0,R.Sv)(r,e),t.include(d.f),H.add("vpos","vec3"),t.include(E.k,e),t.include(l.f,e),t.include(m.L,e),e.output!==a.H.Color&&e.output!==a.H.Alpha||((0,R.hY)(t.vertex,e),t.include(c.O,e),t.include(s.w,e),e.offsetBackfaces&&t.include(o.w),e.instancedColor&&t.attributes.add(L.T.INSTANCECOLOR,"vec4"),H.add("vNormalWorld","vec3"),H.add("localvpos","vec3"),e.hasMultipassTerrain&&H.add("depth","float"),t.include(h.D,e),t.include(i.qj,e),t.include(u.R,e),t.include(f.c,e),r.uniforms.add(new M.N("externalColor",(e=>e.externalColor))),H.add("vcolorExt","vec4"),r.code.add(N.H`
|
|
95
95
|
void main(void) {
|
|
96
96
|
forwardNormalizedVertexColor();
|
|
97
97
|
vcolorExt = externalColor;
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
|
|
128
128
|
gl_FragColor = vec4(opacity_);
|
|
129
129
|
}
|
|
130
|
-
`)),e.output===a.H.Color&&(t.include(n.f5,e),t.include(_.XP,e),t.include(g.K,e),t.include(S.z,e),t.include(e.instancedDoublePrecision?A.hb:A.XE,e),t.include(x.l,e),(0,R.hY)(t.fragment,e),(0,v.Pe)(F),(0,_.PN)(
|
|
130
|
+
`)),e.output===a.H.Color&&(t.include(n.f5,e),t.include(_.XP,e),t.include(g.K,e),t.include(S.z,e),t.include(e.instancedDoublePrecision?A.hb:A.XE,e),t.include(x.l,e),(0,R.hY)(t.fragment,e),(0,v.Pe)(F),(0,_.PN)(F),(0,_.sC)(F),F.uniforms.add([r.uniforms.get("localOrigin"),r.uniforms.get("view"),new y.J("ambient",(e=>e.ambient)),new y.J("diffuse",(e=>e.diffuse)),new O.p("opacity",(e=>e.opacity)),new O.p("layerOpacity",(e=>e.layerOpacity))]),e.hasColorTexture&&F.uniforms.add(new I.A("tex",(e=>e.texture))),t.include(b.jV,e),t.include(T.T,e),F.include(C.y),t.extensions.add("GL_OES_standard_derivatives"),(0,v.F1)(F),F.code.add(N.H`
|
|
131
131
|
void main() {
|
|
132
132
|
discardBySlice(vpos);
|
|
133
133
|
${e.hasMultipassTerrain?N.H`terrainDepthTest(gl_FragCoord, depth);`:""}
|
|
@@ -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.
|
|
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;
|
|
@@ -275,7 +275,7 @@ return proj * (view * vec4(pos, 1.0));
|
|
|
275
275
|
vec3 dpNormal(vec4 _normal) {
|
|
276
276
|
${t.instancedDoublePrecision?"return normalize(modelNormal * _normal.xyz);":"return normalize(_normal.xyz);"}
|
|
277
277
|
}
|
|
278
|
-
`),t.output===n.H.Normal&&((0,l._8)(
|
|
278
|
+
`),t.output===n.H.Normal&&((0,l._8)(r),r.code.add(d.H`
|
|
279
279
|
vec3 dpNormalView(vec4 _normal) {
|
|
280
280
|
${t.instancedDoublePrecision?"return normalize((viewNormal * vec4(modelNormal * _normal.xyz, 1.0)).xyz);":"return normalize((viewNormal * _normal).xyz);"}
|
|
281
281
|
}
|
|
@@ -466,7 +466,7 @@ gl_FragColor = occludedHighlightFlag;
|
|
|
466
466
|
else {
|
|
467
467
|
gl_FragColor = unoccludedHighlightFlag;
|
|
468
468
|
}
|
|
469
|
-
}`)}var E=r(82550),w=r(85787),S=r(93669),C=r(8319),R=r(47026);function y(e,t){const
|
|
469
|
+
}`)}var E=r(82550),w=r(85787),S=r(93669),C=r(8319),R=r(47026);function y(e,t){const{vertex:r,fragment:u}=e,p=t.hasModelTransformation;p&&r.uniforms.add(new C.g("model",(e=>(0,i.pC)(e.modelTransformation)?e.modelTransformation:o.I)));const _=t.hasColorTexture&&t.alphaDiscardMode!==R.JJ.Opaque;switch(t.output){case n.H.Depth:case n.H.Shadow:case n.H.ShadowHighlight:case n.H.ShadowExludeHighlight:case n.H.ObjectAndLayerIdColor:(0,S.Sv)(r,t),e.include(l.w,t),e.include(f.D,t),e.include(E.k,t),e.include(g,t),e.include(s.f5,t),e.include(h,t),(0,a.Zu)(e),e.varyings.add("depth","float"),_&&u.uniforms.add(new x.A("tex",(e=>e.texture))),r.code.add(d.H`
|
|
470
470
|
void main(void) {
|
|
471
471
|
vpos = calculateVPos();
|
|
472
472
|
vpos = subtractOrigin(vpos);
|
|
@@ -475,7 +475,7 @@ gl_FragColor = unoccludedHighlightFlag;
|
|
|
475
475
|
forwardTextureCoordinates();
|
|
476
476
|
forwardObjectAndLayerIdColor();
|
|
477
477
|
}
|
|
478
|
-
`),e.include(w.z,t),u.add(d.H`
|
|
478
|
+
`),e.include(w.z,t),u.code.add(d.H`
|
|
479
479
|
void main(void) {
|
|
480
480
|
discardBySlice(vpos);
|
|
481
481
|
${_?d.H`
|
|
@@ -483,7 +483,7 @@ gl_FragColor = unoccludedHighlightFlag;
|
|
|
483
483
|
discardOrAdjustAlpha(texColor);`:""}
|
|
484
484
|
${t.output===n.H.ObjectAndLayerIdColor?d.H`outputObjectAndLayerIdColor();`:d.H`outputDepth(depth);`}
|
|
485
485
|
}
|
|
486
|
-
`);break;case n.H.Normal:(0,S.Sv)(
|
|
486
|
+
`);break;case n.H.Normal:(0,S.Sv)(r,t),e.include(l.w,t),e.include(c.O,t),e.include(m.Bb,t),e.include(f.D,t),e.include(E.k,t),_&&u.uniforms.add(new x.A("tex",(e=>e.texture))),e.varyings.add("vPositionView","vec3"),r.code.add(d.H`
|
|
487
487
|
void main(void) {
|
|
488
488
|
vpos = calculateVPos();
|
|
489
489
|
vpos = subtractOrigin(vpos);
|
|
@@ -493,7 +493,7 @@ gl_FragColor = unoccludedHighlightFlag;
|
|
|
493
493
|
gl_Position = transformPosition(proj, view, ${p?"model,":""} vpos);
|
|
494
494
|
forwardTextureCoordinates();
|
|
495
495
|
}
|
|
496
|
-
`),e.include(s.f5,t),e.include(w.z,t),u.add(d.H`
|
|
496
|
+
`),e.include(s.f5,t),e.include(w.z,t),u.code.add(d.H`
|
|
497
497
|
void main() {
|
|
498
498
|
discardBySlice(vpos);
|
|
499
499
|
${_?d.H`
|
|
@@ -506,7 +506,7 @@ gl_FragColor = unoccludedHighlightFlag;
|
|
|
506
506
|
if (gl_FrontFacing == false) normal = -normal;`}
|
|
507
507
|
gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);
|
|
508
508
|
}
|
|
509
|
-
`);break;case n.H.Highlight:(0,S.Sv)(
|
|
509
|
+
`);break;case n.H.Highlight:(0,S.Sv)(r,t),e.include(l.w,t),e.include(f.D,t),e.include(E.k,t),_&&u.uniforms.add(new x.A("tex",(e=>e.texture))),r.code.add(d.H`
|
|
510
510
|
void main(void) {
|
|
511
511
|
vpos = calculateVPos();
|
|
512
512
|
vpos = subtractOrigin(vpos);
|
|
@@ -514,7 +514,7 @@ gl_FragColor = unoccludedHighlightFlag;
|
|
|
514
514
|
gl_Position = transformPosition(proj, view, ${p?"model,":""} vpos);
|
|
515
515
|
forwardTextureCoordinates();
|
|
516
516
|
}
|
|
517
|
-
`),e.include(s.f5,t),e.include(w.z,t),e.include(A),u.add(d.H`
|
|
517
|
+
`),e.include(s.f5,t),e.include(w.z,t),e.include(A),u.code.add(d.H`
|
|
518
518
|
void main() {
|
|
519
519
|
discardBySlice(vpos);
|
|
520
520
|
${_?d.H`
|
|
@@ -556,10 +556,10 @@ return 1.0 - texture2D(ssaoTex, (gl_FragCoord.xy - viewportPixelSz.xy) * viewpor
|
|
|
556
556
|
float evaluateAmbientOcclusionInverse() {
|
|
557
557
|
return texture2D(ssaoTex, (gl_FragCoord.xy - viewportPixelSz.xy) * viewportPixelSz.zw).a;
|
|
558
558
|
}`)):r.code.add(n.H`float evaluateAmbientOcclusion() { return 0.0; }
|
|
559
|
-
float evaluateAmbientOcclusionInverse() { return 1.0; }`)}const c=(0,o.c)()},89753:(e,t,r)=>{r.d(t,{XP:()=>
|
|
559
|
+
float evaluateAmbientOcclusionInverse() { return 1.0; }`)}const c=(0,o.c)()},89753:(e,t,r)=>{r.d(t,{XP:()=>S,PN:()=>E,sC:()=>w});var i=r(74085),o=r(17896),a=r(65617),n=r(98766),s=r(88669),l=r(85504),c=r(172),d=r(71250),u=r(74709);function h(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new c.J("lightingAmbientSH0",((e,t)=>(0,o.s)(f,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
560
560
|
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
561
561
|
return ambientLight * (1.0 - ambientOcclusion);
|
|
562
|
-
}`)):1===
|
|
562
|
+
}`)):1===i?(r.uniforms.add([new d.N("lightingAmbientSH_R",((e,t)=>(0,n.s)(m,t.lighting.sh.r[0],t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3]))),new d.N("lightingAmbientSH_G",((e,t)=>(0,n.s)(m,t.lighting.sh.g[0],t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3]))),new d.N("lightingAmbientSH_B",((e,t)=>(0,n.s)(m,t.lighting.sh.b[0],t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3])))]),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
563
563
|
vec4 sh0 = vec4(
|
|
564
564
|
0.282095,
|
|
565
565
|
0.488603 * normal.x,
|
|
@@ -572,7 +572,7 @@ dot(lightingAmbientSH_G, sh0),
|
|
|
572
572
|
dot(lightingAmbientSH_B, sh0)
|
|
573
573
|
);
|
|
574
574
|
return ambientLight * (1.0 - ambientOcclusion);
|
|
575
|
-
}`)):2===
|
|
575
|
+
}`)):2===i&&(r.uniforms.add([new c.J("lightingAmbientSH0",((e,t)=>(0,o.s)(f,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0]))),new d.N("lightingAmbientSH_R1",((e,t)=>(0,n.s)(m,t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3],t.lighting.sh.r[4]))),new d.N("lightingAmbientSH_G1",((e,t)=>(0,n.s)(m,t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3],t.lighting.sh.g[4]))),new d.N("lightingAmbientSH_B1",((e,t)=>(0,n.s)(m,t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3],t.lighting.sh.b[4]))),new d.N("lightingAmbientSH_R2",((e,t)=>(0,n.s)(m,t.lighting.sh.r[5],t.lighting.sh.r[6],t.lighting.sh.r[7],t.lighting.sh.r[8]))),new d.N("lightingAmbientSH_G2",((e,t)=>(0,n.s)(m,t.lighting.sh.g[5],t.lighting.sh.g[6],t.lighting.sh.g[7],t.lighting.sh.g[8]))),new d.N("lightingAmbientSH_B2",((e,t)=>(0,n.s)(m,t.lighting.sh.b[5],t.lighting.sh.b[6],t.lighting.sh.b[7],t.lighting.sh.b[8])))]),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
576
576
|
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
577
577
|
vec4 sh1 = vec4(
|
|
578
578
|
0.488603 * normal.x,
|
|
@@ -597,24 +597,24 @@ dot(lightingAmbientSH_G2, sh2),
|
|
|
597
597
|
dot(lightingAmbientSH_B2, sh2)
|
|
598
598
|
);
|
|
599
599
|
return ambientLight * (1.0 - ambientOcclusion);
|
|
600
|
-
}`),t.pbrMode!==
|
|
600
|
+
}`),t.pbrMode!==l.f7.Normal&&t.pbrMode!==l.f7.Schematic||r.code.add(u.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
|
|
601
601
|
vec3 calculateAmbientRadiance(float ambientOcclusion)
|
|
602
602
|
{
|
|
603
603
|
vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
|
|
604
604
|
return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
|
|
605
|
-
}`))}const
|
|
605
|
+
}`))}const f=(0,a.c)(),m=(0,s.c)();var p=r(66242),g=r(5802),_=r(26322),v=r(27754),x=r(79884),T=r(67498);class b extends x.x{constructor(e,t){super(e,"bool",T.P.Pass,((r,i,o)=>r.setUniform1b(e,t(i,o))))}}var A=r(21437);function E(e){e.constants.add("ambientBoostFactor","float",.4)}function w(e){e.uniforms.add(new A.p("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function S(e,t){const r=e.fragment;switch(e.include(p.K,t),t.pbrMode!==l.f7.Disabled&&e.include(_.T,t),e.include(h,t),e.include(v.e),r.code.add(u.H`
|
|
606
606
|
const float GAMMA_SRGB = 2.1;
|
|
607
607
|
const float INV_GAMMA_SRGB = 0.4761904;
|
|
608
|
-
${t.pbrMode===
|
|
609
|
-
`),
|
|
608
|
+
${t.pbrMode===l.f7.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
|
|
609
|
+
`),E(r),w(r),(0,g.Pe)(r),r.code.add(u.H`
|
|
610
610
|
float additionalDirectedAmbientLight(vec3 vPosWorld) {
|
|
611
|
-
float vndl = dot(${t.spherical?
|
|
611
|
+
float vndl = dot(${t.spherical?u.H`normalize(vPosWorld)`:u.H`vec3(0.0, 0.0, 1.0)`}, lightingMainDirection);
|
|
612
612
|
return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
|
|
613
613
|
}
|
|
614
|
-
`),(0,
|
|
614
|
+
`),(0,g.F1)(r),r.code.add(u.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
|
|
615
615
|
float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
|
|
616
616
|
return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * lightingMainIntensity;
|
|
617
|
-
}`),t.pbrMode
|
|
617
|
+
}`),t.pbrMode){case l.f7.Disabled:case l.f7.WaterOnIntegratedMesh:case l.f7.Water:e.include(g.kR,t),r.code.add(u.H`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)
|
|
618
618
|
{
|
|
619
619
|
vec3 mainLighting = evaluateMainLighting(normalWorld, shadow);
|
|
620
620
|
vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
|
|
@@ -623,7 +623,7 @@ vec3 totalLight = mainLighting + ambientLighting + additionalLight;
|
|
|
623
623
|
totalLight = min(totalLight, vec3(PI));
|
|
624
624
|
vec3 outColor = vec3((albedoLinear / PI) * totalLight);
|
|
625
625
|
return pow(outColor, vec3(INV_GAMMA_SRGB));
|
|
626
|
-
}`)
|
|
626
|
+
}`);break;case l.f7.Normal:case l.f7.Schematic:r.code.add(u.H`const float fillLightIntensity = 0.25;
|
|
627
627
|
const float horizonLightDiffusion = 0.4;
|
|
628
628
|
const float additionalAmbientIrradianceFactor = 0.02;
|
|
629
629
|
vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance)
|
|
@@ -642,16 +642,16 @@ inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0);
|
|
|
642
642
|
inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
|
|
643
643
|
inputs.ssao = ssao;
|
|
644
644
|
inputs.metalness = mrr[0];
|
|
645
|
-
inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(
|
|
645
|
+
inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(u.H`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
|
|
646
646
|
inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
|
|
647
|
-
inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new
|
|
647
|
+
inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new b("hasFillLights",((e,t)=>t.enableFillLights))):r.constants.add("hasFillLights","bool",!1),r.code.add(u.H`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]);
|
|
648
648
|
ambientDir = ambientDir != vec3(0.0)? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
|
|
649
649
|
inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
|
|
650
650
|
vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * lightingMainIntensity;
|
|
651
651
|
vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * lightingMainIntensity * fillLightIntensity;
|
|
652
652
|
vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
|
|
653
653
|
inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
|
|
654
|
-
inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add([new
|
|
654
|
+
inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add([new A.p("lightingSpecularStrength",((e,t)=>t.lighting.mainLight.specularStrength)),new A.p("lightingEnvironmentStrength",((e,t)=>t.lighting.mainLight.environmentStrength))]),r.code.add(u.H`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView;
|
|
655
655
|
vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
|
|
656
656
|
inputs.NdotH_Horizon = dot(normal, horizonRingH);
|
|
657
657
|
vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * lightingMainIntensity * (1.0 - shadow);
|
|
@@ -659,15 +659,15 @@ vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistrib
|
|
|
659
659
|
vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
|
|
660
660
|
inputs.skyRadianceToSurface = ambientLightRadianceComponent + mainLightRadianceComponent + horizonLightRadianceComponent;
|
|
661
661
|
inputs.groundRadianceToSurface = GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) + mainLightRadianceComponent;
|
|
662
|
-
inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(
|
|
662
|
+
inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(u.H`
|
|
663
663
|
vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
|
|
664
664
|
vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
|
|
665
665
|
vec3 emissionComponent = pow(_emission, vec3(GAMMA_SRGB));
|
|
666
666
|
vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
|
|
667
|
-
${t.pbrMode===
|
|
667
|
+
${t.pbrMode===l.f7.Schematic?u.H`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:u.H`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`}
|
|
668
668
|
return outColor;
|
|
669
669
|
}
|
|
670
|
-
`))}r(22021),(0,
|
|
670
|
+
`);break;default:(0,i.Bg)(t.pbrMode);case l.f7.COUNT:}}r(22021),(0,a.c)(),(0,a.c)()},5802:(e,t,r)=>{r.d(t,{F1:()=>s,Pe:()=>n,kR:()=>l});var i=r(172),o=r(21437),a=r(74709);function n(e){e.uniforms.add(new i.J("lightingMainDirection",((e,t)=>t.lighting.mainLight.direction)))}function s(e){e.uniforms.add(new i.J("lightingMainIntensity",((e,t)=>t.lighting.mainLight.intensity)))}function l(e,t){const r=e.fragment;n(r),s(r),function(e,t){const{fragment:r}=e;t.useLegacyTerrainShading?r.uniforms.add(new o.p("lightingFixedFactor",((e,t)=>t.lighting.noonFactor*(1-t.lighting.globalFactor)))):r.constants.add("lightingFixedFactor","float",0)}(e,t),r.code.add(a.H`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) {
|
|
671
671
|
float dotVal = clamp(dot(normal_global, lightingMainDirection), 0.0, 1.0);
|
|
672
672
|
dotVal = mix(dotVal, 1.0, lightingFixedFactor);
|
|
673
673
|
return lightingMainIntensity * ((1.0 - shadowing) * dotVal);
|
|
@@ -1018,4 +1018,4 @@ const vec4 RGBA_2_FLOAT_FACTORS = vec4(
|
|
|
1018
1018
|
);
|
|
1019
1019
|
float rgba2float(vec4 rgba) {
|
|
1020
1020
|
return dot(rgba, RGBA_2_FLOAT_FACTORS);
|
|
1021
|
-
}`)}},93669:(e,t,r)=>{r.d(t,{hY:()=>f,Sv:()=>m,_8:()=>_});var i=r(52138),o=r(10937),a=r(17896),n=r(65617),s=r(70582),l=r(172),c=r(79884),d=r(67498);class u extends c.x{constructor(e,t){super(e,"mat4",d.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(8319);function f(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",n.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,a.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function m(e,t){if(e.vertex.uniforms.add(new h.g("proj",((e,t)=>t.camera.projectionMatrix))),!t.instancedDoublePrecision)return void e.vertex.uniforms.add([new u("view",((e,t)=>(0,i.v)(p,t.camera.viewMatrix,e.origin))),new s.B("localOrigin",(e=>e.origin))]);const r=e=>(0,a.s)(g,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.vertex.uniforms.add([new h.g("view",((e,t)=>(0,i.v)(p,t.camera.viewMatrix,r(t)))),new l.J("localOrigin",((e,t)=>r(t)))])}const p=(0,o.c)(),g=(0,n.c)();function _(e){e.vertex.uniforms.add(new h.g("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},19693:(e,t,r)=>{r.d(t,{A:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec2",o.P.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec3",o.P.Draw,((r,i,o,a)=>r.setUniform3fv(e,t(i,o,a))))}}},172:(e,t,r)=>{r.d(t,{J:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec3",o.P.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec4",o.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"float",o.P.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"int",o.P.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"mat3",o.P.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"mat3",o.P.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"mat4",o.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},33680:(e,t,r)=>{r.d(t,{kG:()=>l});var i=r(20102),o=r(92604),a=r(70586);const n=o.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){n.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class l extends s{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new f,this.extensions=new m,this.constants=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(),o="vertex"===e?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),s="vertex"===e?_:g,l=this.constants.generateSource().concat(o.constants.generateSource());return`\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${a.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${n.join("\n")}`}generateBind(e,t){const r=new Map;this.vertex.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,a.pC)(i)&&r.set(t.name,i)})),this.fragment.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,a.pC)(i)&&r.set(t.name,i)}));const i=Array.from(r.values()),o=i.length;return(e,r,a)=>{for(let n=0;n<o;++n)i[n](t,e,r,a)}}}class c{constructor(){this._entries=new Map}add(e){if(!Array.isArray(e))return this._add(e);for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if((0,a.Wi)(e))n.error(`Trying to add null Uniform from ${(new Error).stack}.`);else{if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}}generateSource(){return Array.from(this._entries.values()).map((e=>(0,a.pC)(e.arraySize)?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class u extends s{constructor(){super(...arguments),this.uniforms=new c,this.code=new d,this.constants=new p}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`attribute ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(){return this._entries.map((e=>`varying ${e[1]} ${e[0]};`))}}class m{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?m.ALLOWLIST_VERTEX:m.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}m.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],m.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=p._numberToFloatStr(r);break;case"int":i=p._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])}, ${p._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])}, ${p._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>p._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",_="precision highp float;\nprecision highp sampler2D;"},46826:(e,t,r)=>{r.d(t,{F:()=>u});var i=r(70586),o=r(4307),a=r(97323),n=r(79884),s=r(67498);class l extends n.x{constructor(e,t){super(e,"vec2",s.P.Draw,((r,i,o,a)=>r.setUniform2fv(e,t(i,o,a))))}}var c=r(4511);class d extends n.x{constructor(e,t){super(e,"sampler2D",s.P.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}function u(e,t,r=c.D.None){const n=[new d(e,t)];if(r&c.D.Size){const r=e+"Size";n.push(new l(r,((e,r)=>{const n=t(e,r);return(0,i.pC)(n)?(0,o.s)(h,n.descriptor.width,n.descriptor.height):a.Z})))}if(r&c.D.InvSize){const r=e+"InvSize";n.push(new l(r,((e,r)=>{const n=t(e,r);return(0,i.pC)(n)?(0,o.s)(h,1/n.descriptor.width,1/n.descriptor.height):a.Z})))}return n}const h=(0,a.a)()},98069:(e,t,r)=>{r.d(t,{A:()=>d,J:()=>u});var i=r(70586),o=r(4307),a=r(97323),n=r(19693),s=r(4511),l=r(79884),c=r(67498);class d extends l.x{constructor(e,t){super(e,"sampler2D",c.P.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}function u(e,t,r=s.D.None){const l=[new d(e,t)];if(r&s.D.Size){const r=e+"Size";l.push(new n.A(r,((e,r)=>{const n=t(e,r);return(0,i.pC)(n)?(0,o.s)(h,n.descriptor.width,n.descriptor.height):a.Z})))}if(r&s.D.InvSize){const r=e+"InvSize";l.push(new n.A(r,((e,r)=>{const n=t(e,r);return(0,i.pC)(n)?(0,o.s)(h,1/n.descriptor.width,1/n.descriptor.height):a.Z})))}return l}const h=(0,a.a)()},4511:(e,t,r)=>{var i;r.d(t,{D:()=>i}),function(e){e[e.None=0]="None",e[e.Size=1]="Size",e[e.InvSize=2]="InvSize"}(i||(i={}))},79884:(e,t,r)=>{r.d(t,{x:()=>a});var i=r(70586),o=r(67498);class a{constructor(e,t,r,a,n=null){this.name=e,this.type=t,this.arraySize=n,this.bind={[o.P.Pass]:null,[o.P.Draw]:null},(0,i.pC)(r)&&(0,i.pC)(a)&&(this.bind[r]=a)}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>o,K:()=>i});class i{}function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}!function(e){e.int=function(e){return Math.round(e).toString()},e.float=function(e){return e.toPrecision(8)}}(o||(o={}))},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},51354:(e,t,r)=>{r.d(t,{m:()=>i,o:()=>o});class i{constructor(){this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function o(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,a=Math.ceil(Math.log2(o)),n=t._parameterBits??[0];let s=0;for(;n[s]+a>16;)s++,s>=n.length&&n.push(0);t._parameterBits=n;const l=n[s],c=(1<<a)-1<<l;n[s]+=a,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw"Configuration value for "+r+" must be boolean or number, got "+typeof e}})}}}},17662:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(99001);class o{constructor(){this.id=(0,i.D)()}unload(){}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Geometry=2]="Geometry",e[e.Material=3]="Material",e[e.Texture=4]="Texture",e[e.COUNT=5]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(35065);const o=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR_INSTANCED,7],[i.T.MODEL,8],[i.T.MODELNORMAL,12],[i.T.MODELORIGINHI,11],[i.T.MODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>s});var i=r(70586),o=r(95330),a=r(74709),n=r(47026);class s extends class{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}ensureTechnique(e,t,r=this._output){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(r,t),this._technique),this._technique}ensureResources(e){return n.Rw.LOADED}}{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?n.Rw.LOADED:n.Rw.LOADING}get textureBindParameters(){return new l((0,i.pC)(this._texture)?this._texture.glTexture:null,(0,i.pC)(this._textureNormal)?this._textureNormal.glTexture:null,(0,i.pC)(this._textureEmissive)?this._textureEmissive.glTexture:null,(0,i.pC)(this._textureOcclusion)?this._textureOcclusion.glTexture:null,(0,i.pC)(this._textureMetallicRoughness)?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){((0,i.Wi)(this._texture)||e!==this._texture.id)&&(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if((0,i.Wi)(e))return void t(null);const r=this._textureRepository.acquire(e);if((0,o.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class l extends a.K{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},82791:(e,t,r)=>{r.d(t,{F5:()=>d,yD:()=>i});var i,o,a=r(70586),n=(r(74709),r(17662)),s=r(4726),l=r(83475),c=r(37782);class d extends n.c{constructor(e,t){super(),this.type=s.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=l.i,this._parameters=(0,c.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,c.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){(0,a.pC)(this.repository)&&this.repository.materialChanged(this)}}(o=i||(i={}))[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque"},93144:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},11726:(e,t,r)=>{r.d(t,{hu:()=>o,yK:()=>a}),r(97323),r(98766),(0,r(88669).c)();class i{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}}function o(e,t){if(!e)throw t=t||"assert",console.log(new Error(t).stack),new i(t)}function a(e,t,r,i){let o,a=(r[0]-e[0])/t[0],n=(i[0]-e[0])/t[0];a>n&&(o=a,a=n,n=o);let s=(r[1]-e[1])/t[1],l=(i[1]-e[1])/t[1];if(s>l&&(o=s,s=l,l=o),a>l||s>n)return!1;s>a&&(a=s),l<n&&(n=l);let c=(r[2]-e[2])/t[2],d=(i[2]-e[2])/t[2];return c>d&&(o=c,c=d,d=o),!(a>d||c>n||(d<n&&(n=d),n<0))}},47026:(e,t,r)=>{var i,o,a,n,s,l,c,d,u,h,f,m;r.d(t,{CE:()=>u,Gv:()=>o,JJ:()=>f,MX:()=>d,Rw:()=>n,Vr:()=>i,hU:()=>s}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(a||(a={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(n||(n={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.ASYNC=0]="ASYNC",e[e.SYNC=1]="SYNC"}(l||(l={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(c||(c={})),function(e){e[e.Triangle=0]="Triangle",e[e.Point=1]="Point",e[e.Line=2]="Line"}(d||(d={})),function(e){e[e.STRETCH=1]="STRETCH",e[e.PAD=2]="PAD"}(u||(u={})),function(e){e[e.CHANGED=0]="CHANGED",e[e.UNCHANGED=1]="UNCHANGED"}(h||(h={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(f||(f={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(m||(m={}))},37782:(e,t,r)=>{r.d(t,{FZ:()=>y,Uf:()=>S,Bw:()=>g,LO:()=>C,Hx:()=>w});var i=r(67676),o=r(22021),a=r(70586),n=r(17896),s=r(65617),l=r(60437),c=r(47026);function d(e,t){return Math.max((0,o.t7)(e*t.scale,e,t.factor),function(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}(e,t))}r(64822),(0,o.Vl)(10),(0,o.Vl)(12),(0,o.Vl)(70),(0,o.Vl)(40);const u={scale:0,factor:0,minPixelSize:0,paddingPixels:0};var h=r(11726),f=r(35065),m=(r(52138),r(13598));r(9820),new Float64Array(3),new Float32Array(6),(0,m.c)();const p=(0,l.Ue)();function g(e,t,r,i,o,n,s){if(!function(e){return!!(0,a.pC)(e)&&!e.visible}(t))if(e.boundingInfo){(0,h.hu)(e.primitiveType===c.MX.Triangle);const t=r.tolerance;v(e.boundingInfo,i,o,t,n,s)}else{const t=e.indices.get(f.T.POSITION),r=e.vertexAttributes.get(f.T.POSITION);T(i,o,0,t.length/3,t,r,void 0,n,s)}}const _=(0,s.c)();function v(e,t,r,i,o,s){if((0,a.Wi)(e))return;const c=function(e,t,r){return(0,n.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,_);if((0,l.op)(p,e.getBBMin()),(0,l.Tn)(p,e.getBBMax()),(0,a.pC)(o)&&o.applyToAabb(p),function(e,t,r,i){return function(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let s=Math.min(a,n),l=Math.max(a,n);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(p,t,c,i)){const{primitiveIndices:a,indices:n,position:l}=e,c=a?a.length:n.length/3;if(c>M){const a=e.getChildren();if(void 0!==a){for(let e=0;e<8;++e)void 0!==a[e]&&v(a[e],t,r,i,o,s);return}}T(t,r,0,c,n,l,a,o,s)}}const x=(0,s.c)();function T(e,t,r,i,o,n,s,l,c){if(s)return function(e,t,r,i,o,n,s,l,c){const d=n.data,u=n.stride||n.size,h=e[0],f=e[1],m=e[2],p=t[0]-h,g=t[1]-f,_=t[2]-m;for(let e=r;e<i;++e){const t=s[e];let r=3*t,i=u*o[r++],n=d[i++],v=d[i++],T=d[i];i=u*o[r++];let b=d[i++],A=d[i++],w=d[i];i=u*o[r];let S=d[i++],C=d[i++],R=d[i];(0,a.pC)(l)&&([n,v,T]=l.applyToVertex(n,v,T,e),[b,A,w]=l.applyToVertex(b,A,w,e),[S,C,R]=l.applyToVertex(S,C,R,e));const y=b-n,M=A-v,O=w-T,N=S-n,P=C-v,I=R-T,D=g*I-P*_,L=_*N-I*p,F=p*P-N*g,H=y*D+M*L+O*F;if(Math.abs(H)<=Number.EPSILON)continue;const B=h-n,U=f-v,z=m-T,V=B*D+U*L+z*F;if(H>0){if(V<0||V>H)continue}else if(V>0||V<H)continue;const G=U*O-M*z,W=z*y-O*B,k=B*M-y*U,$=p*G+g*W+_*k;if(H>0){if($<0||V+$>H)continue}else if($>0||V+$<H)continue;const q=(N*G+P*W+I*k)/H;q>=0&&c(q,E(y,M,O,N,P,I,x),t,!1)}}(e,t,r,i,o,n,s,l,c);const d=n.data,u=n.stride||n.size,h=e[0],f=e[1],m=e[2],p=t[0]-h,g=t[1]-f,_=t[2]-m;for(let e=r,t=3*r;e<i;++e){let r=u*o[t++],i=d[r++],n=d[r++],s=d[r];r=u*o[t++];let v=d[r++],T=d[r++],b=d[r];r=u*o[t++];let A=d[r++],w=d[r++],S=d[r];(0,a.pC)(l)&&([i,n,s]=l.applyToVertex(i,n,s,e),[v,T,b]=l.applyToVertex(v,T,b,e),[A,w,S]=l.applyToVertex(A,w,S,e));const C=v-i,R=T-n,y=b-s,M=A-i,O=w-n,N=S-s,P=g*N-O*_,I=_*M-N*p,D=p*O-M*g,L=C*P+R*I+y*D;if(Math.abs(L)<=Number.EPSILON)continue;const F=h-i,H=f-n,B=m-s,U=F*P+H*I+B*D;if(L>0){if(U<0||U>L)continue}else if(U>0||U<L)continue;const z=H*y-R*B,V=B*C-y*F,G=F*R-C*H,W=p*z+g*V+_*G;if(L>0){if(W<0||U+W>L)continue}else if(W>0||U+W<L)continue;const k=(M*z+O*V+N*G)/L;k>=0&&c(k,E(C,R,y,M,O,N,x),e,!1)}}const b=(0,s.c)(),A=(0,s.c)();function E(e,t,r,i,o,a,s){return(0,n.s)(b,e,t,r),(0,n.s)(A,i,o,a),(0,n.f)(s,b,A),(0,n.n)(s,s),s}function w(e,t,r,i,n){let s=(r.screenLength||0)*e.pixelRatio;(0,a.pC)(n)&&(s=function(e,t,r,i){return d(e,function(e,t,r){const i=r.parameters,o=r.paddingPixelsOverride;return u.scale=Math.min(i.divisor/(t-i.offset),1),u.factor=function(e){return Math.abs(e*e*e)}(e),u.minPixelSize=i.minPixelSize,u.paddingPixels=o,u}(t,r,i))}(s,i,t,n));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.uZ)(l*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function S(e,t){const r=t?S(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=R(i)),null==i&&t in r||(r[t]=i)}return r}function C(e,t){let r=!1;for(const o in t){const a=t[o];void 0!==a&&(Array.isArray(a)?null===e[o]?(e[o]=a.slice(),r=!0):(0,i.Vx)(e[o],a)&&(r=!0):e[o]!==a&&(r=!0,e[o]=a))}return r}function R(e){const t=[];return e.forEach((e=>t.push(e))),t}const y={multiply:1,ignore:2,replace:3,tint:4},M=1e3},75656:(e,t,r)=>{r.d(t,{x:()=>d}),r(80442);var i=r(22021),o=r(70586),a=r(49300),n=r(54738),s=r(35371),l=r(46314);const c={target:s.No.TEXTURE_2D,samplingMode:s.cw.LINEAR,wrapMode:s.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1};class d{constructor(e,t,r=null){this._context=e,this.type="texture",this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(s._g.Texture,this),this._descriptor={...c,...t};for(const e in c)void 0===this._descriptor[e]&&(this._descriptor[e]=c[e]);if(e.type!==n.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),f(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(s._g.Texture,this))}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=s.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=s.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const i=this._descriptor,n=t??i.target,c=f(n);null===e&&(i.width=i.width||4,i.height=i.height||4,c&&(i.depth=i.depth??1));const p=this._context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),d._validateTexture(this._context,i),this._configurePixelStorage();const g=i.pixelFormat;let _=i.internalFormat??this._deriveInternalFormat(g,i.dataType);if(h(e)){let t=e.width,o=e.height;const s=1;e instanceof HTMLVideoElement&&(t=e.videoWidth,o=e.videoHeight),i.width&&i.height,c&&i.depth,i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,i.hasMipmap,t,o,s),this._texImage(n,0,_,t,o,s,e),(0,a.zu)(r),i.hasMipmap&&this.generateMipmap(),void 0===i.width&&(i.width=t),void 0===i.height&&(i.height=o),c&&void 0===i.depth&&(i.depth=s)}else{const{width:t,height:d,depth:h}=i;if(null==t||null==d)throw new Error("Width and height must be specified!");if(c&&null==h)throw new Error("Depth must be specified!");if(i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,i.hasMipmap,t,d,h),r.DEPTH24_STENCIL8&&_===r.DEPTH_STENCIL&&(_=r.DEPTH24_STENCIL8),u(e)){const o=e.levels,a=m(n,t,d,h),c=Math.min(a-1,o.length-1);(0,l.Z)(r)?r.texParameteri(i.target,r.TEXTURE_MAX_LEVEL,c):i.hasMipmap=i.hasMipmap&&a===o.length;const u=_;if(!function(e){return e in s.q_}(u))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const a=o[Math.min(e,o.length-1)];this._compressedTexImage(n,e,u,t,r,i,a)}),c)}else(0,o.pC)(e)?(this._texImage(n,0,_,t,d,h,e),(0,a.zu)(r),i.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((e,t,i,o)=>{this._texImage(n,e,_,t,i,o,null),(0,a.zu)(r)}))}d._applySamplingMode(r,this._descriptor),d._applyWrapMode(r,this._descriptor),d._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,a.zu)(r),this._context.bindTexture(p,d.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,i,o,a){a||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const n=this._context.gl,s=this._descriptor,{pixelFormat:l,dataType:c,isImmutable:f,target:m}=s,p=s.internalFormat??this._deriveInternalFormat(l,c);if(f&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const g=this._context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);(t<0||r<0||i>s.width||o>s.height||t+i>s.width||r+o>s.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),h(a)?n.texSubImage2D(m,e,t,r,l,c,a):u(a)?n.compressedTexSubImage2D(m,e,t,r,i,o,p,a.levels[e]):n.texSubImage2D(m,e,t,r,i,o,l,c,a),this._context.bindTexture(g,d.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,i,o,a,n,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const c=this._context.gl;if(!(0,l.Z)(c))throw new Error("3D textures are not supported in WebGL1");const h=this._descriptor,{pixelFormat:m,dataType:p,isImmutable:g,target:_}=h,v=h.internalFormat??this._deriveInternalFormat(m,p);if(g&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");f(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const x=this._context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||i<0||o>h.width||a>h.height||n>h.depth||t+o>h.width||r+a>h.height||i+n>h.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),u(s))s=s.levels[e],c.compressedTexSubImage3D(_,e,t,r,i,o,a,n,v,s);else{const l=s;c.texSubImage3D(_,e,t,r,i,o,a,n,m,p,l)}this._context.bindTexture(x,d.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,d._validateTexture(this._context,e)}e.samplingMode===s.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=s.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===s.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=s.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,d.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,d._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(d._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(d._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===n.zO.WEBGL1)return e;switch(t){case s.Br.FLOAT:switch(e){case s.VI.RGBA:return s.lP.RGBA32F;case s.VI.RGB:return s.lP.RGB32F;default:throw new Error("Unable to derive format")}case s.Br.UNSIGNED_BYTE:switch(e){case s.VI.RGBA:return s.lP.RGBA8;case s.VI.RGB:return s.lP.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,i,o,a){const n=this._context.gl;if(!(0,l.Z)(n))throw new Error("Immutable textures are not supported in WebGL1");if(!function(e){return e in s.lP}(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?m(e,i,o,a):1;if(f(e)){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");n.texStorage3D(e,c,t,i,o,a)}else n.texStorage2D(e,c,t,i,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,a,s,l){const c=this._context.gl;let d=null;const u=this._context.type===n.zO.WEBGL2,m=f(e),{isImmutable:p,pixelFormat:g,dataType:_}=this._descriptor;if(u&&(d=c),u||!h(l))if(p){if((0,o.pC)(l)){const r=l;if(m){if(null==s)throw new Error("Missing depth dimension for 3D texture upload");d.texSubImage3D(e,t,0,0,0,i,a,s,g,_,r)}else c.texSubImage2D(e,t,0,0,i,a,g,_,r)}}else{const n=(0,o.Wg)(l);if(m){if(null==s)throw new Error("Missing depth dimension for 3D texture upload");d.texImage3D(e,t,r,i,a,s,0,g,_,n)}else c.texImage2D(e,t,r,i,a,0,g,_,n)}else c.texImage2D(e,0,r,g,_,l)}_compressedTexImage(e,t,r,i,a,s,l){const c=this._context.gl;let d=null;const u=f(e),h=this._descriptor.isImmutable;if(u){if(this._context.type!==n.zO.WEBGL2)throw new Error("3D textures are not supported in WebGL1");d=c}if(h){if((0,o.pC)(l))if(u){if(null==s)throw new Error("Missing depth dimension for 3D texture upload");d.compressedTexSubImage3D(e,t,0,0,0,i,a,s,r,l)}else c.compressedTexSubImage2D(e,t,0,0,i,a,r,l)}else if(u){if(null==s)throw new Error("Missing depth dimension for 3D texture upload");d.compressedTexImage3D(e,t,r,i,a,s,0,l)}else c.compressedTexImage2D(e,t,r,i,a,0,l)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:o,hasMipmap:a,target:n}=this._descriptor;const l=n===s.No.TEXTURE_3D;if(null==r||null==i||l&&null==o)throw new Error("Missing texture dimensions for mipmap calculation");for(let n=0;e(n,r,i,o),a&&(1!==r||1!==i||l&&1!==o)&&!(n>=t);++n)r=Math.max(1,r>>1),i=Math.max(1,i>>1),l&&(o=Math.max(1,o>>1))}static _validateTexture(e,t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=(0,l.Z)(e.gl),o=null!=t.width&&(0,i.wt)(t.width)&&null!=t.height&&(0,i.wt)(t.height);r||!t.isImmutable&&!f(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||o||("number"==typeof t.wrapMode?t.wrapMode!==s.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===s.e8.CLAMP_TO_EDGE&&t.wrapMode.t===s.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let r=t.samplingMode,i=t.samplingMode;r===s.cw.LINEAR_MIPMAP_NEAREST||r===s.cw.LINEAR_MIPMAP_LINEAR?(r=s.cw.LINEAR,t.hasMipmap||(i=s.cw.LINEAR)):r!==s.cw.NEAREST_MIPMAP_NEAREST&&r!==s.cw.NEAREST_MIPMAP_LINEAR||(r=s.cw.NEAREST,t.hasMipmap||(i=s.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}function u(e){return(0,o.pC)(e)&&"type"in e&&"compressed"===e.type}function h(e){return(0,o.pC)(e)&&!u(e)&&!function(e){return(0,o.pC)(e)&&"byteLength"in e}(e)}function f(e){return e===s.No.TEXTURE_3D||e===s.No.TEXTURE_2D_ARRAY}function m(e,t,r,i=1){let o=Math.max(t,r);return e===s.No.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}d.TEXTURE_UNIT_FOR_UPDATES=0},21968:(e,t,r)=>{r.d(t,{G:()=>i});class i{constructor(e,t,r,i,o,a=!1,n=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=o,this.normalized=a,this.divisor=n}}},46314:(e,t,r)=>{function i(e){return window.WebGL2RenderingContext&&e instanceof window.WebGL2RenderingContext}r.d(t,{Z:()=>i})},49300:(e,t,r)=>{r.d(t,{hZ:()=>s,zu:()=>l});var i=r(20102),o=r(80442);const a=r(92604).Z.getLogger("esri.views.webgl.checkWebGLError"),n=!!(0,o.Z)("enable-feature:webgl-debug");function s(){return n}function l(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),o=(new Error).stack;a.error(new i.Z("webgl-error","WebGL error occured",{message:r,stack:o}))}}}},54738:(e,t,r)=>{r.d(t,{Sh:()=>n,kr:()=>s,zO:()=>i});var i,o,a=r(80442);function n(e){const t=(0,a.Z)("esri-force-webgl");if(t===i.WEBGL1||t===i.WEBGL2)return[t];switch(e){case"2d":return(0,a.Z)("mac")&&(0,a.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1];case"3d":return[i.WEBGL2,i.WEBGL1]}}function s(e,t,r={}){const o=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let a=null;for(const t of o){try{a=e.getContext(t,r)}catch(e){}if(a)break}return a}(o=i||(i={}))[o.WEBGL1=1]="WEBGL1",o[o.WEBGL2=2]="WEBGL2"},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],t[i]=a[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],a[1]=e[i]-a[0],t[i]=a[1];return t}r.d(t,{GB:()=>o,U8:()=>i});const a=new Float32Array(2)}}]);
|
|
1021
|
+
}`)}},93669:(e,t,r)=>{r.d(t,{hY:()=>f,Sv:()=>m,_8:()=>_});var i=r(52138),o=r(10937),a=r(17896),n=r(65617),s=r(70582),l=r(172),c=r(79884),d=r(67498);class u extends c.x{constructor(e,t){super(e,"mat4",d.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(8319);function f(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",n.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,a.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function m(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add([new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new u("view",((e,t)=>(0,i.v)(p,t.camera.viewMatrix,e.origin))),new s.B("localOrigin",(e=>e.origin))]);const r=e=>(0,a.s)(g,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add([new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new h.g("view",((e,t)=>(0,i.v)(p,t.camera.viewMatrix,r(t)))),new l.J("localOrigin",((e,t)=>r(t)))])}const p=(0,o.c)(),g=(0,n.c)();function _(e){e.uniforms.add(new h.g("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},19693:(e,t,r)=>{r.d(t,{A:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec2",o.P.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec3",o.P.Draw,((r,i,o,a)=>r.setUniform3fv(e,t(i,o,a))))}}},172:(e,t,r)=>{r.d(t,{J:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec3",o.P.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"vec4",o.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"float",o.P.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"int",o.P.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"mat3",o.P.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"mat3",o.P.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>a});var i=r(79884),o=r(67498);class a extends i.x{constructor(e,t){super(e,"mat4",o.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},33680:(e,t,r)=>{r.d(t,{kG:()=>l});var i=r(20102),o=r(92604),a=r(70586);const n=o.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){n.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class l extends s{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new f,this.extensions=new m,this.constants=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(),o="vertex"===e?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),s="vertex"===e?_:g,l=this.constants.generateSource().concat(o.constants.generateSource());return`\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${a.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${n.join("\n")}`}generateBind(e,t){const r=new Map;this.vertex.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,a.pC)(i)&&r.set(t.name,i)})),this.fragment.uniforms.entries.forEach((t=>{const i=t.bind[e];(0,a.pC)(i)&&r.set(t.name,i)}));const i=Array.from(r.values()),o=i.length;return(e,r,a)=>{for(let n=0;n<o;++n)i[n](t,e,r,a)}}}class c{constructor(){this._entries=new Map}add(e){if(!Array.isArray(e))return this._add(e);for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if((0,a.Wi)(e))n.error(`Trying to add null Uniform from ${(new Error).stack}.`);else{if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}}generateSource(){return Array.from(this._entries.values()).map((e=>(0,a.pC)(e.arraySize)?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class u extends s{constructor(){super(...arguments),this.uniforms=new c,this.code=new d,this.constants=new p}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`attribute ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(){return this._entries.map((e=>`varying ${e[1]} ${e[0]};`))}}class m{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?m.ALLOWLIST_VERTEX:m.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}m.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],m.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=p._numberToFloatStr(r);break;case"int":i=p._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])}, ${p._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])}, ${p._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>p._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",_="precision highp float;\nprecision highp sampler2D;"},46826:(e,t,r)=>{r.d(t,{F:()=>u});var i=r(70586),o=r(4307),a=r(97323),n=r(79884),s=r(67498);class l extends n.x{constructor(e,t){super(e,"vec2",s.P.Draw,((r,i,o,a)=>r.setUniform2fv(e,t(i,o,a))))}}var c=r(4511);class d extends n.x{constructor(e,t){super(e,"sampler2D",s.P.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}function u(e,t,r=c.D.None){const n=[new d(e,t)];if(r&c.D.Size){const r=e+"Size";n.push(new l(r,((e,r)=>{const n=t(e,r);return(0,i.pC)(n)?(0,o.s)(h,n.descriptor.width,n.descriptor.height):a.Z})))}if(r&c.D.InvSize){const r=e+"InvSize";n.push(new l(r,((e,r)=>{const n=t(e,r);return(0,i.pC)(n)?(0,o.s)(h,1/n.descriptor.width,1/n.descriptor.height):a.Z})))}return n}const h=(0,a.a)()},98069:(e,t,r)=>{r.d(t,{A:()=>d,J:()=>u});var i=r(70586),o=r(4307),a=r(97323),n=r(19693),s=r(4511),l=r(79884),c=r(67498);class d extends l.x{constructor(e,t){super(e,"sampler2D",c.P.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}function u(e,t,r=s.D.None){const l=[new d(e,t)];if(r&s.D.Size){const r=e+"Size";l.push(new n.A(r,((e,r)=>{const n=t(e,r);return(0,i.pC)(n)?(0,o.s)(h,n.descriptor.width,n.descriptor.height):a.Z})))}if(r&s.D.InvSize){const r=e+"InvSize";l.push(new n.A(r,((e,r)=>{const n=t(e,r);return(0,i.pC)(n)?(0,o.s)(h,1/n.descriptor.width,1/n.descriptor.height):a.Z})))}return l}const h=(0,a.a)()},4511:(e,t,r)=>{var i;r.d(t,{D:()=>i}),function(e){e[e.None=0]="None",e[e.Size=1]="Size",e[e.InvSize=2]="InvSize"}(i||(i={}))},79884:(e,t,r)=>{r.d(t,{x:()=>a});var i=r(70586),o=r(67498);class a{constructor(e,t,r,a,n=null){this.name=e,this.type=t,this.arraySize=n,this.bind={[o.P.Pass]:null,[o.P.Draw]:null},(0,i.pC)(r)&&(0,i.pC)(a)&&(this.bind[r]=a)}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>o,K:()=>i});class i{}function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}!function(e){e.int=function(e){return Math.round(e).toString()},e.float=function(e){return e.toPrecision(8)}}(o||(o={}))},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},51354:(e,t,r)=>{r.d(t,{m:()=>i,o:()=>o});class i{constructor(){this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function o(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,a=Math.ceil(Math.log2(o)),n=t._parameterBits??[0];let s=0;for(;n[s]+a>16;)s++,s>=n.length&&n.push(0);t._parameterBits=n;const l=n[s],c=(1<<a)-1<<l;n[s]+=a,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw"Configuration value for "+r+" must be boolean or number, got "+typeof e}})}}}},17662:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(99001);class o{constructor(){this.id=(0,i.D)()}unload(){}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Geometry=2]="Geometry",e[e.Material=3]="Material",e[e.Texture=4]="Texture",e[e.COUNT=5]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(35065);const o=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR_INSTANCED,7],[i.T.MODEL,8],[i.T.MODELNORMAL,12],[i.T.MODELORIGINHI,11],[i.T.MODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>s});var i=r(70586),o=r(95330),a=r(74709),n=r(47026);class s extends class{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}ensureTechnique(e,t,r=this._output){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(r,t),this._technique),this._technique}ensureResources(e){return n.Rw.LOADED}}{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?n.Rw.LOADED:n.Rw.LOADING}get textureBindParameters(){return new l((0,i.pC)(this._texture)?this._texture.glTexture:null,(0,i.pC)(this._textureNormal)?this._textureNormal.glTexture:null,(0,i.pC)(this._textureEmissive)?this._textureEmissive.glTexture:null,(0,i.pC)(this._textureOcclusion)?this._textureOcclusion.glTexture:null,(0,i.pC)(this._textureMetallicRoughness)?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){((0,i.Wi)(this._texture)||e!==this._texture.id)&&(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if((0,i.Wi)(e))return void t(null);const r=this._textureRepository.acquire(e);if((0,o.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class l extends a.K{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},82791:(e,t,r)=>{r.d(t,{F5:()=>d,yD:()=>i});var i,o,a=r(70586),n=(r(74709),r(17662)),s=r(4726),l=r(83475),c=r(37782);class d extends n.c{constructor(e,t){super(),this.type=s.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=l.i,this._parameters=(0,c.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,c.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){(0,a.pC)(this.repository)&&this.repository.materialChanged(this)}}(o=i||(i={}))[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque"},93144:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},11726:(e,t,r)=>{r.d(t,{hu:()=>o,yK:()=>a}),r(97323),r(98766),(0,r(88669).c)();class i{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}}function o(e,t){if(!e)throw t=t||"assert",console.log(new Error(t).stack),new i(t)}function a(e,t,r,i){let o,a=(r[0]-e[0])/t[0],n=(i[0]-e[0])/t[0];a>n&&(o=a,a=n,n=o);let s=(r[1]-e[1])/t[1],l=(i[1]-e[1])/t[1];if(s>l&&(o=s,s=l,l=o),a>l||s>n)return!1;s>a&&(a=s),l<n&&(n=l);let c=(r[2]-e[2])/t[2],d=(i[2]-e[2])/t[2];return c>d&&(o=c,c=d,d=o),!(a>d||c>n||(d<n&&(n=d),n<0))}},47026:(e,t,r)=>{var i,o,a,n,s,l,c,d,u,h,f,m;r.d(t,{CE:()=>u,Gv:()=>o,JJ:()=>f,MX:()=>d,Rw:()=>n,Vr:()=>i,hU:()=>s}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(a||(a={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(n||(n={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.ASYNC=0]="ASYNC",e[e.SYNC=1]="SYNC"}(l||(l={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(c||(c={})),function(e){e[e.Triangle=0]="Triangle",e[e.Point=1]="Point",e[e.Line=2]="Line"}(d||(d={})),function(e){e[e.STRETCH=1]="STRETCH",e[e.PAD=2]="PAD"}(u||(u={})),function(e){e[e.CHANGED=0]="CHANGED",e[e.UNCHANGED=1]="UNCHANGED"}(h||(h={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(f||(f={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(m||(m={}))},37782:(e,t,r)=>{r.d(t,{FZ:()=>y,Uf:()=>S,Bw:()=>g,LO:()=>C,Hx:()=>w});var i=r(67676),o=r(22021),a=r(70586),n=r(17896),s=r(65617),l=r(60437),c=r(47026);function d(e,t){return Math.max((0,o.t7)(e*t.scale,e,t.factor),function(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}(e,t))}r(64822),(0,o.Vl)(10),(0,o.Vl)(12),(0,o.Vl)(70),(0,o.Vl)(40);const u={scale:0,factor:0,minPixelSize:0,paddingPixels:0};var h=r(11726),f=r(35065),m=(r(52138),r(13598));r(9820),new Float64Array(3),new Float32Array(6),(0,m.c)();const p=(0,l.Ue)();function g(e,t,r,i,o,n,s){if(!function(e){return!!(0,a.pC)(e)&&!e.visible}(t))if(e.boundingInfo){(0,h.hu)(e.primitiveType===c.MX.Triangle);const t=r.tolerance;v(e.boundingInfo,i,o,t,n,s)}else{const t=e.indices.get(f.T.POSITION),r=e.vertexAttributes.get(f.T.POSITION);T(i,o,0,t.length/3,t,r,void 0,n,s)}}const _=(0,s.c)();function v(e,t,r,i,o,s){if((0,a.Wi)(e))return;const c=function(e,t,r){return(0,n.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,_);if((0,l.op)(p,e.getBBMin()),(0,l.Tn)(p,e.getBBMax()),(0,a.pC)(o)&&o.applyToAabb(p),function(e,t,r,i){return function(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let s=Math.min(a,n),l=Math.max(a,n);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(p,t,c,i)){const{primitiveIndices:a,indices:n,position:l}=e,c=a?a.length:n.length/3;if(c>M){const a=e.getChildren();if(void 0!==a){for(let e=0;e<8;++e)void 0!==a[e]&&v(a[e],t,r,i,o,s);return}}T(t,r,0,c,n,l,a,o,s)}}const x=(0,s.c)();function T(e,t,r,i,o,n,s,l,c){if(s)return function(e,t,r,i,o,n,s,l,c){const d=n.data,u=n.stride||n.size,h=e[0],f=e[1],m=e[2],p=t[0]-h,g=t[1]-f,_=t[2]-m;for(let e=r;e<i;++e){const t=s[e];let r=3*t,i=u*o[r++],n=d[i++],v=d[i++],T=d[i];i=u*o[r++];let b=d[i++],A=d[i++],w=d[i];i=u*o[r];let S=d[i++],C=d[i++],R=d[i];(0,a.pC)(l)&&([n,v,T]=l.applyToVertex(n,v,T,e),[b,A,w]=l.applyToVertex(b,A,w,e),[S,C,R]=l.applyToVertex(S,C,R,e));const y=b-n,M=A-v,O=w-T,N=S-n,P=C-v,I=R-T,D=g*I-P*_,L=_*N-I*p,F=p*P-N*g,H=y*D+M*L+O*F;if(Math.abs(H)<=Number.EPSILON)continue;const B=h-n,U=f-v,z=m-T,V=B*D+U*L+z*F;if(H>0){if(V<0||V>H)continue}else if(V>0||V<H)continue;const G=U*O-M*z,W=z*y-O*B,k=B*M-y*U,$=p*G+g*W+_*k;if(H>0){if($<0||V+$>H)continue}else if($>0||V+$<H)continue;const q=(N*G+P*W+I*k)/H;q>=0&&c(q,E(y,M,O,N,P,I,x),t,!1)}}(e,t,r,i,o,n,s,l,c);const d=n.data,u=n.stride||n.size,h=e[0],f=e[1],m=e[2],p=t[0]-h,g=t[1]-f,_=t[2]-m;for(let e=r,t=3*r;e<i;++e){let r=u*o[t++],i=d[r++],n=d[r++],s=d[r];r=u*o[t++];let v=d[r++],T=d[r++],b=d[r];r=u*o[t++];let A=d[r++],w=d[r++],S=d[r];(0,a.pC)(l)&&([i,n,s]=l.applyToVertex(i,n,s,e),[v,T,b]=l.applyToVertex(v,T,b,e),[A,w,S]=l.applyToVertex(A,w,S,e));const C=v-i,R=T-n,y=b-s,M=A-i,O=w-n,N=S-s,P=g*N-O*_,I=_*M-N*p,D=p*O-M*g,L=C*P+R*I+y*D;if(Math.abs(L)<=Number.EPSILON)continue;const F=h-i,H=f-n,B=m-s,U=F*P+H*I+B*D;if(L>0){if(U<0||U>L)continue}else if(U>0||U<L)continue;const z=H*y-R*B,V=B*C-y*F,G=F*R-C*H,W=p*z+g*V+_*G;if(L>0){if(W<0||U+W>L)continue}else if(W>0||U+W<L)continue;const k=(M*z+O*V+N*G)/L;k>=0&&c(k,E(C,R,y,M,O,N,x),e,!1)}}const b=(0,s.c)(),A=(0,s.c)();function E(e,t,r,i,o,a,s){return(0,n.s)(b,e,t,r),(0,n.s)(A,i,o,a),(0,n.f)(s,b,A),(0,n.n)(s,s),s}function w(e,t,r,i,n){let s=(r.screenLength||0)*e.pixelRatio;(0,a.pC)(n)&&(s=function(e,t,r,i){return d(e,function(e,t,r){const i=r.parameters,o=r.paddingPixelsOverride;return u.scale=Math.min(i.divisor/(t-i.offset),1),u.factor=function(e){return Math.abs(e*e*e)}(e),u.minPixelSize=i.minPixelSize,u.paddingPixels=o,u}(t,r,i))}(s,i,t,n));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.uZ)(l*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function S(e,t){const r=t?S(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=R(i)),null==i&&t in r||(r[t]=i)}return r}function C(e,t){let r=!1;for(const o in t){const a=t[o];void 0!==a&&(Array.isArray(a)?null===e[o]?(e[o]=a.slice(),r=!0):(0,i.Vx)(e[o],a)&&(r=!0):e[o]!==a&&(r=!0,e[o]=a))}return r}function R(e){const t=[];return e.forEach((e=>t.push(e))),t}const y={multiply:1,ignore:2,replace:3,tint:4},M=1e3},75656:(e,t,r)=>{r.d(t,{x:()=>d}),r(80442);var i=r(22021),o=r(70586),a=r(49300),n=r(54738),s=r(35371),l=r(46314);const c={target:s.No.TEXTURE_2D,samplingMode:s.cw.LINEAR,wrapMode:s.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1};class d{constructor(e,t,r=null){this._context=e,this.type="texture",this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(s._g.Texture,this),this._descriptor={...c,...t};for(const e in c)void 0===this._descriptor[e]&&(this._descriptor[e]=c[e]);if(e.type!==n.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),f(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(s._g.Texture,this))}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===s.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=s.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=s.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const i=this._descriptor,n=t??i.target,c=f(n);null===e&&(i.width=i.width||4,i.height=i.height||4,c&&(i.depth=i.depth??1));const p=this._context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),d._validateTexture(this._context,i),this._configurePixelStorage();const g=i.pixelFormat;let _=i.internalFormat??this._deriveInternalFormat(g,i.dataType);if(h(e)){let t=e.width,o=e.height;const s=1;e instanceof HTMLVideoElement&&(t=e.videoWidth,o=e.videoHeight),i.width&&i.height,c&&i.depth,i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,i.hasMipmap,t,o,s),this._texImage(n,0,_,t,o,s,e),(0,a.zu)(r),i.hasMipmap&&this.generateMipmap(),void 0===i.width&&(i.width=t),void 0===i.height&&(i.height=o),c&&void 0===i.depth&&(i.depth=s)}else{const{width:t,height:d,depth:h}=i;if(null==t||null==d)throw new Error("Width and height must be specified!");if(c&&null==h)throw new Error("Depth must be specified!");if(i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,i.hasMipmap,t,d,h),r.DEPTH24_STENCIL8&&_===r.DEPTH_STENCIL&&(_=r.DEPTH24_STENCIL8),u(e)){const o=e.levels,a=m(n,t,d,h),c=Math.min(a-1,o.length-1);(0,l.Z)(r)?r.texParameteri(i.target,r.TEXTURE_MAX_LEVEL,c):i.hasMipmap=i.hasMipmap&&a===o.length;const u=_;if(!function(e){return e in s.q_}(u))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const a=o[Math.min(e,o.length-1)];this._compressedTexImage(n,e,u,t,r,i,a)}),c)}else(0,o.pC)(e)?(this._texImage(n,0,_,t,d,h,e),(0,a.zu)(r),i.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((e,t,i,o)=>{this._texImage(n,e,_,t,i,o,null),(0,a.zu)(r)}))}d._applySamplingMode(r,this._descriptor),d._applyWrapMode(r,this._descriptor),d._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,a.zu)(r),this._context.bindTexture(p,d.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,i,o,a){a||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const n=this._context.gl,s=this._descriptor,{pixelFormat:l,dataType:c,isImmutable:f,target:m}=s,p=s.internalFormat??this._deriveInternalFormat(l,c);if(f&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const g=this._context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);(t<0||r<0||i>s.width||o>s.height||t+i>s.width||r+o>s.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),h(a)?n.texSubImage2D(m,e,t,r,l,c,a):u(a)?n.compressedTexSubImage2D(m,e,t,r,i,o,p,a.levels[e]):n.texSubImage2D(m,e,t,r,i,o,l,c,a),this._context.bindTexture(g,d.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,i,o,a,n,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const c=this._context.gl;if(!(0,l.Z)(c))throw new Error("3D textures are not supported in WebGL1");const h=this._descriptor,{pixelFormat:m,dataType:p,isImmutable:g,target:_}=h,v=h.internalFormat??this._deriveInternalFormat(m,p);if(g&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");f(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const x=this._context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||i<0||o>h.width||a>h.height||n>h.depth||t+o>h.width||r+a>h.height||i+n>h.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),u(s))s=s.levels[e],c.compressedTexSubImage3D(_,e,t,r,i,o,a,n,v,s);else{const l=s;c.texSubImage3D(_,e,t,r,i,o,a,n,m,p,l)}this._context.bindTexture(x,d.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,d._validateTexture(this._context,e)}e.samplingMode===s.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=s.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===s.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=s.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,d.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,d.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,d._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(d._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(d._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===n.zO.WEBGL1)return e;switch(t){case s.Br.FLOAT:switch(e){case s.VI.RGBA:return s.lP.RGBA32F;case s.VI.RGB:return s.lP.RGB32F;default:throw new Error("Unable to derive format")}case s.Br.UNSIGNED_BYTE:switch(e){case s.VI.RGBA:return s.lP.RGBA8;case s.VI.RGB:return s.lP.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,i,o,a){const n=this._context.gl;if(!(0,l.Z)(n))throw new Error("Immutable textures are not supported in WebGL1");if(!function(e){return e in s.lP}(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?m(e,i,o,a):1;if(f(e)){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");n.texStorage3D(e,c,t,i,o,a)}else n.texStorage2D(e,c,t,i,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,a,s,l){const c=this._context.gl;let d=null;const u=this._context.type===n.zO.WEBGL2,m=f(e),{isImmutable:p,pixelFormat:g,dataType:_}=this._descriptor;if(u&&(d=c),u||!h(l))if(p){if((0,o.pC)(l)){const r=l;if(m){if(null==s)throw new Error("Missing depth dimension for 3D texture upload");d.texSubImage3D(e,t,0,0,0,i,a,s,g,_,r)}else c.texSubImage2D(e,t,0,0,i,a,g,_,r)}}else{const n=(0,o.Wg)(l);if(m){if(null==s)throw new Error("Missing depth dimension for 3D texture upload");d.texImage3D(e,t,r,i,a,s,0,g,_,n)}else c.texImage2D(e,t,r,i,a,0,g,_,n)}else c.texImage2D(e,0,r,g,_,l)}_compressedTexImage(e,t,r,i,a,s,l){const c=this._context.gl;let d=null;const u=f(e),h=this._descriptor.isImmutable;if(u){if(this._context.type!==n.zO.WEBGL2)throw new Error("3D textures are not supported in WebGL1");d=c}if(h){if((0,o.pC)(l))if(u){if(null==s)throw new Error("Missing depth dimension for 3D texture upload");d.compressedTexSubImage3D(e,t,0,0,0,i,a,s,r,l)}else c.compressedTexSubImage2D(e,t,0,0,i,a,r,l)}else if(u){if(null==s)throw new Error("Missing depth dimension for 3D texture upload");d.compressedTexImage3D(e,t,r,i,a,s,0,l)}else c.compressedTexImage2D(e,t,r,i,a,0,l)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:o,hasMipmap:a,target:n}=this._descriptor;const l=n===s.No.TEXTURE_3D;if(null==r||null==i||l&&null==o)throw new Error("Missing texture dimensions for mipmap calculation");for(let n=0;e(n,r,i,o),a&&(1!==r||1!==i||l&&1!==o)&&!(n>=t);++n)r=Math.max(1,r>>1),i=Math.max(1,i>>1),l&&(o=Math.max(1,o>>1))}static _validateTexture(e,t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=(0,l.Z)(e.gl),o=null!=t.width&&(0,i.wt)(t.width)&&null!=t.height&&(0,i.wt)(t.height);r||!t.isImmutable&&!f(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||o||("number"==typeof t.wrapMode?t.wrapMode!==s.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===s.e8.CLAMP_TO_EDGE&&t.wrapMode.t===s.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let r=t.samplingMode,i=t.samplingMode;r===s.cw.LINEAR_MIPMAP_NEAREST||r===s.cw.LINEAR_MIPMAP_LINEAR?(r=s.cw.LINEAR,t.hasMipmap||(i=s.cw.LINEAR)):r!==s.cw.NEAREST_MIPMAP_NEAREST&&r!==s.cw.NEAREST_MIPMAP_LINEAR||(r=s.cw.NEAREST,t.hasMipmap||(i=s.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}function u(e){return(0,o.pC)(e)&&"type"in e&&"compressed"===e.type}function h(e){return(0,o.pC)(e)&&!u(e)&&!function(e){return(0,o.pC)(e)&&"byteLength"in e}(e)}function f(e){return e===s.No.TEXTURE_3D||e===s.No.TEXTURE_2D_ARRAY}function m(e,t,r,i=1){let o=Math.max(t,r);return e===s.No.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}d.TEXTURE_UNIT_FOR_UPDATES=0},21968:(e,t,r)=>{r.d(t,{G:()=>i});class i{constructor(e,t,r,i,o,a=!1,n=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=o,this.normalized=a,this.divisor=n}}},46314:(e,t,r)=>{function i(e){return window.WebGL2RenderingContext&&e instanceof window.WebGL2RenderingContext}r.d(t,{Z:()=>i})},49300:(e,t,r)=>{r.d(t,{hZ:()=>s,zu:()=>l});var i=r(20102),o=r(80442);const a=r(92604).Z.getLogger("esri.views.webgl.checkWebGLError"),n=!!(0,o.Z)("enable-feature:webgl-debug");function s(){return n}function l(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),o=(new Error).stack;a.error(new i.Z("webgl-error","WebGL error occured",{message:r,stack:o}))}}}},54738:(e,t,r)=>{r.d(t,{Sh:()=>n,kr:()=>s,zO:()=>i});var i,o,a=r(80442);function n(e){const t=(0,a.Z)("esri-force-webgl");if(t===i.WEBGL1||t===i.WEBGL2)return[t];switch(e){case"2d":return(0,a.Z)("mac")&&(0,a.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1];case"3d":return[i.WEBGL2,i.WEBGL1]}}function s(e,t,r={}){const o=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let a=null;for(const t of o){try{a=e.getContext(t,r)}catch(e){}if(a)break}return a}(o=i||(i={}))[o.WEBGL1=1]="WEBGL1",o[o.WEBGL2=2]="WEBGL2"},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],t[i]=a[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],a[1]=e[i]-a[0],t[i]=a[1];return t}r.d(t,{GB:()=>o,U8:()=>i});const a=new Float32Array(2)}}]);
|