@selvajs/selva 4.6.4 → 4.6.6
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/build/client/_app/immutable/chunks/{kqY4iNX9.js → C6SyTEsn.js} +1 -1
- package/build/client/_app/immutable/chunks/C6SyTEsn.js.br +0 -0
- package/build/client/_app/immutable/chunks/C6SyTEsn.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DTwF8a4f.js → D5M_yfbV.js} +1 -1
- package/build/client/_app/immutable/chunks/D5M_yfbV.js.br +0 -0
- package/build/client/_app/immutable/chunks/D5M_yfbV.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{xMLzEyKt.js → DYqDOoj1.js} +1 -1
- package/build/client/_app/immutable/chunks/DYqDOoj1.js.br +0 -0
- package/build/client/_app/immutable/chunks/DYqDOoj1.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{efMfXvhN.js → DnyAtWEo.js} +1 -1
- package/build/client/_app/immutable/chunks/DnyAtWEo.js.br +0 -0
- package/build/client/_app/immutable/chunks/DnyAtWEo.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{C8KcKJ2c.js → iMhxXFaA.js} +1 -1
- package/build/client/_app/immutable/chunks/iMhxXFaA.js.br +0 -0
- package/build/client/_app/immutable/chunks/iMhxXFaA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BB1-pRUc.js → r9bfnncm.js} +1 -1
- package/build/client/_app/immutable/chunks/r9bfnncm.js.br +0 -0
- package/build/client/_app/immutable/chunks/r9bfnncm.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{GJ_fYrsb.js → v1r5UIYh.js} +1 -1
- package/build/client/_app/immutable/chunks/v1r5UIYh.js.br +0 -0
- package/build/client/_app/immutable/chunks/v1r5UIYh.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.ayFUwlR2.js → app.CdBcyly9.js} +2 -2
- package/build/client/_app/immutable/entry/app.CdBcyly9.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CdBcyly9.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.B892ywNW.js +1 -0
- package/build/client/_app/immutable/entry/start.B892ywNW.js.br +2 -0
- package/build/client/_app/immutable/entry/start.B892ywNW.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.OHDpG75C.js → 1.oJLEZQGW.js} +1 -1
- package/build/client/_app/immutable/nodes/1.oJLEZQGW.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.oJLEZQGW.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{11.DKuji22U.js → 11.B0-Abhv0.js} +1 -1
- package/build/client/_app/immutable/nodes/11.B0-Abhv0.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.B0-Abhv0.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{13.B-60I9lB.js → 13.CDv5s6nc.js} +1 -1
- package/build/client/_app/immutable/nodes/13.CDv5s6nc.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.CDv5s6nc.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{14.BHdFda_f.js → 14.DA7MBORT.js} +1 -1
- package/build/client/_app/immutable/nodes/14.DA7MBORT.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.DA7MBORT.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{15.C48gvhUW.js → 15.CiJM83w8.js} +1 -1
- package/build/client/_app/immutable/nodes/15.CiJM83w8.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.CiJM83w8.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{16.apc1jfZS.js → 16.Wa9xdogw.js} +1 -1
- package/build/client/_app/immutable/nodes/16.Wa9xdogw.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.Wa9xdogw.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{17.C_DixZEs.js → 17.CnxURr3J.js} +1 -1
- package/build/client/_app/immutable/nodes/17.CnxURr3J.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.CnxURr3J.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{19.kCOSxKLQ.js → 19.D3zOEMhL.js} +1 -1
- package/build/client/_app/immutable/nodes/19.D3zOEMhL.js.br +0 -0
- package/build/client/_app/immutable/nodes/19.D3zOEMhL.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.CZ_JTzGV.js → 2.B9S8BLZL.js} +1 -1
- package/build/client/_app/immutable/nodes/2.B9S8BLZL.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.B9S8BLZL.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{20.DfIbo8sC.js → 20.BrsBkxbd.js} +1 -1
- package/build/client/_app/immutable/nodes/20.BrsBkxbd.js.br +0 -0
- package/build/client/_app/immutable/nodes/{20.DfIbo8sC.js.gz → 20.BrsBkxbd.js.gz} +0 -0
- package/build/client/_app/immutable/nodes/{21.sNazVMuJ.js → 21.CRh4-aIs.js} +1 -1
- package/build/client/_app/immutable/nodes/21.CRh4-aIs.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.CRh4-aIs.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{23.BYWuf3Je.js → 23.Dd0KaD8G.js} +1 -1
- package/build/client/_app/immutable/nodes/23.Dd0KaD8G.js.br +0 -0
- package/build/client/_app/immutable/nodes/23.Dd0KaD8G.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{24.DsuSLxnA.js → 24.D3ew5iON.js} +1 -1
- package/build/client/_app/immutable/nodes/24.D3ew5iON.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.D3ew5iON.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{27.CYCMB-6E.js → 27.BS_rBkci.js} +1 -1
- package/build/client/_app/immutable/nodes/27.BS_rBkci.js.br +0 -0
- package/build/client/_app/immutable/nodes/27.BS_rBkci.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{28.DEJSgCwe.js → 28.bY8AWwbI.js} +1 -1
- package/build/client/_app/immutable/nodes/28.bY8AWwbI.js.br +0 -0
- package/build/client/_app/immutable/nodes/28.bY8AWwbI.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{29.DpP7L_Vr.js → 29.CiiSFWt5.js} +1 -1
- package/build/client/_app/immutable/nodes/29.CiiSFWt5.js.br +0 -0
- package/build/client/_app/immutable/nodes/29.CiiSFWt5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.QiNVb4PX.js → 3.4LgasaAS.js} +1 -1
- package/build/client/_app/immutable/nodes/3.4LgasaAS.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.4LgasaAS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{30.DOLy4Xgo.js → 30.CrM-PV7w.js} +1 -1
- package/build/client/_app/immutable/nodes/30.CrM-PV7w.js.br +0 -0
- package/build/client/_app/immutable/nodes/30.CrM-PV7w.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{5.COAcxPVZ.js → 5.CgL-uV0s.js} +1 -1
- package/build/client/_app/immutable/nodes/5.CgL-uV0s.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.CgL-uV0s.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{6.Bo3fUdyh.js → 6.ojkimVuV.js} +1 -1
- package/build/client/_app/immutable/nodes/6.ojkimVuV.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.ojkimVuV.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.Bt2Y30-j.js → 7.DTdqiUTt.js} +1 -1
- package/build/client/_app/immutable/nodes/7.DTdqiUTt.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.DTdqiUTt.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{8.B9-zhwmr.js → 8.Cok-hHoD.js} +1 -1
- package/build/client/_app/immutable/nodes/8.Cok-hHoD.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.Cok-hHoD.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{9.Kq2on8AO.js → 9.CaUtmM-j.js} +1 -1
- package/build/client/_app/immutable/nodes/9.CaUtmM-j.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.CaUtmM-j.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/handler.js +4 -4
- package/build/index.js +4 -4
- package/build/server/chunks/chunks/{internal.js-DbXgQdEa.js → internal.js-sUBGr0Bt.js} +2 -2
- package/build/server/chunks/chunks/{internal.js-DbXgQdEa.js.map → internal.js-sUBGr0Bt.js.map} +1 -1
- package/build/server/chunks/chunks/{package.js-C50mFP7B.js → package.js-CAz8pnaN.js} +2 -2
- package/build/server/chunks/chunks/{package.js-C50mFP7B.js.map → package.js-CAz8pnaN.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/compute/{_server.ts.js-BjGQaRKi.js → _server.ts.js-O2KOa4aC.js} +35 -6
- package/build/server/chunks/entries/endpoints/api/compute/_server.ts.js-O2KOa4aC.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/diag/throughput/_server.ts.js-C5urgMLC.js +55 -0
- package/build/server/chunks/entries/endpoints/api/diag/throughput/_server.ts.js-C5urgMLC.js.map +1 -0
- package/build/server/chunks/entries/pages/admin/{_page.server.ts.js-Bz-pns6F.js → _page.server.ts.js-ByhNy61Z.js} +2 -2
- package/build/server/chunks/entries/pages/admin/{_page.server.ts.js-Bz-pns6F.js.map → _page.server.ts.js-ByhNy61Z.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/system/{_page.server.ts.js-C0tF2GA1.js → _page.server.ts.js-x89nYF9K.js} +2 -2
- package/build/server/chunks/entries/pages/admin/system/{_page.server.ts.js-C0tF2GA1.js.map → _page.server.ts.js-x89nYF9K.js.map} +1 -1
- package/build/server/chunks/{handler-CAcxXurr.js → handler-C4-_gTLb.js} +3 -3
- package/build/server/chunks/{handler-CAcxXurr.js.map → handler-C4-_gTLb.js.map} +1 -1
- package/build/server/chunks/{index.js-DTXKQt-L.js → index.js-Cz0ONat-.js} +2 -2
- package/build/server/chunks/{index.js-DTXKQt-L.js.map → index.js-Cz0ONat-.js.map} +1 -1
- package/build/server/chunks/{manifest.js-BwEyEyvE.js → manifest.js-DPbU2Ov3.js} +33 -26
- package/build/server/chunks/manifest.js-DPbU2Ov3.js.map +1 -0
- package/build/server/chunks/nodes/{1.js-Dkjkt2Ob.js → 1.js-Br_s35u3.js} +2 -2
- package/build/server/chunks/nodes/{1.js-Dkjkt2Ob.js.map → 1.js-Br_s35u3.js.map} +1 -1
- package/build/server/chunks/nodes/{11.js-DvSZQKZw.js → 11.js-CeIdsvto.js} +2 -2
- package/build/server/chunks/nodes/{11.js-DvSZQKZw.js.map → 11.js-CeIdsvto.js.map} +1 -1
- package/build/server/chunks/nodes/{13.js-DNO3YOIS.js → 13.js-Cho2zGNR.js} +2 -2
- package/build/server/chunks/nodes/{13.js-DNO3YOIS.js.map → 13.js-Cho2zGNR.js.map} +1 -1
- package/build/server/chunks/nodes/{14.js-B4_yMN6W.js → 14.js-BdhYygLK.js} +2 -2
- package/build/server/chunks/nodes/{14.js-B4_yMN6W.js.map → 14.js-BdhYygLK.js.map} +1 -1
- package/build/server/chunks/nodes/{15.js-D5NgufZP.js → 15.js-BPvi5Ryf.js} +4 -4
- package/build/server/chunks/nodes/{15.js-D5NgufZP.js.map → 15.js-BPvi5Ryf.js.map} +1 -1
- package/build/server/chunks/nodes/{16.js-_ux_QBPR.js → 16.js-Px_iziUh.js} +2 -2
- package/build/server/chunks/nodes/{16.js-_ux_QBPR.js.map → 16.js-Px_iziUh.js.map} +1 -1
- package/build/server/chunks/nodes/{17.js-CmBe1BAI.js → 17.js-BpM0C2oK.js} +2 -2
- package/build/server/chunks/nodes/{17.js-CmBe1BAI.js.map → 17.js-BpM0C2oK.js.map} +1 -1
- package/build/server/chunks/nodes/{19.js-DTwMJjGu.js → 19.js-b6UCCZsh.js} +2 -2
- package/build/server/chunks/nodes/{19.js-DTwMJjGu.js.map → 19.js-b6UCCZsh.js.map} +1 -1
- package/build/server/chunks/nodes/{2.js-BSLN6HY2.js → 2.js-8ZNoe-1x.js} +2 -2
- package/build/server/chunks/nodes/{2.js-BSLN6HY2.js.map → 2.js-8ZNoe-1x.js.map} +1 -1
- package/build/server/chunks/nodes/{20.js-Btu80H-L.js → 20.js-CVBtNChR.js} +2 -2
- package/build/server/chunks/nodes/{20.js-Btu80H-L.js.map → 20.js-CVBtNChR.js.map} +1 -1
- package/build/server/chunks/nodes/{21.js-Cvg4NQZl.js → 21.js-BQv78MvM.js} +2 -2
- package/build/server/chunks/nodes/{21.js-Cvg4NQZl.js.map → 21.js-BQv78MvM.js.map} +1 -1
- package/build/server/chunks/nodes/{23.js-CszOH3UA.js → 23.js-D-rDSLKh.js} +2 -2
- package/build/server/chunks/nodes/{23.js-CszOH3UA.js.map → 23.js-D-rDSLKh.js.map} +1 -1
- package/build/server/chunks/nodes/{24.js-B1pSuAYW.js → 24.js-BEKIaE_T.js} +2 -2
- package/build/server/chunks/nodes/{24.js-B1pSuAYW.js.map → 24.js-BEKIaE_T.js.map} +1 -1
- package/build/server/chunks/nodes/{27.js-Ce7k8WWG.js → 27.js-CLYdtFD3.js} +2 -2
- package/build/server/chunks/nodes/{27.js-Ce7k8WWG.js.map → 27.js-CLYdtFD3.js.map} +1 -1
- package/build/server/chunks/nodes/{28.js-BpIMieLv.js → 28.js-4I48uOEk.js} +2 -2
- package/build/server/chunks/nodes/{28.js-BpIMieLv.js.map → 28.js-4I48uOEk.js.map} +1 -1
- package/build/server/chunks/nodes/{29.js-fwfv5rpN.js → 29.js-B5YMSLBJ.js} +2 -2
- package/build/server/chunks/nodes/{29.js-fwfv5rpN.js.map → 29.js-B5YMSLBJ.js.map} +1 -1
- package/build/server/chunks/nodes/{3.js-C2IvQtb4.js → 3.js--JuqH32r.js} +2 -2
- package/build/server/chunks/nodes/{3.js-C2IvQtb4.js.map → 3.js--JuqH32r.js.map} +1 -1
- package/build/server/chunks/nodes/{30.js-DeTxxF6g.js → 30.js-wiXmW7SJ.js} +2 -2
- package/build/server/chunks/nodes/{30.js-DeTxxF6g.js.map → 30.js-wiXmW7SJ.js.map} +1 -1
- package/build/server/chunks/nodes/{5.js-CBTAEFYJ.js → 5.js-BUBb_r4y.js} +2 -2
- package/build/server/chunks/nodes/{5.js-CBTAEFYJ.js.map → 5.js-BUBb_r4y.js.map} +1 -1
- package/build/server/chunks/nodes/{6.js-CQquoitn.js → 6.js-C_8FpzOr.js} +2 -2
- package/build/server/chunks/nodes/{6.js-CQquoitn.js.map → 6.js-C_8FpzOr.js.map} +1 -1
- package/build/server/chunks/nodes/{7.js-RAm6JMMi.js → 7.js-J2IEC7hV.js} +2 -2
- package/build/server/chunks/nodes/{7.js-RAm6JMMi.js.map → 7.js-J2IEC7hV.js.map} +1 -1
- package/build/server/chunks/nodes/{8.js-t7XR90NC.js → 8.js-Bw7bTByq.js} +2 -2
- package/build/server/chunks/nodes/{8.js-t7XR90NC.js.map → 8.js-Bw7bTByq.js.map} +1 -1
- package/build/server/chunks/nodes/{9.js-Xu_k4gv-.js → 9.js-xv3MqQQQ.js} +4 -4
- package/build/server/chunks/nodes/{9.js-Xu_k4gv-.js.map → 9.js-xv3MqQQQ.js.map} +1 -1
- package/package.json +1 -1
- package/build/client/_app/immutable/chunks/BB1-pRUc.js.br +0 -0
- package/build/client/_app/immutable/chunks/BB1-pRUc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C8KcKJ2c.js.br +0 -0
- package/build/client/_app/immutable/chunks/C8KcKJ2c.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DTwF8a4f.js.br +0 -0
- package/build/client/_app/immutable/chunks/DTwF8a4f.js.gz +0 -0
- package/build/client/_app/immutable/chunks/GJ_fYrsb.js.br +0 -0
- package/build/client/_app/immutable/chunks/GJ_fYrsb.js.gz +0 -0
- package/build/client/_app/immutable/chunks/efMfXvhN.js.br +0 -0
- package/build/client/_app/immutable/chunks/efMfXvhN.js.gz +0 -0
- package/build/client/_app/immutable/chunks/kqY4iNX9.js.br +0 -0
- package/build/client/_app/immutable/chunks/kqY4iNX9.js.gz +0 -0
- package/build/client/_app/immutable/chunks/xMLzEyKt.js.br +0 -0
- package/build/client/_app/immutable/chunks/xMLzEyKt.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.ayFUwlR2.js.br +0 -0
- package/build/client/_app/immutable/entry/app.ayFUwlR2.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BlXJOZTS.js +0 -1
- package/build/client/_app/immutable/entry/start.BlXJOZTS.js.br +0 -2
- package/build/client/_app/immutable/entry/start.BlXJOZTS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.OHDpG75C.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.OHDpG75C.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.DKuji22U.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.DKuji22U.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.B-60I9lB.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.B-60I9lB.js.gz +0 -0
- package/build/client/_app/immutable/nodes/14.BHdFda_f.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.BHdFda_f.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.C48gvhUW.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.C48gvhUW.js.gz +0 -0
- package/build/client/_app/immutable/nodes/16.apc1jfZS.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.apc1jfZS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/17.C_DixZEs.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.C_DixZEs.js.gz +0 -0
- package/build/client/_app/immutable/nodes/19.kCOSxKLQ.js.br +0 -0
- package/build/client/_app/immutable/nodes/19.kCOSxKLQ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.CZ_JTzGV.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.CZ_JTzGV.js.gz +0 -0
- package/build/client/_app/immutable/nodes/20.DfIbo8sC.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.sNazVMuJ.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.sNazVMuJ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/23.BYWuf3Je.js.br +0 -0
- package/build/client/_app/immutable/nodes/23.BYWuf3Je.js.gz +0 -0
- package/build/client/_app/immutable/nodes/24.DsuSLxnA.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.DsuSLxnA.js.gz +0 -0
- package/build/client/_app/immutable/nodes/27.CYCMB-6E.js.br +0 -0
- package/build/client/_app/immutable/nodes/27.CYCMB-6E.js.gz +0 -0
- package/build/client/_app/immutable/nodes/28.DEJSgCwe.js.br +0 -0
- package/build/client/_app/immutable/nodes/28.DEJSgCwe.js.gz +0 -0
- package/build/client/_app/immutable/nodes/29.DpP7L_Vr.js.br +0 -0
- package/build/client/_app/immutable/nodes/29.DpP7L_Vr.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.QiNVb4PX.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.QiNVb4PX.js.gz +0 -0
- package/build/client/_app/immutable/nodes/30.DOLy4Xgo.js.br +0 -0
- package/build/client/_app/immutable/nodes/30.DOLy4Xgo.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.COAcxPVZ.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.COAcxPVZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.Bo3fUdyh.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.Bo3fUdyh.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.Bt2Y30-j.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.Bt2Y30-j.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.B9-zhwmr.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.B9-zhwmr.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.Kq2on8AO.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.Kq2on8AO.js.gz +0 -0
- package/build/server/chunks/entries/endpoints/api/compute/_server.ts.js-BjGQaRKi.js.map +0 -1
- package/build/server/chunks/manifest.js-BwEyEyvE.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as gp}from"../chunks/BapAUJpM.js";import"../chunks/DsnmJJEf.js";import{b1 as Fg,bc as Og,bm as zg,P as Bg,O as Ms,Q as Cu,g as u,h as W,s as Fe,u as O,j as Pt,J as wn,p as st,f as ee,a as at,d as se,c as $,i as wt,r as j,aB as kg,t as Me,aj as Mr,n as yt,b as Ps,K as Vg,bn as vp,e as Hg,ax as th,bo as nh}from"../chunks/BtOVeLcI.js";import{o as dn,s as Ae,a as Xt,d as zi,k as Gg,e as Wg}from"../chunks/BNpXeuQ_.js";import{c as we,a as P,p as Tn,f as K,t as Et,d as Xg}from"../chunks/BoLtD6vo.js";import{i as xe}from"../chunks/DAQN5y4A.js";import{d as ma,u as Pu,o as jg,p as Nt,L as qg,l as Yg,a as us,D as mc,i as No,M as Kg,b as gc,f as _l,g as xl,A as Zg,U as $g}from"../chunks/BB1-pRUc.js";import{S as Jg}from"../chunks/BRHPfB44.js";import{M as Qg,l as ev,m as tv,q as _p,r as nv,s as iv,t as rv,v as sv,w as av,x as ov,A as lv,o as cv,f as xp,u as uv,g as dv,y as hv,a as fv,k as pv}from"../chunks/SM988pE-.js";import{f as Ft,r as Ru,e as Zt,a as Qt,c as Dt,d as Uo,k as bp,l as bl,j as Ii,s as mv}from"../chunks/22C0ZkpD.js";import{s as mt,r as ut,p as oe,c as Ne,b as ui}from"../chunks/ChEZL1UP.js";import{p as ih}from"../chunks/kqY4iNX9.js";import{a as tl,o as yp}from"../chunks/C4cbQnXC.js";import{w as bo,F as rh}from"../chunks/aGXM-hZQ.js";import{b as Sp}from"../chunks/Bfsx6G_D.js";import{S as na}from"../chunks/CkeXmJE0.js";import{S as Fo}from"../chunks/BdIvVr5K.js";import{S as sh}from"../chunks/CitY1SZ1.js";import{C as Du}from"../chunks/Bj6y_fSA.js";import{I as fn,c as ci}from"../chunks/BuC_QZkR.js";import{X as gv}from"../chunks/Ca8xAcDY.js";import{R as wr,D as Er,b as dr,a as ms,c as gs}from"../chunks/jiMRToiE.js";import{s as pt}from"../chunks/8uBOzWQA.js";import{a as bi,e as Pr,h as Oo,x as vv,c as Lu,b as Vn,d as Qe,m as jt,s as vc,r as Iu,S as _v,y as xv}from"../chunks/Bf2Kb0d4.js";import{C as pr,w as fr,E as bv,S as yv,h as Mp,n as Un,d as wp,e as Ep,a as Tp,A as Ap,H as Cp,c as Pp,j as Rp}from"../chunks/MGblXd4C.js";import{i as Sv,H as Mv,F as Dp,P as Lp,c as Ip,g as zo,d as Np,o as Up,R as wv,S as Ev,a as Tv,b as Av}from"../chunks/DNdxyuBP.js";import{C as ia}from"../chunks/LZnjyP_x.js";import{B as Bn}from"../chunks/mlApEF2J.js";import{P as Cv,F as ah,D as yl,U as oh}from"../chunks/CFq1UfS7.js";import{h as Pv}from"../chunks/ClDgNAKE.js";import{T as Rv,a as Dv,b as Lv,d as Iv,c as Nv}from"../chunks/BVUbFuzT.js";import{C as Fp,a as vs}from"../chunks/BawNisij.js";import{C as Op}from"../chunks/Mn4D08zE.js";import{T as yo}from"../chunks/DllGpGf3.js";import{C as Uv,a as Fv}from"../chunks/CY6l1SkO.js";import{C as Ov}from"../chunks/C2PlvXZq.js";import{C as zv}from"../chunks/C0Xb3vka.js";import{L as or}from"../chunks/wegQDfR0.js";import{a as Bv}from"../chunks/C8KcKJ2c.js";import{I as _s}from"../chunks/CJvX1bCR.js";import{M as kv,C as Vv,I as Hv}from"../chunks/C38beKZN.js";import{t as Gv}from"../chunks/ADO9qhNc.js";import{F as Wv}from"../chunks/k1GnUs7f.js";import{r as Xv}from"../chunks/Cbu9Tg11.js";import{C as jv}from"../chunks/3w4Rd2x8.js";import{inflateSync as qv}from"../chunks/BzBbrBKd.js";const Yv=[];function Nu(n,e=!1,t=!1){return So(n,new Map,"",Yv,null,t)}function So(n,e,t,i,r=null,s=!1){if(typeof n=="object"&&n!==null){var a=e.get(n);if(a!==void 0)return a;if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);if(Fg(n)){var o=Array(n.length);e.set(n,o),r!==null&&e.set(r,o);for(var l=0;l<n.length;l+=1){var c=n[l];l in n&&(o[l]=So(c,e,t,i,null,s))}return o}if(Og(n)===zg){o={},e.set(n,o),r!==null&&e.set(r,o);for(var d of Object.keys(n))o[d]=So(n[d],e,t,i,null,s);return o}if(n instanceof Date)return structuredClone(n);if(typeof n.toJSON=="function"&&!s)return So(n.toJSON(),e,t,i,n)}if(n instanceof EventTarget)return n;try{return structuredClone(n)}catch{return n}}class Kv{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return Bg(this.#t)}get(){const e=Ms(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=Ms(this.#t);return t===void 0?e:t}set(e){return Cu(this.#t,e)}}function lh(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]];fn(n,mt({name:"box"},()=>t,{get iconNode(){return i}}))}function Zv(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"}],["circle",{cx:"12",cy:"13",r:"3"}]];fn(n,mt({name:"camera"},()=>t,{get iconNode(){return i}}))}function $v(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}],["path",{d:"m9 11 3 3L22 4"}]];fn(n,mt({name:"circle-check-big"},()=>t,{get iconNode(){return i}}))}function ch(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]];fn(n,mt({name:"circle-question-mark"},()=>t,{get iconNode(){return i}}))}function zp(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];fn(n,mt({name:"download"},()=>t,{get iconNode(){return i}}))}function Sl(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}],["path",{d:"m2 2 20 20"}]];fn(n,mt({name:"eye-off"},()=>t,{get iconNode(){return i}}))}function Ml(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];fn(n,mt({name:"eye"},()=>t,{get iconNode(){return i}}))}function Jv(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}]];fn(n,mt({name:"file"},()=>t,{get iconNode(){return i}}))}function Qv(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}]];fn(n,mt({name:"folder"},()=>t,{get iconNode(){return i}}))}function e0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["line",{x1:"22",x2:"2",y1:"6",y2:"6"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22"}]];fn(n,mt({name:"frame"},()=>t,{get iconNode(){return i}}))}function t0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M3 9h18"}],["path",{d:"M3 15h18"}],["path",{d:"M9 3v18"}],["path",{d:"M15 3v18"}]];fn(n,mt({name:"grid-3x3"},()=>t,{get iconNode(){return i}}))}function n0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}]];fn(n,mt({name:"inbox"},()=>t,{get iconNode(){return i}}))}function i0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"}]];fn(n,mt({name:"layers"},()=>t,{get iconNode(){return i}}))}function r0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];fn(n,mt({name:"link"},()=>t,{get iconNode(){return i}}))}function Uu(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12 2v4"}],["path",{d:"m16.2 7.8 2.9-2.9"}],["path",{d:"M18 12h4"}],["path",{d:"m16.2 16.2 2.9 2.9"}],["path",{d:"M12 18v4"}],["path",{d:"m4.9 19.1 2.9-2.9"}],["path",{d:"M2 12h4"}],["path",{d:"m4.9 4.9 2.9 2.9"}]];fn(n,mt({name:"loader"},()=>t,{get iconNode(){return i}}))}function Fu(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"}]];fn(n,mt({name:"maximize"},()=>t,{get iconNode(){return i}}))}function Ou(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"}]];fn(n,mt({name:"minimize"},()=>t,{get iconNode(){return i}}))}function s0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z"}],["path",{d:"m14.5 12.5 2-2"}],["path",{d:"m11.5 9.5 2-2"}],["path",{d:"m8.5 6.5 2-2"}],["path",{d:"m17.5 15.5 2-2"}]];fn(n,mt({name:"ruler"},()=>t,{get iconNode(){return i}}))}function a0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M14 17H5"}],["path",{d:"M19 7h-9"}],["circle",{cx:"17",cy:"17",r:"3"}],["circle",{cx:"7",cy:"7",r:"3"}]];fn(n,mt({name:"settings-2"},()=>t,{get iconNode(){return i}}))}function o0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}]];fn(n,mt({name:"square"},()=>t,{get iconNode(){return i}}))}function l0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];fn(n,mt({name:"zap"},()=>t,{get iconNode(){return i}}))}function c0(n,e){if(Sv(n)){const i=n();return i===void 0?e:i}return n===void 0?e:n}function nl(n,e){let t=Fe(null);const i=O(()=>c0(e,250));function r(...s){if(u(t))u(t).timeout&&clearTimeout(u(t).timeout);else{let a,o;const l=new Promise((c,d)=>{a=c,o=d});W(t,{timeout:null,runner:null,promise:l,resolve:a,reject:o},!0)}return u(t).runner=async()=>{if(!u(t))return;const a=u(t);W(t,null);try{a.resolve(await n.apply(this,s))}catch(o){a.reject(o)}},u(t).timeout=setTimeout(u(t).runner,u(i)),u(t).promise}return r.cancel=async()=>{(!u(t)||u(t).timeout===null)&&(await new Promise(s=>setTimeout(s,0)),!u(t)||u(t).timeout===null)||(clearTimeout(u(t).timeout),u(t).reject("Cancelled"),W(t,null))},r.runScheduledNow=async()=>{(!u(t)||!u(t).timeout)&&(await new Promise(s=>setTimeout(s,0)),!u(t)||!u(t).timeout)||(clearTimeout(u(t).timeout),u(t).timeout=null,await u(t).runner?.())},Object.defineProperty(r,"pending",{enumerable:!0,get(){return!!u(t)?.timeout}}),r}class zu{#e=Fe(!1);constructor(){Pt(()=>(wn(()=>W(this.#e,!0)),()=>{W(this.#e,!1)}))}get current(){return u(this.#e)}}const u0=Lu({component:"checkbox",parts:["root","group","group-label","input"]}),d0=new pr("Checkbox.Group"),Bp=new pr("Checkbox.Root");class Bu{static create(e,t=null){return Bp.set(new Bu(e,t))}opts;group;#e=O(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.opts.name.current);get trueName(){return u(this.#e)}set trueName(e){W(this.#e,e)}#t=O(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return u(this.#t)}set trueRequired(e){W(this.#t,e)}#n=O(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return u(this.#n)}set trueDisabled(e){W(this.#n,e)}#i=O(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return u(this.#i)}set trueReadonly(e){W(this.#i,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=bi(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),fr.pre([()=>Nu(this.group?.opts.value.current),()=>this.opts.value.current],([i,r])=>{!i||!r||(this.opts.checked.current=i.includes(r))}),fr.pre(()=>this.opts.checked.current,i=>{this.group&&(i?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===bv){e.preventDefault(),this.opts.type.current==="submit"&&e.currentTarget.closest("form")?.requestSubmit();return}e.key===yv&&(e.preventDefault(),this.#r())}}#r(){this.opts.indeterminate.current?(this.opts.indeterminate.current=!1,this.opts.checked.current=!0):this.opts.checked.current=!this.opts.checked.current}onclick(e){if(!(this.trueDisabled||this.trueReadonly)){if(this.opts.type.current==="submit"){this.#r();return}e.preventDefault(),this.#r()}}#s=O(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return u(this.#s)}set snippetProps(e){W(this.#s,e)}#a=O(()=>({id:this.opts.id.current,role:"checkbox",type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":vv(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":Oo(this.trueRequired),"aria-readonly":Oo(this.trueReadonly),"data-disabled":Pr(this.trueDisabled),"data-readonly":Pr(this.trueReadonly),"data-state":h0(this.opts.checked.current,this.opts.indeterminate.current),[u0.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return u(this.#a)}set props(e){W(this.#a,e)}}class ku{static create(){return new ku(Bp.get())}root;#e=O(()=>this.root.group?!!(this.root.opts.value.current!==void 0&&this.root.group.opts.value.current.includes(this.root.opts.value.current)):this.root.opts.checked.current);get trueChecked(){return u(this.#e)}set trueChecked(e){W(this.#e,e)}#t=O(()=>!!this.root.trueName);get shouldRender(){return u(this.#t)}set shouldRender(e){W(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){Mp(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=O(()=>({type:"checkbox",checked:this.root.opts.checked.current===!0,disabled:this.root.trueDisabled,required:this.root.trueRequired,name:this.root.trueName,value:this.root.opts.value.current,readonly:this.root.trueReadonly,onfocus:this.onfocus}));get props(){return u(this.#n)}set props(e){W(this.#n,e)}}function h0(n,e){return e?"indeterminate":n?"checked":"unchecked"}function f0(n,e){st(e,!0);const t=ku.create();var i=we(),r=ee(i);{var s=a=>{Mv(a,mt(()=>t.props))};xe(r,a=>{t.shouldRender&&a(s)})}P(n,i),at()}var p0=K("<button><!></button>"),m0=K("<!> <!>",1);function g0(n,e){const t=Tn();st(e,!0);let i=oe(e,"checked",15,!1),r=oe(e,"ref",15,null),s=oe(e,"disabled",3,!1),a=oe(e,"required",3,!1),o=oe(e,"name",3,void 0),l=oe(e,"value",3,"on"),c=oe(e,"id",19,()=>Vn(t)),d=oe(e,"indeterminate",15,!1),f=oe(e,"type",3,"button"),h=ut(e,["$$slots","$$events","$$legacy","checked","ref","onCheckedChange","children","disabled","required","name","value","id","indeterminate","onIndeterminateChange","child","type","readonly"]);const p=d0.getOr(null);p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1)),fr.pre(()=>l(),()=>{p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1))});const m=Bu.create({checked:Qe(()=>i(),E=>{i(E),e.onCheckedChange?.(E)}),disabled:Qe(()=>s()??!1),required:Qe(()=>a()),name:Qe(()=>o()),value:Qe(()=>l()),id:Qe(()=>c()),ref:Qe(()=>r(),E=>r(E)),indeterminate:Qe(()=>d(),E=>{d(E),e.onIndeterminateChange?.(E)}),type:Qe(()=>f()),readonly:Qe(()=>!!e.readonly)},p),x=O(()=>jt({...h},m.props));var g=m0(),v=ee(g);{var y=E=>{var S=we(),A=ee(S);{let _=O(()=>({props:u(x),...m.snippetProps}));pt(A,()=>e.child,()=>u(_))}P(E,S)},w=E=>{var S=p0();Ft(S,()=>({...u(x)}));var A=$(S);pt(A,()=>e.children??wt,()=>m.snippetProps),j(S),P(E,S)};xe(v,E=>{e.child?E(y):E(w,-1)})}var b=se(v,2);f0(b,{}),P(n,g),at()}function v0(n,e){st(e,!0);let t=oe(e,"open",15,!1),i=oe(e,"onOpenChange",3,Un),r=oe(e,"onOpenChangeComplete",3,Un);Qg.create({open:Qe(()=>t(),s=>{t(s),i()?.(s)}),onOpenChangeComplete:Qe(()=>r())}),Dp(n,{children:(s,a)=>{var o=we(),l=ee(o);pt(l,()=>e.children??wt),P(s,o)},$$slots:{default:!0}}),at()}var _0=K("<div><!></div>");function Ji(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=oe(e,"disabled",3,!1),a=oe(e,"onSelect",3,Un),o=oe(e,"closeOnSelect",3,!0),l=ut(e,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const c=ev.create({id:Qe(()=>r()),disabled:Qe(()=>s()),onSelect:Qe(()=>a()),ref:Qe(()=>i(),x=>i(x)),closeOnSelect:Qe(()=>o())}),d=O(()=>jt(l,c.props));var f=we(),h=ee(f);{var p=x=>{var g=we(),v=ee(g);pt(v,()=>e.child,()=>({props:u(d)})),P(x,g)},m=x=>{var g=_0();Ft(g,()=>({...u(d)}));var v=$(g);pt(v,()=>e.children??wt),j(g),P(x,g)};xe(h,x=>{e.child?x(p):x(m,-1)})}P(n,f),at()}var x0=K("<div><!></div>");function b0(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=ut(e,["$$slots","$$events","$$legacy","ref","id","child","children"]);const a=tv.create({id:Qe(()=>r()),ref:Qe(()=>i(),h=>i(h))}),o=O(()=>jt(s,a.props));var l=we(),c=ee(l);{var d=h=>{var p=we(),m=ee(p);pt(m,()=>e.child,()=>({props:u(o)})),P(h,p)},f=h=>{var p=x0();Ft(p,()=>({...u(o)}));var m=$(p);pt(m,()=>e.children??wt),j(p),P(h,p)};xe(c,h=>{e.child?h(d):h(f,-1)})}P(n,l),at()}var y0=K("<div><div><!></div></div>"),S0=K("<div><div><!></div></div>");function M0(n,e){const t=Tn();st(e,!0);let i=oe(e,"id",19,()=>Vn(t)),r=oe(e,"ref",15,null),s=oe(e,"loop",3,!0),a=oe(e,"onInteractOutside",3,Un),o=oe(e,"forceMount",3,!1),l=oe(e,"onEscapeKeydown",3,Un),c=oe(e,"interactOutsideBehavior",3,"defer-otherwise-close"),d=oe(e,"escapeKeydownBehavior",3,"defer-otherwise-close"),f=oe(e,"onOpenAutoFocus",3,Un),h=oe(e,"onCloseAutoFocus",3,Un),p=oe(e,"onFocusOutside",3,Un),m=oe(e,"side",3,"right"),x=oe(e,"trapFocus",3,!1),g=ut(e,["$$slots","$$events","$$legacy","id","ref","children","child","loop","onInteractOutside","forceMount","onEscapeKeydown","interactOutsideBehavior","escapeKeydownBehavior","onOpenAutoFocus","onCloseAutoFocus","onFocusOutside","side","trapFocus","style"]);const v=_p.create({id:Qe(()=>i()),loop:Qe(()=>s()),ref:Qe(()=>r(),U=>r(U)),isSub:!0,onCloseAutoFocus:Qe(()=>S)});function y(U){const I=U.currentTarget.contains(U.target),R=iv[v.parentMenu.root.opts.dir.current].includes(U.key);I&&R&&(v.parentMenu.onClose(),v.parentMenu.triggerNode?.focus(),U.preventDefault())}const w=O(()=>v.parentMenu.root.getBitsAttr("sub-content")),b=O(()=>jt(g,v.props,{side:m(),onkeydown:y,[u(w)]:""}));function E(U){f()(U),!U.defaultPrevented&&(U.preventDefault(),v.parentMenu.root.isUsingKeyboard&&v.parentMenu.contentNode&&nv.dispatch(v.parentMenu.contentNode))}function S(U){h()(U),!U.defaultPrevented&&U.preventDefault()}function A(U){a()(U),!U.defaultPrevented&&v.parentMenu.onClose()}function _(U){l()(U),!U.defaultPrevented&&v.parentMenu.onClose()}function T(U){if(p()(U),U.defaultPrevented||!Mp(U.target)||U.target.id===v.parentMenu.triggerNode?.id)return;if(v.parentMenu.parentMenu?.contentNode?.contains(U.target)){v.parentMenu.onClose(),U.preventDefault();return}const R=`[${v.parentMenu.root.getBitsAttr("sub-content")}]`;if(U.target.closest(R)){U.preventDefault();return}v.parentMenu.onClose()}var D=we(),L=ee(D);{var F=U=>{Lp(U,mt(()=>u(b),{get ref(){return v.opts.ref},get interactOutsideBehavior(){return c()},get escapeKeydownBehavior(){return d()},onOpenAutoFocus:E,get enabled(){return v.parentMenu.opts.open.current},onInteractOutside:A,onEscapeKeydown:_,onFocusOutside:T,preventScroll:!1,get loop(){return s()},get trapFocus(){return x()},get shouldRender(){return v.shouldRender},popper:(R,z)=>{let q=()=>(z?.()).props,Y=()=>(z?.()).wrapperProps;const te=O(()=>jt(q(),u(b),{style:zo("menu")},{style:e.style}));var le=we(),B=ee(le);{var J=he=>{var G=we(),ie=ee(G);{let Z=O(()=>({props:u(te),wrapperProps:Y(),...v.snippetProps}));pt(ie,()=>e.child,()=>u(Z))}P(he,G)},de=he=>{var G=y0();Ft(G,()=>({...Y()}));var ie=$(G);Ft(ie,()=>({...u(te)}));var Z=$(ie);pt(Z,()=>e.children??wt),j(ie),j(G),P(he,G)};xe(B,he=>{e.child?he(J):he(de,-1)})}P(R,le)},$$slots:{popper:!0}}))},k=U=>{Ip(U,mt(()=>u(b),{get ref(){return v.opts.ref},get interactOutsideBehavior(){return c()},get escapeKeydownBehavior(){return d()},onCloseAutoFocus:S,onOpenAutoFocus:E,get open(){return v.parentMenu.opts.open.current},onInteractOutside:A,onEscapeKeydown:_,onFocusOutside:T,preventScroll:!1,get loop(){return s()},get trapFocus(){return x()},get shouldRender(){return v.shouldRender},popper:(R,z)=>{let q=()=>(z?.()).props,Y=()=>(z?.()).wrapperProps;const te=O(()=>jt(q(),u(b),{style:zo("menu")},{style:e.style}));var le=we(),B=ee(le);{var J=he=>{var G=we(),ie=ee(G);{let Z=O(()=>({props:u(te),wrapperProps:Y(),...v.snippetProps}));pt(ie,()=>e.child,()=>u(Z))}P(he,G)},de=he=>{var G=S0();Ft(G,()=>({...Y()}));var ie=$(G);Ft(ie,()=>({...u(te)}));var Z=$(ie);pt(Z,()=>e.children??wt),j(ie),j(G),P(he,G)};xe(B,he=>{e.child?he(J):he(de,-1)})}P(R,le)},$$slots:{popper:!0}}))};xe(L,U=>{o()?U(F):o()||U(k,1)})}P(n,D),at()}var w0=K("<div><!></div>");function E0(n,e){const t=Tn();st(e,!0);let i=oe(e,"id",19,()=>Vn(t)),r=oe(e,"disabled",3,!1),s=oe(e,"ref",15,null),a=oe(e,"onSelect",3,Un),o=oe(e,"openDelay",3,0),l=ut(e,["$$slots","$$events","$$legacy","id","disabled","ref","children","child","onSelect","openDelay"]);const c=rv.create({disabled:Qe(()=>r()),onSelect:Qe(()=>a()),id:Qe(()=>i()),ref:Qe(()=>s(),f=>s(f)),openDelay:Qe(()=>o())}),d=O(()=>jt(l,c.props));Np(n,{get id(){return i()},get ref(){return c.opts.ref},children:(f,h)=>{var p=we(),m=ee(p);{var x=v=>{var y=we(),w=ee(y);pt(w,()=>e.child,()=>({props:u(d)})),P(v,y)},g=v=>{var y=w0();Ft(y,()=>({...u(d)}));var w=$(y);pt(w,()=>e.children??wt),j(y),P(v,y)};xe(m,v=>{e.child?v(x):v(g,-1)})}P(f,p)},$$slots:{default:!0}}),at()}function T0(n,e){st(e,!0);let t=oe(e,"open",15,!1),i=oe(e,"dir",3,"ltr"),r=oe(e,"onOpenChange",3,Un),s=oe(e,"onOpenChangeComplete",3,Un),a=oe(e,"_internal_variant",3,"dropdown-menu"),o=oe(e,"_internal_should_skip_exit_animation",3,void 0);const l=sv.create({variant:Qe(()=>a()),dir:Qe(()=>i()),onClose:()=>{t(!1),r()(!1)},shouldSkipExitAnimation:()=>o()?.()??!1});av.create({open:Qe(()=>t(),c=>{t(c),r()(c)}),onOpenChangeComplete:Qe(()=>s())},l),Dp(n,{children:(c,d)=>{var f=we(),h=ee(f);pt(h,()=>e.children??wt),P(c,f)},$$slots:{default:!0}}),at()}var A0=K("<div><div><!></div></div>"),C0=K("<div><div><!></div></div>");function P0(n,e){const t=Tn();st(e,!0);let i=oe(e,"id",19,()=>Vn(t)),r=oe(e,"ref",15,null),s=oe(e,"loop",3,!0),a=oe(e,"onInteractOutside",3,Un),o=oe(e,"onEscapeKeydown",3,Un),l=oe(e,"onCloseAutoFocus",3,Un),c=oe(e,"forceMount",3,!1),d=oe(e,"trapFocus",3,!1),f=ut(e,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const h=_p.create({id:Qe(()=>i()),loop:Qe(()=>s()),ref:Qe(()=>r(),b=>r(b)),onCloseAutoFocus:Qe(()=>l())}),p=O(()=>jt(f,h.props));function m(b){if(h.handleInteractOutside(b),!b.defaultPrevented&&(a()(b),!b.defaultPrevented)){if(b.target&&b.target instanceof Element){const E=`[${h.parentMenu.root.getBitsAttr("sub-content")}]`;if(b.target.closest(E))return}h.parentMenu.onClose()}}function x(b){o()(b),!b.defaultPrevented&&h.parentMenu.onClose()}var g=we(),v=ee(g);{var y=b=>{Lp(b,mt(()=>u(p),()=>h.popperProps,{get ref(){return h.opts.ref},get enabled(){return h.parentMenu.opts.open.current},onInteractOutside:m,onEscapeKeydown:x,get trapFocus(){return d()},get loop(){return s()},forceMount:!0,get id(){return i()},get shouldRender(){return h.shouldRender},popper:(S,A)=>{let _=()=>(A?.()).props,T=()=>(A?.()).wrapperProps;const D=O(()=>jt(_(),{style:zo("dropdown-menu")},{style:e.style}));var L=we(),F=ee(L);{var k=I=>{var R=we(),z=ee(R);{let q=O(()=>({props:u(D),wrapperProps:T(),...h.snippetProps}));pt(z,()=>e.child,()=>u(q))}P(I,R)},U=I=>{var R=A0();Ft(R,()=>({...T()}));var z=$(R);Ft(z,()=>({...u(D)}));var q=$(z);pt(q,()=>e.children??wt),j(z),j(R),P(I,R)};xe(F,I=>{e.child?I(k):I(U,-1)})}P(S,L)},$$slots:{popper:!0}}))},w=b=>{Ip(b,mt(()=>u(p),()=>h.popperProps,{get ref(){return h.opts.ref},get open(){return h.parentMenu.opts.open.current},onInteractOutside:m,onEscapeKeydown:x,get trapFocus(){return d()},get loop(){return s()},forceMount:!1,get id(){return i()},get shouldRender(){return h.shouldRender},popper:(S,A)=>{let _=()=>(A?.()).props,T=()=>(A?.()).wrapperProps;const D=O(()=>jt(_(),{style:zo("dropdown-menu")},{style:e.style}));var L=we(),F=ee(L);{var k=I=>{var R=we(),z=ee(R);{let q=O(()=>({props:u(D),wrapperProps:T(),...h.snippetProps}));pt(z,()=>e.child,()=>u(q))}P(I,R)},U=I=>{var R=C0();Ft(R,()=>({...T()}));var z=$(R);Ft(z,()=>({...u(D)}));var q=$(z);pt(q,()=>e.children??wt),j(z),j(R),P(I,R)};xe(F,I=>{e.child?I(k):I(U,-1)})}P(S,L)},$$slots:{popper:!0}}))};xe(v,b=>{c()?b(y):c()||b(w,1)})}P(n,g),at()}var R0=K("<button><!></button>");function D0(n,e){const t=Tn();st(e,!0);let i=oe(e,"id",19,()=>Vn(t)),r=oe(e,"ref",15,null),s=oe(e,"disabled",3,!1),a=oe(e,"type",3,"button"),o=ut(e,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const l=ov.create({id:Qe(()=>i()),disabled:Qe(()=>s()??!1),ref:Qe(()=>r(),d=>r(d))}),c=O(()=>jt(o,l.props,{type:a()}));Np(n,{get id(){return i()},get ref(){return l.opts.ref},children:(d,f)=>{var h=we(),p=ee(h);{var m=g=>{var v=we(),y=ee(v);pt(y,()=>e.child,()=>({props:u(c)})),P(g,v)},x=g=>{var v=R0();Ft(v,()=>({...u(c)}));var y=$(v);pt(y,()=>e.children??wt),j(v),P(g,v)};xe(p,g=>{e.child?g(m):g(x,-1)})}P(d,h)},$$slots:{default:!0}}),at()}class Rr{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),Pt(this.handler)}handler(){let e=0;const t=this.#e();if(!t)return;const i=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return i.observe(t),()=>{window.cancelAnimationFrame(e),i.unobserve(t)}}}class L0{opts;present;#e;#t=Fe(!1);#n=!1;#i=Fe(void 0);#r=null;constructor(e){this.opts=e,this.present=this.opts.open,W(this.#t,e.open.current,!0),this.#e=new lv({ref:this.opts.ref,afterTick:this.opts.open}),cv(()=>this.#a()),fr(()=>this.present.current,t=>{if(!this.#n){this.#n=!0;return}this.#a(),t&&W(this.#t,!0),W(this.#i,t?"starting":"ending",!0),t&&(this.#r=window.requestAnimationFrame(()=>{this.#r=null,this.present.current&&W(this.#i,void 0)})),this.#e.run(()=>{t===this.present.current&&(t||W(this.#t,!1),W(this.#i,void 0))})})}#s=O(()=>u(this.#t));get isPresent(){return u(this.#s)}set isPresent(e){W(this.#s,e)}get transitionStatus(){return u(this.#i)}#a(){this.#r!==null&&(window.cancelAnimationFrame(this.#r),this.#r=null)}}function il(n,e){st(e,!0);const t=new L0({open:Qe(()=>e.open),ref:e.ref});var i=we(),r=ee(i);{var s=a=>{var o=we(),l=ee(o);pt(l,()=>e.presence??wt,()=>({present:t.isPresent,transitionStatus:t.transitionStatus})),P(a,o)};xe(r,a=>{(e.forceMount||e.open||t.isPresent)&&a(s)})}P(n,i),at()}function I0(n,e,t){return Math.min(t,Math.max(e,n))}class N0{state;#e;constructor(e,t){this.state=vc(e),this.#e=t,this.dispatch=this.dispatch.bind(this)}#t(e){return this.#e[this.state.current][e]??this.state.current}dispatch(e){this.state.current=this.#t(e)}}const ga=Lu({component:"scroll-area",parts:["root","viewport","corner","thumb","scrollbar"]}),va=new pr("ScrollArea.Root"),_a=new pr("ScrollArea.Scrollbar"),rl=new pr("ScrollArea.ScrollbarVisible"),Vu=new pr("ScrollArea.ScrollbarAxis"),kp=new pr("ScrollArea.ScrollbarShared");class Hu{static create(e){return va.set(new Hu(e))}opts;attachment;#e=Fe(null);get scrollAreaNode(){return u(this.#e)}set scrollAreaNode(e){W(this.#e,e,!0)}#t=Fe(null);get viewportNode(){return u(this.#t)}set viewportNode(e){W(this.#t,e,!0)}#n=Fe(null);get contentNode(){return u(this.#n)}set contentNode(e){W(this.#n,e,!0)}#i=Fe(null);get scrollbarXNode(){return u(this.#i)}set scrollbarXNode(e){W(this.#i,e,!0)}#r=Fe(null);get scrollbarYNode(){return u(this.#r)}set scrollbarYNode(e){W(this.#r,e,!0)}#s=Fe(0);get cornerWidth(){return u(this.#s)}set cornerWidth(e){W(this.#s,e,!0)}#a=Fe(0);get cornerHeight(){return u(this.#a)}set cornerHeight(e){W(this.#a,e,!0)}#o=Fe(!1);get scrollbarXEnabled(){return u(this.#o)}set scrollbarXEnabled(e){W(this.#o,e,!0)}#l=Fe(!1);get scrollbarYEnabled(){return u(this.#l)}set scrollbarYEnabled(e){W(this.#l,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=bi(e.ref,t=>this.scrollAreaNode=t),this.domContext=new xp(e.ref)}#c=O(()=>({id:this.opts.id.current,dir:this.opts.dir.current,style:{position:"relative","--bits-scroll-area-corner-height":`${this.cornerHeight}px`,"--bits-scroll-area-corner-width":`${this.cornerWidth}px`},[ga.root]:"",...this.attachment}));get props(){return u(this.#c)}set props(e){W(this.#c,e)}}class Gu{static create(e){return new Gu(e,va.get())}opts;root;attachment;#e=vc(uv());#t=vc(null);contentAttachment=bi(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=bi(e.ref,i=>this.root.viewportNode=i)}#n=O(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?"scroll":"hidden",overflowY:this.root.scrollbarYEnabled?"scroll":"hidden"},[ga.viewport]:"",...this.attachment}));get props(){return u(this.#n)}set props(e){W(this.#n,e)}#i=O(()=>({id:this.#e.current,"data-scroll-area-content":"",style:{minWidth:this.root.scrollbarXEnabled?"fit-content":void 0},...this.contentAttachment}));get contentProps(){return u(this.#i)}set contentProps(e){W(this.#i,e)}}class Wu{static create(e){return _a.set(new Wu(e,va.get()))}opts;root;#e=O(()=>this.opts.orientation.current==="horizontal");get isHorizontal(){return u(this.#e)}set isHorizontal(e){W(this.#e,e)}#t=Fe(!1);get hasThumb(){return u(this.#t)}set hasThumb(e){W(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,fr(()=>this.isHorizontal,i=>i?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}}class Xu{static create(){return new Xu(_a.get())}scrollbar;root;#e=Fe(!1);get isVisible(){return u(this.#e)}set isVisible(e){W(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Pt(()=>{const t=this.root.scrollAreaNode,i=this.root.opts.scrollHideDelay.current;let r=0;if(!t)return;const s=()=>{this.root.domContext.clearTimeout(r),wn(()=>this.isVisible=!0)},a=()=>{r&&this.root.domContext.clearTimeout(r),r=this.root.domContext.setTimeout(()=>{wn(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},i)},o=Iu(dn(t,"pointerenter",s),dn(t,"pointerleave",a));return()=>{this.root.domContext.getWindow().clearTimeout(r),o()}})}#t=O(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return u(this.#t)}set props(e){W(this.#t,e)}}class ju{static create(){return new ju(_a.get())}scrollbar;root;machine=new N0("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});#e=O(()=>this.machine.state.current==="hidden");get isHidden(){return u(this.#e)}set isHidden(e){W(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;const t=nl(()=>this.machine.dispatch("SCROLL_END"),100);Pt(()=>{const i=this.machine.state.current,r=this.root.opts.scrollHideDelay.current;if(i==="idle"){const s=this.root.domContext.setTimeout(()=>this.machine.dispatch("HIDE"),r);return()=>this.root.domContext.clearTimeout(s)}}),Pt(()=>{const i=this.root.viewportNode;if(!i)return;const r=this.scrollbar.isHorizontal?"scrollLeft":"scrollTop";let s=i[r];return dn(i,"scroll",()=>{const l=i[r];s!==l&&(this.machine.dispatch("SCROLL"),t()),s=l})}),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}onpointerenter(e){this.machine.dispatch("POINTER_ENTER")}onpointerleave(e){this.machine.dispatch("POINTER_LEAVE")}#t=O(()=>({"data-state":this.machine.state.current==="hidden"?"hidden":"visible",onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return u(this.#t)}set props(e){W(this.#t,e)}}class sl{static create(){return new sl(_a.get())}scrollbar;root;#e=Fe(!1);get isVisible(){return u(this.#e)}set isVisible(e){W(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;const t=nl(()=>{const i=this.root.viewportNode;if(!i)return;const r=i.offsetWidth<i.scrollWidth,s=i.offsetHeight<i.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?r:s},10);new Rr(()=>this.root.viewportNode,t),new Rr(()=>this.root.contentNode,t)}#t=O(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return u(this.#t)}set props(e){W(this.#t,e)}}class qu{static create(){return rl.set(new qu(_a.get()))}scrollbar;root;#e=Fe(null);get thumbNode(){return u(this.#e)}set thumbNode(e){W(this.#e,e,!0)}#t=Fe(0);get pointerOffset(){return u(this.#t)}set pointerOffset(e){W(this.#t,e,!0)}#n=Fe({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return u(this.#n)}set sizes(e){W(this.#n,e)}#i=O(()=>Vp(this.sizes.viewport,this.sizes.content));get thumbRatio(){return u(this.#i)}set thumbRatio(e){W(this.#i,e)}#r=O(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return u(this.#r)}set hasThumb(e){W(this.#r,e)}#s=Fe("");get prevTransformStyle(){return u(this.#s)}set prevTransformStyle(e){W(this.#s,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Pt(()=>{this.scrollbar.hasThumb=this.hasThumb}),Pt(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return U0({pointerPos:e,pointerOffset:this.pointerOffset,sizes:this.sizes,dir:t})}onThumbPointerUp(){this.pointerOffset=0}onThumbPointerDown(e){this.pointerOffset=e}xOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const e=this.root.viewportNode.scrollLeft,i=`translate3d(${uh({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=i,this.prevTransformStyle=i}xOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=e)}xOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=this.getScrollPosition(e,this.root.opts.dir.current))}yOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const e=this.root.viewportNode.scrollTop,i=`translate3d(0, ${uh({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=i,this.prevTransformStyle=i}yOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=e)}yOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=this.getScrollPosition(e,this.root.opts.dir.current))}}class Yu{static create(e){return Vu.set(new Yu(e,rl.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=Fe();get computedStyle(){return u(this.#e)}set computedStyle(e){W(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=bi(this.scrollbar.opts.ref,i=>this.root.scrollbarXNode=i),Pt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Pt(()=>{this.onResize()})}onThumbPointerDown=e=>{this.scrollbarVis.onThumbPointerDown(e.x)};onDragScroll=e=>{this.scrollbarVis.xOnDragScroll(e.x)};onThumbPointerUp=()=>{this.scrollbarVis.onThumbPointerUp()};onThumbPositionChange=()=>{this.scrollbarVis.xOnThumbPositionChange()};onWheelScroll=(e,t)=>{if(!this.root.viewportNode)return;const i=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(i),Gp(i,t)&&e.preventDefault()};onResize=()=>{this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollWidth,viewport:this.root.viewportNode.offsetWidth,scrollbar:{size:this.scrollbar.opts.ref.current.clientWidth,paddingStart:Bo(this.computedStyle.paddingLeft),paddingEnd:Bo(this.computedStyle.paddingRight)}})};#t=O(()=>al(this.scrollbarVis.sizes));get thumbSize(){return u(this.#t)}set thumbSize(e){W(this.#t,e)}#n=O(()=>({id:this.scrollbar.opts.id.current,"data-orientation":"horizontal",style:{bottom:0,left:this.root.opts.dir.current==="rtl"?"var(--bits-scroll-area-corner-width)":0,right:this.root.opts.dir.current==="ltr"?"var(--bits-scroll-area-corner-width)":0,"--bits-scroll-area-thumb-width":`${this.thumbSize}px`},...this.attachment}));get props(){return u(this.#n)}set props(e){W(this.#n,e)}}class Ku{static create(e){return Vu.set(new Ku(e,rl.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=Fe();get computedStyle(){return u(this.#e)}set computedStyle(e){W(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=bi(this.scrollbar.opts.ref,i=>this.root.scrollbarYNode=i),Pt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Pt(()=>{this.onResize()}),this.onThumbPointerDown=this.onThumbPointerDown.bind(this),this.onDragScroll=this.onDragScroll.bind(this),this.onThumbPointerUp=this.onThumbPointerUp.bind(this),this.onThumbPositionChange=this.onThumbPositionChange.bind(this),this.onWheelScroll=this.onWheelScroll.bind(this),this.onResize=this.onResize.bind(this)}onThumbPointerDown(e){this.scrollbarVis.onThumbPointerDown(e.y)}onDragScroll(e){this.scrollbarVis.yOnDragScroll(e.y)}onThumbPointerUp(){this.scrollbarVis.onThumbPointerUp()}onThumbPositionChange(){this.scrollbarVis.yOnThumbPositionChange()}onWheelScroll(e,t){if(!this.root.viewportNode)return;const i=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(i),Gp(i,t)&&e.preventDefault()}onResize(){this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollHeight,viewport:this.root.viewportNode.offsetHeight,scrollbar:{size:this.scrollbar.opts.ref.current.clientHeight,paddingStart:Bo(this.computedStyle.paddingTop),paddingEnd:Bo(this.computedStyle.paddingBottom)}})}#t=O(()=>al(this.scrollbarVis.sizes));get thumbSize(){return u(this.#t)}set thumbSize(e){W(this.#t,e)}#n=O(()=>({id:this.scrollbar.opts.id.current,"data-orientation":"vertical",style:{top:0,right:this.root.opts.dir.current==="ltr"?0:void 0,left:this.root.opts.dir.current==="rtl"?0:void 0,bottom:"var(--bits-scroll-area-corner-height)","--bits-scroll-area-thumb-height":`${this.thumbSize}px`},...this.attachment}));get props(){return u(this.#n)}set props(e){W(this.#n,e)}}class Zu{static create(){return kp.set(new Zu(Vu.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=Fe(null);get rect(){return u(this.#e)}set rect(e){W(this.#e,e)}#t=Fe("");get prevWebkitUserSelect(){return u(this.#t)}set prevWebkitUserSelect(e){W(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#n=O(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return u(this.#n)}set maxScrollPos(e){W(this.#n,e)}constructor(e){this.scrollbarState=e,this.root=e.root,this.scrollbarVis=e.scrollbarVis,this.scrollbar=e.scrollbarVis.scrollbar,this.handleResize=nl(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,Pt(()=>{const t=this.maxScrollPos,i=this.scrollbar.opts.ref.current;this.root.viewportNode;const r=a=>{const o=a.target;i?.contains(o)&&this.handleWheelScroll(a,t)};return dn(this.root.domContext.getDocument(),"wheel",r,{passive:!1})}),kg(()=>{this.scrollbarVis.sizes,wn(()=>this.handleThumbPositionChange())}),new Rr(()=>this.scrollbar.opts.ref.current,this.handleResize),new Rr(()=>this.root.contentNode,this.handleResize),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onlostpointercapture=this.onlostpointercapture.bind(this)}handleDragScroll(e){if(!this.rect)return;const t=e.clientX-this.rect.left,i=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:i})}#i(){this.rect!==null&&(this.root.domContext.getDocument().body.style.webkitUserSelect=this.prevWebkitUserSelect,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=""),this.rect=null)}onpointerdown(e){if(e.button!==0)return;e.target.setPointerCapture(e.pointerId),this.rect=this.scrollbar.opts.ref.current?.getBoundingClientRect()??null,this.prevWebkitUserSelect=this.root.domContext.getDocument().body.style.webkitUserSelect,this.root.domContext.getDocument().body.style.webkitUserSelect="none",this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior="auto"),this.handleDragScroll(e)}onpointermove(e){this.handleDragScroll(e)}onpointerup(e){const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.#i()}onlostpointercapture(e){this.#i()}#r=O(()=>jt({...this.scrollbarState.props,style:{position:"absolute",...this.scrollbarState.props.style},[ga.scrollbar]:"",onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return u(this.#r)}set props(e){W(this.#r,e)}}class $u{static create(e){return new $u(e,kp.get())}opts;scrollbarState;attachment;#e;#t=Fe();#n=nl(()=>{u(this.#t)&&(u(this.#t)(),W(this.#t,void 0))},100);constructor(e,t){this.opts=e,this.scrollbarState=t,this.#e=t.root,this.attachment=bi(this.opts.ref,i=>this.scrollbarState.scrollbarVis.thumbNode=i),Pt(()=>{const i=this.#e.viewportNode;if(!i)return;const r=()=>{if(this.#n(),!u(this.#t)){const a=F0(i,this.scrollbarState.handleThumbPositionChange);W(this.#t,a,!0),this.scrollbarState.handleThumbPositionChange()}};return wn(()=>this.scrollbarState.handleThumbPositionChange()),dn(i,"scroll",r)}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){const t=e.target;if(!t)return;const i=t.getBoundingClientRect(),r=e.clientX-i.left,s=e.clientY-i.top;this.scrollbarState.handleThumbPointerDown({x:r,y:s})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#i=O(()=>({id:this.opts.id.current,"data-state":this.scrollbarState.scrollbarVis.hasThumb?"visible":"hidden",style:{width:"var(--bits-scroll-area-thumb-width)",height:"var(--bits-scroll-area-thumb-height)",transform:this.scrollbarState.scrollbarVis.prevTransformStyle},onpointerdowncapture:this.onpointerdowncapture,onpointerup:this.onpointerup,[ga.thumb]:"",...this.attachment}));get props(){return u(this.#i)}set props(e){W(this.#i,e)}}class Ju{static create(e){return new Ju(e,va.get())}opts;root;attachment;#e=Fe(0);#t=Fe(0);#n=O(()=>!!(u(this.#e)&&u(this.#t)));get hasSize(){return u(this.#n)}set hasSize(e){W(this.#n,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=bi(this.opts.ref),new Rr(()=>this.root.scrollbarXNode,()=>{const i=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=i,W(this.#t,i,!0)}),new Rr(()=>this.root.scrollbarYNode,()=>{const i=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=i,W(this.#e,i,!0)})}#i=O(()=>({id:this.opts.id.current,style:{width:u(this.#e),height:u(this.#t),position:"absolute",right:this.root.opts.dir.current==="ltr"?0:void 0,left:this.root.opts.dir.current==="rtl"?0:void 0,bottom:0},[ga.corner]:"",...this.attachment}));get props(){return u(this.#i)}set props(e){W(this.#i,e)}}function Bo(n){return n?Number.parseInt(n,10):0}function Vp(n,e){const t=n/e;return Number.isNaN(t)?0:t}function al(n){const e=Vp(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,i=(n.scrollbar.size-t)*e;return Math.max(i,18)}function U0({pointerPos:n,pointerOffset:e,sizes:t,dir:i="ltr"}){const r=al(t),s=r/2,a=e||s,o=r-a,l=t.scrollbar.paddingStart+a,c=t.scrollbar.size-t.scrollbar.paddingEnd-o,d=t.content-t.viewport,f=i==="ltr"?[0,d]:[d*-1,0];return Hp([l,c],f)(n)}function uh({scrollPos:n,sizes:e,dir:t="ltr"}){const i=al(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,a=e.content-e.viewport,o=s-i,l=t==="ltr"?[0,a]:[a*-1,0],c=I0(n,l[0],l[1]);return Hp([0,a],[0,o])(c)}function Hp(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(n[1]-n[0]);return e[0]+i*(t-n[0])}}function Gp(n,e){return n>0&&n<e}function F0(n,e){let t={left:n.scrollLeft,top:n.scrollTop},i=0;const r=dv(n);return(function s(){const a={left:n.scrollLeft,top:n.scrollTop},o=t.left!==a.left,l=t.top!==a.top;(o||l)&&e(),t=a,i=r.requestAnimationFrame(s)})(),()=>r.cancelAnimationFrame(i)}var O0=K("<div><!></div>");function z0(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=oe(e,"type",3,"hover"),a=oe(e,"dir",3,"ltr"),o=oe(e,"scrollHideDelay",3,600),l=ut(e,["$$slots","$$events","$$legacy","ref","id","type","dir","scrollHideDelay","children","child"]);const c=Hu.create({type:Qe(()=>s()),dir:Qe(()=>a()),scrollHideDelay:Qe(()=>o()),id:Qe(()=>r()),ref:Qe(()=>i(),x=>i(x))}),d=O(()=>jt(l,c.props));var f=we(),h=ee(f);{var p=x=>{var g=we(),v=ee(g);pt(v,()=>e.child,()=>({props:u(d)})),P(x,g)},m=x=>{var g=O0();Ft(g,()=>({...u(d)}));var v=$(g);pt(v,()=>e.children??wt),j(g),P(x,g)};xe(h,x=>{e.child?x(p):x(m,-1)})}P(n,f),at()}var B0=K("<div><div><!></div></div>");function k0(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=ut(e,["$$slots","$$events","$$legacy","ref","id","children"]);const a=Gu.create({id:Qe(()=>r()),ref:Qe(()=>i(),h=>i(h))}),o=O(()=>jt(s,a.props)),l=O(()=>jt({},a.contentProps));var c=B0();Ft(c,()=>({...u(o)}));var d=$(c);Ft(d,()=>({...u(l)}));var f=$(d);pt(f,()=>e.children??wt),j(d),j(c),P(n,c),at()}var V0=K("<div><!></div>");function Wp(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy","child","children"]);const i=Zu.create(),r=O(()=>jt(t,i.props));var s=we(),a=ee(s);{var o=c=>{var d=we(),f=ee(d);pt(f,()=>e.child,()=>({props:u(r)})),P(c,d)},l=c=>{var d=V0();Ft(d,()=>({...u(r)}));var f=$(d);pt(f,()=>e.children??wt),j(d),P(c,d)};xe(a,c=>{e.child?c(o):c(l,-1)})}P(n,s),at()}function H0(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy"]);const i=new zu,r=Yu.create({mounted:Qe(()=>i.current)}),s=O(()=>jt(t,r.props));Wp(n,mt(()=>u(s))),at()}function G0(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy"]);const i=new zu,r=Ku.create({mounted:Qe(()=>i.current)}),s=O(()=>jt(t,r.props));Wp(n,mt(()=>u(s))),at()}function ol(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy"]);const i=qu.create();var r=we(),s=ee(r);{var a=l=>{H0(l,mt(()=>t))},o=l=>{G0(l,mt(()=>t))};xe(s,l=>{i.scrollbar.opts.orientation.current==="horizontal"?l(a):l(o,-1)})}P(n,r),at()}function W0(n,e){st(e,!0);let t=oe(e,"forceMount",3,!1),i=ut(e,["$$slots","$$events","$$legacy","forceMount"]);const r=sl.create(),s=O(()=>jt(i,r.props));{const a=l=>{ol(l,mt(()=>u(s)))};let o=O(()=>t()||r.isVisible);il(n,{get open(){return u(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}})}at()}function X0(n,e){st(e,!0);let t=oe(e,"forceMount",3,!1),i=ut(e,["$$slots","$$events","$$legacy","forceMount"]);const r=ju.create(),s=O(()=>jt(i,r.props));{const a=l=>{ol(l,mt(()=>u(s)))};let o=O(()=>t()||!r.isHidden);il(n,mt(()=>u(s),{get open(){return u(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}}))}at()}function j0(n,e){st(e,!0);let t=oe(e,"forceMount",3,!1),i=ut(e,["$$slots","$$events","$$legacy","forceMount"]);const r=Xu.create(),s=sl.create(),a=O(()=>jt(i,r.props,s.props,{"data-state":r.isVisible?"visible":"hidden"})),o=O(()=>t()||r.isVisible&&s.isVisible);il(n,{get open(){return u(o)},get ref(){return s.scrollbar.opts.ref},presence:c=>{ol(c,mt(()=>u(a)))},$$slots:{presence:!0}}),at()}function q0(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=ut(e,["$$slots","$$events","$$legacy","ref","id","orientation"]);const a=Wu.create({orientation:Qe(()=>e.orientation),id:Qe(()=>r()),ref:Qe(()=>i(),m=>i(m))}),o=O(()=>a.root.opts.type.current);var l=we(),c=ee(l);{var d=m=>{j0(m,mt(()=>s,{get id(){return r()}}))},f=m=>{X0(m,mt(()=>s,{get id(){return r()}}))},h=m=>{W0(m,mt(()=>s,{get id(){return r()}}))},p=m=>{ol(m,mt(()=>s,{get id(){return r()}}))};xe(c,m=>{u(o)==="hover"?m(d):u(o)==="scroll"?m(f,1):u(o)==="auto"?m(h,2):u(o)==="always"&&m(p,3)})}P(n,l),at()}var Y0=K("<div><!></div>");function K0(n,e){st(e,!0);let t=oe(e,"ref",15,null),i=ut(e,["$$slots","$$events","$$legacy","ref","id","child","children","present"]);const r=new zu,s=$u.create({id:Qe(()=>e.id),ref:Qe(()=>t(),f=>t(f)),mounted:Qe(()=>r.current)}),a=O(()=>jt(i,s.props,{style:{hidden:!e.present}}));var o=we(),l=ee(o);{var c=f=>{var h=we(),p=ee(h);pt(p,()=>e.child,()=>({props:u(a)})),P(f,h)},d=f=>{var h=Y0();Ft(h,()=>({...u(a)}));var p=$(h);pt(p,()=>e.children??wt),j(h),P(f,h)};xe(l,f=>{e.child?f(c):f(d,-1)})}P(n,o),at()}function Z0(n,e){const t=Tn();st(e,!0);let i=oe(e,"id",19,()=>Vn(t)),r=oe(e,"ref",15,null),s=oe(e,"forceMount",3,!1),a=ut(e,["$$slots","$$events","$$legacy","id","ref","forceMount"]);const o=rl.get();{const l=(d,f)=>{let h=()=>(f?.()).present;K0(d,mt(()=>a,{get id(){return i()},get present(){return h()},get ref(){return r()},set ref(p){r(p)}}))};let c=O(()=>s()||o.hasThumb);il(n,{get open(){return u(c)},get ref(){return o.scrollbar.opts.ref},presence:l,$$slots:{presence:!0}})}at()}var $0=K("<div><!></div>");function J0(n,e){st(e,!0);let t=oe(e,"ref",15,null),i=ut(e,["$$slots","$$events","$$legacy","ref","id","children","child"]);const r=Ju.create({id:Qe(()=>e.id),ref:Qe(()=>t(),d=>t(d))}),s=O(()=>jt(i,r.props));var a=we(),o=ee(a);{var l=d=>{var f=we(),h=ee(f);pt(h,()=>e.child,()=>({props:u(s)})),P(d,f)},c=d=>{var f=$0();Ft(f,()=>({...u(s)}));var h=$(f);pt(h,()=>e.children??wt),j(f),P(d,f)};xe(o,d=>{e.child?d(l):d(c,-1)})}P(n,a),at()}function Q0(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=ut(e,["$$slots","$$events","$$legacy","ref","id"]);const a=va.get(),o=O(()=>!!(a.scrollbarXNode&&a.scrollbarYNode)),l=O(()=>a.opts.type.current!=="scroll"&&u(o));var c=we(),d=ee(c);{var f=h=>{J0(h,mt(()=>s,{get id(){return r()},get ref(){return i()},set ref(p){i(p)}}))};xe(d,h=>{u(l)&&h(f)})}P(n,c),at()}function dh(n,e,t){const i={position:"absolute"};return n==="lr"?(i.left=`${e}%`,i.right=`${t}%`):n==="rl"?(i.right=`${e}%`,i.left=`${t}%`):n==="bt"?(i.bottom=`${e}%`,i.top=`${t}%`):(i.top=`${e}%`,i.bottom=`${t}%`),i}function Xp(n,e){const t={position:"absolute"};return n==="lr"?(t.left=`${e}%`,t.translate="-50% 0"):n==="rl"?(t.right=`${e}%`,t.translate="50% 0"):n==="bt"?(t.bottom=`${e}%`,t.translate="0 50%"):(t.top=`${e}%`,t.translate="0 -50%"),t}function jp(n,e,t){const i={position:"absolute"};return n==="lr"?(i.left=`${e}%`,i.translate=`${t}% 0`):n==="rl"?(i.right=`${e}%`,i.translate=`${-t}% 0`):n==="bt"?(i.bottom=`${e}%`,i.translate=`0 ${-t}%`):(i.top=`${e}%`,i.translate=`0 ${t}%`),i}function e_(n){if(Math.floor(n)===n)return 0;const e=n.toString();if(e.indexOf(".")!==-1&&e.indexOf("e-")===-1)return e.split(".")[1].length;if(e.indexOf("e-")!==-1){const t=e.split("e-");return parseInt(t[1],10)}return 0}function t_(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function Qu(n,e,t){if(typeof n=="number"){const i=t-e;let r=Math.ceil(i/n);const s=e_(n),a=Math.pow(10,s),o=Math.round(i*a),l=Math.round(n*a);o%l===0&&r++;const c=[];for(let d=0;d<r;d++){const f=e+d*n,h=t_(f,s);c.push(h)}return c}return[...new Set(n)].filter(i=>i>=e&&i<=t).sort((i,r)=>i-r)}function Tr(n,e){if(e.length===0)return n;let t=e[0],i=Math.abs(n-t);for(const r of e){const s=Math.abs(n-r);s<i&&(i=s,t=r)}return t}function Aa(n,e,t){const i=e.indexOf(n);return i===-1?Tr(n,e):t==="next"?i<e.length-1?e[i+1]:n:i>0?e[i-1]:n}function n_(n,e,t=!0){const[i,r]=n,[s,a]=e,o=(a-s)/(r-i);return l=>{const c=s+o*(l-i);return t?c>Math.max(s,a)?Math.max(s,a):c<Math.min(s,a)?Math.min(s,a):c:c}}const hr=Lu({component:"slider",parts:["root","thumb","range","tick","tick-label","thumb-label"]}),ed=new pr("Slider.Root");class qp{opts;attachment;#e=Fe(!1);get isActive(){return u(this.#e)}set isActive(e){W(this.#e,e,!0)}#t=Fe(0);#n=O(()=>this.opts.orientation.current==="horizontal"?this.opts.dir.current==="rtl"?"rl":"lr":this.opts.dir.current==="rtl"?"tb":"bt");get direction(){return u(this.#n)}set direction(e){W(this.#n,e)}#i=O(()=>Qu(this.opts.step.current,this.opts.min.current,this.opts.max.current));get normalizedSteps(){return u(this.#i)}set normalizedSteps(e){W(this.#i,e)}domContext;constructor(e){this.opts=e,this.attachment=bi(e.ref),this.domContext=new xp(this.opts.ref),new Rr(()=>this.opts.ref.current,this.#r)}#r=()=>{W(this.#t,u(this.#t)+1)};isThumbActive(e){return this.isActive}#s=O(()=>{if(!this.opts.disabled.current)return this.opts.orientation.current==="horizontal"?"pan-y":"pan-x"});getAllThumbs=()=>{const e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(hr.selector("thumb"))):[]};getThumbScale=()=>{u(this.#t);const e=this.opts.trackPadding?.current;if(e!==void 0&&e>0)return[e,100-e];if(this.opts.thumbPositioning.current==="exact")return[0,100];const t=this.opts.orientation.current==="vertical",i=this.getAllThumbs()[0],r=t?i?.offsetHeight:i?.offsetWidth;if(r===void 0||Number.isNaN(r)||r===0)return[0,100];const s=t?this.opts.ref.current?.offsetHeight:this.opts.ref.current?.offsetWidth;if(s===void 0||Number.isNaN(s)||s===0)return[0,100];const a=r/2/s*100,o=a,l=100-a;return[o,l]};getPositionFromValue=e=>{const t=this.getThumbScale();return n_([this.opts.min.current,this.opts.max.current],t)(e)};#a=O(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,"data-disabled":Pr(this.opts.disabled.current),style:{touchAction:u(this.#s)},[hr.root]:"",...this.attachment}));get props(){return u(this.#a)}set props(e){W(this.#a,e)}}class i_ extends qp{opts;isMulti=!1;constructor(e){super(e),this.opts=e,Up(()=>Iu(dn(this.domContext.getDocument(),"pointerdown",this.handlePointerDown),dn(this.domContext.getDocument(),"pointerup",this.handlePointerUp),dn(this.domContext.getDocument(),"pointermove",this.handlePointerMove),dn(this.domContext.getDocument(),"pointerleave",this.handlePointerUp))),fr([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=Qu(t,i,r),o=c=>a.includes(c),l=c=>Tr(c,a);o(s)||(this.opts.value.current=l(s))})}isTickValueSelected=e=>this.opts.value.current===e;applyPosition({clientXY:e,start:t,end:i}){const r=this.opts.min.current,s=this.opts.max.current,o=(e-t)/(i-t)*(s-r)+r;if(o<r)this.updateValue(r);else if(o>s)this.updateValue(s);else{const l=this.normalizedSteps,c=Tr(o,l);this.updateValue(c)}}updateValue=e=>{this.opts.value.current=Tr(e,this.normalizedSteps)};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();const t=this.opts.ref.current,i=this.getAllThumbs()[0];if(!t||!i)return;i.focus();const{left:r,right:s,top:a,bottom:o}=t.getBoundingClientRect();this.direction==="lr"?this.applyPosition({clientXY:e.clientX,start:r,end:s}):this.direction==="rl"?this.applyPosition({clientXY:e.clientX,start:s,end:r}):this.direction==="bt"?this.applyPosition({clientXY:e.clientY,start:o,end:a}):this.direction==="tb"&&this.applyPosition({clientXY:e.clientY,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;const t=this.opts.ref.current,i=this.getAllThumbs()[0];if(!i||!t)return;const r=e.composedPath()[0]??e.target;!Rp(r)||!t.contains(r)||(e.preventDefault(),i.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(wn(()=>this.opts.value.current)),this.isActive=!1)};#e=O(()=>{const e=this.opts.value.current;return Array.from({length:1},()=>{const t=e,i=this.getPositionFromValue(t),r=Xp(this.direction,i);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":t,"aria-disabled":Oo(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":t,"data-orientation":this.opts.orientation.current,style:r,[hr.thumb]:""}})});get thumbsPropsArr(){return u(this.#e)}set thumbsPropsArr(e){W(this.#e,e)}#t=O(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return u(this.#t)}set thumbsRenderArr(e){W(this.#t,e)}#n=O(()=>{const e=this.normalizedSteps,t=this.opts.value.current;return e.map((i,r)=>{const s=this.getPositionFromValue(i),a=r===0,o=r===e.length-1,l=a?0:o?-100:-50,c=jp(this.direction,s,l),d=i<=t;return{"data-disabled":Pr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":d?"":void 0,"data-value":i,"data-selected":this.isTickValueSelected(i)?"":void 0,style:c,[hr.tick]:""}})});get ticksPropsArr(){return u(this.#n)}set ticksPropsArr(e){W(this.#n,e)}#i=O(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return u(this.#i)}set ticksRenderArr(e){W(this.#i,e)}#r=O(()=>this.ticksPropsArr.map((e,t)=>({value:e["data-value"],index:t})));get tickItemsArr(){return u(this.#r)}set tickItemsArr(e){W(this.#r,e)}#s=O(()=>[{value:this.opts.value.current,index:0}]);get thumbItemsArr(){return u(this.#s)}set thumbItemsArr(e){W(this.#s,e)}#a=O(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return u(this.#a)}set snippetProps(e){W(this.#a,e)}}class r_ extends qp{opts;isMulti=!0;#e=Fe(null);get activeThumb(){return u(this.#e)}set activeThumb(e){W(this.#e,e,!0)}#t=Fe(0);get currentThumbIdx(){return u(this.#t)}set currentThumbIdx(e){W(this.#t,e,!0)}constructor(e){super(e),this.opts=e,Up(()=>Iu(dn(this.domContext.getDocument(),"pointerdown",this.handlePointerDown),dn(this.domContext.getDocument(),"pointerup",this.handlePointerUp),dn(this.domContext.getDocument(),"pointermove",this.handlePointerMove),dn(this.domContext.getDocument(),"pointerleave",this.handlePointerUp))),fr([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=Qu(t,i,r),o=c=>a.includes(c),l=c=>Tr(c,a);s.some(c=>!o(c))&&(this.opts.value.current=s.map(l))})}isTickValueSelected=e=>this.opts.value.current.includes(e);isThumbActive(e){return this.isActive&&this.activeThumb?.idx===e}applyPosition({clientXY:e,activeThumbIdx:t,start:i,end:r}){const s=this.opts.min.current,a=this.opts.max.current,l=(e-i)/(r-i)*(a-s)+s;if(l<s)this.updateValue(s,t);else if(l>a)this.updateValue(a,t);else{const c=this.normalizedSteps,d=Tr(l,c);this.updateValue(d,t)}}#n=e=>{const t=this.getAllThumbs();if(!t.length)return;for(const a of t)a.blur();const i=t.map(a=>{if(this.opts.orientation.current==="horizontal"){const{left:o,right:l}=a.getBoundingClientRect();return Math.abs(e.clientX-(o+l)/2)}else{const{top:o,bottom:l}=a.getBoundingClientRect();return Math.abs(e.clientY-(o+l)/2)}}),r=t[i.indexOf(Math.min(...i))],s=t.indexOf(r);return{node:r,idx:s}};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();const t=this.opts.ref.current,i=this.activeThumb;if(!t||!i)return;i.node.focus();const{left:r,right:s,top:a,bottom:o}=t.getBoundingClientRect(),l=this.direction;l==="lr"?this.applyPosition({clientXY:e.clientX,activeThumbIdx:i.idx,start:r,end:s}):l==="rl"?this.applyPosition({clientXY:e.clientX,activeThumbIdx:i.idx,start:s,end:r}):l==="bt"?this.applyPosition({clientXY:e.clientY,activeThumbIdx:i.idx,start:o,end:a}):l==="tb"&&this.applyPosition({clientXY:e.clientY,activeThumbIdx:i.idx,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;const t=this.opts.ref.current,i=this.#n(e);if(!i||!t)return;const r=e.composedPath()[0]??e.target;!Rp(r)||!t.contains(r)||(e.preventDefault(),this.activeThumb=i,i.node.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(wn(()=>this.opts.value.current)),this.isActive=!1)};getAllThumbs=()=>{const e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(hr.selector("thumb"))):[]};updateValue=(e,t)=>{const i=this.opts.value.current;if(!i.length){this.opts.value.current.push(e);return}if(i[t]===e)return;const s=[...i];if(!hv(t,s))return;const a=s[t]>e?-1:1,o=()=>{const c=t+a;s[t]=s[c],s[c]=e;const d=this.getAllThumbs();d.length&&(d[c]?.focus(),this.activeThumb={node:d[c],idx:c})};if(this.opts.autoSort.current&&(a===-1&&e<s[t-1]||a===1&&e>s[t+1])){o(),this.opts.value.current=s;return}const l=this.normalizedSteps;s[t]=Tr(e,l),this.opts.value.current=s};#i=O(()=>{const e=this.opts.value.current;return Array.from({length:e.length||1},(t,i)=>{const r=wn(()=>this.currentThumbIdx);r<e.length&&wn(()=>{this.currentThumbIdx=r+1});const s=e[i],a=this.getPositionFromValue(s??0),o=Xp(this.direction,a);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":s,"aria-disabled":Oo(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":s,"data-orientation":this.opts.orientation.current,style:o,[hr.thumb]:""}})});get thumbsPropsArr(){return u(this.#i)}set thumbsPropsArr(e){W(this.#i,e)}#r=O(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return u(this.#r)}set thumbsRenderArr(e){W(this.#r,e)}#s=O(()=>{const e=this.normalizedSteps,t=this.opts.value.current;return e.map((i,r)=>{const s=this.getPositionFromValue(i),a=r===0,o=r===e.length-1,l=a?0:o?-100:-50,c=jp(this.direction,s,l),d=t.length===1?i<=t[0]:t[0]<=i&&i<=t[t.length-1];return{"data-disabled":Pr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":d?"":void 0,"data-value":i,style:c,[hr.tick]:""}})});get ticksPropsArr(){return u(this.#s)}set ticksPropsArr(e){W(this.#s,e)}#a=O(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return u(this.#a)}set ticksRenderArr(e){W(this.#a,e)}#o=O(()=>this.ticksPropsArr.map((e,t)=>({value:e["data-value"],index:t})));get tickItemsArr(){return u(this.#o)}set tickItemsArr(e){W(this.#o,e)}#l=O(()=>this.opts.value.current.map((t,i)=>({value:t,index:i})));get thumbItemsArr(){return u(this.#l)}set thumbItemsArr(e){W(this.#l,e)}#c=O(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return u(this.#c)}set snippetProps(e){W(this.#c,e)}}class s_{static create(e){const{type:t,...i}=e,r=t==="single"?new i_(i):new r_(i);return ed.set(r)}}const a_=[wp,Ep,Tp,Ap,Cp,Pp];class td{static create(e){return new td(e,ed.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=bi(e.ref)}#e=O(()=>{if(Array.isArray(this.root.opts.value.current)){const e=this.root.opts.value.current.length>1?this.root.getPositionFromValue(Math.min(...this.root.opts.value.current)??0):0,t=100-this.root.getPositionFromValue(Math.max(...this.root.opts.value.current)??0);return{position:"absolute",...dh(this.root.direction,e,t)}}else{const e=this.root.opts.trackPadding?.current,t=this.root.opts.value.current,i=this.root.opts.max.current,r=0,s=e!==void 0&&e>0&&t===i?0:100-this.root.getPositionFromValue(t);return{position:"absolute",...dh(this.root.direction,r,s)}}});get rangeStyles(){return u(this.#e)}set rangeStyles(e){W(this.#e,e)}#t=O(()=>({id:this.opts.id.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":Pr(this.root.opts.disabled.current),style:this.rangeStyles,[hr.range]:"",...this.attachment}));get props(){return u(this.#t)}set props(e){W(this.#t,e)}}class nd{static create(e){return new nd(e,ed.get())}opts;root;attachment;#e=O(()=>this.root.opts.disabled.current||this.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=bi(e.ref),this.onkeydown=this.onkeydown.bind(this)}#t(e){this.root.isMulti?this.root.updateValue(e,this.opts.index.current):this.root.updateValue(e)}onkeydown(e){if(u(this.#e))return;const t=this.opts.ref.current;if(!t)return;const i=this.root.getAllThumbs();if(!i.length)return;const r=i.indexOf(t);if(this.root.isMulti&&(this.root.currentThumbIdx=r),!a_.includes(e.key))return;e.preventDefault();const s=this.root.opts.min.current,a=this.root.opts.max.current,o=this.root.opts.value.current,l=Array.isArray(o)?o[r]:o,c=this.root.opts.orientation.current,d=this.root.direction,f=this.root.normalizedSteps;switch(e.key){case Cp:this.#t(s);break;case Pp:this.#t(a);break;case wp:if(c!=="horizontal")break;if(e.metaKey){const h=d==="rl"?a:s;this.#t(h)}else{const p=Aa(l,f,d==="rl"?"next":"prev");this.#t(p)}break;case Ep:if(c!=="horizontal")break;if(e.metaKey){const h=d==="rl"?s:a;this.#t(h)}else{const p=Aa(l,f,d==="rl"?"prev":"next");this.#t(p)}break;case Tp:if(e.metaKey){const h=d==="tb"?s:a;this.#t(h)}else{const p=Aa(l,f,d==="tb"?"prev":"next");this.#t(p)}break;case Ap:if(e.metaKey){const h=d==="tb"?a:s;this.#t(h)}else{const p=Aa(l,f,d==="tb"?"next":"prev");this.#t(p)}break}this.root.opts.onValueCommit.current(this.root.opts.value.current)}#n=O(()=>({...this.root.thumbsPropsArr[this.opts.index.current],id:this.opts.id.current,onkeydown:this.onkeydown,"data-active":this.root.isThumbActive(this.opts.index.current)?"":void 0,"data-disabled":Pr(this.opts.disabled.current||this.root.opts.disabled.current),tabindex:this.opts.disabled.current||this.root.opts.disabled.current?-1:0,...this.attachment}));get props(){return u(this.#n)}set props(e){W(this.#n,e)}}var o_=K("<span><!></span>");function l_(n,e){const t=Tn();st(e,!0);let i=oe(e,"id",19,()=>Vn(t)),r=oe(e,"ref",15,null),s=oe(e,"value",15),a=oe(e,"onValueChange",3,Un),o=oe(e,"onValueCommit",3,Un),l=oe(e,"disabled",3,!1),c=oe(e,"step",3,1),d=oe(e,"dir",3,"ltr"),f=oe(e,"autoSort",3,!0),h=oe(e,"orientation",3,"horizontal"),p=oe(e,"thumbPositioning",3,"contain"),m=ut(e,["$$slots","$$events","$$legacy","children","child","id","ref","value","type","onValueChange","onValueCommit","disabled","min","max","step","dir","autoSort","orientation","thumbPositioning","trackPadding"]);const x=O(()=>e.min!==void 0?e.min:Array.isArray(c())?Math.min(...c()):0),g=O(()=>e.max!==void 0?e.max:Array.isArray(c())?Math.max(...c()):100);function v(){if(s()===void 0)return e.type==="single"?u(x):[]}v(),fr.pre(()=>s(),()=>{v()});const y=s_.create({id:Qe(()=>i()),ref:Qe(()=>r(),_=>r(_)),value:Qe(()=>s(),_=>{s(_),a()(_)}),onValueCommit:Qe(()=>o()),disabled:Qe(()=>l()),min:Qe(()=>u(x)),max:Qe(()=>u(g)),step:Qe(()=>c()),dir:Qe(()=>d()),autoSort:Qe(()=>f()),orientation:Qe(()=>h()),thumbPositioning:Qe(()=>p()),type:e.type,trackPadding:Qe(()=>e.trackPadding)}),w=O(()=>jt(m,y.props));var b=we(),E=ee(b);{var S=_=>{var T=we(),D=ee(T);{let L=O(()=>({props:u(w),...y.snippetProps}));pt(D,()=>e.child,()=>u(L))}P(_,T)},A=_=>{var T=o_();Ft(T,()=>({...u(w)}));var D=$(T);pt(D,()=>e.children??wt,()=>y.snippetProps),j(T),P(_,T)};xe(E,_=>{e.child?_(S):_(A,-1)})}P(n,b),at()}var c_=K("<span><!></span>");function u_(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=ut(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const a=td.create({id:Qe(()=>r()),ref:Qe(()=>i(),h=>i(h))}),o=O(()=>jt(s,a.props));var l=we(),c=ee(l);{var d=h=>{var p=we(),m=ee(p);pt(m,()=>e.child,()=>({props:u(o)})),P(h,p)},f=h=>{var p=c_();Ft(p,()=>({...u(o)}));var m=$(p);pt(m,()=>e.children??wt),j(p),P(h,p)};xe(c,h=>{e.child?h(d):h(f,-1)})}P(n,l),at()}var d_=K("<span><!></span>");function h_(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=oe(e,"disabled",3,!1),a=ut(e,["$$slots","$$events","$$legacy","children","child","ref","id","index","disabled"]);const o=nd.create({id:Qe(()=>r()),ref:Qe(()=>i(),p=>i(p)),index:Qe(()=>e.index),disabled:Qe(()=>s())}),l=O(()=>jt(a,o.props));var c=we(),d=ee(c);{var f=p=>{var m=we(),x=ee(m);{let g=O(()=>({active:o.root.isThumbActive(o.opts.index.current),props:u(l)}));pt(x,()=>e.child,()=>u(g))}P(p,m)},h=p=>{var m=d_();Ft(m,()=>({...u(l)}));var x=$(m);{let g=O(()=>({active:o.root.isThumbActive(o.opts.index.current)}));pt(x,()=>e.children??wt,()=>u(g))}j(m),P(p,m)};xe(d,p=>{e.child?p(f):p(h,-1)})}P(n,c),at()}var Mo=new Map;function Yp(n,e){Mo.set(n,e)}Yp("Rhino.Geometry.Point3d",(n,e)=>{let t=e;return!t||typeof t.X!="number"?null:new n.Point([t.X,t.Y,t.Z])});Yp("Rhino.Geometry.Line",(n,e)=>{let t=e;return!t||!t.From||!t.To?null:new n.Line([t.From.X,t.From.Y,t.From.Z],[t.To.X,t.To.Y,t.To.Z])});function f_(n){if(Mo.has(n))return Mo.get(n);for(let[e,t]of Mo)if(n.startsWith(e))return t}function p_(n){return!n||typeof n!="object"?null:n.data??n.value??null}function m_(n,e,t){let i=f_(e);if(i)try{return i(t,n)}catch(r){Nt().warn(`Failed to decode Rhino type ${e}:`,r)}try{let r=p_(n);if(r)return t.CommonObject.decode(r)}catch(r){return Nt().warn(`Failed to decode ${e} with CommonObject:`,r),{__decodeError:!0,type:e,raw:n}}return n}var ds={STRING:"System.String",INT:"System.Int32",DOUBLE:"System.Double",BOOL:"System.Boolean"},g_="Rhino.Geometry.",v_=["WebDisplay"],__="FileData";function Kp(n){return v_.some(e=>n.includes(e))}function Zp(n){if(typeof n!="string")return n;let e=n.trim();if(!(e.startsWith("{")||e.startsWith("[")||e.startsWith('"')))return n;try{let t=JSON.parse(e);if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}catch{return n}}function x_(n,e,t){switch(e){case ds.STRING:return typeof n!="string"?n:n.replace(/^"(.*)"$/,"$1");case ds.INT:return Number.parseInt(n,10);case ds.DOUBLE:return Number.parseFloat(n);case ds.BOOL:return String(n).toLowerCase()==="true";default:return t&&e.startsWith(g_)?m_(n,e,t):n}}function $p(n,e,t,i){if(typeof n!="string")return n;let r=t?Zp(n):n;return x_(r,e,i)}function b_(n){if(!n||typeof n!="object")return!1;let e=n;return typeof e.fileName=="string"&&typeof e.fileType=="string"&&"data"in e&&typeof e.isBase64Encoded=="boolean"&&typeof e.subFolder=="string"}function ko(n,e){for(let t of Object.values(n))if(Array.isArray(t))for(let i of t)e(i)}function y_(n,e=!1,t={}){let{parseValues:i=!0,rhino:r,stringOnly:s=!1}=t,a={},o=new Set;for(let l of n.values)ko(l.InnerTree,c=>{if(Kp(c.type)||s&&c.type!==ds.STRING)return;let d=e?c.id:l.ParamName;if(!d)return;let f=$p(c.data,c.type,i,r);d in a?o.has(d)?a[d].push(f):(a[d]=[a[d],f],o.add(d)):a[d]=f});return{values:a}}function S_(n){let e=[];for(let t of n.values)ko(t.InnerTree,i=>{if(!i.type.includes(__))return;let r=Zp(i.data);b_(r)&&e.push(r)});return e}function M_(n,e,t={}){let{parseValues:i=!0,rhino:r,stringOnly:s=!1}=t,a;if("byName"in e?a=n.values.find(l=>l.ParamName===e.byName):a=n.values.find(l=>{let c=!1;return ko(l.InnerTree,d=>{d.id===e.byId&&(c=!0)}),c}),!a)return;let o=[];if(ko(a.InnerTree,l=>{if("byId"in e&&l.id!==e.byId||Kp(l.type)||s&&l.type!==ds.STRING)return;let c=$p(l.data,l.type,i,r);o.push(c)}),o.length!==0)return o.length===1?o[0]:o}var w_=class{constructor(n,e=!1){this.response=n,this.debug=e}getValues(n=!1,e={}){return y_(this.response,n,e)}getValue(n,e){return M_(this.response,n,e)}async extractMeshesFromResponse(n){let e={debug:this.debug,...n},t;try{({getThreeMeshesFromComputeResponse:t}=await gp(()=>Promise.resolve().then(()=>UD),void 0,import.meta.url))}catch(i){throw new ma("Failed to load three.js visualization module. Ensure three.js is installed as a peer dependency.",Pu.INVALID_STATE,{context:{originalError:i instanceof Error?i.message:String(i)}})}return t(this.response,e)}getFileData(){return S_(this.response)}async getAndDownloadFiles(n,e){let t=this.getFileData();await jg(t,n,e)}},E_=/^\{(\d+(?:;\d+)*)?\}$/;function T_(n){if(typeof n!="object"||n===null||Array.isArray(n))return!1;let e=Object.entries(n);return e.length>0&&e.every(([t,i])=>E_.test(t)&&Array.isArray(i))}function Rs(n,e,t){if(n==null)return n;if(Array.isArray(n)){let r=n.map(e).filter(s=>s!==null);return r.length>0?r:void 0}let i=e(n);return i!==null?i:t?void 0:n}var A_=n=>{if(typeof n=="number")return n;if(typeof n=="string"){let e=n.trim();if(e==="")return null;let t=Number(e);return Number.isNaN(t)?null:t}return null},C_=n=>{if(typeof n=="boolean")return n;if(typeof n=="string"){let e=n.toLowerCase();if(e==="true")return!0;if(e==="false")return!1;throw new Error(`Invalid boolean string: "${n}"`)}return null},P_=n=>typeof n=="string"?n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n.startsWith('"')?n.slice(1):n:null,R_=n=>{if(typeof n=="string"){let e=n.trim();return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).trim()),e}return null};function Jp(n){return e=>{if(typeof e=="object"&&e!==null)return e;if(typeof e=="string"&&e.trim()!=="")try{let t=JSON.parse(e);return typeof t=="object"&&t!==null?t:(Nt().warn(`Parsed value for input ${n} is not an object`),null)}catch(t){return Nt().warn(`Failed to parse object value "${e}" for input ${n}`,t),null}return null}}function hh(n,e,t){let i=Number(n.toFixed(e));return Math.abs(n-i)<t?i:n}function D_(n,e){if(!Number.isFinite(n)||n===0)return .1;let t=Math.abs(n);if(t>=1){let d=String(n).split(".")[1];if(d&&d.length>0){let f=Math.min(d.length,12),h=Math.pow(10,-f),p=Number(h.toFixed(f));return Math.abs(p-h)<e?p:h}return 1}let i=String(n),r=i.toLowerCase().match(/e(-?\d+)/);if(r){let d=Number(r[1]);if(d<0||i.toLowerCase().includes("e-")){let f=Math.abs(d),h=Math.pow(10,-f),p=Number(h.toFixed(f));return Math.abs(p-h)<e?p:h}return .1}let s=12,a=t.toFixed(s).replace(/0+$/,""),o=Math.min((a.split(".")[1]||"").length,s);if(o===0)return .1;let l=Math.pow(10,-o),c=Number(l.toFixed(o));return Math.abs(c-l)<e?c:l}function L_(n,e=1e-8){let t=n.paramType==="Integer";if(T_(n.default))return{default:n.default,stepSize:t?1:.1};let i=Rs(n.default,A_,!0);if(t)return Array.isArray(i)?i=i.map(d=>typeof d=="number"?Math.round(d):d):typeof i=="number"&&(i=Math.round(i)),{default:i,stepSize:1};let r=Array.isArray(i)?i[0]:i,s;typeof r=="number"&&Number.isFinite(r)&&r!==0?s=r:typeof n.minimum=="number"&&Number.isFinite(n.minimum)&&n.minimum!==0?s=n.minimum:typeof n.maximum=="number"&&Number.isFinite(n.maximum)&&n.maximum!==0&&(s=n.maximum);let a=s!==void 0?D_(s,e):.1,o=0,l=String(a),c=l.toLowerCase().match(/e(-?\d+)/);if(c?o=Math.abs(Number(c[1])):o=l.split(".")[1]?.length??0,o===0&&typeof r=="number"&&r!==0&&Math.abs(r)<1){let d=Math.ceil(-Math.log10(Math.abs(r)));Number.isFinite(d)&&d>0&&(o=d)}return o=Math.min(Math.max(o,0),12),Array.isArray(i)?i=i.map(d=>typeof d=="number"?hh(d,o,e):d):typeof i=="number"&&(i=hh(i,o,e)),{default:i,stepSize:a}}var I_={types:["Number","Integer"],parse(n,e){let{default:t,stepSize:i}=L_(n);return{...e,paramType:n.paramType,minimum:n.minimum,maximum:n.maximum,atLeast:n.atLeast,atMost:n.atMost,stepSize:i,default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:n.paramType,minimum:n.minimum,maximum:n.maximum,atLeast:n.atLeast,atMost:n.atMost,default:t?[0]:0}}},N_={types:["Boolean"],parse(n,e){let t;try{t=Rs(n.default,C_,!1)}catch(i){throw i instanceof Error?new ma(i.message):i}return{...e,paramType:"Boolean",default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"Boolean",default:t?[!1]:!1}}},U_={types:["Text"],parse(n,e){let t=Rs(n.default,P_,!1);return{...e,paramType:"Text",default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"Text",default:t?[""]:""}}},F_={types:["ValueList"],parse(n,e){if(!n.values||typeof n.values!="object"||Object.keys(n.values).length===0)throw ma.missingValues(n.nickname||"unnamed","ValueList");if(n.default!==void 0&&n.default!==null){let t=String(n.default).toLowerCase();Object.keys(n.values).some(i=>i.toLowerCase()===t)||Nt().warn(`ValueList input "${n.nickname||"unnamed"}" default value "${n.default}" is not in available values`)}return{...e,paramType:"ValueList",values:n.values,default:n.default}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"ValueList",values:n.values??{},default:t?[n.default]:n.default}}},O_={types:["Geometry"],parse(n,e){let t=Rs(n.default,Jp(n.nickname||"unnamed"),!0);return{...e,paramType:"Geometry",default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"Geometry",default:t?[null]:null}}},z_={types:["File"],parse(n,e){let t=Rs(n.default,Jp(n.nickname||"unnamed"),!0);return{...e,paramType:"File",acceptedFormats:n.acceptedFormats,default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"File",default:t?[null]:null}}},B_={types:["Color"],parse(n,e){let t=Rs(n.default,R_,!1);return{...e,paramType:"Color",default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"Color",default:t?["0, 0, 0"]:"0, 0, 0"}}},k_=[I_,N_,U_,F_,O_,z_,B_],V_=new Map(k_.flatMap(n=>n.types.map(e=>[e,n])));new Map([...V_.keys()].map(n=>[n.toLowerCase(),n]));const id="184",xs={ROTATE:0,DOLLY:1,PAN:2},hs={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},H_=0,fh=1,G_=2,wo=1,W_=2,fs=3,Kn=0,Yn=1,Qn=2,Mn=0,bs=1,ph=2,mh=3,gh=4,Qp=5,gi=100,X_=101,j_=102,q_=103,Y_=104,Js=200,K_=201,Z_=202,$_=203,_c=204,xc=205,bc=206,J_=207,yc=208,Q_=209,ex=210,tx=211,nx=212,ix=213,rx=214,Sc=0,Mc=1,wc=2,ws=3,Ec=4,Tc=5,Ac=6,Cc=7,em=0,sx=1,ax=2,Fi=0,rd=1,sd=2,ad=3,od=4,ld=5,cd=6,xa=7,tm=300,Dr=301,Es=302,Eo=303,wl=304,ll=306,Lr=1e3,_i=1001,Pc=1002,xn=1003,ox=1004,Ca=1005,hn=1006,El=1007,lr=1008,qn=1009,nm=1010,im=1011,aa=1012,ud=1013,Oi=1014,ti=1015,Fn=1016,dd=1017,hd=1018,Ts=1020,rm=35902,sm=35899,am=1021,om=1022,li=1023,Yi=1026,cr=1027,lm=1028,fd=1029,Ir=1030,pd=1031,md=1033,To=33776,Ao=33777,Co=33778,Po=33779,Rc=35840,Dc=35841,Lc=35842,Ic=35843,Nc=36196,Uc=37492,Fc=37496,Oc=37488,zc=37489,Vo=37490,Bc=37491,kc=37808,Vc=37809,Hc=37810,Gc=37811,Wc=37812,Xc=37813,jc=37814,qc=37815,Yc=37816,Kc=37817,Zc=37818,$c=37819,Jc=37820,Qc=37821,eu=36492,tu=36494,nu=36495,iu=36283,ru=36284,Ho=36285,su=36286,lx=3200,Go=0,cx=1,ar="",Wn="srgb",oa="srgb-linear",Wo="linear",Ut="srgb",kr=7680,vh=519,ux=512,dx=513,hx=514,gd=515,fx=516,px=517,vd=518,mx=519,au=35044,_h="300 es",Ni=2e3,la=2001;function gx(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function Xo(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function vx(){const n=Xo("canvas");return n.style.display="block",n}const xh={};function jo(...n){const e="THREE."+n.shift();console.log(e,...n)}function cm(n){const e=n[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=n[1];t&&t.isStackTrace?n[0]+=" "+t.getLocation():n[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return n}function ft(...n){n=cm(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...n)}}function Tt(...n){n=cm(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...n)}}function ou(...n){const e=n.join(" ");e in xh||(xh[e]=!0,ft(...n))}function _x(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const xx={[Sc]:Mc,[wc]:Ac,[Ec]:Cc,[ws]:Tc,[Mc]:Sc,[Ac]:wc,[Cc]:Ec,[Tc]:ws};class mr{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}}const In=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let bh=1234567;const ys=Math.PI/180,ca=180/Math.PI;function ji(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(In[n&255]+In[n>>8&255]+In[n>>16&255]+In[n>>24&255]+"-"+In[e&255]+In[e>>8&255]+"-"+In[e>>16&15|64]+In[e>>24&255]+"-"+In[t&63|128]+In[t>>8&255]+"-"+In[t>>16&255]+In[t>>24&255]+In[i&255]+In[i>>8&255]+In[i>>16&255]+In[i>>24&255]).toLowerCase()}function gt(n,e,t){return Math.max(e,Math.min(t,n))}function _d(n,e){return(n%e+e)%e}function bx(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function yx(n,e,t){return n!==e?(t-n)/(e-n):0}function ra(n,e,t){return(1-t)*n+t*e}function Sx(n,e,t,i){return ra(n,e,1-Math.exp(-t*i))}function Mx(n,e=1){return e-Math.abs(_d(n,e*2)-e)}function wx(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Ex(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Tx(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Ax(n,e){return n+Math.random()*(e-n)}function Cx(n){return n*(.5-Math.random())}function Px(n){n!==void 0&&(bh=n);let e=bh+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Rx(n){return n*ys}function Dx(n){return n*ca}function Lx(n){return(n&n-1)===0&&n!==0}function Ix(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Nx(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Ux(n,e,t,i,r){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),c=s((e+i)/2),d=a((e+i)/2),f=s((e-i)/2),h=a((e-i)/2),p=s((i-e)/2),m=a((i-e)/2);switch(r){case"XYX":n.set(o*d,l*f,l*h,o*c);break;case"YZY":n.set(l*h,o*d,l*f,o*c);break;case"ZXZ":n.set(l*f,l*h,o*d,o*c);break;case"XZX":n.set(o*d,l*m,l*p,o*c);break;case"YXY":n.set(l*p,o*d,l*m,o*c);break;case"ZYZ":n.set(l*m,l*p,o*d,o*c);break;default:ft("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function vi(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ot(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const um={DEG2RAD:ys,RAD2DEG:ca,generateUUID:ji,clamp:gt,euclideanModulo:_d,mapLinear:bx,inverseLerp:yx,lerp:ra,damp:Sx,pingpong:Mx,smoothstep:wx,smootherstep:Ex,randInt:Tx,randFloat:Ax,randFloatSpread:Cx,seededRandom:Px,degToRad:Rx,radToDeg:Dx,isPowerOfTwo:Lx,ceilPowerOfTwo:Ix,floorPowerOfTwo:Nx,setQuaternionFromProperEuler:Ux,normalize:Ot,denormalize:vi},Kd=class Kd{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=gt(this.x,e.x,t.x),this.y=gt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=gt(this.x,e,t),this.y=gt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(gt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(gt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*i-a*r+e.x,this.y=s*r+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Kd.prototype.isVector2=!0;let it=Kd;class xi{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,a,o){let l=i[r+0],c=i[r+1],d=i[r+2],f=i[r+3],h=s[a+0],p=s[a+1],m=s[a+2],x=s[a+3];if(f!==x||l!==h||c!==p||d!==m){let g=l*h+c*p+d*m+f*x;g<0&&(h=-h,p=-p,m=-m,x=-x,g=-g);let v=1-o;if(g<.9995){const y=Math.acos(g),w=Math.sin(y);v=Math.sin(v*y)/w,o=Math.sin(o*y)/w,l=l*v+h*o,c=c*v+p*o,d=d*v+m*o,f=f*v+x*o}else{l=l*v+h*o,c=c*v+p*o,d=d*v+m*o,f=f*v+x*o;const y=1/Math.sqrt(l*l+c*c+d*d+f*f);l*=y,c*=y,d*=y,f*=y}}e[t]=l,e[t+1]=c,e[t+2]=d,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,r,s,a){const o=i[r],l=i[r+1],c=i[r+2],d=i[r+3],f=s[a],h=s[a+1],p=s[a+2],m=s[a+3];return e[t]=o*m+d*f+l*p-c*h,e[t+1]=l*m+d*h+c*f-o*p,e[t+2]=c*m+d*p+o*h-l*f,e[t+3]=d*m-o*f-l*h-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(i/2),d=o(r/2),f=o(s/2),h=l(i/2),p=l(r/2),m=l(s/2);switch(a){case"XYZ":this._x=h*d*f+c*p*m,this._y=c*p*f-h*d*m,this._z=c*d*m+h*p*f,this._w=c*d*f-h*p*m;break;case"YXZ":this._x=h*d*f+c*p*m,this._y=c*p*f-h*d*m,this._z=c*d*m-h*p*f,this._w=c*d*f+h*p*m;break;case"ZXY":this._x=h*d*f-c*p*m,this._y=c*p*f+h*d*m,this._z=c*d*m+h*p*f,this._w=c*d*f-h*p*m;break;case"ZYX":this._x=h*d*f-c*p*m,this._y=c*p*f+h*d*m,this._z=c*d*m-h*p*f,this._w=c*d*f+h*p*m;break;case"YZX":this._x=h*d*f+c*p*m,this._y=c*p*f+h*d*m,this._z=c*d*m-h*p*f,this._w=c*d*f-h*p*m;break;case"XZY":this._x=h*d*f-c*p*m,this._y=c*p*f-h*d*m,this._z=c*d*m+h*p*f,this._w=c*d*f+h*p*m;break;default:ft("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],d=t[6],f=t[10],h=i+o+f;if(h>0){const p=.5/Math.sqrt(h+1);this._w=.25/p,this._x=(d-l)*p,this._y=(s-c)*p,this._z=(a-r)*p}else if(i>o&&i>f){const p=2*Math.sqrt(1+i-o-f);this._w=(d-l)/p,this._x=.25*p,this._y=(r+a)/p,this._z=(s+c)/p}else if(o>f){const p=2*Math.sqrt(1+o-i-f);this._w=(s-c)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(l+d)/p}else{const p=2*Math.sqrt(1+f-i-o);this._w=(a-r)/p,this._x=(s+c)/p,this._y=(l+d)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(gt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,d=t._w;return this._x=i*d+a*o+r*c-s*l,this._y=r*d+a*l+s*o-i*c,this._z=s*d+a*c+i*l-r*o,this._w=a*d-i*o-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){let i=e._x,r=e._y,s=e._z,a=e._w,o=this.dot(e);o<0&&(i=-i,r=-r,s=-s,a=-a,o=-o);let l=1-t;if(o<.9995){const c=Math.acos(o),d=Math.sin(c);l=Math.sin(l*c)/d,t=Math.sin(t*c)/d,this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this._onChangeCallback()}else this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const Zd=class Zd{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(yh.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(yh.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*r-o*i),d=2*(o*t-s*r),f=2*(s*i-a*t);return this.x=t+l*c+a*f-o*d,this.y=i+l*d+o*c-s*f,this.z=r+l*f+s*d-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=gt(this.x,e.x,t.x),this.y=gt(this.y,e.y,t.y),this.z=gt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=gt(this.x,e,t),this.y=gt(this.y,e,t),this.z=gt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(gt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Tl.copy(this).projectOnVector(e),this.sub(Tl)}reflect(e){return this.sub(Tl.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(gt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Zd.prototype.isVector3=!0;let X=Zd;const Tl=new X,yh=new xi,$d=class $d{constructor(e,t,i,r,s,a,o,l,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,a,o,l,c)}set(e,t,i,r,s,a,o,l,c){const d=this.elements;return d[0]=e,d[1]=r,d[2]=o,d[3]=t,d[4]=s,d[5]=l,d[6]=i,d[7]=a,d[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],d=i[4],f=i[7],h=i[2],p=i[5],m=i[8],x=r[0],g=r[3],v=r[6],y=r[1],w=r[4],b=r[7],E=r[2],S=r[5],A=r[8];return s[0]=a*x+o*y+l*E,s[3]=a*g+o*w+l*S,s[6]=a*v+o*b+l*A,s[1]=c*x+d*y+f*E,s[4]=c*g+d*w+f*S,s[7]=c*v+d*b+f*A,s[2]=h*x+p*y+m*E,s[5]=h*g+p*w+m*S,s[8]=h*v+p*b+m*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],d=e[8];return t*a*d-t*o*c-i*s*d+i*o*l+r*s*c-r*a*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],d=e[8],f=d*a-o*c,h=o*l-d*s,p=c*s-a*l,m=t*f+i*h+r*p;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/m;return e[0]=f*x,e[1]=(r*c-d*i)*x,e[2]=(o*i-r*a)*x,e[3]=h*x,e[4]=(d*t-r*l)*x,e[5]=(r*s-o*t)*x,e[6]=p*x,e[7]=(i*l-c*t)*x,e[8]=(a*t-i*s)*x,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*a+c*o)+a+e,-r*c,r*l,-r*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Al.makeScale(e,t)),this}rotate(e){return this.premultiply(Al.makeRotation(-e)),this}translate(e,t){return this.premultiply(Al.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};$d.prototype.isMatrix3=!0;let xt=$d;const Al=new xt,Sh=new xt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Mh=new xt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Fx(){const n={enabled:!0,workingColorSpace:oa,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===Ut&&(r.r=qi(r.r),r.g=qi(r.g),r.b=qi(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Ut&&(r.r=Ss(r.r),r.g=Ss(r.g),r.b=Ss(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===ar?Wo:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return ou("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return ou("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[oa]:{primaries:e,whitePoint:i,transfer:Wo,toXYZ:Sh,fromXYZ:Mh,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Wn},outputColorSpaceConfig:{drawingBufferColorSpace:Wn}},[Wn]:{primaries:e,whitePoint:i,transfer:Ut,toXYZ:Sh,fromXYZ:Mh,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Wn}}}),n}const At=Fx();function qi(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Ss(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Vr;class Ox{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Vr===void 0&&(Vr=Xo("canvas")),Vr.width=e.width,Vr.height=e.height;const r=Vr.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=Vr}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Xo("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=qi(s[a]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(qi(t[i]/255)*255):t[i]=qi(t[i]);return{data:t,width:e.width,height:e.height}}else return ft("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let zx=0;class xd{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:zx++}),this.uuid=ji(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(Cl(r[a].image)):s.push(Cl(r[a]))}else s=Cl(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function Cl(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?Ox.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(ft("Texture: Unable to serialize Texture."),{})}let Bx=0;const Pl=new X;class En extends mr{constructor(e=En.DEFAULT_IMAGE,t=En.DEFAULT_MAPPING,i=_i,r=_i,s=hn,a=lr,o=li,l=qn,c=En.DEFAULT_ANISOTROPY,d=ar){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Bx++}),this.uuid=ji(),this.name="",this.source=new xd(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new it(0,0),this.repeat=new it(1,1),this.center=new it(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new xt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Pl).x}get height(){return this.source.getSize(Pl).y}get depth(){return this.source.getSize(Pl).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){ft(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){ft(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==tm)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Lr:e.x=e.x-Math.floor(e.x);break;case _i:e.x=e.x<0?0:1;break;case Pc:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Lr:e.y=e.y-Math.floor(e.y);break;case _i:e.y=e.y<0?0:1;break;case Pc:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}En.DEFAULT_IMAGE=null;En.DEFAULT_MAPPING=tm;En.DEFAULT_ANISOTROPY=1;const Jd=class Jd{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*i+a[11]*r+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],d=l[4],f=l[8],h=l[1],p=l[5],m=l[9],x=l[2],g=l[6],v=l[10];if(Math.abs(d-h)<.01&&Math.abs(f-x)<.01&&Math.abs(m-g)<.01){if(Math.abs(d+h)<.1&&Math.abs(f+x)<.1&&Math.abs(m+g)<.1&&Math.abs(c+p+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(c+1)/2,b=(p+1)/2,E=(v+1)/2,S=(d+h)/4,A=(f+x)/4,_=(m+g)/4;return w>b&&w>E?w<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(w),r=S/i,s=A/i):b>E?b<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(b),i=S/r,s=_/r):E<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(E),i=A/s,r=_/s),this.set(i,r,s,t),this}let y=Math.sqrt((g-m)*(g-m)+(f-x)*(f-x)+(h-d)*(h-d));return Math.abs(y)<.001&&(y=1),this.x=(g-m)/y,this.y=(f-x)/y,this.z=(h-d)/y,this.w=Math.acos((c+p+v-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=gt(this.x,e.x,t.x),this.y=gt(this.y,e.y,t.y),this.z=gt(this.z,e.z,t.z),this.w=gt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=gt(this.x,e,t),this.y=gt(this.y,e,t),this.z=gt(this.z,e,t),this.w=gt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(gt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};Jd.prototype.isVector4=!0;let kt=Jd;class kx extends mr{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:hn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new kt(0,0,e,t),this.scissorTest=!1,this.viewport=new kt(0,0,e,t),this.textures=[];const r={width:e,height:t,depth:i.depth},s=new En(r),a=i.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const t={minFilter:hn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=i,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new xd(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ni extends kx{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class dm extends En{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=xn,this.minFilter=xn,this.wrapR=_i,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Vx extends En{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=xn,this.minFilter=xn,this.wrapR=_i,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const el=class el{constructor(e,t,i,r,s,a,o,l,c,d,f,h,p,m,x,g){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,a,o,l,c,d,f,h,p,m,x,g)}set(e,t,i,r,s,a,o,l,c,d,f,h,p,m,x,g){const v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=r,v[1]=s,v[5]=a,v[9]=o,v[13]=l,v[2]=c,v[6]=d,v[10]=f,v[14]=h,v[3]=p,v[7]=m,v[11]=x,v[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new el().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,i=e.elements,r=1/Hr.setFromMatrixColumn(e,0).length(),s=1/Hr.setFromMatrixColumn(e,1).length(),a=1/Hr.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),c=Math.sin(r),d=Math.cos(s),f=Math.sin(s);if(e.order==="XYZ"){const h=a*d,p=a*f,m=o*d,x=o*f;t[0]=l*d,t[4]=-l*f,t[8]=c,t[1]=p+m*c,t[5]=h-x*c,t[9]=-o*l,t[2]=x-h*c,t[6]=m+p*c,t[10]=a*l}else if(e.order==="YXZ"){const h=l*d,p=l*f,m=c*d,x=c*f;t[0]=h+x*o,t[4]=m*o-p,t[8]=a*c,t[1]=a*f,t[5]=a*d,t[9]=-o,t[2]=p*o-m,t[6]=x+h*o,t[10]=a*l}else if(e.order==="ZXY"){const h=l*d,p=l*f,m=c*d,x=c*f;t[0]=h-x*o,t[4]=-a*f,t[8]=m+p*o,t[1]=p+m*o,t[5]=a*d,t[9]=x-h*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const h=a*d,p=a*f,m=o*d,x=o*f;t[0]=l*d,t[4]=m*c-p,t[8]=h*c+x,t[1]=l*f,t[5]=x*c+h,t[9]=p*c-m,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const h=a*l,p=a*c,m=o*l,x=o*c;t[0]=l*d,t[4]=x-h*f,t[8]=m*f+p,t[1]=f,t[5]=a*d,t[9]=-o*d,t[2]=-c*d,t[6]=p*f+m,t[10]=h-x*f}else if(e.order==="XZY"){const h=a*l,p=a*c,m=o*l,x=o*c;t[0]=l*d,t[4]=-f,t[8]=c*d,t[1]=h*f+x,t[5]=a*d,t[9]=p*f-m,t[2]=m*f-p,t[6]=o*d,t[10]=x*f+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Hx,e,Gx)}lookAt(e,t,i){const r=this.elements;return $n.subVectors(e,t),$n.lengthSq()===0&&($n.z=1),$n.normalize(),Qi.crossVectors(i,$n),Qi.lengthSq()===0&&(Math.abs(i.z)===1?$n.x+=1e-4:$n.z+=1e-4,$n.normalize(),Qi.crossVectors(i,$n)),Qi.normalize(),Pa.crossVectors($n,Qi),r[0]=Qi.x,r[4]=Pa.x,r[8]=$n.x,r[1]=Qi.y,r[5]=Pa.y,r[9]=$n.y,r[2]=Qi.z,r[6]=Pa.z,r[10]=$n.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],d=i[1],f=i[5],h=i[9],p=i[13],m=i[2],x=i[6],g=i[10],v=i[14],y=i[3],w=i[7],b=i[11],E=i[15],S=r[0],A=r[4],_=r[8],T=r[12],D=r[1],L=r[5],F=r[9],k=r[13],U=r[2],I=r[6],R=r[10],z=r[14],q=r[3],Y=r[7],te=r[11],le=r[15];return s[0]=a*S+o*D+l*U+c*q,s[4]=a*A+o*L+l*I+c*Y,s[8]=a*_+o*F+l*R+c*te,s[12]=a*T+o*k+l*z+c*le,s[1]=d*S+f*D+h*U+p*q,s[5]=d*A+f*L+h*I+p*Y,s[9]=d*_+f*F+h*R+p*te,s[13]=d*T+f*k+h*z+p*le,s[2]=m*S+x*D+g*U+v*q,s[6]=m*A+x*L+g*I+v*Y,s[10]=m*_+x*F+g*R+v*te,s[14]=m*T+x*k+g*z+v*le,s[3]=y*S+w*D+b*U+E*q,s[7]=y*A+w*L+b*I+E*Y,s[11]=y*_+w*F+b*R+E*te,s[15]=y*T+w*k+b*z+E*le,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],d=e[2],f=e[6],h=e[10],p=e[14],m=e[3],x=e[7],g=e[11],v=e[15],y=l*p-c*h,w=o*p-c*f,b=o*h-l*f,E=a*p-c*d,S=a*h-l*d,A=a*f-o*d;return t*(x*y-g*w+v*b)-i*(m*y-g*E+v*S)+r*(m*w-x*E+v*A)-s*(m*b-x*S+g*A)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],d=e[8],f=e[9],h=e[10],p=e[11],m=e[12],x=e[13],g=e[14],v=e[15],y=t*o-i*a,w=t*l-r*a,b=t*c-s*a,E=i*l-r*o,S=i*c-s*o,A=r*c-s*l,_=d*x-f*m,T=d*g-h*m,D=d*v-p*m,L=f*g-h*x,F=f*v-p*x,k=h*v-p*g,U=y*k-w*F+b*L+E*D-S*T+A*_;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/U;return e[0]=(o*k-l*F+c*L)*I,e[1]=(r*F-i*k-s*L)*I,e[2]=(x*A-g*S+v*E)*I,e[3]=(h*S-f*A-p*E)*I,e[4]=(l*D-a*k-c*T)*I,e[5]=(t*k-r*D+s*T)*I,e[6]=(g*b-m*A-v*w)*I,e[7]=(d*A-h*b+p*w)*I,e[8]=(a*F-o*D+c*_)*I,e[9]=(i*D-t*F-s*_)*I,e[10]=(m*S-x*b+v*y)*I,e[11]=(f*b-d*S-p*y)*I,e[12]=(o*T-a*L-l*_)*I,e[13]=(t*L-i*T+r*_)*I,e[14]=(x*w-m*E-g*y)*I,e[15]=(d*E-f*w+h*y)*I,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,a=e.x,o=e.y,l=e.z,c=s*a,d=s*o;return this.set(c*a+i,c*o-r*l,c*l+r*o,0,c*o+r*l,d*o+i,d*l-r*a,0,c*l-r*o,d*l+r*a,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,a){return this.set(1,i,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,d=a+a,f=o+o,h=s*c,p=s*d,m=s*f,x=a*d,g=a*f,v=o*f,y=l*c,w=l*d,b=l*f,E=i.x,S=i.y,A=i.z;return r[0]=(1-(x+v))*E,r[1]=(p+b)*E,r[2]=(m-w)*E,r[3]=0,r[4]=(p-b)*S,r[5]=(1-(h+v))*S,r[6]=(g+y)*S,r[7]=0,r[8]=(m+w)*A,r[9]=(g-y)*A,r[10]=(1-(h+x))*A,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinant();if(s===0)return i.set(1,1,1),t.identity(),this;let a=Hr.set(r[0],r[1],r[2]).length();const o=Hr.set(r[4],r[5],r[6]).length(),l=Hr.set(r[8],r[9],r[10]).length();s<0&&(a=-a),hi.copy(this);const c=1/a,d=1/o,f=1/l;return hi.elements[0]*=c,hi.elements[1]*=c,hi.elements[2]*=c,hi.elements[4]*=d,hi.elements[5]*=d,hi.elements[6]*=d,hi.elements[8]*=f,hi.elements[9]*=f,hi.elements[10]*=f,t.setFromRotationMatrix(hi),i.x=a,i.y=o,i.z=l,this}makePerspective(e,t,i,r,s,a,o=Ni,l=!1){const c=this.elements,d=2*s/(t-e),f=2*s/(i-r),h=(t+e)/(t-e),p=(i+r)/(i-r);let m,x;if(l)m=s/(a-s),x=a*s/(a-s);else if(o===Ni)m=-(a+s)/(a-s),x=-2*a*s/(a-s);else if(o===la)m=-a/(a-s),x=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=d,c[4]=0,c[8]=h,c[12]=0,c[1]=0,c[5]=f,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=m,c[14]=x,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,i,r,s,a,o=Ni,l=!1){const c=this.elements,d=2/(t-e),f=2/(i-r),h=-(t+e)/(t-e),p=-(i+r)/(i-r);let m,x;if(l)m=1/(a-s),x=a/(a-s);else if(o===Ni)m=-2/(a-s),x=-(a+s)/(a-s);else if(o===la)m=-1/(a-s),x=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=d,c[4]=0,c[8]=0,c[12]=h,c[1]=0,c[5]=f,c[9]=0,c[13]=p,c[2]=0,c[6]=0,c[10]=m,c[14]=x,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}};el.prototype.isMatrix4=!0;let Lt=el;const Hr=new X,hi=new Lt,Hx=new X(0,0,0),Gx=new X(1,1,1),Qi=new X,Pa=new X,$n=new X,wh=new Lt,Eh=new xi;class Xn{constructor(e=0,t=0,i=0,r=Xn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],d=r[9],f=r[2],h=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(gt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-d,p),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-gt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(gt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-gt(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(gt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-gt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-d,p),this._y=0);break;default:ft("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return wh.makeRotationFromQuaternion(e),this.setFromRotationMatrix(wh,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Eh.setFromEuler(this),this.setFromQuaternion(Eh,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Xn.DEFAULT_ORDER="XYZ";class bd{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Wx=0;const Th=new X,Gr=new xi,Bi=new Lt,Ra=new X,Fs=new X,Xx=new X,jx=new xi,Ah=new X(1,0,0),Ch=new X(0,1,0),Ph=new X(0,0,1),Rh={type:"added"},qx={type:"removed"},Wr={type:"childadded",child:null},Rl={type:"childremoved",child:null};class rn extends mr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Wx++}),this.uuid=ji(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=rn.DEFAULT_UP.clone();const e=new X,t=new Xn,i=new xi,r=new X(1,1,1);function s(){i.setFromEuler(t,!1)}function a(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Lt},normalMatrix:{value:new xt}}),this.matrix=new Lt,this.matrixWorld=new Lt,this.matrixAutoUpdate=rn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=rn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new bd,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Gr.setFromAxisAngle(e,t),this.quaternion.multiply(Gr),this}rotateOnWorldAxis(e,t){return Gr.setFromAxisAngle(e,t),this.quaternion.premultiply(Gr),this}rotateX(e){return this.rotateOnAxis(Ah,e)}rotateY(e){return this.rotateOnAxis(Ch,e)}rotateZ(e){return this.rotateOnAxis(Ph,e)}translateOnAxis(e,t){return Th.copy(e).applyQuaternion(this.quaternion),this.position.add(Th.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Ah,e)}translateY(e){return this.translateOnAxis(Ch,e)}translateZ(e){return this.translateOnAxis(Ph,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Bi.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?Ra.copy(e):Ra.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Fs.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Bi.lookAt(Fs,Ra,this.up):Bi.lookAt(Ra,Fs,this.up),this.quaternion.setFromRotationMatrix(Bi),r&&(Bi.extractRotation(r.matrixWorld),Gr.setFromRotationMatrix(Bi),this.quaternion.premultiply(Gr.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(Tt("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Rh),Wr.child=e,this.dispatchEvent(Wr),Wr.child=null):Tt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(qx),Rl.child=e,this.dispatchEvent(Rl),Rl.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Bi.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Bi.multiply(e.parent.matrixWorld)),e.applyMatrix4(Bi),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Rh),Wr.child=e,this.dispatchEvent(Wr),Wr.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){const a=this.children[i].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Fs,e,Xx),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Fs,jx,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,i=e.y,r=e.z,s=this.matrix.elements;s[12]+=t-s[0]*t-s[4]*i-s[8]*r,s[13]+=i-s[1]*t-s[5]*i-s[9]*r,s[14]+=r-s[2]*t-s[6]*i-s[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,d=l.length;c<d;c++){const f=l[c];s(e.shapes,f)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),d=a(e.images),f=a(e.shapes),h=a(e.skeletons),p=a(e.animations),m=a(e.nodes);o.length>0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),d.length>0&&(i.images=d),f.length>0&&(i.shapes=f),h.length>0&&(i.skeletons=h),p.length>0&&(i.animations=p),m.length>0&&(i.nodes=m)}return i.object=r,i;function a(o){const l=[];for(const c in o){const d=o[c];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}rn.DEFAULT_UP=new X(0,1,0);rn.DEFAULT_MATRIX_AUTO_UPDATE=!0;rn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let Qs=class extends rn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const Yx={type:"move"};class Dl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Qs,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Qs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new X,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new X),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Qs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new X,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new X,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const x of e.hand.values()){const g=t.getJointPose(x,i),v=this._getHandJoint(c,x);g!==null&&(v.matrix.fromArray(g.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=g.radius),v.visible=g!==null}const d=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=d.position.distanceTo(f.position),p=.02,m=.005;c.inputState.pinching&&h>p+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=p-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1,l.eventsEnabled&&l.dispatchEvent({type:"gripUpdated",data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Yx)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Qs;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const hm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},er={h:0,s:0,l:0},Da={h:0,s:0,l:0};function Ll(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class tt{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Wn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,At.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=At.workingColorSpace){return this.r=e,this.g=t,this.b=i,At.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=At.workingColorSpace){if(e=_d(e,1),t=gt(t,0,1),i=gt(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,a=2*i-s;this.r=Ll(a,s,e+1/3),this.g=Ll(a,s,e),this.b=Ll(a,s,e-1/3)}return At.colorSpaceToWorking(this,r),this}setStyle(e,t=Wn){function i(s){s!==void 0&&parseFloat(s)<1&&ft("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:ft("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);ft("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Wn){const i=hm[e.toLowerCase()];return i!==void 0?this.setHex(i,t):ft("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=qi(e.r),this.g=qi(e.g),this.b=qi(e.b),this}copyLinearToSRGB(e){return this.r=Ss(e.r),this.g=Ss(e.g),this.b=Ss(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Wn){return At.workingToColorSpace(Nn.copy(this),e),Math.round(gt(Nn.r*255,0,255))*65536+Math.round(gt(Nn.g*255,0,255))*256+Math.round(gt(Nn.b*255,0,255))}getHexString(e=Wn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=At.workingColorSpace){At.workingToColorSpace(Nn.copy(this),t);const i=Nn.r,r=Nn.g,s=Nn.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let l,c;const d=(o+a)/2;if(o===a)l=0,c=0;else{const f=a-o;switch(c=d<=.5?f/(a+o):f/(2-a-o),a){case i:l=(r-s)/f+(r<s?6:0);break;case r:l=(s-i)/f+2;break;case s:l=(i-r)/f+4;break}l/=6}return e.h=l,e.s=c,e.l=d,e}getRGB(e,t=At.workingColorSpace){return At.workingToColorSpace(Nn.copy(this),t),e.r=Nn.r,e.g=Nn.g,e.b=Nn.b,e}getStyle(e=Wn){At.workingToColorSpace(Nn.copy(this),e);const t=Nn.r,i=Nn.g,r=Nn.b;return e!==Wn?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(er),this.setHSL(er.h+e,er.s+t,er.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(er),e.getHSL(Da);const i=ra(er.h,Da.h,t),r=ra(er.s,Da.s,t),s=ra(er.l,Da.l,t);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Nn=new tt;tt.NAMES=hm;class Kx extends rn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Xn,this.environmentIntensity=1,this.environmentRotation=new Xn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const fi=new X,ki=new X,Il=new X,Vi=new X,Xr=new X,jr=new X,Dh=new X,Nl=new X,Ul=new X,Fl=new X,Ol=new kt,zl=new kt,Bl=new kt;class ei{constructor(e=new X,t=new X,i=new X){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),fi.subVectors(e,t),r.cross(fi);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){fi.subVectors(r,t),ki.subVectors(i,t),Il.subVectors(e,t);const a=fi.dot(fi),o=fi.dot(ki),l=fi.dot(Il),c=ki.dot(ki),d=ki.dot(Il),f=a*c-o*o;if(f===0)return s.set(0,0,0),null;const h=1/f,p=(c*l-o*d)*h,m=(a*d-o*l)*h;return s.set(1-p-m,m,p)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Vi)===null?!1:Vi.x>=0&&Vi.y>=0&&Vi.x+Vi.y<=1}static getInterpolation(e,t,i,r,s,a,o,l){return this.getBarycoord(e,t,i,r,Vi)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Vi.x),l.addScaledVector(a,Vi.y),l.addScaledVector(o,Vi.z),l)}static getInterpolatedAttribute(e,t,i,r,s,a){return Ol.setScalar(0),zl.setScalar(0),Bl.setScalar(0),Ol.fromBufferAttribute(e,t),zl.fromBufferAttribute(e,i),Bl.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(Ol,s.x),a.addScaledVector(zl,s.y),a.addScaledVector(Bl,s.z),a}static isFrontFacing(e,t,i,r){return fi.subVectors(i,t),ki.subVectors(e,t),fi.cross(ki).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return fi.subVectors(this.c,this.b),ki.subVectors(this.a,this.b),fi.cross(ki).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ei.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return ei.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return ei.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return ei.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ei.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let a,o;Xr.subVectors(r,i),jr.subVectors(s,i),Nl.subVectors(e,i);const l=Xr.dot(Nl),c=jr.dot(Nl);if(l<=0&&c<=0)return t.copy(i);Ul.subVectors(e,r);const d=Xr.dot(Ul),f=jr.dot(Ul);if(d>=0&&f<=d)return t.copy(r);const h=l*f-d*c;if(h<=0&&l>=0&&d<=0)return a=l/(l-d),t.copy(i).addScaledVector(Xr,a);Fl.subVectors(e,s);const p=Xr.dot(Fl),m=jr.dot(Fl);if(m>=0&&p<=m)return t.copy(s);const x=p*c-l*m;if(x<=0&&c>=0&&m<=0)return o=c/(c-m),t.copy(i).addScaledVector(jr,o);const g=d*m-p*f;if(g<=0&&f-d>=0&&p-m>=0)return Dh.subVectors(s,r),o=(f-d)/(f-d+(p-m)),t.copy(r).addScaledVector(Dh,o);const v=1/(g+x+h);return a=x*v,o=h*v,t.copy(i).addScaledVector(Xr,a).addScaledVector(jr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class di{constructor(e=new X(1/0,1/0,1/0),t=new X(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(pi.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(pi.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=pi.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,pi):pi.fromBufferAttribute(s,a),pi.applyMatrix4(e.matrixWorld),this.expandByPoint(pi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),La.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),La.copy(i.boundingBox)),La.applyMatrix4(e.matrixWorld),this.union(La)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,pi),pi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Os),Ia.subVectors(this.max,Os),qr.subVectors(e.a,Os),Yr.subVectors(e.b,Os),Kr.subVectors(e.c,Os),tr.subVectors(Yr,qr),nr.subVectors(Kr,Yr),vr.subVectors(qr,Kr);let t=[0,-tr.z,tr.y,0,-nr.z,nr.y,0,-vr.z,vr.y,tr.z,0,-tr.x,nr.z,0,-nr.x,vr.z,0,-vr.x,-tr.y,tr.x,0,-nr.y,nr.x,0,-vr.y,vr.x,0];return!kl(t,qr,Yr,Kr,Ia)||(t=[1,0,0,0,1,0,0,0,1],!kl(t,qr,Yr,Kr,Ia))?!1:(Na.crossVectors(tr,nr),t=[Na.x,Na.y,Na.z],kl(t,qr,Yr,Kr,Ia))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,pi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(pi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Hi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Hi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Hi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Hi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Hi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Hi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Hi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Hi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Hi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Hi=[new X,new X,new X,new X,new X,new X,new X,new X],pi=new X,La=new di,qr=new X,Yr=new X,Kr=new X,tr=new X,nr=new X,vr=new X,Os=new X,Ia=new X,Na=new X,_r=new X;function kl(n,e,t,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){_r.fromArray(n,s);const o=r.x*Math.abs(_r.x)+r.y*Math.abs(_r.y)+r.z*Math.abs(_r.z),l=e.dot(_r),c=t.dot(_r),d=i.dot(_r);if(Math.max(-Math.max(l,c,d),Math.min(l,c,d))>o)return!1}return!0}const Xi=Zx();function Zx(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,d=0;for(;(c&8388608)===0;)c<<=1,d-=8388608;c&=-8388609,d+=947912704,s[l]=c|d}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function $x(n){Math.abs(n)>65504&&ft("DataUtils.toHalfFloat(): Value out of range."),n=gt(n,-65504,65504),Xi.floatView[0]=n;const e=Xi.uint32View[0],t=e>>23&511;return Xi.baseTable[t]+((e&8388607)>>Xi.shiftTable[t])}function Jx(n){const e=n>>10;return Xi.uint32View[0]=Xi.mantissaTable[Xi.offsetTable[e]+(n&1023)]+Xi.exponentTable[e],Xi.floatView[0]}class Ua{static toHalfFloat(e){return $x(e)}static fromHalfFloat(e){return Jx(e)}}const mn=new X,Fa=new it;let Qx=0;class kn extends mr{constructor(e,t,i=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Qx++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=au,this.updateRanges=[],this.gpuType=ti,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)Fa.fromBufferAttribute(this,t),Fa.applyMatrix3(e),this.setXY(t,Fa.x,Fa.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)mn.fromBufferAttribute(this,t),mn.applyMatrix3(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)mn.fromBufferAttribute(this,t),mn.applyMatrix4(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)mn.fromBufferAttribute(this,t),mn.applyNormalMatrix(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)mn.fromBufferAttribute(this,t),mn.transformDirection(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=vi(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ot(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=vi(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=vi(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=vi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=vi(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array),s=Ot(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==au&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class fm extends kn{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class pm extends kn{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class sn extends kn{constructor(e,t,i){super(new Float32Array(e),t,i)}}const eb=new di,zs=new X,Vl=new X;class Ur{constructor(e=new X,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):eb.setFromPoints(e).getCenter(i);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;zs.subVectors(e,this.center);const t=zs.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(zs,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Vl.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(zs.copy(e.center).add(Vl)),this.expandByPoint(zs.copy(e.center).sub(Vl))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let tb=0;const ai=new Lt,Hl=new rn,Zr=new X,Jn=new di,Bs=new di,Sn=new X;class on extends mr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:tb++}),this.uuid=ji(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(gx(e)?pm:fm)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new xt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ai.makeRotationFromQuaternion(e),this.applyMatrix4(ai),this}rotateX(e){return ai.makeRotationX(e),this.applyMatrix4(ai),this}rotateY(e){return ai.makeRotationY(e),this.applyMatrix4(ai),this}rotateZ(e){return ai.makeRotationZ(e),this.applyMatrix4(ai),this}translate(e,t,i){return ai.makeTranslation(e,t,i),this.applyMatrix4(ai),this}scale(e,t,i){return ai.makeScale(e,t,i),this.applyMatrix4(ai),this}lookAt(e){return Hl.lookAt(e),Hl.updateMatrix(),this.applyMatrix4(Hl.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Zr).negate(),this.translate(Zr.x,Zr.y,Zr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];i.push(a.x,a.y,a.z||0)}this.setAttribute("position",new sn(i,3))}else{const i=Math.min(e.length,t.count);for(let r=0;r<i;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&ft("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new di);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Tt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new X(-1/0,-1/0,-1/0),new X(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const s=t[i];Jn.setFromBufferAttribute(s),this.morphTargetsRelative?(Sn.addVectors(this.boundingBox.min,Jn.min),this.boundingBox.expandByPoint(Sn),Sn.addVectors(this.boundingBox.max,Jn.max),this.boundingBox.expandByPoint(Sn)):(this.boundingBox.expandByPoint(Jn.min),this.boundingBox.expandByPoint(Jn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Tt('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ur);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Tt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new X,1/0);return}if(e){const i=this.boundingSphere.center;if(Jn.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];Bs.setFromBufferAttribute(o),this.morphTargetsRelative?(Sn.addVectors(Jn.min,Bs.min),Jn.expandByPoint(Sn),Sn.addVectors(Jn.max,Bs.max),Jn.expandByPoint(Sn)):(Jn.expandByPoint(Bs.min),Jn.expandByPoint(Bs.max))}Jn.getCenter(i);let r=0;for(let s=0,a=e.count;s<a;s++)Sn.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(Sn));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,d=o.count;c<d;c++)Sn.fromBufferAttribute(o,c),l&&(Zr.fromBufferAttribute(e,c),Sn.add(Zr)),r=Math.max(r,i.distanceToSquared(Sn))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&Tt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){Tt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new kn(new Float32Array(4*i.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let _=0;_<i.count;_++)o[_]=new X,l[_]=new X;const c=new X,d=new X,f=new X,h=new it,p=new it,m=new it,x=new X,g=new X;function v(_,T,D){c.fromBufferAttribute(i,_),d.fromBufferAttribute(i,T),f.fromBufferAttribute(i,D),h.fromBufferAttribute(s,_),p.fromBufferAttribute(s,T),m.fromBufferAttribute(s,D),d.sub(c),f.sub(c),p.sub(h),m.sub(h);const L=1/(p.x*m.y-m.x*p.y);isFinite(L)&&(x.copy(d).multiplyScalar(m.y).addScaledVector(f,-p.y).multiplyScalar(L),g.copy(f).multiplyScalar(p.x).addScaledVector(d,-m.x).multiplyScalar(L),o[_].add(x),o[T].add(x),o[D].add(x),l[_].add(g),l[T].add(g),l[D].add(g))}let y=this.groups;y.length===0&&(y=[{start:0,count:e.count}]);for(let _=0,T=y.length;_<T;++_){const D=y[_],L=D.start,F=D.count;for(let k=L,U=L+F;k<U;k+=3)v(e.getX(k+0),e.getX(k+1),e.getX(k+2))}const w=new X,b=new X,E=new X,S=new X;function A(_){E.fromBufferAttribute(r,_),S.copy(E);const T=o[_];w.copy(T),w.sub(E.multiplyScalar(E.dot(T))).normalize(),b.crossVectors(S,T);const L=b.dot(l[_])<0?-1:1;a.setXYZW(_,w.x,w.y,w.z,L)}for(let _=0,T=y.length;_<T;++_){const D=y[_],L=D.start,F=D.count;for(let k=L,U=L+F;k<U;k+=3)A(e.getX(k+0)),A(e.getX(k+1)),A(e.getX(k+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new kn(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let h=0,p=i.count;h<p;h++)i.setXYZ(h,0,0,0);const r=new X,s=new X,a=new X,o=new X,l=new X,c=new X,d=new X,f=new X;if(e)for(let h=0,p=e.count;h<p;h+=3){const m=e.getX(h+0),x=e.getX(h+1),g=e.getX(h+2);r.fromBufferAttribute(t,m),s.fromBufferAttribute(t,x),a.fromBufferAttribute(t,g),d.subVectors(a,s),f.subVectors(r,s),d.cross(f),o.fromBufferAttribute(i,m),l.fromBufferAttribute(i,x),c.fromBufferAttribute(i,g),o.add(d),l.add(d),c.add(d),i.setXYZ(m,o.x,o.y,o.z),i.setXYZ(x,l.x,l.y,l.z),i.setXYZ(g,c.x,c.y,c.z)}else for(let h=0,p=t.count;h<p;h+=3)r.fromBufferAttribute(t,h+0),s.fromBufferAttribute(t,h+1),a.fromBufferAttribute(t,h+2),d.subVectors(a,s),f.subVectors(r,s),d.cross(f),i.setXYZ(h+0,d.x,d.y,d.z),i.setXYZ(h+1,d.x,d.y,d.z),i.setXYZ(h+2,d.x,d.y,d.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)Sn.fromBufferAttribute(e,t),Sn.normalize(),e.setXYZ(t,Sn.x,Sn.y,Sn.z)}toNonIndexed(){function e(o,l){const c=o.array,d=o.itemSize,f=o.normalized,h=new c.constructor(l.length*d);let p=0,m=0;for(let x=0,g=l.length;x<g;x++){o.isInterleavedBufferAttribute?p=l[x]*o.data.stride+o.offset:p=l[x]*d;for(let v=0;v<d;v++)h[m++]=c[p++]}return new kn(h,d,f)}if(this.index===null)return ft("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new on,i=this.index.array,r=this.attributes;for(const o in r){const l=r[o],c=e(l,i);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let d=0,f=c.length;d<f;d++){const h=c[d],p=e(h,i);l.push(p)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],d=[];for(let f=0,h=c.length;f<h;f++){const p=c[f];d.push(p.toJSON(e.data))}d.length>0&&(r[l]=d,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const c in r){const d=r[c];this.setAttribute(c,d.clone(t))}const s=e.morphAttributes;for(const c in s){const d=[],f=s[c];for(let h=0,p=f.length;h<p;h++)d.push(f[h].clone(t));this.morphAttributes[c]=d}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,d=a.length;c<d;c++){const f=a[c];this.addGroup(f.start,f.count,f.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class mm{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=au,this.updateRanges=[],this.version=0,this.uuid=ji()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ji()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ji()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const On=new X;class Ui{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)On.fromBufferAttribute(this,t),On.applyMatrix4(e),this.setXYZ(t,On.x,On.y,On.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)On.fromBufferAttribute(this,t),On.applyNormalMatrix(e),this.setXYZ(t,On.x,On.y,On.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)On.fromBufferAttribute(this,t),On.transformDirection(e),this.setXYZ(t,On.x,On.y,On.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=vi(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ot(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=vi(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=vi(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=vi(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=vi(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array),s=Ot(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){jo("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new kn(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ui(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){jo("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let nb=0;class yi extends mr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:nb++}),this.uuid=ji(),this.name="",this.type="Material",this.blending=bs,this.side=Kn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=_c,this.blendDst=xc,this.blendEquation=gi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new tt(0,0,0),this.blendAlpha=0,this.depthFunc=ws,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=vh,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=kr,this.stencilZFail=kr,this.stencilZPass=kr,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){ft(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){ft(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==bs&&(i.blending=this.blending),this.side!==Kn&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==_c&&(i.blendSrc=this.blendSrc),this.blendDst!==xc&&(i.blendDst=this.blendDst),this.blendEquation!==gi&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==ws&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==vh&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==kr&&(i.stencilFail=this.stencilFail),this.stencilZFail!==kr&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==kr&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=r(e.textures),a=r(e.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class gm extends yi{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new tt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let $r;const ks=new X,Jr=new X,Qr=new X,es=new it,Vs=new it,vm=new Lt,Oa=new X,Hs=new X,za=new X,Lh=new it,Gl=new it,Ih=new it;class ts extends rn{constructor(e=new gm){if(super(),this.isSprite=!0,this.type="Sprite",$r===void 0){$r=new on;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new mm(t,5);$r.setIndex([0,1,2,0,2,3]),$r.setAttribute("position",new Ui(i,3,0,!1)),$r.setAttribute("uv",new Ui(i,2,3,!1))}this.geometry=$r,this.material=e,this.center=new it(.5,.5),this.count=1}raycast(e,t){e.camera===null&&Tt('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Jr.setFromMatrixScale(this.matrixWorld),vm.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Qr.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Jr.multiplyScalar(-Qr.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const a=this.center;Ba(Oa.set(-.5,-.5,0),Qr,a,Jr,r,s),Ba(Hs.set(.5,-.5,0),Qr,a,Jr,r,s),Ba(za.set(.5,.5,0),Qr,a,Jr,r,s),Lh.set(0,0),Gl.set(1,0),Ih.set(1,1);let o=e.ray.intersectTriangle(Oa,Hs,za,!1,ks);if(o===null&&(Ba(Hs.set(-.5,.5,0),Qr,a,Jr,r,s),Gl.set(0,1),o=e.ray.intersectTriangle(Oa,za,Hs,!1,ks),o===null))return;const l=e.ray.origin.distanceTo(ks);l<e.near||l>e.far||t.push({distance:l,point:ks.clone(),uv:ei.getInterpolation(ks,Oa,Hs,za,Lh,Gl,Ih,new it),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Ba(n,e,t,i,r,s){es.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Vs.x=s*es.x-r*es.y,Vs.y=r*es.x+s*es.y):Vs.copy(es),n.copy(e),n.x+=Vs.x,n.y+=Vs.y,n.applyMatrix4(vm)}const Gi=new X,Wl=new X,ka=new X,ir=new X,Xl=new X,Va=new X,jl=new X;class ba{constructor(e=new X,t=new X(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Gi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Gi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Gi.copy(this.origin).addScaledVector(this.direction,t),Gi.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Wl.copy(e).add(t).multiplyScalar(.5),ka.copy(t).sub(e).normalize(),ir.copy(this.origin).sub(Wl);const s=e.distanceTo(t)*.5,a=-this.direction.dot(ka),o=ir.dot(this.direction),l=-ir.dot(ka),c=ir.lengthSq(),d=Math.abs(1-a*a);let f,h,p,m;if(d>0)if(f=a*l-o,h=a*o-l,m=s*d,f>=0)if(h>=-m)if(h<=m){const x=1/d;f*=x,h*=x,p=f*(f+a*h+2*o)+h*(a*f+h+2*l)+c}else h=s,f=Math.max(0,-(a*h+o)),p=-f*f+h*(h+2*l)+c;else h=-s,f=Math.max(0,-(a*h+o)),p=-f*f+h*(h+2*l)+c;else h<=-m?(f=Math.max(0,-(-a*s+o)),h=f>0?-s:Math.min(Math.max(-s,-l),s),p=-f*f+h*(h+2*l)+c):h<=m?(f=0,h=Math.min(Math.max(-s,-l),s),p=h*(h+2*l)+c):(f=Math.max(0,-(a*s+o)),h=f>0?s:Math.min(Math.max(-s,-l),s),p=-f*f+h*(h+2*l)+c);else h=a>0?-s:s,f=Math.max(0,-(a*h+o)),p=-f*f+h*(h+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),r&&r.copy(Wl).addScaledVector(ka,h),p}intersectSphere(e,t){Gi.subVectors(e.center,this.origin);const i=Gi.dot(this.direction),r=Gi.dot(Gi)-i*i,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,a,o,l;const c=1/this.direction.x,d=1/this.direction.y,f=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),d>=0?(s=(e.min.y-h.y)*d,a=(e.max.y-h.y)*d):(s=(e.max.y-h.y)*d,a=(e.min.y-h.y)*d),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a<r||isNaN(r))&&(r=a),f>=0?(o=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(o=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),i>l||o>r)||((o>i||i!==i)&&(i=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Gi)!==null}intersectTriangle(e,t,i,r,s){Xl.subVectors(t,e),Va.subVectors(i,e),jl.crossVectors(Xl,Va);let a=this.direction.dot(jl),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;ir.subVectors(this.origin,e);const l=o*this.direction.dot(Va.crossVectors(ir,Va));if(l<0)return null;const c=o*this.direction.dot(Xl.cross(ir));if(c<0||l+c>a)return null;const d=-o*ir.dot(jl);return d<0?null:this.at(d/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class yd extends yi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Xn,this.combine=em,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Nh=new Lt,xr=new ba,Ha=new Ur,Uh=new X,Ga=new X,Wa=new X,Xa=new X,ql=new X,ja=new X,Fh=new X,qa=new X;class an extends rn{constructor(e=new on,t=new yd){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,a=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){ja.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const d=o[l],f=s[l];d!==0&&(ql.fromBufferAttribute(f,e),a?ja.addScaledVector(ql,d):ja.addScaledVector(ql.sub(t),d))}t.add(ja)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Ha.copy(i.boundingSphere),Ha.applyMatrix4(s),xr.copy(e.ray).recast(e.near),!(Ha.containsPoint(xr.origin)===!1&&(xr.intersectSphere(Ha,Uh)===null||xr.origin.distanceToSquared(Uh)>(e.far-e.near)**2))&&(Nh.copy(s).invert(),xr.copy(e.ray).applyMatrix4(Nh),!(i.boundingBox!==null&&xr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,xr)))}_computeIntersections(e,t,i){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,d=s.attributes.uv1,f=s.attributes.normal,h=s.groups,p=s.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,x=h.length;m<x;m++){const g=h[m],v=a[g.materialIndex],y=Math.max(g.start,p.start),w=Math.min(o.count,Math.min(g.start+g.count,p.start+p.count));for(let b=y,E=w;b<E;b+=3){const S=o.getX(b),A=o.getX(b+1),_=o.getX(b+2);r=Ya(this,v,e,i,c,d,f,S,A,_),r&&(r.faceIndex=Math.floor(b/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const m=Math.max(0,p.start),x=Math.min(o.count,p.start+p.count);for(let g=m,v=x;g<v;g+=3){const y=o.getX(g),w=o.getX(g+1),b=o.getX(g+2);r=Ya(this,a,e,i,c,d,f,y,w,b),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,x=h.length;m<x;m++){const g=h[m],v=a[g.materialIndex],y=Math.max(g.start,p.start),w=Math.min(l.count,Math.min(g.start+g.count,p.start+p.count));for(let b=y,E=w;b<E;b+=3){const S=b,A=b+1,_=b+2;r=Ya(this,v,e,i,c,d,f,S,A,_),r&&(r.faceIndex=Math.floor(b/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const m=Math.max(0,p.start),x=Math.min(l.count,p.start+p.count);for(let g=m,v=x;g<v;g+=3){const y=g,w=g+1,b=g+2;r=Ya(this,a,e,i,c,d,f,y,w,b),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}}}function ib(n,e,t,i,r,s,a,o){let l;if(e.side===Yn?l=i.intersectTriangle(a,s,r,!0,o):l=i.intersectTriangle(r,s,a,e.side===Kn,o),l===null)return null;qa.copy(o),qa.applyMatrix4(n.matrixWorld);const c=t.ray.origin.distanceTo(qa);return c<t.near||c>t.far?null:{distance:c,point:qa.clone(),object:n}}function Ya(n,e,t,i,r,s,a,o,l,c){n.getVertexPosition(o,Ga),n.getVertexPosition(l,Wa),n.getVertexPosition(c,Xa);const d=ib(n,e,t,i,Ga,Wa,Xa,Fh);if(d){const f=new X;ei.getBarycoord(Fh,Ga,Wa,Xa,f),r&&(d.uv=ei.getInterpolatedAttribute(r,o,l,c,f,new it)),s&&(d.uv1=ei.getInterpolatedAttribute(s,o,l,c,f,new it)),a&&(d.normal=ei.getInterpolatedAttribute(a,o,l,c,f,new X),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const h={a:o,b:l,c,normal:new X,materialIndex:0};ei.getNormal(Ga,Wa,Xa,h.normal),d.face=h,d.barycoord=f}return d}class cl extends En{constructor(e=null,t=1,i=1,r,s,a,o,l,c=xn,d=xn,f,h){super(null,a,o,l,c,d,r,s,f,h),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Yl=new X,rb=new X,sb=new xt;class sr{constructor(e=new X(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=Yl.subVectors(i,t).cross(rb.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,i=!0){const r=e.delta(Yl),s=this.normal.dot(r);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/s;return i===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||sb.getNormalMatrix(e),r=this.coplanarPoint(Yl).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const br=new Ur,ab=new it(.5,.5),Ka=new X;class Sd{constructor(e=new sr,t=new sr,i=new sr,r=new sr,s=new sr,a=new sr){this.planes=[e,t,i,r,s,a]}set(e,t,i,r,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Ni,i=!1){const r=this.planes,s=e.elements,a=s[0],o=s[1],l=s[2],c=s[3],d=s[4],f=s[5],h=s[6],p=s[7],m=s[8],x=s[9],g=s[10],v=s[11],y=s[12],w=s[13],b=s[14],E=s[15];if(r[0].setComponents(c-a,p-d,v-m,E-y).normalize(),r[1].setComponents(c+a,p+d,v+m,E+y).normalize(),r[2].setComponents(c+o,p+f,v+x,E+w).normalize(),r[3].setComponents(c-o,p-f,v-x,E-w).normalize(),i)r[4].setComponents(l,h,g,b).normalize(),r[5].setComponents(c-l,p-h,v-g,E-b).normalize();else if(r[4].setComponents(c-l,p-h,v-g,E-b).normalize(),t===Ni)r[5].setComponents(c+l,p+h,v+g,E+b).normalize();else if(t===la)r[5].setComponents(l,h,g,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),br.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),br.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(br)}intersectsSprite(e){br.center.set(0,0,0);const t=ab.distanceTo(e.center);return br.radius=.7071067811865476+t,br.applyMatrix4(e.matrixWorld),this.intersectsSphere(br)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(Ka.x=r.normal.x>0?e.max.x:e.min.x,Ka.y=r.normal.y>0?e.max.y:e.min.y,Ka.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Ka)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class ob extends yi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new tt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const qo=new X,Yo=new X,Oh=new Lt,Gs=new ba,Za=new Ur,Kl=new X,zh=new X;class lb extends rn{constructor(e=new on,t=new ob){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)qo.fromBufferAttribute(t,r-1),Yo.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=qo.distanceTo(Yo);e.setAttribute("lineDistance",new sn(i,1))}else ft("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,a=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Za.copy(i.boundingSphere),Za.applyMatrix4(r),Za.radius+=s,e.ray.intersectsSphere(Za)===!1)return;Oh.copy(r).invert(),Gs.copy(e.ray).applyMatrix4(Oh);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,d=i.index,h=i.attributes.position;if(d!==null){const p=Math.max(0,a.start),m=Math.min(d.count,a.start+a.count);for(let x=p,g=m-1;x<g;x+=c){const v=d.getX(x),y=d.getX(x+1),w=$a(this,e,Gs,l,v,y,x);w&&t.push(w)}if(this.isLineLoop){const x=d.getX(m-1),g=d.getX(p),v=$a(this,e,Gs,l,x,g,m-1);v&&t.push(v)}}else{const p=Math.max(0,a.start),m=Math.min(h.count,a.start+a.count);for(let x=p,g=m-1;x<g;x+=c){const v=$a(this,e,Gs,l,x,x+1,x);v&&t.push(v)}if(this.isLineLoop){const x=$a(this,e,Gs,l,m-1,p,m-1);x&&t.push(x)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function $a(n,e,t,i,r,s,a){const o=n.geometry.attributes.position;if(qo.fromBufferAttribute(o,r),Yo.fromBufferAttribute(o,s),t.distanceSqToSegment(qo,Yo,Kl,zh)>i)return;Kl.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(Kl);if(!(c<e.near||c>e.far))return{distance:c,point:zh.clone().applyMatrix4(n.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:n}}class Ko extends yi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new tt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Bh=new Lt,lu=new ba,Ja=new Ur,Qa=new X;class Zo extends rn{constructor(e=new on,t=new Ko){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,a=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ja.copy(i.boundingSphere),Ja.applyMatrix4(r),Ja.radius+=s,e.ray.intersectsSphere(Ja)===!1)return;Bh.copy(r).invert(),lu.copy(e.ray).applyMatrix4(Bh);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=i.index,f=i.attributes.position;if(c!==null){const h=Math.max(0,a.start),p=Math.min(c.count,a.start+a.count);for(let m=h,x=p;m<x;m++){const g=c.getX(m);Qa.fromBufferAttribute(f,g),kh(Qa,g,l,r,e,t,this)}}else{const h=Math.max(0,a.start),p=Math.min(f.count,a.start+a.count);for(let m=h,x=p;m<x;m++)Qa.fromBufferAttribute(f,m),kh(Qa,m,l,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function kh(n,e,t,i,r,s,a){const o=lu.distanceSqToPoint(n);if(o<t){const l=new X;lu.closestPointToPoint(n,l),l.applyMatrix4(i);const c=r.ray.origin.distanceTo(l);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class _m extends En{constructor(e=[],t=Dr,i,r,s,a,o,l,c,d){super(e,t,i,r,s,a,o,l,c,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class cb extends En{constructor(e,t,i,r,s,a,o,l,c){super(e,t,i,r,s,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Nr extends En{constructor(e,t,i=Oi,r,s,a,o=xn,l=xn,c,d=Yi,f=1){if(d!==Yi&&d!==cr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const h={width:e,height:t,depth:f};super(h,r,s,a,o,l,d,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new xd(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class ub extends Nr{constructor(e,t=Oi,i=Dr,r,s,a=xn,o=xn,l,c=Yi){const d={width:e,height:e,depth:1},f=[d,d,d,d,d,d];super(e,e,t,i,r,s,a,o,l,c),this.image=f,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class xm extends En{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class ya extends on{constructor(e=1,t=1,i=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],d=[],f=[];let h=0,p=0;m("z","y","x",-1,-1,i,t,e,a,s,0),m("z","y","x",1,-1,i,t,-e,a,s,1),m("x","z","y",1,1,e,i,t,r,a,2),m("x","z","y",1,-1,e,i,-t,r,a,3),m("x","y","z",1,-1,e,t,i,r,s,4),m("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new sn(c,3)),this.setAttribute("normal",new sn(d,3)),this.setAttribute("uv",new sn(f,2));function m(x,g,v,y,w,b,E,S,A,_,T){const D=b/A,L=E/_,F=b/2,k=E/2,U=S/2,I=A+1,R=_+1;let z=0,q=0;const Y=new X;for(let te=0;te<R;te++){const le=te*L-k;for(let B=0;B<I;B++){const J=B*D-F;Y[x]=J*y,Y[g]=le*w,Y[v]=U,c.push(Y.x,Y.y,Y.z),Y[x]=0,Y[g]=0,Y[v]=S>0?1:-1,d.push(Y.x,Y.y,Y.z),f.push(B/A),f.push(1-te/_),z+=1}}for(let te=0;te<_;te++)for(let le=0;le<A;le++){const B=h+le+I*te,J=h+le+I*(te+1),de=h+(le+1)+I*(te+1),he=h+(le+1)+I*te;l.push(B,J,he),l.push(J,de,he),q+=6}o.addGroup(p,q,T),p+=q,h+=z}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ya(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class Md extends on{constructor(e=1,t=1,i=1,r=32,s=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:a,thetaStart:o,thetaLength:l};const c=this;r=Math.floor(r),s=Math.floor(s);const d=[],f=[],h=[],p=[];let m=0;const x=[],g=i/2;let v=0;y(),a===!1&&(e>0&&w(!0),t>0&&w(!1)),this.setIndex(d),this.setAttribute("position",new sn(f,3)),this.setAttribute("normal",new sn(h,3)),this.setAttribute("uv",new sn(p,2));function y(){const b=new X,E=new X;let S=0;const A=(t-e)/i;for(let _=0;_<=s;_++){const T=[],D=_/s,L=D*(t-e)+e;for(let F=0;F<=r;F++){const k=F/r,U=k*l+o,I=Math.sin(U),R=Math.cos(U);E.x=L*I,E.y=-D*i+g,E.z=L*R,f.push(E.x,E.y,E.z),b.set(I,A,R).normalize(),h.push(b.x,b.y,b.z),p.push(k,1-D),T.push(m++)}x.push(T)}for(let _=0;_<r;_++)for(let T=0;T<s;T++){const D=x[T][_],L=x[T+1][_],F=x[T+1][_+1],k=x[T][_+1];(e>0||T!==0)&&(d.push(D,L,k),S+=3),(t>0||T!==s-1)&&(d.push(L,F,k),S+=3)}c.addGroup(v,S,0),v+=S}function w(b){const E=m,S=new it,A=new X;let _=0;const T=b===!0?e:t,D=b===!0?1:-1;for(let F=1;F<=r;F++)f.push(0,g*D,0),h.push(0,D,0),p.push(.5,.5),m++;const L=m;for(let F=0;F<=r;F++){const U=F/r*l+o,I=Math.cos(U),R=Math.sin(U);A.x=T*R,A.y=g*D,A.z=T*I,f.push(A.x,A.y,A.z),h.push(0,D,0),S.x=I*.5+.5,S.y=R*.5*D+.5,p.push(S.x,S.y),m++}for(let F=0;F<r;F++){const k=E+F,U=L+F;b===!0?d.push(U,U+1,k):d.push(U+1,U,k),_+=3}c.addGroup(v,_,b===!0?1:2),v+=_}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Md(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}const eo=new X,to=new X,Zl=new X,no=new ei;class db extends on{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const r=Math.pow(10,4),s=Math.cos(ys*t),a=e.getIndex(),o=e.getAttribute("position"),l=a?a.count:o.count,c=[0,0,0],d=["a","b","c"],f=new Array(3),h={},p=[];for(let m=0;m<l;m+=3){a?(c[0]=a.getX(m),c[1]=a.getX(m+1),c[2]=a.getX(m+2)):(c[0]=m,c[1]=m+1,c[2]=m+2);const{a:x,b:g,c:v}=no;if(x.fromBufferAttribute(o,c[0]),g.fromBufferAttribute(o,c[1]),v.fromBufferAttribute(o,c[2]),no.getNormal(Zl),f[0]=`${Math.round(x.x*r)},${Math.round(x.y*r)},${Math.round(x.z*r)}`,f[1]=`${Math.round(g.x*r)},${Math.round(g.y*r)},${Math.round(g.z*r)}`,f[2]=`${Math.round(v.x*r)},${Math.round(v.y*r)},${Math.round(v.z*r)}`,!(f[0]===f[1]||f[1]===f[2]||f[2]===f[0]))for(let y=0;y<3;y++){const w=(y+1)%3,b=f[y],E=f[w],S=no[d[y]],A=no[d[w]],_=`${b}_${E}`,T=`${E}_${b}`;T in h&&h[T]?(Zl.dot(h[T].normal)<=s&&(p.push(S.x,S.y,S.z),p.push(A.x,A.y,A.z)),h[T]=null):_ in h||(h[_]={index0:c[y],index1:c[w],normal:Zl.clone()})}}for(const m in h)if(h[m]){const{index0:x,index1:g}=h[m];eo.fromBufferAttribute(o,x),to.fromBufferAttribute(o,g),p.push(eo.x,eo.y,eo.z),p.push(to.x,to.y,to.z)}this.setAttribute("position",new sn(p,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Ds extends on{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const s=e/2,a=t/2,o=Math.floor(i),l=Math.floor(r),c=o+1,d=l+1,f=e/o,h=t/l,p=[],m=[],x=[],g=[];for(let v=0;v<d;v++){const y=v*h-a;for(let w=0;w<c;w++){const b=w*f-s;m.push(b,-y,0),x.push(0,0,1),g.push(w/o),g.push(1-v/l)}}for(let v=0;v<l;v++)for(let y=0;y<o;y++){const w=y+c*v,b=y+c*(v+1),E=y+1+c*(v+1),S=y+1+c*v;p.push(w,b,S),p.push(b,E,S)}this.setIndex(p),this.setAttribute("position",new sn(m,3)),this.setAttribute("normal",new sn(x,3)),this.setAttribute("uv",new sn(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ds(e.width,e.height,e.widthSegments,e.heightSegments)}}class hb extends on{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],i=new Set,r=new X,s=new X;if(e.index!==null){const a=e.attributes.position,o=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let c=0,d=l.length;c<d;++c){const f=l[c],h=f.start,p=f.count;for(let m=h,x=h+p;m<x;m+=3)for(let g=0;g<3;g++){const v=o.getX(m+g),y=o.getX(m+(g+1)%3);r.fromBufferAttribute(a,v),s.fromBufferAttribute(a,y),Vh(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}}else{const a=e.attributes.position;for(let o=0,l=a.count/3;o<l;o++)for(let c=0;c<3;c++){const d=3*o+c,f=3*o+(c+1)%3;r.fromBufferAttribute(a,d),s.fromBufferAttribute(a,f),Vh(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new sn(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Vh(n,e,t){const i=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(i)===!0||t.has(r)===!0?!1:(t.add(i),t.add(r),!0)}function As(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];if(Hh(r))r.isRenderTargetTexture?(ft("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone();else if(Array.isArray(r))if(Hh(r[0])){const s=[];for(let a=0,o=r.length;a<o;a++)s[a]=r[a].clone();e[t][i]=s}else e[t][i]=r.slice();else e[t][i]=r}}return e}function zn(n){const e={};for(let t=0;t<n.length;t++){const i=As(n[t]);for(const r in i)e[r]=i[r]}return e}function Hh(n){return n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)}function fb(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function bm(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:At.workingColorSpace}const Di={clone:As,merge:zn};var pb=`void main() {
|
|
1
|
+
import{_ as gp}from"../chunks/BapAUJpM.js";import"../chunks/DsnmJJEf.js";import{b1 as Fg,bc as Og,bm as zg,P as Bg,O as Ms,Q as Cu,g as u,h as W,s as Fe,u as O,j as Pt,J as wn,p as st,f as ee,a as at,d as se,c as $,i as wt,r as j,aB as kg,t as Me,aj as Mr,n as yt,b as Ps,K as Vg,bn as vp,e as Hg,ax as th,bo as nh}from"../chunks/BtOVeLcI.js";import{o as dn,s as Ae,a as Xt,d as zi,k as Gg,e as Wg}from"../chunks/BNpXeuQ_.js";import{c as we,a as P,p as Tn,f as K,t as Et,d as Xg}from"../chunks/BoLtD6vo.js";import{i as xe}from"../chunks/DAQN5y4A.js";import{d as ma,u as Pu,o as jg,p as Nt,L as qg,l as Yg,a as us,D as mc,i as No,M as Kg,b as gc,f as _l,g as xl,A as Zg,U as $g}from"../chunks/r9bfnncm.js";import{S as Jg}from"../chunks/BRHPfB44.js";import{M as Qg,l as ev,m as tv,q as _p,r as nv,s as iv,t as rv,v as sv,w as av,x as ov,A as lv,o as cv,f as xp,u as uv,g as dv,y as hv,a as fv,k as pv}from"../chunks/SM988pE-.js";import{f as Ft,r as Ru,e as Zt,a as Qt,c as Dt,d as Uo,k as bp,l as bl,j as Ii,s as mv}from"../chunks/22C0ZkpD.js";import{s as mt,r as ut,p as oe,c as Ne,b as ui}from"../chunks/ChEZL1UP.js";import{p as ih}from"../chunks/C6SyTEsn.js";import{a as tl,o as yp}from"../chunks/C4cbQnXC.js";import{w as bo,F as rh}from"../chunks/aGXM-hZQ.js";import{b as Sp}from"../chunks/Bfsx6G_D.js";import{S as na}from"../chunks/CkeXmJE0.js";import{S as Fo}from"../chunks/BdIvVr5K.js";import{S as sh}from"../chunks/CitY1SZ1.js";import{C as Du}from"../chunks/Bj6y_fSA.js";import{I as fn,c as ci}from"../chunks/BuC_QZkR.js";import{X as gv}from"../chunks/Ca8xAcDY.js";import{R as wr,D as Er,b as dr,a as ms,c as gs}from"../chunks/jiMRToiE.js";import{s as pt}from"../chunks/8uBOzWQA.js";import{a as bi,e as Pr,h as Oo,x as vv,c as Lu,b as Vn,d as Qe,m as jt,s as vc,r as Iu,S as _v,y as xv}from"../chunks/Bf2Kb0d4.js";import{C as pr,w as fr,E as bv,S as yv,h as Mp,n as Un,d as wp,e as Ep,a as Tp,A as Ap,H as Cp,c as Pp,j as Rp}from"../chunks/MGblXd4C.js";import{i as Sv,H as Mv,F as Dp,P as Lp,c as Ip,g as zo,d as Np,o as Up,R as wv,S as Ev,a as Tv,b as Av}from"../chunks/DNdxyuBP.js";import{C as ia}from"../chunks/LZnjyP_x.js";import{B as Bn}from"../chunks/mlApEF2J.js";import{P as Cv,F as ah,D as yl,U as oh}from"../chunks/CFq1UfS7.js";import{h as Pv}from"../chunks/ClDgNAKE.js";import{T as Rv,a as Dv,b as Lv,d as Iv,c as Nv}from"../chunks/BVUbFuzT.js";import{C as Fp,a as vs}from"../chunks/BawNisij.js";import{C as Op}from"../chunks/Mn4D08zE.js";import{T as yo}from"../chunks/DllGpGf3.js";import{C as Uv,a as Fv}from"../chunks/CY6l1SkO.js";import{C as Ov}from"../chunks/C2PlvXZq.js";import{C as zv}from"../chunks/C0Xb3vka.js";import{L as or}from"../chunks/wegQDfR0.js";import{a as Bv}from"../chunks/iMhxXFaA.js";import{I as _s}from"../chunks/CJvX1bCR.js";import{M as kv,C as Vv,I as Hv}from"../chunks/C38beKZN.js";import{t as Gv}from"../chunks/ADO9qhNc.js";import{F as Wv}from"../chunks/k1GnUs7f.js";import{r as Xv}from"../chunks/Cbu9Tg11.js";import{C as jv}from"../chunks/3w4Rd2x8.js";import{inflateSync as qv}from"../chunks/BzBbrBKd.js";const Yv=[];function Nu(n,e=!1,t=!1){return So(n,new Map,"",Yv,null,t)}function So(n,e,t,i,r=null,s=!1){if(typeof n=="object"&&n!==null){var a=e.get(n);if(a!==void 0)return a;if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);if(Fg(n)){var o=Array(n.length);e.set(n,o),r!==null&&e.set(r,o);for(var l=0;l<n.length;l+=1){var c=n[l];l in n&&(o[l]=So(c,e,t,i,null,s))}return o}if(Og(n)===zg){o={},e.set(n,o),r!==null&&e.set(r,o);for(var d of Object.keys(n))o[d]=So(n[d],e,t,i,null,s);return o}if(n instanceof Date)return structuredClone(n);if(typeof n.toJSON=="function"&&!s)return So(n.toJSON(),e,t,i,n)}if(n instanceof EventTarget)return n;try{return structuredClone(n)}catch{return n}}class Kv{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return Bg(this.#t)}get(){const e=Ms(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=Ms(this.#t);return t===void 0?e:t}set(e){return Cu(this.#t,e)}}function lh(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]];fn(n,mt({name:"box"},()=>t,{get iconNode(){return i}}))}function Zv(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"}],["circle",{cx:"12",cy:"13",r:"3"}]];fn(n,mt({name:"camera"},()=>t,{get iconNode(){return i}}))}function $v(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}],["path",{d:"m9 11 3 3L22 4"}]];fn(n,mt({name:"circle-check-big"},()=>t,{get iconNode(){return i}}))}function ch(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]];fn(n,mt({name:"circle-question-mark"},()=>t,{get iconNode(){return i}}))}function zp(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];fn(n,mt({name:"download"},()=>t,{get iconNode(){return i}}))}function Sl(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}],["path",{d:"m2 2 20 20"}]];fn(n,mt({name:"eye-off"},()=>t,{get iconNode(){return i}}))}function Ml(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];fn(n,mt({name:"eye"},()=>t,{get iconNode(){return i}}))}function Jv(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}]];fn(n,mt({name:"file"},()=>t,{get iconNode(){return i}}))}function Qv(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}]];fn(n,mt({name:"folder"},()=>t,{get iconNode(){return i}}))}function e0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["line",{x1:"22",x2:"2",y1:"6",y2:"6"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22"}]];fn(n,mt({name:"frame"},()=>t,{get iconNode(){return i}}))}function t0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M3 9h18"}],["path",{d:"M3 15h18"}],["path",{d:"M9 3v18"}],["path",{d:"M15 3v18"}]];fn(n,mt({name:"grid-3x3"},()=>t,{get iconNode(){return i}}))}function n0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}]];fn(n,mt({name:"inbox"},()=>t,{get iconNode(){return i}}))}function i0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"}]];fn(n,mt({name:"layers"},()=>t,{get iconNode(){return i}}))}function r0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];fn(n,mt({name:"link"},()=>t,{get iconNode(){return i}}))}function Uu(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12 2v4"}],["path",{d:"m16.2 7.8 2.9-2.9"}],["path",{d:"M18 12h4"}],["path",{d:"m16.2 16.2 2.9 2.9"}],["path",{d:"M12 18v4"}],["path",{d:"m4.9 19.1 2.9-2.9"}],["path",{d:"M2 12h4"}],["path",{d:"m4.9 4.9 2.9 2.9"}]];fn(n,mt({name:"loader"},()=>t,{get iconNode(){return i}}))}function Fu(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"}]];fn(n,mt({name:"maximize"},()=>t,{get iconNode(){return i}}))}function Ou(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"}]];fn(n,mt({name:"minimize"},()=>t,{get iconNode(){return i}}))}function s0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z"}],["path",{d:"m14.5 12.5 2-2"}],["path",{d:"m11.5 9.5 2-2"}],["path",{d:"m8.5 6.5 2-2"}],["path",{d:"m17.5 15.5 2-2"}]];fn(n,mt({name:"ruler"},()=>t,{get iconNode(){return i}}))}function a0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M14 17H5"}],["path",{d:"M19 7h-9"}],["circle",{cx:"17",cy:"17",r:"3"}],["circle",{cx:"7",cy:"7",r:"3"}]];fn(n,mt({name:"settings-2"},()=>t,{get iconNode(){return i}}))}function o0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}]];fn(n,mt({name:"square"},()=>t,{get iconNode(){return i}}))}function l0(n,e){let t=ut(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];fn(n,mt({name:"zap"},()=>t,{get iconNode(){return i}}))}function c0(n,e){if(Sv(n)){const i=n();return i===void 0?e:i}return n===void 0?e:n}function nl(n,e){let t=Fe(null);const i=O(()=>c0(e,250));function r(...s){if(u(t))u(t).timeout&&clearTimeout(u(t).timeout);else{let a,o;const l=new Promise((c,d)=>{a=c,o=d});W(t,{timeout:null,runner:null,promise:l,resolve:a,reject:o},!0)}return u(t).runner=async()=>{if(!u(t))return;const a=u(t);W(t,null);try{a.resolve(await n.apply(this,s))}catch(o){a.reject(o)}},u(t).timeout=setTimeout(u(t).runner,u(i)),u(t).promise}return r.cancel=async()=>{(!u(t)||u(t).timeout===null)&&(await new Promise(s=>setTimeout(s,0)),!u(t)||u(t).timeout===null)||(clearTimeout(u(t).timeout),u(t).reject("Cancelled"),W(t,null))},r.runScheduledNow=async()=>{(!u(t)||!u(t).timeout)&&(await new Promise(s=>setTimeout(s,0)),!u(t)||!u(t).timeout)||(clearTimeout(u(t).timeout),u(t).timeout=null,await u(t).runner?.())},Object.defineProperty(r,"pending",{enumerable:!0,get(){return!!u(t)?.timeout}}),r}class zu{#e=Fe(!1);constructor(){Pt(()=>(wn(()=>W(this.#e,!0)),()=>{W(this.#e,!1)}))}get current(){return u(this.#e)}}const u0=Lu({component:"checkbox",parts:["root","group","group-label","input"]}),d0=new pr("Checkbox.Group"),Bp=new pr("Checkbox.Root");class Bu{static create(e,t=null){return Bp.set(new Bu(e,t))}opts;group;#e=O(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.opts.name.current);get trueName(){return u(this.#e)}set trueName(e){W(this.#e,e)}#t=O(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return u(this.#t)}set trueRequired(e){W(this.#t,e)}#n=O(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return u(this.#n)}set trueDisabled(e){W(this.#n,e)}#i=O(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return u(this.#i)}set trueReadonly(e){W(this.#i,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=bi(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),fr.pre([()=>Nu(this.group?.opts.value.current),()=>this.opts.value.current],([i,r])=>{!i||!r||(this.opts.checked.current=i.includes(r))}),fr.pre(()=>this.opts.checked.current,i=>{this.group&&(i?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===bv){e.preventDefault(),this.opts.type.current==="submit"&&e.currentTarget.closest("form")?.requestSubmit();return}e.key===yv&&(e.preventDefault(),this.#r())}}#r(){this.opts.indeterminate.current?(this.opts.indeterminate.current=!1,this.opts.checked.current=!0):this.opts.checked.current=!this.opts.checked.current}onclick(e){if(!(this.trueDisabled||this.trueReadonly)){if(this.opts.type.current==="submit"){this.#r();return}e.preventDefault(),this.#r()}}#s=O(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return u(this.#s)}set snippetProps(e){W(this.#s,e)}#a=O(()=>({id:this.opts.id.current,role:"checkbox",type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":vv(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":Oo(this.trueRequired),"aria-readonly":Oo(this.trueReadonly),"data-disabled":Pr(this.trueDisabled),"data-readonly":Pr(this.trueReadonly),"data-state":h0(this.opts.checked.current,this.opts.indeterminate.current),[u0.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return u(this.#a)}set props(e){W(this.#a,e)}}class ku{static create(){return new ku(Bp.get())}root;#e=O(()=>this.root.group?!!(this.root.opts.value.current!==void 0&&this.root.group.opts.value.current.includes(this.root.opts.value.current)):this.root.opts.checked.current);get trueChecked(){return u(this.#e)}set trueChecked(e){W(this.#e,e)}#t=O(()=>!!this.root.trueName);get shouldRender(){return u(this.#t)}set shouldRender(e){W(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){Mp(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=O(()=>({type:"checkbox",checked:this.root.opts.checked.current===!0,disabled:this.root.trueDisabled,required:this.root.trueRequired,name:this.root.trueName,value:this.root.opts.value.current,readonly:this.root.trueReadonly,onfocus:this.onfocus}));get props(){return u(this.#n)}set props(e){W(this.#n,e)}}function h0(n,e){return e?"indeterminate":n?"checked":"unchecked"}function f0(n,e){st(e,!0);const t=ku.create();var i=we(),r=ee(i);{var s=a=>{Mv(a,mt(()=>t.props))};xe(r,a=>{t.shouldRender&&a(s)})}P(n,i),at()}var p0=K("<button><!></button>"),m0=K("<!> <!>",1);function g0(n,e){const t=Tn();st(e,!0);let i=oe(e,"checked",15,!1),r=oe(e,"ref",15,null),s=oe(e,"disabled",3,!1),a=oe(e,"required",3,!1),o=oe(e,"name",3,void 0),l=oe(e,"value",3,"on"),c=oe(e,"id",19,()=>Vn(t)),d=oe(e,"indeterminate",15,!1),f=oe(e,"type",3,"button"),h=ut(e,["$$slots","$$events","$$legacy","checked","ref","onCheckedChange","children","disabled","required","name","value","id","indeterminate","onIndeterminateChange","child","type","readonly"]);const p=d0.getOr(null);p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1)),fr.pre(()=>l(),()=>{p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1))});const m=Bu.create({checked:Qe(()=>i(),E=>{i(E),e.onCheckedChange?.(E)}),disabled:Qe(()=>s()??!1),required:Qe(()=>a()),name:Qe(()=>o()),value:Qe(()=>l()),id:Qe(()=>c()),ref:Qe(()=>r(),E=>r(E)),indeterminate:Qe(()=>d(),E=>{d(E),e.onIndeterminateChange?.(E)}),type:Qe(()=>f()),readonly:Qe(()=>!!e.readonly)},p),x=O(()=>jt({...h},m.props));var g=m0(),v=ee(g);{var y=E=>{var S=we(),A=ee(S);{let _=O(()=>({props:u(x),...m.snippetProps}));pt(A,()=>e.child,()=>u(_))}P(E,S)},w=E=>{var S=p0();Ft(S,()=>({...u(x)}));var A=$(S);pt(A,()=>e.children??wt,()=>m.snippetProps),j(S),P(E,S)};xe(v,E=>{e.child?E(y):E(w,-1)})}var b=se(v,2);f0(b,{}),P(n,g),at()}function v0(n,e){st(e,!0);let t=oe(e,"open",15,!1),i=oe(e,"onOpenChange",3,Un),r=oe(e,"onOpenChangeComplete",3,Un);Qg.create({open:Qe(()=>t(),s=>{t(s),i()?.(s)}),onOpenChangeComplete:Qe(()=>r())}),Dp(n,{children:(s,a)=>{var o=we(),l=ee(o);pt(l,()=>e.children??wt),P(s,o)},$$slots:{default:!0}}),at()}var _0=K("<div><!></div>");function Ji(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=oe(e,"disabled",3,!1),a=oe(e,"onSelect",3,Un),o=oe(e,"closeOnSelect",3,!0),l=ut(e,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const c=ev.create({id:Qe(()=>r()),disabled:Qe(()=>s()),onSelect:Qe(()=>a()),ref:Qe(()=>i(),x=>i(x)),closeOnSelect:Qe(()=>o())}),d=O(()=>jt(l,c.props));var f=we(),h=ee(f);{var p=x=>{var g=we(),v=ee(g);pt(v,()=>e.child,()=>({props:u(d)})),P(x,g)},m=x=>{var g=_0();Ft(g,()=>({...u(d)}));var v=$(g);pt(v,()=>e.children??wt),j(g),P(x,g)};xe(h,x=>{e.child?x(p):x(m,-1)})}P(n,f),at()}var x0=K("<div><!></div>");function b0(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=ut(e,["$$slots","$$events","$$legacy","ref","id","child","children"]);const a=tv.create({id:Qe(()=>r()),ref:Qe(()=>i(),h=>i(h))}),o=O(()=>jt(s,a.props));var l=we(),c=ee(l);{var d=h=>{var p=we(),m=ee(p);pt(m,()=>e.child,()=>({props:u(o)})),P(h,p)},f=h=>{var p=x0();Ft(p,()=>({...u(o)}));var m=$(p);pt(m,()=>e.children??wt),j(p),P(h,p)};xe(c,h=>{e.child?h(d):h(f,-1)})}P(n,l),at()}var y0=K("<div><div><!></div></div>"),S0=K("<div><div><!></div></div>");function M0(n,e){const t=Tn();st(e,!0);let i=oe(e,"id",19,()=>Vn(t)),r=oe(e,"ref",15,null),s=oe(e,"loop",3,!0),a=oe(e,"onInteractOutside",3,Un),o=oe(e,"forceMount",3,!1),l=oe(e,"onEscapeKeydown",3,Un),c=oe(e,"interactOutsideBehavior",3,"defer-otherwise-close"),d=oe(e,"escapeKeydownBehavior",3,"defer-otherwise-close"),f=oe(e,"onOpenAutoFocus",3,Un),h=oe(e,"onCloseAutoFocus",3,Un),p=oe(e,"onFocusOutside",3,Un),m=oe(e,"side",3,"right"),x=oe(e,"trapFocus",3,!1),g=ut(e,["$$slots","$$events","$$legacy","id","ref","children","child","loop","onInteractOutside","forceMount","onEscapeKeydown","interactOutsideBehavior","escapeKeydownBehavior","onOpenAutoFocus","onCloseAutoFocus","onFocusOutside","side","trapFocus","style"]);const v=_p.create({id:Qe(()=>i()),loop:Qe(()=>s()),ref:Qe(()=>r(),U=>r(U)),isSub:!0,onCloseAutoFocus:Qe(()=>S)});function y(U){const I=U.currentTarget.contains(U.target),R=iv[v.parentMenu.root.opts.dir.current].includes(U.key);I&&R&&(v.parentMenu.onClose(),v.parentMenu.triggerNode?.focus(),U.preventDefault())}const w=O(()=>v.parentMenu.root.getBitsAttr("sub-content")),b=O(()=>jt(g,v.props,{side:m(),onkeydown:y,[u(w)]:""}));function E(U){f()(U),!U.defaultPrevented&&(U.preventDefault(),v.parentMenu.root.isUsingKeyboard&&v.parentMenu.contentNode&&nv.dispatch(v.parentMenu.contentNode))}function S(U){h()(U),!U.defaultPrevented&&U.preventDefault()}function A(U){a()(U),!U.defaultPrevented&&v.parentMenu.onClose()}function _(U){l()(U),!U.defaultPrevented&&v.parentMenu.onClose()}function T(U){if(p()(U),U.defaultPrevented||!Mp(U.target)||U.target.id===v.parentMenu.triggerNode?.id)return;if(v.parentMenu.parentMenu?.contentNode?.contains(U.target)){v.parentMenu.onClose(),U.preventDefault();return}const R=`[${v.parentMenu.root.getBitsAttr("sub-content")}]`;if(U.target.closest(R)){U.preventDefault();return}v.parentMenu.onClose()}var D=we(),L=ee(D);{var F=U=>{Lp(U,mt(()=>u(b),{get ref(){return v.opts.ref},get interactOutsideBehavior(){return c()},get escapeKeydownBehavior(){return d()},onOpenAutoFocus:E,get enabled(){return v.parentMenu.opts.open.current},onInteractOutside:A,onEscapeKeydown:_,onFocusOutside:T,preventScroll:!1,get loop(){return s()},get trapFocus(){return x()},get shouldRender(){return v.shouldRender},popper:(R,z)=>{let q=()=>(z?.()).props,Y=()=>(z?.()).wrapperProps;const te=O(()=>jt(q(),u(b),{style:zo("menu")},{style:e.style}));var le=we(),B=ee(le);{var J=he=>{var G=we(),ie=ee(G);{let Z=O(()=>({props:u(te),wrapperProps:Y(),...v.snippetProps}));pt(ie,()=>e.child,()=>u(Z))}P(he,G)},de=he=>{var G=y0();Ft(G,()=>({...Y()}));var ie=$(G);Ft(ie,()=>({...u(te)}));var Z=$(ie);pt(Z,()=>e.children??wt),j(ie),j(G),P(he,G)};xe(B,he=>{e.child?he(J):he(de,-1)})}P(R,le)},$$slots:{popper:!0}}))},k=U=>{Ip(U,mt(()=>u(b),{get ref(){return v.opts.ref},get interactOutsideBehavior(){return c()},get escapeKeydownBehavior(){return d()},onCloseAutoFocus:S,onOpenAutoFocus:E,get open(){return v.parentMenu.opts.open.current},onInteractOutside:A,onEscapeKeydown:_,onFocusOutside:T,preventScroll:!1,get loop(){return s()},get trapFocus(){return x()},get shouldRender(){return v.shouldRender},popper:(R,z)=>{let q=()=>(z?.()).props,Y=()=>(z?.()).wrapperProps;const te=O(()=>jt(q(),u(b),{style:zo("menu")},{style:e.style}));var le=we(),B=ee(le);{var J=he=>{var G=we(),ie=ee(G);{let Z=O(()=>({props:u(te),wrapperProps:Y(),...v.snippetProps}));pt(ie,()=>e.child,()=>u(Z))}P(he,G)},de=he=>{var G=S0();Ft(G,()=>({...Y()}));var ie=$(G);Ft(ie,()=>({...u(te)}));var Z=$(ie);pt(Z,()=>e.children??wt),j(ie),j(G),P(he,G)};xe(B,he=>{e.child?he(J):he(de,-1)})}P(R,le)},$$slots:{popper:!0}}))};xe(L,U=>{o()?U(F):o()||U(k,1)})}P(n,D),at()}var w0=K("<div><!></div>");function E0(n,e){const t=Tn();st(e,!0);let i=oe(e,"id",19,()=>Vn(t)),r=oe(e,"disabled",3,!1),s=oe(e,"ref",15,null),a=oe(e,"onSelect",3,Un),o=oe(e,"openDelay",3,0),l=ut(e,["$$slots","$$events","$$legacy","id","disabled","ref","children","child","onSelect","openDelay"]);const c=rv.create({disabled:Qe(()=>r()),onSelect:Qe(()=>a()),id:Qe(()=>i()),ref:Qe(()=>s(),f=>s(f)),openDelay:Qe(()=>o())}),d=O(()=>jt(l,c.props));Np(n,{get id(){return i()},get ref(){return c.opts.ref},children:(f,h)=>{var p=we(),m=ee(p);{var x=v=>{var y=we(),w=ee(y);pt(w,()=>e.child,()=>({props:u(d)})),P(v,y)},g=v=>{var y=w0();Ft(y,()=>({...u(d)}));var w=$(y);pt(w,()=>e.children??wt),j(y),P(v,y)};xe(m,v=>{e.child?v(x):v(g,-1)})}P(f,p)},$$slots:{default:!0}}),at()}function T0(n,e){st(e,!0);let t=oe(e,"open",15,!1),i=oe(e,"dir",3,"ltr"),r=oe(e,"onOpenChange",3,Un),s=oe(e,"onOpenChangeComplete",3,Un),a=oe(e,"_internal_variant",3,"dropdown-menu"),o=oe(e,"_internal_should_skip_exit_animation",3,void 0);const l=sv.create({variant:Qe(()=>a()),dir:Qe(()=>i()),onClose:()=>{t(!1),r()(!1)},shouldSkipExitAnimation:()=>o()?.()??!1});av.create({open:Qe(()=>t(),c=>{t(c),r()(c)}),onOpenChangeComplete:Qe(()=>s())},l),Dp(n,{children:(c,d)=>{var f=we(),h=ee(f);pt(h,()=>e.children??wt),P(c,f)},$$slots:{default:!0}}),at()}var A0=K("<div><div><!></div></div>"),C0=K("<div><div><!></div></div>");function P0(n,e){const t=Tn();st(e,!0);let i=oe(e,"id",19,()=>Vn(t)),r=oe(e,"ref",15,null),s=oe(e,"loop",3,!0),a=oe(e,"onInteractOutside",3,Un),o=oe(e,"onEscapeKeydown",3,Un),l=oe(e,"onCloseAutoFocus",3,Un),c=oe(e,"forceMount",3,!1),d=oe(e,"trapFocus",3,!1),f=ut(e,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const h=_p.create({id:Qe(()=>i()),loop:Qe(()=>s()),ref:Qe(()=>r(),b=>r(b)),onCloseAutoFocus:Qe(()=>l())}),p=O(()=>jt(f,h.props));function m(b){if(h.handleInteractOutside(b),!b.defaultPrevented&&(a()(b),!b.defaultPrevented)){if(b.target&&b.target instanceof Element){const E=`[${h.parentMenu.root.getBitsAttr("sub-content")}]`;if(b.target.closest(E))return}h.parentMenu.onClose()}}function x(b){o()(b),!b.defaultPrevented&&h.parentMenu.onClose()}var g=we(),v=ee(g);{var y=b=>{Lp(b,mt(()=>u(p),()=>h.popperProps,{get ref(){return h.opts.ref},get enabled(){return h.parentMenu.opts.open.current},onInteractOutside:m,onEscapeKeydown:x,get trapFocus(){return d()},get loop(){return s()},forceMount:!0,get id(){return i()},get shouldRender(){return h.shouldRender},popper:(S,A)=>{let _=()=>(A?.()).props,T=()=>(A?.()).wrapperProps;const D=O(()=>jt(_(),{style:zo("dropdown-menu")},{style:e.style}));var L=we(),F=ee(L);{var k=I=>{var R=we(),z=ee(R);{let q=O(()=>({props:u(D),wrapperProps:T(),...h.snippetProps}));pt(z,()=>e.child,()=>u(q))}P(I,R)},U=I=>{var R=A0();Ft(R,()=>({...T()}));var z=$(R);Ft(z,()=>({...u(D)}));var q=$(z);pt(q,()=>e.children??wt),j(z),j(R),P(I,R)};xe(F,I=>{e.child?I(k):I(U,-1)})}P(S,L)},$$slots:{popper:!0}}))},w=b=>{Ip(b,mt(()=>u(p),()=>h.popperProps,{get ref(){return h.opts.ref},get open(){return h.parentMenu.opts.open.current},onInteractOutside:m,onEscapeKeydown:x,get trapFocus(){return d()},get loop(){return s()},forceMount:!1,get id(){return i()},get shouldRender(){return h.shouldRender},popper:(S,A)=>{let _=()=>(A?.()).props,T=()=>(A?.()).wrapperProps;const D=O(()=>jt(_(),{style:zo("dropdown-menu")},{style:e.style}));var L=we(),F=ee(L);{var k=I=>{var R=we(),z=ee(R);{let q=O(()=>({props:u(D),wrapperProps:T(),...h.snippetProps}));pt(z,()=>e.child,()=>u(q))}P(I,R)},U=I=>{var R=C0();Ft(R,()=>({...T()}));var z=$(R);Ft(z,()=>({...u(D)}));var q=$(z);pt(q,()=>e.children??wt),j(z),j(R),P(I,R)};xe(F,I=>{e.child?I(k):I(U,-1)})}P(S,L)},$$slots:{popper:!0}}))};xe(v,b=>{c()?b(y):c()||b(w,1)})}P(n,g),at()}var R0=K("<button><!></button>");function D0(n,e){const t=Tn();st(e,!0);let i=oe(e,"id",19,()=>Vn(t)),r=oe(e,"ref",15,null),s=oe(e,"disabled",3,!1),a=oe(e,"type",3,"button"),o=ut(e,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const l=ov.create({id:Qe(()=>i()),disabled:Qe(()=>s()??!1),ref:Qe(()=>r(),d=>r(d))}),c=O(()=>jt(o,l.props,{type:a()}));Np(n,{get id(){return i()},get ref(){return l.opts.ref},children:(d,f)=>{var h=we(),p=ee(h);{var m=g=>{var v=we(),y=ee(v);pt(y,()=>e.child,()=>({props:u(c)})),P(g,v)},x=g=>{var v=R0();Ft(v,()=>({...u(c)}));var y=$(v);pt(y,()=>e.children??wt),j(v),P(g,v)};xe(p,g=>{e.child?g(m):g(x,-1)})}P(d,h)},$$slots:{default:!0}}),at()}class Rr{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),Pt(this.handler)}handler(){let e=0;const t=this.#e();if(!t)return;const i=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return i.observe(t),()=>{window.cancelAnimationFrame(e),i.unobserve(t)}}}class L0{opts;present;#e;#t=Fe(!1);#n=!1;#i=Fe(void 0);#r=null;constructor(e){this.opts=e,this.present=this.opts.open,W(this.#t,e.open.current,!0),this.#e=new lv({ref:this.opts.ref,afterTick:this.opts.open}),cv(()=>this.#a()),fr(()=>this.present.current,t=>{if(!this.#n){this.#n=!0;return}this.#a(),t&&W(this.#t,!0),W(this.#i,t?"starting":"ending",!0),t&&(this.#r=window.requestAnimationFrame(()=>{this.#r=null,this.present.current&&W(this.#i,void 0)})),this.#e.run(()=>{t===this.present.current&&(t||W(this.#t,!1),W(this.#i,void 0))})})}#s=O(()=>u(this.#t));get isPresent(){return u(this.#s)}set isPresent(e){W(this.#s,e)}get transitionStatus(){return u(this.#i)}#a(){this.#r!==null&&(window.cancelAnimationFrame(this.#r),this.#r=null)}}function il(n,e){st(e,!0);const t=new L0({open:Qe(()=>e.open),ref:e.ref});var i=we(),r=ee(i);{var s=a=>{var o=we(),l=ee(o);pt(l,()=>e.presence??wt,()=>({present:t.isPresent,transitionStatus:t.transitionStatus})),P(a,o)};xe(r,a=>{(e.forceMount||e.open||t.isPresent)&&a(s)})}P(n,i),at()}function I0(n,e,t){return Math.min(t,Math.max(e,n))}class N0{state;#e;constructor(e,t){this.state=vc(e),this.#e=t,this.dispatch=this.dispatch.bind(this)}#t(e){return this.#e[this.state.current][e]??this.state.current}dispatch(e){this.state.current=this.#t(e)}}const ga=Lu({component:"scroll-area",parts:["root","viewport","corner","thumb","scrollbar"]}),va=new pr("ScrollArea.Root"),_a=new pr("ScrollArea.Scrollbar"),rl=new pr("ScrollArea.ScrollbarVisible"),Vu=new pr("ScrollArea.ScrollbarAxis"),kp=new pr("ScrollArea.ScrollbarShared");class Hu{static create(e){return va.set(new Hu(e))}opts;attachment;#e=Fe(null);get scrollAreaNode(){return u(this.#e)}set scrollAreaNode(e){W(this.#e,e,!0)}#t=Fe(null);get viewportNode(){return u(this.#t)}set viewportNode(e){W(this.#t,e,!0)}#n=Fe(null);get contentNode(){return u(this.#n)}set contentNode(e){W(this.#n,e,!0)}#i=Fe(null);get scrollbarXNode(){return u(this.#i)}set scrollbarXNode(e){W(this.#i,e,!0)}#r=Fe(null);get scrollbarYNode(){return u(this.#r)}set scrollbarYNode(e){W(this.#r,e,!0)}#s=Fe(0);get cornerWidth(){return u(this.#s)}set cornerWidth(e){W(this.#s,e,!0)}#a=Fe(0);get cornerHeight(){return u(this.#a)}set cornerHeight(e){W(this.#a,e,!0)}#o=Fe(!1);get scrollbarXEnabled(){return u(this.#o)}set scrollbarXEnabled(e){W(this.#o,e,!0)}#l=Fe(!1);get scrollbarYEnabled(){return u(this.#l)}set scrollbarYEnabled(e){W(this.#l,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=bi(e.ref,t=>this.scrollAreaNode=t),this.domContext=new xp(e.ref)}#c=O(()=>({id:this.opts.id.current,dir:this.opts.dir.current,style:{position:"relative","--bits-scroll-area-corner-height":`${this.cornerHeight}px`,"--bits-scroll-area-corner-width":`${this.cornerWidth}px`},[ga.root]:"",...this.attachment}));get props(){return u(this.#c)}set props(e){W(this.#c,e)}}class Gu{static create(e){return new Gu(e,va.get())}opts;root;attachment;#e=vc(uv());#t=vc(null);contentAttachment=bi(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=bi(e.ref,i=>this.root.viewportNode=i)}#n=O(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?"scroll":"hidden",overflowY:this.root.scrollbarYEnabled?"scroll":"hidden"},[ga.viewport]:"",...this.attachment}));get props(){return u(this.#n)}set props(e){W(this.#n,e)}#i=O(()=>({id:this.#e.current,"data-scroll-area-content":"",style:{minWidth:this.root.scrollbarXEnabled?"fit-content":void 0},...this.contentAttachment}));get contentProps(){return u(this.#i)}set contentProps(e){W(this.#i,e)}}class Wu{static create(e){return _a.set(new Wu(e,va.get()))}opts;root;#e=O(()=>this.opts.orientation.current==="horizontal");get isHorizontal(){return u(this.#e)}set isHorizontal(e){W(this.#e,e)}#t=Fe(!1);get hasThumb(){return u(this.#t)}set hasThumb(e){W(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,fr(()=>this.isHorizontal,i=>i?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}}class Xu{static create(){return new Xu(_a.get())}scrollbar;root;#e=Fe(!1);get isVisible(){return u(this.#e)}set isVisible(e){W(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Pt(()=>{const t=this.root.scrollAreaNode,i=this.root.opts.scrollHideDelay.current;let r=0;if(!t)return;const s=()=>{this.root.domContext.clearTimeout(r),wn(()=>this.isVisible=!0)},a=()=>{r&&this.root.domContext.clearTimeout(r),r=this.root.domContext.setTimeout(()=>{wn(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},i)},o=Iu(dn(t,"pointerenter",s),dn(t,"pointerleave",a));return()=>{this.root.domContext.getWindow().clearTimeout(r),o()}})}#t=O(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return u(this.#t)}set props(e){W(this.#t,e)}}class ju{static create(){return new ju(_a.get())}scrollbar;root;machine=new N0("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});#e=O(()=>this.machine.state.current==="hidden");get isHidden(){return u(this.#e)}set isHidden(e){W(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;const t=nl(()=>this.machine.dispatch("SCROLL_END"),100);Pt(()=>{const i=this.machine.state.current,r=this.root.opts.scrollHideDelay.current;if(i==="idle"){const s=this.root.domContext.setTimeout(()=>this.machine.dispatch("HIDE"),r);return()=>this.root.domContext.clearTimeout(s)}}),Pt(()=>{const i=this.root.viewportNode;if(!i)return;const r=this.scrollbar.isHorizontal?"scrollLeft":"scrollTop";let s=i[r];return dn(i,"scroll",()=>{const l=i[r];s!==l&&(this.machine.dispatch("SCROLL"),t()),s=l})}),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}onpointerenter(e){this.machine.dispatch("POINTER_ENTER")}onpointerleave(e){this.machine.dispatch("POINTER_LEAVE")}#t=O(()=>({"data-state":this.machine.state.current==="hidden"?"hidden":"visible",onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return u(this.#t)}set props(e){W(this.#t,e)}}class sl{static create(){return new sl(_a.get())}scrollbar;root;#e=Fe(!1);get isVisible(){return u(this.#e)}set isVisible(e){W(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;const t=nl(()=>{const i=this.root.viewportNode;if(!i)return;const r=i.offsetWidth<i.scrollWidth,s=i.offsetHeight<i.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?r:s},10);new Rr(()=>this.root.viewportNode,t),new Rr(()=>this.root.contentNode,t)}#t=O(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return u(this.#t)}set props(e){W(this.#t,e)}}class qu{static create(){return rl.set(new qu(_a.get()))}scrollbar;root;#e=Fe(null);get thumbNode(){return u(this.#e)}set thumbNode(e){W(this.#e,e,!0)}#t=Fe(0);get pointerOffset(){return u(this.#t)}set pointerOffset(e){W(this.#t,e,!0)}#n=Fe({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return u(this.#n)}set sizes(e){W(this.#n,e)}#i=O(()=>Vp(this.sizes.viewport,this.sizes.content));get thumbRatio(){return u(this.#i)}set thumbRatio(e){W(this.#i,e)}#r=O(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return u(this.#r)}set hasThumb(e){W(this.#r,e)}#s=Fe("");get prevTransformStyle(){return u(this.#s)}set prevTransformStyle(e){W(this.#s,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Pt(()=>{this.scrollbar.hasThumb=this.hasThumb}),Pt(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return U0({pointerPos:e,pointerOffset:this.pointerOffset,sizes:this.sizes,dir:t})}onThumbPointerUp(){this.pointerOffset=0}onThumbPointerDown(e){this.pointerOffset=e}xOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const e=this.root.viewportNode.scrollLeft,i=`translate3d(${uh({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=i,this.prevTransformStyle=i}xOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=e)}xOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=this.getScrollPosition(e,this.root.opts.dir.current))}yOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const e=this.root.viewportNode.scrollTop,i=`translate3d(0, ${uh({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=i,this.prevTransformStyle=i}yOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=e)}yOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=this.getScrollPosition(e,this.root.opts.dir.current))}}class Yu{static create(e){return Vu.set(new Yu(e,rl.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=Fe();get computedStyle(){return u(this.#e)}set computedStyle(e){W(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=bi(this.scrollbar.opts.ref,i=>this.root.scrollbarXNode=i),Pt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Pt(()=>{this.onResize()})}onThumbPointerDown=e=>{this.scrollbarVis.onThumbPointerDown(e.x)};onDragScroll=e=>{this.scrollbarVis.xOnDragScroll(e.x)};onThumbPointerUp=()=>{this.scrollbarVis.onThumbPointerUp()};onThumbPositionChange=()=>{this.scrollbarVis.xOnThumbPositionChange()};onWheelScroll=(e,t)=>{if(!this.root.viewportNode)return;const i=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(i),Gp(i,t)&&e.preventDefault()};onResize=()=>{this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollWidth,viewport:this.root.viewportNode.offsetWidth,scrollbar:{size:this.scrollbar.opts.ref.current.clientWidth,paddingStart:Bo(this.computedStyle.paddingLeft),paddingEnd:Bo(this.computedStyle.paddingRight)}})};#t=O(()=>al(this.scrollbarVis.sizes));get thumbSize(){return u(this.#t)}set thumbSize(e){W(this.#t,e)}#n=O(()=>({id:this.scrollbar.opts.id.current,"data-orientation":"horizontal",style:{bottom:0,left:this.root.opts.dir.current==="rtl"?"var(--bits-scroll-area-corner-width)":0,right:this.root.opts.dir.current==="ltr"?"var(--bits-scroll-area-corner-width)":0,"--bits-scroll-area-thumb-width":`${this.thumbSize}px`},...this.attachment}));get props(){return u(this.#n)}set props(e){W(this.#n,e)}}class Ku{static create(e){return Vu.set(new Ku(e,rl.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=Fe();get computedStyle(){return u(this.#e)}set computedStyle(e){W(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=bi(this.scrollbar.opts.ref,i=>this.root.scrollbarYNode=i),Pt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Pt(()=>{this.onResize()}),this.onThumbPointerDown=this.onThumbPointerDown.bind(this),this.onDragScroll=this.onDragScroll.bind(this),this.onThumbPointerUp=this.onThumbPointerUp.bind(this),this.onThumbPositionChange=this.onThumbPositionChange.bind(this),this.onWheelScroll=this.onWheelScroll.bind(this),this.onResize=this.onResize.bind(this)}onThumbPointerDown(e){this.scrollbarVis.onThumbPointerDown(e.y)}onDragScroll(e){this.scrollbarVis.yOnDragScroll(e.y)}onThumbPointerUp(){this.scrollbarVis.onThumbPointerUp()}onThumbPositionChange(){this.scrollbarVis.yOnThumbPositionChange()}onWheelScroll(e,t){if(!this.root.viewportNode)return;const i=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(i),Gp(i,t)&&e.preventDefault()}onResize(){this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollHeight,viewport:this.root.viewportNode.offsetHeight,scrollbar:{size:this.scrollbar.opts.ref.current.clientHeight,paddingStart:Bo(this.computedStyle.paddingTop),paddingEnd:Bo(this.computedStyle.paddingBottom)}})}#t=O(()=>al(this.scrollbarVis.sizes));get thumbSize(){return u(this.#t)}set thumbSize(e){W(this.#t,e)}#n=O(()=>({id:this.scrollbar.opts.id.current,"data-orientation":"vertical",style:{top:0,right:this.root.opts.dir.current==="ltr"?0:void 0,left:this.root.opts.dir.current==="rtl"?0:void 0,bottom:"var(--bits-scroll-area-corner-height)","--bits-scroll-area-thumb-height":`${this.thumbSize}px`},...this.attachment}));get props(){return u(this.#n)}set props(e){W(this.#n,e)}}class Zu{static create(){return kp.set(new Zu(Vu.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=Fe(null);get rect(){return u(this.#e)}set rect(e){W(this.#e,e)}#t=Fe("");get prevWebkitUserSelect(){return u(this.#t)}set prevWebkitUserSelect(e){W(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#n=O(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return u(this.#n)}set maxScrollPos(e){W(this.#n,e)}constructor(e){this.scrollbarState=e,this.root=e.root,this.scrollbarVis=e.scrollbarVis,this.scrollbar=e.scrollbarVis.scrollbar,this.handleResize=nl(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,Pt(()=>{const t=this.maxScrollPos,i=this.scrollbar.opts.ref.current;this.root.viewportNode;const r=a=>{const o=a.target;i?.contains(o)&&this.handleWheelScroll(a,t)};return dn(this.root.domContext.getDocument(),"wheel",r,{passive:!1})}),kg(()=>{this.scrollbarVis.sizes,wn(()=>this.handleThumbPositionChange())}),new Rr(()=>this.scrollbar.opts.ref.current,this.handleResize),new Rr(()=>this.root.contentNode,this.handleResize),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onlostpointercapture=this.onlostpointercapture.bind(this)}handleDragScroll(e){if(!this.rect)return;const t=e.clientX-this.rect.left,i=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:i})}#i(){this.rect!==null&&(this.root.domContext.getDocument().body.style.webkitUserSelect=this.prevWebkitUserSelect,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=""),this.rect=null)}onpointerdown(e){if(e.button!==0)return;e.target.setPointerCapture(e.pointerId),this.rect=this.scrollbar.opts.ref.current?.getBoundingClientRect()??null,this.prevWebkitUserSelect=this.root.domContext.getDocument().body.style.webkitUserSelect,this.root.domContext.getDocument().body.style.webkitUserSelect="none",this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior="auto"),this.handleDragScroll(e)}onpointermove(e){this.handleDragScroll(e)}onpointerup(e){const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.#i()}onlostpointercapture(e){this.#i()}#r=O(()=>jt({...this.scrollbarState.props,style:{position:"absolute",...this.scrollbarState.props.style},[ga.scrollbar]:"",onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return u(this.#r)}set props(e){W(this.#r,e)}}class $u{static create(e){return new $u(e,kp.get())}opts;scrollbarState;attachment;#e;#t=Fe();#n=nl(()=>{u(this.#t)&&(u(this.#t)(),W(this.#t,void 0))},100);constructor(e,t){this.opts=e,this.scrollbarState=t,this.#e=t.root,this.attachment=bi(this.opts.ref,i=>this.scrollbarState.scrollbarVis.thumbNode=i),Pt(()=>{const i=this.#e.viewportNode;if(!i)return;const r=()=>{if(this.#n(),!u(this.#t)){const a=F0(i,this.scrollbarState.handleThumbPositionChange);W(this.#t,a,!0),this.scrollbarState.handleThumbPositionChange()}};return wn(()=>this.scrollbarState.handleThumbPositionChange()),dn(i,"scroll",r)}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){const t=e.target;if(!t)return;const i=t.getBoundingClientRect(),r=e.clientX-i.left,s=e.clientY-i.top;this.scrollbarState.handleThumbPointerDown({x:r,y:s})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#i=O(()=>({id:this.opts.id.current,"data-state":this.scrollbarState.scrollbarVis.hasThumb?"visible":"hidden",style:{width:"var(--bits-scroll-area-thumb-width)",height:"var(--bits-scroll-area-thumb-height)",transform:this.scrollbarState.scrollbarVis.prevTransformStyle},onpointerdowncapture:this.onpointerdowncapture,onpointerup:this.onpointerup,[ga.thumb]:"",...this.attachment}));get props(){return u(this.#i)}set props(e){W(this.#i,e)}}class Ju{static create(e){return new Ju(e,va.get())}opts;root;attachment;#e=Fe(0);#t=Fe(0);#n=O(()=>!!(u(this.#e)&&u(this.#t)));get hasSize(){return u(this.#n)}set hasSize(e){W(this.#n,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=bi(this.opts.ref),new Rr(()=>this.root.scrollbarXNode,()=>{const i=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=i,W(this.#t,i,!0)}),new Rr(()=>this.root.scrollbarYNode,()=>{const i=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=i,W(this.#e,i,!0)})}#i=O(()=>({id:this.opts.id.current,style:{width:u(this.#e),height:u(this.#t),position:"absolute",right:this.root.opts.dir.current==="ltr"?0:void 0,left:this.root.opts.dir.current==="rtl"?0:void 0,bottom:0},[ga.corner]:"",...this.attachment}));get props(){return u(this.#i)}set props(e){W(this.#i,e)}}function Bo(n){return n?Number.parseInt(n,10):0}function Vp(n,e){const t=n/e;return Number.isNaN(t)?0:t}function al(n){const e=Vp(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,i=(n.scrollbar.size-t)*e;return Math.max(i,18)}function U0({pointerPos:n,pointerOffset:e,sizes:t,dir:i="ltr"}){const r=al(t),s=r/2,a=e||s,o=r-a,l=t.scrollbar.paddingStart+a,c=t.scrollbar.size-t.scrollbar.paddingEnd-o,d=t.content-t.viewport,f=i==="ltr"?[0,d]:[d*-1,0];return Hp([l,c],f)(n)}function uh({scrollPos:n,sizes:e,dir:t="ltr"}){const i=al(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,a=e.content-e.viewport,o=s-i,l=t==="ltr"?[0,a]:[a*-1,0],c=I0(n,l[0],l[1]);return Hp([0,a],[0,o])(c)}function Hp(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(n[1]-n[0]);return e[0]+i*(t-n[0])}}function Gp(n,e){return n>0&&n<e}function F0(n,e){let t={left:n.scrollLeft,top:n.scrollTop},i=0;const r=dv(n);return(function s(){const a={left:n.scrollLeft,top:n.scrollTop},o=t.left!==a.left,l=t.top!==a.top;(o||l)&&e(),t=a,i=r.requestAnimationFrame(s)})(),()=>r.cancelAnimationFrame(i)}var O0=K("<div><!></div>");function z0(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=oe(e,"type",3,"hover"),a=oe(e,"dir",3,"ltr"),o=oe(e,"scrollHideDelay",3,600),l=ut(e,["$$slots","$$events","$$legacy","ref","id","type","dir","scrollHideDelay","children","child"]);const c=Hu.create({type:Qe(()=>s()),dir:Qe(()=>a()),scrollHideDelay:Qe(()=>o()),id:Qe(()=>r()),ref:Qe(()=>i(),x=>i(x))}),d=O(()=>jt(l,c.props));var f=we(),h=ee(f);{var p=x=>{var g=we(),v=ee(g);pt(v,()=>e.child,()=>({props:u(d)})),P(x,g)},m=x=>{var g=O0();Ft(g,()=>({...u(d)}));var v=$(g);pt(v,()=>e.children??wt),j(g),P(x,g)};xe(h,x=>{e.child?x(p):x(m,-1)})}P(n,f),at()}var B0=K("<div><div><!></div></div>");function k0(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=ut(e,["$$slots","$$events","$$legacy","ref","id","children"]);const a=Gu.create({id:Qe(()=>r()),ref:Qe(()=>i(),h=>i(h))}),o=O(()=>jt(s,a.props)),l=O(()=>jt({},a.contentProps));var c=B0();Ft(c,()=>({...u(o)}));var d=$(c);Ft(d,()=>({...u(l)}));var f=$(d);pt(f,()=>e.children??wt),j(d),j(c),P(n,c),at()}var V0=K("<div><!></div>");function Wp(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy","child","children"]);const i=Zu.create(),r=O(()=>jt(t,i.props));var s=we(),a=ee(s);{var o=c=>{var d=we(),f=ee(d);pt(f,()=>e.child,()=>({props:u(r)})),P(c,d)},l=c=>{var d=V0();Ft(d,()=>({...u(r)}));var f=$(d);pt(f,()=>e.children??wt),j(d),P(c,d)};xe(a,c=>{e.child?c(o):c(l,-1)})}P(n,s),at()}function H0(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy"]);const i=new zu,r=Yu.create({mounted:Qe(()=>i.current)}),s=O(()=>jt(t,r.props));Wp(n,mt(()=>u(s))),at()}function G0(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy"]);const i=new zu,r=Ku.create({mounted:Qe(()=>i.current)}),s=O(()=>jt(t,r.props));Wp(n,mt(()=>u(s))),at()}function ol(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy"]);const i=qu.create();var r=we(),s=ee(r);{var a=l=>{H0(l,mt(()=>t))},o=l=>{G0(l,mt(()=>t))};xe(s,l=>{i.scrollbar.opts.orientation.current==="horizontal"?l(a):l(o,-1)})}P(n,r),at()}function W0(n,e){st(e,!0);let t=oe(e,"forceMount",3,!1),i=ut(e,["$$slots","$$events","$$legacy","forceMount"]);const r=sl.create(),s=O(()=>jt(i,r.props));{const a=l=>{ol(l,mt(()=>u(s)))};let o=O(()=>t()||r.isVisible);il(n,{get open(){return u(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}})}at()}function X0(n,e){st(e,!0);let t=oe(e,"forceMount",3,!1),i=ut(e,["$$slots","$$events","$$legacy","forceMount"]);const r=ju.create(),s=O(()=>jt(i,r.props));{const a=l=>{ol(l,mt(()=>u(s)))};let o=O(()=>t()||!r.isHidden);il(n,mt(()=>u(s),{get open(){return u(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}}))}at()}function j0(n,e){st(e,!0);let t=oe(e,"forceMount",3,!1),i=ut(e,["$$slots","$$events","$$legacy","forceMount"]);const r=Xu.create(),s=sl.create(),a=O(()=>jt(i,r.props,s.props,{"data-state":r.isVisible?"visible":"hidden"})),o=O(()=>t()||r.isVisible&&s.isVisible);il(n,{get open(){return u(o)},get ref(){return s.scrollbar.opts.ref},presence:c=>{ol(c,mt(()=>u(a)))},$$slots:{presence:!0}}),at()}function q0(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=ut(e,["$$slots","$$events","$$legacy","ref","id","orientation"]);const a=Wu.create({orientation:Qe(()=>e.orientation),id:Qe(()=>r()),ref:Qe(()=>i(),m=>i(m))}),o=O(()=>a.root.opts.type.current);var l=we(),c=ee(l);{var d=m=>{j0(m,mt(()=>s,{get id(){return r()}}))},f=m=>{X0(m,mt(()=>s,{get id(){return r()}}))},h=m=>{W0(m,mt(()=>s,{get id(){return r()}}))},p=m=>{ol(m,mt(()=>s,{get id(){return r()}}))};xe(c,m=>{u(o)==="hover"?m(d):u(o)==="scroll"?m(f,1):u(o)==="auto"?m(h,2):u(o)==="always"&&m(p,3)})}P(n,l),at()}var Y0=K("<div><!></div>");function K0(n,e){st(e,!0);let t=oe(e,"ref",15,null),i=ut(e,["$$slots","$$events","$$legacy","ref","id","child","children","present"]);const r=new zu,s=$u.create({id:Qe(()=>e.id),ref:Qe(()=>t(),f=>t(f)),mounted:Qe(()=>r.current)}),a=O(()=>jt(i,s.props,{style:{hidden:!e.present}}));var o=we(),l=ee(o);{var c=f=>{var h=we(),p=ee(h);pt(p,()=>e.child,()=>({props:u(a)})),P(f,h)},d=f=>{var h=Y0();Ft(h,()=>({...u(a)}));var p=$(h);pt(p,()=>e.children??wt),j(h),P(f,h)};xe(l,f=>{e.child?f(c):f(d,-1)})}P(n,o),at()}function Z0(n,e){const t=Tn();st(e,!0);let i=oe(e,"id",19,()=>Vn(t)),r=oe(e,"ref",15,null),s=oe(e,"forceMount",3,!1),a=ut(e,["$$slots","$$events","$$legacy","id","ref","forceMount"]);const o=rl.get();{const l=(d,f)=>{let h=()=>(f?.()).present;K0(d,mt(()=>a,{get id(){return i()},get present(){return h()},get ref(){return r()},set ref(p){r(p)}}))};let c=O(()=>s()||o.hasThumb);il(n,{get open(){return u(c)},get ref(){return o.scrollbar.opts.ref},presence:l,$$slots:{presence:!0}})}at()}var $0=K("<div><!></div>");function J0(n,e){st(e,!0);let t=oe(e,"ref",15,null),i=ut(e,["$$slots","$$events","$$legacy","ref","id","children","child"]);const r=Ju.create({id:Qe(()=>e.id),ref:Qe(()=>t(),d=>t(d))}),s=O(()=>jt(i,r.props));var a=we(),o=ee(a);{var l=d=>{var f=we(),h=ee(f);pt(h,()=>e.child,()=>({props:u(s)})),P(d,f)},c=d=>{var f=$0();Ft(f,()=>({...u(s)}));var h=$(f);pt(h,()=>e.children??wt),j(f),P(d,f)};xe(o,d=>{e.child?d(l):d(c,-1)})}P(n,a),at()}function Q0(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=ut(e,["$$slots","$$events","$$legacy","ref","id"]);const a=va.get(),o=O(()=>!!(a.scrollbarXNode&&a.scrollbarYNode)),l=O(()=>a.opts.type.current!=="scroll"&&u(o));var c=we(),d=ee(c);{var f=h=>{J0(h,mt(()=>s,{get id(){return r()},get ref(){return i()},set ref(p){i(p)}}))};xe(d,h=>{u(l)&&h(f)})}P(n,c),at()}function dh(n,e,t){const i={position:"absolute"};return n==="lr"?(i.left=`${e}%`,i.right=`${t}%`):n==="rl"?(i.right=`${e}%`,i.left=`${t}%`):n==="bt"?(i.bottom=`${e}%`,i.top=`${t}%`):(i.top=`${e}%`,i.bottom=`${t}%`),i}function Xp(n,e){const t={position:"absolute"};return n==="lr"?(t.left=`${e}%`,t.translate="-50% 0"):n==="rl"?(t.right=`${e}%`,t.translate="50% 0"):n==="bt"?(t.bottom=`${e}%`,t.translate="0 50%"):(t.top=`${e}%`,t.translate="0 -50%"),t}function jp(n,e,t){const i={position:"absolute"};return n==="lr"?(i.left=`${e}%`,i.translate=`${t}% 0`):n==="rl"?(i.right=`${e}%`,i.translate=`${-t}% 0`):n==="bt"?(i.bottom=`${e}%`,i.translate=`0 ${-t}%`):(i.top=`${e}%`,i.translate=`0 ${t}%`),i}function e_(n){if(Math.floor(n)===n)return 0;const e=n.toString();if(e.indexOf(".")!==-1&&e.indexOf("e-")===-1)return e.split(".")[1].length;if(e.indexOf("e-")!==-1){const t=e.split("e-");return parseInt(t[1],10)}return 0}function t_(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function Qu(n,e,t){if(typeof n=="number"){const i=t-e;let r=Math.ceil(i/n);const s=e_(n),a=Math.pow(10,s),o=Math.round(i*a),l=Math.round(n*a);o%l===0&&r++;const c=[];for(let d=0;d<r;d++){const f=e+d*n,h=t_(f,s);c.push(h)}return c}return[...new Set(n)].filter(i=>i>=e&&i<=t).sort((i,r)=>i-r)}function Tr(n,e){if(e.length===0)return n;let t=e[0],i=Math.abs(n-t);for(const r of e){const s=Math.abs(n-r);s<i&&(i=s,t=r)}return t}function Aa(n,e,t){const i=e.indexOf(n);return i===-1?Tr(n,e):t==="next"?i<e.length-1?e[i+1]:n:i>0?e[i-1]:n}function n_(n,e,t=!0){const[i,r]=n,[s,a]=e,o=(a-s)/(r-i);return l=>{const c=s+o*(l-i);return t?c>Math.max(s,a)?Math.max(s,a):c<Math.min(s,a)?Math.min(s,a):c:c}}const hr=Lu({component:"slider",parts:["root","thumb","range","tick","tick-label","thumb-label"]}),ed=new pr("Slider.Root");class qp{opts;attachment;#e=Fe(!1);get isActive(){return u(this.#e)}set isActive(e){W(this.#e,e,!0)}#t=Fe(0);#n=O(()=>this.opts.orientation.current==="horizontal"?this.opts.dir.current==="rtl"?"rl":"lr":this.opts.dir.current==="rtl"?"tb":"bt");get direction(){return u(this.#n)}set direction(e){W(this.#n,e)}#i=O(()=>Qu(this.opts.step.current,this.opts.min.current,this.opts.max.current));get normalizedSteps(){return u(this.#i)}set normalizedSteps(e){W(this.#i,e)}domContext;constructor(e){this.opts=e,this.attachment=bi(e.ref),this.domContext=new xp(this.opts.ref),new Rr(()=>this.opts.ref.current,this.#r)}#r=()=>{W(this.#t,u(this.#t)+1)};isThumbActive(e){return this.isActive}#s=O(()=>{if(!this.opts.disabled.current)return this.opts.orientation.current==="horizontal"?"pan-y":"pan-x"});getAllThumbs=()=>{const e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(hr.selector("thumb"))):[]};getThumbScale=()=>{u(this.#t);const e=this.opts.trackPadding?.current;if(e!==void 0&&e>0)return[e,100-e];if(this.opts.thumbPositioning.current==="exact")return[0,100];const t=this.opts.orientation.current==="vertical",i=this.getAllThumbs()[0],r=t?i?.offsetHeight:i?.offsetWidth;if(r===void 0||Number.isNaN(r)||r===0)return[0,100];const s=t?this.opts.ref.current?.offsetHeight:this.opts.ref.current?.offsetWidth;if(s===void 0||Number.isNaN(s)||s===0)return[0,100];const a=r/2/s*100,o=a,l=100-a;return[o,l]};getPositionFromValue=e=>{const t=this.getThumbScale();return n_([this.opts.min.current,this.opts.max.current],t)(e)};#a=O(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,"data-disabled":Pr(this.opts.disabled.current),style:{touchAction:u(this.#s)},[hr.root]:"",...this.attachment}));get props(){return u(this.#a)}set props(e){W(this.#a,e)}}class i_ extends qp{opts;isMulti=!1;constructor(e){super(e),this.opts=e,Up(()=>Iu(dn(this.domContext.getDocument(),"pointerdown",this.handlePointerDown),dn(this.domContext.getDocument(),"pointerup",this.handlePointerUp),dn(this.domContext.getDocument(),"pointermove",this.handlePointerMove),dn(this.domContext.getDocument(),"pointerleave",this.handlePointerUp))),fr([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=Qu(t,i,r),o=c=>a.includes(c),l=c=>Tr(c,a);o(s)||(this.opts.value.current=l(s))})}isTickValueSelected=e=>this.opts.value.current===e;applyPosition({clientXY:e,start:t,end:i}){const r=this.opts.min.current,s=this.opts.max.current,o=(e-t)/(i-t)*(s-r)+r;if(o<r)this.updateValue(r);else if(o>s)this.updateValue(s);else{const l=this.normalizedSteps,c=Tr(o,l);this.updateValue(c)}}updateValue=e=>{this.opts.value.current=Tr(e,this.normalizedSteps)};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();const t=this.opts.ref.current,i=this.getAllThumbs()[0];if(!t||!i)return;i.focus();const{left:r,right:s,top:a,bottom:o}=t.getBoundingClientRect();this.direction==="lr"?this.applyPosition({clientXY:e.clientX,start:r,end:s}):this.direction==="rl"?this.applyPosition({clientXY:e.clientX,start:s,end:r}):this.direction==="bt"?this.applyPosition({clientXY:e.clientY,start:o,end:a}):this.direction==="tb"&&this.applyPosition({clientXY:e.clientY,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;const t=this.opts.ref.current,i=this.getAllThumbs()[0];if(!i||!t)return;const r=e.composedPath()[0]??e.target;!Rp(r)||!t.contains(r)||(e.preventDefault(),i.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(wn(()=>this.opts.value.current)),this.isActive=!1)};#e=O(()=>{const e=this.opts.value.current;return Array.from({length:1},()=>{const t=e,i=this.getPositionFromValue(t),r=Xp(this.direction,i);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":t,"aria-disabled":Oo(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":t,"data-orientation":this.opts.orientation.current,style:r,[hr.thumb]:""}})});get thumbsPropsArr(){return u(this.#e)}set thumbsPropsArr(e){W(this.#e,e)}#t=O(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return u(this.#t)}set thumbsRenderArr(e){W(this.#t,e)}#n=O(()=>{const e=this.normalizedSteps,t=this.opts.value.current;return e.map((i,r)=>{const s=this.getPositionFromValue(i),a=r===0,o=r===e.length-1,l=a?0:o?-100:-50,c=jp(this.direction,s,l),d=i<=t;return{"data-disabled":Pr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":d?"":void 0,"data-value":i,"data-selected":this.isTickValueSelected(i)?"":void 0,style:c,[hr.tick]:""}})});get ticksPropsArr(){return u(this.#n)}set ticksPropsArr(e){W(this.#n,e)}#i=O(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return u(this.#i)}set ticksRenderArr(e){W(this.#i,e)}#r=O(()=>this.ticksPropsArr.map((e,t)=>({value:e["data-value"],index:t})));get tickItemsArr(){return u(this.#r)}set tickItemsArr(e){W(this.#r,e)}#s=O(()=>[{value:this.opts.value.current,index:0}]);get thumbItemsArr(){return u(this.#s)}set thumbItemsArr(e){W(this.#s,e)}#a=O(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return u(this.#a)}set snippetProps(e){W(this.#a,e)}}class r_ extends qp{opts;isMulti=!0;#e=Fe(null);get activeThumb(){return u(this.#e)}set activeThumb(e){W(this.#e,e,!0)}#t=Fe(0);get currentThumbIdx(){return u(this.#t)}set currentThumbIdx(e){W(this.#t,e,!0)}constructor(e){super(e),this.opts=e,Up(()=>Iu(dn(this.domContext.getDocument(),"pointerdown",this.handlePointerDown),dn(this.domContext.getDocument(),"pointerup",this.handlePointerUp),dn(this.domContext.getDocument(),"pointermove",this.handlePointerMove),dn(this.domContext.getDocument(),"pointerleave",this.handlePointerUp))),fr([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=Qu(t,i,r),o=c=>a.includes(c),l=c=>Tr(c,a);s.some(c=>!o(c))&&(this.opts.value.current=s.map(l))})}isTickValueSelected=e=>this.opts.value.current.includes(e);isThumbActive(e){return this.isActive&&this.activeThumb?.idx===e}applyPosition({clientXY:e,activeThumbIdx:t,start:i,end:r}){const s=this.opts.min.current,a=this.opts.max.current,l=(e-i)/(r-i)*(a-s)+s;if(l<s)this.updateValue(s,t);else if(l>a)this.updateValue(a,t);else{const c=this.normalizedSteps,d=Tr(l,c);this.updateValue(d,t)}}#n=e=>{const t=this.getAllThumbs();if(!t.length)return;for(const a of t)a.blur();const i=t.map(a=>{if(this.opts.orientation.current==="horizontal"){const{left:o,right:l}=a.getBoundingClientRect();return Math.abs(e.clientX-(o+l)/2)}else{const{top:o,bottom:l}=a.getBoundingClientRect();return Math.abs(e.clientY-(o+l)/2)}}),r=t[i.indexOf(Math.min(...i))],s=t.indexOf(r);return{node:r,idx:s}};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();const t=this.opts.ref.current,i=this.activeThumb;if(!t||!i)return;i.node.focus();const{left:r,right:s,top:a,bottom:o}=t.getBoundingClientRect(),l=this.direction;l==="lr"?this.applyPosition({clientXY:e.clientX,activeThumbIdx:i.idx,start:r,end:s}):l==="rl"?this.applyPosition({clientXY:e.clientX,activeThumbIdx:i.idx,start:s,end:r}):l==="bt"?this.applyPosition({clientXY:e.clientY,activeThumbIdx:i.idx,start:o,end:a}):l==="tb"&&this.applyPosition({clientXY:e.clientY,activeThumbIdx:i.idx,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;const t=this.opts.ref.current,i=this.#n(e);if(!i||!t)return;const r=e.composedPath()[0]??e.target;!Rp(r)||!t.contains(r)||(e.preventDefault(),this.activeThumb=i,i.node.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(wn(()=>this.opts.value.current)),this.isActive=!1)};getAllThumbs=()=>{const e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(hr.selector("thumb"))):[]};updateValue=(e,t)=>{const i=this.opts.value.current;if(!i.length){this.opts.value.current.push(e);return}if(i[t]===e)return;const s=[...i];if(!hv(t,s))return;const a=s[t]>e?-1:1,o=()=>{const c=t+a;s[t]=s[c],s[c]=e;const d=this.getAllThumbs();d.length&&(d[c]?.focus(),this.activeThumb={node:d[c],idx:c})};if(this.opts.autoSort.current&&(a===-1&&e<s[t-1]||a===1&&e>s[t+1])){o(),this.opts.value.current=s;return}const l=this.normalizedSteps;s[t]=Tr(e,l),this.opts.value.current=s};#i=O(()=>{const e=this.opts.value.current;return Array.from({length:e.length||1},(t,i)=>{const r=wn(()=>this.currentThumbIdx);r<e.length&&wn(()=>{this.currentThumbIdx=r+1});const s=e[i],a=this.getPositionFromValue(s??0),o=Xp(this.direction,a);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":s,"aria-disabled":Oo(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":s,"data-orientation":this.opts.orientation.current,style:o,[hr.thumb]:""}})});get thumbsPropsArr(){return u(this.#i)}set thumbsPropsArr(e){W(this.#i,e)}#r=O(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return u(this.#r)}set thumbsRenderArr(e){W(this.#r,e)}#s=O(()=>{const e=this.normalizedSteps,t=this.opts.value.current;return e.map((i,r)=>{const s=this.getPositionFromValue(i),a=r===0,o=r===e.length-1,l=a?0:o?-100:-50,c=jp(this.direction,s,l),d=t.length===1?i<=t[0]:t[0]<=i&&i<=t[t.length-1];return{"data-disabled":Pr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":d?"":void 0,"data-value":i,style:c,[hr.tick]:""}})});get ticksPropsArr(){return u(this.#s)}set ticksPropsArr(e){W(this.#s,e)}#a=O(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return u(this.#a)}set ticksRenderArr(e){W(this.#a,e)}#o=O(()=>this.ticksPropsArr.map((e,t)=>({value:e["data-value"],index:t})));get tickItemsArr(){return u(this.#o)}set tickItemsArr(e){W(this.#o,e)}#l=O(()=>this.opts.value.current.map((t,i)=>({value:t,index:i})));get thumbItemsArr(){return u(this.#l)}set thumbItemsArr(e){W(this.#l,e)}#c=O(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return u(this.#c)}set snippetProps(e){W(this.#c,e)}}class s_{static create(e){const{type:t,...i}=e,r=t==="single"?new i_(i):new r_(i);return ed.set(r)}}const a_=[wp,Ep,Tp,Ap,Cp,Pp];class td{static create(e){return new td(e,ed.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=bi(e.ref)}#e=O(()=>{if(Array.isArray(this.root.opts.value.current)){const e=this.root.opts.value.current.length>1?this.root.getPositionFromValue(Math.min(...this.root.opts.value.current)??0):0,t=100-this.root.getPositionFromValue(Math.max(...this.root.opts.value.current)??0);return{position:"absolute",...dh(this.root.direction,e,t)}}else{const e=this.root.opts.trackPadding?.current,t=this.root.opts.value.current,i=this.root.opts.max.current,r=0,s=e!==void 0&&e>0&&t===i?0:100-this.root.getPositionFromValue(t);return{position:"absolute",...dh(this.root.direction,r,s)}}});get rangeStyles(){return u(this.#e)}set rangeStyles(e){W(this.#e,e)}#t=O(()=>({id:this.opts.id.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":Pr(this.root.opts.disabled.current),style:this.rangeStyles,[hr.range]:"",...this.attachment}));get props(){return u(this.#t)}set props(e){W(this.#t,e)}}class nd{static create(e){return new nd(e,ed.get())}opts;root;attachment;#e=O(()=>this.root.opts.disabled.current||this.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=bi(e.ref),this.onkeydown=this.onkeydown.bind(this)}#t(e){this.root.isMulti?this.root.updateValue(e,this.opts.index.current):this.root.updateValue(e)}onkeydown(e){if(u(this.#e))return;const t=this.opts.ref.current;if(!t)return;const i=this.root.getAllThumbs();if(!i.length)return;const r=i.indexOf(t);if(this.root.isMulti&&(this.root.currentThumbIdx=r),!a_.includes(e.key))return;e.preventDefault();const s=this.root.opts.min.current,a=this.root.opts.max.current,o=this.root.opts.value.current,l=Array.isArray(o)?o[r]:o,c=this.root.opts.orientation.current,d=this.root.direction,f=this.root.normalizedSteps;switch(e.key){case Cp:this.#t(s);break;case Pp:this.#t(a);break;case wp:if(c!=="horizontal")break;if(e.metaKey){const h=d==="rl"?a:s;this.#t(h)}else{const p=Aa(l,f,d==="rl"?"next":"prev");this.#t(p)}break;case Ep:if(c!=="horizontal")break;if(e.metaKey){const h=d==="rl"?s:a;this.#t(h)}else{const p=Aa(l,f,d==="rl"?"prev":"next");this.#t(p)}break;case Tp:if(e.metaKey){const h=d==="tb"?s:a;this.#t(h)}else{const p=Aa(l,f,d==="tb"?"prev":"next");this.#t(p)}break;case Ap:if(e.metaKey){const h=d==="tb"?a:s;this.#t(h)}else{const p=Aa(l,f,d==="tb"?"next":"prev");this.#t(p)}break}this.root.opts.onValueCommit.current(this.root.opts.value.current)}#n=O(()=>({...this.root.thumbsPropsArr[this.opts.index.current],id:this.opts.id.current,onkeydown:this.onkeydown,"data-active":this.root.isThumbActive(this.opts.index.current)?"":void 0,"data-disabled":Pr(this.opts.disabled.current||this.root.opts.disabled.current),tabindex:this.opts.disabled.current||this.root.opts.disabled.current?-1:0,...this.attachment}));get props(){return u(this.#n)}set props(e){W(this.#n,e)}}var o_=K("<span><!></span>");function l_(n,e){const t=Tn();st(e,!0);let i=oe(e,"id",19,()=>Vn(t)),r=oe(e,"ref",15,null),s=oe(e,"value",15),a=oe(e,"onValueChange",3,Un),o=oe(e,"onValueCommit",3,Un),l=oe(e,"disabled",3,!1),c=oe(e,"step",3,1),d=oe(e,"dir",3,"ltr"),f=oe(e,"autoSort",3,!0),h=oe(e,"orientation",3,"horizontal"),p=oe(e,"thumbPositioning",3,"contain"),m=ut(e,["$$slots","$$events","$$legacy","children","child","id","ref","value","type","onValueChange","onValueCommit","disabled","min","max","step","dir","autoSort","orientation","thumbPositioning","trackPadding"]);const x=O(()=>e.min!==void 0?e.min:Array.isArray(c())?Math.min(...c()):0),g=O(()=>e.max!==void 0?e.max:Array.isArray(c())?Math.max(...c()):100);function v(){if(s()===void 0)return e.type==="single"?u(x):[]}v(),fr.pre(()=>s(),()=>{v()});const y=s_.create({id:Qe(()=>i()),ref:Qe(()=>r(),_=>r(_)),value:Qe(()=>s(),_=>{s(_),a()(_)}),onValueCommit:Qe(()=>o()),disabled:Qe(()=>l()),min:Qe(()=>u(x)),max:Qe(()=>u(g)),step:Qe(()=>c()),dir:Qe(()=>d()),autoSort:Qe(()=>f()),orientation:Qe(()=>h()),thumbPositioning:Qe(()=>p()),type:e.type,trackPadding:Qe(()=>e.trackPadding)}),w=O(()=>jt(m,y.props));var b=we(),E=ee(b);{var S=_=>{var T=we(),D=ee(T);{let L=O(()=>({props:u(w),...y.snippetProps}));pt(D,()=>e.child,()=>u(L))}P(_,T)},A=_=>{var T=o_();Ft(T,()=>({...u(w)}));var D=$(T);pt(D,()=>e.children??wt,()=>y.snippetProps),j(T),P(_,T)};xe(E,_=>{e.child?_(S):_(A,-1)})}P(n,b),at()}var c_=K("<span><!></span>");function u_(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=ut(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const a=td.create({id:Qe(()=>r()),ref:Qe(()=>i(),h=>i(h))}),o=O(()=>jt(s,a.props));var l=we(),c=ee(l);{var d=h=>{var p=we(),m=ee(p);pt(m,()=>e.child,()=>({props:u(o)})),P(h,p)},f=h=>{var p=c_();Ft(p,()=>({...u(o)}));var m=$(p);pt(m,()=>e.children??wt),j(p),P(h,p)};xe(c,h=>{e.child?h(d):h(f,-1)})}P(n,l),at()}var d_=K("<span><!></span>");function h_(n,e){const t=Tn();st(e,!0);let i=oe(e,"ref",15,null),r=oe(e,"id",19,()=>Vn(t)),s=oe(e,"disabled",3,!1),a=ut(e,["$$slots","$$events","$$legacy","children","child","ref","id","index","disabled"]);const o=nd.create({id:Qe(()=>r()),ref:Qe(()=>i(),p=>i(p)),index:Qe(()=>e.index),disabled:Qe(()=>s())}),l=O(()=>jt(a,o.props));var c=we(),d=ee(c);{var f=p=>{var m=we(),x=ee(m);{let g=O(()=>({active:o.root.isThumbActive(o.opts.index.current),props:u(l)}));pt(x,()=>e.child,()=>u(g))}P(p,m)},h=p=>{var m=d_();Ft(m,()=>({...u(l)}));var x=$(m);{let g=O(()=>({active:o.root.isThumbActive(o.opts.index.current)}));pt(x,()=>e.children??wt,()=>u(g))}j(m),P(p,m)};xe(d,p=>{e.child?p(f):p(h,-1)})}P(n,c),at()}var Mo=new Map;function Yp(n,e){Mo.set(n,e)}Yp("Rhino.Geometry.Point3d",(n,e)=>{let t=e;return!t||typeof t.X!="number"?null:new n.Point([t.X,t.Y,t.Z])});Yp("Rhino.Geometry.Line",(n,e)=>{let t=e;return!t||!t.From||!t.To?null:new n.Line([t.From.X,t.From.Y,t.From.Z],[t.To.X,t.To.Y,t.To.Z])});function f_(n){if(Mo.has(n))return Mo.get(n);for(let[e,t]of Mo)if(n.startsWith(e))return t}function p_(n){return!n||typeof n!="object"?null:n.data??n.value??null}function m_(n,e,t){let i=f_(e);if(i)try{return i(t,n)}catch(r){Nt().warn(`Failed to decode Rhino type ${e}:`,r)}try{let r=p_(n);if(r)return t.CommonObject.decode(r)}catch(r){return Nt().warn(`Failed to decode ${e} with CommonObject:`,r),{__decodeError:!0,type:e,raw:n}}return n}var ds={STRING:"System.String",INT:"System.Int32",DOUBLE:"System.Double",BOOL:"System.Boolean"},g_="Rhino.Geometry.",v_=["WebDisplay"],__="FileData";function Kp(n){return v_.some(e=>n.includes(e))}function Zp(n){if(typeof n!="string")return n;let e=n.trim();if(!(e.startsWith("{")||e.startsWith("[")||e.startsWith('"')))return n;try{let t=JSON.parse(e);if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}catch{return n}}function x_(n,e,t){switch(e){case ds.STRING:return typeof n!="string"?n:n.replace(/^"(.*)"$/,"$1");case ds.INT:return Number.parseInt(n,10);case ds.DOUBLE:return Number.parseFloat(n);case ds.BOOL:return String(n).toLowerCase()==="true";default:return t&&e.startsWith(g_)?m_(n,e,t):n}}function $p(n,e,t,i){if(typeof n!="string")return n;let r=t?Zp(n):n;return x_(r,e,i)}function b_(n){if(!n||typeof n!="object")return!1;let e=n;return typeof e.fileName=="string"&&typeof e.fileType=="string"&&"data"in e&&typeof e.isBase64Encoded=="boolean"&&typeof e.subFolder=="string"}function ko(n,e){for(let t of Object.values(n))if(Array.isArray(t))for(let i of t)e(i)}function y_(n,e=!1,t={}){let{parseValues:i=!0,rhino:r,stringOnly:s=!1}=t,a={},o=new Set;for(let l of n.values)ko(l.InnerTree,c=>{if(Kp(c.type)||s&&c.type!==ds.STRING)return;let d=e?c.id:l.ParamName;if(!d)return;let f=$p(c.data,c.type,i,r);d in a?o.has(d)?a[d].push(f):(a[d]=[a[d],f],o.add(d)):a[d]=f});return{values:a}}function S_(n){let e=[];for(let t of n.values)ko(t.InnerTree,i=>{if(!i.type.includes(__))return;let r=Zp(i.data);b_(r)&&e.push(r)});return e}function M_(n,e,t={}){let{parseValues:i=!0,rhino:r,stringOnly:s=!1}=t,a;if("byName"in e?a=n.values.find(l=>l.ParamName===e.byName):a=n.values.find(l=>{let c=!1;return ko(l.InnerTree,d=>{d.id===e.byId&&(c=!0)}),c}),!a)return;let o=[];if(ko(a.InnerTree,l=>{if("byId"in e&&l.id!==e.byId||Kp(l.type)||s&&l.type!==ds.STRING)return;let c=$p(l.data,l.type,i,r);o.push(c)}),o.length!==0)return o.length===1?o[0]:o}var w_=class{constructor(n,e=!1){this.response=n,this.debug=e}getValues(n=!1,e={}){return y_(this.response,n,e)}getValue(n,e){return M_(this.response,n,e)}async extractMeshesFromResponse(n){let e={debug:this.debug,...n},t;try{({getThreeMeshesFromComputeResponse:t}=await gp(()=>Promise.resolve().then(()=>UD),void 0,import.meta.url))}catch(i){throw new ma("Failed to load three.js visualization module. Ensure three.js is installed as a peer dependency.",Pu.INVALID_STATE,{context:{originalError:i instanceof Error?i.message:String(i)}})}return t(this.response,e)}getFileData(){return S_(this.response)}async getAndDownloadFiles(n,e){let t=this.getFileData();await jg(t,n,e)}},E_=/^\{(\d+(?:;\d+)*)?\}$/;function T_(n){if(typeof n!="object"||n===null||Array.isArray(n))return!1;let e=Object.entries(n);return e.length>0&&e.every(([t,i])=>E_.test(t)&&Array.isArray(i))}function Rs(n,e,t){if(n==null)return n;if(Array.isArray(n)){let r=n.map(e).filter(s=>s!==null);return r.length>0?r:void 0}let i=e(n);return i!==null?i:t?void 0:n}var A_=n=>{if(typeof n=="number")return n;if(typeof n=="string"){let e=n.trim();if(e==="")return null;let t=Number(e);return Number.isNaN(t)?null:t}return null},C_=n=>{if(typeof n=="boolean")return n;if(typeof n=="string"){let e=n.toLowerCase();if(e==="true")return!0;if(e==="false")return!1;throw new Error(`Invalid boolean string: "${n}"`)}return null},P_=n=>typeof n=="string"?n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n.startsWith('"')?n.slice(1):n:null,R_=n=>{if(typeof n=="string"){let e=n.trim();return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).trim()),e}return null};function Jp(n){return e=>{if(typeof e=="object"&&e!==null)return e;if(typeof e=="string"&&e.trim()!=="")try{let t=JSON.parse(e);return typeof t=="object"&&t!==null?t:(Nt().warn(`Parsed value for input ${n} is not an object`),null)}catch(t){return Nt().warn(`Failed to parse object value "${e}" for input ${n}`,t),null}return null}}function hh(n,e,t){let i=Number(n.toFixed(e));return Math.abs(n-i)<t?i:n}function D_(n,e){if(!Number.isFinite(n)||n===0)return .1;let t=Math.abs(n);if(t>=1){let d=String(n).split(".")[1];if(d&&d.length>0){let f=Math.min(d.length,12),h=Math.pow(10,-f),p=Number(h.toFixed(f));return Math.abs(p-h)<e?p:h}return 1}let i=String(n),r=i.toLowerCase().match(/e(-?\d+)/);if(r){let d=Number(r[1]);if(d<0||i.toLowerCase().includes("e-")){let f=Math.abs(d),h=Math.pow(10,-f),p=Number(h.toFixed(f));return Math.abs(p-h)<e?p:h}return .1}let s=12,a=t.toFixed(s).replace(/0+$/,""),o=Math.min((a.split(".")[1]||"").length,s);if(o===0)return .1;let l=Math.pow(10,-o),c=Number(l.toFixed(o));return Math.abs(c-l)<e?c:l}function L_(n,e=1e-8){let t=n.paramType==="Integer";if(T_(n.default))return{default:n.default,stepSize:t?1:.1};let i=Rs(n.default,A_,!0);if(t)return Array.isArray(i)?i=i.map(d=>typeof d=="number"?Math.round(d):d):typeof i=="number"&&(i=Math.round(i)),{default:i,stepSize:1};let r=Array.isArray(i)?i[0]:i,s;typeof r=="number"&&Number.isFinite(r)&&r!==0?s=r:typeof n.minimum=="number"&&Number.isFinite(n.minimum)&&n.minimum!==0?s=n.minimum:typeof n.maximum=="number"&&Number.isFinite(n.maximum)&&n.maximum!==0&&(s=n.maximum);let a=s!==void 0?D_(s,e):.1,o=0,l=String(a),c=l.toLowerCase().match(/e(-?\d+)/);if(c?o=Math.abs(Number(c[1])):o=l.split(".")[1]?.length??0,o===0&&typeof r=="number"&&r!==0&&Math.abs(r)<1){let d=Math.ceil(-Math.log10(Math.abs(r)));Number.isFinite(d)&&d>0&&(o=d)}return o=Math.min(Math.max(o,0),12),Array.isArray(i)?i=i.map(d=>typeof d=="number"?hh(d,o,e):d):typeof i=="number"&&(i=hh(i,o,e)),{default:i,stepSize:a}}var I_={types:["Number","Integer"],parse(n,e){let{default:t,stepSize:i}=L_(n);return{...e,paramType:n.paramType,minimum:n.minimum,maximum:n.maximum,atLeast:n.atLeast,atMost:n.atMost,stepSize:i,default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:n.paramType,minimum:n.minimum,maximum:n.maximum,atLeast:n.atLeast,atMost:n.atMost,default:t?[0]:0}}},N_={types:["Boolean"],parse(n,e){let t;try{t=Rs(n.default,C_,!1)}catch(i){throw i instanceof Error?new ma(i.message):i}return{...e,paramType:"Boolean",default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"Boolean",default:t?[!1]:!1}}},U_={types:["Text"],parse(n,e){let t=Rs(n.default,P_,!1);return{...e,paramType:"Text",default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"Text",default:t?[""]:""}}},F_={types:["ValueList"],parse(n,e){if(!n.values||typeof n.values!="object"||Object.keys(n.values).length===0)throw ma.missingValues(n.nickname||"unnamed","ValueList");if(n.default!==void 0&&n.default!==null){let t=String(n.default).toLowerCase();Object.keys(n.values).some(i=>i.toLowerCase()===t)||Nt().warn(`ValueList input "${n.nickname||"unnamed"}" default value "${n.default}" is not in available values`)}return{...e,paramType:"ValueList",values:n.values,default:n.default}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"ValueList",values:n.values??{},default:t?[n.default]:n.default}}},O_={types:["Geometry"],parse(n,e){let t=Rs(n.default,Jp(n.nickname||"unnamed"),!0);return{...e,paramType:"Geometry",default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"Geometry",default:t?[null]:null}}},z_={types:["File"],parse(n,e){let t=Rs(n.default,Jp(n.nickname||"unnamed"),!0);return{...e,paramType:"File",acceptedFormats:n.acceptedFormats,default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"File",default:t?[null]:null}}},B_={types:["Color"],parse(n,e){let t=Rs(n.default,R_,!1);return{...e,paramType:"Color",default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"Color",default:t?["0, 0, 0"]:"0, 0, 0"}}},k_=[I_,N_,U_,F_,O_,z_,B_],V_=new Map(k_.flatMap(n=>n.types.map(e=>[e,n])));new Map([...V_.keys()].map(n=>[n.toLowerCase(),n]));const id="184",xs={ROTATE:0,DOLLY:1,PAN:2},hs={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},H_=0,fh=1,G_=2,wo=1,W_=2,fs=3,Kn=0,Yn=1,Qn=2,Mn=0,bs=1,ph=2,mh=3,gh=4,Qp=5,gi=100,X_=101,j_=102,q_=103,Y_=104,Js=200,K_=201,Z_=202,$_=203,_c=204,xc=205,bc=206,J_=207,yc=208,Q_=209,ex=210,tx=211,nx=212,ix=213,rx=214,Sc=0,Mc=1,wc=2,ws=3,Ec=4,Tc=5,Ac=6,Cc=7,em=0,sx=1,ax=2,Fi=0,rd=1,sd=2,ad=3,od=4,ld=5,cd=6,xa=7,tm=300,Dr=301,Es=302,Eo=303,wl=304,ll=306,Lr=1e3,_i=1001,Pc=1002,xn=1003,ox=1004,Ca=1005,hn=1006,El=1007,lr=1008,qn=1009,nm=1010,im=1011,aa=1012,ud=1013,Oi=1014,ti=1015,Fn=1016,dd=1017,hd=1018,Ts=1020,rm=35902,sm=35899,am=1021,om=1022,li=1023,Yi=1026,cr=1027,lm=1028,fd=1029,Ir=1030,pd=1031,md=1033,To=33776,Ao=33777,Co=33778,Po=33779,Rc=35840,Dc=35841,Lc=35842,Ic=35843,Nc=36196,Uc=37492,Fc=37496,Oc=37488,zc=37489,Vo=37490,Bc=37491,kc=37808,Vc=37809,Hc=37810,Gc=37811,Wc=37812,Xc=37813,jc=37814,qc=37815,Yc=37816,Kc=37817,Zc=37818,$c=37819,Jc=37820,Qc=37821,eu=36492,tu=36494,nu=36495,iu=36283,ru=36284,Ho=36285,su=36286,lx=3200,Go=0,cx=1,ar="",Wn="srgb",oa="srgb-linear",Wo="linear",Ut="srgb",kr=7680,vh=519,ux=512,dx=513,hx=514,gd=515,fx=516,px=517,vd=518,mx=519,au=35044,_h="300 es",Ni=2e3,la=2001;function gx(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function Xo(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function vx(){const n=Xo("canvas");return n.style.display="block",n}const xh={};function jo(...n){const e="THREE."+n.shift();console.log(e,...n)}function cm(n){const e=n[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=n[1];t&&t.isStackTrace?n[0]+=" "+t.getLocation():n[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return n}function ft(...n){n=cm(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...n)}}function Tt(...n){n=cm(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...n)}}function ou(...n){const e=n.join(" ");e in xh||(xh[e]=!0,ft(...n))}function _x(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const xx={[Sc]:Mc,[wc]:Ac,[Ec]:Cc,[ws]:Tc,[Mc]:Sc,[Ac]:wc,[Cc]:Ec,[Tc]:ws};class mr{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}}const In=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let bh=1234567;const ys=Math.PI/180,ca=180/Math.PI;function ji(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(In[n&255]+In[n>>8&255]+In[n>>16&255]+In[n>>24&255]+"-"+In[e&255]+In[e>>8&255]+"-"+In[e>>16&15|64]+In[e>>24&255]+"-"+In[t&63|128]+In[t>>8&255]+"-"+In[t>>16&255]+In[t>>24&255]+In[i&255]+In[i>>8&255]+In[i>>16&255]+In[i>>24&255]).toLowerCase()}function gt(n,e,t){return Math.max(e,Math.min(t,n))}function _d(n,e){return(n%e+e)%e}function bx(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function yx(n,e,t){return n!==e?(t-n)/(e-n):0}function ra(n,e,t){return(1-t)*n+t*e}function Sx(n,e,t,i){return ra(n,e,1-Math.exp(-t*i))}function Mx(n,e=1){return e-Math.abs(_d(n,e*2)-e)}function wx(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Ex(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Tx(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Ax(n,e){return n+Math.random()*(e-n)}function Cx(n){return n*(.5-Math.random())}function Px(n){n!==void 0&&(bh=n);let e=bh+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Rx(n){return n*ys}function Dx(n){return n*ca}function Lx(n){return(n&n-1)===0&&n!==0}function Ix(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Nx(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Ux(n,e,t,i,r){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),c=s((e+i)/2),d=a((e+i)/2),f=s((e-i)/2),h=a((e-i)/2),p=s((i-e)/2),m=a((i-e)/2);switch(r){case"XYX":n.set(o*d,l*f,l*h,o*c);break;case"YZY":n.set(l*h,o*d,l*f,o*c);break;case"ZXZ":n.set(l*f,l*h,o*d,o*c);break;case"XZX":n.set(o*d,l*m,l*p,o*c);break;case"YXY":n.set(l*p,o*d,l*m,o*c);break;case"ZYZ":n.set(l*m,l*p,o*d,o*c);break;default:ft("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function vi(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Ot(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const um={DEG2RAD:ys,RAD2DEG:ca,generateUUID:ji,clamp:gt,euclideanModulo:_d,mapLinear:bx,inverseLerp:yx,lerp:ra,damp:Sx,pingpong:Mx,smoothstep:wx,smootherstep:Ex,randInt:Tx,randFloat:Ax,randFloatSpread:Cx,seededRandom:Px,degToRad:Rx,radToDeg:Dx,isPowerOfTwo:Lx,ceilPowerOfTwo:Ix,floorPowerOfTwo:Nx,setQuaternionFromProperEuler:Ux,normalize:Ot,denormalize:vi},Kd=class Kd{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=gt(this.x,e.x,t.x),this.y=gt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=gt(this.x,e,t),this.y=gt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(gt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(gt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*i-a*r+e.x,this.y=s*r+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Kd.prototype.isVector2=!0;let it=Kd;class xi{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,a,o){let l=i[r+0],c=i[r+1],d=i[r+2],f=i[r+3],h=s[a+0],p=s[a+1],m=s[a+2],x=s[a+3];if(f!==x||l!==h||c!==p||d!==m){let g=l*h+c*p+d*m+f*x;g<0&&(h=-h,p=-p,m=-m,x=-x,g=-g);let v=1-o;if(g<.9995){const y=Math.acos(g),w=Math.sin(y);v=Math.sin(v*y)/w,o=Math.sin(o*y)/w,l=l*v+h*o,c=c*v+p*o,d=d*v+m*o,f=f*v+x*o}else{l=l*v+h*o,c=c*v+p*o,d=d*v+m*o,f=f*v+x*o;const y=1/Math.sqrt(l*l+c*c+d*d+f*f);l*=y,c*=y,d*=y,f*=y}}e[t]=l,e[t+1]=c,e[t+2]=d,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,r,s,a){const o=i[r],l=i[r+1],c=i[r+2],d=i[r+3],f=s[a],h=s[a+1],p=s[a+2],m=s[a+3];return e[t]=o*m+d*f+l*p-c*h,e[t+1]=l*m+d*h+c*f-o*p,e[t+2]=c*m+d*p+o*h-l*f,e[t+3]=d*m-o*f-l*h-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(i/2),d=o(r/2),f=o(s/2),h=l(i/2),p=l(r/2),m=l(s/2);switch(a){case"XYZ":this._x=h*d*f+c*p*m,this._y=c*p*f-h*d*m,this._z=c*d*m+h*p*f,this._w=c*d*f-h*p*m;break;case"YXZ":this._x=h*d*f+c*p*m,this._y=c*p*f-h*d*m,this._z=c*d*m-h*p*f,this._w=c*d*f+h*p*m;break;case"ZXY":this._x=h*d*f-c*p*m,this._y=c*p*f+h*d*m,this._z=c*d*m+h*p*f,this._w=c*d*f-h*p*m;break;case"ZYX":this._x=h*d*f-c*p*m,this._y=c*p*f+h*d*m,this._z=c*d*m-h*p*f,this._w=c*d*f+h*p*m;break;case"YZX":this._x=h*d*f+c*p*m,this._y=c*p*f+h*d*m,this._z=c*d*m-h*p*f,this._w=c*d*f-h*p*m;break;case"XZY":this._x=h*d*f-c*p*m,this._y=c*p*f-h*d*m,this._z=c*d*m+h*p*f,this._w=c*d*f+h*p*m;break;default:ft("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],d=t[6],f=t[10],h=i+o+f;if(h>0){const p=.5/Math.sqrt(h+1);this._w=.25/p,this._x=(d-l)*p,this._y=(s-c)*p,this._z=(a-r)*p}else if(i>o&&i>f){const p=2*Math.sqrt(1+i-o-f);this._w=(d-l)/p,this._x=.25*p,this._y=(r+a)/p,this._z=(s+c)/p}else if(o>f){const p=2*Math.sqrt(1+o-i-f);this._w=(s-c)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(l+d)/p}else{const p=2*Math.sqrt(1+f-i-o);this._w=(a-r)/p,this._x=(s+c)/p,this._y=(l+d)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(gt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,d=t._w;return this._x=i*d+a*o+r*c-s*l,this._y=r*d+a*l+s*o-i*c,this._z=s*d+a*c+i*l-r*o,this._w=a*d-i*o-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){let i=e._x,r=e._y,s=e._z,a=e._w,o=this.dot(e);o<0&&(i=-i,r=-r,s=-s,a=-a,o=-o);let l=1-t;if(o<.9995){const c=Math.acos(o),d=Math.sin(c);l=Math.sin(l*c)/d,t=Math.sin(t*c)/d,this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this._onChangeCallback()}else this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const Zd=class Zd{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(yh.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(yh.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*r-o*i),d=2*(o*t-s*r),f=2*(s*i-a*t);return this.x=t+l*c+a*f-o*d,this.y=i+l*d+o*c-s*f,this.z=r+l*f+s*d-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=gt(this.x,e.x,t.x),this.y=gt(this.y,e.y,t.y),this.z=gt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=gt(this.x,e,t),this.y=gt(this.y,e,t),this.z=gt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(gt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Tl.copy(this).projectOnVector(e),this.sub(Tl)}reflect(e){return this.sub(Tl.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(gt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Zd.prototype.isVector3=!0;let X=Zd;const Tl=new X,yh=new xi,$d=class $d{constructor(e,t,i,r,s,a,o,l,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,a,o,l,c)}set(e,t,i,r,s,a,o,l,c){const d=this.elements;return d[0]=e,d[1]=r,d[2]=o,d[3]=t,d[4]=s,d[5]=l,d[6]=i,d[7]=a,d[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],d=i[4],f=i[7],h=i[2],p=i[5],m=i[8],x=r[0],g=r[3],v=r[6],y=r[1],w=r[4],b=r[7],E=r[2],S=r[5],A=r[8];return s[0]=a*x+o*y+l*E,s[3]=a*g+o*w+l*S,s[6]=a*v+o*b+l*A,s[1]=c*x+d*y+f*E,s[4]=c*g+d*w+f*S,s[7]=c*v+d*b+f*A,s[2]=h*x+p*y+m*E,s[5]=h*g+p*w+m*S,s[8]=h*v+p*b+m*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],d=e[8];return t*a*d-t*o*c-i*s*d+i*o*l+r*s*c-r*a*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],d=e[8],f=d*a-o*c,h=o*l-d*s,p=c*s-a*l,m=t*f+i*h+r*p;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/m;return e[0]=f*x,e[1]=(r*c-d*i)*x,e[2]=(o*i-r*a)*x,e[3]=h*x,e[4]=(d*t-r*l)*x,e[5]=(r*s-o*t)*x,e[6]=p*x,e[7]=(i*l-c*t)*x,e[8]=(a*t-i*s)*x,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*a+c*o)+a+e,-r*c,r*l,-r*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Al.makeScale(e,t)),this}rotate(e){return this.premultiply(Al.makeRotation(-e)),this}translate(e,t){return this.premultiply(Al.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};$d.prototype.isMatrix3=!0;let xt=$d;const Al=new xt,Sh=new xt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Mh=new xt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Fx(){const n={enabled:!0,workingColorSpace:oa,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===Ut&&(r.r=qi(r.r),r.g=qi(r.g),r.b=qi(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Ut&&(r.r=Ss(r.r),r.g=Ss(r.g),r.b=Ss(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===ar?Wo:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return ou("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return ou("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[oa]:{primaries:e,whitePoint:i,transfer:Wo,toXYZ:Sh,fromXYZ:Mh,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Wn},outputColorSpaceConfig:{drawingBufferColorSpace:Wn}},[Wn]:{primaries:e,whitePoint:i,transfer:Ut,toXYZ:Sh,fromXYZ:Mh,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Wn}}}),n}const At=Fx();function qi(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Ss(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Vr;class Ox{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Vr===void 0&&(Vr=Xo("canvas")),Vr.width=e.width,Vr.height=e.height;const r=Vr.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=Vr}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Xo("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=qi(s[a]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(qi(t[i]/255)*255):t[i]=qi(t[i]);return{data:t,width:e.width,height:e.height}}else return ft("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let zx=0;class xd{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:zx++}),this.uuid=ji(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(Cl(r[a].image)):s.push(Cl(r[a]))}else s=Cl(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function Cl(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?Ox.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(ft("Texture: Unable to serialize Texture."),{})}let Bx=0;const Pl=new X;class En extends mr{constructor(e=En.DEFAULT_IMAGE,t=En.DEFAULT_MAPPING,i=_i,r=_i,s=hn,a=lr,o=li,l=qn,c=En.DEFAULT_ANISOTROPY,d=ar){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Bx++}),this.uuid=ji(),this.name="",this.source=new xd(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new it(0,0),this.repeat=new it(1,1),this.center=new it(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new xt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Pl).x}get height(){return this.source.getSize(Pl).y}get depth(){return this.source.getSize(Pl).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){ft(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){ft(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==tm)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Lr:e.x=e.x-Math.floor(e.x);break;case _i:e.x=e.x<0?0:1;break;case Pc:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Lr:e.y=e.y-Math.floor(e.y);break;case _i:e.y=e.y<0?0:1;break;case Pc:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}En.DEFAULT_IMAGE=null;En.DEFAULT_MAPPING=tm;En.DEFAULT_ANISOTROPY=1;const Jd=class Jd{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*i+a[11]*r+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],d=l[4],f=l[8],h=l[1],p=l[5],m=l[9],x=l[2],g=l[6],v=l[10];if(Math.abs(d-h)<.01&&Math.abs(f-x)<.01&&Math.abs(m-g)<.01){if(Math.abs(d+h)<.1&&Math.abs(f+x)<.1&&Math.abs(m+g)<.1&&Math.abs(c+p+v-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(c+1)/2,b=(p+1)/2,E=(v+1)/2,S=(d+h)/4,A=(f+x)/4,_=(m+g)/4;return w>b&&w>E?w<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(w),r=S/i,s=A/i):b>E?b<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(b),i=S/r,s=_/r):E<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(E),i=A/s,r=_/s),this.set(i,r,s,t),this}let y=Math.sqrt((g-m)*(g-m)+(f-x)*(f-x)+(h-d)*(h-d));return Math.abs(y)<.001&&(y=1),this.x=(g-m)/y,this.y=(f-x)/y,this.z=(h-d)/y,this.w=Math.acos((c+p+v-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=gt(this.x,e.x,t.x),this.y=gt(this.y,e.y,t.y),this.z=gt(this.z,e.z,t.z),this.w=gt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=gt(this.x,e,t),this.y=gt(this.y,e,t),this.z=gt(this.z,e,t),this.w=gt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(gt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};Jd.prototype.isVector4=!0;let kt=Jd;class kx extends mr{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:hn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new kt(0,0,e,t),this.scissorTest=!1,this.viewport=new kt(0,0,e,t),this.textures=[];const r={width:e,height:t,depth:i.depth},s=new En(r),a=i.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const t={minFilter:hn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=i,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new xd(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ni extends kx{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class dm extends En{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=xn,this.minFilter=xn,this.wrapR=_i,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Vx extends En{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=xn,this.minFilter=xn,this.wrapR=_i,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const el=class el{constructor(e,t,i,r,s,a,o,l,c,d,f,h,p,m,x,g){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,a,o,l,c,d,f,h,p,m,x,g)}set(e,t,i,r,s,a,o,l,c,d,f,h,p,m,x,g){const v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=r,v[1]=s,v[5]=a,v[9]=o,v[13]=l,v[2]=c,v[6]=d,v[10]=f,v[14]=h,v[3]=p,v[7]=m,v[11]=x,v[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new el().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,i=e.elements,r=1/Hr.setFromMatrixColumn(e,0).length(),s=1/Hr.setFromMatrixColumn(e,1).length(),a=1/Hr.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),c=Math.sin(r),d=Math.cos(s),f=Math.sin(s);if(e.order==="XYZ"){const h=a*d,p=a*f,m=o*d,x=o*f;t[0]=l*d,t[4]=-l*f,t[8]=c,t[1]=p+m*c,t[5]=h-x*c,t[9]=-o*l,t[2]=x-h*c,t[6]=m+p*c,t[10]=a*l}else if(e.order==="YXZ"){const h=l*d,p=l*f,m=c*d,x=c*f;t[0]=h+x*o,t[4]=m*o-p,t[8]=a*c,t[1]=a*f,t[5]=a*d,t[9]=-o,t[2]=p*o-m,t[6]=x+h*o,t[10]=a*l}else if(e.order==="ZXY"){const h=l*d,p=l*f,m=c*d,x=c*f;t[0]=h-x*o,t[4]=-a*f,t[8]=m+p*o,t[1]=p+m*o,t[5]=a*d,t[9]=x-h*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const h=a*d,p=a*f,m=o*d,x=o*f;t[0]=l*d,t[4]=m*c-p,t[8]=h*c+x,t[1]=l*f,t[5]=x*c+h,t[9]=p*c-m,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const h=a*l,p=a*c,m=o*l,x=o*c;t[0]=l*d,t[4]=x-h*f,t[8]=m*f+p,t[1]=f,t[5]=a*d,t[9]=-o*d,t[2]=-c*d,t[6]=p*f+m,t[10]=h-x*f}else if(e.order==="XZY"){const h=a*l,p=a*c,m=o*l,x=o*c;t[0]=l*d,t[4]=-f,t[8]=c*d,t[1]=h*f+x,t[5]=a*d,t[9]=p*f-m,t[2]=m*f-p,t[6]=o*d,t[10]=x*f+h}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Hx,e,Gx)}lookAt(e,t,i){const r=this.elements;return $n.subVectors(e,t),$n.lengthSq()===0&&($n.z=1),$n.normalize(),Qi.crossVectors(i,$n),Qi.lengthSq()===0&&(Math.abs(i.z)===1?$n.x+=1e-4:$n.z+=1e-4,$n.normalize(),Qi.crossVectors(i,$n)),Qi.normalize(),Pa.crossVectors($n,Qi),r[0]=Qi.x,r[4]=Pa.x,r[8]=$n.x,r[1]=Qi.y,r[5]=Pa.y,r[9]=$n.y,r[2]=Qi.z,r[6]=Pa.z,r[10]=$n.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],d=i[1],f=i[5],h=i[9],p=i[13],m=i[2],x=i[6],g=i[10],v=i[14],y=i[3],w=i[7],b=i[11],E=i[15],S=r[0],A=r[4],_=r[8],T=r[12],D=r[1],L=r[5],F=r[9],k=r[13],U=r[2],I=r[6],R=r[10],z=r[14],q=r[3],Y=r[7],te=r[11],le=r[15];return s[0]=a*S+o*D+l*U+c*q,s[4]=a*A+o*L+l*I+c*Y,s[8]=a*_+o*F+l*R+c*te,s[12]=a*T+o*k+l*z+c*le,s[1]=d*S+f*D+h*U+p*q,s[5]=d*A+f*L+h*I+p*Y,s[9]=d*_+f*F+h*R+p*te,s[13]=d*T+f*k+h*z+p*le,s[2]=m*S+x*D+g*U+v*q,s[6]=m*A+x*L+g*I+v*Y,s[10]=m*_+x*F+g*R+v*te,s[14]=m*T+x*k+g*z+v*le,s[3]=y*S+w*D+b*U+E*q,s[7]=y*A+w*L+b*I+E*Y,s[11]=y*_+w*F+b*R+E*te,s[15]=y*T+w*k+b*z+E*le,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],d=e[2],f=e[6],h=e[10],p=e[14],m=e[3],x=e[7],g=e[11],v=e[15],y=l*p-c*h,w=o*p-c*f,b=o*h-l*f,E=a*p-c*d,S=a*h-l*d,A=a*f-o*d;return t*(x*y-g*w+v*b)-i*(m*y-g*E+v*S)+r*(m*w-x*E+v*A)-s*(m*b-x*S+g*A)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],d=e[8],f=e[9],h=e[10],p=e[11],m=e[12],x=e[13],g=e[14],v=e[15],y=t*o-i*a,w=t*l-r*a,b=t*c-s*a,E=i*l-r*o,S=i*c-s*o,A=r*c-s*l,_=d*x-f*m,T=d*g-h*m,D=d*v-p*m,L=f*g-h*x,F=f*v-p*x,k=h*v-p*g,U=y*k-w*F+b*L+E*D-S*T+A*_;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/U;return e[0]=(o*k-l*F+c*L)*I,e[1]=(r*F-i*k-s*L)*I,e[2]=(x*A-g*S+v*E)*I,e[3]=(h*S-f*A-p*E)*I,e[4]=(l*D-a*k-c*T)*I,e[5]=(t*k-r*D+s*T)*I,e[6]=(g*b-m*A-v*w)*I,e[7]=(d*A-h*b+p*w)*I,e[8]=(a*F-o*D+c*_)*I,e[9]=(i*D-t*F-s*_)*I,e[10]=(m*S-x*b+v*y)*I,e[11]=(f*b-d*S-p*y)*I,e[12]=(o*T-a*L-l*_)*I,e[13]=(t*L-i*T+r*_)*I,e[14]=(x*w-m*E-g*y)*I,e[15]=(d*E-f*w+h*y)*I,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,a=e.x,o=e.y,l=e.z,c=s*a,d=s*o;return this.set(c*a+i,c*o-r*l,c*l+r*o,0,c*o+r*l,d*o+i,d*l-r*a,0,c*l-r*o,d*l+r*a,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,a){return this.set(1,i,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,d=a+a,f=o+o,h=s*c,p=s*d,m=s*f,x=a*d,g=a*f,v=o*f,y=l*c,w=l*d,b=l*f,E=i.x,S=i.y,A=i.z;return r[0]=(1-(x+v))*E,r[1]=(p+b)*E,r[2]=(m-w)*E,r[3]=0,r[4]=(p-b)*S,r[5]=(1-(h+v))*S,r[6]=(g+y)*S,r[7]=0,r[8]=(m+w)*A,r[9]=(g-y)*A,r[10]=(1-(h+x))*A,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinant();if(s===0)return i.set(1,1,1),t.identity(),this;let a=Hr.set(r[0],r[1],r[2]).length();const o=Hr.set(r[4],r[5],r[6]).length(),l=Hr.set(r[8],r[9],r[10]).length();s<0&&(a=-a),hi.copy(this);const c=1/a,d=1/o,f=1/l;return hi.elements[0]*=c,hi.elements[1]*=c,hi.elements[2]*=c,hi.elements[4]*=d,hi.elements[5]*=d,hi.elements[6]*=d,hi.elements[8]*=f,hi.elements[9]*=f,hi.elements[10]*=f,t.setFromRotationMatrix(hi),i.x=a,i.y=o,i.z=l,this}makePerspective(e,t,i,r,s,a,o=Ni,l=!1){const c=this.elements,d=2*s/(t-e),f=2*s/(i-r),h=(t+e)/(t-e),p=(i+r)/(i-r);let m,x;if(l)m=s/(a-s),x=a*s/(a-s);else if(o===Ni)m=-(a+s)/(a-s),x=-2*a*s/(a-s);else if(o===la)m=-a/(a-s),x=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=d,c[4]=0,c[8]=h,c[12]=0,c[1]=0,c[5]=f,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=m,c[14]=x,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,i,r,s,a,o=Ni,l=!1){const c=this.elements,d=2/(t-e),f=2/(i-r),h=-(t+e)/(t-e),p=-(i+r)/(i-r);let m,x;if(l)m=1/(a-s),x=a/(a-s);else if(o===Ni)m=-2/(a-s),x=-(a+s)/(a-s);else if(o===la)m=-1/(a-s),x=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=d,c[4]=0,c[8]=0,c[12]=h,c[1]=0,c[5]=f,c[9]=0,c[13]=p,c[2]=0,c[6]=0,c[10]=m,c[14]=x,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}};el.prototype.isMatrix4=!0;let Lt=el;const Hr=new X,hi=new Lt,Hx=new X(0,0,0),Gx=new X(1,1,1),Qi=new X,Pa=new X,$n=new X,wh=new Lt,Eh=new xi;class Xn{constructor(e=0,t=0,i=0,r=Xn.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],d=r[9],f=r[2],h=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(gt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-d,p),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-gt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(gt(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-f,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-gt(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(h,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(gt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-gt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-d,p),this._y=0);break;default:ft("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return wh.makeRotationFromQuaternion(e),this.setFromRotationMatrix(wh,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Eh.setFromEuler(this),this.setFromQuaternion(Eh,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Xn.DEFAULT_ORDER="XYZ";class bd{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Wx=0;const Th=new X,Gr=new xi,Bi=new Lt,Ra=new X,Fs=new X,Xx=new X,jx=new xi,Ah=new X(1,0,0),Ch=new X(0,1,0),Ph=new X(0,0,1),Rh={type:"added"},qx={type:"removed"},Wr={type:"childadded",child:null},Rl={type:"childremoved",child:null};class rn extends mr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Wx++}),this.uuid=ji(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=rn.DEFAULT_UP.clone();const e=new X,t=new Xn,i=new xi,r=new X(1,1,1);function s(){i.setFromEuler(t,!1)}function a(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Lt},normalMatrix:{value:new xt}}),this.matrix=new Lt,this.matrixWorld=new Lt,this.matrixAutoUpdate=rn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=rn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new bd,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Gr.setFromAxisAngle(e,t),this.quaternion.multiply(Gr),this}rotateOnWorldAxis(e,t){return Gr.setFromAxisAngle(e,t),this.quaternion.premultiply(Gr),this}rotateX(e){return this.rotateOnAxis(Ah,e)}rotateY(e){return this.rotateOnAxis(Ch,e)}rotateZ(e){return this.rotateOnAxis(Ph,e)}translateOnAxis(e,t){return Th.copy(e).applyQuaternion(this.quaternion),this.position.add(Th.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Ah,e)}translateY(e){return this.translateOnAxis(Ch,e)}translateZ(e){return this.translateOnAxis(Ph,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Bi.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?Ra.copy(e):Ra.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Fs.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Bi.lookAt(Fs,Ra,this.up):Bi.lookAt(Ra,Fs,this.up),this.quaternion.setFromRotationMatrix(Bi),r&&(Bi.extractRotation(r.matrixWorld),Gr.setFromRotationMatrix(Bi),this.quaternion.premultiply(Gr.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(Tt("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Rh),Wr.child=e,this.dispatchEvent(Wr),Wr.child=null):Tt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(qx),Rl.child=e,this.dispatchEvent(Rl),Rl.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Bi.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Bi.multiply(e.parent.matrixWorld)),e.applyMatrix4(Bi),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Rh),Wr.child=e,this.dispatchEvent(Wr),Wr.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){const a=this.children[i].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Fs,e,Xx),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Fs,jx,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,i=e.y,r=e.z,s=this.matrix.elements;s[12]+=t-s[0]*t-s[4]*i-s[8]*r,s[13]+=i-s[1]*t-s[5]*i-s[9]*r,s[14]+=r-s[2]*t-s[6]*i-s[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,d=l.length;c<d;c++){const f=l[c];s(e.shapes,f)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),d=a(e.images),f=a(e.shapes),h=a(e.skeletons),p=a(e.animations),m=a(e.nodes);o.length>0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),d.length>0&&(i.images=d),f.length>0&&(i.shapes=f),h.length>0&&(i.skeletons=h),p.length>0&&(i.animations=p),m.length>0&&(i.nodes=m)}return i.object=r,i;function a(o){const l=[];for(const c in o){const d=o[c];delete d.metadata,l.push(d)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}rn.DEFAULT_UP=new X(0,1,0);rn.DEFAULT_MATRIX_AUTO_UPDATE=!0;rn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let Qs=class extends rn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const Yx={type:"move"};class Dl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Qs,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Qs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new X,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new X),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Qs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new X,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new X,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const x of e.hand.values()){const g=t.getJointPose(x,i),v=this._getHandJoint(c,x);g!==null&&(v.matrix.fromArray(g.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=g.radius),v.visible=g!==null}const d=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=d.position.distanceTo(f.position),p=.02,m=.005;c.inputState.pinching&&h>p+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=p-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1,l.eventsEnabled&&l.dispatchEvent({type:"gripUpdated",data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Yx)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Qs;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const hm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},er={h:0,s:0,l:0},Da={h:0,s:0,l:0};function Ll(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class tt{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Wn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,At.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=At.workingColorSpace){return this.r=e,this.g=t,this.b=i,At.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=At.workingColorSpace){if(e=_d(e,1),t=gt(t,0,1),i=gt(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,a=2*i-s;this.r=Ll(a,s,e+1/3),this.g=Ll(a,s,e),this.b=Ll(a,s,e-1/3)}return At.colorSpaceToWorking(this,r),this}setStyle(e,t=Wn){function i(s){s!==void 0&&parseFloat(s)<1&&ft("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:ft("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);ft("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Wn){const i=hm[e.toLowerCase()];return i!==void 0?this.setHex(i,t):ft("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=qi(e.r),this.g=qi(e.g),this.b=qi(e.b),this}copyLinearToSRGB(e){return this.r=Ss(e.r),this.g=Ss(e.g),this.b=Ss(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Wn){return At.workingToColorSpace(Nn.copy(this),e),Math.round(gt(Nn.r*255,0,255))*65536+Math.round(gt(Nn.g*255,0,255))*256+Math.round(gt(Nn.b*255,0,255))}getHexString(e=Wn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=At.workingColorSpace){At.workingToColorSpace(Nn.copy(this),t);const i=Nn.r,r=Nn.g,s=Nn.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let l,c;const d=(o+a)/2;if(o===a)l=0,c=0;else{const f=a-o;switch(c=d<=.5?f/(a+o):f/(2-a-o),a){case i:l=(r-s)/f+(r<s?6:0);break;case r:l=(s-i)/f+2;break;case s:l=(i-r)/f+4;break}l/=6}return e.h=l,e.s=c,e.l=d,e}getRGB(e,t=At.workingColorSpace){return At.workingToColorSpace(Nn.copy(this),t),e.r=Nn.r,e.g=Nn.g,e.b=Nn.b,e}getStyle(e=Wn){At.workingToColorSpace(Nn.copy(this),e);const t=Nn.r,i=Nn.g,r=Nn.b;return e!==Wn?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(er),this.setHSL(er.h+e,er.s+t,er.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(er),e.getHSL(Da);const i=ra(er.h,Da.h,t),r=ra(er.s,Da.s,t),s=ra(er.l,Da.l,t);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Nn=new tt;tt.NAMES=hm;class Kx extends rn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Xn,this.environmentIntensity=1,this.environmentRotation=new Xn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const fi=new X,ki=new X,Il=new X,Vi=new X,Xr=new X,jr=new X,Dh=new X,Nl=new X,Ul=new X,Fl=new X,Ol=new kt,zl=new kt,Bl=new kt;class ei{constructor(e=new X,t=new X,i=new X){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),fi.subVectors(e,t),r.cross(fi);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){fi.subVectors(r,t),ki.subVectors(i,t),Il.subVectors(e,t);const a=fi.dot(fi),o=fi.dot(ki),l=fi.dot(Il),c=ki.dot(ki),d=ki.dot(Il),f=a*c-o*o;if(f===0)return s.set(0,0,0),null;const h=1/f,p=(c*l-o*d)*h,m=(a*d-o*l)*h;return s.set(1-p-m,m,p)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Vi)===null?!1:Vi.x>=0&&Vi.y>=0&&Vi.x+Vi.y<=1}static getInterpolation(e,t,i,r,s,a,o,l){return this.getBarycoord(e,t,i,r,Vi)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Vi.x),l.addScaledVector(a,Vi.y),l.addScaledVector(o,Vi.z),l)}static getInterpolatedAttribute(e,t,i,r,s,a){return Ol.setScalar(0),zl.setScalar(0),Bl.setScalar(0),Ol.fromBufferAttribute(e,t),zl.fromBufferAttribute(e,i),Bl.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(Ol,s.x),a.addScaledVector(zl,s.y),a.addScaledVector(Bl,s.z),a}static isFrontFacing(e,t,i,r){return fi.subVectors(i,t),ki.subVectors(e,t),fi.cross(ki).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return fi.subVectors(this.c,this.b),ki.subVectors(this.a,this.b),fi.cross(ki).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ei.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return ei.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return ei.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return ei.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ei.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let a,o;Xr.subVectors(r,i),jr.subVectors(s,i),Nl.subVectors(e,i);const l=Xr.dot(Nl),c=jr.dot(Nl);if(l<=0&&c<=0)return t.copy(i);Ul.subVectors(e,r);const d=Xr.dot(Ul),f=jr.dot(Ul);if(d>=0&&f<=d)return t.copy(r);const h=l*f-d*c;if(h<=0&&l>=0&&d<=0)return a=l/(l-d),t.copy(i).addScaledVector(Xr,a);Fl.subVectors(e,s);const p=Xr.dot(Fl),m=jr.dot(Fl);if(m>=0&&p<=m)return t.copy(s);const x=p*c-l*m;if(x<=0&&c>=0&&m<=0)return o=c/(c-m),t.copy(i).addScaledVector(jr,o);const g=d*m-p*f;if(g<=0&&f-d>=0&&p-m>=0)return Dh.subVectors(s,r),o=(f-d)/(f-d+(p-m)),t.copy(r).addScaledVector(Dh,o);const v=1/(g+x+h);return a=x*v,o=h*v,t.copy(i).addScaledVector(Xr,a).addScaledVector(jr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class di{constructor(e=new X(1/0,1/0,1/0),t=new X(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(pi.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(pi.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=pi.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,pi):pi.fromBufferAttribute(s,a),pi.applyMatrix4(e.matrixWorld),this.expandByPoint(pi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),La.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),La.copy(i.boundingBox)),La.applyMatrix4(e.matrixWorld),this.union(La)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,pi),pi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Os),Ia.subVectors(this.max,Os),qr.subVectors(e.a,Os),Yr.subVectors(e.b,Os),Kr.subVectors(e.c,Os),tr.subVectors(Yr,qr),nr.subVectors(Kr,Yr),vr.subVectors(qr,Kr);let t=[0,-tr.z,tr.y,0,-nr.z,nr.y,0,-vr.z,vr.y,tr.z,0,-tr.x,nr.z,0,-nr.x,vr.z,0,-vr.x,-tr.y,tr.x,0,-nr.y,nr.x,0,-vr.y,vr.x,0];return!kl(t,qr,Yr,Kr,Ia)||(t=[1,0,0,0,1,0,0,0,1],!kl(t,qr,Yr,Kr,Ia))?!1:(Na.crossVectors(tr,nr),t=[Na.x,Na.y,Na.z],kl(t,qr,Yr,Kr,Ia))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,pi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(pi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Hi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Hi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Hi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Hi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Hi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Hi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Hi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Hi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Hi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Hi=[new X,new X,new X,new X,new X,new X,new X,new X],pi=new X,La=new di,qr=new X,Yr=new X,Kr=new X,tr=new X,nr=new X,vr=new X,Os=new X,Ia=new X,Na=new X,_r=new X;function kl(n,e,t,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){_r.fromArray(n,s);const o=r.x*Math.abs(_r.x)+r.y*Math.abs(_r.y)+r.z*Math.abs(_r.z),l=e.dot(_r),c=t.dot(_r),d=i.dot(_r);if(Math.max(-Math.max(l,c,d),Math.min(l,c,d))>o)return!1}return!0}const Xi=Zx();function Zx(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,d=0;for(;(c&8388608)===0;)c<<=1,d-=8388608;c&=-8388609,d+=947912704,s[l]=c|d}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function $x(n){Math.abs(n)>65504&&ft("DataUtils.toHalfFloat(): Value out of range."),n=gt(n,-65504,65504),Xi.floatView[0]=n;const e=Xi.uint32View[0],t=e>>23&511;return Xi.baseTable[t]+((e&8388607)>>Xi.shiftTable[t])}function Jx(n){const e=n>>10;return Xi.uint32View[0]=Xi.mantissaTable[Xi.offsetTable[e]+(n&1023)]+Xi.exponentTable[e],Xi.floatView[0]}class Ua{static toHalfFloat(e){return $x(e)}static fromHalfFloat(e){return Jx(e)}}const mn=new X,Fa=new it;let Qx=0;class kn extends mr{constructor(e,t,i=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Qx++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=au,this.updateRanges=[],this.gpuType=ti,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)Fa.fromBufferAttribute(this,t),Fa.applyMatrix3(e),this.setXY(t,Fa.x,Fa.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)mn.fromBufferAttribute(this,t),mn.applyMatrix3(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)mn.fromBufferAttribute(this,t),mn.applyMatrix4(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)mn.fromBufferAttribute(this,t),mn.applyNormalMatrix(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)mn.fromBufferAttribute(this,t),mn.transformDirection(e),this.setXYZ(t,mn.x,mn.y,mn.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=vi(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ot(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=vi(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=vi(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=vi(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=vi(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array),s=Ot(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==au&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class fm extends kn{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class pm extends kn{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class sn extends kn{constructor(e,t,i){super(new Float32Array(e),t,i)}}const eb=new di,zs=new X,Vl=new X;class Ur{constructor(e=new X,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):eb.setFromPoints(e).getCenter(i);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;zs.subVectors(e,this.center);const t=zs.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(zs,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Vl.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(zs.copy(e.center).add(Vl)),this.expandByPoint(zs.copy(e.center).sub(Vl))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let tb=0;const ai=new Lt,Hl=new rn,Zr=new X,Jn=new di,Bs=new di,Sn=new X;class on extends mr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:tb++}),this.uuid=ji(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(gx(e)?pm:fm)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new xt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ai.makeRotationFromQuaternion(e),this.applyMatrix4(ai),this}rotateX(e){return ai.makeRotationX(e),this.applyMatrix4(ai),this}rotateY(e){return ai.makeRotationY(e),this.applyMatrix4(ai),this}rotateZ(e){return ai.makeRotationZ(e),this.applyMatrix4(ai),this}translate(e,t,i){return ai.makeTranslation(e,t,i),this.applyMatrix4(ai),this}scale(e,t,i){return ai.makeScale(e,t,i),this.applyMatrix4(ai),this}lookAt(e){return Hl.lookAt(e),Hl.updateMatrix(),this.applyMatrix4(Hl.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Zr).negate(),this.translate(Zr.x,Zr.y,Zr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];i.push(a.x,a.y,a.z||0)}this.setAttribute("position",new sn(i,3))}else{const i=Math.min(e.length,t.count);for(let r=0;r<i;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&ft("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new di);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Tt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new X(-1/0,-1/0,-1/0),new X(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const s=t[i];Jn.setFromBufferAttribute(s),this.morphTargetsRelative?(Sn.addVectors(this.boundingBox.min,Jn.min),this.boundingBox.expandByPoint(Sn),Sn.addVectors(this.boundingBox.max,Jn.max),this.boundingBox.expandByPoint(Sn)):(this.boundingBox.expandByPoint(Jn.min),this.boundingBox.expandByPoint(Jn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Tt('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ur);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Tt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new X,1/0);return}if(e){const i=this.boundingSphere.center;if(Jn.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];Bs.setFromBufferAttribute(o),this.morphTargetsRelative?(Sn.addVectors(Jn.min,Bs.min),Jn.expandByPoint(Sn),Sn.addVectors(Jn.max,Bs.max),Jn.expandByPoint(Sn)):(Jn.expandByPoint(Bs.min),Jn.expandByPoint(Bs.max))}Jn.getCenter(i);let r=0;for(let s=0,a=e.count;s<a;s++)Sn.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(Sn));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,d=o.count;c<d;c++)Sn.fromBufferAttribute(o,c),l&&(Zr.fromBufferAttribute(e,c),Sn.add(Zr)),r=Math.max(r,i.distanceToSquared(Sn))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&Tt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){Tt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new kn(new Float32Array(4*i.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let _=0;_<i.count;_++)o[_]=new X,l[_]=new X;const c=new X,d=new X,f=new X,h=new it,p=new it,m=new it,x=new X,g=new X;function v(_,T,D){c.fromBufferAttribute(i,_),d.fromBufferAttribute(i,T),f.fromBufferAttribute(i,D),h.fromBufferAttribute(s,_),p.fromBufferAttribute(s,T),m.fromBufferAttribute(s,D),d.sub(c),f.sub(c),p.sub(h),m.sub(h);const L=1/(p.x*m.y-m.x*p.y);isFinite(L)&&(x.copy(d).multiplyScalar(m.y).addScaledVector(f,-p.y).multiplyScalar(L),g.copy(f).multiplyScalar(p.x).addScaledVector(d,-m.x).multiplyScalar(L),o[_].add(x),o[T].add(x),o[D].add(x),l[_].add(g),l[T].add(g),l[D].add(g))}let y=this.groups;y.length===0&&(y=[{start:0,count:e.count}]);for(let _=0,T=y.length;_<T;++_){const D=y[_],L=D.start,F=D.count;for(let k=L,U=L+F;k<U;k+=3)v(e.getX(k+0),e.getX(k+1),e.getX(k+2))}const w=new X,b=new X,E=new X,S=new X;function A(_){E.fromBufferAttribute(r,_),S.copy(E);const T=o[_];w.copy(T),w.sub(E.multiplyScalar(E.dot(T))).normalize(),b.crossVectors(S,T);const L=b.dot(l[_])<0?-1:1;a.setXYZW(_,w.x,w.y,w.z,L)}for(let _=0,T=y.length;_<T;++_){const D=y[_],L=D.start,F=D.count;for(let k=L,U=L+F;k<U;k+=3)A(e.getX(k+0)),A(e.getX(k+1)),A(e.getX(k+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new kn(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let h=0,p=i.count;h<p;h++)i.setXYZ(h,0,0,0);const r=new X,s=new X,a=new X,o=new X,l=new X,c=new X,d=new X,f=new X;if(e)for(let h=0,p=e.count;h<p;h+=3){const m=e.getX(h+0),x=e.getX(h+1),g=e.getX(h+2);r.fromBufferAttribute(t,m),s.fromBufferAttribute(t,x),a.fromBufferAttribute(t,g),d.subVectors(a,s),f.subVectors(r,s),d.cross(f),o.fromBufferAttribute(i,m),l.fromBufferAttribute(i,x),c.fromBufferAttribute(i,g),o.add(d),l.add(d),c.add(d),i.setXYZ(m,o.x,o.y,o.z),i.setXYZ(x,l.x,l.y,l.z),i.setXYZ(g,c.x,c.y,c.z)}else for(let h=0,p=t.count;h<p;h+=3)r.fromBufferAttribute(t,h+0),s.fromBufferAttribute(t,h+1),a.fromBufferAttribute(t,h+2),d.subVectors(a,s),f.subVectors(r,s),d.cross(f),i.setXYZ(h+0,d.x,d.y,d.z),i.setXYZ(h+1,d.x,d.y,d.z),i.setXYZ(h+2,d.x,d.y,d.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)Sn.fromBufferAttribute(e,t),Sn.normalize(),e.setXYZ(t,Sn.x,Sn.y,Sn.z)}toNonIndexed(){function e(o,l){const c=o.array,d=o.itemSize,f=o.normalized,h=new c.constructor(l.length*d);let p=0,m=0;for(let x=0,g=l.length;x<g;x++){o.isInterleavedBufferAttribute?p=l[x]*o.data.stride+o.offset:p=l[x]*d;for(let v=0;v<d;v++)h[m++]=c[p++]}return new kn(h,d,f)}if(this.index===null)return ft("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new on,i=this.index.array,r=this.attributes;for(const o in r){const l=r[o],c=e(l,i);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let d=0,f=c.length;d<f;d++){const h=c[d],p=e(h,i);l.push(p)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],d=[];for(let f=0,h=c.length;f<h;f++){const p=c[f];d.push(p.toJSON(e.data))}d.length>0&&(r[l]=d,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const c in r){const d=r[c];this.setAttribute(c,d.clone(t))}const s=e.morphAttributes;for(const c in s){const d=[],f=s[c];for(let h=0,p=f.length;h<p;h++)d.push(f[h].clone(t));this.morphAttributes[c]=d}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,d=a.length;c<d;c++){const f=a[c];this.addGroup(f.start,f.count,f.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class mm{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=au,this.updateRanges=[],this.version=0,this.uuid=ji()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ji()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=ji()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const On=new X;class Ui{constructor(e,t,i,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)On.fromBufferAttribute(this,t),On.applyMatrix4(e),this.setXYZ(t,On.x,On.y,On.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)On.fromBufferAttribute(this,t),On.applyNormalMatrix(e),this.setXYZ(t,On.x,On.y,On.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)On.fromBufferAttribute(this,t),On.transformDirection(e),this.setXYZ(t,On.x,On.y,On.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=vi(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Ot(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ot(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=vi(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=vi(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=vi(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=vi(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ot(t,this.array),i=Ot(i,this.array),r=Ot(r,this.array),s=Ot(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){jo("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new kn(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Ui(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){jo("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let nb=0;class yi extends mr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:nb++}),this.uuid=ji(),this.name="",this.type="Material",this.blending=bs,this.side=Kn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=_c,this.blendDst=xc,this.blendEquation=gi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new tt(0,0,0),this.blendAlpha=0,this.depthFunc=ws,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=vh,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=kr,this.stencilZFail=kr,this.stencilZPass=kr,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){ft(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){ft(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==bs&&(i.blending=this.blending),this.side!==Kn&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==_c&&(i.blendSrc=this.blendSrc),this.blendDst!==xc&&(i.blendDst=this.blendDst),this.blendEquation!==gi&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==ws&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==vh&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==kr&&(i.stencilFail=this.stencilFail),this.stencilZFail!==kr&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==kr&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=r(e.textures),a=r(e.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class gm extends yi{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new tt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let $r;const ks=new X,Jr=new X,Qr=new X,es=new it,Vs=new it,vm=new Lt,Oa=new X,Hs=new X,za=new X,Lh=new it,Gl=new it,Ih=new it;class ts extends rn{constructor(e=new gm){if(super(),this.isSprite=!0,this.type="Sprite",$r===void 0){$r=new on;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new mm(t,5);$r.setIndex([0,1,2,0,2,3]),$r.setAttribute("position",new Ui(i,3,0,!1)),$r.setAttribute("uv",new Ui(i,2,3,!1))}this.geometry=$r,this.material=e,this.center=new it(.5,.5),this.count=1}raycast(e,t){e.camera===null&&Tt('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Jr.setFromMatrixScale(this.matrixWorld),vm.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Qr.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Jr.multiplyScalar(-Qr.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const a=this.center;Ba(Oa.set(-.5,-.5,0),Qr,a,Jr,r,s),Ba(Hs.set(.5,-.5,0),Qr,a,Jr,r,s),Ba(za.set(.5,.5,0),Qr,a,Jr,r,s),Lh.set(0,0),Gl.set(1,0),Ih.set(1,1);let o=e.ray.intersectTriangle(Oa,Hs,za,!1,ks);if(o===null&&(Ba(Hs.set(-.5,.5,0),Qr,a,Jr,r,s),Gl.set(0,1),o=e.ray.intersectTriangle(Oa,za,Hs,!1,ks),o===null))return;const l=e.ray.origin.distanceTo(ks);l<e.near||l>e.far||t.push({distance:l,point:ks.clone(),uv:ei.getInterpolation(ks,Oa,Hs,za,Lh,Gl,Ih,new it),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Ba(n,e,t,i,r,s){es.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Vs.x=s*es.x-r*es.y,Vs.y=r*es.x+s*es.y):Vs.copy(es),n.copy(e),n.x+=Vs.x,n.y+=Vs.y,n.applyMatrix4(vm)}const Gi=new X,Wl=new X,ka=new X,ir=new X,Xl=new X,Va=new X,jl=new X;class ba{constructor(e=new X,t=new X(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Gi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Gi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Gi.copy(this.origin).addScaledVector(this.direction,t),Gi.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Wl.copy(e).add(t).multiplyScalar(.5),ka.copy(t).sub(e).normalize(),ir.copy(this.origin).sub(Wl);const s=e.distanceTo(t)*.5,a=-this.direction.dot(ka),o=ir.dot(this.direction),l=-ir.dot(ka),c=ir.lengthSq(),d=Math.abs(1-a*a);let f,h,p,m;if(d>0)if(f=a*l-o,h=a*o-l,m=s*d,f>=0)if(h>=-m)if(h<=m){const x=1/d;f*=x,h*=x,p=f*(f+a*h+2*o)+h*(a*f+h+2*l)+c}else h=s,f=Math.max(0,-(a*h+o)),p=-f*f+h*(h+2*l)+c;else h=-s,f=Math.max(0,-(a*h+o)),p=-f*f+h*(h+2*l)+c;else h<=-m?(f=Math.max(0,-(-a*s+o)),h=f>0?-s:Math.min(Math.max(-s,-l),s),p=-f*f+h*(h+2*l)+c):h<=m?(f=0,h=Math.min(Math.max(-s,-l),s),p=h*(h+2*l)+c):(f=Math.max(0,-(a*s+o)),h=f>0?s:Math.min(Math.max(-s,-l),s),p=-f*f+h*(h+2*l)+c);else h=a>0?-s:s,f=Math.max(0,-(a*h+o)),p=-f*f+h*(h+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),r&&r.copy(Wl).addScaledVector(ka,h),p}intersectSphere(e,t){Gi.subVectors(e.center,this.origin);const i=Gi.dot(this.direction),r=Gi.dot(Gi)-i*i,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,a,o,l;const c=1/this.direction.x,d=1/this.direction.y,f=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),d>=0?(s=(e.min.y-h.y)*d,a=(e.max.y-h.y)*d):(s=(e.max.y-h.y)*d,a=(e.min.y-h.y)*d),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a<r||isNaN(r))&&(r=a),f>=0?(o=(e.min.z-h.z)*f,l=(e.max.z-h.z)*f):(o=(e.max.z-h.z)*f,l=(e.min.z-h.z)*f),i>l||o>r)||((o>i||i!==i)&&(i=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Gi)!==null}intersectTriangle(e,t,i,r,s){Xl.subVectors(t,e),Va.subVectors(i,e),jl.crossVectors(Xl,Va);let a=this.direction.dot(jl),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;ir.subVectors(this.origin,e);const l=o*this.direction.dot(Va.crossVectors(ir,Va));if(l<0)return null;const c=o*this.direction.dot(Xl.cross(ir));if(c<0||l+c>a)return null;const d=-o*ir.dot(jl);return d<0?null:this.at(d/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class yd extends yi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new tt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Xn,this.combine=em,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Nh=new Lt,xr=new ba,Ha=new Ur,Uh=new X,Ga=new X,Wa=new X,Xa=new X,ql=new X,ja=new X,Fh=new X,qa=new X;class an extends rn{constructor(e=new on,t=new yd){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,a=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){ja.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const d=o[l],f=s[l];d!==0&&(ql.fromBufferAttribute(f,e),a?ja.addScaledVector(ql,d):ja.addScaledVector(ql.sub(t),d))}t.add(ja)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Ha.copy(i.boundingSphere),Ha.applyMatrix4(s),xr.copy(e.ray).recast(e.near),!(Ha.containsPoint(xr.origin)===!1&&(xr.intersectSphere(Ha,Uh)===null||xr.origin.distanceToSquared(Uh)>(e.far-e.near)**2))&&(Nh.copy(s).invert(),xr.copy(e.ray).applyMatrix4(Nh),!(i.boundingBox!==null&&xr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,xr)))}_computeIntersections(e,t,i){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,d=s.attributes.uv1,f=s.attributes.normal,h=s.groups,p=s.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,x=h.length;m<x;m++){const g=h[m],v=a[g.materialIndex],y=Math.max(g.start,p.start),w=Math.min(o.count,Math.min(g.start+g.count,p.start+p.count));for(let b=y,E=w;b<E;b+=3){const S=o.getX(b),A=o.getX(b+1),_=o.getX(b+2);r=Ya(this,v,e,i,c,d,f,S,A,_),r&&(r.faceIndex=Math.floor(b/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const m=Math.max(0,p.start),x=Math.min(o.count,p.start+p.count);for(let g=m,v=x;g<v;g+=3){const y=o.getX(g),w=o.getX(g+1),b=o.getX(g+2);r=Ya(this,a,e,i,c,d,f,y,w,b),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,x=h.length;m<x;m++){const g=h[m],v=a[g.materialIndex],y=Math.max(g.start,p.start),w=Math.min(l.count,Math.min(g.start+g.count,p.start+p.count));for(let b=y,E=w;b<E;b+=3){const S=b,A=b+1,_=b+2;r=Ya(this,v,e,i,c,d,f,S,A,_),r&&(r.faceIndex=Math.floor(b/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const m=Math.max(0,p.start),x=Math.min(l.count,p.start+p.count);for(let g=m,v=x;g<v;g+=3){const y=g,w=g+1,b=g+2;r=Ya(this,a,e,i,c,d,f,y,w,b),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}}}function ib(n,e,t,i,r,s,a,o){let l;if(e.side===Yn?l=i.intersectTriangle(a,s,r,!0,o):l=i.intersectTriangle(r,s,a,e.side===Kn,o),l===null)return null;qa.copy(o),qa.applyMatrix4(n.matrixWorld);const c=t.ray.origin.distanceTo(qa);return c<t.near||c>t.far?null:{distance:c,point:qa.clone(),object:n}}function Ya(n,e,t,i,r,s,a,o,l,c){n.getVertexPosition(o,Ga),n.getVertexPosition(l,Wa),n.getVertexPosition(c,Xa);const d=ib(n,e,t,i,Ga,Wa,Xa,Fh);if(d){const f=new X;ei.getBarycoord(Fh,Ga,Wa,Xa,f),r&&(d.uv=ei.getInterpolatedAttribute(r,o,l,c,f,new it)),s&&(d.uv1=ei.getInterpolatedAttribute(s,o,l,c,f,new it)),a&&(d.normal=ei.getInterpolatedAttribute(a,o,l,c,f,new X),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const h={a:o,b:l,c,normal:new X,materialIndex:0};ei.getNormal(Ga,Wa,Xa,h.normal),d.face=h,d.barycoord=f}return d}class cl extends En{constructor(e=null,t=1,i=1,r,s,a,o,l,c=xn,d=xn,f,h){super(null,a,o,l,c,d,r,s,f,h),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Yl=new X,rb=new X,sb=new xt;class sr{constructor(e=new X(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=Yl.subVectors(i,t).cross(rb.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,i=!0){const r=e.delta(Yl),s=this.normal.dot(r);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/s;return i===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||sb.getNormalMatrix(e),r=this.coplanarPoint(Yl).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const br=new Ur,ab=new it(.5,.5),Ka=new X;class Sd{constructor(e=new sr,t=new sr,i=new sr,r=new sr,s=new sr,a=new sr){this.planes=[e,t,i,r,s,a]}set(e,t,i,r,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Ni,i=!1){const r=this.planes,s=e.elements,a=s[0],o=s[1],l=s[2],c=s[3],d=s[4],f=s[5],h=s[6],p=s[7],m=s[8],x=s[9],g=s[10],v=s[11],y=s[12],w=s[13],b=s[14],E=s[15];if(r[0].setComponents(c-a,p-d,v-m,E-y).normalize(),r[1].setComponents(c+a,p+d,v+m,E+y).normalize(),r[2].setComponents(c+o,p+f,v+x,E+w).normalize(),r[3].setComponents(c-o,p-f,v-x,E-w).normalize(),i)r[4].setComponents(l,h,g,b).normalize(),r[5].setComponents(c-l,p-h,v-g,E-b).normalize();else if(r[4].setComponents(c-l,p-h,v-g,E-b).normalize(),t===Ni)r[5].setComponents(c+l,p+h,v+g,E+b).normalize();else if(t===la)r[5].setComponents(l,h,g,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),br.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),br.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(br)}intersectsSprite(e){br.center.set(0,0,0);const t=ab.distanceTo(e.center);return br.radius=.7071067811865476+t,br.applyMatrix4(e.matrixWorld),this.intersectsSphere(br)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(Ka.x=r.normal.x>0?e.max.x:e.min.x,Ka.y=r.normal.y>0?e.max.y:e.min.y,Ka.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Ka)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class ob extends yi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new tt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const qo=new X,Yo=new X,Oh=new Lt,Gs=new ba,Za=new Ur,Kl=new X,zh=new X;class lb extends rn{constructor(e=new on,t=new ob){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)qo.fromBufferAttribute(t,r-1),Yo.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=qo.distanceTo(Yo);e.setAttribute("lineDistance",new sn(i,1))}else ft("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,a=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Za.copy(i.boundingSphere),Za.applyMatrix4(r),Za.radius+=s,e.ray.intersectsSphere(Za)===!1)return;Oh.copy(r).invert(),Gs.copy(e.ray).applyMatrix4(Oh);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,d=i.index,h=i.attributes.position;if(d!==null){const p=Math.max(0,a.start),m=Math.min(d.count,a.start+a.count);for(let x=p,g=m-1;x<g;x+=c){const v=d.getX(x),y=d.getX(x+1),w=$a(this,e,Gs,l,v,y,x);w&&t.push(w)}if(this.isLineLoop){const x=d.getX(m-1),g=d.getX(p),v=$a(this,e,Gs,l,x,g,m-1);v&&t.push(v)}}else{const p=Math.max(0,a.start),m=Math.min(h.count,a.start+a.count);for(let x=p,g=m-1;x<g;x+=c){const v=$a(this,e,Gs,l,x,x+1,x);v&&t.push(v)}if(this.isLineLoop){const x=$a(this,e,Gs,l,m-1,p,m-1);x&&t.push(x)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function $a(n,e,t,i,r,s,a){const o=n.geometry.attributes.position;if(qo.fromBufferAttribute(o,r),Yo.fromBufferAttribute(o,s),t.distanceSqToSegment(qo,Yo,Kl,zh)>i)return;Kl.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(Kl);if(!(c<e.near||c>e.far))return{distance:c,point:zh.clone().applyMatrix4(n.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:n}}class Ko extends yi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new tt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Bh=new Lt,lu=new ba,Ja=new Ur,Qa=new X;class Zo extends rn{constructor(e=new on,t=new Ko){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,a=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),Ja.copy(i.boundingSphere),Ja.applyMatrix4(r),Ja.radius+=s,e.ray.intersectsSphere(Ja)===!1)return;Bh.copy(r).invert(),lu.copy(e.ray).applyMatrix4(Bh);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=i.index,f=i.attributes.position;if(c!==null){const h=Math.max(0,a.start),p=Math.min(c.count,a.start+a.count);for(let m=h,x=p;m<x;m++){const g=c.getX(m);Qa.fromBufferAttribute(f,g),kh(Qa,g,l,r,e,t,this)}}else{const h=Math.max(0,a.start),p=Math.min(f.count,a.start+a.count);for(let m=h,x=p;m<x;m++)Qa.fromBufferAttribute(f,m),kh(Qa,m,l,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function kh(n,e,t,i,r,s,a){const o=lu.distanceSqToPoint(n);if(o<t){const l=new X;lu.closestPointToPoint(n,l),l.applyMatrix4(i);const c=r.ray.origin.distanceTo(l);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class _m extends En{constructor(e=[],t=Dr,i,r,s,a,o,l,c,d){super(e,t,i,r,s,a,o,l,c,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class cb extends En{constructor(e,t,i,r,s,a,o,l,c){super(e,t,i,r,s,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Nr extends En{constructor(e,t,i=Oi,r,s,a,o=xn,l=xn,c,d=Yi,f=1){if(d!==Yi&&d!==cr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const h={width:e,height:t,depth:f};super(h,r,s,a,o,l,d,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new xd(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class ub extends Nr{constructor(e,t=Oi,i=Dr,r,s,a=xn,o=xn,l,c=Yi){const d={width:e,height:e,depth:1},f=[d,d,d,d,d,d];super(e,e,t,i,r,s,a,o,l,c),this.image=f,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class xm extends En{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class ya extends on{constructor(e=1,t=1,i=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],d=[],f=[];let h=0,p=0;m("z","y","x",-1,-1,i,t,e,a,s,0),m("z","y","x",1,-1,i,t,-e,a,s,1),m("x","z","y",1,1,e,i,t,r,a,2),m("x","z","y",1,-1,e,i,-t,r,a,3),m("x","y","z",1,-1,e,t,i,r,s,4),m("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new sn(c,3)),this.setAttribute("normal",new sn(d,3)),this.setAttribute("uv",new sn(f,2));function m(x,g,v,y,w,b,E,S,A,_,T){const D=b/A,L=E/_,F=b/2,k=E/2,U=S/2,I=A+1,R=_+1;let z=0,q=0;const Y=new X;for(let te=0;te<R;te++){const le=te*L-k;for(let B=0;B<I;B++){const J=B*D-F;Y[x]=J*y,Y[g]=le*w,Y[v]=U,c.push(Y.x,Y.y,Y.z),Y[x]=0,Y[g]=0,Y[v]=S>0?1:-1,d.push(Y.x,Y.y,Y.z),f.push(B/A),f.push(1-te/_),z+=1}}for(let te=0;te<_;te++)for(let le=0;le<A;le++){const B=h+le+I*te,J=h+le+I*(te+1),de=h+(le+1)+I*(te+1),he=h+(le+1)+I*te;l.push(B,J,he),l.push(J,de,he),q+=6}o.addGroup(p,q,T),p+=q,h+=z}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ya(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class Md extends on{constructor(e=1,t=1,i=1,r=32,s=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:a,thetaStart:o,thetaLength:l};const c=this;r=Math.floor(r),s=Math.floor(s);const d=[],f=[],h=[],p=[];let m=0;const x=[],g=i/2;let v=0;y(),a===!1&&(e>0&&w(!0),t>0&&w(!1)),this.setIndex(d),this.setAttribute("position",new sn(f,3)),this.setAttribute("normal",new sn(h,3)),this.setAttribute("uv",new sn(p,2));function y(){const b=new X,E=new X;let S=0;const A=(t-e)/i;for(let _=0;_<=s;_++){const T=[],D=_/s,L=D*(t-e)+e;for(let F=0;F<=r;F++){const k=F/r,U=k*l+o,I=Math.sin(U),R=Math.cos(U);E.x=L*I,E.y=-D*i+g,E.z=L*R,f.push(E.x,E.y,E.z),b.set(I,A,R).normalize(),h.push(b.x,b.y,b.z),p.push(k,1-D),T.push(m++)}x.push(T)}for(let _=0;_<r;_++)for(let T=0;T<s;T++){const D=x[T][_],L=x[T+1][_],F=x[T+1][_+1],k=x[T][_+1];(e>0||T!==0)&&(d.push(D,L,k),S+=3),(t>0||T!==s-1)&&(d.push(L,F,k),S+=3)}c.addGroup(v,S,0),v+=S}function w(b){const E=m,S=new it,A=new X;let _=0;const T=b===!0?e:t,D=b===!0?1:-1;for(let F=1;F<=r;F++)f.push(0,g*D,0),h.push(0,D,0),p.push(.5,.5),m++;const L=m;for(let F=0;F<=r;F++){const U=F/r*l+o,I=Math.cos(U),R=Math.sin(U);A.x=T*R,A.y=g*D,A.z=T*I,f.push(A.x,A.y,A.z),h.push(0,D,0),S.x=I*.5+.5,S.y=R*.5*D+.5,p.push(S.x,S.y),m++}for(let F=0;F<r;F++){const k=E+F,U=L+F;b===!0?d.push(U,U+1,k):d.push(U+1,U,k),_+=3}c.addGroup(v,_,b===!0?1:2),v+=_}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Md(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}const eo=new X,to=new X,Zl=new X,no=new ei;class db extends on{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const r=Math.pow(10,4),s=Math.cos(ys*t),a=e.getIndex(),o=e.getAttribute("position"),l=a?a.count:o.count,c=[0,0,0],d=["a","b","c"],f=new Array(3),h={},p=[];for(let m=0;m<l;m+=3){a?(c[0]=a.getX(m),c[1]=a.getX(m+1),c[2]=a.getX(m+2)):(c[0]=m,c[1]=m+1,c[2]=m+2);const{a:x,b:g,c:v}=no;if(x.fromBufferAttribute(o,c[0]),g.fromBufferAttribute(o,c[1]),v.fromBufferAttribute(o,c[2]),no.getNormal(Zl),f[0]=`${Math.round(x.x*r)},${Math.round(x.y*r)},${Math.round(x.z*r)}`,f[1]=`${Math.round(g.x*r)},${Math.round(g.y*r)},${Math.round(g.z*r)}`,f[2]=`${Math.round(v.x*r)},${Math.round(v.y*r)},${Math.round(v.z*r)}`,!(f[0]===f[1]||f[1]===f[2]||f[2]===f[0]))for(let y=0;y<3;y++){const w=(y+1)%3,b=f[y],E=f[w],S=no[d[y]],A=no[d[w]],_=`${b}_${E}`,T=`${E}_${b}`;T in h&&h[T]?(Zl.dot(h[T].normal)<=s&&(p.push(S.x,S.y,S.z),p.push(A.x,A.y,A.z)),h[T]=null):_ in h||(h[_]={index0:c[y],index1:c[w],normal:Zl.clone()})}}for(const m in h)if(h[m]){const{index0:x,index1:g}=h[m];eo.fromBufferAttribute(o,x),to.fromBufferAttribute(o,g),p.push(eo.x,eo.y,eo.z),p.push(to.x,to.y,to.z)}this.setAttribute("position",new sn(p,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Ds extends on{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const s=e/2,a=t/2,o=Math.floor(i),l=Math.floor(r),c=o+1,d=l+1,f=e/o,h=t/l,p=[],m=[],x=[],g=[];for(let v=0;v<d;v++){const y=v*h-a;for(let w=0;w<c;w++){const b=w*f-s;m.push(b,-y,0),x.push(0,0,1),g.push(w/o),g.push(1-v/l)}}for(let v=0;v<l;v++)for(let y=0;y<o;y++){const w=y+c*v,b=y+c*(v+1),E=y+1+c*(v+1),S=y+1+c*v;p.push(w,b,S),p.push(b,E,S)}this.setIndex(p),this.setAttribute("position",new sn(m,3)),this.setAttribute("normal",new sn(x,3)),this.setAttribute("uv",new sn(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ds(e.width,e.height,e.widthSegments,e.heightSegments)}}class hb extends on{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],i=new Set,r=new X,s=new X;if(e.index!==null){const a=e.attributes.position,o=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let c=0,d=l.length;c<d;++c){const f=l[c],h=f.start,p=f.count;for(let m=h,x=h+p;m<x;m+=3)for(let g=0;g<3;g++){const v=o.getX(m+g),y=o.getX(m+(g+1)%3);r.fromBufferAttribute(a,v),s.fromBufferAttribute(a,y),Vh(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}}else{const a=e.attributes.position;for(let o=0,l=a.count/3;o<l;o++)for(let c=0;c<3;c++){const d=3*o+c,f=3*o+(c+1)%3;r.fromBufferAttribute(a,d),s.fromBufferAttribute(a,f),Vh(r,s,i)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new sn(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Vh(n,e,t){const i=`${n.x},${n.y},${n.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${n.x},${n.y},${n.z}`;return t.has(i)===!0||t.has(r)===!0?!1:(t.add(i),t.add(r),!0)}function As(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];if(Hh(r))r.isRenderTargetTexture?(ft("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone();else if(Array.isArray(r))if(Hh(r[0])){const s=[];for(let a=0,o=r.length;a<o;a++)s[a]=r[a].clone();e[t][i]=s}else e[t][i]=r.slice();else e[t][i]=r}}return e}function zn(n){const e={};for(let t=0;t<n.length;t++){const i=As(n[t]);for(const r in i)e[r]=i[r]}return e}function Hh(n){return n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)}function fb(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function bm(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:At.workingColorSpace}const Di={clone:As,merge:zn};var pb=`void main() {
|
|
2
2
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
3
3
|
}`,mb=`void main() {
|
|
4
4
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|