@selvajs/selva 4.6.18 → 4.6.20
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/BSD-T_QY.js +3 -0
- package/build/client/_app/immutable/chunks/BSD-T_QY.js.br +0 -0
- package/build/client/_app/immutable/chunks/BSD-T_QY.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{1u1kwnk_.js → BhZ9V0Q6.js} +1 -1
- package/build/client/_app/immutable/chunks/BhZ9V0Q6.js.br +0 -0
- package/build/client/_app/immutable/chunks/BhZ9V0Q6.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DF27cg_X.js → C2RxSzQd.js} +1 -1
- package/build/client/_app/immutable/chunks/C2RxSzQd.js.br +0 -0
- package/build/client/_app/immutable/chunks/C2RxSzQd.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CWckDDc_.js → CxEdHCmD.js} +1 -1
- package/build/client/_app/immutable/chunks/CxEdHCmD.js.br +0 -0
- package/build/client/_app/immutable/chunks/CxEdHCmD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Ct4PQB2N.js → D5AUBpG3.js} +1 -1
- package/build/client/_app/immutable/chunks/D5AUBpG3.js.br +0 -0
- package/build/client/_app/immutable/chunks/D5AUBpG3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DkGkEWye.js → DIyQYaq7.js} +1 -1
- package/build/client/_app/immutable/chunks/DIyQYaq7.js.br +0 -0
- package/build/client/_app/immutable/chunks/DIyQYaq7.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{MkJsWBxy.js → DTSOQAZW.js} +1 -1
- package/build/client/_app/immutable/chunks/DTSOQAZW.js.br +0 -0
- package/build/client/_app/immutable/chunks/DTSOQAZW.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.C-b-l_6C.js → app.38pNn_JU.js} +2 -2
- package/build/client/_app/immutable/entry/app.38pNn_JU.js.br +0 -0
- package/build/client/_app/immutable/entry/app.38pNn_JU.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.CKOsmyKt.js +1 -0
- package/build/client/_app/immutable/entry/start.CKOsmyKt.js.br +0 -0
- package/build/client/_app/immutable/entry/start.CKOsmyKt.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.y5YV9e0l.js → 1.B0qwn5NK.js} +1 -1
- package/build/client/_app/immutable/nodes/1.B0qwn5NK.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.B0qwn5NK.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{11.BrmBFxsq.js → 11.rn5ZTWmN.js} +1 -1
- package/build/client/_app/immutable/nodes/11.rn5ZTWmN.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.rn5ZTWmN.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{13.DoS_efV2.js → 13.H_xCuUg9.js} +1 -1
- package/build/client/_app/immutable/nodes/13.H_xCuUg9.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.H_xCuUg9.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{14.CrepvoOX.js → 14.DCP-H3uo.js} +1 -1
- package/build/client/_app/immutable/nodes/14.DCP-H3uo.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.DCP-H3uo.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{15.5R75lvSv.js → 15.D7gIKi07.js} +1 -1
- package/build/client/_app/immutable/nodes/15.D7gIKi07.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.D7gIKi07.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{16.BUNOKDtO.js → 16.NdWQ9BKZ.js} +1 -1
- package/build/client/_app/immutable/nodes/16.NdWQ9BKZ.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.NdWQ9BKZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{17.WNxh7RgK.js → 17.D3VAiEW5.js} +1 -1
- package/build/client/_app/immutable/nodes/17.D3VAiEW5.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.D3VAiEW5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{19.BvKHjOT8.js → 19.hMUgKje5.js} +1 -1
- package/build/client/_app/immutable/nodes/19.hMUgKje5.js.br +0 -0
- package/build/client/_app/immutable/nodes/19.hMUgKje5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.lfn_Ap2G.js → 2.DDYeCuq7.js} +1 -1
- package/build/client/_app/immutable/nodes/2.DDYeCuq7.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.DDYeCuq7.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{20.CM3IW0NJ.js → 20.C1_PUx24.js} +1 -1
- package/build/client/_app/immutable/nodes/20.C1_PUx24.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.C1_PUx24.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{21.BSCpY3ux.js → 21.BiI1rBLE.js} +1 -1
- package/build/client/_app/immutable/nodes/21.BiI1rBLE.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.BiI1rBLE.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{23.Ba_tSly1.js → 23.BxU2TCRn.js} +1 -1
- package/build/client/_app/immutable/nodes/23.BxU2TCRn.js.br +0 -0
- package/build/client/_app/immutable/nodes/{23.Ba_tSly1.js.gz → 23.BxU2TCRn.js.gz} +0 -0
- package/build/client/_app/immutable/nodes/{24.DLv3u_AH.js → 24.JKirXh0Y.js} +1 -1
- package/build/client/_app/immutable/nodes/24.JKirXh0Y.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.JKirXh0Y.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{27.DRmKIj3E.js → 27.S-z9DqFC.js} +1 -1
- package/build/client/_app/immutable/nodes/27.S-z9DqFC.js.br +0 -0
- package/build/client/_app/immutable/nodes/27.S-z9DqFC.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{28.CymYXMXC.js → 28.fTVNaqCI.js} +1 -1
- package/build/client/_app/immutable/nodes/28.fTVNaqCI.js.br +0 -0
- package/build/client/_app/immutable/nodes/28.fTVNaqCI.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{29.B2Vg5C4Y.js → 29.kGUbHvNW.js} +1 -1
- package/build/client/_app/immutable/nodes/29.kGUbHvNW.js.br +0 -0
- package/build/client/_app/immutable/nodes/29.kGUbHvNW.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.D4iBNgD_.js → 3.BY9lDrJt.js} +1 -1
- package/build/client/_app/immutable/nodes/3.BY9lDrJt.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.BY9lDrJt.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{30.B1f9wd9k.js → 30.B6AQ-5eI.js} +1 -1
- package/build/client/_app/immutable/nodes/30.B6AQ-5eI.js.br +0 -0
- package/build/client/_app/immutable/nodes/30.B6AQ-5eI.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{5.WUf-8TLN.js → 5.u6HGf5Mu.js} +1 -1
- package/build/client/_app/immutable/nodes/5.u6HGf5Mu.js.br +1 -0
- package/build/client/_app/immutable/nodes/5.u6HGf5Mu.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{6.BdCBDiTe.js → 6.DXUBvWPr.js} +1 -1
- package/build/client/_app/immutable/nodes/6.DXUBvWPr.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.DXUBvWPr.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.DPTc3zUO.js → 7.DMxiZiA7.js} +1 -1
- package/build/client/_app/immutable/nodes/7.DMxiZiA7.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.DMxiZiA7.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{8.LKMUCtqV.js → 8.C-bXDNO5.js} +1 -1
- package/build/client/_app/immutable/nodes/8.C-bXDNO5.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.C-bXDNO5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{9.hYsm0yzU.js → 9.Dfp4e3j9.js} +1 -1
- package/build/client/_app/immutable/nodes/9.Dfp4e3j9.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.Dfp4e3j9.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/{access.server.js-x_KrjYJP.js → access.server.js-Bxaml4ii.js} +4 -4
- package/build/server/chunks/chunks/{access.server.js-x_KrjYJP.js.map → access.server.js-Bxaml4ii.js.map} +1 -1
- package/build/server/chunks/chunks/{api-errors.js-B1VX-zf8.js → api-errors.js-DuT1tEio.js} +3 -3
- package/build/server/chunks/chunks/{api-errors.js-B1VX-zf8.js.map → api-errors.js-DuT1tEio.js.map} +1 -1
- package/build/server/chunks/chunks/{auth-bootstrap.server.js-C3M4bN44.js → auth-bootstrap.server.js-DYPxhTi7.js} +2 -2
- package/build/server/chunks/chunks/{auth-bootstrap.server.js-C3M4bN44.js.map → auth-bootstrap.server.js-DYPxhTi7.js.map} +1 -1
- package/build/server/chunks/chunks/{bootHealth.server.js-o9cAZ837.js → bootHealth.server.js-Ds-uqCxE.js} +2 -2
- package/build/server/chunks/chunks/{bootHealth.server.js-o9cAZ837.js.map → bootHealth.server.js-Ds-uqCxE.js.map} +1 -1
- package/build/server/chunks/chunks/{internal.js-CSbIfVJO.js → internal.js-BUlPK7GQ.js} +3 -3
- package/build/server/chunks/chunks/{internal.js-CSbIfVJO.js.map → internal.js-BUlPK7GQ.js.map} +1 -1
- package/build/server/chunks/chunks/org-members.server.js-HahiM88D.js +24 -0
- package/build/server/chunks/chunks/org-members.server.js-HahiM88D.js.map +1 -0
- package/build/server/chunks/chunks/{package.js-DXXa4mq9.js → package.js-OjFg7Zfg.js} +2 -2
- package/build/server/chunks/chunks/{package.js-DXXa4mq9.js.map → package.js-OjFg7Zfg.js.map} +1 -1
- package/build/server/chunks/chunks/{permissions.server.js-B1Spnvnp.js → permissions.server.js-IiOUZVAf.js} +2 -2
- package/build/server/chunks/chunks/{permissions.server.js-B1Spnvnp.js.map → permissions.server.js-IiOUZVAf.js.map} +1 -1
- package/build/server/chunks/chunks/{providers.server.js-Sbk117pY.js → providers.server.js-Dwaws7YS.js} +25 -12
- package/build/server/chunks/chunks/providers.server.js-Dwaws7YS.js.map +1 -0
- package/build/server/chunks/chunks/{resolve.server.js-oRLjLsp2.js → resolve.server.js-zyKuppLS.js} +2 -2
- package/build/server/chunks/chunks/{resolve.server.js-oRLjLsp2.js.map → resolve.server.js-zyKuppLS.js.map} +1 -1
- package/build/server/chunks/chunks/{utils4.js-DvnSECfA.js → utils4.js-BV6v9j4B.js} +2 -2
- package/build/server/chunks/chunks/{utils4.js-DvnSECfA.js.map → utils4.js-BV6v9j4B.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/compute/{_server.ts.js-At2WPXTO.js → _server.ts.js-C4OhMqNV.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/compute/{_server.ts.js-At2WPXTO.js.map → _server.ts.js-C4OhMqNV.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/compute/actions/{_server.ts.js-C7IxEmV_.js → _server.ts.js-BF-mIUNH.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/compute/actions/{_server.ts.js-C7IxEmV_.js.map → _server.ts.js-BF-mIUNH.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/compute/status/{_server.ts.js-C3wKOPU7.js → _server.ts.js-Bt55U2rv.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/compute/status/{_server.ts.js-C3wKOPU7.js.map → _server.ts.js-Bt55U2rv.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/orgs/_id_/{_server.ts.js-DPXSSURv.js → _server.ts.js-BlQZbZwV.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/orgs/_id_/{_server.ts.js-DPXSSURv.js.map → _server.ts.js-BlQZbZwV.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/orgs/_id_/assets/_kind_/{_server.ts.js-C3h2a4jh.js → _server.ts.js-C0P4TzSr.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/orgs/_id_/assets/_kind_/{_server.ts.js-C3h2a4jh.js.map → _server.ts.js-C0P4TzSr.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/orgs/{_server.ts.js-CWC6GVdY.js → _server.ts.js-oo9gQFmj.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/orgs/{_server.ts.js-CWC6GVdY.js.map → _server.ts.js-oo9gQFmj.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/projects/_id_/{_server.ts.js-CS5ErY1M.js → _server.ts.js-6eIRmCk3.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/projects/_id_/{_server.ts.js-CS5ErY1M.js.map → _server.ts.js-6eIRmCk3.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/projects/_id_/grants/_grantId_/{_server.ts.js-DU_gLDs6.js → _server.ts.js-ClunmSFZ.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/projects/_id_/grants/_grantId_/{_server.ts.js-DU_gLDs6.js.map → _server.ts.js-ClunmSFZ.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/projects/_id_/grants/{_server.ts.js-DMxdDGgQ.js → _server.ts.js-B-nJc_Yy.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/projects/_id_/grants/{_server.ts.js-DMxdDGgQ.js.map → _server.ts.js-B-nJc_Yy.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/projects/{_server.ts.js-DvyK27Fl.js → _server.ts.js-BbGLkV4i.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/projects/{_server.ts.js-DvyK27Fl.js.map → _server.ts.js-BbGLkV4i.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/system/health/{_server.ts.js-CWBVKNdf.js → _server.ts.js-DAGq_Wfj.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/system/health/{_server.ts.js-CWBVKNdf.js.map → _server.ts.js-DAGq_Wfj.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/system/throughput/{_server.ts.js-CQZiKJH5.js → _server.ts.js-qBM-BTR9.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/system/throughput/{_server.ts.js-CQZiKJH5.js.map → _server.ts.js-qBM-BTR9.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/system/update/{_server.ts.js-Bm7Ktrs8.js → _server.ts.js-Dxq3-XBF.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/system/update/{_server.ts.js-Bm7Ktrs8.js.map → _server.ts.js-Dxq3-XBF.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/users/_id_/{_server.ts.js-Bo9FJ97l.js → _server.ts.js-CIJguTr6.js} +6 -6
- package/build/server/chunks/entries/endpoints/admin/api/users/_id_/{_server.ts.js-Bo9FJ97l.js.map → _server.ts.js-CIJguTr6.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/users/_id_/disable/{_server.ts.js-DIwBwpnn.js → _server.ts.js-s17e1_CM.js} +5 -5
- package/build/server/chunks/entries/endpoints/admin/api/users/_id_/disable/{_server.ts.js-DIwBwpnn.js.map → _server.ts.js-s17e1_CM.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/admin/api/users/{_server.ts.js-C1svi-Ld.js → _server.ts.js-CtJ0F0yl.js} +24 -25
- package/build/server/chunks/entries/endpoints/admin/api/users/_server.ts.js-CtJ0F0yl.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/compute/{_server.ts.js-Ct_7OEVp.js → _server.ts.js-Cj8dn1-X.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/compute/{_server.ts.js-Ct_7OEVp.js.map → _server.ts.js-Cj8dn1-X.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/compute/schema/{_server.ts.js-CS7DNpIB.js → _server.ts.js-DGyEctwL.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/compute/schema/{_server.ts.js-CS7DNpIB.js.map → _server.ts.js-DGyEctwL.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/{_server.ts.js-C1bI6fx_.js → _server.ts.js-Cg-W5WcZ.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/{_server.ts.js-C1bI6fx_.js.map → _server.ts.js-Cg-W5WcZ.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/image/_filename_/{_server.ts.js-DG0bgqAW.js → _server.ts.js-D1um-dy1.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/image/_filename_/{_server.ts.js-DG0bgqAW.js.map → _server.ts.js-D1um-dy1.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/image/{_server.ts.js-vURofqUH.js → _server.ts.js-CQF_XYLu.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/image/{_server.ts.js-vURofqUH.js.map → _server.ts.js-CQF_XYLu.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/publish/{_server.ts.js-tDF_TKqq.js → _server.ts.js-DOFz4xQt.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/publish/{_server.ts.js-tDF_TKqq.js.map → _server.ts.js-DOFz4xQt.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/share-links/_linkId_/{_server.ts.js-BKFS4e1E.js → _server.ts.js-DUG9nt0Y.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/share-links/_linkId_/{_server.ts.js-BKFS4e1E.js.map → _server.ts.js-DUG9nt0Y.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/share-links/{_server.ts.js-BTVUUKaO.js → _server.ts.js-me3Ap27W.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/share-links/{_server.ts.js-BTVUUKaO.js.map → _server.ts.js-me3Ap27W.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/versions/{_server.ts.js-BPTGDGrE.js → _server.ts.js-C8r8_Myz.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/versions/{_server.ts.js-BPTGDGrE.js.map → _server.ts.js-C8r8_Myz.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/versions/_versionId_/{_server.ts.js-DmpMY-tz.js → _server.ts.js-Gh_iyZgq.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/definitions/_guid_/versions/_versionId_/{_server.ts.js-DmpMY-tz.js.map → _server.ts.js-Gh_iyZgq.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/definitions/{_server.ts.js-CgDtxILD.js → _server.ts.js-iut3CIP3.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/definitions/{_server.ts.js-CgDtxILD.js.map → _server.ts.js-iut3CIP3.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/diag/throughput/{_server.ts.js-C5urgMLC.js → _server.ts.js-CS05w245.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/diag/throughput/{_server.ts.js-C5urgMLC.js.map → _server.ts.js-CS05w245.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/files/_...path_/{_server.ts.js-JYCUGi0C.js → _server.ts.js-CtXA_LRt.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/files/_...path_/{_server.ts.js-JYCUGi0C.js.map → _server.ts.js-CtXA_LRt.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/health/{_server.ts.js-CcG69a2b.js → _server.ts.js-CKByPISV.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/health/{_server.ts.js-CcG69a2b.js.map → _server.ts.js-CKByPISV.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/invites/_id_/{_server.ts.js-CpTViiM7.js → _server.ts.js-DelCbwm2.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/invites/_id_/{_server.ts.js-CpTViiM7.js.map → _server.ts.js-DelCbwm2.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/invites/{_server.ts.js-DveWNfQf.js → _server.ts.js-B475nd8c.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/invites/{_server.ts.js-DveWNfQf.js.map → _server.ts.js-B475nd8c.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/me/starred/_guid_/{_server.ts.js-DvBZkOHM.js → _server.ts.js-BewojRGR.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/me/starred/_guid_/{_server.ts.js-DvBZkOHM.js.map → _server.ts.js-BewojRGR.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/org/compute/{_server.ts.js-jFG7Wq0K.js → _server.ts.js-jipqWLvT.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/org/compute/{_server.ts.js-jFG7Wq0K.js.map → _server.ts.js-jipqWLvT.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/orgs/_orgId_/members/_userId_/{_server.ts.js-B2ycg2AE.js → _server.ts.js-Cs-TkeoT.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/orgs/_orgId_/members/_userId_/{_server.ts.js-B2ycg2AE.js.map → _server.ts.js-Cs-TkeoT.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/projects/_id_/{_server.ts.js-CNP_RE3t.js → _server.ts.js-DAJ9G-mb.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/projects/_id_/{_server.ts.js-CNP_RE3t.js.map → _server.ts.js-DAJ9G-mb.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/projects/_id_/members/{_server.ts.js-Bn5xwjry.js → _server.ts.js-BQc6JD1R.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/projects/_id_/members/{_server.ts.js-Bn5xwjry.js.map → _server.ts.js-BQc6JD1R.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/projects/_id_/members/_userId_/{_server.ts.js-BM6OdR6F.js → _server.ts.js-DuJiS41Q.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/projects/_id_/members/_userId_/{_server.ts.js-BM6OdR6F.js.map → _server.ts.js-DuJiS41Q.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/projects/_id_/reclaim/{_server.ts.js-kZpX0JUe.js → _server.ts.js-DlU4uFGv.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/projects/_id_/reclaim/{_server.ts.js-kZpX0JUe.js.map → _server.ts.js-DlU4uFGv.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/api/projects/{_server.ts.js-B-9USbyM.js → _server.ts.js-BcCbKM5j.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/projects/{_server.ts.js-B-9USbyM.js.map → _server.ts.js-BcCbKM5j.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/auth/email/callback/{_server.ts.js-BBxTiBOV.js → _server.ts.js-Bibt1Edq.js} +5 -5
- package/build/server/chunks/entries/endpoints/auth/email/callback/{_server.ts.js-BBxTiBOV.js.map → _server.ts.js-Bibt1Edq.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/auth/supabase/callback/{_server.ts.js-C2ENZLn1.js → _server.ts.js-DfxmYMjD.js} +5 -5
- package/build/server/chunks/entries/endpoints/auth/supabase/callback/{_server.ts.js-C2ENZLn1.js.map → _server.ts.js-DfxmYMjD.js.map} +1 -1
- package/build/server/chunks/entries/endpoints/auth/supabase/start/{_server.ts.js-DQkl2H6i.js → _server.ts.js-BsA9AqXB.js} +4 -4
- package/build/server/chunks/entries/endpoints/auth/supabase/start/{_server.ts.js-DQkl2H6i.js.map → _server.ts.js-BsA9AqXB.js.map} +1 -1
- package/build/server/chunks/entries/{hooks.server.js-C3YMifQe.js → hooks.server.js-DWlAkp3V.js} +4 -4
- package/build/server/chunks/entries/{hooks.server.js-C3YMifQe.js.map → hooks.server.js-DWlAkp3V.js.map} +1 -1
- package/build/server/chunks/entries/pages/{_layout.server.ts.js-BJt_Hh-8.js → _layout.server.ts.js-O4aCr20v.js} +2 -2
- package/build/server/chunks/entries/pages/{_layout.server.ts.js-BJt_Hh-8.js.map → _layout.server.ts.js-O4aCr20v.js.map} +1 -1
- package/build/server/chunks/entries/pages/accept-invite/{_page.server.ts.js-p0Ur2D2z.js → _page.server.ts.js-CGc-os4Z.js} +2 -2
- package/build/server/chunks/entries/pages/accept-invite/{_page.server.ts.js-p0Ur2D2z.js.map → _page.server.ts.js-CGc-os4Z.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/{_layout.server.ts.js-CwHlKomC.js → _layout.server.ts.js-Duqw1No8.js} +3 -3
- package/build/server/chunks/entries/pages/admin/{_layout.server.ts.js-CwHlKomC.js.map → _layout.server.ts.js-Duqw1No8.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/{_page.server.ts.js-Cmg0t3cP.js → _page.server.ts.js-v7h0uoYm.js} +3 -3
- package/build/server/chunks/entries/pages/admin/{_page.server.ts.js-Cmg0t3cP.js.map → _page.server.ts.js-v7h0uoYm.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/audit/{_page.server.ts.js-B2E4712L.js → _page.server.ts.js-1K6KKjK5.js} +3 -3
- package/build/server/chunks/entries/pages/admin/audit/{_page.server.ts.js-B2E4712L.js.map → _page.server.ts.js-1K6KKjK5.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/compute/{_page.server.ts.js-X7vOXVx_.js → _page.server.ts.js-BNFLECyp.js} +4 -4
- package/build/server/chunks/entries/pages/admin/compute/{_page.server.ts.js-X7vOXVx_.js.map → _page.server.ts.js-BNFLECyp.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/organizations/{_page.server.ts.js-C9ThvUZW.js → _page.server.ts.js-CBpDahF4.js} +2 -2
- package/build/server/chunks/entries/pages/admin/organizations/{_page.server.ts.js-C9ThvUZW.js.map → _page.server.ts.js-CBpDahF4.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/projects/_id_/{_page.server.ts.js-CbYQUdsT.js → _page.server.ts.js-CuYkBvSO.js} +2 -2
- package/build/server/chunks/entries/pages/admin/projects/_id_/{_page.server.ts.js-CbYQUdsT.js.map → _page.server.ts.js-CuYkBvSO.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/projects/{_page.server.ts.js-Bwzbc5U7.js → _page.server.ts.js-cro6Bk8a.js} +2 -2
- package/build/server/chunks/entries/pages/admin/projects/{_page.server.ts.js-Bwzbc5U7.js.map → _page.server.ts.js-cro6Bk8a.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/system/{_page.server.ts.js-BdyAMz5d.js → _page.server.ts.js-DWNwsNrt.js} +4 -4
- package/build/server/chunks/entries/pages/admin/system/{_page.server.ts.js-BdyAMz5d.js.map → _page.server.ts.js-DWNwsNrt.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/users/{_page.server.ts.js-5CoqZYu7.js → _page.server.ts.js-CuaytkMZ.js} +25 -25
- package/build/server/chunks/entries/pages/admin/users/_page.server.ts.js-CuaytkMZ.js.map +1 -0
- package/build/server/chunks/entries/pages/auth/email/start/{_page.server.ts.js-CJVxmsjJ.js → _page.server.ts.js-BzS0DVwC.js} +2 -2
- package/build/server/chunks/entries/pages/auth/email/start/{_page.server.ts.js-CJVxmsjJ.js.map → _page.server.ts.js-BzS0DVwC.js.map} +1 -1
- package/build/server/chunks/entries/pages/library/_guid_/{_page.server.ts.js-CdsnDM7L.js → _page.server.ts.js-vq_q0-Li.js} +6 -6
- package/build/server/chunks/entries/pages/library/_guid_/{_page.server.ts.js-CdsnDM7L.js.map → _page.server.ts.js-vq_q0-Li.js.map} +1 -1
- package/build/server/chunks/entries/pages/library/{_page.server.ts.js-CGuuDwN6.js → _page.server.ts.js-jygNqA58.js} +2 -2
- package/build/server/chunks/entries/pages/library/{_page.server.ts.js-CGuuDwN6.js.map → _page.server.ts.js-jygNqA58.js.map} +1 -1
- package/build/server/chunks/entries/pages/login/{_page.server.ts.js-DKowuYxD.js → _page.server.ts.js-VU8vyVXc.js} +2 -2
- package/build/server/chunks/entries/pages/login/{_page.server.ts.js-DKowuYxD.js.map → _page.server.ts.js-VU8vyVXc.js.map} +1 -1
- package/build/server/chunks/entries/pages/projects/{_page.server.ts.js-DUSltMia.js → _page.server.ts.js-mPb_4hsj.js} +4 -4
- package/build/server/chunks/entries/pages/projects/{_page.server.ts.js-DUSltMia.js.map → _page.server.ts.js-mPb_4hsj.js.map} +1 -1
- package/build/server/chunks/entries/pages/setup/{_page.server.ts.js-Bi43FW5A.js → _page.server.ts.js-DW0iJNBo.js} +3 -3
- package/build/server/chunks/entries/pages/setup/{_page.server.ts.js-Bi43FW5A.js.map → _page.server.ts.js-DW0iJNBo.js.map} +1 -1
- package/build/server/chunks/entries/pages/team/{_layout.server.ts.js-kTT4BcsF.js → _layout.server.ts.js-C_ELHANY.js} +2 -2
- package/build/server/chunks/entries/pages/team/{_layout.server.ts.js-kTT4BcsF.js.map → _layout.server.ts.js-C_ELHANY.js.map} +1 -1
- package/build/server/chunks/entries/pages/team/{_page.server.ts.js-BM0HjGiv.js → _page.server.ts.js-BGuKcuqP.js} +2 -2
- package/build/server/chunks/entries/pages/team/{_page.server.ts.js-BM0HjGiv.js.map → _page.server.ts.js-BGuKcuqP.js.map} +1 -1
- package/build/server/chunks/entries/pages/team/compute/{_page.server.ts.js-DSVbfXjJ.js → _page.server.ts.js-CBvxL84l.js} +3 -3
- package/build/server/chunks/entries/pages/team/compute/{_page.server.ts.js-DSVbfXjJ.js.map → _page.server.ts.js-CBvxL84l.js.map} +1 -1
- package/build/server/chunks/entries/pages/team/members/{_page.server.ts.js-B8od5Y-v.js → _page.server.ts.js-7f_CGIun.js} +12 -7
- package/build/server/chunks/entries/pages/team/members/_page.server.ts.js-7f_CGIun.js.map +1 -0
- package/build/server/chunks/entries/pages/team/projects/{_page.server.ts.js-BU18iBCr.js → _page.server.ts.js-DvDxnikr.js} +2 -2
- package/build/server/chunks/entries/pages/team/projects/{_page.server.ts.js-BU18iBCr.js.map → _page.server.ts.js-DvDxnikr.js.map} +1 -1
- package/build/server/chunks/entries/pages/team/reclaim/{_page.server.ts.js-DQR8CiW5.js → _page.server.ts.js-BUDiGmWK.js} +2 -2
- package/build/server/chunks/entries/pages/team/reclaim/{_page.server.ts.js-DQR8CiW5.js.map → _page.server.ts.js-BUDiGmWK.js.map} +1 -1
- package/build/server/chunks/entries/pages/team/settings/{_page.server.ts.js-Ds2Ncl_k.js → _page.server.ts.js-BZqUrhLO.js} +2 -2
- package/build/server/chunks/entries/pages/team/settings/{_page.server.ts.js-Ds2Ncl_k.js.map → _page.server.ts.js-BZqUrhLO.js.map} +1 -1
- package/build/server/chunks/entries/pages/team/shares/{_page.server.ts.js-BPApcgSj.js → _page.server.ts.js-OaxCSz12.js} +2 -2
- package/build/server/chunks/entries/pages/team/shares/{_page.server.ts.js-BPApcgSj.js.map → _page.server.ts.js-OaxCSz12.js.map} +1 -1
- package/build/server/chunks/{handler-ChMa4swI.js → handler-mad9n37t.js} +3 -3
- package/build/server/chunks/{handler-ChMa4swI.js.map → handler-mad9n37t.js.map} +1 -1
- package/build/server/chunks/{index.js-BT9EM2t1.js → index.js-C84j3_an.js} +2 -2
- package/build/server/chunks/{index.js-BT9EM2t1.js.map → index.js-C84j3_an.js.map} +1 -1
- package/build/server/chunks/{manifest.js-BMofdSe5.js → manifest.js-YQbY5s7W.js} +75 -75
- package/build/server/chunks/{manifest.js-BMofdSe5.js.map → manifest.js-YQbY5s7W.js.map} +1 -1
- package/build/server/chunks/nodes/{0.js-CSowTy6s.js → 0.js-G-PLtOZx.js} +3 -3
- package/build/server/chunks/nodes/{0.js-CSowTy6s.js.map → 0.js-G-PLtOZx.js.map} +1 -1
- package/build/server/chunks/nodes/{1.js-Cycg5M7H.js → 1.js-D_7pN2Ic.js} +2 -2
- package/build/server/chunks/nodes/{1.js-Cycg5M7H.js.map → 1.js-D_7pN2Ic.js.map} +1 -1
- package/build/server/chunks/nodes/{10.js-H0usRAOJ.js → 10.js-DQWYzA3J.js} +6 -6
- package/build/server/chunks/nodes/{10.js-H0usRAOJ.js.map → 10.js-DQWYzA3J.js.map} +1 -1
- package/build/server/chunks/nodes/{11.js-C7iIxjhX.js → 11.js-BHE4zqtG.js} +7 -7
- package/build/server/chunks/nodes/{11.js-C7iIxjhX.js.map → 11.js-BHE4zqtG.js.map} +1 -1
- package/build/server/chunks/nodes/{12.js-Hi7yiemE.js → 12.js-l5dsvfpW.js} +3 -3
- package/build/server/chunks/nodes/{12.js-Hi7yiemE.js.map → 12.js-l5dsvfpW.js.map} +1 -1
- package/build/server/chunks/nodes/{13.js-Bi_osv6Z.js → 13.js-B3hnLHfL.js} +4 -4
- package/build/server/chunks/nodes/{13.js-Bi_osv6Z.js.map → 13.js-B3hnLHfL.js.map} +1 -1
- package/build/server/chunks/nodes/{14.js-Dmyem_Cl.js → 14.js-AVmjgvWp.js} +4 -4
- package/build/server/chunks/nodes/{14.js-Dmyem_Cl.js.map → 14.js-AVmjgvWp.js.map} +1 -1
- package/build/server/chunks/nodes/{15.js-C57JlznM.js → 15.js-CfM7SsL6.js} +8 -8
- package/build/server/chunks/nodes/{15.js-C57JlznM.js.map → 15.js-CfM7SsL6.js.map} +1 -1
- package/build/server/chunks/nodes/{16.js-CdzlaYXn.js → 16.js-cuHdzos_.js} +10 -9
- package/build/server/chunks/nodes/{16.js-CdzlaYXn.js.map → 16.js-cuHdzos_.js.map} +1 -1
- package/build/server/chunks/nodes/{17.js-uJfAMf1s.js → 17.js-D58XfdeI.js} +2 -2
- package/build/server/chunks/nodes/{17.js-uJfAMf1s.js.map → 17.js-D58XfdeI.js.map} +1 -1
- package/build/server/chunks/nodes/{18.js-DGcj7w2M.js → 18.js-CdNRTHSA.js} +3 -3
- package/build/server/chunks/nodes/{18.js-DGcj7w2M.js.map → 18.js-CdNRTHSA.js.map} +1 -1
- package/build/server/chunks/nodes/{19.js-Cee7cuSc.js → 19.js-Sw9zOU0D.js} +4 -4
- package/build/server/chunks/nodes/{19.js-Cee7cuSc.js.map → 19.js-Sw9zOU0D.js.map} +1 -1
- package/build/server/chunks/nodes/{2.js-CXCNaNpi.js → 2.js-BoYiwAuI.js} +7 -7
- package/build/server/chunks/nodes/{2.js-CXCNaNpi.js.map → 2.js-BoYiwAuI.js.map} +1 -1
- package/build/server/chunks/nodes/{20.js-CqNctoTV.js → 20.js-bjRxXIki.js} +8 -8
- package/build/server/chunks/nodes/{20.js-CqNctoTV.js.map → 20.js-bjRxXIki.js.map} +1 -1
- package/build/server/chunks/nodes/{21.js-FSki90yK.js → 21.js-CwWdsbap.js} +4 -4
- package/build/server/chunks/nodes/{21.js-FSki90yK.js.map → 21.js-CwWdsbap.js.map} +1 -1
- package/build/server/chunks/nodes/{23.js-BQrf4Npl.js → 23.js-LoBoXxCG.js} +7 -7
- package/build/server/chunks/nodes/{23.js-BQrf4Npl.js.map → 23.js-LoBoXxCG.js.map} +1 -1
- package/build/server/chunks/nodes/{24.js-BpSV0rAh.js → 24.js-DLeN573c.js} +5 -5
- package/build/server/chunks/nodes/{24.js-BpSV0rAh.js.map → 24.js-DLeN573c.js.map} +1 -1
- package/build/server/chunks/nodes/{25.js-Dz_tw4Pc.js → 25.js-CgdDsNr9.js} +3 -3
- package/build/server/chunks/nodes/{25.js-Dz_tw4Pc.js.map → 25.js-CgdDsNr9.js.map} +1 -1
- package/build/server/chunks/nodes/{27.js-Bdt9Xgid.js → 27.js-DVE0HbuP.js} +5 -5
- package/build/server/chunks/nodes/{27.js-Bdt9Xgid.js.map → 27.js-DVE0HbuP.js.map} +1 -1
- package/build/server/chunks/nodes/{28.js-BTp9Km2q.js → 28.js-DS64U8iq.js} +4 -4
- package/build/server/chunks/nodes/{28.js-BTp9Km2q.js.map → 28.js-DS64U8iq.js.map} +1 -1
- package/build/server/chunks/nodes/{29.js-n2p9iraT.js → 29.js-Dcc0I-fV.js} +4 -4
- package/build/server/chunks/nodes/{29.js-n2p9iraT.js.map → 29.js-Dcc0I-fV.js.map} +1 -1
- package/build/server/chunks/nodes/{3.js-DjsKKWxJ.js → 3.js-DZ58dKEG.js} +2 -2
- package/build/server/chunks/nodes/{3.js-DjsKKWxJ.js.map → 3.js-DZ58dKEG.js.map} +1 -1
- package/build/server/chunks/nodes/{30.js-B5CP7MHc.js → 30.js-ubnqhIEF.js} +4 -4
- package/build/server/chunks/nodes/{30.js-B5CP7MHc.js.map → 30.js-ubnqhIEF.js.map} +1 -1
- package/build/server/chunks/nodes/{31.js-C6TEDhTN.js → 31.js-U5qOhprQ.js} +3 -3
- package/build/server/chunks/nodes/{31.js-C6TEDhTN.js.map → 31.js-U5qOhprQ.js.map} +1 -1
- package/build/server/chunks/nodes/{32.js-B2ywocPi.js → 32.js-CoIW_Enf.js} +3 -3
- package/build/server/chunks/nodes/{32.js-B2ywocPi.js.map → 32.js-CoIW_Enf.js.map} +1 -1
- package/build/server/chunks/nodes/{5.js-BAKBRMYw.js → 5.js-DRBSAwFI.js} +2 -2
- package/build/server/chunks/nodes/{5.js-BAKBRMYw.js.map → 5.js-DRBSAwFI.js.map} +1 -1
- package/build/server/chunks/nodes/{6.js-QrUqOWZX.js → 6.js-_Sbq9WIw.js} +4 -4
- package/build/server/chunks/nodes/{6.js-QrUqOWZX.js.map → 6.js-_Sbq9WIw.js.map} +1 -1
- package/build/server/chunks/nodes/{7.js-BvjgrYGl.js → 7.js-FwZCaNXc.js} +2 -2
- package/build/server/chunks/nodes/{7.js-BvjgrYGl.js.map → 7.js-FwZCaNXc.js.map} +1 -1
- package/build/server/chunks/nodes/{8.js-D1sbrbPg.js → 8.js-D6wD8vit.js} +4 -4
- package/build/server/chunks/nodes/{8.js-D1sbrbPg.js.map → 8.js-D6wD8vit.js.map} +1 -1
- package/build/server/chunks/nodes/{9.js-DL6jyGGv.js → 9.js-IbcMZXdJ.js} +5 -5
- package/build/server/chunks/nodes/{9.js-DL6jyGGv.js.map → 9.js-IbcMZXdJ.js.map} +1 -1
- package/package.json +1 -1
- package/build/client/_app/immutable/chunks/1u1kwnk_.js.br +0 -0
- package/build/client/_app/immutable/chunks/1u1kwnk_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CWckDDc_.js.br +0 -0
- package/build/client/_app/immutable/chunks/CWckDDc_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Ct4PQB2N.js.br +0 -0
- package/build/client/_app/immutable/chunks/Ct4PQB2N.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DF27cg_X.js.br +0 -0
- package/build/client/_app/immutable/chunks/DF27cg_X.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DkGkEWye.js.br +0 -0
- package/build/client/_app/immutable/chunks/DkGkEWye.js.gz +0 -0
- package/build/client/_app/immutable/chunks/MkJsWBxy.js.br +0 -0
- package/build/client/_app/immutable/chunks/MkJsWBxy.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Zux0n3kg.js +0 -3
- package/build/client/_app/immutable/chunks/Zux0n3kg.js.br +0 -0
- package/build/client/_app/immutable/chunks/Zux0n3kg.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.C-b-l_6C.js.br +0 -0
- package/build/client/_app/immutable/entry/app.C-b-l_6C.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.C4SEq0Pb.js +0 -1
- package/build/client/_app/immutable/entry/start.C4SEq0Pb.js.br +0 -2
- package/build/client/_app/immutable/entry/start.C4SEq0Pb.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.y5YV9e0l.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.y5YV9e0l.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.BrmBFxsq.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.BrmBFxsq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.DoS_efV2.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.DoS_efV2.js.gz +0 -0
- package/build/client/_app/immutable/nodes/14.CrepvoOX.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.CrepvoOX.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.5R75lvSv.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.5R75lvSv.js.gz +0 -0
- package/build/client/_app/immutable/nodes/16.BUNOKDtO.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.BUNOKDtO.js.gz +0 -0
- package/build/client/_app/immutable/nodes/17.WNxh7RgK.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.WNxh7RgK.js.gz +0 -0
- package/build/client/_app/immutable/nodes/19.BvKHjOT8.js.br +0 -0
- package/build/client/_app/immutable/nodes/19.BvKHjOT8.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.lfn_Ap2G.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.lfn_Ap2G.js.gz +0 -0
- package/build/client/_app/immutable/nodes/20.CM3IW0NJ.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.CM3IW0NJ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.BSCpY3ux.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.BSCpY3ux.js.gz +0 -0
- package/build/client/_app/immutable/nodes/23.Ba_tSly1.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.DLv3u_AH.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.DLv3u_AH.js.gz +0 -0
- package/build/client/_app/immutable/nodes/27.DRmKIj3E.js.br +0 -0
- package/build/client/_app/immutable/nodes/27.DRmKIj3E.js.gz +0 -0
- package/build/client/_app/immutable/nodes/28.CymYXMXC.js.br +0 -0
- package/build/client/_app/immutable/nodes/28.CymYXMXC.js.gz +0 -0
- package/build/client/_app/immutable/nodes/29.B2Vg5C4Y.js.br +0 -0
- package/build/client/_app/immutable/nodes/29.B2Vg5C4Y.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.D4iBNgD_.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.D4iBNgD_.js.gz +0 -0
- package/build/client/_app/immutable/nodes/30.B1f9wd9k.js.br +0 -0
- package/build/client/_app/immutable/nodes/30.B1f9wd9k.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.WUf-8TLN.js.br +0 -1
- package/build/client/_app/immutable/nodes/5.WUf-8TLN.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.BdCBDiTe.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.BdCBDiTe.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.DPTc3zUO.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.DPTc3zUO.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.LKMUCtqV.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.LKMUCtqV.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.hYsm0yzU.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.hYsm0yzU.js.gz +0 -0
- package/build/server/chunks/chunks/providers.server.js-Sbk117pY.js.map +0 -1
- package/build/server/chunks/entries/endpoints/admin/api/users/_server.ts.js-C1svi-Ld.js.map +0 -1
- package/build/server/chunks/entries/pages/admin/users/_page.server.ts.js-5CoqZYu7.js.map +0 -1
- package/build/server/chunks/entries/pages/team/members/_page.server.ts.js-B8od5Y-v.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as _p}from"../chunks/BapAUJpM.js";import"../chunks/DsnmJJEf.js";import{b1 as zg,bc as Bg,bm as kg,P as Vg,O as ws,Q as Pu,g as u,h as W,s as Be,u as O,j as Pt,J as wn,p as st,f as J,a as at,d as ae,c as Z,i as wt,r as j,aB as Hg,t as Me,aj as wr,n as yt,b as Rs,K as Gg,bn as xp,e as Wg,ax as nh,bo as ih}from"../chunks/BtOVeLcI.js";import{o as dn,s as Pe,a as Xt,d as zi,k as Xg,e as jg}from"../chunks/BNpXeuQ_.js";import{c as Te,a as C,p as Tn,f as K,t as Et,d as qg}from"../chunks/BoLtD6vo.js";import{i as be}from"../chunks/DAQN5y4A.js";import{d as ga,u as Ru,o as Yg,p as Nt,L as Kg,l as Zg,a as ds,D as gc,i as Uo,M as $g,b as vc,f as xl,g as bl,A as Jg,U as Qg}from"../chunks/DkGkEWye.js";import{S as ev}from"../chunks/BRHPfB44.js";import{M as tv,l as nv,m as iv,q as bp,r as rv,s as sv,t as av,v as ov,w as lv,x as cv,A as uv,o as dv,f as yp,u as hv,g as fv,y as pv,a as mv,k as gv}from"../chunks/SM988pE-.js";import{f as Ft,r as Du,e as Zt,a as Qt,c as Dt,d as Fo,k as Sp,l as yl,j as Ii,s as vv}from"../chunks/22C0ZkpD.js";import{s as mt,r as ut,p as oe,c as ze,b as ui}from"../chunks/ChEZL1UP.js";import{p as rh}from"../chunks/MkJsWBxy.js";import{a as nl,o as Mp}from"../chunks/C4cbQnXC.js";import{w as yo,F as sh}from"../chunks/aGXM-hZQ.js";import{b as wp}from"../chunks/Bfsx6G_D.js";import{S as ia}from"../chunks/CkeXmJE0.js";import{S as Oo}from"../chunks/BdIvVr5K.js";import{S as ah}from"../chunks/CitY1SZ1.js";import{C as Lu}from"../chunks/Bj6y_fSA.js";import{I as fn,c as ci}from"../chunks/BuC_QZkR.js";import{X as _v}from"../chunks/Ca8xAcDY.js";import{R as Er,D as Tr,b as hr,a as gs,c as vs}from"../chunks/jiMRToiE.js";import{s as pt}from"../chunks/8uBOzWQA.js";import{a as bi,e as Rr,h as zo,x as xv,c as Iu,b as Vn,d as Je,m as jt,s as _c,r as Nu,S as bv,y as yv}from"../chunks/Bf2Kb0d4.js";import{C as mr,w as pr,E as Sv,S as Mv,h as Ep,n as Un,d as Tp,e as Ap,a as Cp,A as Pp,H as Rp,c as Dp,j as Lp}from"../chunks/MGblXd4C.js";import{i as wv,H as Ev,F as Ip,P as Np,c as Up,g as Bo,d as Fp,o as Op,R as Tv,S as Av,a as Cv,b as Pv}from"../chunks/DNdxyuBP.js";import{C as ra}from"../chunks/LZnjyP_x.js";import{B as Bn}from"../chunks/mlApEF2J.js";import{P as Rv,F as oh,D as Sl,U as lh}from"../chunks/CFq1UfS7.js";import{h as Dv}from"../chunks/ClDgNAKE.js";import{T as Lv,a as Iv,b as Nv,d as Uv,c as Fv}from"../chunks/BVUbFuzT.js";import{C as zp,a as _s}from"../chunks/BawNisij.js";import{C as Bp}from"../chunks/Mn4D08zE.js";import{T as So}from"../chunks/DllGpGf3.js";import{C as Ov,a as zv}from"../chunks/CY6l1SkO.js";import{C as Bv}from"../chunks/C2PlvXZq.js";import{C as kv}from"../chunks/C0Xb3vka.js";import{L as lr}from"../chunks/wegQDfR0.js";import{a as Vv}from"../chunks/DF27cg_X.js";import{I as xs}from"../chunks/CJvX1bCR.js";import{M as Hv,C as Gv,I as Wv}from"../chunks/C38beKZN.js";import{t as Xv}from"../chunks/ADO9qhNc.js";import{F as jv}from"../chunks/k1GnUs7f.js";import{r as qv}from"../chunks/Cbu9Tg11.js";import{C as Yv}from"../chunks/3w4Rd2x8.js";import{inflateSync as Kv}from"../chunks/BzBbrBKd.js";const Zv=[];function Uu(n,e=!1,t=!1){return Mo(n,new Map,"",Zv,null,t)}function Mo(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(zg(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]=Mo(c,e,t,i,null,s))}return o}if(Bg(n)===kg){o={},e.set(n,o),r!==null&&e.set(r,o);for(var d of Object.keys(n))o[d]=Mo(n[d],e,t,i,null,s);return o}if(n instanceof Date)return structuredClone(n);if(typeof n.toJSON=="function"&&!s)return Mo(n.toJSON(),e,t,i,n)}if(n instanceof EventTarget)return n;try{return structuredClone(n)}catch{return n}}class $v{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return Vg(this.#t)}get(){const e=ws(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=ws(this.#t);return t===void 0?e:t}set(e){return Pu(this.#t,e)}}function ch(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 Jv(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 Qv(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 uh(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 kp(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 Ml(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 wl(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 e0(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 t0(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 n0(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 i0(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 r0(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 s0(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 a0(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 Fu(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 Ou(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 zu(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 o0(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 l0(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 c0(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 u0(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 d0(n,e){if(wv(n)){const i=n();return i===void 0?e:i}return n===void 0?e:n}function il(n,e){let t=Be(null);const i=O(()=>d0(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 Bu{#e=Be(!1);constructor(){Pt(()=>(wn(()=>W(this.#e,!0)),()=>{W(this.#e,!1)}))}get current(){return u(this.#e)}}const h0=Iu({component:"checkbox",parts:["root","group","group-label","input"]}),f0=new mr("Checkbox.Group"),Vp=new mr("Checkbox.Root");class ku{static create(e,t=null){return Vp.set(new ku(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),pr.pre([()=>Uu(this.group?.opts.value.current),()=>this.opts.value.current],([i,r])=>{!i||!r||(this.opts.checked.current=i.includes(r))}),pr.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===Sv){e.preventDefault(),this.opts.type.current==="submit"&&e.currentTarget.closest("form")?.requestSubmit();return}e.key===Mv&&(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":xv(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":zo(this.trueRequired),"aria-readonly":zo(this.trueReadonly),"data-disabled":Rr(this.trueDisabled),"data-readonly":Rr(this.trueReadonly),"data-state":p0(this.opts.checked.current,this.opts.indeterminate.current),[h0.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return u(this.#a)}set props(e){W(this.#a,e)}}class Vu{static create(){return new Vu(Vp.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){Ep(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 p0(n,e){return e?"indeterminate":n?"checked":"unchecked"}function m0(n,e){st(e,!0);const t=Vu.create();var i=Te(),r=J(i);{var s=a=>{Ev(a,mt(()=>t.props))};be(r,a=>{t.shouldRender&&a(s)})}C(n,i),at()}var g0=K("<button><!></button>"),v0=K("<!> <!>",1);function _0(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=f0.getOr(null);p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1)),pr.pre(()=>l(),()=>{p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1))});const v=ku.create({checked:Je(()=>i(),T=>{i(T),e.onCheckedChange?.(T)}),disabled:Je(()=>s()??!1),required:Je(()=>a()),name:Je(()=>o()),value:Je(()=>l()),id:Je(()=>c()),ref:Je(()=>r(),T=>r(T)),indeterminate:Je(()=>d(),T=>{d(T),e.onIndeterminateChange?.(T)}),type:Je(()=>f()),readonly:Je(()=>!!e.readonly)},p),x=O(()=>jt({...h},v.props));var g=v0(),m=J(g);{var b=T=>{var y=Te(),A=J(y);{let _=O(()=>({props:u(x),...v.snippetProps}));pt(A,()=>e.child,()=>u(_))}C(T,y)},w=T=>{var y=g0();Ft(y,()=>({...u(x)}));var A=Z(y);pt(A,()=>e.children??wt,()=>v.snippetProps),j(y),C(T,y)};be(m,T=>{e.child?T(b):T(w,-1)})}var S=ae(m,2);m0(S,{}),C(n,g),at()}function x0(n,e){st(e,!0);let t=oe(e,"open",15,!1),i=oe(e,"onOpenChange",3,Un),r=oe(e,"onOpenChangeComplete",3,Un);tv.create({open:Je(()=>t(),s=>{t(s),i()?.(s)}),onOpenChangeComplete:Je(()=>r())}),Ip(n,{children:(s,a)=>{var o=Te(),l=J(o);pt(l,()=>e.children??wt),C(s,o)},$$slots:{default:!0}}),at()}var b0=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=nv.create({id:Je(()=>r()),disabled:Je(()=>s()),onSelect:Je(()=>a()),ref:Je(()=>i(),x=>i(x)),closeOnSelect:Je(()=>o())}),d=O(()=>jt(l,c.props));var f=Te(),h=J(f);{var p=x=>{var g=Te(),m=J(g);pt(m,()=>e.child,()=>({props:u(d)})),C(x,g)},v=x=>{var g=b0();Ft(g,()=>({...u(d)}));var m=Z(g);pt(m,()=>e.children??wt),j(g),C(x,g)};be(h,x=>{e.child?x(p):x(v,-1)})}C(n,f),at()}var y0=K("<div><!></div>");function S0(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=iv.create({id:Je(()=>r()),ref:Je(()=>i(),h=>i(h))}),o=O(()=>jt(s,a.props));var l=Te(),c=J(l);{var d=h=>{var p=Te(),v=J(p);pt(v,()=>e.child,()=>({props:u(o)})),C(h,p)},f=h=>{var p=y0();Ft(p,()=>({...u(o)}));var v=Z(p);pt(v,()=>e.children??wt),j(p),C(h,p)};be(c,h=>{e.child?h(d):h(f,-1)})}C(n,l),at()}var M0=K("<div><div><!></div></div>"),w0=K("<div><div><!></div></div>");function E0(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),v=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 m=bp.create({id:Je(()=>i()),loop:Je(()=>s()),ref:Je(()=>r(),U=>r(U)),isSub:!0,onCloseAutoFocus:Je(()=>y)});function b(U){const N=U.currentTarget.contains(U.target),D=sv[m.parentMenu.root.opts.dir.current].includes(U.key);N&&D&&(m.parentMenu.onClose(),m.parentMenu.triggerNode?.focus(),U.preventDefault())}const w=O(()=>m.parentMenu.root.getBitsAttr("sub-content")),S=O(()=>jt(g,m.props,{side:v(),onkeydown:b,[u(w)]:""}));function T(U){f()(U),!U.defaultPrevented&&(U.preventDefault(),m.parentMenu.root.isUsingKeyboard&&m.parentMenu.contentNode&&rv.dispatch(m.parentMenu.contentNode))}function y(U){h()(U),!U.defaultPrevented&&U.preventDefault()}function A(U){a()(U),!U.defaultPrevented&&m.parentMenu.onClose()}function _(U){l()(U),!U.defaultPrevented&&m.parentMenu.onClose()}function E(U){if(p()(U),U.defaultPrevented||!Ep(U.target)||U.target.id===m.parentMenu.triggerNode?.id)return;if(m.parentMenu.parentMenu?.contentNode?.contains(U.target)){m.parentMenu.onClose(),U.preventDefault();return}const D=`[${m.parentMenu.root.getBitsAttr("sub-content")}]`;if(U.target.closest(D)){U.preventDefault();return}m.parentMenu.onClose()}var R=Te(),L=J(R);{var F=U=>{Np(U,mt(()=>u(S),{get ref(){return m.opts.ref},get interactOutsideBehavior(){return c()},get escapeKeydownBehavior(){return d()},onOpenAutoFocus:T,get enabled(){return m.parentMenu.opts.open.current},onInteractOutside:A,onEscapeKeydown:_,onFocusOutside:E,preventScroll:!1,get loop(){return s()},get trapFocus(){return x()},get shouldRender(){return m.shouldRender},popper:(D,z)=>{let q=()=>(z?.()).props,Y=()=>(z?.()).wrapperProps;const ee=O(()=>jt(q(),u(S),{style:Bo("menu")},{style:e.style}));var re=Te(),V=J(re);{var Q=me=>{var G=Te(),ie=J(G);{let ne=O(()=>({props:u(ee),wrapperProps:Y(),...m.snippetProps}));pt(ie,()=>e.child,()=>u(ne))}C(me,G)},he=me=>{var G=M0();Ft(G,()=>({...Y()}));var ie=Z(G);Ft(ie,()=>({...u(ee)}));var ne=Z(ie);pt(ne,()=>e.children??wt),j(ie),j(G),C(me,G)};be(V,me=>{e.child?me(Q):me(he,-1)})}C(D,re)},$$slots:{popper:!0}}))},k=U=>{Up(U,mt(()=>u(S),{get ref(){return m.opts.ref},get interactOutsideBehavior(){return c()},get escapeKeydownBehavior(){return d()},onCloseAutoFocus:y,onOpenAutoFocus:T,get open(){return m.parentMenu.opts.open.current},onInteractOutside:A,onEscapeKeydown:_,onFocusOutside:E,preventScroll:!1,get loop(){return s()},get trapFocus(){return x()},get shouldRender(){return m.shouldRender},popper:(D,z)=>{let q=()=>(z?.()).props,Y=()=>(z?.()).wrapperProps;const ee=O(()=>jt(q(),u(S),{style:Bo("menu")},{style:e.style}));var re=Te(),V=J(re);{var Q=me=>{var G=Te(),ie=J(G);{let ne=O(()=>({props:u(ee),wrapperProps:Y(),...m.snippetProps}));pt(ie,()=>e.child,()=>u(ne))}C(me,G)},he=me=>{var G=w0();Ft(G,()=>({...Y()}));var ie=Z(G);Ft(ie,()=>({...u(ee)}));var ne=Z(ie);pt(ne,()=>e.children??wt),j(ie),j(G),C(me,G)};be(V,me=>{e.child?me(Q):me(he,-1)})}C(D,re)},$$slots:{popper:!0}}))};be(L,U=>{o()?U(F):o()||U(k,1)})}C(n,R),at()}var T0=K("<div><!></div>");function A0(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=av.create({disabled:Je(()=>r()),onSelect:Je(()=>a()),id:Je(()=>i()),ref:Je(()=>s(),f=>s(f)),openDelay:Je(()=>o())}),d=O(()=>jt(l,c.props));Fp(n,{get id(){return i()},get ref(){return c.opts.ref},children:(f,h)=>{var p=Te(),v=J(p);{var x=m=>{var b=Te(),w=J(b);pt(w,()=>e.child,()=>({props:u(d)})),C(m,b)},g=m=>{var b=T0();Ft(b,()=>({...u(d)}));var w=Z(b);pt(w,()=>e.children??wt),j(b),C(m,b)};be(v,m=>{e.child?m(x):m(g,-1)})}C(f,p)},$$slots:{default:!0}}),at()}function C0(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=ov.create({variant:Je(()=>a()),dir:Je(()=>i()),onClose:()=>{t(!1),r()(!1)},shouldSkipExitAnimation:()=>o()?.()??!1});lv.create({open:Je(()=>t(),c=>{t(c),r()(c)}),onOpenChangeComplete:Je(()=>s())},l),Ip(n,{children:(c,d)=>{var f=Te(),h=J(f);pt(h,()=>e.children??wt),C(c,f)},$$slots:{default:!0}}),at()}var P0=K("<div><div><!></div></div>"),R0=K("<div><div><!></div></div>");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,"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=bp.create({id:Je(()=>i()),loop:Je(()=>s()),ref:Je(()=>r(),S=>r(S)),onCloseAutoFocus:Je(()=>l())}),p=O(()=>jt(f,h.props));function v(S){if(h.handleInteractOutside(S),!S.defaultPrevented&&(a()(S),!S.defaultPrevented)){if(S.target&&S.target instanceof Element){const T=`[${h.parentMenu.root.getBitsAttr("sub-content")}]`;if(S.target.closest(T))return}h.parentMenu.onClose()}}function x(S){o()(S),!S.defaultPrevented&&h.parentMenu.onClose()}var g=Te(),m=J(g);{var b=S=>{Np(S,mt(()=>u(p),()=>h.popperProps,{get ref(){return h.opts.ref},get enabled(){return h.parentMenu.opts.open.current},onInteractOutside:v,onEscapeKeydown:x,get trapFocus(){return d()},get loop(){return s()},forceMount:!0,get id(){return i()},get shouldRender(){return h.shouldRender},popper:(y,A)=>{let _=()=>(A?.()).props,E=()=>(A?.()).wrapperProps;const R=O(()=>jt(_(),{style:Bo("dropdown-menu")},{style:e.style}));var L=Te(),F=J(L);{var k=N=>{var D=Te(),z=J(D);{let q=O(()=>({props:u(R),wrapperProps:E(),...h.snippetProps}));pt(z,()=>e.child,()=>u(q))}C(N,D)},U=N=>{var D=P0();Ft(D,()=>({...E()}));var z=Z(D);Ft(z,()=>({...u(R)}));var q=Z(z);pt(q,()=>e.children??wt),j(z),j(D),C(N,D)};be(F,N=>{e.child?N(k):N(U,-1)})}C(y,L)},$$slots:{popper:!0}}))},w=S=>{Up(S,mt(()=>u(p),()=>h.popperProps,{get ref(){return h.opts.ref},get open(){return h.parentMenu.opts.open.current},onInteractOutside:v,onEscapeKeydown:x,get trapFocus(){return d()},get loop(){return s()},forceMount:!1,get id(){return i()},get shouldRender(){return h.shouldRender},popper:(y,A)=>{let _=()=>(A?.()).props,E=()=>(A?.()).wrapperProps;const R=O(()=>jt(_(),{style:Bo("dropdown-menu")},{style:e.style}));var L=Te(),F=J(L);{var k=N=>{var D=Te(),z=J(D);{let q=O(()=>({props:u(R),wrapperProps:E(),...h.snippetProps}));pt(z,()=>e.child,()=>u(q))}C(N,D)},U=N=>{var D=R0();Ft(D,()=>({...E()}));var z=Z(D);Ft(z,()=>({...u(R)}));var q=Z(z);pt(q,()=>e.children??wt),j(z),j(D),C(N,D)};be(F,N=>{e.child?N(k):N(U,-1)})}C(y,L)},$$slots:{popper:!0}}))};be(m,S=>{c()?S(b):c()||S(w,1)})}C(n,g),at()}var L0=K("<button><!></button>");function I0(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=cv.create({id:Je(()=>i()),disabled:Je(()=>s()??!1),ref:Je(()=>r(),d=>r(d))}),c=O(()=>jt(o,l.props,{type:a()}));Fp(n,{get id(){return i()},get ref(){return l.opts.ref},children:(d,f)=>{var h=Te(),p=J(h);{var v=g=>{var m=Te(),b=J(m);pt(b,()=>e.child,()=>({props:u(c)})),C(g,m)},x=g=>{var m=L0();Ft(m,()=>({...u(c)}));var b=Z(m);pt(b,()=>e.children??wt),j(m),C(g,m)};be(p,g=>{e.child?g(v):g(x,-1)})}C(d,h)},$$slots:{default:!0}}),at()}class Dr{#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 N0{opts;present;#e;#t=Be(!1);#n=!1;#i=Be(void 0);#r=null;constructor(e){this.opts=e,this.present=this.opts.open,W(this.#t,e.open.current,!0),this.#e=new uv({ref:this.opts.ref,afterTick:this.opts.open}),dv(()=>this.#a()),pr(()=>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 rl(n,e){st(e,!0);const t=new N0({open:Je(()=>e.open),ref:e.ref});var i=Te(),r=J(i);{var s=a=>{var o=Te(),l=J(o);pt(l,()=>e.presence??wt,()=>({present:t.isPresent,transitionStatus:t.transitionStatus})),C(a,o)};be(r,a=>{(e.forceMount||e.open||t.isPresent)&&a(s)})}C(n,i),at()}function U0(n,e,t){return Math.min(t,Math.max(e,n))}class F0{state;#e;constructor(e,t){this.state=_c(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 va=Iu({component:"scroll-area",parts:["root","viewport","corner","thumb","scrollbar"]}),_a=new mr("ScrollArea.Root"),xa=new mr("ScrollArea.Scrollbar"),sl=new mr("ScrollArea.ScrollbarVisible"),Hu=new mr("ScrollArea.ScrollbarAxis"),Hp=new mr("ScrollArea.ScrollbarShared");class Gu{static create(e){return _a.set(new Gu(e))}opts;attachment;#e=Be(null);get scrollAreaNode(){return u(this.#e)}set scrollAreaNode(e){W(this.#e,e,!0)}#t=Be(null);get viewportNode(){return u(this.#t)}set viewportNode(e){W(this.#t,e,!0)}#n=Be(null);get contentNode(){return u(this.#n)}set contentNode(e){W(this.#n,e,!0)}#i=Be(null);get scrollbarXNode(){return u(this.#i)}set scrollbarXNode(e){W(this.#i,e,!0)}#r=Be(null);get scrollbarYNode(){return u(this.#r)}set scrollbarYNode(e){W(this.#r,e,!0)}#s=Be(0);get cornerWidth(){return u(this.#s)}set cornerWidth(e){W(this.#s,e,!0)}#a=Be(0);get cornerHeight(){return u(this.#a)}set cornerHeight(e){W(this.#a,e,!0)}#o=Be(!1);get scrollbarXEnabled(){return u(this.#o)}set scrollbarXEnabled(e){W(this.#o,e,!0)}#l=Be(!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 yp(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`},[va.root]:"",...this.attachment}));get props(){return u(this.#c)}set props(e){W(this.#c,e)}}class Wu{static create(e){return new Wu(e,_a.get())}opts;root;attachment;#e=_c(hv());#t=_c(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"},[va.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 Xu{static create(e){return xa.set(new Xu(e,_a.get()))}opts;root;#e=O(()=>this.opts.orientation.current==="horizontal");get isHorizontal(){return u(this.#e)}set isHorizontal(e){W(this.#e,e)}#t=Be(!1);get hasThumb(){return u(this.#t)}set hasThumb(e){W(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,pr(()=>this.isHorizontal,i=>i?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}}class ju{static create(){return new ju(xa.get())}scrollbar;root;#e=Be(!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=Nu(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 qu{static create(){return new qu(xa.get())}scrollbar;root;machine=new F0("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=il(()=>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 al{static create(){return new al(xa.get())}scrollbar;root;#e=Be(!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=il(()=>{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 Dr(()=>this.root.viewportNode,t),new Dr(()=>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 Yu{static create(){return sl.set(new Yu(xa.get()))}scrollbar;root;#e=Be(null);get thumbNode(){return u(this.#e)}set thumbNode(e){W(this.#e,e,!0)}#t=Be(0);get pointerOffset(){return u(this.#t)}set pointerOffset(e){W(this.#t,e,!0)}#n=Be({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(()=>Gp(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=Be("");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 O0({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(${dh({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, ${dh({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 Ku{static create(e){return Hu.set(new Ku(e,sl.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=Be();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),Xp(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:ko(this.computedStyle.paddingLeft),paddingEnd:ko(this.computedStyle.paddingRight)}})};#t=O(()=>ol(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 Zu{static create(e){return Hu.set(new Zu(e,sl.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=Be();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),Xp(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:ko(this.computedStyle.paddingTop),paddingEnd:ko(this.computedStyle.paddingBottom)}})}#t=O(()=>ol(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 $u{static create(){return Hp.set(new $u(Hu.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=Be(null);get rect(){return u(this.#e)}set rect(e){W(this.#e,e)}#t=Be("");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=il(()=>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})}),Hg(()=>{this.scrollbarVis.sizes,wn(()=>this.handleThumbPositionChange())}),new Dr(()=>this.scrollbar.opts.ref.current,this.handleResize),new Dr(()=>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},[va.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 Ju{static create(e){return new Ju(e,Hp.get())}opts;scrollbarState;attachment;#e;#t=Be();#n=il(()=>{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=z0(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,[va.thumb]:"",...this.attachment}));get props(){return u(this.#i)}set props(e){W(this.#i,e)}}class Qu{static create(e){return new Qu(e,_a.get())}opts;root;attachment;#e=Be(0);#t=Be(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 Dr(()=>this.root.scrollbarXNode,()=>{const i=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=i,W(this.#t,i,!0)}),new Dr(()=>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},[va.corner]:"",...this.attachment}));get props(){return u(this.#i)}set props(e){W(this.#i,e)}}function ko(n){return n?Number.parseInt(n,10):0}function Gp(n,e){const t=n/e;return Number.isNaN(t)?0:t}function ol(n){const e=Gp(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,i=(n.scrollbar.size-t)*e;return Math.max(i,18)}function O0({pointerPos:n,pointerOffset:e,sizes:t,dir:i="ltr"}){const r=ol(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 Wp([l,c],f)(n)}function dh({scrollPos:n,sizes:e,dir:t="ltr"}){const i=ol(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=U0(n,l[0],l[1]);return Wp([0,a],[0,o])(c)}function Wp(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 Xp(n,e){return n>0&&n<e}function z0(n,e){let t={left:n.scrollLeft,top:n.scrollTop},i=0;const r=fv(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 B0=K("<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=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=Gu.create({type:Je(()=>s()),dir:Je(()=>a()),scrollHideDelay:Je(()=>o()),id:Je(()=>r()),ref:Je(()=>i(),x=>i(x))}),d=O(()=>jt(l,c.props));var f=Te(),h=J(f);{var p=x=>{var g=Te(),m=J(g);pt(m,()=>e.child,()=>({props:u(d)})),C(x,g)},v=x=>{var g=B0();Ft(g,()=>({...u(d)}));var m=Z(g);pt(m,()=>e.children??wt),j(g),C(x,g)};be(h,x=>{e.child?x(p):x(v,-1)})}C(n,f),at()}var V0=K("<div><div><!></div></div>");function H0(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=Wu.create({id:Je(()=>r()),ref:Je(()=>i(),h=>i(h))}),o=O(()=>jt(s,a.props)),l=O(()=>jt({},a.contentProps));var c=V0();Ft(c,()=>({...u(o)}));var d=Z(c);Ft(d,()=>({...u(l)}));var f=Z(d);pt(f,()=>e.children??wt),j(d),j(c),C(n,c),at()}var G0=K("<div><!></div>");function jp(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy","child","children"]);const i=$u.create(),r=O(()=>jt(t,i.props));var s=Te(),a=J(s);{var o=c=>{var d=Te(),f=J(d);pt(f,()=>e.child,()=>({props:u(r)})),C(c,d)},l=c=>{var d=G0();Ft(d,()=>({...u(r)}));var f=Z(d);pt(f,()=>e.children??wt),j(d),C(c,d)};be(a,c=>{e.child?c(o):c(l,-1)})}C(n,s),at()}function W0(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy"]);const i=new Bu,r=Ku.create({mounted:Je(()=>i.current)}),s=O(()=>jt(t,r.props));jp(n,mt(()=>u(s))),at()}function X0(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy"]);const i=new Bu,r=Zu.create({mounted:Je(()=>i.current)}),s=O(()=>jt(t,r.props));jp(n,mt(()=>u(s))),at()}function ll(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy"]);const i=Yu.create();var r=Te(),s=J(r);{var a=l=>{W0(l,mt(()=>t))},o=l=>{X0(l,mt(()=>t))};be(s,l=>{i.scrollbar.opts.orientation.current==="horizontal"?l(a):l(o,-1)})}C(n,r),at()}function j0(n,e){st(e,!0);let t=oe(e,"forceMount",3,!1),i=ut(e,["$$slots","$$events","$$legacy","forceMount"]);const r=al.create(),s=O(()=>jt(i,r.props));{const a=l=>{ll(l,mt(()=>u(s)))};let o=O(()=>t()||r.isVisible);rl(n,{get open(){return u(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}})}at()}function q0(n,e){st(e,!0);let t=oe(e,"forceMount",3,!1),i=ut(e,["$$slots","$$events","$$legacy","forceMount"]);const r=qu.create(),s=O(()=>jt(i,r.props));{const a=l=>{ll(l,mt(()=>u(s)))};let o=O(()=>t()||!r.isHidden);rl(n,mt(()=>u(s),{get open(){return u(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}}))}at()}function Y0(n,e){st(e,!0);let t=oe(e,"forceMount",3,!1),i=ut(e,["$$slots","$$events","$$legacy","forceMount"]);const r=ju.create(),s=al.create(),a=O(()=>jt(i,r.props,s.props,{"data-state":r.isVisible?"visible":"hidden"})),o=O(()=>t()||r.isVisible&&s.isVisible);rl(n,{get open(){return u(o)},get ref(){return s.scrollbar.opts.ref},presence:c=>{ll(c,mt(()=>u(a)))},$$slots:{presence:!0}}),at()}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","orientation"]);const a=Xu.create({orientation:Je(()=>e.orientation),id:Je(()=>r()),ref:Je(()=>i(),v=>i(v))}),o=O(()=>a.root.opts.type.current);var l=Te(),c=J(l);{var d=v=>{Y0(v,mt(()=>s,{get id(){return r()}}))},f=v=>{q0(v,mt(()=>s,{get id(){return r()}}))},h=v=>{j0(v,mt(()=>s,{get id(){return r()}}))},p=v=>{ll(v,mt(()=>s,{get id(){return r()}}))};be(c,v=>{u(o)==="hover"?v(d):u(o)==="scroll"?v(f,1):u(o)==="auto"?v(h,2):u(o)==="always"&&v(p,3)})}C(n,l),at()}var Z0=K("<div><!></div>");function $0(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 Bu,s=Ju.create({id:Je(()=>e.id),ref:Je(()=>t(),f=>t(f)),mounted:Je(()=>r.current)}),a=O(()=>jt(i,s.props,{style:{hidden:!e.present}}));var o=Te(),l=J(o);{var c=f=>{var h=Te(),p=J(h);pt(p,()=>e.child,()=>({props:u(a)})),C(f,h)},d=f=>{var h=Z0();Ft(h,()=>({...u(a)}));var p=Z(h);pt(p,()=>e.children??wt),j(h),C(f,h)};be(l,f=>{e.child?f(c):f(d,-1)})}C(n,o),at()}function J0(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=sl.get();{const l=(d,f)=>{let h=()=>(f?.()).present;$0(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);rl(n,{get open(){return u(c)},get ref(){return o.scrollbar.opts.ref},presence:l,$$slots:{presence:!0}})}at()}var Q0=K("<div><!></div>");function e_(n,e){st(e,!0);let t=oe(e,"ref",15,null),i=ut(e,["$$slots","$$events","$$legacy","ref","id","children","child"]);const r=Qu.create({id:Je(()=>e.id),ref:Je(()=>t(),d=>t(d))}),s=O(()=>jt(i,r.props));var a=Te(),o=J(a);{var l=d=>{var f=Te(),h=J(f);pt(h,()=>e.child,()=>({props:u(s)})),C(d,f)},c=d=>{var f=Q0();Ft(f,()=>({...u(s)}));var h=Z(f);pt(h,()=>e.children??wt),j(f),C(d,f)};be(o,d=>{e.child?d(l):d(c,-1)})}C(n,a),at()}function t_(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=_a.get(),o=O(()=>!!(a.scrollbarXNode&&a.scrollbarYNode)),l=O(()=>a.opts.type.current!=="scroll"&&u(o));var c=Te(),d=J(c);{var f=h=>{e_(h,mt(()=>s,{get id(){return r()},get ref(){return i()},set ref(p){i(p)}}))};be(d,h=>{u(l)&&h(f)})}C(n,c),at()}function hh(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 qp(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 Yp(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 n_(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 i_(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function ed(n,e,t){if(typeof n=="number"){const i=t-e;let r=Math.ceil(i/n);const s=n_(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=i_(f,s);c.push(h)}return c}return[...new Set(n)].filter(i=>i>=e&&i<=t).sort((i,r)=>i-r)}function Ar(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 Ca(n,e,t){const i=e.indexOf(n);return i===-1?Ar(n,e):t==="next"?i<e.length-1?e[i+1]:n:i>0?e[i-1]:n}function r_(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 fr=Iu({component:"slider",parts:["root","thumb","range","tick","tick-label","thumb-label"]}),td=new mr("Slider.Root");class Kp{opts;attachment;#e=Be(!1);get isActive(){return u(this.#e)}set isActive(e){W(this.#e,e,!0)}#t=Be(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(()=>ed(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 yp(this.opts.ref),new Dr(()=>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(fr.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 r_([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":Rr(this.opts.disabled.current),style:{touchAction:u(this.#s)},[fr.root]:"",...this.attachment}));get props(){return u(this.#a)}set props(e){W(this.#a,e)}}class s_ extends Kp{opts;isMulti=!1;constructor(e){super(e),this.opts=e,Op(()=>Nu(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))),pr([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=ed(t,i,r),o=c=>a.includes(c),l=c=>Ar(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=Ar(o,l);this.updateValue(c)}}updateValue=e=>{this.opts.value.current=Ar(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;!Lp(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=qp(this.direction,i);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":t,"aria-disabled":zo(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":t,"data-orientation":this.opts.orientation.current,style:r,[fr.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=Yp(this.direction,s,l),d=i<=t;return{"data-disabled":Rr(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,[fr.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 a_ extends Kp{opts;isMulti=!0;#e=Be(null);get activeThumb(){return u(this.#e)}set activeThumb(e){W(this.#e,e,!0)}#t=Be(0);get currentThumbIdx(){return u(this.#t)}set currentThumbIdx(e){W(this.#t,e,!0)}constructor(e){super(e),this.opts=e,Op(()=>Nu(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))),pr([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=ed(t,i,r),o=c=>a.includes(c),l=c=>Ar(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=Ar(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;!Lp(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(fr.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(!pv(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]=Ar(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=qp(this.direction,a);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":s,"aria-disabled":zo(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":s,"data-orientation":this.opts.orientation.current,style:o,[fr.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=Yp(this.direction,s,l),d=t.length===1?i<=t[0]:t[0]<=i&&i<=t[t.length-1];return{"data-disabled":Rr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":d?"":void 0,"data-value":i,style:c,[fr.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 o_{static create(e){const{type:t,...i}=e,r=t==="single"?new s_(i):new a_(i);return td.set(r)}}const l_=[Tp,Ap,Cp,Pp,Rp,Dp];class nd{static create(e){return new nd(e,td.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",...hh(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",...hh(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":Rr(this.root.opts.disabled.current),style:this.rangeStyles,[fr.range]:"",...this.attachment}));get props(){return u(this.#t)}set props(e){W(this.#t,e)}}class id{static create(e){return new id(e,td.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),!l_.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 Rp:this.#t(s);break;case Dp:this.#t(a);break;case Tp:if(c!=="horizontal")break;if(e.metaKey){const h=d==="rl"?a:s;this.#t(h)}else{const p=Ca(l,f,d==="rl"?"next":"prev");this.#t(p)}break;case Ap:if(c!=="horizontal")break;if(e.metaKey){const h=d==="rl"?s:a;this.#t(h)}else{const p=Ca(l,f,d==="rl"?"prev":"next");this.#t(p)}break;case Cp:if(e.metaKey){const h=d==="tb"?s:a;this.#t(h)}else{const p=Ca(l,f,d==="tb"?"prev":"next");this.#t(p)}break;case Pp:if(e.metaKey){const h=d==="tb"?a:s;this.#t(h)}else{const p=Ca(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":Rr(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 c_=K("<span><!></span>");function u_(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"),v=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 m(){if(s()===void 0)return e.type==="single"?u(x):[]}m(),pr.pre(()=>s(),()=>{m()});const b=o_.create({id:Je(()=>i()),ref:Je(()=>r(),_=>r(_)),value:Je(()=>s(),_=>{s(_),a()(_)}),onValueCommit:Je(()=>o()),disabled:Je(()=>l()),min:Je(()=>u(x)),max:Je(()=>u(g)),step:Je(()=>c()),dir:Je(()=>d()),autoSort:Je(()=>f()),orientation:Je(()=>h()),thumbPositioning:Je(()=>p()),type:e.type,trackPadding:Je(()=>e.trackPadding)}),w=O(()=>jt(v,b.props));var S=Te(),T=J(S);{var y=_=>{var E=Te(),R=J(E);{let L=O(()=>({props:u(w),...b.snippetProps}));pt(R,()=>e.child,()=>u(L))}C(_,E)},A=_=>{var E=c_();Ft(E,()=>({...u(w)}));var R=Z(E);pt(R,()=>e.children??wt,()=>b.snippetProps),j(E),C(_,E)};be(T,_=>{e.child?_(y):_(A,-1)})}C(n,S),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=ut(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const a=nd.create({id:Je(()=>r()),ref:Je(()=>i(),h=>i(h))}),o=O(()=>jt(s,a.props));var l=Te(),c=J(l);{var d=h=>{var p=Te(),v=J(p);pt(v,()=>e.child,()=>({props:u(o)})),C(h,p)},f=h=>{var p=d_();Ft(p,()=>({...u(o)}));var v=Z(p);pt(v,()=>e.children??wt),j(p),C(h,p)};be(c,h=>{e.child?h(d):h(f,-1)})}C(n,l),at()}var f_=K("<span><!></span>");function p_(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=id.create({id:Je(()=>r()),ref:Je(()=>i(),p=>i(p)),index:Je(()=>e.index),disabled:Je(()=>s())}),l=O(()=>jt(a,o.props));var c=Te(),d=J(c);{var f=p=>{var v=Te(),x=J(v);{let g=O(()=>({active:o.root.isThumbActive(o.opts.index.current),props:u(l)}));pt(x,()=>e.child,()=>u(g))}C(p,v)},h=p=>{var v=f_();Ft(v,()=>({...u(l)}));var x=Z(v);{let g=O(()=>({active:o.root.isThumbActive(o.opts.index.current)}));pt(x,()=>e.children??wt,()=>u(g))}j(v),C(p,v)};be(d,p=>{e.child?p(f):p(h,-1)})}C(n,c),at()}var wo=new Map;function Zp(n,e){wo.set(n,e)}Zp("Rhino.Geometry.Point3d",(n,e)=>{let t=e;return!t||typeof t.X!="number"?null:new n.Point([t.X,t.Y,t.Z])});Zp("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 m_(n){if(wo.has(n))return wo.get(n);for(let[e,t]of wo)if(n.startsWith(e))return t}function g_(n){return!n||typeof n!="object"?null:n.data??n.value??null}function v_(n,e,t){let i=m_(e);if(i)try{return i(t,n)}catch(r){Nt().warn(`Failed to decode Rhino type ${e}:`,r)}try{let r=g_(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 hs={STRING:"System.String",INT:"System.Int32",DOUBLE:"System.Double",BOOL:"System.Boolean"},__="Rhino.Geometry.",x_=["WebDisplay"],b_="FileData";function $p(n){return x_.some(e=>n.includes(e))}function Jp(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 y_(n,e,t){switch(e){case hs.STRING:return typeof n!="string"?n:n.replace(/^"(.*)"$/,"$1");case hs.INT:return Number.parseInt(n,10);case hs.DOUBLE:return Number.parseFloat(n);case hs.BOOL:return String(n).toLowerCase()==="true";default:return t&&e.startsWith(__)?v_(n,e,t):n}}function Qp(n,e,t,i){if(typeof n!="string")return n;let r=t?Jp(n):n;return y_(r,e,i)}function S_(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 Vo(n,e){for(let t of Object.values(n))if(Array.isArray(t))for(let i of t)e(i)}function M_(n,e=!1,t={}){let{parseValues:i=!0,rhino:r,stringOnly:s=!1}=t,a={},o=new Set;for(let l of n.values)Vo(l.InnerTree,c=>{if($p(c.type)||s&&c.type!==hs.STRING)return;let d=e?c.id:l.ParamName;if(!d)return;let f=Qp(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 w_(n){let e=[];for(let t of n.values)Vo(t.InnerTree,i=>{if(!i.type.includes(b_))return;let r=Jp(i.data);S_(r)&&e.push(r)});return e}function E_(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 Vo(l.InnerTree,d=>{d.id===e.byId&&(c=!0)}),c}),!a)return;let o=[];if(Vo(a.InnerTree,l=>{if("byId"in e&&l.id!==e.byId||$p(l.type)||s&&l.type!==hs.STRING)return;let c=Qp(l.data,l.type,i,r);o.push(c)}),o.length!==0)return o.length===1?o[0]:o}var T_=class{constructor(n,e=!1){this.response=n,this.debug=e}getValues(n=!1,e={}){return M_(this.response,n,e)}getValue(n,e){return E_(this.response,n,e)}async extractMeshesFromResponse(n){let e={debug:this.debug,...n},t;try{({getThreeMeshesFromComputeResponse:t}=await _p(()=>Promise.resolve().then(()=>BD),void 0,import.meta.url))}catch(i){throw new ga("Failed to load three.js visualization module. Ensure three.js is installed as a peer dependency.",Ru.INVALID_STATE,{context:{originalError:i instanceof Error?i.message:String(i)}})}return t(this.response,e)}getFileData(){return w_(this.response)}async getAndDownloadFiles(n,e){let t=this.getFileData();await Yg(t,n,e)}},A_=/^\{(\d+(?:;\d+)*)?\}$/;function C_(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])=>A_.test(t)&&Array.isArray(i))}function Ds(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 P_=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},R_=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},D_=n=>typeof n=="string"?n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n.startsWith('"')?n.slice(1):n:null,L_=n=>{if(typeof n=="string"){let e=n.trim();return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).trim()),e}return null};function em(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 fh(n,e,t){let i=Number(n.toFixed(e));return Math.abs(n-i)<t?i:n}function I_(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 N_(n,e=1e-8){let t=n.paramType==="Integer";if(C_(n.default))return{default:n.default,stepSize:t?1:.1};let i=Ds(n.default,P_,!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?I_(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"?fh(d,o,e):d):typeof i=="number"&&(i=fh(i,o,e)),{default:i,stepSize:a}}var U_={types:["Number","Integer"],parse(n,e){let{default:t,stepSize:i}=N_(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}}},F_={types:["Boolean"],parse(n,e){let t;try{t=Ds(n.default,R_,!1)}catch(i){throw i instanceof Error?new ga(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}}},O_={types:["Text"],parse(n,e){let t=Ds(n.default,D_,!1);return{...e,paramType:"Text",default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"Text",default:t?[""]:""}}},z_={types:["ValueList"],parse(n,e){if(!n.values||typeof n.values!="object"||Object.keys(n.values).length===0)throw ga.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}}},B_={types:["Geometry"],parse(n,e){let t=Ds(n.default,em(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}}},k_={types:["File"],parse(n,e){let t=Ds(n.default,em(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}}},V_={types:["Color"],parse(n,e){let t=Ds(n.default,L_,!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"}}},H_=[U_,F_,O_,z_,B_,k_,V_],G_=new Map(H_.flatMap(n=>n.types.map(e=>[e,n])));new Map([...G_.keys()].map(n=>[n.toLowerCase(),n]));const rd="184",bs={ROTATE:0,DOLLY:1,PAN:2},fs={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},W_=0,ph=1,X_=2,Eo=1,j_=2,ps=3,Kn=0,Yn=1,Qn=2,Mn=0,ys=1,mh=2,gh=3,vh=4,tm=5,gi=100,q_=101,Y_=102,K_=103,Z_=104,Qs=200,$_=201,J_=202,Q_=203,xc=204,bc=205,yc=206,ex=207,Sc=208,tx=209,nx=210,ix=211,rx=212,sx=213,ax=214,Mc=0,wc=1,Ec=2,Es=3,Tc=4,Ac=5,Cc=6,Pc=7,nm=0,ox=1,lx=2,Fi=0,sd=1,ad=2,od=3,ld=4,cd=5,ud=6,ba=7,im=300,Lr=301,Ts=302,To=303,El=304,cl=306,Ir=1e3,_i=1001,Rc=1002,xn=1003,cx=1004,Pa=1005,hn=1006,Tl=1007,cr=1008,qn=1009,rm=1010,sm=1011,oa=1012,dd=1013,Oi=1014,ti=1015,Fn=1016,hd=1017,fd=1018,As=1020,am=35902,om=35899,lm=1021,cm=1022,li=1023,Yi=1026,ur=1027,um=1028,pd=1029,Nr=1030,md=1031,gd=1033,Ao=33776,Co=33777,Po=33778,Ro=33779,Dc=35840,Lc=35841,Ic=35842,Nc=35843,Uc=36196,Fc=37492,Oc=37496,zc=37488,Bc=37489,Ho=37490,kc=37491,Vc=37808,Hc=37809,Gc=37810,Wc=37811,Xc=37812,jc=37813,qc=37814,Yc=37815,Kc=37816,Zc=37817,$c=37818,Jc=37819,Qc=37820,eu=37821,tu=36492,nu=36494,iu=36495,ru=36283,su=36284,Go=36285,au=36286,ux=3200,Wo=0,dx=1,or="",Wn="srgb",la="srgb-linear",Xo="linear",Ut="srgb",Vr=7680,_h=519,hx=512,fx=513,px=514,vd=515,mx=516,gx=517,_d=518,vx=519,ou=35044,xh="300 es",Ni=2e3,ca=2001;function _x(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function jo(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function xx(){const n=jo("canvas");return n.style.display="block",n}const bh={};function qo(...n){const e="THREE."+n.shift();console.log(e,...n)}function dm(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=dm(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=dm(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...n)}}function lu(...n){const e=n.join(" ");e in bh||(bh[e]=!0,ft(...n))}function bx(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 yx={[Mc]:wc,[Ec]:Cc,[Tc]:Pc,[Es]:Ac,[wc]:Mc,[Cc]:Ec,[Pc]:Tc,[Ac]:Es};class gr{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 yh=1234567;const Ss=Math.PI/180,ua=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 xd(n,e){return(n%e+e)%e}function Sx(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function Mx(n,e,t){return n!==e?(t-n)/(e-n):0}function sa(n,e,t){return(1-t)*n+t*e}function wx(n,e,t,i){return sa(n,e,1-Math.exp(-t*i))}function Ex(n,e=1){return e-Math.abs(xd(n,e*2)-e)}function Tx(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Ax(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Cx(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Px(n,e){return n+Math.random()*(e-n)}function Rx(n){return n*(.5-Math.random())}function Dx(n){n!==void 0&&(yh=n);let e=yh+=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 Lx(n){return n*Ss}function Ix(n){return n*ua}function Nx(n){return(n&n-1)===0&&n!==0}function Ux(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Fx(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Ox(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),v=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*v,l*p,o*c);break;case"YXY":n.set(l*p,o*d,l*v,o*c);break;case"ZYZ":n.set(l*v,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 hm={DEG2RAD:Ss,RAD2DEG:ua,generateUUID:ji,clamp:gt,euclideanModulo:xd,mapLinear:Sx,inverseLerp:Mx,lerp:sa,damp:wx,pingpong:Ex,smoothstep:Tx,smootherstep:Ax,randInt:Cx,randFloat:Px,randFloatSpread:Rx,seededRandom:Dx,degToRad:Lx,radToDeg:Ix,isPowerOfTwo:Nx,ceilPowerOfTwo:Ux,floorPowerOfTwo:Fx,setQuaternionFromProperEuler:Ox,normalize:Ot,denormalize:vi},Zd=class Zd{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}};Zd.prototype.isVector2=!0;let it=Zd;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],v=s[a+2],x=s[a+3];if(f!==x||l!==h||c!==p||d!==v){let g=l*h+c*p+d*v+f*x;g<0&&(h=-h,p=-p,v=-v,x=-x,g=-g);let m=1-o;if(g<.9995){const b=Math.acos(g),w=Math.sin(b);m=Math.sin(m*b)/w,o=Math.sin(o*b)/w,l=l*m+h*o,c=c*m+p*o,d=d*m+v*o,f=f*m+x*o}else{l=l*m+h*o,c=c*m+p*o,d=d*m+v*o,f=f*m+x*o;const b=1/Math.sqrt(l*l+c*c+d*d+f*f);l*=b,c*=b,d*=b,f*=b}}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],v=s[a+3];return e[t]=o*v+d*f+l*p-c*h,e[t+1]=l*v+d*h+c*f-o*p,e[t+2]=c*v+d*p+o*h-l*f,e[t+3]=d*v-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),v=l(s/2);switch(a){case"XYZ":this._x=h*d*f+c*p*v,this._y=c*p*f-h*d*v,this._z=c*d*v+h*p*f,this._w=c*d*f-h*p*v;break;case"YXZ":this._x=h*d*f+c*p*v,this._y=c*p*f-h*d*v,this._z=c*d*v-h*p*f,this._w=c*d*f+h*p*v;break;case"ZXY":this._x=h*d*f-c*p*v,this._y=c*p*f+h*d*v,this._z=c*d*v+h*p*f,this._w=c*d*f-h*p*v;break;case"ZYX":this._x=h*d*f-c*p*v,this._y=c*p*f+h*d*v,this._z=c*d*v-h*p*f,this._w=c*d*f+h*p*v;break;case"YZX":this._x=h*d*f+c*p*v,this._y=c*p*f+h*d*v,this._z=c*d*v-h*p*f,this._w=c*d*f-h*p*v;break;case"XZY":this._x=h*d*f-c*p*v,this._y=c*p*f-h*d*v,this._z=c*d*v+h*p*f,this._w=c*d*f+h*p*v;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 $d=class $d{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(Sh.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Sh.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 Al.copy(this).projectOnVector(e),this.sub(Al)}reflect(e){return this.sub(Al.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}};$d.prototype.isVector3=!0;let X=$d;const Al=new X,Sh=new xi,Jd=class Jd{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],v=i[8],x=r[0],g=r[3],m=r[6],b=r[1],w=r[4],S=r[7],T=r[2],y=r[5],A=r[8];return s[0]=a*x+o*b+l*T,s[3]=a*g+o*w+l*y,s[6]=a*m+o*S+l*A,s[1]=c*x+d*b+f*T,s[4]=c*g+d*w+f*y,s[7]=c*m+d*S+f*A,s[2]=h*x+p*b+v*T,s[5]=h*g+p*w+v*y,s[8]=h*m+p*S+v*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,v=t*f+i*h+r*p;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/v;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(Cl.makeScale(e,t)),this}rotate(e){return this.premultiply(Cl.makeRotation(-e)),this}translate(e,t){return this.premultiply(Cl.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)}};Jd.prototype.isMatrix3=!0;let xt=Jd;const Cl=new xt,Mh=new xt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),wh=new xt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function zx(){const n={enabled:!0,workingColorSpace:la,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=Ms(r.r),r.g=Ms(r.g),r.b=Ms(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===or?Xo: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 lu("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return lu("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({[la]:{primaries:e,whitePoint:i,transfer:Xo,toXYZ:Mh,fromXYZ:wh,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Wn},outputColorSpaceConfig:{drawingBufferColorSpace:Wn}},[Wn]:{primaries:e,whitePoint:i,transfer:Ut,toXYZ:Mh,fromXYZ:wh,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Wn}}}),n}const At=zx();function qi(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Ms(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Hr;class Bx{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{Hr===void 0&&(Hr=jo("canvas")),Hr.width=e.width,Hr.height=e.height;const r=Hr.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=Hr}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=jo("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 kx=0;class bd{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:kx++}),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(Pl(r[a].image)):s.push(Pl(r[a]))}else s=Pl(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function Pl(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?Bx.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 Vx=0;const Rl=new X;class En extends gr{constructor(e=En.DEFAULT_IMAGE,t=En.DEFAULT_MAPPING,i=_i,r=_i,s=hn,a=cr,o=li,l=qn,c=En.DEFAULT_ANISOTROPY,d=or){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Vx++}),this.uuid=ji(),this.name="",this.source=new bd(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(Rl).x}get height(){return this.source.getSize(Rl).y}get depth(){return this.source.getSize(Rl).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!==im)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ir:e.x=e.x-Math.floor(e.x);break;case _i:e.x=e.x<0?0:1;break;case Rc: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 Ir:e.y=e.y-Math.floor(e.y);break;case _i:e.y=e.y<0?0:1;break;case Rc: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=im;En.DEFAULT_ANISOTROPY=1;const Qd=class Qd{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],v=l[9],x=l[2],g=l[6],m=l[10];if(Math.abs(d-h)<.01&&Math.abs(f-x)<.01&&Math.abs(v-g)<.01){if(Math.abs(d+h)<.1&&Math.abs(f+x)<.1&&Math.abs(v+g)<.1&&Math.abs(c+p+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(c+1)/2,S=(p+1)/2,T=(m+1)/2,y=(d+h)/4,A=(f+x)/4,_=(v+g)/4;return w>S&&w>T?w<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(w),r=y/i,s=A/i):S>T?S<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(S),i=y/r,s=_/r):T<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(T),i=A/s,r=_/s),this.set(i,r,s,t),this}let b=Math.sqrt((g-v)*(g-v)+(f-x)*(f-x)+(h-d)*(h-d));return Math.abs(b)<.001&&(b=1),this.x=(g-v)/b,this.y=(f-x)/b,this.z=(h-d)/b,this.w=Math.acos((c+p+m-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}};Qd.prototype.isVector4=!0;let kt=Qd;class Hx extends gr{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 bd(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 Hx{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class fm 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 Gx 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 tl=class tl{constructor(e,t,i,r,s,a,o,l,c,d,f,h,p,v,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,v,x,g)}set(e,t,i,r,s,a,o,l,c,d,f,h,p,v,x,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=a,m[9]=o,m[13]=l,m[2]=c,m[6]=d,m[10]=f,m[14]=h,m[3]=p,m[7]=v,m[11]=x,m[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 tl().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/Gr.setFromMatrixColumn(e,0).length(),s=1/Gr.setFromMatrixColumn(e,1).length(),a=1/Gr.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,v=o*d,x=o*f;t[0]=l*d,t[4]=-l*f,t[8]=c,t[1]=p+v*c,t[5]=h-x*c,t[9]=-o*l,t[2]=x-h*c,t[6]=v+p*c,t[10]=a*l}else if(e.order==="YXZ"){const h=l*d,p=l*f,v=c*d,x=c*f;t[0]=h+x*o,t[4]=v*o-p,t[8]=a*c,t[1]=a*f,t[5]=a*d,t[9]=-o,t[2]=p*o-v,t[6]=x+h*o,t[10]=a*l}else if(e.order==="ZXY"){const h=l*d,p=l*f,v=c*d,x=c*f;t[0]=h-x*o,t[4]=-a*f,t[8]=v+p*o,t[1]=p+v*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,v=o*d,x=o*f;t[0]=l*d,t[4]=v*c-p,t[8]=h*c+x,t[1]=l*f,t[5]=x*c+h,t[9]=p*c-v,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const h=a*l,p=a*c,v=o*l,x=o*c;t[0]=l*d,t[4]=x-h*f,t[8]=v*f+p,t[1]=f,t[5]=a*d,t[9]=-o*d,t[2]=-c*d,t[6]=p*f+v,t[10]=h-x*f}else if(e.order==="XZY"){const h=a*l,p=a*c,v=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-v,t[2]=v*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(Wx,e,Xx)}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(),Ra.crossVectors($n,Qi),r[0]=Qi.x,r[4]=Ra.x,r[8]=$n.x,r[1]=Qi.y,r[5]=Ra.y,r[9]=$n.y,r[2]=Qi.z,r[6]=Ra.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],v=i[2],x=i[6],g=i[10],m=i[14],b=i[3],w=i[7],S=i[11],T=i[15],y=r[0],A=r[4],_=r[8],E=r[12],R=r[1],L=r[5],F=r[9],k=r[13],U=r[2],N=r[6],D=r[10],z=r[14],q=r[3],Y=r[7],ee=r[11],re=r[15];return s[0]=a*y+o*R+l*U+c*q,s[4]=a*A+o*L+l*N+c*Y,s[8]=a*_+o*F+l*D+c*ee,s[12]=a*E+o*k+l*z+c*re,s[1]=d*y+f*R+h*U+p*q,s[5]=d*A+f*L+h*N+p*Y,s[9]=d*_+f*F+h*D+p*ee,s[13]=d*E+f*k+h*z+p*re,s[2]=v*y+x*R+g*U+m*q,s[6]=v*A+x*L+g*N+m*Y,s[10]=v*_+x*F+g*D+m*ee,s[14]=v*E+x*k+g*z+m*re,s[3]=b*y+w*R+S*U+T*q,s[7]=b*A+w*L+S*N+T*Y,s[11]=b*_+w*F+S*D+T*ee,s[15]=b*E+w*k+S*z+T*re,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],v=e[3],x=e[7],g=e[11],m=e[15],b=l*p-c*h,w=o*p-c*f,S=o*h-l*f,T=a*p-c*d,y=a*h-l*d,A=a*f-o*d;return t*(x*b-g*w+m*S)-i*(v*b-g*T+m*y)+r*(v*w-x*T+m*A)-s*(v*S-x*y+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],v=e[12],x=e[13],g=e[14],m=e[15],b=t*o-i*a,w=t*l-r*a,S=t*c-s*a,T=i*l-r*o,y=i*c-s*o,A=r*c-s*l,_=d*x-f*v,E=d*g-h*v,R=d*m-p*v,L=f*g-h*x,F=f*m-p*x,k=h*m-p*g,U=b*k-w*F+S*L+T*R-y*E+A*_;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const N=1/U;return e[0]=(o*k-l*F+c*L)*N,e[1]=(r*F-i*k-s*L)*N,e[2]=(x*A-g*y+m*T)*N,e[3]=(h*y-f*A-p*T)*N,e[4]=(l*R-a*k-c*E)*N,e[5]=(t*k-r*R+s*E)*N,e[6]=(g*S-v*A-m*w)*N,e[7]=(d*A-h*S+p*w)*N,e[8]=(a*F-o*R+c*_)*N,e[9]=(i*R-t*F-s*_)*N,e[10]=(v*y-x*S+m*b)*N,e[11]=(f*S-d*y-p*b)*N,e[12]=(o*E-a*L-l*_)*N,e[13]=(t*L-i*E+r*_)*N,e[14]=(x*w-v*T-g*b)*N,e[15]=(d*T-f*w+h*b)*N,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,v=s*f,x=a*d,g=a*f,m=o*f,b=l*c,w=l*d,S=l*f,T=i.x,y=i.y,A=i.z;return r[0]=(1-(x+m))*T,r[1]=(p+S)*T,r[2]=(v-w)*T,r[3]=0,r[4]=(p-S)*y,r[5]=(1-(h+m))*y,r[6]=(g+b)*y,r[7]=0,r[8]=(v+w)*A,r[9]=(g-b)*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=Gr.set(r[0],r[1],r[2]).length();const o=Gr.set(r[4],r[5],r[6]).length(),l=Gr.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 v,x;if(l)v=s/(a-s),x=a*s/(a-s);else if(o===Ni)v=-(a+s)/(a-s),x=-2*a*s/(a-s);else if(o===ca)v=-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]=v,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 v,x;if(l)v=1/(a-s),x=a/(a-s);else if(o===Ni)v=-2/(a-s),x=-(a+s)/(a-s);else if(o===ca)v=-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]=v,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}};tl.prototype.isMatrix4=!0;let Lt=tl;const Gr=new X,hi=new Lt,Wx=new X(0,0,0),Xx=new X(1,1,1),Qi=new X,Ra=new X,$n=new X,Eh=new Lt,Th=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 Eh.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Eh,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Th.setFromEuler(this),this.setFromQuaternion(Th,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 yd{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 jx=0;const Ah=new X,Wr=new xi,Bi=new Lt,Da=new X,Os=new X,qx=new X,Yx=new xi,Ch=new X(1,0,0),Ph=new X(0,1,0),Rh=new X(0,0,1),Dh={type:"added"},Kx={type:"removed"},Xr={type:"childadded",child:null},Dl={type:"childremoved",child:null};class rn extends gr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:jx++}),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 yd,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 Wr.setFromAxisAngle(e,t),this.quaternion.multiply(Wr),this}rotateOnWorldAxis(e,t){return Wr.setFromAxisAngle(e,t),this.quaternion.premultiply(Wr),this}rotateX(e){return this.rotateOnAxis(Ch,e)}rotateY(e){return this.rotateOnAxis(Ph,e)}rotateZ(e){return this.rotateOnAxis(Rh,e)}translateOnAxis(e,t){return Ah.copy(e).applyQuaternion(this.quaternion),this.position.add(Ah.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Ch,e)}translateY(e){return this.translateOnAxis(Ph,e)}translateZ(e){return this.translateOnAxis(Rh,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?Da.copy(e):Da.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Os.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Bi.lookAt(Os,Da,this.up):Bi.lookAt(Da,Os,this.up),this.quaternion.setFromRotationMatrix(Bi),r&&(Bi.extractRotation(r.matrixWorld),Wr.setFromRotationMatrix(Bi),this.quaternion.premultiply(Wr.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(Dh),Xr.child=e,this.dispatchEvent(Xr),Xr.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(Kx),Dl.child=e,this.dispatchEvent(Dl),Dl.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(Dh),Xr.child=e,this.dispatchEvent(Xr),Xr.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(Os,e,qx),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Os,Yx,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),v=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),v.length>0&&(i.nodes=v)}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 ea=class extends rn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const Zx={type:"move"};class Ll{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ea,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 ea,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 ea,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),m=this._getHandJoint(c,x);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const d=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=d.position.distanceTo(f.position),p=.02,v=.005;c.inputState.pinching&&h>p+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=p-v&&(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(Zx)))}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 ea;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const pm={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},La={h:0,s:0,l:0};function Il(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=xd(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=Il(a,s,e+1/3),this.g=Il(a,s,e),this.b=Il(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=pm[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=Ms(e.r),this.g=Ms(e.g),this.b=Ms(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(La);const i=sa(er.h,La.h,t),r=sa(er.s,La.s,t),s=sa(er.l,La.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=pm;class $x 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,Nl=new X,Vi=new X,jr=new X,qr=new X,Lh=new X,Ul=new X,Fl=new X,Ol=new X,zl=new kt,Bl=new kt,kl=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),Nl.subVectors(e,t);const a=fi.dot(fi),o=fi.dot(ki),l=fi.dot(Nl),c=ki.dot(ki),d=ki.dot(Nl),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,v=(a*d-o*l)*h;return s.set(1-p-v,v,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 zl.setScalar(0),Bl.setScalar(0),kl.setScalar(0),zl.fromBufferAttribute(e,t),Bl.fromBufferAttribute(e,i),kl.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(zl,s.x),a.addScaledVector(Bl,s.y),a.addScaledVector(kl,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;jr.subVectors(r,i),qr.subVectors(s,i),Ul.subVectors(e,i);const l=jr.dot(Ul),c=qr.dot(Ul);if(l<=0&&c<=0)return t.copy(i);Fl.subVectors(e,r);const d=jr.dot(Fl),f=qr.dot(Fl);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(jr,a);Ol.subVectors(e,s);const p=jr.dot(Ol),v=qr.dot(Ol);if(v>=0&&p<=v)return t.copy(s);const x=p*c-l*v;if(x<=0&&c>=0&&v<=0)return o=c/(c-v),t.copy(i).addScaledVector(qr,o);const g=d*v-p*f;if(g<=0&&f-d>=0&&p-v>=0)return Lh.subVectors(s,r),o=(f-d)/(f-d+(p-v)),t.copy(r).addScaledVector(Lh,o);const m=1/(g+x+h);return a=x*m,o=h*m,t.copy(i).addScaledVector(jr,a).addScaledVector(qr,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(),Ia.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Ia.copy(i.boundingBox)),Ia.applyMatrix4(e.matrixWorld),this.union(Ia)}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(zs),Na.subVectors(this.max,zs),Yr.subVectors(e.a,zs),Kr.subVectors(e.b,zs),Zr.subVectors(e.c,zs),tr.subVectors(Kr,Yr),nr.subVectors(Zr,Kr),_r.subVectors(Yr,Zr);let t=[0,-tr.z,tr.y,0,-nr.z,nr.y,0,-_r.z,_r.y,tr.z,0,-tr.x,nr.z,0,-nr.x,_r.z,0,-_r.x,-tr.y,tr.x,0,-nr.y,nr.x,0,-_r.y,_r.x,0];return!Vl(t,Yr,Kr,Zr,Na)||(t=[1,0,0,0,1,0,0,0,1],!Vl(t,Yr,Kr,Zr,Na))?!1:(Ua.crossVectors(tr,nr),t=[Ua.x,Ua.y,Ua.z],Vl(t,Yr,Kr,Zr,Na))}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,Ia=new di,Yr=new X,Kr=new X,Zr=new X,tr=new X,nr=new X,_r=new X,zs=new X,Na=new X,Ua=new X,xr=new X;function Vl(n,e,t,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){xr.fromArray(n,s);const o=r.x*Math.abs(xr.x)+r.y*Math.abs(xr.y)+r.z*Math.abs(xr.z),l=e.dot(xr),c=t.dot(xr),d=i.dot(xr);if(Math.max(-Math.max(l,c,d),Math.min(l,c,d))>o)return!1}return!0}const Xi=Jx();function Jx(){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 Qx(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 eb(n){const e=n>>10;return Xi.uint32View[0]=Xi.mantissaTable[Xi.offsetTable[e]+(n&1023)]+Xi.exponentTable[e],Xi.floatView[0]}class Fa{static toHalfFloat(e){return Qx(e)}static fromHalfFloat(e){return eb(e)}}const mn=new X,Oa=new it;let tb=0;class kn extends gr{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:tb++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=ou,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++)Oa.fromBufferAttribute(this,t),Oa.applyMatrix3(e),this.setXY(t,Oa.x,Oa.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!==ou&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class mm extends kn{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class gm 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 nb=new di,Bs=new X,Hl=new X;class Fr{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):nb.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;Bs.subVectors(e,this.center);const t=Bs.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Bs,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):(Hl.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Bs.copy(e.center).add(Hl)),this.expandByPoint(Bs.copy(e.center).sub(Hl))),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 ib=0;const ai=new Lt,Gl=new rn,$r=new X,Jn=new di,ks=new di,Sn=new X;class on extends gr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:ib++}),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(_x(e)?gm:mm)(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 Gl.lookAt(e),Gl.updateMatrix(),this.applyMatrix4(Gl.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter($r).negate(),this.translate($r.x,$r.y,$r.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 Fr);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];ks.setFromBufferAttribute(o),this.morphTargetsRelative?(Sn.addVectors(Jn.min,ks.min),Jn.expandByPoint(Sn),Sn.addVectors(Jn.max,ks.max),Jn.expandByPoint(Sn)):(Jn.expandByPoint(ks.min),Jn.expandByPoint(ks.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&&($r.fromBufferAttribute(e,c),Sn.add($r)),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,v=new it,x=new X,g=new X;function m(_,E,R){c.fromBufferAttribute(i,_),d.fromBufferAttribute(i,E),f.fromBufferAttribute(i,R),h.fromBufferAttribute(s,_),p.fromBufferAttribute(s,E),v.fromBufferAttribute(s,R),d.sub(c),f.sub(c),p.sub(h),v.sub(h);const L=1/(p.x*v.y-v.x*p.y);isFinite(L)&&(x.copy(d).multiplyScalar(v.y).addScaledVector(f,-p.y).multiplyScalar(L),g.copy(f).multiplyScalar(p.x).addScaledVector(d,-v.x).multiplyScalar(L),o[_].add(x),o[E].add(x),o[R].add(x),l[_].add(g),l[E].add(g),l[R].add(g))}let b=this.groups;b.length===0&&(b=[{start:0,count:e.count}]);for(let _=0,E=b.length;_<E;++_){const R=b[_],L=R.start,F=R.count;for(let k=L,U=L+F;k<U;k+=3)m(e.getX(k+0),e.getX(k+1),e.getX(k+2))}const w=new X,S=new X,T=new X,y=new X;function A(_){T.fromBufferAttribute(r,_),y.copy(T);const E=o[_];w.copy(E),w.sub(T.multiplyScalar(T.dot(E))).normalize(),S.crossVectors(y,E);const L=S.dot(l[_])<0?-1:1;a.setXYZW(_,w.x,w.y,w.z,L)}for(let _=0,E=b.length;_<E;++_){const R=b[_],L=R.start,F=R.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 v=e.getX(h+0),x=e.getX(h+1),g=e.getX(h+2);r.fromBufferAttribute(t,v),s.fromBufferAttribute(t,x),a.fromBufferAttribute(t,g),d.subVectors(a,s),f.subVectors(r,s),d.cross(f),o.fromBufferAttribute(i,v),l.fromBufferAttribute(i,x),c.fromBufferAttribute(i,g),o.add(d),l.add(d),c.add(d),i.setXYZ(v,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,v=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 m=0;m<d;m++)h[v++]=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 vm{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ou,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){qo("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){qo("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 rb=0;class yi extends gr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rb++}),this.uuid=ji(),this.name="",this.type="Material",this.blending=ys,this.side=Kn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=xc,this.blendDst=bc,this.blendEquation=gi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new tt(0,0,0),this.blendAlpha=0,this.depthFunc=Es,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=_h,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Vr,this.stencilZFail=Vr,this.stencilZPass=Vr,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!==ys&&(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!==xc&&(i.blendSrc=this.blendSrc),this.blendDst!==bc&&(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!==Es&&(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!==_h&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Vr&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Vr&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Vr&&(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 _m 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 Jr;const Vs=new X,Qr=new X,es=new X,ts=new it,Hs=new it,xm=new Lt,za=new X,Gs=new X,Ba=new X,Ih=new it,Wl=new it,Nh=new it;class ns extends rn{constructor(e=new _m){if(super(),this.isSprite=!0,this.type="Sprite",Jr===void 0){Jr=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 vm(t,5);Jr.setIndex([0,1,2,0,2,3]),Jr.setAttribute("position",new Ui(i,3,0,!1)),Jr.setAttribute("uv",new Ui(i,2,3,!1))}this.geometry=Jr,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.'),Qr.setFromMatrixScale(this.matrixWorld),xm.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),es.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Qr.multiplyScalar(-es.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const a=this.center;ka(za.set(-.5,-.5,0),es,a,Qr,r,s),ka(Gs.set(.5,-.5,0),es,a,Qr,r,s),ka(Ba.set(.5,.5,0),es,a,Qr,r,s),Ih.set(0,0),Wl.set(1,0),Nh.set(1,1);let o=e.ray.intersectTriangle(za,Gs,Ba,!1,Vs);if(o===null&&(ka(Gs.set(-.5,.5,0),es,a,Qr,r,s),Wl.set(0,1),o=e.ray.intersectTriangle(za,Ba,Gs,!1,Vs),o===null))return;const l=e.ray.origin.distanceTo(Vs);l<e.near||l>e.far||t.push({distance:l,point:Vs.clone(),uv:ei.getInterpolation(Vs,za,Gs,Ba,Ih,Wl,Nh,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 ka(n,e,t,i,r,s){ts.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Hs.x=s*ts.x-r*ts.y,Hs.y=r*ts.x+s*ts.y):Hs.copy(ts),n.copy(e),n.x+=Hs.x,n.y+=Hs.y,n.applyMatrix4(xm)}const Gi=new X,Xl=new X,Va=new X,ir=new X,jl=new X,Ha=new X,ql=new X;class ya{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){Xl.copy(e).add(t).multiplyScalar(.5),Va.copy(t).sub(e).normalize(),ir.copy(this.origin).sub(Xl);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Va),o=ir.dot(this.direction),l=-ir.dot(Va),c=ir.lengthSq(),d=Math.abs(1-a*a);let f,h,p,v;if(d>0)if(f=a*l-o,h=a*o-l,v=s*d,f>=0)if(h>=-v)if(h<=v){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<=-v?(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<=v?(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(Xl).addScaledVector(Va,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){jl.subVectors(t,e),Ha.subVectors(i,e),ql.crossVectors(jl,Ha);let a=this.direction.dot(ql),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(Ha.crossVectors(ir,Ha));if(l<0)return null;const c=o*this.direction.dot(jl.cross(ir));if(c<0||l+c>a)return null;const d=-o*ir.dot(ql);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 Sd 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=nm,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 Uh=new Lt,br=new ya,Ga=new Fr,Fh=new X,Wa=new X,Xa=new X,ja=new X,Yl=new X,qa=new X,Oh=new X,Ya=new X;class an extends rn{constructor(e=new on,t=new Sd){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){qa.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const d=o[l],f=s[l];d!==0&&(Yl.fromBufferAttribute(f,e),a?qa.addScaledVector(Yl,d):qa.addScaledVector(Yl.sub(t),d))}t.add(qa)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Ga.copy(i.boundingSphere),Ga.applyMatrix4(s),br.copy(e.ray).recast(e.near),!(Ga.containsPoint(br.origin)===!1&&(br.intersectSphere(Ga,Fh)===null||br.origin.distanceToSquared(Fh)>(e.far-e.near)**2))&&(Uh.copy(s).invert(),br.copy(e.ray).applyMatrix4(Uh),!(i.boundingBox!==null&&br.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,br)))}_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 v=0,x=h.length;v<x;v++){const g=h[v],m=a[g.materialIndex],b=Math.max(g.start,p.start),w=Math.min(o.count,Math.min(g.start+g.count,p.start+p.count));for(let S=b,T=w;S<T;S+=3){const y=o.getX(S),A=o.getX(S+1),_=o.getX(S+2);r=Ka(this,m,e,i,c,d,f,y,A,_),r&&(r.faceIndex=Math.floor(S/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const v=Math.max(0,p.start),x=Math.min(o.count,p.start+p.count);for(let g=v,m=x;g<m;g+=3){const b=o.getX(g),w=o.getX(g+1),S=o.getX(g+2);r=Ka(this,a,e,i,c,d,f,b,w,S),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let v=0,x=h.length;v<x;v++){const g=h[v],m=a[g.materialIndex],b=Math.max(g.start,p.start),w=Math.min(l.count,Math.min(g.start+g.count,p.start+p.count));for(let S=b,T=w;S<T;S+=3){const y=S,A=S+1,_=S+2;r=Ka(this,m,e,i,c,d,f,y,A,_),r&&(r.faceIndex=Math.floor(S/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const v=Math.max(0,p.start),x=Math.min(l.count,p.start+p.count);for(let g=v,m=x;g<m;g+=3){const b=g,w=g+1,S=g+2;r=Ka(this,a,e,i,c,d,f,b,w,S),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}}}function sb(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;Ya.copy(o),Ya.applyMatrix4(n.matrixWorld);const c=t.ray.origin.distanceTo(Ya);return c<t.near||c>t.far?null:{distance:c,point:Ya.clone(),object:n}}function Ka(n,e,t,i,r,s,a,o,l,c){n.getVertexPosition(o,Wa),n.getVertexPosition(l,Xa),n.getVertexPosition(c,ja);const d=sb(n,e,t,i,Wa,Xa,ja,Oh);if(d){const f=new X;ei.getBarycoord(Oh,Wa,Xa,ja,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(Wa,Xa,ja,h.normal),d.face=h,d.barycoord=f}return d}class ul 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 Kl=new X,ab=new X,ob=new xt;class ar{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=Kl.subVectors(i,t).cross(ab.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(Kl),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||ob.getNormalMatrix(e),r=this.coplanarPoint(Kl).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 yr=new Fr,lb=new it(.5,.5),Za=new X;class Md{constructor(e=new ar,t=new ar,i=new ar,r=new ar,s=new ar,a=new ar){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],v=s[8],x=s[9],g=s[10],m=s[11],b=s[12],w=s[13],S=s[14],T=s[15];if(r[0].setComponents(c-a,p-d,m-v,T-b).normalize(),r[1].setComponents(c+a,p+d,m+v,T+b).normalize(),r[2].setComponents(c+o,p+f,m+x,T+w).normalize(),r[3].setComponents(c-o,p-f,m-x,T-w).normalize(),i)r[4].setComponents(l,h,g,S).normalize(),r[5].setComponents(c-l,p-h,m-g,T-S).normalize();else if(r[4].setComponents(c-l,p-h,m-g,T-S).normalize(),t===Ni)r[5].setComponents(c+l,p+h,m+g,T+S).normalize();else if(t===ca)r[5].setComponents(l,h,g,S).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(),yr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),yr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(yr)}intersectsSprite(e){yr.center.set(0,0,0);const t=lb.distanceTo(e.center);return yr.radius=.7071067811865476+t,yr.applyMatrix4(e.matrixWorld),this.intersectsSphere(yr)}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(Za.x=r.normal.x>0?e.max.x:e.min.x,Za.y=r.normal.y>0?e.max.y:e.min.y,Za.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Za)<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 cb 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 Yo=new X,Ko=new X,zh=new Lt,Ws=new ya,$a=new Fr,Zl=new X,Bh=new X;class ub extends rn{constructor(e=new on,t=new cb){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++)Yo.fromBufferAttribute(t,r-1),Ko.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Yo.distanceTo(Ko);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(),$a.copy(i.boundingSphere),$a.applyMatrix4(r),$a.radius+=s,e.ray.intersectsSphere($a)===!1)return;zh.copy(r).invert(),Ws.copy(e.ray).applyMatrix4(zh);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),v=Math.min(d.count,a.start+a.count);for(let x=p,g=v-1;x<g;x+=c){const m=d.getX(x),b=d.getX(x+1),w=Ja(this,e,Ws,l,m,b,x);w&&t.push(w)}if(this.isLineLoop){const x=d.getX(v-1),g=d.getX(p),m=Ja(this,e,Ws,l,x,g,v-1);m&&t.push(m)}}else{const p=Math.max(0,a.start),v=Math.min(h.count,a.start+a.count);for(let x=p,g=v-1;x<g;x+=c){const m=Ja(this,e,Ws,l,x,x+1,x);m&&t.push(m)}if(this.isLineLoop){const x=Ja(this,e,Ws,l,v-1,p,v-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 Ja(n,e,t,i,r,s,a){const o=n.geometry.attributes.position;if(Yo.fromBufferAttribute(o,r),Ko.fromBufferAttribute(o,s),t.distanceSqToSegment(Yo,Ko,Zl,Bh)>i)return;Zl.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(Zl);if(!(c<e.near||c>e.far))return{distance:c,point:Bh.clone().applyMatrix4(n.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:n}}class Zo 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 kh=new Lt,cu=new ya,Qa=new Fr,eo=new X;class $o extends rn{constructor(e=new on,t=new Zo){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(),Qa.copy(i.boundingSphere),Qa.applyMatrix4(r),Qa.radius+=s,e.ray.intersectsSphere(Qa)===!1)return;kh.copy(r).invert(),cu.copy(e.ray).applyMatrix4(kh);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 v=h,x=p;v<x;v++){const g=c.getX(v);eo.fromBufferAttribute(f,g),Vh(eo,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 v=h,x=p;v<x;v++)eo.fromBufferAttribute(f,v),Vh(eo,v,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 Vh(n,e,t,i,r,s,a){const o=cu.distanceSqToPoint(n);if(o<t){const l=new X;cu.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 bm extends En{constructor(e=[],t=Lr,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 db 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 Ur extends En{constructor(e,t,i=Oi,r,s,a,o=xn,l=xn,c,d=Yi,f=1){if(d!==Yi&&d!==ur)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 bd(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 hb extends Ur{constructor(e,t=Oi,i=Lr,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 ym extends En{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Sa 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;v("z","y","x",-1,-1,i,t,e,a,s,0),v("z","y","x",1,-1,i,t,-e,a,s,1),v("x","z","y",1,1,e,i,t,r,a,2),v("x","z","y",1,-1,e,i,-t,r,a,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("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 v(x,g,m,b,w,S,T,y,A,_,E){const R=S/A,L=T/_,F=S/2,k=T/2,U=y/2,N=A+1,D=_+1;let z=0,q=0;const Y=new X;for(let ee=0;ee<D;ee++){const re=ee*L-k;for(let V=0;V<N;V++){const Q=V*R-F;Y[x]=Q*b,Y[g]=re*w,Y[m]=U,c.push(Y.x,Y.y,Y.z),Y[x]=0,Y[g]=0,Y[m]=y>0?1:-1,d.push(Y.x,Y.y,Y.z),f.push(V/A),f.push(1-ee/_),z+=1}}for(let ee=0;ee<_;ee++)for(let re=0;re<A;re++){const V=h+re+N*ee,Q=h+re+N*(ee+1),he=h+(re+1)+N*(ee+1),me=h+(re+1)+N*ee;l.push(V,Q,me),l.push(Q,he,me),q+=6}o.addGroup(p,q,E),p+=q,h+=z}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Sa(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class wd 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 v=0;const x=[],g=i/2;let m=0;b(),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 b(){const S=new X,T=new X;let y=0;const A=(t-e)/i;for(let _=0;_<=s;_++){const E=[],R=_/s,L=R*(t-e)+e;for(let F=0;F<=r;F++){const k=F/r,U=k*l+o,N=Math.sin(U),D=Math.cos(U);T.x=L*N,T.y=-R*i+g,T.z=L*D,f.push(T.x,T.y,T.z),S.set(N,A,D).normalize(),h.push(S.x,S.y,S.z),p.push(k,1-R),E.push(v++)}x.push(E)}for(let _=0;_<r;_++)for(let E=0;E<s;E++){const R=x[E][_],L=x[E+1][_],F=x[E+1][_+1],k=x[E][_+1];(e>0||E!==0)&&(d.push(R,L,k),y+=3),(t>0||E!==s-1)&&(d.push(L,F,k),y+=3)}c.addGroup(m,y,0),m+=y}function w(S){const T=v,y=new it,A=new X;let _=0;const E=S===!0?e:t,R=S===!0?1:-1;for(let F=1;F<=r;F++)f.push(0,g*R,0),h.push(0,R,0),p.push(.5,.5),v++;const L=v;for(let F=0;F<=r;F++){const U=F/r*l+o,N=Math.cos(U),D=Math.sin(U);A.x=E*D,A.y=g*R,A.z=E*N,f.push(A.x,A.y,A.z),h.push(0,R,0),y.x=N*.5+.5,y.y=D*.5*R+.5,p.push(y.x,y.y),v++}for(let F=0;F<r;F++){const k=T+F,U=L+F;S===!0?d.push(U,U+1,k):d.push(U+1,U,k),_+=3}c.addGroup(m,_,S===!0?1:2),m+=_}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new wd(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}const to=new X,no=new X,$l=new X,io=new ei;class fb 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(Ss*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 v=0;v<l;v+=3){a?(c[0]=a.getX(v),c[1]=a.getX(v+1),c[2]=a.getX(v+2)):(c[0]=v,c[1]=v+1,c[2]=v+2);const{a:x,b:g,c:m}=io;if(x.fromBufferAttribute(o,c[0]),g.fromBufferAttribute(o,c[1]),m.fromBufferAttribute(o,c[2]),io.getNormal($l),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(m.x*r)},${Math.round(m.y*r)},${Math.round(m.z*r)}`,!(f[0]===f[1]||f[1]===f[2]||f[2]===f[0]))for(let b=0;b<3;b++){const w=(b+1)%3,S=f[b],T=f[w],y=io[d[b]],A=io[d[w]],_=`${S}_${T}`,E=`${T}_${S}`;E in h&&h[E]?($l.dot(h[E].normal)<=s&&(p.push(y.x,y.y,y.z),p.push(A.x,A.y,A.z)),h[E]=null):_ in h||(h[_]={index0:c[b],index1:c[w],normal:$l.clone()})}}for(const v in h)if(h[v]){const{index0:x,index1:g}=h[v];to.fromBufferAttribute(o,x),no.fromBufferAttribute(o,g),p.push(to.x,to.y,to.z),p.push(no.x,no.y,no.z)}this.setAttribute("position",new sn(p,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Ls 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=[],v=[],x=[],g=[];for(let m=0;m<d;m++){const b=m*h-a;for(let w=0;w<c;w++){const S=w*f-s;v.push(S,-b,0),x.push(0,0,1),g.push(w/o),g.push(1-m/l)}}for(let m=0;m<l;m++)for(let b=0;b<o;b++){const w=b+c*m,S=b+c*(m+1),T=b+1+c*(m+1),y=b+1+c*m;p.push(w,S,y),p.push(S,T,y)}this.setIndex(p),this.setAttribute("position",new sn(v,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 Ls(e.width,e.height,e.widthSegments,e.heightSegments)}}class pb 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 v=h,x=h+p;v<x;v+=3)for(let g=0;g<3;g++){const m=o.getX(v+g),b=o.getX(v+(g+1)%3);r.fromBufferAttribute(a,m),s.fromBufferAttribute(a,b),Hh(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),Hh(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 Hh(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 Cs(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];if(Gh(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(Gh(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=Cs(n[t]);for(const r in i)e[r]=i[r]}return e}function Gh(n){return n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)}function mb(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function Sm(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:At.workingColorSpace}const Di={clone:Cs,merge:zn};var gb=`void main() {
|
|
1
|
+
import{_ as _p}from"../chunks/BapAUJpM.js";import"../chunks/DsnmJJEf.js";import{b1 as zg,bc as Bg,bm as kg,P as Vg,O as ws,Q as Pu,g as u,h as W,s as Be,u as O,j as Pt,J as wn,p as st,f as J,a as at,d as ae,c as Z,i as wt,r as j,aB as Hg,t as Me,aj as wr,n as yt,b as Rs,K as Gg,bn as xp,e as Wg,ax as nh,bo as ih}from"../chunks/BtOVeLcI.js";import{o as dn,s as Pe,a as Xt,d as zi,k as Xg,e as jg}from"../chunks/BNpXeuQ_.js";import{c as Te,a as C,p as Tn,f as K,t as Et,d as qg}from"../chunks/BoLtD6vo.js";import{i as be}from"../chunks/DAQN5y4A.js";import{d as ga,u as Ru,o as Yg,p as Nt,L as Kg,l as Zg,a as ds,D as gc,i as Uo,M as $g,b as vc,f as xl,g as bl,A as Jg,U as Qg}from"../chunks/DIyQYaq7.js";import{S as ev}from"../chunks/BRHPfB44.js";import{M as tv,l as nv,m as iv,q as bp,r as rv,s as sv,t as av,v as ov,w as lv,x as cv,A as uv,o as dv,f as yp,u as hv,g as fv,y as pv,a as mv,k as gv}from"../chunks/SM988pE-.js";import{f as Ft,r as Du,e as Zt,a as Qt,c as Dt,d as Fo,k as Sp,l as yl,j as Ii,s as vv}from"../chunks/22C0ZkpD.js";import{s as mt,r as ut,p as oe,c as ze,b as ui}from"../chunks/ChEZL1UP.js";import{p as rh}from"../chunks/DTSOQAZW.js";import{a as nl,o as Mp}from"../chunks/C4cbQnXC.js";import{w as yo,F as sh}from"../chunks/aGXM-hZQ.js";import{b as wp}from"../chunks/Bfsx6G_D.js";import{S as ia}from"../chunks/CkeXmJE0.js";import{S as Oo}from"../chunks/BdIvVr5K.js";import{S as ah}from"../chunks/CitY1SZ1.js";import{C as Lu}from"../chunks/Bj6y_fSA.js";import{I as fn,c as ci}from"../chunks/BuC_QZkR.js";import{X as _v}from"../chunks/Ca8xAcDY.js";import{R as Er,D as Tr,b as hr,a as gs,c as vs}from"../chunks/jiMRToiE.js";import{s as pt}from"../chunks/8uBOzWQA.js";import{a as bi,e as Rr,h as zo,x as xv,c as Iu,b as Vn,d as Je,m as jt,s as _c,r as Nu,S as bv,y as yv}from"../chunks/Bf2Kb0d4.js";import{C as mr,w as pr,E as Sv,S as Mv,h as Ep,n as Un,d as Tp,e as Ap,a as Cp,A as Pp,H as Rp,c as Dp,j as Lp}from"../chunks/MGblXd4C.js";import{i as wv,H as Ev,F as Ip,P as Np,c as Up,g as Bo,d as Fp,o as Op,R as Tv,S as Av,a as Cv,b as Pv}from"../chunks/DNdxyuBP.js";import{C as ra}from"../chunks/LZnjyP_x.js";import{B as Bn}from"../chunks/mlApEF2J.js";import{P as Rv,F as oh,D as Sl,U as lh}from"../chunks/CFq1UfS7.js";import{h as Dv}from"../chunks/ClDgNAKE.js";import{T as Lv,a as Iv,b as Nv,d as Uv,c as Fv}from"../chunks/BVUbFuzT.js";import{C as zp,a as _s}from"../chunks/BawNisij.js";import{C as Bp}from"../chunks/Mn4D08zE.js";import{T as So}from"../chunks/DllGpGf3.js";import{C as Ov,a as zv}from"../chunks/CY6l1SkO.js";import{C as Bv}from"../chunks/C2PlvXZq.js";import{C as kv}from"../chunks/C0Xb3vka.js";import{L as lr}from"../chunks/wegQDfR0.js";import{a as Vv}from"../chunks/C2RxSzQd.js";import{I as xs}from"../chunks/CJvX1bCR.js";import{M as Hv,C as Gv,I as Wv}from"../chunks/C38beKZN.js";import{t as Xv}from"../chunks/ADO9qhNc.js";import{F as jv}from"../chunks/k1GnUs7f.js";import{r as qv}from"../chunks/Cbu9Tg11.js";import{C as Yv}from"../chunks/3w4Rd2x8.js";import{inflateSync as Kv}from"../chunks/BzBbrBKd.js";const Zv=[];function Uu(n,e=!1,t=!1){return Mo(n,new Map,"",Zv,null,t)}function Mo(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(zg(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]=Mo(c,e,t,i,null,s))}return o}if(Bg(n)===kg){o={},e.set(n,o),r!==null&&e.set(r,o);for(var d of Object.keys(n))o[d]=Mo(n[d],e,t,i,null,s);return o}if(n instanceof Date)return structuredClone(n);if(typeof n.toJSON=="function"&&!s)return Mo(n.toJSON(),e,t,i,n)}if(n instanceof EventTarget)return n;try{return structuredClone(n)}catch{return n}}class $v{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return Vg(this.#t)}get(){const e=ws(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=ws(this.#t);return t===void 0?e:t}set(e){return Pu(this.#t,e)}}function ch(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 Jv(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 Qv(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 uh(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 kp(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 Ml(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 wl(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 e0(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 t0(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 n0(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 i0(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 r0(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 s0(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 a0(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 Fu(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 Ou(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 zu(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 o0(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 l0(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 c0(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 u0(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 d0(n,e){if(wv(n)){const i=n();return i===void 0?e:i}return n===void 0?e:n}function il(n,e){let t=Be(null);const i=O(()=>d0(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 Bu{#e=Be(!1);constructor(){Pt(()=>(wn(()=>W(this.#e,!0)),()=>{W(this.#e,!1)}))}get current(){return u(this.#e)}}const h0=Iu({component:"checkbox",parts:["root","group","group-label","input"]}),f0=new mr("Checkbox.Group"),Vp=new mr("Checkbox.Root");class ku{static create(e,t=null){return Vp.set(new ku(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),pr.pre([()=>Uu(this.group?.opts.value.current),()=>this.opts.value.current],([i,r])=>{!i||!r||(this.opts.checked.current=i.includes(r))}),pr.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===Sv){e.preventDefault(),this.opts.type.current==="submit"&&e.currentTarget.closest("form")?.requestSubmit();return}e.key===Mv&&(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":xv(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":zo(this.trueRequired),"aria-readonly":zo(this.trueReadonly),"data-disabled":Rr(this.trueDisabled),"data-readonly":Rr(this.trueReadonly),"data-state":p0(this.opts.checked.current,this.opts.indeterminate.current),[h0.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return u(this.#a)}set props(e){W(this.#a,e)}}class Vu{static create(){return new Vu(Vp.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){Ep(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 p0(n,e){return e?"indeterminate":n?"checked":"unchecked"}function m0(n,e){st(e,!0);const t=Vu.create();var i=Te(),r=J(i);{var s=a=>{Ev(a,mt(()=>t.props))};be(r,a=>{t.shouldRender&&a(s)})}C(n,i),at()}var g0=K("<button><!></button>"),v0=K("<!> <!>",1);function _0(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=f0.getOr(null);p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1)),pr.pre(()=>l(),()=>{p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1))});const v=ku.create({checked:Je(()=>i(),T=>{i(T),e.onCheckedChange?.(T)}),disabled:Je(()=>s()??!1),required:Je(()=>a()),name:Je(()=>o()),value:Je(()=>l()),id:Je(()=>c()),ref:Je(()=>r(),T=>r(T)),indeterminate:Je(()=>d(),T=>{d(T),e.onIndeterminateChange?.(T)}),type:Je(()=>f()),readonly:Je(()=>!!e.readonly)},p),x=O(()=>jt({...h},v.props));var g=v0(),m=J(g);{var b=T=>{var y=Te(),A=J(y);{let _=O(()=>({props:u(x),...v.snippetProps}));pt(A,()=>e.child,()=>u(_))}C(T,y)},w=T=>{var y=g0();Ft(y,()=>({...u(x)}));var A=Z(y);pt(A,()=>e.children??wt,()=>v.snippetProps),j(y),C(T,y)};be(m,T=>{e.child?T(b):T(w,-1)})}var S=ae(m,2);m0(S,{}),C(n,g),at()}function x0(n,e){st(e,!0);let t=oe(e,"open",15,!1),i=oe(e,"onOpenChange",3,Un),r=oe(e,"onOpenChangeComplete",3,Un);tv.create({open:Je(()=>t(),s=>{t(s),i()?.(s)}),onOpenChangeComplete:Je(()=>r())}),Ip(n,{children:(s,a)=>{var o=Te(),l=J(o);pt(l,()=>e.children??wt),C(s,o)},$$slots:{default:!0}}),at()}var b0=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=nv.create({id:Je(()=>r()),disabled:Je(()=>s()),onSelect:Je(()=>a()),ref:Je(()=>i(),x=>i(x)),closeOnSelect:Je(()=>o())}),d=O(()=>jt(l,c.props));var f=Te(),h=J(f);{var p=x=>{var g=Te(),m=J(g);pt(m,()=>e.child,()=>({props:u(d)})),C(x,g)},v=x=>{var g=b0();Ft(g,()=>({...u(d)}));var m=Z(g);pt(m,()=>e.children??wt),j(g),C(x,g)};be(h,x=>{e.child?x(p):x(v,-1)})}C(n,f),at()}var y0=K("<div><!></div>");function S0(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=iv.create({id:Je(()=>r()),ref:Je(()=>i(),h=>i(h))}),o=O(()=>jt(s,a.props));var l=Te(),c=J(l);{var d=h=>{var p=Te(),v=J(p);pt(v,()=>e.child,()=>({props:u(o)})),C(h,p)},f=h=>{var p=y0();Ft(p,()=>({...u(o)}));var v=Z(p);pt(v,()=>e.children??wt),j(p),C(h,p)};be(c,h=>{e.child?h(d):h(f,-1)})}C(n,l),at()}var M0=K("<div><div><!></div></div>"),w0=K("<div><div><!></div></div>");function E0(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),v=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 m=bp.create({id:Je(()=>i()),loop:Je(()=>s()),ref:Je(()=>r(),U=>r(U)),isSub:!0,onCloseAutoFocus:Je(()=>y)});function b(U){const N=U.currentTarget.contains(U.target),D=sv[m.parentMenu.root.opts.dir.current].includes(U.key);N&&D&&(m.parentMenu.onClose(),m.parentMenu.triggerNode?.focus(),U.preventDefault())}const w=O(()=>m.parentMenu.root.getBitsAttr("sub-content")),S=O(()=>jt(g,m.props,{side:v(),onkeydown:b,[u(w)]:""}));function T(U){f()(U),!U.defaultPrevented&&(U.preventDefault(),m.parentMenu.root.isUsingKeyboard&&m.parentMenu.contentNode&&rv.dispatch(m.parentMenu.contentNode))}function y(U){h()(U),!U.defaultPrevented&&U.preventDefault()}function A(U){a()(U),!U.defaultPrevented&&m.parentMenu.onClose()}function _(U){l()(U),!U.defaultPrevented&&m.parentMenu.onClose()}function E(U){if(p()(U),U.defaultPrevented||!Ep(U.target)||U.target.id===m.parentMenu.triggerNode?.id)return;if(m.parentMenu.parentMenu?.contentNode?.contains(U.target)){m.parentMenu.onClose(),U.preventDefault();return}const D=`[${m.parentMenu.root.getBitsAttr("sub-content")}]`;if(U.target.closest(D)){U.preventDefault();return}m.parentMenu.onClose()}var R=Te(),L=J(R);{var F=U=>{Np(U,mt(()=>u(S),{get ref(){return m.opts.ref},get interactOutsideBehavior(){return c()},get escapeKeydownBehavior(){return d()},onOpenAutoFocus:T,get enabled(){return m.parentMenu.opts.open.current},onInteractOutside:A,onEscapeKeydown:_,onFocusOutside:E,preventScroll:!1,get loop(){return s()},get trapFocus(){return x()},get shouldRender(){return m.shouldRender},popper:(D,z)=>{let q=()=>(z?.()).props,Y=()=>(z?.()).wrapperProps;const ee=O(()=>jt(q(),u(S),{style:Bo("menu")},{style:e.style}));var re=Te(),V=J(re);{var Q=me=>{var G=Te(),ie=J(G);{let ne=O(()=>({props:u(ee),wrapperProps:Y(),...m.snippetProps}));pt(ie,()=>e.child,()=>u(ne))}C(me,G)},he=me=>{var G=M0();Ft(G,()=>({...Y()}));var ie=Z(G);Ft(ie,()=>({...u(ee)}));var ne=Z(ie);pt(ne,()=>e.children??wt),j(ie),j(G),C(me,G)};be(V,me=>{e.child?me(Q):me(he,-1)})}C(D,re)},$$slots:{popper:!0}}))},k=U=>{Up(U,mt(()=>u(S),{get ref(){return m.opts.ref},get interactOutsideBehavior(){return c()},get escapeKeydownBehavior(){return d()},onCloseAutoFocus:y,onOpenAutoFocus:T,get open(){return m.parentMenu.opts.open.current},onInteractOutside:A,onEscapeKeydown:_,onFocusOutside:E,preventScroll:!1,get loop(){return s()},get trapFocus(){return x()},get shouldRender(){return m.shouldRender},popper:(D,z)=>{let q=()=>(z?.()).props,Y=()=>(z?.()).wrapperProps;const ee=O(()=>jt(q(),u(S),{style:Bo("menu")},{style:e.style}));var re=Te(),V=J(re);{var Q=me=>{var G=Te(),ie=J(G);{let ne=O(()=>({props:u(ee),wrapperProps:Y(),...m.snippetProps}));pt(ie,()=>e.child,()=>u(ne))}C(me,G)},he=me=>{var G=w0();Ft(G,()=>({...Y()}));var ie=Z(G);Ft(ie,()=>({...u(ee)}));var ne=Z(ie);pt(ne,()=>e.children??wt),j(ie),j(G),C(me,G)};be(V,me=>{e.child?me(Q):me(he,-1)})}C(D,re)},$$slots:{popper:!0}}))};be(L,U=>{o()?U(F):o()||U(k,1)})}C(n,R),at()}var T0=K("<div><!></div>");function A0(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=av.create({disabled:Je(()=>r()),onSelect:Je(()=>a()),id:Je(()=>i()),ref:Je(()=>s(),f=>s(f)),openDelay:Je(()=>o())}),d=O(()=>jt(l,c.props));Fp(n,{get id(){return i()},get ref(){return c.opts.ref},children:(f,h)=>{var p=Te(),v=J(p);{var x=m=>{var b=Te(),w=J(b);pt(w,()=>e.child,()=>({props:u(d)})),C(m,b)},g=m=>{var b=T0();Ft(b,()=>({...u(d)}));var w=Z(b);pt(w,()=>e.children??wt),j(b),C(m,b)};be(v,m=>{e.child?m(x):m(g,-1)})}C(f,p)},$$slots:{default:!0}}),at()}function C0(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=ov.create({variant:Je(()=>a()),dir:Je(()=>i()),onClose:()=>{t(!1),r()(!1)},shouldSkipExitAnimation:()=>o()?.()??!1});lv.create({open:Je(()=>t(),c=>{t(c),r()(c)}),onOpenChangeComplete:Je(()=>s())},l),Ip(n,{children:(c,d)=>{var f=Te(),h=J(f);pt(h,()=>e.children??wt),C(c,f)},$$slots:{default:!0}}),at()}var P0=K("<div><div><!></div></div>"),R0=K("<div><div><!></div></div>");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,"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=bp.create({id:Je(()=>i()),loop:Je(()=>s()),ref:Je(()=>r(),S=>r(S)),onCloseAutoFocus:Je(()=>l())}),p=O(()=>jt(f,h.props));function v(S){if(h.handleInteractOutside(S),!S.defaultPrevented&&(a()(S),!S.defaultPrevented)){if(S.target&&S.target instanceof Element){const T=`[${h.parentMenu.root.getBitsAttr("sub-content")}]`;if(S.target.closest(T))return}h.parentMenu.onClose()}}function x(S){o()(S),!S.defaultPrevented&&h.parentMenu.onClose()}var g=Te(),m=J(g);{var b=S=>{Np(S,mt(()=>u(p),()=>h.popperProps,{get ref(){return h.opts.ref},get enabled(){return h.parentMenu.opts.open.current},onInteractOutside:v,onEscapeKeydown:x,get trapFocus(){return d()},get loop(){return s()},forceMount:!0,get id(){return i()},get shouldRender(){return h.shouldRender},popper:(y,A)=>{let _=()=>(A?.()).props,E=()=>(A?.()).wrapperProps;const R=O(()=>jt(_(),{style:Bo("dropdown-menu")},{style:e.style}));var L=Te(),F=J(L);{var k=N=>{var D=Te(),z=J(D);{let q=O(()=>({props:u(R),wrapperProps:E(),...h.snippetProps}));pt(z,()=>e.child,()=>u(q))}C(N,D)},U=N=>{var D=P0();Ft(D,()=>({...E()}));var z=Z(D);Ft(z,()=>({...u(R)}));var q=Z(z);pt(q,()=>e.children??wt),j(z),j(D),C(N,D)};be(F,N=>{e.child?N(k):N(U,-1)})}C(y,L)},$$slots:{popper:!0}}))},w=S=>{Up(S,mt(()=>u(p),()=>h.popperProps,{get ref(){return h.opts.ref},get open(){return h.parentMenu.opts.open.current},onInteractOutside:v,onEscapeKeydown:x,get trapFocus(){return d()},get loop(){return s()},forceMount:!1,get id(){return i()},get shouldRender(){return h.shouldRender},popper:(y,A)=>{let _=()=>(A?.()).props,E=()=>(A?.()).wrapperProps;const R=O(()=>jt(_(),{style:Bo("dropdown-menu")},{style:e.style}));var L=Te(),F=J(L);{var k=N=>{var D=Te(),z=J(D);{let q=O(()=>({props:u(R),wrapperProps:E(),...h.snippetProps}));pt(z,()=>e.child,()=>u(q))}C(N,D)},U=N=>{var D=R0();Ft(D,()=>({...E()}));var z=Z(D);Ft(z,()=>({...u(R)}));var q=Z(z);pt(q,()=>e.children??wt),j(z),j(D),C(N,D)};be(F,N=>{e.child?N(k):N(U,-1)})}C(y,L)},$$slots:{popper:!0}}))};be(m,S=>{c()?S(b):c()||S(w,1)})}C(n,g),at()}var L0=K("<button><!></button>");function I0(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=cv.create({id:Je(()=>i()),disabled:Je(()=>s()??!1),ref:Je(()=>r(),d=>r(d))}),c=O(()=>jt(o,l.props,{type:a()}));Fp(n,{get id(){return i()},get ref(){return l.opts.ref},children:(d,f)=>{var h=Te(),p=J(h);{var v=g=>{var m=Te(),b=J(m);pt(b,()=>e.child,()=>({props:u(c)})),C(g,m)},x=g=>{var m=L0();Ft(m,()=>({...u(c)}));var b=Z(m);pt(b,()=>e.children??wt),j(m),C(g,m)};be(p,g=>{e.child?g(v):g(x,-1)})}C(d,h)},$$slots:{default:!0}}),at()}class Dr{#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 N0{opts;present;#e;#t=Be(!1);#n=!1;#i=Be(void 0);#r=null;constructor(e){this.opts=e,this.present=this.opts.open,W(this.#t,e.open.current,!0),this.#e=new uv({ref:this.opts.ref,afterTick:this.opts.open}),dv(()=>this.#a()),pr(()=>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 rl(n,e){st(e,!0);const t=new N0({open:Je(()=>e.open),ref:e.ref});var i=Te(),r=J(i);{var s=a=>{var o=Te(),l=J(o);pt(l,()=>e.presence??wt,()=>({present:t.isPresent,transitionStatus:t.transitionStatus})),C(a,o)};be(r,a=>{(e.forceMount||e.open||t.isPresent)&&a(s)})}C(n,i),at()}function U0(n,e,t){return Math.min(t,Math.max(e,n))}class F0{state;#e;constructor(e,t){this.state=_c(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 va=Iu({component:"scroll-area",parts:["root","viewport","corner","thumb","scrollbar"]}),_a=new mr("ScrollArea.Root"),xa=new mr("ScrollArea.Scrollbar"),sl=new mr("ScrollArea.ScrollbarVisible"),Hu=new mr("ScrollArea.ScrollbarAxis"),Hp=new mr("ScrollArea.ScrollbarShared");class Gu{static create(e){return _a.set(new Gu(e))}opts;attachment;#e=Be(null);get scrollAreaNode(){return u(this.#e)}set scrollAreaNode(e){W(this.#e,e,!0)}#t=Be(null);get viewportNode(){return u(this.#t)}set viewportNode(e){W(this.#t,e,!0)}#n=Be(null);get contentNode(){return u(this.#n)}set contentNode(e){W(this.#n,e,!0)}#i=Be(null);get scrollbarXNode(){return u(this.#i)}set scrollbarXNode(e){W(this.#i,e,!0)}#r=Be(null);get scrollbarYNode(){return u(this.#r)}set scrollbarYNode(e){W(this.#r,e,!0)}#s=Be(0);get cornerWidth(){return u(this.#s)}set cornerWidth(e){W(this.#s,e,!0)}#a=Be(0);get cornerHeight(){return u(this.#a)}set cornerHeight(e){W(this.#a,e,!0)}#o=Be(!1);get scrollbarXEnabled(){return u(this.#o)}set scrollbarXEnabled(e){W(this.#o,e,!0)}#l=Be(!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 yp(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`},[va.root]:"",...this.attachment}));get props(){return u(this.#c)}set props(e){W(this.#c,e)}}class Wu{static create(e){return new Wu(e,_a.get())}opts;root;attachment;#e=_c(hv());#t=_c(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"},[va.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 Xu{static create(e){return xa.set(new Xu(e,_a.get()))}opts;root;#e=O(()=>this.opts.orientation.current==="horizontal");get isHorizontal(){return u(this.#e)}set isHorizontal(e){W(this.#e,e)}#t=Be(!1);get hasThumb(){return u(this.#t)}set hasThumb(e){W(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,pr(()=>this.isHorizontal,i=>i?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}}class ju{static create(){return new ju(xa.get())}scrollbar;root;#e=Be(!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=Nu(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 qu{static create(){return new qu(xa.get())}scrollbar;root;machine=new F0("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=il(()=>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 al{static create(){return new al(xa.get())}scrollbar;root;#e=Be(!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=il(()=>{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 Dr(()=>this.root.viewportNode,t),new Dr(()=>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 Yu{static create(){return sl.set(new Yu(xa.get()))}scrollbar;root;#e=Be(null);get thumbNode(){return u(this.#e)}set thumbNode(e){W(this.#e,e,!0)}#t=Be(0);get pointerOffset(){return u(this.#t)}set pointerOffset(e){W(this.#t,e,!0)}#n=Be({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(()=>Gp(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=Be("");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 O0({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(${dh({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, ${dh({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 Ku{static create(e){return Hu.set(new Ku(e,sl.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=Be();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),Xp(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:ko(this.computedStyle.paddingLeft),paddingEnd:ko(this.computedStyle.paddingRight)}})};#t=O(()=>ol(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 Zu{static create(e){return Hu.set(new Zu(e,sl.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=Be();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),Xp(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:ko(this.computedStyle.paddingTop),paddingEnd:ko(this.computedStyle.paddingBottom)}})}#t=O(()=>ol(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 $u{static create(){return Hp.set(new $u(Hu.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=Be(null);get rect(){return u(this.#e)}set rect(e){W(this.#e,e)}#t=Be("");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=il(()=>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})}),Hg(()=>{this.scrollbarVis.sizes,wn(()=>this.handleThumbPositionChange())}),new Dr(()=>this.scrollbar.opts.ref.current,this.handleResize),new Dr(()=>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},[va.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 Ju{static create(e){return new Ju(e,Hp.get())}opts;scrollbarState;attachment;#e;#t=Be();#n=il(()=>{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=z0(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,[va.thumb]:"",...this.attachment}));get props(){return u(this.#i)}set props(e){W(this.#i,e)}}class Qu{static create(e){return new Qu(e,_a.get())}opts;root;attachment;#e=Be(0);#t=Be(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 Dr(()=>this.root.scrollbarXNode,()=>{const i=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=i,W(this.#t,i,!0)}),new Dr(()=>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},[va.corner]:"",...this.attachment}));get props(){return u(this.#i)}set props(e){W(this.#i,e)}}function ko(n){return n?Number.parseInt(n,10):0}function Gp(n,e){const t=n/e;return Number.isNaN(t)?0:t}function ol(n){const e=Gp(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,i=(n.scrollbar.size-t)*e;return Math.max(i,18)}function O0({pointerPos:n,pointerOffset:e,sizes:t,dir:i="ltr"}){const r=ol(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 Wp([l,c],f)(n)}function dh({scrollPos:n,sizes:e,dir:t="ltr"}){const i=ol(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=U0(n,l[0],l[1]);return Wp([0,a],[0,o])(c)}function Wp(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 Xp(n,e){return n>0&&n<e}function z0(n,e){let t={left:n.scrollLeft,top:n.scrollTop},i=0;const r=fv(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 B0=K("<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=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=Gu.create({type:Je(()=>s()),dir:Je(()=>a()),scrollHideDelay:Je(()=>o()),id:Je(()=>r()),ref:Je(()=>i(),x=>i(x))}),d=O(()=>jt(l,c.props));var f=Te(),h=J(f);{var p=x=>{var g=Te(),m=J(g);pt(m,()=>e.child,()=>({props:u(d)})),C(x,g)},v=x=>{var g=B0();Ft(g,()=>({...u(d)}));var m=Z(g);pt(m,()=>e.children??wt),j(g),C(x,g)};be(h,x=>{e.child?x(p):x(v,-1)})}C(n,f),at()}var V0=K("<div><div><!></div></div>");function H0(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=Wu.create({id:Je(()=>r()),ref:Je(()=>i(),h=>i(h))}),o=O(()=>jt(s,a.props)),l=O(()=>jt({},a.contentProps));var c=V0();Ft(c,()=>({...u(o)}));var d=Z(c);Ft(d,()=>({...u(l)}));var f=Z(d);pt(f,()=>e.children??wt),j(d),j(c),C(n,c),at()}var G0=K("<div><!></div>");function jp(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy","child","children"]);const i=$u.create(),r=O(()=>jt(t,i.props));var s=Te(),a=J(s);{var o=c=>{var d=Te(),f=J(d);pt(f,()=>e.child,()=>({props:u(r)})),C(c,d)},l=c=>{var d=G0();Ft(d,()=>({...u(r)}));var f=Z(d);pt(f,()=>e.children??wt),j(d),C(c,d)};be(a,c=>{e.child?c(o):c(l,-1)})}C(n,s),at()}function W0(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy"]);const i=new Bu,r=Ku.create({mounted:Je(()=>i.current)}),s=O(()=>jt(t,r.props));jp(n,mt(()=>u(s))),at()}function X0(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy"]);const i=new Bu,r=Zu.create({mounted:Je(()=>i.current)}),s=O(()=>jt(t,r.props));jp(n,mt(()=>u(s))),at()}function ll(n,e){st(e,!0);let t=ut(e,["$$slots","$$events","$$legacy"]);const i=Yu.create();var r=Te(),s=J(r);{var a=l=>{W0(l,mt(()=>t))},o=l=>{X0(l,mt(()=>t))};be(s,l=>{i.scrollbar.opts.orientation.current==="horizontal"?l(a):l(o,-1)})}C(n,r),at()}function j0(n,e){st(e,!0);let t=oe(e,"forceMount",3,!1),i=ut(e,["$$slots","$$events","$$legacy","forceMount"]);const r=al.create(),s=O(()=>jt(i,r.props));{const a=l=>{ll(l,mt(()=>u(s)))};let o=O(()=>t()||r.isVisible);rl(n,{get open(){return u(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}})}at()}function q0(n,e){st(e,!0);let t=oe(e,"forceMount",3,!1),i=ut(e,["$$slots","$$events","$$legacy","forceMount"]);const r=qu.create(),s=O(()=>jt(i,r.props));{const a=l=>{ll(l,mt(()=>u(s)))};let o=O(()=>t()||!r.isHidden);rl(n,mt(()=>u(s),{get open(){return u(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}}))}at()}function Y0(n,e){st(e,!0);let t=oe(e,"forceMount",3,!1),i=ut(e,["$$slots","$$events","$$legacy","forceMount"]);const r=ju.create(),s=al.create(),a=O(()=>jt(i,r.props,s.props,{"data-state":r.isVisible?"visible":"hidden"})),o=O(()=>t()||r.isVisible&&s.isVisible);rl(n,{get open(){return u(o)},get ref(){return s.scrollbar.opts.ref},presence:c=>{ll(c,mt(()=>u(a)))},$$slots:{presence:!0}}),at()}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","orientation"]);const a=Xu.create({orientation:Je(()=>e.orientation),id:Je(()=>r()),ref:Je(()=>i(),v=>i(v))}),o=O(()=>a.root.opts.type.current);var l=Te(),c=J(l);{var d=v=>{Y0(v,mt(()=>s,{get id(){return r()}}))},f=v=>{q0(v,mt(()=>s,{get id(){return r()}}))},h=v=>{j0(v,mt(()=>s,{get id(){return r()}}))},p=v=>{ll(v,mt(()=>s,{get id(){return r()}}))};be(c,v=>{u(o)==="hover"?v(d):u(o)==="scroll"?v(f,1):u(o)==="auto"?v(h,2):u(o)==="always"&&v(p,3)})}C(n,l),at()}var Z0=K("<div><!></div>");function $0(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 Bu,s=Ju.create({id:Je(()=>e.id),ref:Je(()=>t(),f=>t(f)),mounted:Je(()=>r.current)}),a=O(()=>jt(i,s.props,{style:{hidden:!e.present}}));var o=Te(),l=J(o);{var c=f=>{var h=Te(),p=J(h);pt(p,()=>e.child,()=>({props:u(a)})),C(f,h)},d=f=>{var h=Z0();Ft(h,()=>({...u(a)}));var p=Z(h);pt(p,()=>e.children??wt),j(h),C(f,h)};be(l,f=>{e.child?f(c):f(d,-1)})}C(n,o),at()}function J0(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=sl.get();{const l=(d,f)=>{let h=()=>(f?.()).present;$0(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);rl(n,{get open(){return u(c)},get ref(){return o.scrollbar.opts.ref},presence:l,$$slots:{presence:!0}})}at()}var Q0=K("<div><!></div>");function e_(n,e){st(e,!0);let t=oe(e,"ref",15,null),i=ut(e,["$$slots","$$events","$$legacy","ref","id","children","child"]);const r=Qu.create({id:Je(()=>e.id),ref:Je(()=>t(),d=>t(d))}),s=O(()=>jt(i,r.props));var a=Te(),o=J(a);{var l=d=>{var f=Te(),h=J(f);pt(h,()=>e.child,()=>({props:u(s)})),C(d,f)},c=d=>{var f=Q0();Ft(f,()=>({...u(s)}));var h=Z(f);pt(h,()=>e.children??wt),j(f),C(d,f)};be(o,d=>{e.child?d(l):d(c,-1)})}C(n,a),at()}function t_(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=_a.get(),o=O(()=>!!(a.scrollbarXNode&&a.scrollbarYNode)),l=O(()=>a.opts.type.current!=="scroll"&&u(o));var c=Te(),d=J(c);{var f=h=>{e_(h,mt(()=>s,{get id(){return r()},get ref(){return i()},set ref(p){i(p)}}))};be(d,h=>{u(l)&&h(f)})}C(n,c),at()}function hh(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 qp(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 Yp(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 n_(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 i_(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function ed(n,e,t){if(typeof n=="number"){const i=t-e;let r=Math.ceil(i/n);const s=n_(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=i_(f,s);c.push(h)}return c}return[...new Set(n)].filter(i=>i>=e&&i<=t).sort((i,r)=>i-r)}function Ar(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 Ca(n,e,t){const i=e.indexOf(n);return i===-1?Ar(n,e):t==="next"?i<e.length-1?e[i+1]:n:i>0?e[i-1]:n}function r_(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 fr=Iu({component:"slider",parts:["root","thumb","range","tick","tick-label","thumb-label"]}),td=new mr("Slider.Root");class Kp{opts;attachment;#e=Be(!1);get isActive(){return u(this.#e)}set isActive(e){W(this.#e,e,!0)}#t=Be(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(()=>ed(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 yp(this.opts.ref),new Dr(()=>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(fr.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 r_([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":Rr(this.opts.disabled.current),style:{touchAction:u(this.#s)},[fr.root]:"",...this.attachment}));get props(){return u(this.#a)}set props(e){W(this.#a,e)}}class s_ extends Kp{opts;isMulti=!1;constructor(e){super(e),this.opts=e,Op(()=>Nu(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))),pr([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=ed(t,i,r),o=c=>a.includes(c),l=c=>Ar(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=Ar(o,l);this.updateValue(c)}}updateValue=e=>{this.opts.value.current=Ar(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;!Lp(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=qp(this.direction,i);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":t,"aria-disabled":zo(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":t,"data-orientation":this.opts.orientation.current,style:r,[fr.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=Yp(this.direction,s,l),d=i<=t;return{"data-disabled":Rr(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,[fr.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 a_ extends Kp{opts;isMulti=!0;#e=Be(null);get activeThumb(){return u(this.#e)}set activeThumb(e){W(this.#e,e,!0)}#t=Be(0);get currentThumbIdx(){return u(this.#t)}set currentThumbIdx(e){W(this.#t,e,!0)}constructor(e){super(e),this.opts=e,Op(()=>Nu(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))),pr([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=ed(t,i,r),o=c=>a.includes(c),l=c=>Ar(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=Ar(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;!Lp(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(fr.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(!pv(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]=Ar(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=qp(this.direction,a);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":s,"aria-disabled":zo(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":s,"data-orientation":this.opts.orientation.current,style:o,[fr.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=Yp(this.direction,s,l),d=t.length===1?i<=t[0]:t[0]<=i&&i<=t[t.length-1];return{"data-disabled":Rr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":d?"":void 0,"data-value":i,style:c,[fr.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 o_{static create(e){const{type:t,...i}=e,r=t==="single"?new s_(i):new a_(i);return td.set(r)}}const l_=[Tp,Ap,Cp,Pp,Rp,Dp];class nd{static create(e){return new nd(e,td.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",...hh(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",...hh(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":Rr(this.root.opts.disabled.current),style:this.rangeStyles,[fr.range]:"",...this.attachment}));get props(){return u(this.#t)}set props(e){W(this.#t,e)}}class id{static create(e){return new id(e,td.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),!l_.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 Rp:this.#t(s);break;case Dp:this.#t(a);break;case Tp:if(c!=="horizontal")break;if(e.metaKey){const h=d==="rl"?a:s;this.#t(h)}else{const p=Ca(l,f,d==="rl"?"next":"prev");this.#t(p)}break;case Ap:if(c!=="horizontal")break;if(e.metaKey){const h=d==="rl"?s:a;this.#t(h)}else{const p=Ca(l,f,d==="rl"?"prev":"next");this.#t(p)}break;case Cp:if(e.metaKey){const h=d==="tb"?s:a;this.#t(h)}else{const p=Ca(l,f,d==="tb"?"prev":"next");this.#t(p)}break;case Pp:if(e.metaKey){const h=d==="tb"?a:s;this.#t(h)}else{const p=Ca(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":Rr(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 c_=K("<span><!></span>");function u_(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"),v=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 m(){if(s()===void 0)return e.type==="single"?u(x):[]}m(),pr.pre(()=>s(),()=>{m()});const b=o_.create({id:Je(()=>i()),ref:Je(()=>r(),_=>r(_)),value:Je(()=>s(),_=>{s(_),a()(_)}),onValueCommit:Je(()=>o()),disabled:Je(()=>l()),min:Je(()=>u(x)),max:Je(()=>u(g)),step:Je(()=>c()),dir:Je(()=>d()),autoSort:Je(()=>f()),orientation:Je(()=>h()),thumbPositioning:Je(()=>p()),type:e.type,trackPadding:Je(()=>e.trackPadding)}),w=O(()=>jt(v,b.props));var S=Te(),T=J(S);{var y=_=>{var E=Te(),R=J(E);{let L=O(()=>({props:u(w),...b.snippetProps}));pt(R,()=>e.child,()=>u(L))}C(_,E)},A=_=>{var E=c_();Ft(E,()=>({...u(w)}));var R=Z(E);pt(R,()=>e.children??wt,()=>b.snippetProps),j(E),C(_,E)};be(T,_=>{e.child?_(y):_(A,-1)})}C(n,S),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=ut(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const a=nd.create({id:Je(()=>r()),ref:Je(()=>i(),h=>i(h))}),o=O(()=>jt(s,a.props));var l=Te(),c=J(l);{var d=h=>{var p=Te(),v=J(p);pt(v,()=>e.child,()=>({props:u(o)})),C(h,p)},f=h=>{var p=d_();Ft(p,()=>({...u(o)}));var v=Z(p);pt(v,()=>e.children??wt),j(p),C(h,p)};be(c,h=>{e.child?h(d):h(f,-1)})}C(n,l),at()}var f_=K("<span><!></span>");function p_(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=id.create({id:Je(()=>r()),ref:Je(()=>i(),p=>i(p)),index:Je(()=>e.index),disabled:Je(()=>s())}),l=O(()=>jt(a,o.props));var c=Te(),d=J(c);{var f=p=>{var v=Te(),x=J(v);{let g=O(()=>({active:o.root.isThumbActive(o.opts.index.current),props:u(l)}));pt(x,()=>e.child,()=>u(g))}C(p,v)},h=p=>{var v=f_();Ft(v,()=>({...u(l)}));var x=Z(v);{let g=O(()=>({active:o.root.isThumbActive(o.opts.index.current)}));pt(x,()=>e.children??wt,()=>u(g))}j(v),C(p,v)};be(d,p=>{e.child?p(f):p(h,-1)})}C(n,c),at()}var wo=new Map;function Zp(n,e){wo.set(n,e)}Zp("Rhino.Geometry.Point3d",(n,e)=>{let t=e;return!t||typeof t.X!="number"?null:new n.Point([t.X,t.Y,t.Z])});Zp("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 m_(n){if(wo.has(n))return wo.get(n);for(let[e,t]of wo)if(n.startsWith(e))return t}function g_(n){return!n||typeof n!="object"?null:n.data??n.value??null}function v_(n,e,t){let i=m_(e);if(i)try{return i(t,n)}catch(r){Nt().warn(`Failed to decode Rhino type ${e}:`,r)}try{let r=g_(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 hs={STRING:"System.String",INT:"System.Int32",DOUBLE:"System.Double",BOOL:"System.Boolean"},__="Rhino.Geometry.",x_=["WebDisplay"],b_="FileData";function $p(n){return x_.some(e=>n.includes(e))}function Jp(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 y_(n,e,t){switch(e){case hs.STRING:return typeof n!="string"?n:n.replace(/^"(.*)"$/,"$1");case hs.INT:return Number.parseInt(n,10);case hs.DOUBLE:return Number.parseFloat(n);case hs.BOOL:return String(n).toLowerCase()==="true";default:return t&&e.startsWith(__)?v_(n,e,t):n}}function Qp(n,e,t,i){if(typeof n!="string")return n;let r=t?Jp(n):n;return y_(r,e,i)}function S_(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 Vo(n,e){for(let t of Object.values(n))if(Array.isArray(t))for(let i of t)e(i)}function M_(n,e=!1,t={}){let{parseValues:i=!0,rhino:r,stringOnly:s=!1}=t,a={},o=new Set;for(let l of n.values)Vo(l.InnerTree,c=>{if($p(c.type)||s&&c.type!==hs.STRING)return;let d=e?c.id:l.ParamName;if(!d)return;let f=Qp(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 w_(n){let e=[];for(let t of n.values)Vo(t.InnerTree,i=>{if(!i.type.includes(b_))return;let r=Jp(i.data);S_(r)&&e.push(r)});return e}function E_(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 Vo(l.InnerTree,d=>{d.id===e.byId&&(c=!0)}),c}),!a)return;let o=[];if(Vo(a.InnerTree,l=>{if("byId"in e&&l.id!==e.byId||$p(l.type)||s&&l.type!==hs.STRING)return;let c=Qp(l.data,l.type,i,r);o.push(c)}),o.length!==0)return o.length===1?o[0]:o}var T_=class{constructor(n,e=!1){this.response=n,this.debug=e}getValues(n=!1,e={}){return M_(this.response,n,e)}getValue(n,e){return E_(this.response,n,e)}async extractMeshesFromResponse(n){let e={debug:this.debug,...n},t;try{({getThreeMeshesFromComputeResponse:t}=await _p(()=>Promise.resolve().then(()=>BD),void 0,import.meta.url))}catch(i){throw new ga("Failed to load three.js visualization module. Ensure three.js is installed as a peer dependency.",Ru.INVALID_STATE,{context:{originalError:i instanceof Error?i.message:String(i)}})}return t(this.response,e)}getFileData(){return w_(this.response)}async getAndDownloadFiles(n,e){let t=this.getFileData();await Yg(t,n,e)}},A_=/^\{(\d+(?:;\d+)*)?\}$/;function C_(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])=>A_.test(t)&&Array.isArray(i))}function Ds(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 P_=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},R_=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},D_=n=>typeof n=="string"?n.length>=2&&n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):n.startsWith('"')?n.slice(1):n:null,L_=n=>{if(typeof n=="string"){let e=n.trim();return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).trim()),e}return null};function em(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 fh(n,e,t){let i=Number(n.toFixed(e));return Math.abs(n-i)<t?i:n}function I_(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 N_(n,e=1e-8){let t=n.paramType==="Integer";if(C_(n.default))return{default:n.default,stepSize:t?1:.1};let i=Ds(n.default,P_,!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?I_(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"?fh(d,o,e):d):typeof i=="number"&&(i=fh(i,o,e)),{default:i,stepSize:a}}var U_={types:["Number","Integer"],parse(n,e){let{default:t,stepSize:i}=N_(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}}},F_={types:["Boolean"],parse(n,e){let t;try{t=Ds(n.default,R_,!1)}catch(i){throw i instanceof Error?new ga(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}}},O_={types:["Text"],parse(n,e){let t=Ds(n.default,D_,!1);return{...e,paramType:"Text",default:t}},fallback(n,e){let t=(n.atMost??1)>1;return{...e,paramType:"Text",default:t?[""]:""}}},z_={types:["ValueList"],parse(n,e){if(!n.values||typeof n.values!="object"||Object.keys(n.values).length===0)throw ga.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}}},B_={types:["Geometry"],parse(n,e){let t=Ds(n.default,em(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}}},k_={types:["File"],parse(n,e){let t=Ds(n.default,em(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}}},V_={types:["Color"],parse(n,e){let t=Ds(n.default,L_,!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"}}},H_=[U_,F_,O_,z_,B_,k_,V_],G_=new Map(H_.flatMap(n=>n.types.map(e=>[e,n])));new Map([...G_.keys()].map(n=>[n.toLowerCase(),n]));const rd="184",bs={ROTATE:0,DOLLY:1,PAN:2},fs={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},W_=0,ph=1,X_=2,Eo=1,j_=2,ps=3,Kn=0,Yn=1,Qn=2,Mn=0,ys=1,mh=2,gh=3,vh=4,tm=5,gi=100,q_=101,Y_=102,K_=103,Z_=104,Qs=200,$_=201,J_=202,Q_=203,xc=204,bc=205,yc=206,ex=207,Sc=208,tx=209,nx=210,ix=211,rx=212,sx=213,ax=214,Mc=0,wc=1,Ec=2,Es=3,Tc=4,Ac=5,Cc=6,Pc=7,nm=0,ox=1,lx=2,Fi=0,sd=1,ad=2,od=3,ld=4,cd=5,ud=6,ba=7,im=300,Lr=301,Ts=302,To=303,El=304,cl=306,Ir=1e3,_i=1001,Rc=1002,xn=1003,cx=1004,Pa=1005,hn=1006,Tl=1007,cr=1008,qn=1009,rm=1010,sm=1011,oa=1012,dd=1013,Oi=1014,ti=1015,Fn=1016,hd=1017,fd=1018,As=1020,am=35902,om=35899,lm=1021,cm=1022,li=1023,Yi=1026,ur=1027,um=1028,pd=1029,Nr=1030,md=1031,gd=1033,Ao=33776,Co=33777,Po=33778,Ro=33779,Dc=35840,Lc=35841,Ic=35842,Nc=35843,Uc=36196,Fc=37492,Oc=37496,zc=37488,Bc=37489,Ho=37490,kc=37491,Vc=37808,Hc=37809,Gc=37810,Wc=37811,Xc=37812,jc=37813,qc=37814,Yc=37815,Kc=37816,Zc=37817,$c=37818,Jc=37819,Qc=37820,eu=37821,tu=36492,nu=36494,iu=36495,ru=36283,su=36284,Go=36285,au=36286,ux=3200,Wo=0,dx=1,or="",Wn="srgb",la="srgb-linear",Xo="linear",Ut="srgb",Vr=7680,_h=519,hx=512,fx=513,px=514,vd=515,mx=516,gx=517,_d=518,vx=519,ou=35044,xh="300 es",Ni=2e3,ca=2001;function _x(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function jo(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function xx(){const n=jo("canvas");return n.style.display="block",n}const bh={};function qo(...n){const e="THREE."+n.shift();console.log(e,...n)}function dm(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=dm(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=dm(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...n)}}function lu(...n){const e=n.join(" ");e in bh||(bh[e]=!0,ft(...n))}function bx(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 yx={[Mc]:wc,[Ec]:Cc,[Tc]:Pc,[Es]:Ac,[wc]:Mc,[Cc]:Ec,[Pc]:Tc,[Ac]:Es};class gr{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 yh=1234567;const Ss=Math.PI/180,ua=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 xd(n,e){return(n%e+e)%e}function Sx(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function Mx(n,e,t){return n!==e?(t-n)/(e-n):0}function sa(n,e,t){return(1-t)*n+t*e}function wx(n,e,t,i){return sa(n,e,1-Math.exp(-t*i))}function Ex(n,e=1){return e-Math.abs(xd(n,e*2)-e)}function Tx(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function Ax(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Cx(n,e){return n+Math.floor(Math.random()*(e-n+1))}function Px(n,e){return n+Math.random()*(e-n)}function Rx(n){return n*(.5-Math.random())}function Dx(n){n!==void 0&&(yh=n);let e=yh+=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 Lx(n){return n*Ss}function Ix(n){return n*ua}function Nx(n){return(n&n-1)===0&&n!==0}function Ux(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Fx(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Ox(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),v=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*v,l*p,o*c);break;case"YXY":n.set(l*p,o*d,l*v,o*c);break;case"ZYZ":n.set(l*v,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 hm={DEG2RAD:Ss,RAD2DEG:ua,generateUUID:ji,clamp:gt,euclideanModulo:xd,mapLinear:Sx,inverseLerp:Mx,lerp:sa,damp:wx,pingpong:Ex,smoothstep:Tx,smootherstep:Ax,randInt:Cx,randFloat:Px,randFloatSpread:Rx,seededRandom:Dx,degToRad:Lx,radToDeg:Ix,isPowerOfTwo:Nx,ceilPowerOfTwo:Ux,floorPowerOfTwo:Fx,setQuaternionFromProperEuler:Ox,normalize:Ot,denormalize:vi},Zd=class Zd{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}};Zd.prototype.isVector2=!0;let it=Zd;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],v=s[a+2],x=s[a+3];if(f!==x||l!==h||c!==p||d!==v){let g=l*h+c*p+d*v+f*x;g<0&&(h=-h,p=-p,v=-v,x=-x,g=-g);let m=1-o;if(g<.9995){const b=Math.acos(g),w=Math.sin(b);m=Math.sin(m*b)/w,o=Math.sin(o*b)/w,l=l*m+h*o,c=c*m+p*o,d=d*m+v*o,f=f*m+x*o}else{l=l*m+h*o,c=c*m+p*o,d=d*m+v*o,f=f*m+x*o;const b=1/Math.sqrt(l*l+c*c+d*d+f*f);l*=b,c*=b,d*=b,f*=b}}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],v=s[a+3];return e[t]=o*v+d*f+l*p-c*h,e[t+1]=l*v+d*h+c*f-o*p,e[t+2]=c*v+d*p+o*h-l*f,e[t+3]=d*v-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),v=l(s/2);switch(a){case"XYZ":this._x=h*d*f+c*p*v,this._y=c*p*f-h*d*v,this._z=c*d*v+h*p*f,this._w=c*d*f-h*p*v;break;case"YXZ":this._x=h*d*f+c*p*v,this._y=c*p*f-h*d*v,this._z=c*d*v-h*p*f,this._w=c*d*f+h*p*v;break;case"ZXY":this._x=h*d*f-c*p*v,this._y=c*p*f+h*d*v,this._z=c*d*v+h*p*f,this._w=c*d*f-h*p*v;break;case"ZYX":this._x=h*d*f-c*p*v,this._y=c*p*f+h*d*v,this._z=c*d*v-h*p*f,this._w=c*d*f+h*p*v;break;case"YZX":this._x=h*d*f+c*p*v,this._y=c*p*f+h*d*v,this._z=c*d*v-h*p*f,this._w=c*d*f-h*p*v;break;case"XZY":this._x=h*d*f-c*p*v,this._y=c*p*f-h*d*v,this._z=c*d*v+h*p*f,this._w=c*d*f+h*p*v;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 $d=class $d{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(Sh.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Sh.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 Al.copy(this).projectOnVector(e),this.sub(Al)}reflect(e){return this.sub(Al.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}};$d.prototype.isVector3=!0;let X=$d;const Al=new X,Sh=new xi,Jd=class Jd{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],v=i[8],x=r[0],g=r[3],m=r[6],b=r[1],w=r[4],S=r[7],T=r[2],y=r[5],A=r[8];return s[0]=a*x+o*b+l*T,s[3]=a*g+o*w+l*y,s[6]=a*m+o*S+l*A,s[1]=c*x+d*b+f*T,s[4]=c*g+d*w+f*y,s[7]=c*m+d*S+f*A,s[2]=h*x+p*b+v*T,s[5]=h*g+p*w+v*y,s[8]=h*m+p*S+v*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,v=t*f+i*h+r*p;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/v;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(Cl.makeScale(e,t)),this}rotate(e){return this.premultiply(Cl.makeRotation(-e)),this}translate(e,t){return this.premultiply(Cl.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)}};Jd.prototype.isMatrix3=!0;let xt=Jd;const Cl=new xt,Mh=new xt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),wh=new xt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function zx(){const n={enabled:!0,workingColorSpace:la,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=Ms(r.r),r.g=Ms(r.g),r.b=Ms(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===or?Xo: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 lu("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return lu("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({[la]:{primaries:e,whitePoint:i,transfer:Xo,toXYZ:Mh,fromXYZ:wh,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Wn},outputColorSpaceConfig:{drawingBufferColorSpace:Wn}},[Wn]:{primaries:e,whitePoint:i,transfer:Ut,toXYZ:Mh,fromXYZ:wh,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Wn}}}),n}const At=zx();function qi(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Ms(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Hr;class Bx{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{Hr===void 0&&(Hr=jo("canvas")),Hr.width=e.width,Hr.height=e.height;const r=Hr.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=Hr}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=jo("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 kx=0;class bd{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:kx++}),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(Pl(r[a].image)):s.push(Pl(r[a]))}else s=Pl(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function Pl(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?Bx.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 Vx=0;const Rl=new X;class En extends gr{constructor(e=En.DEFAULT_IMAGE,t=En.DEFAULT_MAPPING,i=_i,r=_i,s=hn,a=cr,o=li,l=qn,c=En.DEFAULT_ANISOTROPY,d=or){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Vx++}),this.uuid=ji(),this.name="",this.source=new bd(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(Rl).x}get height(){return this.source.getSize(Rl).y}get depth(){return this.source.getSize(Rl).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!==im)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ir:e.x=e.x-Math.floor(e.x);break;case _i:e.x=e.x<0?0:1;break;case Rc: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 Ir:e.y=e.y-Math.floor(e.y);break;case _i:e.y=e.y<0?0:1;break;case Rc: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=im;En.DEFAULT_ANISOTROPY=1;const Qd=class Qd{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],v=l[9],x=l[2],g=l[6],m=l[10];if(Math.abs(d-h)<.01&&Math.abs(f-x)<.01&&Math.abs(v-g)<.01){if(Math.abs(d+h)<.1&&Math.abs(f+x)<.1&&Math.abs(v+g)<.1&&Math.abs(c+p+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(c+1)/2,S=(p+1)/2,T=(m+1)/2,y=(d+h)/4,A=(f+x)/4,_=(v+g)/4;return w>S&&w>T?w<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(w),r=y/i,s=A/i):S>T?S<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(S),i=y/r,s=_/r):T<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(T),i=A/s,r=_/s),this.set(i,r,s,t),this}let b=Math.sqrt((g-v)*(g-v)+(f-x)*(f-x)+(h-d)*(h-d));return Math.abs(b)<.001&&(b=1),this.x=(g-v)/b,this.y=(f-x)/b,this.z=(h-d)/b,this.w=Math.acos((c+p+m-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}};Qd.prototype.isVector4=!0;let kt=Qd;class Hx extends gr{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 bd(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 Hx{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class fm 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 Gx 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 tl=class tl{constructor(e,t,i,r,s,a,o,l,c,d,f,h,p,v,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,v,x,g)}set(e,t,i,r,s,a,o,l,c,d,f,h,p,v,x,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=a,m[9]=o,m[13]=l,m[2]=c,m[6]=d,m[10]=f,m[14]=h,m[3]=p,m[7]=v,m[11]=x,m[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 tl().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/Gr.setFromMatrixColumn(e,0).length(),s=1/Gr.setFromMatrixColumn(e,1).length(),a=1/Gr.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,v=o*d,x=o*f;t[0]=l*d,t[4]=-l*f,t[8]=c,t[1]=p+v*c,t[5]=h-x*c,t[9]=-o*l,t[2]=x-h*c,t[6]=v+p*c,t[10]=a*l}else if(e.order==="YXZ"){const h=l*d,p=l*f,v=c*d,x=c*f;t[0]=h+x*o,t[4]=v*o-p,t[8]=a*c,t[1]=a*f,t[5]=a*d,t[9]=-o,t[2]=p*o-v,t[6]=x+h*o,t[10]=a*l}else if(e.order==="ZXY"){const h=l*d,p=l*f,v=c*d,x=c*f;t[0]=h-x*o,t[4]=-a*f,t[8]=v+p*o,t[1]=p+v*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,v=o*d,x=o*f;t[0]=l*d,t[4]=v*c-p,t[8]=h*c+x,t[1]=l*f,t[5]=x*c+h,t[9]=p*c-v,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const h=a*l,p=a*c,v=o*l,x=o*c;t[0]=l*d,t[4]=x-h*f,t[8]=v*f+p,t[1]=f,t[5]=a*d,t[9]=-o*d,t[2]=-c*d,t[6]=p*f+v,t[10]=h-x*f}else if(e.order==="XZY"){const h=a*l,p=a*c,v=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-v,t[2]=v*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(Wx,e,Xx)}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(),Ra.crossVectors($n,Qi),r[0]=Qi.x,r[4]=Ra.x,r[8]=$n.x,r[1]=Qi.y,r[5]=Ra.y,r[9]=$n.y,r[2]=Qi.z,r[6]=Ra.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],v=i[2],x=i[6],g=i[10],m=i[14],b=i[3],w=i[7],S=i[11],T=i[15],y=r[0],A=r[4],_=r[8],E=r[12],R=r[1],L=r[5],F=r[9],k=r[13],U=r[2],N=r[6],D=r[10],z=r[14],q=r[3],Y=r[7],ee=r[11],re=r[15];return s[0]=a*y+o*R+l*U+c*q,s[4]=a*A+o*L+l*N+c*Y,s[8]=a*_+o*F+l*D+c*ee,s[12]=a*E+o*k+l*z+c*re,s[1]=d*y+f*R+h*U+p*q,s[5]=d*A+f*L+h*N+p*Y,s[9]=d*_+f*F+h*D+p*ee,s[13]=d*E+f*k+h*z+p*re,s[2]=v*y+x*R+g*U+m*q,s[6]=v*A+x*L+g*N+m*Y,s[10]=v*_+x*F+g*D+m*ee,s[14]=v*E+x*k+g*z+m*re,s[3]=b*y+w*R+S*U+T*q,s[7]=b*A+w*L+S*N+T*Y,s[11]=b*_+w*F+S*D+T*ee,s[15]=b*E+w*k+S*z+T*re,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],v=e[3],x=e[7],g=e[11],m=e[15],b=l*p-c*h,w=o*p-c*f,S=o*h-l*f,T=a*p-c*d,y=a*h-l*d,A=a*f-o*d;return t*(x*b-g*w+m*S)-i*(v*b-g*T+m*y)+r*(v*w-x*T+m*A)-s*(v*S-x*y+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],v=e[12],x=e[13],g=e[14],m=e[15],b=t*o-i*a,w=t*l-r*a,S=t*c-s*a,T=i*l-r*o,y=i*c-s*o,A=r*c-s*l,_=d*x-f*v,E=d*g-h*v,R=d*m-p*v,L=f*g-h*x,F=f*m-p*x,k=h*m-p*g,U=b*k-w*F+S*L+T*R-y*E+A*_;if(U===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const N=1/U;return e[0]=(o*k-l*F+c*L)*N,e[1]=(r*F-i*k-s*L)*N,e[2]=(x*A-g*y+m*T)*N,e[3]=(h*y-f*A-p*T)*N,e[4]=(l*R-a*k-c*E)*N,e[5]=(t*k-r*R+s*E)*N,e[6]=(g*S-v*A-m*w)*N,e[7]=(d*A-h*S+p*w)*N,e[8]=(a*F-o*R+c*_)*N,e[9]=(i*R-t*F-s*_)*N,e[10]=(v*y-x*S+m*b)*N,e[11]=(f*S-d*y-p*b)*N,e[12]=(o*E-a*L-l*_)*N,e[13]=(t*L-i*E+r*_)*N,e[14]=(x*w-v*T-g*b)*N,e[15]=(d*T-f*w+h*b)*N,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,v=s*f,x=a*d,g=a*f,m=o*f,b=l*c,w=l*d,S=l*f,T=i.x,y=i.y,A=i.z;return r[0]=(1-(x+m))*T,r[1]=(p+S)*T,r[2]=(v-w)*T,r[3]=0,r[4]=(p-S)*y,r[5]=(1-(h+m))*y,r[6]=(g+b)*y,r[7]=0,r[8]=(v+w)*A,r[9]=(g-b)*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=Gr.set(r[0],r[1],r[2]).length();const o=Gr.set(r[4],r[5],r[6]).length(),l=Gr.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 v,x;if(l)v=s/(a-s),x=a*s/(a-s);else if(o===Ni)v=-(a+s)/(a-s),x=-2*a*s/(a-s);else if(o===ca)v=-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]=v,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 v,x;if(l)v=1/(a-s),x=a/(a-s);else if(o===Ni)v=-2/(a-s),x=-(a+s)/(a-s);else if(o===ca)v=-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]=v,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}};tl.prototype.isMatrix4=!0;let Lt=tl;const Gr=new X,hi=new Lt,Wx=new X(0,0,0),Xx=new X(1,1,1),Qi=new X,Ra=new X,$n=new X,Eh=new Lt,Th=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 Eh.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Eh,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Th.setFromEuler(this),this.setFromQuaternion(Th,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 yd{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 jx=0;const Ah=new X,Wr=new xi,Bi=new Lt,Da=new X,Os=new X,qx=new X,Yx=new xi,Ch=new X(1,0,0),Ph=new X(0,1,0),Rh=new X(0,0,1),Dh={type:"added"},Kx={type:"removed"},Xr={type:"childadded",child:null},Dl={type:"childremoved",child:null};class rn extends gr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:jx++}),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 yd,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 Wr.setFromAxisAngle(e,t),this.quaternion.multiply(Wr),this}rotateOnWorldAxis(e,t){return Wr.setFromAxisAngle(e,t),this.quaternion.premultiply(Wr),this}rotateX(e){return this.rotateOnAxis(Ch,e)}rotateY(e){return this.rotateOnAxis(Ph,e)}rotateZ(e){return this.rotateOnAxis(Rh,e)}translateOnAxis(e,t){return Ah.copy(e).applyQuaternion(this.quaternion),this.position.add(Ah.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Ch,e)}translateY(e){return this.translateOnAxis(Ph,e)}translateZ(e){return this.translateOnAxis(Rh,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?Da.copy(e):Da.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Os.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Bi.lookAt(Os,Da,this.up):Bi.lookAt(Da,Os,this.up),this.quaternion.setFromRotationMatrix(Bi),r&&(Bi.extractRotation(r.matrixWorld),Wr.setFromRotationMatrix(Bi),this.quaternion.premultiply(Wr.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(Dh),Xr.child=e,this.dispatchEvent(Xr),Xr.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(Kx),Dl.child=e,this.dispatchEvent(Dl),Dl.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(Dh),Xr.child=e,this.dispatchEvent(Xr),Xr.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(Os,e,qx),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Os,Yx,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),v=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),v.length>0&&(i.nodes=v)}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 ea=class extends rn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const Zx={type:"move"};class Ll{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ea,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 ea,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 ea,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),m=this._getHandJoint(c,x);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const d=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],h=d.position.distanceTo(f.position),p=.02,v=.005;c.inputState.pinching&&h>p+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=p-v&&(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(Zx)))}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 ea;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const pm={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},La={h:0,s:0,l:0};function Il(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=xd(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=Il(a,s,e+1/3),this.g=Il(a,s,e),this.b=Il(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=pm[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=Ms(e.r),this.g=Ms(e.g),this.b=Ms(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(La);const i=sa(er.h,La.h,t),r=sa(er.s,La.s,t),s=sa(er.l,La.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=pm;class $x 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,Nl=new X,Vi=new X,jr=new X,qr=new X,Lh=new X,Ul=new X,Fl=new X,Ol=new X,zl=new kt,Bl=new kt,kl=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),Nl.subVectors(e,t);const a=fi.dot(fi),o=fi.dot(ki),l=fi.dot(Nl),c=ki.dot(ki),d=ki.dot(Nl),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,v=(a*d-o*l)*h;return s.set(1-p-v,v,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 zl.setScalar(0),Bl.setScalar(0),kl.setScalar(0),zl.fromBufferAttribute(e,t),Bl.fromBufferAttribute(e,i),kl.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(zl,s.x),a.addScaledVector(Bl,s.y),a.addScaledVector(kl,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;jr.subVectors(r,i),qr.subVectors(s,i),Ul.subVectors(e,i);const l=jr.dot(Ul),c=qr.dot(Ul);if(l<=0&&c<=0)return t.copy(i);Fl.subVectors(e,r);const d=jr.dot(Fl),f=qr.dot(Fl);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(jr,a);Ol.subVectors(e,s);const p=jr.dot(Ol),v=qr.dot(Ol);if(v>=0&&p<=v)return t.copy(s);const x=p*c-l*v;if(x<=0&&c>=0&&v<=0)return o=c/(c-v),t.copy(i).addScaledVector(qr,o);const g=d*v-p*f;if(g<=0&&f-d>=0&&p-v>=0)return Lh.subVectors(s,r),o=(f-d)/(f-d+(p-v)),t.copy(r).addScaledVector(Lh,o);const m=1/(g+x+h);return a=x*m,o=h*m,t.copy(i).addScaledVector(jr,a).addScaledVector(qr,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(),Ia.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Ia.copy(i.boundingBox)),Ia.applyMatrix4(e.matrixWorld),this.union(Ia)}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(zs),Na.subVectors(this.max,zs),Yr.subVectors(e.a,zs),Kr.subVectors(e.b,zs),Zr.subVectors(e.c,zs),tr.subVectors(Kr,Yr),nr.subVectors(Zr,Kr),_r.subVectors(Yr,Zr);let t=[0,-tr.z,tr.y,0,-nr.z,nr.y,0,-_r.z,_r.y,tr.z,0,-tr.x,nr.z,0,-nr.x,_r.z,0,-_r.x,-tr.y,tr.x,0,-nr.y,nr.x,0,-_r.y,_r.x,0];return!Vl(t,Yr,Kr,Zr,Na)||(t=[1,0,0,0,1,0,0,0,1],!Vl(t,Yr,Kr,Zr,Na))?!1:(Ua.crossVectors(tr,nr),t=[Ua.x,Ua.y,Ua.z],Vl(t,Yr,Kr,Zr,Na))}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,Ia=new di,Yr=new X,Kr=new X,Zr=new X,tr=new X,nr=new X,_r=new X,zs=new X,Na=new X,Ua=new X,xr=new X;function Vl(n,e,t,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){xr.fromArray(n,s);const o=r.x*Math.abs(xr.x)+r.y*Math.abs(xr.y)+r.z*Math.abs(xr.z),l=e.dot(xr),c=t.dot(xr),d=i.dot(xr);if(Math.max(-Math.max(l,c,d),Math.min(l,c,d))>o)return!1}return!0}const Xi=Jx();function Jx(){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 Qx(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 eb(n){const e=n>>10;return Xi.uint32View[0]=Xi.mantissaTable[Xi.offsetTable[e]+(n&1023)]+Xi.exponentTable[e],Xi.floatView[0]}class Fa{static toHalfFloat(e){return Qx(e)}static fromHalfFloat(e){return eb(e)}}const mn=new X,Oa=new it;let tb=0;class kn extends gr{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:tb++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=ou,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++)Oa.fromBufferAttribute(this,t),Oa.applyMatrix3(e),this.setXY(t,Oa.x,Oa.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!==ou&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class mm extends kn{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class gm 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 nb=new di,Bs=new X,Hl=new X;class Fr{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):nb.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;Bs.subVectors(e,this.center);const t=Bs.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Bs,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):(Hl.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Bs.copy(e.center).add(Hl)),this.expandByPoint(Bs.copy(e.center).sub(Hl))),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 ib=0;const ai=new Lt,Gl=new rn,$r=new X,Jn=new di,ks=new di,Sn=new X;class on extends gr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:ib++}),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(_x(e)?gm:mm)(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 Gl.lookAt(e),Gl.updateMatrix(),this.applyMatrix4(Gl.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter($r).negate(),this.translate($r.x,$r.y,$r.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 Fr);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];ks.setFromBufferAttribute(o),this.morphTargetsRelative?(Sn.addVectors(Jn.min,ks.min),Jn.expandByPoint(Sn),Sn.addVectors(Jn.max,ks.max),Jn.expandByPoint(Sn)):(Jn.expandByPoint(ks.min),Jn.expandByPoint(ks.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&&($r.fromBufferAttribute(e,c),Sn.add($r)),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,v=new it,x=new X,g=new X;function m(_,E,R){c.fromBufferAttribute(i,_),d.fromBufferAttribute(i,E),f.fromBufferAttribute(i,R),h.fromBufferAttribute(s,_),p.fromBufferAttribute(s,E),v.fromBufferAttribute(s,R),d.sub(c),f.sub(c),p.sub(h),v.sub(h);const L=1/(p.x*v.y-v.x*p.y);isFinite(L)&&(x.copy(d).multiplyScalar(v.y).addScaledVector(f,-p.y).multiplyScalar(L),g.copy(f).multiplyScalar(p.x).addScaledVector(d,-v.x).multiplyScalar(L),o[_].add(x),o[E].add(x),o[R].add(x),l[_].add(g),l[E].add(g),l[R].add(g))}let b=this.groups;b.length===0&&(b=[{start:0,count:e.count}]);for(let _=0,E=b.length;_<E;++_){const R=b[_],L=R.start,F=R.count;for(let k=L,U=L+F;k<U;k+=3)m(e.getX(k+0),e.getX(k+1),e.getX(k+2))}const w=new X,S=new X,T=new X,y=new X;function A(_){T.fromBufferAttribute(r,_),y.copy(T);const E=o[_];w.copy(E),w.sub(T.multiplyScalar(T.dot(E))).normalize(),S.crossVectors(y,E);const L=S.dot(l[_])<0?-1:1;a.setXYZW(_,w.x,w.y,w.z,L)}for(let _=0,E=b.length;_<E;++_){const R=b[_],L=R.start,F=R.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 v=e.getX(h+0),x=e.getX(h+1),g=e.getX(h+2);r.fromBufferAttribute(t,v),s.fromBufferAttribute(t,x),a.fromBufferAttribute(t,g),d.subVectors(a,s),f.subVectors(r,s),d.cross(f),o.fromBufferAttribute(i,v),l.fromBufferAttribute(i,x),c.fromBufferAttribute(i,g),o.add(d),l.add(d),c.add(d),i.setXYZ(v,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,v=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 m=0;m<d;m++)h[v++]=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 vm{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ou,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){qo("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){qo("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 rb=0;class yi extends gr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rb++}),this.uuid=ji(),this.name="",this.type="Material",this.blending=ys,this.side=Kn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=xc,this.blendDst=bc,this.blendEquation=gi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new tt(0,0,0),this.blendAlpha=0,this.depthFunc=Es,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=_h,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Vr,this.stencilZFail=Vr,this.stencilZPass=Vr,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!==ys&&(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!==xc&&(i.blendSrc=this.blendSrc),this.blendDst!==bc&&(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!==Es&&(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!==_h&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Vr&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Vr&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Vr&&(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 _m 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 Jr;const Vs=new X,Qr=new X,es=new X,ts=new it,Hs=new it,xm=new Lt,za=new X,Gs=new X,Ba=new X,Ih=new it,Wl=new it,Nh=new it;class ns extends rn{constructor(e=new _m){if(super(),this.isSprite=!0,this.type="Sprite",Jr===void 0){Jr=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 vm(t,5);Jr.setIndex([0,1,2,0,2,3]),Jr.setAttribute("position",new Ui(i,3,0,!1)),Jr.setAttribute("uv",new Ui(i,2,3,!1))}this.geometry=Jr,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.'),Qr.setFromMatrixScale(this.matrixWorld),xm.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),es.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Qr.multiplyScalar(-es.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const a=this.center;ka(za.set(-.5,-.5,0),es,a,Qr,r,s),ka(Gs.set(.5,-.5,0),es,a,Qr,r,s),ka(Ba.set(.5,.5,0),es,a,Qr,r,s),Ih.set(0,0),Wl.set(1,0),Nh.set(1,1);let o=e.ray.intersectTriangle(za,Gs,Ba,!1,Vs);if(o===null&&(ka(Gs.set(-.5,.5,0),es,a,Qr,r,s),Wl.set(0,1),o=e.ray.intersectTriangle(za,Ba,Gs,!1,Vs),o===null))return;const l=e.ray.origin.distanceTo(Vs);l<e.near||l>e.far||t.push({distance:l,point:Vs.clone(),uv:ei.getInterpolation(Vs,za,Gs,Ba,Ih,Wl,Nh,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 ka(n,e,t,i,r,s){ts.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Hs.x=s*ts.x-r*ts.y,Hs.y=r*ts.x+s*ts.y):Hs.copy(ts),n.copy(e),n.x+=Hs.x,n.y+=Hs.y,n.applyMatrix4(xm)}const Gi=new X,Xl=new X,Va=new X,ir=new X,jl=new X,Ha=new X,ql=new X;class ya{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){Xl.copy(e).add(t).multiplyScalar(.5),Va.copy(t).sub(e).normalize(),ir.copy(this.origin).sub(Xl);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Va),o=ir.dot(this.direction),l=-ir.dot(Va),c=ir.lengthSq(),d=Math.abs(1-a*a);let f,h,p,v;if(d>0)if(f=a*l-o,h=a*o-l,v=s*d,f>=0)if(h>=-v)if(h<=v){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<=-v?(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<=v?(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(Xl).addScaledVector(Va,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){jl.subVectors(t,e),Ha.subVectors(i,e),ql.crossVectors(jl,Ha);let a=this.direction.dot(ql),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(Ha.crossVectors(ir,Ha));if(l<0)return null;const c=o*this.direction.dot(jl.cross(ir));if(c<0||l+c>a)return null;const d=-o*ir.dot(ql);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 Sd 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=nm,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 Uh=new Lt,br=new ya,Ga=new Fr,Fh=new X,Wa=new X,Xa=new X,ja=new X,Yl=new X,qa=new X,Oh=new X,Ya=new X;class an extends rn{constructor(e=new on,t=new Sd){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){qa.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const d=o[l],f=s[l];d!==0&&(Yl.fromBufferAttribute(f,e),a?qa.addScaledVector(Yl,d):qa.addScaledVector(Yl.sub(t),d))}t.add(qa)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Ga.copy(i.boundingSphere),Ga.applyMatrix4(s),br.copy(e.ray).recast(e.near),!(Ga.containsPoint(br.origin)===!1&&(br.intersectSphere(Ga,Fh)===null||br.origin.distanceToSquared(Fh)>(e.far-e.near)**2))&&(Uh.copy(s).invert(),br.copy(e.ray).applyMatrix4(Uh),!(i.boundingBox!==null&&br.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,br)))}_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 v=0,x=h.length;v<x;v++){const g=h[v],m=a[g.materialIndex],b=Math.max(g.start,p.start),w=Math.min(o.count,Math.min(g.start+g.count,p.start+p.count));for(let S=b,T=w;S<T;S+=3){const y=o.getX(S),A=o.getX(S+1),_=o.getX(S+2);r=Ka(this,m,e,i,c,d,f,y,A,_),r&&(r.faceIndex=Math.floor(S/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const v=Math.max(0,p.start),x=Math.min(o.count,p.start+p.count);for(let g=v,m=x;g<m;g+=3){const b=o.getX(g),w=o.getX(g+1),S=o.getX(g+2);r=Ka(this,a,e,i,c,d,f,b,w,S),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let v=0,x=h.length;v<x;v++){const g=h[v],m=a[g.materialIndex],b=Math.max(g.start,p.start),w=Math.min(l.count,Math.min(g.start+g.count,p.start+p.count));for(let S=b,T=w;S<T;S+=3){const y=S,A=S+1,_=S+2;r=Ka(this,m,e,i,c,d,f,y,A,_),r&&(r.faceIndex=Math.floor(S/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const v=Math.max(0,p.start),x=Math.min(l.count,p.start+p.count);for(let g=v,m=x;g<m;g+=3){const b=g,w=g+1,S=g+2;r=Ka(this,a,e,i,c,d,f,b,w,S),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}}}function sb(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;Ya.copy(o),Ya.applyMatrix4(n.matrixWorld);const c=t.ray.origin.distanceTo(Ya);return c<t.near||c>t.far?null:{distance:c,point:Ya.clone(),object:n}}function Ka(n,e,t,i,r,s,a,o,l,c){n.getVertexPosition(o,Wa),n.getVertexPosition(l,Xa),n.getVertexPosition(c,ja);const d=sb(n,e,t,i,Wa,Xa,ja,Oh);if(d){const f=new X;ei.getBarycoord(Oh,Wa,Xa,ja,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(Wa,Xa,ja,h.normal),d.face=h,d.barycoord=f}return d}class ul 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 Kl=new X,ab=new X,ob=new xt;class ar{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=Kl.subVectors(i,t).cross(ab.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(Kl),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||ob.getNormalMatrix(e),r=this.coplanarPoint(Kl).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 yr=new Fr,lb=new it(.5,.5),Za=new X;class Md{constructor(e=new ar,t=new ar,i=new ar,r=new ar,s=new ar,a=new ar){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],v=s[8],x=s[9],g=s[10],m=s[11],b=s[12],w=s[13],S=s[14],T=s[15];if(r[0].setComponents(c-a,p-d,m-v,T-b).normalize(),r[1].setComponents(c+a,p+d,m+v,T+b).normalize(),r[2].setComponents(c+o,p+f,m+x,T+w).normalize(),r[3].setComponents(c-o,p-f,m-x,T-w).normalize(),i)r[4].setComponents(l,h,g,S).normalize(),r[5].setComponents(c-l,p-h,m-g,T-S).normalize();else if(r[4].setComponents(c-l,p-h,m-g,T-S).normalize(),t===Ni)r[5].setComponents(c+l,p+h,m+g,T+S).normalize();else if(t===ca)r[5].setComponents(l,h,g,S).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(),yr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),yr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(yr)}intersectsSprite(e){yr.center.set(0,0,0);const t=lb.distanceTo(e.center);return yr.radius=.7071067811865476+t,yr.applyMatrix4(e.matrixWorld),this.intersectsSphere(yr)}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(Za.x=r.normal.x>0?e.max.x:e.min.x,Za.y=r.normal.y>0?e.max.y:e.min.y,Za.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Za)<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 cb 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 Yo=new X,Ko=new X,zh=new Lt,Ws=new ya,$a=new Fr,Zl=new X,Bh=new X;class ub extends rn{constructor(e=new on,t=new cb){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++)Yo.fromBufferAttribute(t,r-1),Ko.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Yo.distanceTo(Ko);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(),$a.copy(i.boundingSphere),$a.applyMatrix4(r),$a.radius+=s,e.ray.intersectsSphere($a)===!1)return;zh.copy(r).invert(),Ws.copy(e.ray).applyMatrix4(zh);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),v=Math.min(d.count,a.start+a.count);for(let x=p,g=v-1;x<g;x+=c){const m=d.getX(x),b=d.getX(x+1),w=Ja(this,e,Ws,l,m,b,x);w&&t.push(w)}if(this.isLineLoop){const x=d.getX(v-1),g=d.getX(p),m=Ja(this,e,Ws,l,x,g,v-1);m&&t.push(m)}}else{const p=Math.max(0,a.start),v=Math.min(h.count,a.start+a.count);for(let x=p,g=v-1;x<g;x+=c){const m=Ja(this,e,Ws,l,x,x+1,x);m&&t.push(m)}if(this.isLineLoop){const x=Ja(this,e,Ws,l,v-1,p,v-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 Ja(n,e,t,i,r,s,a){const o=n.geometry.attributes.position;if(Yo.fromBufferAttribute(o,r),Ko.fromBufferAttribute(o,s),t.distanceSqToSegment(Yo,Ko,Zl,Bh)>i)return;Zl.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(Zl);if(!(c<e.near||c>e.far))return{distance:c,point:Bh.clone().applyMatrix4(n.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:n}}class Zo 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 kh=new Lt,cu=new ya,Qa=new Fr,eo=new X;class $o extends rn{constructor(e=new on,t=new Zo){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(),Qa.copy(i.boundingSphere),Qa.applyMatrix4(r),Qa.radius+=s,e.ray.intersectsSphere(Qa)===!1)return;kh.copy(r).invert(),cu.copy(e.ray).applyMatrix4(kh);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 v=h,x=p;v<x;v++){const g=c.getX(v);eo.fromBufferAttribute(f,g),Vh(eo,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 v=h,x=p;v<x;v++)eo.fromBufferAttribute(f,v),Vh(eo,v,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 Vh(n,e,t,i,r,s,a){const o=cu.distanceSqToPoint(n);if(o<t){const l=new X;cu.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 bm extends En{constructor(e=[],t=Lr,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 db 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 Ur extends En{constructor(e,t,i=Oi,r,s,a,o=xn,l=xn,c,d=Yi,f=1){if(d!==Yi&&d!==ur)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 bd(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 hb extends Ur{constructor(e,t=Oi,i=Lr,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 ym extends En{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Sa 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;v("z","y","x",-1,-1,i,t,e,a,s,0),v("z","y","x",1,-1,i,t,-e,a,s,1),v("x","z","y",1,1,e,i,t,r,a,2),v("x","z","y",1,-1,e,i,-t,r,a,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("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 v(x,g,m,b,w,S,T,y,A,_,E){const R=S/A,L=T/_,F=S/2,k=T/2,U=y/2,N=A+1,D=_+1;let z=0,q=0;const Y=new X;for(let ee=0;ee<D;ee++){const re=ee*L-k;for(let V=0;V<N;V++){const Q=V*R-F;Y[x]=Q*b,Y[g]=re*w,Y[m]=U,c.push(Y.x,Y.y,Y.z),Y[x]=0,Y[g]=0,Y[m]=y>0?1:-1,d.push(Y.x,Y.y,Y.z),f.push(V/A),f.push(1-ee/_),z+=1}}for(let ee=0;ee<_;ee++)for(let re=0;re<A;re++){const V=h+re+N*ee,Q=h+re+N*(ee+1),he=h+(re+1)+N*(ee+1),me=h+(re+1)+N*ee;l.push(V,Q,me),l.push(Q,he,me),q+=6}o.addGroup(p,q,E),p+=q,h+=z}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Sa(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class wd 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 v=0;const x=[],g=i/2;let m=0;b(),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 b(){const S=new X,T=new X;let y=0;const A=(t-e)/i;for(let _=0;_<=s;_++){const E=[],R=_/s,L=R*(t-e)+e;for(let F=0;F<=r;F++){const k=F/r,U=k*l+o,N=Math.sin(U),D=Math.cos(U);T.x=L*N,T.y=-R*i+g,T.z=L*D,f.push(T.x,T.y,T.z),S.set(N,A,D).normalize(),h.push(S.x,S.y,S.z),p.push(k,1-R),E.push(v++)}x.push(E)}for(let _=0;_<r;_++)for(let E=0;E<s;E++){const R=x[E][_],L=x[E+1][_],F=x[E+1][_+1],k=x[E][_+1];(e>0||E!==0)&&(d.push(R,L,k),y+=3),(t>0||E!==s-1)&&(d.push(L,F,k),y+=3)}c.addGroup(m,y,0),m+=y}function w(S){const T=v,y=new it,A=new X;let _=0;const E=S===!0?e:t,R=S===!0?1:-1;for(let F=1;F<=r;F++)f.push(0,g*R,0),h.push(0,R,0),p.push(.5,.5),v++;const L=v;for(let F=0;F<=r;F++){const U=F/r*l+o,N=Math.cos(U),D=Math.sin(U);A.x=E*D,A.y=g*R,A.z=E*N,f.push(A.x,A.y,A.z),h.push(0,R,0),y.x=N*.5+.5,y.y=D*.5*R+.5,p.push(y.x,y.y),v++}for(let F=0;F<r;F++){const k=T+F,U=L+F;S===!0?d.push(U,U+1,k):d.push(U+1,U,k),_+=3}c.addGroup(m,_,S===!0?1:2),m+=_}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new wd(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}const to=new X,no=new X,$l=new X,io=new ei;class fb 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(Ss*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 v=0;v<l;v+=3){a?(c[0]=a.getX(v),c[1]=a.getX(v+1),c[2]=a.getX(v+2)):(c[0]=v,c[1]=v+1,c[2]=v+2);const{a:x,b:g,c:m}=io;if(x.fromBufferAttribute(o,c[0]),g.fromBufferAttribute(o,c[1]),m.fromBufferAttribute(o,c[2]),io.getNormal($l),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(m.x*r)},${Math.round(m.y*r)},${Math.round(m.z*r)}`,!(f[0]===f[1]||f[1]===f[2]||f[2]===f[0]))for(let b=0;b<3;b++){const w=(b+1)%3,S=f[b],T=f[w],y=io[d[b]],A=io[d[w]],_=`${S}_${T}`,E=`${T}_${S}`;E in h&&h[E]?($l.dot(h[E].normal)<=s&&(p.push(y.x,y.y,y.z),p.push(A.x,A.y,A.z)),h[E]=null):_ in h||(h[_]={index0:c[b],index1:c[w],normal:$l.clone()})}}for(const v in h)if(h[v]){const{index0:x,index1:g}=h[v];to.fromBufferAttribute(o,x),no.fromBufferAttribute(o,g),p.push(to.x,to.y,to.z),p.push(no.x,no.y,no.z)}this.setAttribute("position",new sn(p,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class Ls 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=[],v=[],x=[],g=[];for(let m=0;m<d;m++){const b=m*h-a;for(let w=0;w<c;w++){const S=w*f-s;v.push(S,-b,0),x.push(0,0,1),g.push(w/o),g.push(1-m/l)}}for(let m=0;m<l;m++)for(let b=0;b<o;b++){const w=b+c*m,S=b+c*(m+1),T=b+1+c*(m+1),y=b+1+c*m;p.push(w,S,y),p.push(S,T,y)}this.setIndex(p),this.setAttribute("position",new sn(v,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 Ls(e.width,e.height,e.widthSegments,e.heightSegments)}}class pb 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 v=h,x=h+p;v<x;v+=3)for(let g=0;g<3;g++){const m=o.getX(v+g),b=o.getX(v+(g+1)%3);r.fromBufferAttribute(a,m),s.fromBufferAttribute(a,b),Hh(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),Hh(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 Hh(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 Cs(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];if(Gh(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(Gh(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=Cs(n[t]);for(const r in i)e[r]=i[r]}return e}function Gh(n){return n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)}function mb(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function Sm(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:At.workingColorSpace}const Di={clone:Cs,merge:zn};var gb=`void main() {
|
|
2
2
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
3
3
|
}`,vb=`void main() {
|
|
4
4
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|