@selvajs/selva 4.8.2 → 4.9.0
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/{C66oCHKq.js → BJ1titjr.js} +1 -1
- package/build/client/_app/immutable/chunks/BJ1titjr.js.br +0 -0
- package/build/client/_app/immutable/chunks/BJ1titjr.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Ba5e_Szc2.js +1 -0
- package/build/client/_app/immutable/chunks/Ba5e_Szc2.js.br +2 -0
- package/build/client/_app/immutable/chunks/Ba5e_Szc2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{D2AS0eL_.js → CR6AN07v.js} +1 -1
- package/build/client/_app/immutable/chunks/CR6AN07v.js.br +2 -0
- package/build/client/_app/immutable/chunks/CR6AN07v.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CXk7zzxB.js +2 -0
- package/build/client/_app/immutable/chunks/CXk7zzxB.js.br +0 -0
- package/build/client/_app/immutable/chunks/CXk7zzxB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DGbMmQU12.js → D9e_QTet2.js} +1 -1
- package/build/client/_app/immutable/chunks/D9e_QTet2.js.br +0 -0
- package/build/client/_app/immutable/chunks/D9e_QTet2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DvVWAv53.js → DJgkiyc_.js} +1 -1
- package/build/client/_app/immutable/chunks/DJgkiyc_.js.br +0 -0
- package/build/client/_app/immutable/chunks/DJgkiyc_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{D7YIFN7-2.js → DhW_r4Se2.js} +1 -1
- package/build/client/_app/immutable/chunks/DhW_r4Se2.js.br +0 -0
- package/build/client/_app/immutable/chunks/DhW_r4Se2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{pf1uJd41.js → QnE7Zhsu.js} +1 -1
- package/build/client/_app/immutable/chunks/QnE7Zhsu.js.br +0 -0
- package/build/client/_app/immutable/chunks/QnE7Zhsu.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.C6mEVjCa.js → app.C7z1DYdd.js} +2 -2
- package/build/client/_app/immutable/entry/app.C7z1DYdd.js.br +0 -0
- package/build/client/_app/immutable/entry/app.C7z1DYdd.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.CzaR1gTK.js +1 -0
- package/build/client/_app/immutable/entry/start.CzaR1gTK.js.br +0 -0
- package/build/client/_app/immutable/entry/start.CzaR1gTK.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.DVjS-wU3.js → 1.DgxQBbm4.js} +1 -1
- package/build/client/_app/immutable/nodes/1.DgxQBbm4.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.DgxQBbm4.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{11.d4mJ2ENW.js → 11.KerihFoX.js} +1 -1
- package/build/client/_app/immutable/nodes/11.KerihFoX.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.KerihFoX.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{13.OBFmlM4G.js → 13.sF4TjXx5.js} +1 -1
- package/build/client/_app/immutable/nodes/13.sF4TjXx5.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.sF4TjXx5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{14.B2A3QvgV.js → 14.BHIi-huz.js} +1 -1
- package/build/client/_app/immutable/nodes/14.BHIi-huz.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.BHIi-huz.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{15.BngV--Z8.js → 15.B7FPhaeG.js} +1 -1
- package/build/client/_app/immutable/nodes/15.B7FPhaeG.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.B7FPhaeG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{16.C3kb15Hk.js → 16.C_jemWZO.js} +1 -1
- package/build/client/_app/immutable/nodes/16.C_jemWZO.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.C_jemWZO.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{17.qo81_orT.js → 17.CHk2EqVG.js} +1 -1
- package/build/client/_app/immutable/nodes/17.CHk2EqVG.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.CHk2EqVG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{19.BB0bguXe.js → 19.k_KEtYk4.js} +1 -1
- package/build/client/_app/immutable/nodes/19.k_KEtYk4.js.br +0 -0
- package/build/client/_app/immutable/nodes/19.k_KEtYk4.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.BVWPdbfY.js → 2.BMyoGr5f.js} +1 -1
- package/build/client/_app/immutable/nodes/2.BMyoGr5f.js.br +2 -0
- package/build/client/_app/immutable/nodes/2.BMyoGr5f.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{20.CEsCDcUg.js → 20.CqvBzYHe.js} +1 -1
- package/build/client/_app/immutable/nodes/20.CqvBzYHe.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.CqvBzYHe.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{21.DnQOpIlb.js → 21.Bdq7i9gx.js} +1 -1
- package/build/client/_app/immutable/nodes/21.Bdq7i9gx.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.Bdq7i9gx.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{22.DLNR3X0_.js → 22.DiDjt5np.js} +1 -1
- package/build/client/_app/immutable/nodes/22.DiDjt5np.js.br +0 -0
- package/build/client/_app/immutable/nodes/22.DiDjt5np.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{24.Myu3dpCG.js → 24.CUdJe1ye.js} +1 -1
- package/build/client/_app/immutable/nodes/24.CUdJe1ye.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.CUdJe1ye.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{25.fGk6Bd3H.js → 25.D7y_AcOn.js} +1 -1
- package/build/client/_app/immutable/nodes/25.D7y_AcOn.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.D7y_AcOn.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{28.BrHVL459.js → 28.DHXKEO_W.js} +1 -1
- package/build/client/_app/immutable/nodes/28.DHXKEO_W.js.br +0 -0
- package/build/client/_app/immutable/nodes/28.DHXKEO_W.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{29.Cc2cJNYj.js → 29.CWD7F418.js} +1 -1
- package/build/client/_app/immutable/nodes/29.CWD7F418.js.br +0 -0
- package/build/client/_app/immutable/nodes/29.CWD7F418.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.Bk2gicwt.js → 3.CB4c2xi-.js} +1 -1
- package/build/client/_app/immutable/nodes/3.CB4c2xi-.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.CB4c2xi-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{30.DE39sPAX.js → 30.BkiRE7Ol.js} +1 -1
- package/build/client/_app/immutable/nodes/30.BkiRE7Ol.js.br +0 -0
- package/build/client/_app/immutable/nodes/30.BkiRE7Ol.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{31.FEcGG6mC.js → 31.BB3I96IL.js} +1 -1
- package/build/client/_app/immutable/nodes/31.BB3I96IL.js.br +0 -0
- package/build/client/_app/immutable/nodes/31.BB3I96IL.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{5.CrnPEsum.js → 5.Ds9zNfwn.js} +1 -1
- package/build/client/_app/immutable/nodes/5.Ds9zNfwn.js.br +1 -0
- package/build/client/_app/immutable/nodes/5.Ds9zNfwn.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{6.25_MlJn0.js → 6.Do62ld3o.js} +1 -1
- package/build/client/_app/immutable/nodes/6.Do62ld3o.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.Do62ld3o.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.B3uf6wZL.js → 7.CkGkeL0k.js} +1 -1
- package/build/client/_app/immutable/nodes/7.CkGkeL0k.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.CkGkeL0k.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{8.DLtJHXvQ.js → 8.ClQG8D8_.js} +1 -1
- package/build/client/_app/immutable/nodes/8.ClQG8D8_.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.ClQG8D8_.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{9.Wk5Cvrnn.js → 9.DD2KpKEh.js} +1 -1
- package/build/client/_app/immutable/nodes/9.DD2KpKEh.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.DD2KpKEh.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/{AppHeader.js-DSoj21ao.js → AppHeader.js-COKMHUFV.js} +3 -3
- package/build/server/chunks/chunks/{AppHeader.js-DSoj21ao.js.map → AppHeader.js-COKMHUFV.js.map} +1 -1
- package/build/server/chunks/chunks/{SideNav.js-Cr0ZZOJx.js → SideNav.js-aNokKDwy.js} +2 -2
- package/build/server/chunks/chunks/{SideNav.js-Cr0ZZOJx.js.map → SideNav.js-aNokKDwy.js.map} +1 -1
- package/build/server/chunks/chunks/{UserChip.js-DQzUfmob.js → UserChip.js-dJO0x2VB.js} +3 -3
- package/build/server/chunks/chunks/{UserChip.js-DQzUfmob.js.map → UserChip.js-dJO0x2VB.js.map} +1 -1
- package/build/server/chunks/chunks/{client.js-DzGbdrzt.js → client.js-BelvuVWm.js} +2 -2
- package/build/server/chunks/chunks/{client.js-DzGbdrzt.js.map → client.js-BelvuVWm.js.map} +1 -1
- package/build/server/chunks/chunks/forms.js-jAyrBZP9.js +2 -0
- package/build/server/chunks/chunks/forms.js-jAyrBZP9.js.map +1 -0
- package/build/server/chunks/chunks/internal.js-CkVehOOc.js.map +1 -1
- package/build/server/chunks/chunks/{internal2.js-DFCTkHdc.js → internal2.js-CnaYURQz.js} +2 -2
- package/build/server/chunks/chunks/{internal2.js-DFCTkHdc.js.map → internal2.js-CnaYURQz.js.map} +1 -1
- package/build/server/chunks/chunks/navigation.js-jAyrBZP9.js +2 -0
- package/build/server/chunks/chunks/navigation.js-jAyrBZP9.js.map +1 -0
- package/build/server/chunks/chunks/{package.js-LSj2ZYsp.js → package.js-CFVjSCfG.js} +2 -2
- package/build/server/chunks/chunks/{package.js-LSj2ZYsp.js.map → package.js-CFVjSCfG.js.map} +1 -1
- package/build/server/chunks/chunks/{paths.js-veMC2dzy.js → paths.js-lLmRr8a7.js} +2 -2
- package/build/server/chunks/chunks/{paths.js-veMC2dzy.js.map → paths.js-lLmRr8a7.js.map} +1 -1
- package/build/server/chunks/chunks/{state.js-7DhmlguJ.js → state.js-De6VXlTk.js} +2 -2
- package/build/server/chunks/chunks/{state.js-7DhmlguJ.js.map → state.js-De6VXlTk.js.map} +1 -1
- package/build/server/chunks/chunks/{stores.js-B4rCR4-I.js → stores.js-Cw8_ifn0.js} +2 -2
- package/build/server/chunks/chunks/{stores.js-B4rCR4-I.js.map → stores.js-Cw8_ifn0.js.map} +1 -1
- package/build/server/chunks/entries/pages/{_error.svelte.js-7BUdqGDh.js → _error.svelte.js-Do1Jsdl4.js} +4 -4
- package/build/server/chunks/entries/pages/{_error.svelte.js-7BUdqGDh.js.map → _error.svelte.js-Do1Jsdl4.js.map} +1 -1
- package/build/server/chunks/entries/pages/{_page.svelte.js-DHpD4Mha.js → _page.svelte.js-AeMomx7x.js} +6 -6
- package/build/server/chunks/entries/pages/{_page.svelte.js-DHpD4Mha.js.map → _page.svelte.js-AeMomx7x.js.map} +1 -1
- package/build/server/chunks/entries/pages/accept-invite/{_page.svelte.js-BZbuJfms.js → _page.svelte.js-hWqdfF86.js} +4 -4
- package/build/server/chunks/entries/pages/accept-invite/{_page.svelte.js-BZbuJfms.js.map → _page.svelte.js-hWqdfF86.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/{_error.svelte.js-R9omit8u.js → _error.svelte.js-Czgteonq.js} +4 -4
- package/build/server/chunks/entries/pages/admin/{_error.svelte.js-R9omit8u.js.map → _error.svelte.js-Czgteonq.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/{_layout.svelte.js-BHVD-9TB.js → _layout.svelte.js-pAZZ33Bq.js} +7 -7
- package/build/server/chunks/entries/pages/admin/{_layout.svelte.js-BHVD-9TB.js.map → _layout.svelte.js-pAZZ33Bq.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/{_page.server.ts.js-VvoO6FDi.js → _page.server.ts.js-DL41BXc_.js} +2 -2
- package/build/server/chunks/entries/pages/admin/{_page.server.ts.js-VvoO6FDi.js.map → _page.server.ts.js-DL41BXc_.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/{_page.svelte.js-Cn0hF0DI.js → _page.svelte.js-DCKLQ3Uh.js} +4 -4
- package/build/server/chunks/entries/pages/admin/{_page.svelte.js-Cn0hF0DI.js.map → _page.svelte.js-DCKLQ3Uh.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/compute/{_page.svelte.js-441SPXVP.js → _page.svelte.js-3cOj5sHJ.js} +3 -3
- package/build/server/chunks/entries/pages/admin/compute/{_page.svelte.js-441SPXVP.js.map → _page.svelte.js-3cOj5sHJ.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/projects/_id_/{_page.svelte.js-OifDOF_G.js → _page.svelte.js-Bxkj7Gsh.js} +3 -3
- package/build/server/chunks/entries/pages/admin/projects/_id_/{_page.svelte.js-OifDOF_G.js.map → _page.svelte.js-Bxkj7Gsh.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/projects/{_page.svelte.js-DgjWbX-w.js → _page.svelte.js-CfdfOtxT.js} +3 -3
- package/build/server/chunks/entries/pages/admin/projects/{_page.svelte.js-DgjWbX-w.js.map → _page.svelte.js-CfdfOtxT.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/system/{_page.server.ts.js-BW-G9m_7.js → _page.server.ts.js-DZMwr-0a.js} +2 -2
- package/build/server/chunks/entries/pages/admin/system/{_page.server.ts.js-BW-G9m_7.js.map → _page.server.ts.js-DZMwr-0a.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/system/{_page.svelte.js-CKJWNNnL.js → _page.svelte.js-n3gn5t0X.js} +3 -3
- package/build/server/chunks/entries/pages/admin/system/{_page.svelte.js-CKJWNNnL.js.map → _page.svelte.js-n3gn5t0X.js.map} +1 -1
- package/build/server/chunks/entries/pages/admin/users/{_page.svelte.js-Bc-RZFjW.js → _page.svelte.js-DtcpmAeX.js} +4 -4
- package/build/server/chunks/entries/pages/admin/users/{_page.svelte.js-Bc-RZFjW.js.map → _page.svelte.js-DtcpmAeX.js.map} +1 -1
- package/build/server/chunks/entries/pages/auth/email/sent/{_page.svelte.js-BEkP08TZ.js → _page.svelte.js-6NjWsq5P.js} +4 -4
- package/build/server/chunks/entries/pages/auth/email/sent/{_page.svelte.js-BEkP08TZ.js.map → _page.svelte.js-6NjWsq5P.js.map} +1 -1
- package/build/server/chunks/entries/pages/docs/api/{_page.svelte.js-Cb8r7OIX.js → _page.svelte.js-k5vGXNVr.js} +3 -3
- package/build/server/chunks/entries/pages/docs/api/{_page.svelte.js-Cb8r7OIX.js.map → _page.svelte.js-k5vGXNVr.js.map} +1 -1
- package/build/server/chunks/entries/pages/library/_guid_/{_page.svelte.js-TiyA9e3Q.js → _page.svelte.js-BAIOKkAi.js} +5 -5
- package/build/server/chunks/entries/pages/library/_guid_/{_page.svelte.js-TiyA9e3Q.js.map → _page.svelte.js-BAIOKkAi.js.map} +1 -1
- package/build/server/chunks/entries/pages/library/{_page.svelte.js-CgG1X0b8.js → _page.svelte.js-CVCUJqmw.js} +6 -6
- package/build/server/chunks/entries/pages/library/{_page.svelte.js-CgG1X0b8.js.map → _page.svelte.js-CVCUJqmw.js.map} +1 -1
- package/build/server/chunks/entries/pages/login/{_page.svelte.js-jyMQl_7D.js → _page.svelte.js-Cqupgev3.js} +4 -4
- package/build/server/chunks/entries/pages/login/{_page.svelte.js-jyMQl_7D.js.map → _page.svelte.js-Cqupgev3.js.map} +1 -1
- package/build/server/chunks/entries/pages/projects/{_layout.svelte.js-BCoW-2hB.js → _layout.svelte.js-jvdSPmb6.js} +6 -6
- package/build/server/chunks/entries/pages/projects/{_layout.svelte.js-BCoW-2hB.js.map → _layout.svelte.js-jvdSPmb6.js.map} +1 -1
- package/build/server/chunks/entries/pages/projects/{_page.svelte.js-BnM-lziZ.js → _page.svelte.js-BZXgGiq0.js} +4 -4
- package/build/server/chunks/entries/pages/projects/{_page.svelte.js-BnM-lziZ.js.map → _page.svelte.js-BZXgGiq0.js.map} +1 -1
- package/build/server/chunks/entries/pages/setup/{_page.svelte.js-XQlMxduw.js → _page.svelte.js-BeZMxOF-.js} +4 -4
- package/build/server/chunks/entries/pages/setup/{_page.svelte.js-XQlMxduw.js.map → _page.svelte.js-BeZMxOF-.js.map} +1 -1
- package/build/server/chunks/entries/pages/team/{_layout.svelte.js-DfqhQVf5.js → _layout.svelte.js-DZa0TX9t.js} +8 -8
- package/build/server/chunks/entries/pages/team/{_layout.svelte.js-DfqhQVf5.js.map → _layout.svelte.js-DZa0TX9t.js.map} +1 -1
- package/build/server/chunks/entries/pages/team/compute/{_page.svelte.js-CB96XjGo.js → _page.svelte.js-CBFrurXA.js} +4 -4
- package/build/server/chunks/entries/pages/team/compute/{_page.svelte.js-CB96XjGo.js.map → _page.svelte.js-CBFrurXA.js.map} +1 -1
- package/build/server/chunks/entries/pages/team/members/{_page.svelte.js-kTkRpUA0.js → _page.svelte.js-A68WMCw4.js} +3 -3
- package/build/server/chunks/entries/pages/team/members/{_page.svelte.js-kTkRpUA0.js.map → _page.svelte.js-A68WMCw4.js.map} +1 -1
- package/build/server/chunks/entries/pages/team/projects/{_page.svelte.js-B5RQVKsd.js → _page.svelte.js-BVqcMVMi.js} +3 -3
- package/build/server/chunks/entries/pages/team/projects/{_page.svelte.js-B5RQVKsd.js.map → _page.svelte.js-BVqcMVMi.js.map} +1 -1
- package/build/server/chunks/entries/pages/team/reclaim/{_page.svelte.js-DC2cJoWU.js → _page.svelte.js--x8s2UX5.js} +3 -3
- package/build/server/chunks/entries/pages/team/reclaim/{_page.svelte.js-DC2cJoWU.js.map → _page.svelte.js--x8s2UX5.js.map} +1 -1
- package/build/server/chunks/{handler-DOlDwJb3.js → handler-DFFztY7q.js} +3 -3
- package/build/server/chunks/{handler-DOlDwJb3.js.map → handler-DFFztY7q.js.map} +1 -1
- package/build/server/chunks/{index.js-Bfb0U_Jd.js → index.js-CiK5-Da7.js} +2 -2
- package/build/server/chunks/{index.js-Bfb0U_Jd.js.map → index.js-CiK5-Da7.js.map} +1 -1
- package/build/server/chunks/{manifest.js-B08cgiBS.js → manifest.js-nUN8Vr9X.js} +26 -26
- package/build/server/chunks/{manifest.js-B08cgiBS.js.map → manifest.js-nUN8Vr9X.js.map} +1 -1
- package/build/server/chunks/nodes/{1.js-CPvrpFcw.js → 1.js-utRBlyJq.js} +3 -3
- package/build/server/chunks/nodes/{1.js-CPvrpFcw.js.map → 1.js-utRBlyJq.js.map} +1 -1
- package/build/server/chunks/nodes/{11.js-jXwkSufg.js → 11.js-CnlYeU4X.js} +3 -3
- package/build/server/chunks/nodes/{11.js-jXwkSufg.js.map → 11.js-CnlYeU4X.js.map} +1 -1
- package/build/server/chunks/nodes/{13.js-D1AnDQ-e.js → 13.js-CTEpADXd.js} +3 -3
- package/build/server/chunks/nodes/{13.js-D1AnDQ-e.js.map → 13.js-CTEpADXd.js.map} +1 -1
- package/build/server/chunks/nodes/{14.js-CiAchQzE.js → 14.js-BcaggEyP.js} +3 -3
- package/build/server/chunks/nodes/{14.js-CiAchQzE.js.map → 14.js-BcaggEyP.js.map} +1 -1
- package/build/server/chunks/nodes/{15.js-CvNh46bO.js → 15.js-BGexRY-n.js} +5 -5
- package/build/server/chunks/nodes/{15.js-CvNh46bO.js.map → 15.js-BGexRY-n.js.map} +1 -1
- package/build/server/chunks/nodes/{16.js-DFIx646g.js → 16.js-BHaeHvyv.js} +3 -3
- package/build/server/chunks/nodes/{16.js-DFIx646g.js.map → 16.js-BHaeHvyv.js.map} +1 -1
- package/build/server/chunks/nodes/{17.js-Duq1ljOg.js → 17.js-Df8OkYc3.js} +3 -3
- package/build/server/chunks/nodes/{17.js-Duq1ljOg.js.map → 17.js-Df8OkYc3.js.map} +1 -1
- package/build/server/chunks/nodes/{19.js-Chm7XFGh.js → 19.js-CeaNwViH.js} +3 -3
- package/build/server/chunks/nodes/{19.js-Chm7XFGh.js.map → 19.js-CeaNwViH.js.map} +1 -1
- package/build/server/chunks/nodes/{2.js-CSly8u9X.js → 2.js-D05a6wui.js} +3 -3
- package/build/server/chunks/nodes/{2.js-CSly8u9X.js.map → 2.js-D05a6wui.js.map} +1 -1
- package/build/server/chunks/nodes/{20.js-B0Yr5Fx_.js → 20.js-nOgKt5U0.js} +3 -3
- package/build/server/chunks/nodes/{20.js-B0Yr5Fx_.js.map → 20.js-nOgKt5U0.js.map} +1 -1
- package/build/server/chunks/nodes/{21.js-CClz-HoB.js → 21.js-Bv9ybDFn.js} +3 -3
- package/build/server/chunks/nodes/{21.js-CClz-HoB.js.map → 21.js-Bv9ybDFn.js.map} +1 -1
- package/build/server/chunks/nodes/{22.js-Bx9e78i_.js → 22.js-BrDqfY0g.js} +3 -3
- package/build/server/chunks/nodes/{22.js-Bx9e78i_.js.map → 22.js-BrDqfY0g.js.map} +1 -1
- package/build/server/chunks/nodes/{24.js-DqfQCjmk.js → 24.js-Cqc44jmx.js} +3 -3
- package/build/server/chunks/nodes/{24.js-DqfQCjmk.js.map → 24.js-Cqc44jmx.js.map} +1 -1
- package/build/server/chunks/nodes/{25.js-DYVcZvmh.js → 25.js-BsBFeaZT.js} +3 -3
- package/build/server/chunks/nodes/{25.js-DYVcZvmh.js.map → 25.js-BsBFeaZT.js.map} +1 -1
- package/build/server/chunks/nodes/{28.js-B-JnmZd_.js → 28.js-phZLqKD9.js} +3 -3
- package/build/server/chunks/nodes/{28.js-B-JnmZd_.js.map → 28.js-phZLqKD9.js.map} +1 -1
- package/build/server/chunks/nodes/{29.js-C_r-T_LD.js → 29.js-JUf_q3Am.js} +3 -3
- package/build/server/chunks/nodes/{29.js-C_r-T_LD.js.map → 29.js-JUf_q3Am.js.map} +1 -1
- package/build/server/chunks/nodes/{3.js-Dan7TdWG.js → 3.js-Bjabqh0U.js} +3 -3
- package/build/server/chunks/nodes/{3.js-Dan7TdWG.js.map → 3.js-Bjabqh0U.js.map} +1 -1
- package/build/server/chunks/nodes/{30.js-DWm6Psu1.js → 30.js-CP124JZ4.js} +3 -3
- package/build/server/chunks/nodes/{30.js-DWm6Psu1.js.map → 30.js-CP124JZ4.js.map} +1 -1
- package/build/server/chunks/nodes/{31.js-Dt_npZtw.js → 31.js-CDO9relg.js} +3 -3
- package/build/server/chunks/nodes/{31.js-Dt_npZtw.js.map → 31.js-CDO9relg.js.map} +1 -1
- package/build/server/chunks/nodes/{5.js-MnK5yVtc.js → 5.js-CXpMpKRu.js} +3 -3
- package/build/server/chunks/nodes/{5.js-MnK5yVtc.js.map → 5.js-CXpMpKRu.js.map} +1 -1
- package/build/server/chunks/nodes/{6.js-Bcb0cjFL.js → 6.js-Cmgpied0.js} +3 -3
- package/build/server/chunks/nodes/{6.js-Bcb0cjFL.js.map → 6.js-Cmgpied0.js.map} +1 -1
- package/build/server/chunks/nodes/{7.js-Dapmqh2G.js → 7.js-DSrveoKI.js} +3 -3
- package/build/server/chunks/nodes/{7.js-Dapmqh2G.js.map → 7.js-DSrveoKI.js.map} +1 -1
- package/build/server/chunks/nodes/{8.js-7wm1M4Aa.js → 8.js-BjKhtcps.js} +3 -3
- package/build/server/chunks/nodes/{8.js-7wm1M4Aa.js.map → 8.js-BjKhtcps.js.map} +1 -1
- package/build/server/chunks/nodes/{9.js-Bul_Zu6L.js → 9.js-D_IzjKEW.js} +5 -5
- package/build/server/chunks/nodes/{9.js-Bul_Zu6L.js.map → 9.js-D_IzjKEW.js.map} +1 -1
- package/package.json +4 -4
- package/build/client/_app/immutable/chunks/C66oCHKq.js.br +0 -0
- package/build/client/_app/immutable/chunks/C66oCHKq.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D2AS0eL_.js.br +0 -2
- package/build/client/_app/immutable/chunks/D2AS0eL_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D7YIFN7-2.js.br +0 -0
- package/build/client/_app/immutable/chunks/D7YIFN7-2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DGbMmQU12.js.br +0 -0
- package/build/client/_app/immutable/chunks/DGbMmQU12.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DPBDT0yo.js +0 -2
- package/build/client/_app/immutable/chunks/DPBDT0yo.js.br +0 -0
- package/build/client/_app/immutable/chunks/DPBDT0yo.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DvVWAv53.js.br +0 -0
- package/build/client/_app/immutable/chunks/DvVWAv53.js.gz +0 -0
- package/build/client/_app/immutable/chunks/QjhEYLpX2.js +0 -1
- package/build/client/_app/immutable/chunks/QjhEYLpX2.js.br +0 -2
- package/build/client/_app/immutable/chunks/QjhEYLpX2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/pf1uJd41.js.br +0 -0
- package/build/client/_app/immutable/chunks/pf1uJd41.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.C6mEVjCa.js.br +0 -0
- package/build/client/_app/immutable/entry/app.C6mEVjCa.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.Bhb62nYY.js +0 -1
- package/build/client/_app/immutable/entry/start.Bhb62nYY.js.br +0 -0
- package/build/client/_app/immutable/entry/start.Bhb62nYY.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.DVjS-wU3.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.DVjS-wU3.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.d4mJ2ENW.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.d4mJ2ENW.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.OBFmlM4G.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.OBFmlM4G.js.gz +0 -0
- package/build/client/_app/immutable/nodes/14.B2A3QvgV.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.B2A3QvgV.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.BngV--Z8.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.BngV--Z8.js.gz +0 -0
- package/build/client/_app/immutable/nodes/16.C3kb15Hk.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.C3kb15Hk.js.gz +0 -0
- package/build/client/_app/immutable/nodes/17.qo81_orT.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.qo81_orT.js.gz +0 -0
- package/build/client/_app/immutable/nodes/19.BB0bguXe.js.br +0 -0
- package/build/client/_app/immutable/nodes/19.BB0bguXe.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.BVWPdbfY.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.BVWPdbfY.js.gz +0 -0
- package/build/client/_app/immutable/nodes/20.CEsCDcUg.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.CEsCDcUg.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.DnQOpIlb.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.DnQOpIlb.js.gz +0 -0
- package/build/client/_app/immutable/nodes/22.DLNR3X0_.js.br +0 -0
- package/build/client/_app/immutable/nodes/22.DLNR3X0_.js.gz +0 -0
- package/build/client/_app/immutable/nodes/24.Myu3dpCG.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.Myu3dpCG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/25.fGk6Bd3H.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.fGk6Bd3H.js.gz +0 -0
- package/build/client/_app/immutable/nodes/28.BrHVL459.js.br +0 -0
- package/build/client/_app/immutable/nodes/28.BrHVL459.js.gz +0 -0
- package/build/client/_app/immutable/nodes/29.Cc2cJNYj.js.br +0 -0
- package/build/client/_app/immutable/nodes/29.Cc2cJNYj.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.Bk2gicwt.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.Bk2gicwt.js.gz +0 -0
- package/build/client/_app/immutable/nodes/30.DE39sPAX.js.br +0 -0
- package/build/client/_app/immutable/nodes/30.DE39sPAX.js.gz +0 -0
- package/build/client/_app/immutable/nodes/31.FEcGG6mC.js.br +0 -0
- package/build/client/_app/immutable/nodes/31.FEcGG6mC.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.CrnPEsum.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.CrnPEsum.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.25_MlJn0.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.25_MlJn0.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.B3uf6wZL.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.B3uf6wZL.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.DLtJHXvQ.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.DLtJHXvQ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.Wk5Cvrnn.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.Wk5Cvrnn.js.gz +0 -0
- package/build/server/chunks/chunks/forms.js-aie0AliG.js +0 -2
- package/build/server/chunks/chunks/forms.js-aie0AliG.js.map +0 -1
- package/build/server/chunks/chunks/navigation.js-aie0AliG.js +0 -2
- package/build/server/chunks/chunks/navigation.js-aie0AliG.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,A as t,At as n,B as r,C as i,Dt as a,E as o,F as s,Ft as c,G as l,H as u,It as d,J as f,K as p,L as m,Lt as h,M as g,N as _,P as v,Pt as y,Q as b,Rt as x,S,T as C,U as w,V as T,W as E,X as D,Y as O,_t as k,a as A,at as j,bt as ee,c as M,dt as N,f as P,ft as te,g as ne,gt as F,h as re,it as I,j as ie,jt as ae,k as L,kt as R,lt as z,m as oe,mt as B,n as se,nt as ce,o as V,ot as le,q as ue,r as de,s as H,ut as U,v as fe,vt as pe,w as W,yt as G,z as K,zt as me}from"../chunks/Cke4knuE.js";import"../chunks/xihTtKlq.js";import{c as q,s as he,t as J}from"../chunks/DTG79Uyf.js";import{i as ge,r as _e}from"../chunks/B2lr8IYb.js";import{C as ve,E as ye,d as be,n as xe,o as Se,p as Ce,r as we,s as Te,t as Ee,u as De,y as Y}from"../chunks/BWkyPB3e.js";import{n as Oe,t as ke}from"../chunks/DSGwkBAQ.js";import{a as Ae,c as je,d as Me,f as Ne,h as Pe,i as Fe,l as Ie,m as Le,n as Re,o as ze,p as Be,r as Ve,s as He,t as Ue,u as We}from"../chunks/pf1uJd41.js";import{t as Ge}from"../chunks/5o828efA.js";import{t as Ke}from"../chunks/DryGTRV9.js";import{t as qe}from"../chunks/VJTh542u.js";import{t as Je}from"../chunks/DX2MELJa.js";import{t as Ye}from"../chunks/CNcd_3er.js";import{t as Xe}from"../chunks/f9BZlcKm.js";import{t as Ze}from"../chunks/_YFjRYrV.js";import{n as Qe,r as $e,t as et}from"../chunks/0lP-Rpma.js";import{i as tt,n as nt,r as rt,t as it}from"../chunks/BzEuycjW.js";import{t as at}from"../chunks/CAB-AK4E.js";import{t as ot}from"../chunks/gu4X15yF.js";import{t as st}from"../chunks/CjPXNCS7.js";import{t as ct}from"../chunks/BOS-wpIV.js";import{t as lt}from"../chunks/Dz00jH5u.js";import{D as ut,E as dt,O as ft,a as pt,d as mt,f as ht,o as gt,p as _t,t as vt,u as yt,v as bt,w as xt}from"../chunks/B50OBSAG.js";import{a as St,c as Ct,d as wt,i as Tt,l as Et,n as Dt,o as Ot,r as kt,s as At,t as jt,u as Mt}from"../chunks/CzAXFvH8.js";import{D as Nt,M as Pt,O as Ft,T as It,c as Lt,d as Rt,f as zt,h as Bt,k as Vt,l as Ht,m as Ut,n as Wt,p as Gt,s as Kt,u as qt,w as Jt,x as Yt}from"../chunks/B1oMYNg6.js";import{a as Xt,i as Zt,n as Qt,r as $t,t as en}from"../chunks/CWlCxbnY.js";import{t as tn}from"../chunks/C2ulfLBp.js";import{a as nn,i as rn,n as an,r as on,t as sn}from"../chunks/E0FrUJ1t.js";import{t as cn}from"../chunks/D2AS0eL_.js";import{n as ln,t as un}from"../chunks/DJq7n-sf.js";import{t as dn}from"../chunks/KXvDoa1V.js";import{n as fn,t as pn}from"../chunks/sPP9TUD-.js";import{t as mn}from"../chunks/D3p1tqid.js";import{t as hn}from"../chunks/DqR8kuM62.js";import{n as gn}from"../chunks/C57linrd2.js";var _n=new Set([`$$slots`,`$$events`,`$$legacy`]);function vn(e,t){let n=V(t,_n),r=[[`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`}]];Oe(e,H({name:`box`},()=>n,{get iconNode(){return r}}))}var yn=new Set([`$$slots`,`$$events`,`$$legacy`]);function bn(e,t){let n=V(t,yn),r=[[`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`}]];Oe(e,H({name:`camera`},()=>n,{get iconNode(){return r}}))}var xn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Sn(e,t){let n=V(t,xn),r=[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`}],[`path`,{d:`m9 11 3 3L22 4`}]];Oe(e,H({name:`circle-check-big`},()=>n,{get iconNode(){return r}}))}var Cn=new Set([`$$slots`,`$$events`,`$$legacy`]);function wn(e,t){let n=V(t,Cn),r=[[`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`}]];Oe(e,H({name:`circle-question-mark`},()=>n,{get iconNode(){return r}}))}var Tn=new Set([`$$slots`,`$$events`,`$$legacy`]);function En(e,t){let n=V(t,Tn),r=[[`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`}]];Oe(e,H({name:`download`},()=>n,{get iconNode(){return r}}))}var Dn=new Set([`$$slots`,`$$events`,`$$legacy`]);function On(e,t){let n=V(t,Dn),r=[[`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`}]];Oe(e,H({name:`eye-off`},()=>n,{get iconNode(){return r}}))}var kn=new Set([`$$slots`,`$$events`,`$$legacy`]);function An(e,t){let n=V(t,kn),r=[[`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`}]];Oe(e,H({name:`eye`},()=>n,{get iconNode(){return r}}))}var jn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Mn(e,t){let n=V(t,jn),r=[[`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`}]];Oe(e,H({name:`file`},()=>n,{get iconNode(){return r}}))}var Nn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Pn(e,t){let n=V(t,Nn),r=[[`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`}]];Oe(e,H({name:`folder`},()=>n,{get iconNode(){return r}}))}var Fn=new Set([`$$slots`,`$$events`,`$$legacy`]);function In(e,t){let n=V(t,Fn),r=[[`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`}]];Oe(e,H({name:`frame`},()=>n,{get iconNode(){return r}}))}var Ln=new Set([`$$slots`,`$$events`,`$$legacy`]);function Rn(e,t){let n=V(t,Ln),r=[[`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`}]];Oe(e,H({name:`grid-3x3`},()=>n,{get iconNode(){return r}}))}var zn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Bn(e,t){let n=V(t,zn),r=[[`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`}]];Oe(e,H({name:`inbox`},()=>n,{get iconNode(){return r}}))}var Vn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Hn(e,t){let n=V(t,Vn),r=[[`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`}]];Oe(e,H({name:`layers`},()=>n,{get iconNode(){return r}}))}var Un=new Set([`$$slots`,`$$events`,`$$legacy`]);function Wn(e,t){let n=V(t,Un),r=[[`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`}]];Oe(e,H({name:`link`},()=>n,{get iconNode(){return r}}))}var Gn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Kn(e,t){let n=V(t,Gn),r=[[`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`}]];Oe(e,H({name:`loader`},()=>n,{get iconNode(){return r}}))}var qn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Jn(e,t){let n=V(t,qn),r=[[`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`}]];Oe(e,H({name:`maximize`},()=>n,{get iconNode(){return r}}))}var Yn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Xn(e,t){let n=V(t,Yn),r=[[`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`}]];Oe(e,H({name:`minimize`},()=>n,{get iconNode(){return r}}))}var Zn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Qn(e,t){let n=V(t,Zn),r=[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]];Oe(e,H({name:`palette`},()=>n,{get iconNode(){return r}}))}var $n=new Set([`$$slots`,`$$events`,`$$legacy`]);function er(e,t){let n=V(t,$n),r=[[`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`}]];Oe(e,H({name:`ruler`},()=>n,{get iconNode(){return r}}))}var tr=new Set([`$$slots`,`$$events`,`$$legacy`]);function nr(e,t){let n=V(t,tr),r=[[`path`,{d:`M14 17H5`}],[`path`,{d:`M19 7h-9`}],[`circle`,{cx:`17`,cy:`17`,r:`3`}],[`circle`,{cx:`7`,cy:`7`,r:`3`}]];Oe(e,H({name:`settings-2`},()=>n,{get iconNode(){return r}}))}var rr=new Set([`$$slots`,`$$events`,`$$legacy`]);function ir(e,t){let n=V(t,rr),r=[[`circle`,{cx:`19`,cy:`5`,r:`2`}],[`circle`,{cx:`5`,cy:`19`,r:`2`}],[`path`,{d:`M5 17A12 12 0 0 1 17 5`}]];Oe(e,H({name:`spline`},()=>n,{get iconNode(){return r}}))}var ar=new Set([`$$slots`,`$$events`,`$$legacy`]);function or(e,t){let n=V(t,ar),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}]];Oe(e,H({name:`square`},()=>n,{get iconNode(){return r}}))}var sr=new Set([`$$slots`,`$$events`,`$$legacy`]);function cr(e,t){let n=V(t,sr),r=[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`}]];Oe(e,H({name:`zap`},()=>n,{get iconNode(){return r}}))}var lr=Se({component:`checkbox`,parts:[`root`,`group`,`group-label`,`input`]}),ur=new ft(`Checkbox.Group`),dr=new ft(`Checkbox.Root`),fr=class e{static create(t,n=null){return dr.set(new e(t,n))}opts;group;#e=G(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.opts.name.current);get trueName(){return D(this.#e)}set trueName(e){B(this.#e,e)}#t=G(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return D(this.#t)}set trueRequired(e){B(this.#t,e)}#n=G(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return D(this.#n)}set trueDisabled(e){B(this.#n,e)}#r=G(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return D(this.#r)}set trueReadonly(e){B(this.#r,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=De(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),dt.pre([()=>y(this.group?.opts.value.current),()=>this.opts.value.current],([e,t])=>{!e||!t||(this.opts.checked.current=e.includes(t))}),dt.pre(()=>this.opts.checked.current,e=>{this.group&&(e?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===`Enter`){e.preventDefault(),this.opts.type.current===`submit`&&e.currentTarget.closest(`form`)?.requestSubmit();return}e.key===` `&&(e.preventDefault(),this.#i())}}#i(){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.#i();return}e.preventDefault(),this.#i()}}#a=G(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return D(this.#a)}set snippetProps(e){B(this.#a,e)}#o=G(()=>({id:this.opts.id.current,role:`checkbox`,type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":Te(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":we(this.trueRequired),"aria-readonly":we(this.trueReadonly),"data-disabled":xe(this.trueDisabled),"data-readonly":xe(this.trueReadonly),"data-state":mr(this.opts.checked.current,this.opts.indeterminate.current),[lr.root]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return D(this.#o)}set props(e){B(this.#o,e)}},pr=class e{static create(){return new e(dr.get())}root;#e=G(()=>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 D(this.#e)}set trueChecked(e){B(this.#e,e)}#t=G(()=>!!this.root.trueName);get shouldRender(){return D(this.#t)}set shouldRender(e){B(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){gt(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=G(()=>({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 D(this.#n)}set props(e){B(this.#n,e)}};function mr(e,t){return t?`indeterminate`:e?`checked`:`unchecked`}function hr(e,t){n(t,!0);let i=pr.create();var a=r(),o=U(a),c=e=>{Mt(e,H(()=>i.props))};s(o,e=>{i.shouldRender&&e(c)}),K(e,a),R()}var gr=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`ref`,`onCheckedChange`,`children`,`disabled`,`required`,`name`,`value`,`id`,`indeterminate`,`onIndeterminateChange`,`child`,`type`,`readonly`]),_r=T(`<button><!></button>`),vr=T(`<!> <!>`,1);function yr(e,i){let a=w();n(i,!0);let o=A(i,`checked`,15,!1),c=A(i,`ref`,15,null),l=A(i,`disabled`,3,!1),u=A(i,`required`,3,!1),f=A(i,`name`,3,void 0),p=A(i,`value`,3,`on`),m=A(i,`id`,19,()=>Ee(a)),h=A(i,`indeterminate`,15,!1),g=A(i,`type`,3,`button`),_=V(i,gr),v=ur.getOr(null);v&&p()&&(v.opts.value.current.includes(p())?o(!0):o(!1)),dt.pre(()=>p(),()=>{v&&p()&&(v.opts.value.current.includes(p())?o(!0):o(!1))});let y=fr.create({checked:Y(()=>o(),e=>{o(e),i.onCheckedChange?.(e)}),disabled:Y(()=>l()??!1),required:Y(()=>u()),name:Y(()=>f()),value:Y(()=>p()),id:Y(()=>m()),ref:Y(()=>c(),e=>c(e)),indeterminate:Y(()=>h(),e=>{h(e),i.onIndeterminateChange?.(e)}),type:Y(()=>g()),readonly:Y(()=>!!i.readonly)},v),b=G(()=>be({..._},y.props));var S=vr(),C=U(S),T=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(b),...y.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},E=e=>{var n=_r();oe(n,()=>({...D(b)}));var r=z(n);t(r,()=>i.children??x,()=>y.snippetProps),d(n),K(e,n)};s(C,e=>{i.child?e(T):e(E,-1)}),hr(N(C,2),{}),K(e,S),R()}function br(e,i){n(i,!0);let a=A(i,`open`,15,!1),o=A(i,`onOpenChange`,3,vt),s=A(i,`onOpenChangeComplete`,3,vt);Bt.create({open:Y(()=>a(),e=>{a(e),o()?.(e)}),onOpenChangeComplete:Y(()=>s())}),Ct(e,{children:(e,n)=>{var a=r(),o=U(a);t(o,()=>i.children??x),K(e,a)},$$slots:{default:!0}}),R()}var xr=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`disabled`,`onSelect`,`closeOnSelect`]),Sr=T(`<div><!></div>`);function Cr(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=A(i,`disabled`,3,!1),u=A(i,`onSelect`,3,vt),f=A(i,`closeOnSelect`,3,!0),p=V(i,xr),m=Ht.create({id:Y(()=>c()),disabled:Y(()=>l()),onSelect:Y(()=>u()),ref:Y(()=>o(),e=>o(e)),closeOnSelect:Y(()=>f())}),h=G(()=>be(p,m.props));var g=r(),_=U(g),v=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(h)})),K(e,n)},y=e=>{var n=Sr();oe(n,()=>({...D(h)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(_,e=>{i.child?e(v):e(y,-1)}),K(e,g),R()}var wr=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`]),Tr=T(`<div><!></div>`);function Er(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=V(i,wr),u=Gt.create({id:Y(()=>c()),ref:Y(()=>o(),e=>o(e))}),f=G(()=>be(l,u.props));var p=r(),m=U(p),h=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(f)})),K(e,n)},g=e=>{var n=Tr();oe(n,()=>({...D(f)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(m,e=>{i.child?e(h):e(g,-1)}),K(e,p),R()}var Dr=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`,`loop`,`onInteractOutside`,`forceMount`,`onEscapeKeydown`,`interactOutsideBehavior`,`escapeKeydownBehavior`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onFocusOutside`,`side`,`trapFocus`,`style`]),Or=T(`<div><div><!></div></div>`);function kr(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`loop`,3,!0),u=A(i,`onInteractOutside`,3,vt),f=A(i,`forceMount`,3,!1),p=A(i,`onEscapeKeydown`,3,vt),m=A(i,`interactOutsideBehavior`,3,`defer-otherwise-close`),h=A(i,`escapeKeydownBehavior`,3,`defer-otherwise-close`),g=A(i,`onOpenAutoFocus`,3,vt),_=A(i,`onCloseAutoFocus`,3,vt),v=A(i,`onFocusOutside`,3,vt),y=A(i,`side`,3,`right`),b=A(i,`trapFocus`,3,!1),S=V(i,Dr),C=Lt.create({id:Y(()=>o()),loop:Y(()=>l()),ref:Y(()=>c(),e=>c(e)),isSub:!0,onCloseAutoFocus:Y(()=>j)});function T(e){let t=e.currentTarget.contains(e.target),n=Jt[C.parentMenu.root.opts.dir.current].includes(e.key);t&&n&&(C.parentMenu.onClose(),C.parentMenu.triggerNode?.focus(),e.preventDefault())}let E=G(()=>C.parentMenu.root.getBitsAttr(`sub-content`)),O=G(()=>be(S,C.props,{side:y(),onkeydown:T,[D(E)]:``}));function k(e){g()(e),!e.defaultPrevented&&(e.preventDefault(),C.parentMenu.root.isUsingKeyboard&&C.parentMenu.contentNode&&Rt.dispatch(C.parentMenu.contentNode))}function j(e){_()(e),!e.defaultPrevented&&e.preventDefault()}function ee(e){u()(e),!e.defaultPrevented&&C.parentMenu.onClose()}function M(e){p()(e),!e.defaultPrevented&&C.parentMenu.onClose()}function N(e){if(v()(e),e.defaultPrevented||!gt(e.target)||e.target.id===C.parentMenu.triggerNode?.id)return;if((C.parentMenu.parentMenu?.contentNode)?.contains(e.target)){C.parentMenu.onClose(),e.preventDefault();return}let t=`[${C.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t)){e.preventDefault();return}C.parentMenu.onClose()}var P=r(),te=U(P),ne=e=>{St(e,H(()=>D(O),{get ref(){return C.opts.ref},get interactOutsideBehavior(){return m()},get escapeKeydownBehavior(){return h()},onOpenAutoFocus:k,get enabled(){return C.parentMenu.opts.open.current},onInteractOutside:ee,onEscapeKeydown:M,onFocusOutside:N,preventScroll:!1,get loop(){return l()},get trapFocus(){return b()},get shouldRender(){return C.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),D(O),{style:Et(`menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),...C.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Or();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))},F=e=>{Ot(e,H(()=>D(O),{get ref(){return C.opts.ref},get interactOutsideBehavior(){return m()},get escapeKeydownBehavior(){return h()},onCloseAutoFocus:j,onOpenAutoFocus:k,get open(){return C.parentMenu.opts.open.current},onInteractOutside:ee,onEscapeKeydown:M,onFocusOutside:N,preventScroll:!1,get loop(){return l()},get trapFocus(){return b()},get shouldRender(){return C.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),D(O),{style:Et(`menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),...C.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Or();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))};s(te,e=>{f()?e(ne):f()||e(F,1)}),K(e,P),R()}var Ar=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`disabled`,`ref`,`children`,`child`,`onSelect`,`openDelay`]),jr=T(`<div><!></div>`);function Mr(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`disabled`,3,!1),l=A(i,`ref`,15,null),u=A(i,`onSelect`,3,vt),f=A(i,`openDelay`,3,0),p=V(i,Ar),m=Ut.create({disabled:Y(()=>c()),onSelect:Y(()=>u()),id:Y(()=>o()),ref:Y(()=>l(),e=>l(e)),openDelay:Y(()=>f())}),h=G(()=>be(p,m.props));At(e,{get id(){return o()},get ref(){return m.opts.ref},children:(e,n)=>{var a=r(),o=U(a),c=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(h)})),K(e,n)},l=e=>{var n=jr();oe(n,()=>({...D(h)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(o,e=>{i.child?e(c):e(l,-1)}),K(e,a)},$$slots:{default:!0}}),R()}function Nr(e,i){n(i,!0);let a=A(i,`open`,15,!1),o=A(i,`dir`,3,`ltr`),s=A(i,`onOpenChange`,3,vt),c=A(i,`onOpenChangeComplete`,3,vt),l=A(i,`_internal_variant`,3,`dropdown-menu`),u=A(i,`_internal_should_skip_exit_animation`,3,void 0),d=zt.create({variant:Y(()=>l()),dir:Y(()=>o()),onClose:()=>{a(!1),s()(!1)},shouldSkipExitAnimation:()=>u()?.()??!1});qt.create({open:Y(()=>a(),e=>{a(e),s()(e)}),onOpenChangeComplete:Y(()=>c())},d),Ct(e,{children:(e,n)=>{var a=r(),o=U(a);t(o,()=>i.children??x),K(e,a)},$$slots:{default:!0}}),R()}var Pr=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`child`,`children`,`ref`,`loop`,`onInteractOutside`,`onEscapeKeydown`,`onCloseAutoFocus`,`forceMount`,`trapFocus`,`style`]),Fr=T(`<div><div><!></div></div>`);function Ir(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`loop`,3,!0),u=A(i,`onInteractOutside`,3,vt),f=A(i,`onEscapeKeydown`,3,vt),p=A(i,`onCloseAutoFocus`,3,vt),m=A(i,`forceMount`,3,!1),h=A(i,`trapFocus`,3,!1),g=V(i,Pr),_=Lt.create({id:Y(()=>o()),loop:Y(()=>l()),ref:Y(()=>c(),e=>c(e)),onCloseAutoFocus:Y(()=>p())}),v=G(()=>be(g,_.props));function y(e){if(_.handleInteractOutside(e),!e.defaultPrevented&&(u()(e),!e.defaultPrevented)){if(e.target&&e.target instanceof Element){let t=`[${_.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t))return}_.parentMenu.onClose()}}function b(e){f()(e),!e.defaultPrevented&&_.parentMenu.onClose()}var S=r(),C=U(S),T=e=>{St(e,H(()=>D(v),()=>_.popperProps,{get ref(){return _.opts.ref},get enabled(){return _.parentMenu.opts.open.current},onInteractOutside:y,onEscapeKeydown:b,get trapFocus(){return h()},get loop(){return l()},forceMount:!0,get id(){return o()},get shouldRender(){return _.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),{style:Et(`dropdown-menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),..._.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Fr();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))},E=e=>{Ot(e,H(()=>D(v),()=>_.popperProps,{get ref(){return _.opts.ref},get open(){return _.parentMenu.opts.open.current},onInteractOutside:y,onEscapeKeydown:b,get trapFocus(){return h()},get loop(){return l()},forceMount:!1,get id(){return o()},get shouldRender(){return _.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),{style:Et(`dropdown-menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),..._.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Fr();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))};s(C,e=>{m()?e(T):m()||e(E,1)}),K(e,S),R()}var Lr=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`disabled`,`type`]),Rr=T(`<button><!></button>`);function zr(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`disabled`,3,!1),u=A(i,`type`,3,`button`),f=V(i,Lr),p=Kt.create({id:Y(()=>o()),disabled:Y(()=>l()??!1),ref:Y(()=>c(),e=>c(e))}),m=G(()=>be(f,p.props,{type:u()}));At(e,{get id(){return o()},get ref(){return p.opts.ref},children:(e,n)=>{var a=r(),o=U(a),c=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(m)})),K(e,n)},l=e=>{var n=Rr();oe(n,()=>({...D(m)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(o,e=>{i.child?e(c):e(l,-1)}),K(e,a)},$$slots:{default:!0}}),R()}var Br=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),j(this.handler)}handler(){let e=0,t=this.#e();if(!t)return;let n=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return n.observe(t),()=>{window.cancelAnimationFrame(e),n.unobserve(t)}}},Vr=class{opts;present;#e;#t=F(!1);#n=!1;#r=F(void 0);#i=null;constructor(e){this.opts=e,this.present=this.opts.open,B(this.#t,e.open.current,!0),this.#e=new Nt({ref:this.opts.ref,afterTick:this.opts.open}),Pt(()=>this.#o()),dt(()=>this.present.current,e=>{if(!this.#n){this.#n=!0;return}this.#o(),e&&B(this.#t,!0),B(this.#r,e?`starting`:`ending`,!0),e&&(this.#i=window.requestAnimationFrame(()=>{this.#i=null,this.present.current&&B(this.#r,void 0)})),this.#e.run(()=>{e===this.present.current&&(e||B(this.#t,!1),B(this.#r,void 0))})})}#a=G(()=>D(this.#t));get isPresent(){return D(this.#a)}set isPresent(e){B(this.#a,e)}get transitionStatus(){return D(this.#r)}#o(){this.#i!==null&&(window.cancelAnimationFrame(this.#i),this.#i=null)}};function Hr(e,i){n(i,!0);let a=new Vr({open:Y(()=>i.open),ref:i.ref});var o=r(),c=U(o),l=e=>{var n=r(),o=U(n);t(o,()=>i.presence??x,()=>({present:a.isPresent,transitionStatus:a.transitionStatus})),K(e,n)};s(c,e=>{(i.forceMount||i.open||a.isPresent)&&e(l)}),K(e,o),R()}function Ur(e,t,n){return Math.min(n,Math.max(t,e))}var Wr=class{state;#e;constructor(e,t){this.state=ve(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)}},Gr=Se({component:`scroll-area`,parts:[`root`,`viewport`,`corner`,`thumb`,`scrollbar`]}),Kr=new ft(`ScrollArea.Root`),qr=new ft(`ScrollArea.Scrollbar`),Jr=new ft(`ScrollArea.ScrollbarVisible`),Yr=new ft(`ScrollArea.ScrollbarAxis`),Xr=new ft(`ScrollArea.ScrollbarShared`),Zr=class e{static create(t){return Kr.set(new e(t))}opts;attachment;#e=F(null);get scrollAreaNode(){return D(this.#e)}set scrollAreaNode(e){B(this.#e,e,!0)}#t=F(null);get viewportNode(){return D(this.#t)}set viewportNode(e){B(this.#t,e,!0)}#n=F(null);get contentNode(){return D(this.#n)}set contentNode(e){B(this.#n,e,!0)}#r=F(null);get scrollbarXNode(){return D(this.#r)}set scrollbarXNode(e){B(this.#r,e,!0)}#i=F(null);get scrollbarYNode(){return D(this.#i)}set scrollbarYNode(e){B(this.#i,e,!0)}#a=F(0);get cornerWidth(){return D(this.#a)}set cornerWidth(e){B(this.#a,e,!0)}#o=F(0);get cornerHeight(){return D(this.#o)}set cornerHeight(e){B(this.#o,e,!0)}#s=F(!1);get scrollbarXEnabled(){return D(this.#s)}set scrollbarXEnabled(e){B(this.#s,e,!0)}#c=F(!1);get scrollbarYEnabled(){return D(this.#c)}set scrollbarYEnabled(e){B(this.#c,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=De(e.ref,e=>this.scrollAreaNode=e),this.domContext=new Ft(e.ref)}#l=G(()=>({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`},[Gr.root]:``,...this.attachment}));get props(){return D(this.#l)}set props(e){B(this.#l,e)}},Qr=class e{static create(t){return new e(t,Kr.get())}opts;root;attachment;#e=ve(Wt());#t=ve(null);contentAttachment=De(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=De(e.ref,e=>this.root.viewportNode=e)}#n=G(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?`scroll`:`hidden`,overflowY:this.root.scrollbarYEnabled?`scroll`:`hidden`},[Gr.viewport]:``,...this.attachment}));get props(){return D(this.#n)}set props(e){B(this.#n,e)}#r=G(()=>({id:this.#e.current,"data-scroll-area-content":``,style:{minWidth:this.root.scrollbarXEnabled?`fit-content`:void 0},...this.contentAttachment}));get contentProps(){return D(this.#r)}set contentProps(e){B(this.#r,e)}},$r=class e{static create(t){return qr.set(new e(t,Kr.get()))}opts;root;#e=G(()=>this.opts.orientation.current===`horizontal`);get isHorizontal(){return D(this.#e)}set isHorizontal(e){B(this.#e,e)}#t=F(!1);get hasThumb(){return D(this.#t)}set hasThumb(e){B(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,dt(()=>this.isHorizontal,e=>e?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}},ei=class t{static create(){return new t(qr.get())}scrollbar;root;#e=F(!1);get isVisible(){return D(this.#e)}set isVisible(e){B(this.#e,e,!0)}constructor(t){this.scrollbar=t,this.root=t.root,j(()=>{let t=this.root.scrollAreaNode,n=this.root.opts.scrollHideDelay.current,r=0;if(!t)return;let i=Ce(f(t,`pointerenter`,()=>{this.root.domContext.clearTimeout(r),e(()=>this.isVisible=!0)}),f(t,`pointerleave`,()=>{r&&this.root.domContext.clearTimeout(r),r=this.root.domContext.setTimeout(()=>{e(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},n)}));return()=>{this.root.domContext.getWindow().clearTimeout(r),i()}})}#t=G(()=>({"data-state":this.isVisible?`visible`:`hidden`}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},ti=class e{static create(){return new e(qr.get())}scrollbar;root;machine=new Wr(`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=G(()=>this.machine.state.current===`hidden`);get isHidden(){return D(this.#e)}set isHidden(e){B(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;let t=ut(()=>this.machine.dispatch(`SCROLL_END`),100);j(()=>{let e=this.machine.state.current,t=this.root.opts.scrollHideDelay.current;if(e===`idle`){let e=this.root.domContext.setTimeout(()=>this.machine.dispatch(`HIDE`),t);return()=>this.root.domContext.clearTimeout(e)}}),j(()=>{let e=this.root.viewportNode;if(!e)return;let n=this.scrollbar.isHorizontal?`scrollLeft`:`scrollTop`,r=e[n];return f(e,`scroll`,()=>{let i=e[n];r!==i&&(this.machine.dispatch(`SCROLL`),t()),r=i})}),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=G(()=>({"data-state":this.machine.state.current===`hidden`?`hidden`:`visible`,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},ni=class e{static create(){return new e(qr.get())}scrollbar;root;#e=F(!1);get isVisible(){return D(this.#e)}set isVisible(e){B(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;let t=ut(()=>{let e=this.root.viewportNode;if(!e)return;let t=e.offsetWidth<e.scrollWidth,n=e.offsetHeight<e.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?t:n},10);new Br(()=>this.root.viewportNode,t),new Br(()=>this.root.contentNode,t)}#t=G(()=>({"data-state":this.isVisible?`visible`:`hidden`}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},ri=class e{static create(){return Jr.set(new e(qr.get()))}scrollbar;root;#e=F(null);get thumbNode(){return D(this.#e)}set thumbNode(e){B(this.#e,e,!0)}#t=F(0);get pointerOffset(){return D(this.#t)}set pointerOffset(e){B(this.#t,e,!0)}#n=F({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return D(this.#n)}set sizes(e){B(this.#n,e)}#r=G(()=>ui(this.sizes.viewport,this.sizes.content));get thumbRatio(){return D(this.#r)}set thumbRatio(e){B(this.#r,e)}#i=G(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return D(this.#i)}set hasThumb(e){B(this.#i,e)}#a=F(``);get prevTransformStyle(){return D(this.#a)}set prevTransformStyle(e){B(this.#a,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,j(()=>{this.scrollbar.hasThumb=this.hasThumb}),j(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return fi({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;let e=this.root.viewportNode.scrollLeft,t=`translate3d(${pi({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=t,this.prevTransformStyle=t}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;let e=this.root.viewportNode.scrollTop,t=`translate3d(0, ${pi({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=t,this.prevTransformStyle=t}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))}},ii=class e{static create(t){return Yr.set(new e(t,Jr.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=F();get computedStyle(){return D(this.#e)}set computedStyle(e){B(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=De(this.scrollbar.opts.ref,e=>this.root.scrollbarXNode=e),j(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),j(()=>{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;let n=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(n),hi(n,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:li(this.computedStyle.paddingLeft),paddingEnd:li(this.computedStyle.paddingRight)}})};#t=G(()=>di(this.scrollbarVis.sizes));get thumbSize(){return D(this.#t)}set thumbSize(e){B(this.#t,e)}#n=G(()=>({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 D(this.#n)}set props(e){B(this.#n,e)}},ai=class e{static create(t){return Yr.set(new e(t,Jr.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=F();get computedStyle(){return D(this.#e)}set computedStyle(e){B(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=De(this.scrollbar.opts.ref,e=>this.root.scrollbarYNode=e),j(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),j(()=>{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;let n=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(n),hi(n,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:li(this.computedStyle.paddingTop),paddingEnd:li(this.computedStyle.paddingBottom)}})}#t=G(()=>di(this.scrollbarVis.sizes));get thumbSize(){return D(this.#t)}set thumbSize(e){B(this.#t,e)}#n=G(()=>({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 D(this.#n)}set props(e){B(this.#n,e)}},oi=class t{static create(){return Xr.set(new t(Yr.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=F(null);get rect(){return D(this.#e)}set rect(e){B(this.#e,e)}#t=F(``);get prevWebkitUserSelect(){return D(this.#t)}set prevWebkitUserSelect(e){B(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#n=G(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return D(this.#n)}set maxScrollPos(e){B(this.#n,e)}constructor(t){this.scrollbarState=t,this.root=t.root,this.scrollbarVis=t.scrollbarVis,this.scrollbar=t.scrollbarVis.scrollbar,this.handleResize=ut(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,j(()=>{let e=this.maxScrollPos,t=this.scrollbar.opts.ref.current;return this.root.viewportNode,f(this.root.domContext.getDocument(),`wheel`,n=>{let r=n.target;t?.contains(r)&&this.handleWheelScroll(n,e)},{passive:!1})}),le(()=>{this.scrollbarVis.sizes,e(()=>this.handleThumbPositionChange())}),new Br(()=>this.scrollbar.opts.ref.current,this.handleResize),new Br(()=>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;let t=e.clientX-this.rect.left,n=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:n})}#r(){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){e.button===0&&(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){let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.#r()}onlostpointercapture(e){this.#r()}#i=G(()=>be({...this.scrollbarState.props,style:{position:`absolute`,...this.scrollbarState.props.style},[Gr.scrollbar]:``,onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return D(this.#i)}set props(e){B(this.#i,e)}},si=class t{static create(e){return new t(e,Xr.get())}opts;scrollbarState;attachment;#e;#t=F();#n=ut(()=>{D(this.#t)&&(D(this.#t)(),B(this.#t,void 0))},100);constructor(t,n){this.opts=t,this.scrollbarState=n,this.#e=n.root,this.attachment=De(this.opts.ref,e=>this.scrollbarState.scrollbarVis.thumbNode=e),j(()=>{let t=this.#e.viewportNode;return t?(e(()=>this.scrollbarState.handleThumbPositionChange()),f(t,`scroll`,()=>{if(this.#n(),!D(this.#t)){let e=gi(t,this.scrollbarState.handleThumbPositionChange);B(this.#t,e,!0),this.scrollbarState.handleThumbPositionChange()}})):void 0}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){let t=e.target;if(!t)return;let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top;this.scrollbarState.handleThumbPointerDown({x:r,y:i})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#r=G(()=>({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,[Gr.thumb]:``,...this.attachment}));get props(){return D(this.#r)}set props(e){B(this.#r,e)}},ci=class e{static create(t){return new e(t,Kr.get())}opts;root;attachment;#e=F(0);#t=F(0);#n=G(()=>!!(D(this.#e)&&D(this.#t)));get hasSize(){return D(this.#n)}set hasSize(e){B(this.#n,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=De(this.opts.ref),new Br(()=>this.root.scrollbarXNode,()=>{let e=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=e,B(this.#t,e,!0)}),new Br(()=>this.root.scrollbarYNode,()=>{let e=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=e,B(this.#e,e,!0)})}#r=G(()=>({id:this.opts.id.current,style:{width:D(this.#e),height:D(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},[Gr.corner]:``,...this.attachment}));get props(){return D(this.#r)}set props(e){B(this.#r,e)}};function li(e){return e?Number.parseInt(e,10):0}function ui(e,t){let n=e/t;return Number.isNaN(n)?0:n}function di(e){let t=ui(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function fi({pointerPos:e,pointerOffset:t,sizes:n,dir:r=`ltr`}){let i=di(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return mi([c,l],d)(e)}function pi({scrollPos:e,sizes:t,dir:n=`ltr`}){let r=di(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=n===`ltr`?[0,o]:[o*-1,0],l=Ur(e,c[0],c[1]);return mi([0,o],[0,s])(l)}function mi(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function hi(e,t){return e>0&&e<t}function gi(e,t){let n={left:e.scrollLeft,top:e.scrollTop},r=0,i=Vt(e);return(function a(){let o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,c=n.top!==o.top;(s||c)&&t(),n=o,r=i.requestAnimationFrame(a)})(),()=>i.cancelAnimationFrame(r)}var _i=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`type`,`dir`,`scrollHideDelay`,`children`,`child`]),vi=T(`<div><!></div>`);function yi(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=A(i,`type`,3,`hover`),u=A(i,`dir`,3,`ltr`),f=A(i,`scrollHideDelay`,3,600),p=V(i,_i),m=Zr.create({type:Y(()=>l()),dir:Y(()=>u()),scrollHideDelay:Y(()=>f()),id:Y(()=>c()),ref:Y(()=>o(),e=>o(e))}),h=G(()=>be(p,m.props));var g=r(),_=U(g),v=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(h)})),K(e,n)},y=e=>{var n=vi();oe(n,()=>({...D(h)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(_,e=>{i.child?e(v):e(y,-1)}),K(e,g),R()}var bi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`children`]),xi=T(`<div><div><!></div></div>`);function Si(e,r){let i=w();n(r,!0);let a=A(r,`ref`,15,null),o=A(r,`id`,19,()=>Ee(i)),s=V(r,bi),c=Qr.create({id:Y(()=>o()),ref:Y(()=>a(),e=>a(e))}),l=G(()=>be(s,c.props)),u=G(()=>be({},c.contentProps));var f=xi();oe(f,()=>({...D(l)}));var p=z(f);oe(p,()=>({...D(u)}));var m=z(p);t(m,()=>r.children??x),d(p),d(f),K(e,f),R()}var Ci=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`]),wi=T(`<div><!></div>`);function Ti(e,i){n(i,!0);let a=V(i,Ci),o=oi.create(),c=G(()=>be(a,o.props));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(c)})),K(e,n)},p=e=>{var n=wi();oe(n,()=>({...D(c)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l),R()}var Ei=new Set([`$$slots`,`$$events`,`$$legacy`]);function Di(e,t){n(t,!0);let r=V(t,Ei),i=new xt,a=ii.create({mounted:Y(()=>i.current)}),o=G(()=>be(r,a.props));Ti(e,H(()=>D(o))),R()}var Oi=new Set([`$$slots`,`$$events`,`$$legacy`]);function ki(e,t){n(t,!0);let r=V(t,Oi),i=new xt,a=ai.create({mounted:Y(()=>i.current)}),o=G(()=>be(r,a.props));Ti(e,H(()=>D(o))),R()}var Ai=new Set([`$$slots`,`$$events`,`$$legacy`]);function ji(e,t){n(t,!0);let i=V(t,Ai),a=ri.create();var o=r(),c=U(o),l=e=>{Di(e,H(()=>i))},u=e=>{ki(e,H(()=>i))};s(c,e=>{a.scrollbar.opts.orientation.current===`horizontal`?e(l):e(u,-1)}),K(e,o),R()}var Mi=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Ni(e,t){n(t,!0);let r=A(t,`forceMount`,3,!1),i=V(t,Mi),a=ni.create(),o=G(()=>be(i,a.props));{let t=e=>{ji(e,H(()=>D(o)))},n=G(()=>r()||a.isVisible);Hr(e,{get open(){return D(n)},get ref(){return a.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}})}R()}var Pi=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Fi(e,t){n(t,!0);let r=A(t,`forceMount`,3,!1),i=V(t,Pi),a=ti.create(),o=G(()=>be(i,a.props));{let t=e=>{ji(e,H(()=>D(o)))},n=G(()=>r()||!a.isHidden);Hr(e,H(()=>D(o),{get open(){return D(n)},get ref(){return a.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}}))}R()}var Ii=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Li(e,t){n(t,!0);let r=A(t,`forceMount`,3,!1),i=V(t,Ii),a=ei.create(),o=ni.create(),s=G(()=>be(i,a.props,o.props,{"data-state":a.isVisible?`visible`:`hidden`})),c=G(()=>r()||a.isVisible&&o.isVisible);Hr(e,{get open(){return D(c)},get ref(){return o.scrollbar.opts.ref},presence:e=>{ji(e,H(()=>D(s)))},$$slots:{presence:!0}}),R()}var Ri=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`orientation`]);function zi(e,t){let i=w();n(t,!0);let a=A(t,`ref`,15,null),o=A(t,`id`,19,()=>Ee(i)),c=V(t,Ri),l=$r.create({orientation:Y(()=>t.orientation),id:Y(()=>o()),ref:Y(()=>a(),e=>a(e))}),u=G(()=>l.root.opts.type.current);var d=r(),f=U(d),p=e=>{Li(e,H(()=>c,{get id(){return o()}}))},m=e=>{Fi(e,H(()=>c,{get id(){return o()}}))},h=e=>{Ni(e,H(()=>c,{get id(){return o()}}))},g=e=>{ji(e,H(()=>c,{get id(){return o()}}))};s(f,e=>{D(u)===`hover`?e(p):D(u)===`scroll`?e(m,1):D(u)===`auto`?e(h,2):D(u)===`always`&&e(g,3)}),K(e,d),R()}var Bi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`,`present`]),Vi=T(`<div><!></div>`);function Hi(e,i){n(i,!0);let a=A(i,`ref`,15,null),o=V(i,Bi),c=new xt,l=si.create({id:Y(()=>i.id),ref:Y(()=>a(),e=>a(e)),mounted:Y(()=>c.current)}),u=G(()=>be(o,l.props,{style:{hidden:!i.present}}));var f=r(),p=U(f),m=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(u)})),K(e,n)},h=e=>{var n=Vi();oe(n,()=>({...D(u)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(p,e=>{i.child?e(m):e(h,-1)}),K(e,f),R()}var Ui=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`forceMount`]);function Wi(e,t){let r=w();n(t,!0);let i=A(t,`id`,19,()=>Ee(r)),a=A(t,`ref`,15,null),o=A(t,`forceMount`,3,!1),s=V(t,Ui),c=Jr.get();{let t=(e,t)=>{let n=()=>(t?.()).present;Hi(e,H(()=>s,{get id(){return i()},get present(){return n()},get ref(){return a()},set ref(e){a(e)}}))},n=G(()=>o()||c.hasThumb);Hr(e,{get open(){return D(n)},get ref(){return c.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}})}R()}var Gi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`children`,`child`]),Ki=T(`<div><!></div>`);function qi(e,i){n(i,!0);let a=A(i,`ref`,15,null),o=V(i,Gi),c=ci.create({id:Y(()=>i.id),ref:Y(()=>a(),e=>a(e))}),l=G(()=>be(o,c.props));var u=r(),f=U(u),p=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(l)})),K(e,n)},m=e=>{var n=Ki();oe(n,()=>({...D(l)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(f,e=>{i.child?e(p):e(m,-1)}),K(e,u),R()}var Ji=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`]);function Yi(e,t){let i=w();n(t,!0);let a=A(t,`ref`,15,null),o=A(t,`id`,19,()=>Ee(i)),c=V(t,Ji),l=Kr.get(),u=G(()=>!!(l.scrollbarXNode&&l.scrollbarYNode)),d=G(()=>l.opts.type.current!==`scroll`&&D(u));var f=r(),p=U(f),m=e=>{qi(e,H(()=>c,{get id(){return o()},get ref(){return a()},set ref(e){a(e)}}))};s(p,e=>{D(d)&&e(m)}),K(e,f),R()}function Xi(e,t,n){let r={position:`absolute`};return e===`lr`?(r.left=`${t}%`,r.right=`${n}%`):e===`rl`?(r.right=`${t}%`,r.left=`${n}%`):e===`bt`?(r.bottom=`${t}%`,r.top=`${n}%`):(r.top=`${t}%`,r.bottom=`${n}%`),r}function Zi(e,t){let n={position:`absolute`};return e===`lr`?(n.left=`${t}%`,n.translate=`-50% 0`):e===`rl`?(n.right=`${t}%`,n.translate=`50% 0`):e===`bt`?(n.bottom=`${t}%`,n.translate=`0 50%`):(n.top=`${t}%`,n.translate=`0 -50%`),n}function Qi(e,t,n){let r={position:`absolute`};return e===`lr`?(r.left=`${t}%`,r.translate=`${n}% 0`):e===`rl`?(r.right=`${t}%`,r.translate=`${-n}% 0`):e===`bt`?(r.bottom=`${t}%`,r.translate=`0 ${-n}%`):(r.top=`${t}%`,r.translate=`0 ${n}%`),r}function $i(e){if(Math.floor(e)===e)return 0;let t=e.toString();if(t.indexOf(`.`)!==-1&&t.indexOf(`e-`)===-1)return t.split(`.`)[1].length;if(t.indexOf(`e-`)!==-1){let e=t.split(`e-`);return parseInt(e[1],10)}return 0}function ea(e,t){let n=10**t;return Math.round(e*n)/n}function ta(e,t,n){if(typeof e==`number`){let r=n-t,i=Math.ceil(r/e),a=$i(e),o=10**a;Math.round(r*o)%Math.round(e*o)===0&&i++;let s=[];for(let n=0;n<i;n++){let r=ea(t+n*e,a);s.push(r)}return s}return[...new Set(e)].filter(e=>e>=t&&e<=n).sort((e,t)=>e-t)}function na(e,t){if(t.length===0)return e;let n=t[0],r=Math.abs(e-n);for(let i of t){let t=Math.abs(e-i);t<r&&(r=t,n=i)}return n}function ra(e,t,n){let r=t.indexOf(e);return r===-1?na(e,t):n===`next`?r<t.length-1?t[r+1]:e:r>0?t[r-1]:e}function ia(e,t,n=!0){let[r,i]=e,[a,o]=t,s=(o-a)/(i-r);return e=>{let t=a+s*(e-r);return n?t>Math.max(a,o)?Math.max(a,o):t<Math.min(a,o)?Math.min(a,o):t:t}}var aa=Se({component:`slider`,parts:[`root`,`thumb`,`range`,`tick`,`tick-label`,`thumb-label`]}),oa=new ft(`Slider.Root`),sa=class{opts;attachment;#e=F(!1);get isActive(){return D(this.#e)}set isActive(e){B(this.#e,e,!0)}#t=F(0);#n=G(()=>this.opts.orientation.current===`horizontal`?this.opts.dir.current===`rtl`?`rl`:`lr`:this.opts.dir.current===`rtl`?`tb`:`bt`);get direction(){return D(this.#n)}set direction(e){B(this.#n,e)}#r=G(()=>ta(this.opts.step.current,this.opts.min.current,this.opts.max.current));get normalizedSteps(){return D(this.#r)}set normalizedSteps(e){B(this.#r,e)}domContext;constructor(e){this.opts=e,this.attachment=De(e.ref),this.domContext=new Ft(this.opts.ref),new Br(()=>this.opts.ref.current,this.#i)}#i=()=>{B(this.#t,D(this.#t)+1)};isThumbActive(e){return this.isActive}#a=G(()=>{if(!this.opts.disabled.current)return this.opts.orientation.current===`horizontal`?`pan-y`:`pan-x`});getAllThumbs=()=>{let e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(aa.selector(`thumb`))):[]};getThumbScale=()=>{D(this.#t);let e=this.opts.trackPadding?.current;if(e!==void 0&&e>0)return[e,100-e];if(this.opts.thumbPositioning.current===`exact`)return[0,100];let t=this.opts.orientation.current===`vertical`,n=this.getAllThumbs()[0],r=t?n?.offsetHeight:n?.offsetWidth;if(r===void 0||Number.isNaN(r)||r===0)return[0,100];let i=t?this.opts.ref.current?.offsetHeight:this.opts.ref.current?.offsetWidth;if(i===void 0||Number.isNaN(i)||i===0)return[0,100];let a=r/2/i*100;return[a,100-a]};getPositionFromValue=e=>{let t=this.getThumbScale();return ia([this.opts.min.current,this.opts.max.current],t)(e)};#o=G(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,"data-disabled":xe(this.opts.disabled.current),style:{touchAction:D(this.#a)},[aa.root]:``,...this.attachment}));get props(){return D(this.#o)}set props(e){B(this.#o,e)}},ca=class extends sa{opts;isMulti=!1;constructor(e){super(e),this.opts=e,wt(()=>Ce(f(this.domContext.getDocument(),`pointerdown`,this.handlePointerDown),f(this.domContext.getDocument(),`pointerup`,this.handlePointerUp),f(this.domContext.getDocument(),`pointermove`,this.handlePointerMove),f(this.domContext.getDocument(),`pointerleave`,this.handlePointerUp))),dt([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([e,t,n,r])=>{let i=ta(e,t,n),a=e=>i.includes(e),o=e=>na(e,i);a(r)||(this.opts.value.current=o(r))})}isTickValueSelected=e=>this.opts.value.current===e;applyPosition({clientXY:e,start:t,end:n}){let r=this.opts.min.current,i=this.opts.max.current,a=(e-t)/(n-t)*(i-r)+r;if(a<r)this.updateValue(r);else if(a>i)this.updateValue(i);else{let e=this.normalizedSteps,t=na(a,e);this.updateValue(t)}}updateValue=e=>{this.opts.value.current=na(e,this.normalizedSteps)};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();let t=this.opts.ref.current,n=this.getAllThumbs()[0];if(!t||!n)return;n.focus();let{left:r,right:i,top:a,bottom:o}=t.getBoundingClientRect();this.direction===`lr`?this.applyPosition({clientXY:e.clientX,start:r,end:i}):this.direction===`rl`?this.applyPosition({clientXY:e.clientX,start:i,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;let t=this.opts.ref.current,n=this.getAllThumbs()[0];if(!n||!t)return;let r=e.composedPath()[0]??e.target;!pt(r)||!t.contains(r)||(e.preventDefault(),n.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(e(()=>this.opts.value.current)),this.isActive=!1)};#e=G(()=>{let e=this.opts.value.current;return Array.from({length:1},()=>{let t=e,n=this.getPositionFromValue(t),r=Zi(this.direction,n);return{role:`slider`,"aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":t,"aria-disabled":we(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":t,"data-orientation":this.opts.orientation.current,style:r,[aa.thumb]:``}})});get thumbsPropsArr(){return D(this.#e)}set thumbsPropsArr(e){B(this.#e,e)}#t=G(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return D(this.#t)}set thumbsRenderArr(e){B(this.#t,e)}#n=G(()=>{let e=this.normalizedSteps,t=this.opts.value.current;return e.map((n,r)=>{let i=this.getPositionFromValue(n),a=r===0,o=r===e.length-1,s=a?0:o?-100:-50,c=Qi(this.direction,i,s),l=n<=t;return{"data-disabled":xe(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":l?``:void 0,"data-value":n,"data-selected":this.isTickValueSelected(n)?``:void 0,style:c,[aa.tick]:``}})});get ticksPropsArr(){return D(this.#n)}set ticksPropsArr(e){B(this.#n,e)}#r=G(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return D(this.#r)}set ticksRenderArr(e){B(this.#r,e)}#i=G(()=>this.ticksPropsArr.map((e,t)=>({value:e[`data-value`],index:t})));get tickItemsArr(){return D(this.#i)}set tickItemsArr(e){B(this.#i,e)}#a=G(()=>[{value:this.opts.value.current,index:0}]);get thumbItemsArr(){return D(this.#a)}set thumbItemsArr(e){B(this.#a,e)}#o=G(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return D(this.#o)}set snippetProps(e){B(this.#o,e)}},la=class extends sa{opts;isMulti=!0;#e=F(null);get activeThumb(){return D(this.#e)}set activeThumb(e){B(this.#e,e,!0)}#t=F(0);get currentThumbIdx(){return D(this.#t)}set currentThumbIdx(e){B(this.#t,e,!0)}constructor(e){super(e),this.opts=e,wt(()=>Ce(f(this.domContext.getDocument(),`pointerdown`,this.handlePointerDown),f(this.domContext.getDocument(),`pointerup`,this.handlePointerUp),f(this.domContext.getDocument(),`pointermove`,this.handlePointerMove),f(this.domContext.getDocument(),`pointerleave`,this.handlePointerUp))),dt([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([e,t,n,r])=>{let i=ta(e,t,n),a=e=>i.includes(e),o=e=>na(e,i);r.some(e=>!a(e))&&(this.opts.value.current=r.map(o))})}isTickValueSelected=e=>this.opts.value.current.includes(e);isThumbActive(e){return this.isActive&&this.activeThumb?.idx===e}applyPosition({clientXY:e,activeThumbIdx:t,start:n,end:r}){let i=this.opts.min.current,a=this.opts.max.current,o=(e-n)/(r-n)*(a-i)+i;if(o<i)this.updateValue(i,t);else if(o>a)this.updateValue(a,t);else{let e=this.normalizedSteps,n=na(o,e);this.updateValue(n,t)}}#n=e=>{let t=this.getAllThumbs();if(!t.length)return;for(let e of t)e.blur();let n=t.map(t=>{if(this.opts.orientation.current===`horizontal`){let{left:n,right:r}=t.getBoundingClientRect();return Math.abs(e.clientX-(n+r)/2)}{let{top:n,bottom:r}=t.getBoundingClientRect();return Math.abs(e.clientY-(n+r)/2)}}),r=t[n.indexOf(Math.min(...n))];return{node:r,idx:t.indexOf(r)}};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();let t=this.opts.ref.current,n=this.activeThumb;if(!t||!n)return;n.node.focus();let{left:r,right:i,top:a,bottom:o}=t.getBoundingClientRect(),s=this.direction;s===`lr`?this.applyPosition({clientXY:e.clientX,activeThumbIdx:n.idx,start:r,end:i}):s===`rl`?this.applyPosition({clientXY:e.clientX,activeThumbIdx:n.idx,start:i,end:r}):s===`bt`?this.applyPosition({clientXY:e.clientY,activeThumbIdx:n.idx,start:o,end:a}):s===`tb`&&this.applyPosition({clientXY:e.clientY,activeThumbIdx:n.idx,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;let t=this.opts.ref.current,n=this.#n(e);if(!n||!t)return;let r=e.composedPath()[0]??e.target;!pt(r)||!t.contains(r)||(e.preventDefault(),this.activeThumb=n,n.node.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(e(()=>this.opts.value.current)),this.isActive=!1)};getAllThumbs=()=>{let e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(aa.selector(`thumb`))):[]};updateValue=(e,t)=>{let n=this.opts.value.current;if(!n.length){this.opts.value.current.push(e);return}if(n[t]===e)return;let r=[...n];if(!Yt(t,r))return;let i=r[t]>e?-1:1,a=()=>{let n=t+i;r[t]=r[n],r[n]=e;let a=this.getAllThumbs();a.length&&(a[n]?.focus(),this.activeThumb={node:a[n],idx:n})};if(this.opts.autoSort.current&&(i===-1&&e<r[t-1]||i===1&&e>r[t+1])){a(),this.opts.value.current=r;return}let o=this.normalizedSteps;r[t]=na(e,o),this.opts.value.current=r};#r=G(()=>{let t=this.opts.value.current;return Array.from({length:t.length||1},(n,r)=>{let i=e(()=>this.currentThumbIdx);i<t.length&&e(()=>{this.currentThumbIdx=i+1});let a=t[r],o=this.getPositionFromValue(a??0),s=Zi(this.direction,o);return{role:`slider`,"aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":a,"aria-disabled":we(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":a,"data-orientation":this.opts.orientation.current,style:s,[aa.thumb]:``}})});get thumbsPropsArr(){return D(this.#r)}set thumbsPropsArr(e){B(this.#r,e)}#i=G(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return D(this.#i)}set thumbsRenderArr(e){B(this.#i,e)}#a=G(()=>{let e=this.normalizedSteps,t=this.opts.value.current;return e.map((n,r)=>{let i=this.getPositionFromValue(n),a=r===0,o=r===e.length-1,s=a?0:o?-100:-50,c=Qi(this.direction,i,s),l=t.length===1?n<=t[0]:t[0]<=n&&n<=t[t.length-1];return{"data-disabled":xe(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":l?``:void 0,"data-value":n,style:c,[aa.tick]:``}})});get ticksPropsArr(){return D(this.#a)}set ticksPropsArr(e){B(this.#a,e)}#o=G(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return D(this.#o)}set ticksRenderArr(e){B(this.#o,e)}#s=G(()=>this.ticksPropsArr.map((e,t)=>({value:e[`data-value`],index:t})));get tickItemsArr(){return D(this.#s)}set tickItemsArr(e){B(this.#s,e)}#c=G(()=>this.opts.value.current.map((e,t)=>({value:e,index:t})));get thumbItemsArr(){return D(this.#c)}set thumbItemsArr(e){B(this.#c,e)}#l=G(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return D(this.#l)}set snippetProps(e){B(this.#l,e)}},ua=class{static create(e){let{type:t,...n}=e,r=t===`single`?new ca(n):new la(n);return oa.set(r)}},da=[mt,ht,_t,yt,bt,`End`],fa=class e{static create(t){return new e(t,oa.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=De(e.ref)}#e=G(()=>{if(Array.isArray(this.root.opts.value.current)){let 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`,...Xi(this.root.direction,e,t)}}{let e=this.root.opts.trackPadding?.current,t=this.root.opts.value.current,n=this.root.opts.max.current,r=e!==void 0&&e>0&&t===n?0:100-this.root.getPositionFromValue(t);return{position:`absolute`,...Xi(this.root.direction,0,r)}}});get rangeStyles(){return D(this.#e)}set rangeStyles(e){B(this.#e,e)}#t=G(()=>({id:this.opts.id.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":xe(this.root.opts.disabled.current),style:this.rangeStyles,[aa.range]:``,...this.attachment}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},pa=class e{static create(t){return new e(t,oa.get())}opts;root;attachment;#e=G(()=>this.root.opts.disabled.current||this.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=De(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(D(this.#e))return;let t=this.opts.ref.current;if(!t)return;let n=this.root.getAllThumbs();if(!n.length)return;let r=n.indexOf(t);if(this.root.isMulti&&(this.root.currentThumbIdx=r),!da.includes(e.key))return;e.preventDefault();let i=this.root.opts.min.current,a=this.root.opts.max.current,o=this.root.opts.value.current,s=Array.isArray(o)?o[r]:o,c=this.root.opts.orientation.current,l=this.root.direction,u=this.root.normalizedSteps;switch(e.key){case bt:this.#t(i);break;case`End`:this.#t(a);break;case mt:if(c!==`horizontal`)break;if(e.metaKey){let e=l===`rl`?a:i;this.#t(e)}else{let e=ra(s,u,l===`rl`?`next`:`prev`);this.#t(e)}break;case ht:if(c!==`horizontal`)break;if(e.metaKey){let e=l===`rl`?i:a;this.#t(e)}else{let e=ra(s,u,l===`rl`?`prev`:`next`);this.#t(e)}break;case _t:if(e.metaKey){let e=l===`tb`?i:a;this.#t(e)}else{let e=ra(s,u,l===`tb`?`prev`:`next`);this.#t(e)}break;case yt:if(e.metaKey){let e=l===`tb`?a:i;this.#t(e)}else{let e=ra(s,u,l===`tb`?`next`:`prev`);this.#t(e)}}this.root.opts.onValueCommit.current(this.root.opts.value.current)}#n=G(()=>({...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":xe(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 D(this.#n)}set props(e){B(this.#n,e)}},ma=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`value`,`type`,`onValueChange`,`onValueCommit`,`disabled`,`min`,`max`,`step`,`dir`,`autoSort`,`orientation`,`thumbPositioning`,`trackPadding`]),ha=T(`<span><!></span>`);function ga(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`value`,15),u=A(i,`onValueChange`,3,vt),f=A(i,`onValueCommit`,3,vt),p=A(i,`disabled`,3,!1),m=A(i,`step`,3,1),h=A(i,`dir`,3,`ltr`),g=A(i,`autoSort`,3,!0),_=A(i,`orientation`,3,`horizontal`),v=A(i,`thumbPositioning`,3,`contain`),y=V(i,ma),b=G(()=>i.min===void 0?Array.isArray(m())?Math.min(...m()):0:i.min),S=G(()=>i.max===void 0?Array.isArray(m())?Math.max(...m()):100:i.max);function C(){if(l()===void 0)return i.type===`single`?D(b):[]}C(),dt.pre(()=>l(),()=>{C()});let T=ua.create({id:Y(()=>o()),ref:Y(()=>c(),e=>c(e)),value:Y(()=>l(),e=>{l(e),u()(e)}),onValueCommit:Y(()=>f()),disabled:Y(()=>p()),min:Y(()=>D(b)),max:Y(()=>D(S)),step:Y(()=>m()),dir:Y(()=>h()),autoSort:Y(()=>g()),orientation:Y(()=>_()),thumbPositioning:Y(()=>v()),type:i.type,trackPadding:Y(()=>i.trackPadding)}),E=G(()=>be(y,T.props));var O=r(),k=U(O),j=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(E),...T.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},ee=e=>{var n=ha();oe(n,()=>({...D(E)}));var r=z(n);t(r,()=>i.children??x,()=>T.snippetProps),d(n),K(e,n)};s(k,e=>{i.child?e(j):e(ee,-1)}),K(e,O),R()}var _a=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),va=T(`<span><!></span>`);function ya(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=V(i,_a),u=fa.create({id:Y(()=>c()),ref:Y(()=>o(),e=>o(e))}),f=G(()=>be(l,u.props));var p=r(),m=U(p),h=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(f)})),K(e,n)},g=e=>{var n=va();oe(n,()=>({...D(f)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(m,e=>{i.child?e(h):e(g,-1)}),K(e,p),R()}var ba=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`,`index`,`disabled`]),xa=T(`<span><!></span>`);function Sa(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=A(i,`disabled`,3,!1),u=V(i,ba),f=pa.create({id:Y(()=>c()),ref:Y(()=>o(),e=>o(e)),index:Y(()=>i.index),disabled:Y(()=>l())}),p=G(()=>be(u,f.props));var m=r(),h=U(m),g=e=>{var n=r(),a=U(n);{let e=G(()=>({active:f.root.isThumbActive(f.opts.index.current),props:D(p)}));t(a,()=>i.child,()=>D(e))}K(e,n)},_=e=>{var n=xa();oe(n,()=>({...D(p)}));var r=z(n);{let e=G(()=>({active:f.root.isThumbActive(f.opts.index.current)}));t(r,()=>i.children??x,()=>D(e))}d(n),K(e,n)};s(h,e=>{i.child?e(g):e(_,-1)}),K(e,m),R()}var Ca={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},wa={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Ta=1e3,Ea=1001,Da=1002,Oa=1003,ka=1004,Aa=1005,ja=1006,Ma=1007,Na=1008,Pa=1009,Fa=1010,Ia=1011,La=1012,Ra=1013,za=1014,Ba=1015,Va=1016,Ha=1017,Ua=1018,Wa=1020,Ga=35902,Ka=35899,qa=1021,Ja=1022,Ya=1023,Xa=1026,Za=1027,Qa=1028,$a=1029,eo=1030,to=1031,no=1033,ro=33776,io=33777,ao=33778,oo=33779,so=35840,co=35841,lo=35842,uo=35843,fo=36196,po=37492,mo=37496,ho=37488,go=37489,_o=37490,vo=37491,yo=37808,bo=37809,xo=37810,So=37811,Co=37812,wo=37813,To=37814,Eo=37815,Do=37816,Oo=37817,ko=37818,Ao=37819,jo=37820,Mo=37821,No=36492,Po=36494,Fo=36495,Io=36283,Lo=36284,Ro=36285,zo=36286,Bo=2300,Vo=2301,Ho=2302,Uo=2303,Wo=2400,Go=2401,Ko=2402,qo=3200,Jo=`srgb`,Yo=`srgb-linear`,Xo=`linear`,Zo=`srgb`,Qo=7680,$o=35044,es=2e3;function ts(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function ns(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function rs(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function is(){let e=rs(`canvas`);return e.style.display=`block`,e}var as={};function os(...e){let t=`THREE.`+e.shift();console.log(t,...e)}function ss(e){let t=e[0];if(typeof t==`string`&&t.startsWith(`TSL:`)){let t=e[1];t&&t.isStackTrace?e[0]+=` `+t.getLocation():e[1]=`Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.`}return e}function cs(...e){e=ss(e);let t=`THREE.`+e.shift();{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}function ls(...e){e=ss(e);let t=`THREE.`+e.shift();{let n=e[0];n&&n.isStackTrace?console.error(n.getError(t)):console.error(t,...e)}}function us(...e){let t=e.join(` `);t in as||(as[t]=!0,cs(...e))}function ds(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var fs={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3},ps=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n!==void 0&&n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n<r;n++)t[n].call(this,e);e.target=null}}},ms=`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`.split(`.`),hs=1234567,gs=Math.PI/180,_s=180/Math.PI;function vs(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(ms[e&255]+ms[e>>8&255]+ms[e>>16&255]+ms[e>>24&255]+`-`+ms[t&255]+ms[t>>8&255]+`-`+ms[t>>16&15|64]+ms[t>>24&255]+`-`+ms[n&63|128]+ms[n>>8&255]+`-`+ms[n>>16&255]+ms[n>>24&255]+ms[r&255]+ms[r>>8&255]+ms[r>>16&255]+ms[r>>24&255]).toLowerCase()}function ys(e,t,n){return Math.max(t,Math.min(n,e))}function bs(e,t){return(e%t+t)%t}function xs(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function Ss(e,t,n){return e===t?0:(n-e)/(t-e)}function Cs(e,t,n){return(1-n)*e+n*t}function ws(e,t,n,r){return Cs(e,t,1-Math.exp(-n*r))}function Ts(e,t=1){return t-Math.abs(bs(e,t*2)-t)}function Es(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function Ds(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function Os(e,t){return e+Math.floor(Math.random()*(t-e+1))}function ks(e,t){return e+Math.random()*(t-e)}function As(e){return e*(.5-Math.random())}function js(e){e!==void 0&&(hs=e);let t=hs+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Ms(e){return e*gs}function Ns(e){return e*_s}function Ps(e){return!(e&e-1)&&e!==0}function Fs(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function Is(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function Ls(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:cs(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function Rs(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}function zs(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}var Bs={DEG2RAD:gs,RAD2DEG:_s,generateUUID:vs,clamp:ys,euclideanModulo:bs,mapLinear:xs,inverseLerp:Ss,lerp:Cs,damp:ws,pingpong:Ts,smoothstep:Es,smootherstep:Ds,randInt:Os,randFloat:ks,randFloatSpread:As,seededRandom:js,degToRad:Ms,radToDeg:Ns,isPowerOfTwo:Ps,ceilPowerOfTwo:Fs,floorPowerOfTwo:Is,setQuaternionFromProperEuler:Ls,normalize:zs,denormalize:Rs},X=class e{static{e.prototype.isVector2=!0}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 Error(`THREE.Vector2: index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`THREE.Vector2: 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){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+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=ys(this.x,e.x,t.x),this.y=ys(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=ys(this.x,e,t),this.y=ys(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(ys(n,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){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(ys(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,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){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Vs=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,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,n,r){return this._x=e,this._y=t,this._z=n,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){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:cs(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(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=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ys(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);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*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*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}},Z=class e{static{e.prototype.isVector3=!0}constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,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 Error(`THREE.Vector3: 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 Error(`THREE.Vector3: 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(Us.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Us.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-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){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[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=ys(this.x,e.x,t.x),this.y=ys(this.y,e.y,t.y),this.z=ys(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=ys(this.x,e,t),this.y=ys(this.y,e,t),this.z=ys(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(ys(n,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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Hs.copy(this).projectOnVector(e),this.sub(Hs)}reflect(e){return this.sub(Hs.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(ys(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+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,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,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(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Hs=new Z,Us=new Vs,Ws=class e{static{e.prototype.isMatrix3=!0}constructor(e,t,n,r,i,a,o,s,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let 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){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,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){let 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,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return us(`Matrix3: .scale() is deprecated. Use .makeScale() instead.`),this.premultiply(Gs.makeScale(e,t)),this}rotate(e){return us(`Matrix3: .rotate() is deprecated. Use .makeRotation() instead.`),this.premultiply(Gs.makeRotation(-e)),this}translate(e,t){return us(`Matrix3: .translate() is deprecated. Use .makeTranslation() instead.`),this.premultiply(Gs.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){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},Gs=new Ws,Ks=new Ws().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),qs=new Ws().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Js(){let e={enabled:!0,workingColorSpace:Yo,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=Xs(e.r),e.g=Xs(e.g),e.b=Xs(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=Zs(e.r),e.g=Zs(e.g),e.b=Zs(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?Xo:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return us(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return us(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[Yo]:{primaries:t,whitePoint:r,transfer:Xo,toXYZ:Ks,fromXYZ:qs,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Jo},outputColorSpaceConfig:{drawingBufferColorSpace:Jo}},[Jo]:{primaries:t,whitePoint:r,transfer:Zo,toXYZ:Ks,fromXYZ:qs,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Jo}}}),e}var Ys=Js();function Xs(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function Zs(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var Qs,$s=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Qs===void 0&&(Qs=rs(`canvas`)),Qs.width=e.width,Qs.height=e.height;let t=Qs.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=Qs}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=rs(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=Xs(i[e]/255)*255;return n.putImageData(r,0,0),t}if(e.data){let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(Xs(t[e]/255)*255):t[e]=Xs(t[e]);return{data:t,width:e.width,height:e.height}}return cs(`ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.`),e}},ec=0,tc=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:ec++}),this.uuid=vs(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let 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(0,0,0):e.set(t.width,t.height,t.depth||0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:``},r=this.data;if(r!==null){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(nc(r[t].image)):e.push(nc(r[t]))}else e=nc(r);n.url=e}return t||(e.images[this.uuid]=n),n}};function nc(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap?$s.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(cs(`Texture: Unable to serialize Texture.`),{})}var rc=0,ic=new Z,ac=class e extends ps{constructor(t=e.DEFAULT_IMAGE,n=e.DEFAULT_MAPPING,r=Ea,i=Ea,a=ja,o=Na,s=Ya,c=Pa,l=e.DEFAULT_ANISOTROPY,u=``){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:rc++}),this.uuid=vs(),this.name=``,this.source=new tc(t),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=a,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=c,this.offset=new X(0,0),this.repeat=new X(1,1),this.center=new X(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ws,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(ic).x}get height(){return this.source.getSize(ic).y}get depth(){return this.source.getSize(ic).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(let t in e){let n=e[t];if(n===void 0){cs(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){cs(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ta:e.x-=Math.floor(e.x);break;case Ea:e.x=e.x<0?0:1;break;case Da:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case Ta:e.y-=Math.floor(e.y);break;case Ea:e.y=e.y<0?0:1;break;case Da:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y)}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++}};ac.DEFAULT_IMAGE=null,ac.DEFAULT_MAPPING=300,ac.DEFAULT_ANISOTROPY=1;var oc=class e{static{e.prototype.isVector4=!0}constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,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,n,r){return this.x=e,this.y=t,this.z=n,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 Error(`THREE.Vector4: 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 Error(`THREE.Vector4: 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?1:e.w,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){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,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);let 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,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;let e=(c+1)/2,s=(f+1)/2,_=(g+1)/2,v=(l+d)/4,y=(u+m)/4,b=(p+h)/4;return e>s&&e>_?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):s>_?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=y/i,r=b/i),this.set(n,r,i,t),this}let _=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(_)<.001&&(_=1),this.x=(h-p)/_,this.y=(u-m)/_,this.z=(d-l)/_,this.w=Math.acos((c+f+g-1)/2),this}setFromMatrixPosition(e){let 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=ys(this.x,e.x,t.x),this.y=ys(this.y,e.y,t.y),this.z=ys(this.z,e.z,t.z),this.w=ys(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=ys(this.x,e,t),this.y=ys(this.y,e,t),this.z=ys(this.z,e,t),this.w=ys(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(ys(n,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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,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}},sc=class extends ps{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ja,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new oc(0,0,e,t),this.scissorTest=!1,this.viewport=new oc(0,0,e,t),this.textures=[];let r=new ac({width:e,height:t,depth:n.depth}),i=n.count;for(let e=0;e<i;e++)this.textures[e]=r.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview,this.useArrayDepthTexture=n.useArrayDepthTexture}_setTextureOptions(e={}){let t={minFilter:ja,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 e=0;e<this.textures.length;e++)this.textures[e].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,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,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,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let n=Object.assign({},e.textures[t].image);this.textures[t].source=new tc(n)}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.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:`dispose`})}},cc=class extends sc{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},lc=class extends ac{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Oa,this.minFilter=Oa,this.wrapR=Ea,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},uc=class extends ac{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Oa,this.minFilter=Oa,this.wrapR=Ea,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},dc=class e{static{e.prototype.isMatrix4=!0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){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,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,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 e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let 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,n){return this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();let t=this.elements,n=e.elements,r=1/fc.setFromMatrixColumn(e,0).length(),i=1/fc.setFromMatrixColumn(e,1).length(),a=1/fc.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}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(mc,e,hc)}lookAt(e,t,n){let r=this.elements;return vc.subVectors(e,t),vc.lengthSq()===0&&(vc.z=1),vc.normalize(),gc.crossVectors(n,vc),gc.lengthSq()===0&&(Math.abs(n.z)===1?vc.x+=1e-4:vc.z+=1e-4,vc.normalize(),gc.crossVectors(n,vc)),gc.normalize(),_c.crossVectors(vc,gc),r[0]=gc.x,r[4]=_c.x,r[8]=vc.x,r[1]=gc.y,r[5]=_c.y,r[9]=vc.y,r[2]=gc.z,r[6]=_c.z,r[10]=vc.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],j=r[10],ee=r[14],M=r[3],N=r[7],P=r[11],te=r[15];return i[0]=a*x+o*T+s*k+c*M,i[4]=a*S+o*E+s*A+c*N,i[8]=a*C+o*D+s*j+c*P,i[12]=a*w+o*O+s*ee+c*te,i[1]=l*x+u*T+d*k+f*M,i[5]=l*S+u*E+d*A+f*N,i[9]=l*C+u*D+d*j+f*P,i[13]=l*w+u*O+d*ee+f*te,i[2]=p*x+m*T+h*k+g*M,i[6]=p*S+m*E+h*A+g*N,i[10]=p*C+m*D+h*j+g*P,i[14]=p*w+m*O+h*ee+g*te,i[3]=_*x+v*T+y*k+b*M,i[7]=_*S+v*E+y*A+b*N,i[11]=_*C+v*D+y*j+b*P,i[15]=_*w+v*O+y*ee+b*te,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}determinantAffine(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[1],a=e[5],o=e[9],s=e[2],c=e[6],l=e[10];return t*(a*l-o*c)-n*(i*l-o*s)+r*(i*c-a*s)}transpose(){let e=this.elements,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,n){let 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]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=t*c-i*a,b=n*s-r*o,x=n*c-i*o,S=r*c-i*s,C=l*m-u*p,w=l*h-d*p,T=l*g-f*p,E=u*h-d*m,D=u*g-f*m,O=d*g-f*h,k=_*O-v*D+y*E+b*T-x*w+S*C;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let A=1/k;return e[0]=(o*O-s*D+c*E)*A,e[1]=(r*D-n*O-i*E)*A,e[2]=(m*S-h*x+g*b)*A,e[3]=(d*x-u*S-f*b)*A,e[4]=(s*T-a*O-c*w)*A,e[5]=(t*O-r*T+i*w)*A,e[6]=(h*y-p*S-g*v)*A,e[7]=(l*S-d*y+f*v)*A,e[8]=(a*D-o*T+c*C)*A,e[9]=(n*T-t*D-i*C)*A,e[10]=(p*x-m*y+g*_)*A,e[11]=(u*y-l*x-f*_)*A,e[12]=(o*w-a*E-s*C)*A,e[13]=(t*E-n*w+r*C)*A,e[14]=(m*v-p*b-h*_)*A,e[15]=(l*b-u*v+d*_)*A,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=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,n,r))}makeTranslation(e,t,n){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,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];let i=this.determinantAffine();if(i===0)return n.set(1,1,1),t.identity(),this;let a=fc.set(r[0],r[1],r[2]).length(),o=fc.set(r[4],r[5],r[6]).length(),s=fc.set(r[8],r[9],r[10]).length();i<0&&(a=-a),pc.copy(this);let c=1/a,l=1/o,u=1/s;return pc.elements[0]*=c,pc.elements[1]*=c,pc.elements[2]*=c,pc.elements[4]*=l,pc.elements[5]*=l,pc.elements[6]*=l,pc.elements[8]*=u,pc.elements[9]*=u,pc.elements[10]*=u,t.setFromRotationMatrix(pc),n.x=a,n.y=o,n.z=s,this}makePerspective(e,t,n,r,i,a,o=es,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=es,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},fc=new Z,pc=new dc,mc=new Z(0,0,0),hc=new Z(1,1,1),gc=new Z,_c=new Z,vc=new Z,yc=new dc,bc=new Vs,xc=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}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,n,r=this._order){return this._x=e,this._y=t,this._z=n,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,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(ys(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-ys(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(ys(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-ys(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(ys(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-ys(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:cs(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return yc.makeRotationFromQuaternion(e),this.setFromRotationMatrix(yc,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return bc.setFromEuler(this),this.setFromQuaternion(bc,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}};xc.DEFAULT_ORDER=`XYZ`;var Sc=class{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))}},Cc=0,wc=new Z,Tc=new Vs,Ec=new dc,Dc=new Z,Oc=new Z,kc=new Z,Ac=new Vs,jc=new Z(1,0,0),Mc=new Z(0,1,0),Nc=new Z(0,0,1),Pc={type:`added`},Fc={type:`removed`},Ic={type:`childadded`,child:null},Lc={type:`childremoved`,child:null},Rc=class e extends ps{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Cc++}),this.uuid=vs(),this.name=``,this.type=`Object3D`,this.parent=null,this.children=[],this.up=e.DEFAULT_UP.clone();let t=new Z,n=new xc,r=new Vs,i=new Z(1,1,1);function a(){r.setFromEuler(n,!1)}function o(){n.setFromQuaternion(r,void 0,!1)}n._onChange(a),r._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new dc},normalMatrix:{value:new Ws}}),this.matrix=new dc,this.matrixWorld=new dc,this.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Sc,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 Tc.setFromAxisAngle(e,t),this.quaternion.multiply(Tc),this}rotateOnWorldAxis(e,t){return Tc.setFromAxisAngle(e,t),this.quaternion.premultiply(Tc),this}rotateX(e){return this.rotateOnAxis(jc,e)}rotateY(e){return this.rotateOnAxis(Mc,e)}rotateZ(e){return this.rotateOnAxis(Nc,e)}translateOnAxis(e,t){return wc.copy(e).applyQuaternion(this.quaternion),this.position.add(wc.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(jc,e)}translateY(e){return this.translateOnAxis(Mc,e)}translateZ(e){return this.translateOnAxis(Nc,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ec.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Dc.copy(e):Dc.set(e,t,n);let r=this.parent;this.updateWorldMatrix(!0,!1),Oc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ec.lookAt(Oc,Dc,this.up):Ec.lookAt(Dc,Oc,this.up),this.quaternion.setFromRotationMatrix(Ec),r&&(Ec.extractRotation(r.matrixWorld),Tc.setFromRotationMatrix(Ec),this.quaternion.premultiply(Tc.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(ls(`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(Pc),Ic.child=e,this.dispatchEvent(Ic),Ic.child=null):ls(`Object3D.add: object not an instance of THREE.Object3D.`,e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Fc),Lc.child=e,this.dispatchEvent(Lc),Lc.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ec.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ec.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ec),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Pc),Ic.child=e,this.dispatchEvent(Ic),Ic.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 n=0,r=this.children.length;n<r;n++){let r=this.children[n].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Oc,e,kc),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Oc,Ac,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let t=e.x,n=e.y,r=e.z,i=this.matrix.elements;i[12]+=t-i[0]*t-i[4]*n-i[8]*r,i[13]+=n-i[1]*t-i[5]*n-i[9]*r,i[14]+=r-i[2]*t-i[6]*n-i[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);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){let r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),t===!0){let e=this.children;for(let t=0,r=e.length;t<r;t++)e[t].updateWorldMatrix(!1,!0,n)}}toJSON(e){let t=e===void 0||typeof e==`string`,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:`Object`,generator:`Object3D.toJSON`});let 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(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),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 i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.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=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){let r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){let t=a(e.geometries),r=a(e.materials),i=a(e.textures),o=a(e.images),s=a(e.shapes),c=a(e.skeletons),l=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}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?null:e.pivot.clone(),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 t=0;t<e.children.length;t++){let n=e.children[t];this.add(n.clone())}return this}};Rc.DEFAULT_UP=new Z(0,1,0),Rc.DEFAULT_MATRIX_AUTO_UPDATE=!0,Rc.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var zc=class extends Rc{constructor(){super(),this.isGroup=!0,this.type=`Group`}},Bc={type:`move`},Vc=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new zc,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 zc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new zc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Z,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){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}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,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position);c.inputState.pinching&&o>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,s.eventsEnabled&&s.dispatchEvent({type:`gripUpdated`,data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),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(Bc)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new zc;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},Hc={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},Uc={h:0,s:0,l:0},Wc={h:0,s:0,l:0};function Gc(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var Q=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Jo){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ys.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=Ys.workingColorSpace){return this.r=e,this.g=t,this.b=n,Ys.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=Ys.workingColorSpace){if(e=bs(e,1),t=ys(t,0,1),n=ys(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Gc(i,r,e+1/3),this.g=Gc(i,r,e),this.b=Gc(i,r,e-1/3)}return Ys.colorSpaceToWorking(this,r),this}setStyle(e,t=Jo){function n(t){t!==void 0&&parseFloat(t)<1&&cs(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:cs(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);cs(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Jo){let n=Hc[e.toLowerCase()];return n===void 0?cs(`Color: Unknown color `+e):this.setHex(n,t),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=Xs(e.r),this.g=Xs(e.g),this.b=Xs(e.b),this}copyLinearToSRGB(e){return this.r=Zs(e.r),this.g=Zs(e.g),this.b=Zs(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Jo){return Ys.workingToColorSpace(Kc.copy(this),e),Math.round(ys(Kc.r*255,0,255))*65536+Math.round(ys(Kc.g*255,0,255))*256+Math.round(ys(Kc.b*255,0,255))}getHexString(e=Jo){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ys.workingColorSpace){Ys.workingToColorSpace(Kc.copy(this),t);let n=Kc.r,r=Kc.g,i=Kc.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r<i?6:0);break;case r:s=(i-n)/e+2;break;case i:s=(n-r)/e+4}s/=6}return e.h=s,e.s=c,e.l=l,e}getRGB(e,t=Ys.workingColorSpace){return Ys.workingToColorSpace(Kc.copy(this),t),e.r=Kc.r,e.g=Kc.g,e.b=Kc.b,e}getStyle(e=Jo){Ys.workingToColorSpace(Kc.copy(this),e);let t=Kc.r,n=Kc.g,r=Kc.b;return e===`srgb`?`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`:`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`}offsetHSL(e,t,n){return this.getHSL(Uc),this.setHSL(Uc.h+e,Uc.s+t,Uc.l+n)}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,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Uc),e.getHSL(Wc);let n=Cs(Uc.h,Wc.h,t),r=Cs(Uc.s,Wc.s,t),i=Cs(Uc.l,Wc.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[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}},Kc=new Q;Q.NAMES=Hc;var qc=class extends Rc{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 xc,this.environmentIntensity=1,this.environmentRotation=new xc,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){let 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}},Jc=new Z,Yc=new Z,Xc=new Z,Zc=new Z,Qc=new Z,$c=new Z,el=new Z,tl=new Z,nl=new Z,rl=new Z,il=new oc,al=new oc,ol=new oc,sl=class e{constructor(e=new Z,t=new Z,n=new Z){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Jc.subVectors(e,t),r.cross(Jc);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Jc.subVectors(r,t),Yc.subVectors(n,t),Xc.subVectors(e,t);let a=Jc.dot(Jc),o=Jc.dot(Yc),s=Jc.dot(Xc),c=Yc.dot(Yc),l=Yc.dot(Xc),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Zc)!==null&&Zc.x>=0&&Zc.y>=0&&Zc.x+Zc.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Zc)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,Zc.x),s.addScaledVector(a,Zc.y),s.addScaledVector(o,Zc.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return il.setScalar(0),al.setScalar(0),ol.setScalar(0),il.fromBufferAttribute(e,t),al.fromBufferAttribute(e,n),ol.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(il,i.x),a.addScaledVector(al,i.y),a.addScaledVector(ol,i.z),a}static isFrontFacing(e,t,n,r){return Jc.subVectors(n,t),Yc.subVectors(e,t),Jc.cross(Yc).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),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 Jc.subVectors(this.c,this.b),Yc.subVectors(this.a,this.b),Jc.cross(Yc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Qc.subVectors(r,n),$c.subVectors(i,n),tl.subVectors(e,n);let s=Qc.dot(tl),c=$c.dot(tl);if(s<=0&&c<=0)return t.copy(n);nl.subVectors(e,r);let l=Qc.dot(nl),u=$c.dot(nl);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Qc,a);rl.subVectors(e,i);let f=Qc.dot(rl),p=$c.dot(rl);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector($c,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return el.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(el,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Qc,a).addScaledVector($c,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},cl=class{constructor(e=new Z(1/0,1/0,1/0),t=new Z(-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,n=e.length;t<n;t+=3)this.expandByPoint(ul.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(ul.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=ul.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),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);let n=e.geometry;if(n!==void 0){let r=n.getAttribute(`position`);if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let t=0,n=r.count;t<n;t++)e.isMesh===!0?e.getVertexPosition(t,ul):ul.fromBufferAttribute(r,t),ul.applyMatrix4(e.matrixWorld),this.expandByPoint(ul);else e.boundingBox===void 0?(n.boundingBox===null&&n.computeBoundingBox(),dl.copy(n.boundingBox)):(e.boundingBox===null&&e.computeBoundingBox(),dl.copy(e.boundingBox)),dl.applyMatrix4(e.matrixWorld),this.union(dl)}let r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],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,ul),ul.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(vl),yl.subVectors(this.max,vl),fl.subVectors(e.a,vl),pl.subVectors(e.b,vl),ml.subVectors(e.c,vl),hl.subVectors(pl,fl),gl.subVectors(ml,pl),_l.subVectors(fl,ml);let t=[0,-hl.z,hl.y,0,-gl.z,gl.y,0,-_l.z,_l.y,hl.z,0,-hl.x,gl.z,0,-gl.x,_l.z,0,-_l.x,-hl.y,hl.x,0,-gl.y,gl.x,0,-_l.y,_l.x,0];return!Sl(t,fl,pl,ml,yl)||(t=[1,0,0,0,1,0,0,0,1],!Sl(t,fl,pl,ml,yl))?!1:(bl.crossVectors(hl,gl),t=[bl.x,bl.y,bl.z],Sl(t,fl,pl,ml,yl))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ul).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ul).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:(ll[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ll[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ll[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ll[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ll[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ll[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ll[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ll[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ll),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}},ll=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],ul=new Z,dl=new cl,fl=new Z,pl=new Z,ml=new Z,hl=new Z,gl=new Z,_l=new Z,vl=new Z,yl=new Z,bl=new Z,xl=new Z;function Sl(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){xl.fromArray(e,a);let o=i.x*Math.abs(xl.x)+i.y*Math.abs(xl.y)+i.z*Math.abs(xl.z),s=t.dot(xl),c=n.dot(xl),l=r.dot(xl);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var Cl=wl();function wl(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[e|256]=32768,i[e]=24,i[e|256]=24):t<-14?(r[e]=1024>>-t-14,r[e|256]=1024>>-t-14|32768,i[e]=-t-1,i[e|256]=-t-1):t<=15?(r[e]=t+15<<10,r[e|256]=t+15<<10|32768,i[e]=13,i[e|256]=13):t<128?(r[e]=31744,r[e|256]=64512,i[e]=24,i[e|256]=24):(r[e]=31744,r[e|256]=64512,i[e]=13,i[e|256]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(t&8388608);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}function Tl(e){Math.abs(e)>65504&&cs(`DataUtils.toHalfFloat(): Value out of range.`),e=ys(e,-65504,65504),Cl.floatView[0]=e;let t=Cl.uint32View[0],n=t>>23&511;return Cl.baseTable[n]+((t&8388607)>>Cl.shiftTable[n])}function El(e){let t=e>>10;return Cl.uint32View[0]=Cl.mantissaTable[Cl.offsetTable[t]+(e&1023)]+Cl.exponentTable[t],Cl.floatView[0]}var Dl=class{static toHalfFloat(e){return Tl(e)}static fromHalfFloat(e){return El(e)}},Ol=new Z,kl=new X,Al=0,jl=class extends ps{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Al++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=$o,this.updateRanges=[],this.gpuType=Ba,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,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)kl.fromBufferAttribute(this,t),kl.applyMatrix3(e),this.setXY(t,kl.x,kl.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Ol.fromBufferAttribute(this,t),Ol.applyMatrix3(e),this.setXYZ(t,Ol.x,Ol.y,Ol.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Ol.fromBufferAttribute(this,t),Ol.applyMatrix4(e),this.setXYZ(t,Ol.x,Ol.y,Ol.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ol.fromBufferAttribute(this,t),Ol.applyNormalMatrix(e),this.setXYZ(t,Ol.x,Ol.y,Ol.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ol.fromBufferAttribute(this,t),Ol.transformDirection(e),this.setXYZ(t,Ol.x,Ol.y,Ol.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Rs(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=zs(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Rs(t,this.array)),t}setX(e,t){return this.normalized&&(t=zs(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Rs(t,this.array)),t}setY(e,t){return this.normalized&&(t=zs(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=Rs(t,this.array)),t}setZ(e,t){return this.normalized&&(t=zs(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=Rs(t,this.array)),t}setW(e,t){return this.normalized&&(t=zs(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=zs(t,this.array),n=zs(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=zs(t,this.array),n=zs(n,this.array),r=zs(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=zs(t,this.array),n=zs(n,this.array),r=zs(r,this.array),i=zs(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let 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!==35044&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:`dispose`})}},Ml=class extends jl{constructor(e,t,n){super(new Uint16Array(e),t,n)}},Nl=class extends jl{constructor(e,t,n){super(new Uint32Array(e),t,n)}},Pl=class extends jl{constructor(e,t,n){super(new Float32Array(e),t,n)}},Fl=new cl,Il=new Z,Ll=new Z,Rl=class{constructor(e=new Z,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){let n=this.center;t===void 0?Fl.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));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){let 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){let n=this.center.distanceToSquared(e);return t.copy(e),n>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*=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;Il.subVectors(e,this.center);let t=Il.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(Il,n/e),this.radius+=n}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):(Ll.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Il.copy(e.center).add(Ll)),this.expandByPoint(Il.copy(e.center).sub(Ll))),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}},zl=0,Bl=new dc,Vl=new Rc,Hl=new Z,Ul=new cl,Wl=new cl,Gl=new Z,Kl=class e extends ps{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:zl++}),this.uuid=vs(),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={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return this.index=Array.isArray(e)?new(ts(e)?Nl:Ml)(e,1):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,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let t=new Ws().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let 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._transformed=!0,this}applyQuaternion(e){return Bl.makeRotationFromQuaternion(e),this.applyMatrix4(Bl),this}rotateX(e){return Bl.makeRotationX(e),this.applyMatrix4(Bl),this}rotateY(e){return Bl.makeRotationY(e),this.applyMatrix4(Bl),this}rotateZ(e){return Bl.makeRotationZ(e),this.applyMatrix4(Bl),this}translate(e,t,n){return Bl.makeTranslation(e,t,n),this.applyMatrix4(Bl),this}scale(e,t,n){return Bl.makeScale(e,t,n),this.applyMatrix4(Bl),this}lookAt(e){return Vl.lookAt(e),Vl.updateMatrix(),this.applyMatrix4(Vl.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Hl).negate(),this.translate(Hl.x,Hl.y,Hl.z),this}setFromPoints(e){let t=this.getAttribute(`position`);if(t===void 0){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}this.setAttribute(`position`,new Pl(t,3))}else{let n=Math.min(e.length,t.count);for(let r=0;r<n;r++){let n=e[r];t.setXYZ(r,n.x,n.y,n.z||0)}e.length>t.count&&cs(`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 cl);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){ls(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new Z(-1/0,-1/0,-1/0),new Z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Ul.setFromBufferAttribute(n),this.morphTargetsRelative?(Gl.addVectors(this.boundingBox.min,Ul.min),this.boundingBox.expandByPoint(Gl),Gl.addVectors(this.boundingBox.max,Ul.max),this.boundingBox.expandByPoint(Gl)):(this.boundingBox.expandByPoint(Ul.min),this.boundingBox.expandByPoint(Ul.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&ls(`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 Rl);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){ls(`BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.`,this),this.boundingSphere.set(new Z,1/0);return}if(e){let n=this.boundingSphere.center;if(Ul.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Wl.setFromBufferAttribute(n),this.morphTargetsRelative?(Gl.addVectors(Ul.min,Wl.min),Ul.expandByPoint(Gl),Gl.addVectors(Ul.max,Wl.max),Ul.expandByPoint(Gl)):(Ul.expandByPoint(Wl.min),Ul.expandByPoint(Wl.max))}Ul.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)Gl.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(Gl));if(t)for(let i=0,a=t.length;i<a;i++){let a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)Gl.fromBufferAttribute(a,t),o&&(Hl.fromBufferAttribute(e,t),Gl.add(Hl)),r=Math.max(r,n.distanceToSquared(Gl))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&ls(`BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.`,this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){ls(`BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)`);return}let n=t.position,r=t.normal,i=t.uv,a=this.getAttribute(`tangent`);(a===void 0||a.count!==n.count)&&(a=new jl(new Float32Array(4*n.count),4),this.setAttribute(`tangent`,a));let o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new Z,s[e]=new Z;let c=new Z,l=new Z,u=new Z,d=new X,f=new X,p=new X,m=new Z,h=new Z;function g(e,t,r){c.fromBufferAttribute(n,e),l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,r),d.fromBufferAttribute(i,e),f.fromBufferAttribute(i,t),p.fromBufferAttribute(i,r),l.sub(c),u.sub(c),f.sub(d),p.sub(d);let a=1/(f.x*p.y-p.x*f.y);isFinite(a)&&(m.copy(l).multiplyScalar(p.y).addScaledVector(u,-f.y).multiplyScalar(a),h.copy(u).multiplyScalar(f.x).addScaledVector(l,-p.x).multiplyScalar(a),o[e].add(m),o[t].add(m),o[r].add(m),s[e].add(h),s[t].add(h),s[r].add(h))}let _=this.groups;_.length===0&&(_=[{start:0,count:e.count}]);for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)g(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let v=new Z,y=new Z,b=new Z,x=new Z;function S(e){b.fromBufferAttribute(r,e),x.copy(b);let t=o[e];v.copy(t),v.sub(b.multiplyScalar(b.dot(t))).normalize(),y.crossVectors(x,t);let n=y.dot(s[e])<0?-1:1;a.setXYZW(e,v.x,v.y,v.z,n)}for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)S(e.getX(t+0)),S(e.getX(t+1)),S(e.getX(t+2))}this._transformed=!0}computeVertexNormals(){let e=this.index,t=this.getAttribute(`position`);if(t!==void 0){let n=this.getAttribute(`normal`);if(n===void 0||n.count!==t.count)n=new jl(new Float32Array(t.count*3),3),this.setAttribute(`normal`,n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let r=new Z,i=new Z,a=new Z,o=new Z,s=new Z,c=new Z,l=new Z,u=new Z;if(e)for(let d=0,f=e.count;d<f;d+=3){let f=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);r.fromBufferAttribute(t,f),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,m),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),o.fromBufferAttribute(n,f),s.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),o.add(l),s.add(l),c.add(l),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let e=0,o=t.count;e<o;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),n.setXYZ(e+0,l.x,l.y,l.z),n.setXYZ(e+1,l.x,l.y,l.z),n.setXYZ(e+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Gl.fromBufferAttribute(e,t),Gl.normalize(),e.setXYZ(t,Gl.x,Gl.y,Gl.z)}toNonIndexed(){function t(e,t){let n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0;for(let i=0,c=t.length;i<c;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new jl(a,r,i)}if(this.index===null)return cs(`BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.`),this;let n=new e,r=this.index.array,i=this.attributes;for(let e in i){let a=i[e],o=t(a,r);n.setAttribute(e,o)}let a=this.morphAttributes;for(let e in a){let i=[],o=a[e];for(let e=0,n=o.length;e<n;e++){let n=o[e],a=t(n,r);i.push(a)}n.morphAttributes[e]=i}n.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let e=0,t=o.length;e<t;e++){let t=o[e];n.addGroup(t.start,t.count,t.materialIndex)}return n}toJSON(){let e={metadata:{version:4.7,type:`BufferGeometry`,generator:`BufferGeometry.toJSON`}};if(e.uuid=this.uuid,e.type=this.parameters!==void 0&&this._transformed===!0?`BufferGeometry`:this.type,this.name!==``&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t<r;t++){let r=n[t];a.push(r.toJSON(e.data))}a.length>0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let 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;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());let s=e.boundingSphere;return s!==null&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:`dispose`})}},ql=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.usage=$o,this.updateRanges=[],this.version=0,this.uuid=vs()}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,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+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=vs()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}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=vs()),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}}},Jl=new Z,Yl=class e{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name=``,this.data=e,this.itemSize=t,this.offset=n,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,n=this.data.count;t<n;t++)Jl.fromBufferAttribute(this,t),Jl.applyMatrix4(e),this.setXYZ(t,Jl.x,Jl.y,Jl.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Jl.fromBufferAttribute(this,t),Jl.applyNormalMatrix(e),this.setXYZ(t,Jl.x,Jl.y,Jl.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Jl.fromBufferAttribute(this,t),Jl.transformDirection(e),this.setXYZ(t,Jl.x,Jl.y,Jl.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Rs(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=zs(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=zs(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=zs(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=zs(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=zs(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=Rs(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Rs(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Rs(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Rs(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=zs(t,this.array),n=zs(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=zs(t,this.array),n=zs(n,this.array),r=zs(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=zs(t,this.array),n=zs(n,this.array),r=zs(r,this.array),i=zs(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(t){if(t===void 0){os(`InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new jl(new this.array.constructor(e),this.itemSize,this.normalized)}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new e(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){os(`InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}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}}},Xl=0,Zl=class extends ps{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Xl++}),this.uuid=vs(),this.name=``,this.type=`Material`,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Q(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Qo,this.stencilZFail=Qo,this.stencilZPass=Qo,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(let t in e){let n=e[t];if(n===void 0){cs(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){cs(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector2&&n&&n.isVector2||r&&r.isEuler&&n&&n.isEuler||r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}fromJSON(e,t){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new Q().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(this.vertexColors=typeof e.vertexColors==`number`?e.vertexColors>0:e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),this.normalScale=new X().fromArray(t)}return e.displacementMap!==void 0&&(this.displacementMap=t[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new X().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}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;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,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++}},Ql=class extends Zl{constructor(e){super(),this.isSpriteMaterial=!0,this.type=`SpriteMaterial`,this.color=new Q(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}},$l,eu=new Z,tu=new Z,nu=new Z,ru=new X,iu=new X,au=new dc,ou=new Z,su=new Z,cu=new Z,lu=new X,uu=new X,du=new X,fu=class extends Rc{constructor(e=new Ql){if(super(),this.isSprite=!0,this.type=`Sprite`,$l===void 0){$l=new Kl;let e=new ql(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);$l.setIndex([0,1,2,0,2,3]),$l.setAttribute(`position`,new Yl(e,3,0,!1)),$l.setAttribute(`uv`,new Yl(e,2,3,!1))}this.geometry=$l,this.material=e,this.center=new X(.5,.5),this.count=1}raycast(e,t){e.camera===null&&ls(`Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.`),tu.setFromMatrixScale(this.matrixWorld),au.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),nu.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&tu.multiplyScalar(-nu.z);let n=this.material.rotation,r,i;n!==0&&(i=Math.cos(n),r=Math.sin(n));let a=this.center;pu(ou.set(-.5,-.5,0),nu,a,tu,r,i),pu(su.set(.5,-.5,0),nu,a,tu,r,i),pu(cu.set(.5,.5,0),nu,a,tu,r,i),lu.set(0,0),uu.set(1,0),du.set(1,1);let o=e.ray.intersectTriangle(ou,su,cu,!1,eu);if(o===null&&(pu(su.set(-.5,.5,0),nu,a,tu,r,i),uu.set(0,1),o=e.ray.intersectTriangle(ou,cu,su,!1,eu),o===null))return;let s=e.ray.origin.distanceTo(eu);s<e.near||s>e.far||t.push({distance:s,point:eu.clone(),uv:sl.getInterpolation(eu,ou,su,cu,lu,uu,du,new X),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 pu(e,t,n,r,i,a){ru.subVectors(e,n).addScalar(.5).multiply(r),i===void 0?iu.copy(ru):(iu.x=a*ru.x-i*ru.y,iu.y=i*ru.x+a*ru.y),e.copy(t),e.x+=iu.x,e.y+=iu.y,e.applyMatrix4(au)}var mu=new Z,hu=new Z,gu=new Z,_u=new Z,vu=new Z,yu=new Z,bu=new Z,xu=class{constructor(e=new Z,t=new Z(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,mu)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=mu.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(mu.copy(this.origin).addScaledVector(this.direction,t),mu.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){hu.copy(e).add(t).multiplyScalar(.5),gu.copy(t).sub(e).normalize(),_u.copy(this.origin).sub(hu);let i=e.distanceTo(t)*.5,a=-this.direction.dot(gu),o=_u.dot(this.direction),s=-_u.dot(gu),c=_u.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(hu).addScaledVector(gu,d),f}intersectSphere(e,t){mu.subVectors(e.center,this.origin);let n=mu.dot(this.direction),r=mu.dot(mu)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,mu)!==null}intersectTriangle(e,t,n,r,i){vu.subVectors(t,e),yu.subVectors(n,e),bu.crossVectors(vu,yu);let a=this.direction.dot(bu),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;_u.subVectors(this.origin,e);let s=o*this.direction.dot(yu.crossVectors(_u,yu));if(s<0)return null;let c=o*this.direction.dot(vu.cross(_u));if(c<0||s+c>a)return null;let l=-o*_u.dot(bu);return l<0?null:this.at(l/a,i)}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)}},Su=class extends Zl{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new Q(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 xc,this.combine=0,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}},Cu=new dc,wu=new xu,Tu=new Rl,Eu=new Z,Du=new Z,Ou=new Z,ku=new Z,Au=new Z,ju=new Z,Mu=new Z,Nu=new Z,Pu=class extends Rc{constructor(e=new Kl,t=new Su){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(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);let o=this.morphTargetInfluences;if(i&&o){ju.set(0,0,0);for(let n=0,r=i.length;n<r;n++){let r=o[n],s=i[n];r!==0&&(Au.fromBufferAttribute(s,e),a?ju.addScaledVector(Au,r):ju.addScaledVector(Au.sub(t),r))}t.add(ju)}return t}raycast(e,t){let n=this.geometry,r=this.material,i=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Tu.copy(n.boundingSphere),Tu.applyMatrix4(i),wu.copy(e.ray).recast(e.near),!(Tu.containsPoint(wu.origin)===!1&&(wu.intersectSphere(Tu,Eu)===null||wu.origin.distanceToSquared(Eu)>(e.far-e.near)**2))&&(Cu.copy(i).invert(),wu.copy(e.ray).applyMatrix4(Cu),(n.boundingBox===null||wu.intersectsBox(n.boundingBox)!==!1)&&this._computeIntersections(e,t,wu)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;i<s;i++){let s=d[i],p=a[s.materialIndex],m=Math.max(s.start,f.start),h=Math.min(o.count,Math.min(s.start+s.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=o.getX(i),d=o.getX(i+1),f=o.getX(i+2);r=Iu(this,p,e,n,c,l,u,a,d,f),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),s=Math.min(o.count,f.start+f.count);for(let d=i,f=s;d<f;d+=3){let i=o.getX(d),s=o.getX(d+1),f=o.getX(d+2);r=Iu(this,a,e,n,c,l,u,i,s,f),r&&(r.faceIndex=Math.floor(d/3),t.push(r))}}else if(s!==void 0)if(Array.isArray(a))for(let i=0,o=d.length;i<o;i++){let o=d[i],p=a[o.materialIndex],m=Math.max(o.start,f.start),h=Math.min(s.count,Math.min(o.start+o.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=i,s=i+1,d=i+2;r=Iu(this,p,e,n,c,l,u,a,s,d),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),o=Math.min(s.count,f.start+f.count);for(let s=i,d=o;s<d;s+=3){let i=s,o=s+1,d=s+2;r=Iu(this,a,e,n,c,l,u,i,o,d),r&&(r.faceIndex=Math.floor(s/3),t.push(r))}}}};function Fu(e,t,n,r,i,a,o,s){let c;if(c=t.side===1?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side===0,s),c===null)return null;Nu.copy(s),Nu.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(Nu);return l<n.near||l>n.far?null:{distance:l,point:Nu.clone(),object:e}}function Iu(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,Du),e.getVertexPosition(c,Ou),e.getVertexPosition(l,ku);let u=Fu(e,t,n,r,Du,Ou,ku,Mu);if(u){let e=new Z;sl.getBarycoord(Mu,Du,Ou,ku,e),i&&(u.uv=sl.getInterpolatedAttribute(i,s,c,l,e,new X)),a&&(u.uv1=sl.getInterpolatedAttribute(a,s,c,l,e,new X)),o&&(u.normal=sl.getInterpolatedAttribute(o,s,c,l,e,new Z),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new Z,materialIndex:0};sl.getNormal(Du,Ou,ku,t.normal),u.face=t,u.barycoord=e}return u}var Lu=class extends ac{constructor(e=null,t=1,n=1,r,i,a,o,s,c=Oa,l=Oa,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Ru=new Z,zu=new Z,Bu=new Ws,Vu=class{constructor(e=new Z(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,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=Ru.subVectors(n,t).cross(zu.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let 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,n=!0){let r=e.delta(Ru),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/i;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<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){let n=t||Bu.getNormalMatrix(e),r=this.coplanarPoint(Ru).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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)}},Hu=new Rl,Uu=new X(.5,.5),Wu=new Z,Gu=class{constructor(e=new Vu,t=new Vu,n=new Vu,r=new Vu,i=new Vu,a=new Vu){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=es,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Hu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Hu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Hu)}intersectsSprite(e){return Hu.center.set(0,0,0),Hu.radius=.7071067811865476+Uu.distanceTo(e.center),Hu.applyMatrix4(e.matrixWorld),this.intersectsSphere(Hu)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let r=t[n];if(Wu.x=r.normal.x>0?e.max.x:e.min.x,Wu.y=r.normal.y>0?e.max.y:e.min.y,Wu.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},Ku=class extends Zl{constructor(e){super(),this.isLineBasicMaterial=!0,this.type=`LineBasicMaterial`,this.color=new Q(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}},qu=new Z,Ju=new Z,Yu=new dc,Xu=new xu,Zu=new Rl,Qu=new Z,$u=new Z,ed=class extends Rc{constructor(e=new Kl,t=new Ku){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(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)qu.fromBufferAttribute(t,e-1),Ju.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=qu.distanceTo(Ju);e.setAttribute(`lineDistance`,new Pl(n,1))}else cs(`Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.`);return this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Zu.copy(n.boundingSphere),Zu.applyMatrix4(r),Zu.radius+=i,e.ray.intersectsSphere(Zu)===!1)return;Yu.copy(r).invert(),Xu.copy(e.ray).applyMatrix4(Yu);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=this.isLineSegments?2:1,l=n.index,u=n.attributes.position;if(l!==null){let n=Math.max(0,a.start),r=Math.min(l.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=l.getX(i),r=l.getX(i+1),a=td(this,e,Xu,s,n,r,i);a&&t.push(a)}if(this.isLineLoop){let i=l.getX(r-1),a=l.getX(n),o=td(this,e,Xu,s,i,a,r-1);o&&t.push(o)}}else{let n=Math.max(0,a.start),r=Math.min(u.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=td(this,e,Xu,s,i,i+1,i);n&&t.push(n)}if(this.isLineLoop){let i=td(this,e,Xu,s,r-1,n,r-1);i&&t.push(i)}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function td(e,t,n,r,i,a,o){let s=e.geometry.attributes.position;if(qu.fromBufferAttribute(s,i),Ju.fromBufferAttribute(s,a),n.distanceSqToSegment(qu,Ju,Qu,$u)>r)return;Qu.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(Qu);if(!(c<t.near||c>t.far))return{distance:c,point:$u.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}var nd=class extends Zl{constructor(e){super(),this.isPointsMaterial=!0,this.type=`PointsMaterial`,this.color=new Q(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}},rd=new dc,id=new xu,ad=new Rl,od=new Z,sd=class extends Rc{constructor(e=new Kl,t=new nd){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){let n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),ad.copy(n.boundingSphere),ad.applyMatrix4(r),ad.radius+=i,e.ray.intersectsSphere(ad)===!1)return;rd.copy(r).invert(),id.copy(e.ray).applyMatrix4(rd);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=n.index,l=n.attributes.position;if(c!==null){let n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);for(let a=n,o=i;a<o;a++){let n=c.getX(a);od.fromBufferAttribute(l,n),cd(od,n,s,r,e,t,this)}}else{let n=Math.max(0,a.start),i=Math.min(l.count,a.start+a.count);for(let a=n,o=i;a<o;a++)od.fromBufferAttribute(l,a),cd(od,a,s,r,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function cd(e,t,n,r,i,a,o){let s=id.distanceSqToPoint(e);if(s<n){let n=new Z;id.closestPointToPoint(e,n),n.applyMatrix4(r);let c=i.ray.origin.distanceTo(n);if(c<i.near||c>i.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var ld=class extends ac{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},ud=class extends ac{constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isCanvasTexture=!0,this.needsUpdate=!0}},dd=class extends ac{constructor(e,t,n=za,r,i,a,o=Oa,s=Oa,c,l=Xa,u=1){if(l!==1026&&l!==1027)throw Error(`THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new tc(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},fd=class extends dd{constructor(e,t=za,n=301,r,i,a=Oa,o=Oa,s,c=Xa){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},pd=class extends ac{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},md=class e extends Kl{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new Pl(c,3)),this.setAttribute(`normal`,new Pl(l,3)),this.setAttribute(`uv`,new Pl(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new Z;for(let a=0;a<w;a++){let o=a*y-x;for(let s=0;s<C;s++)D[e]=(s*v-b)*r,D[t]=o*i,D[n]=S,c.push(D.x,D.y,D.z),D[e]=0,D[t]=0,D[n]=m>0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e<g;e++)for(let t=0;t<h;t++){let n=d+t+C*e,r=d+t+C*(e+1),i=d+(t+1)+C*(e+1),a=d+(t+1)+C*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(f,E,_),f+=E,d+=T}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}},hd=class e extends Kl{constructor(e=1,t=1,n=1,r=32,i=1,a=!1,o=0,s=Math.PI*2){super(),this.type=`CylinderGeometry`,this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};let c=this;r=Math.floor(r),i=Math.floor(i);let l=[],u=[],d=[],f=[],p=0,m=[],h=n/2,g=0;_(),a===!1&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new Pl(u,3)),this.setAttribute(`normal`,new Pl(d,3)),this.setAttribute(`uv`,new Pl(f,2));function _(){let a=new Z,_=new Z,v=0,y=(t-e)/n;for(let c=0;c<=i;c++){let l=[],g=c/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,c=Math.sin(i),m=Math.cos(i);_.x=v*c,_.y=-g*n+h,_.z=v*m,u.push(_.x,_.y,_.z),a.set(c,y,m).normalize(),d.push(a.x,a.y,a.z),f.push(t,1-g),l.push(p++)}m.push(l)}for(let n=0;n<r;n++)for(let r=0;r<i;r++){let a=m[r][n],o=m[r+1][n],s=m[r+1][n+1],c=m[r][n+1];(e>0||r!==0)&&(l.push(a,o,c),v+=3),(t>0||r!==i-1)&&(l.push(o,s,c),v+=3)}c.addGroup(g,v,0),g+=v}function v(n){let i=p,a=new X,m=new Z,_=0,v=n===!0?e:t,y=n===!0?1:-1;for(let e=1;e<=r;e++)u.push(0,h*y,0),d.push(0,y,0),f.push(.5,.5),p++;let b=p;for(let e=0;e<=r;e++){let t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);m.x=v*i,m.y=h*y,m.z=v*n,u.push(m.x,m.y,m.z),d.push(0,y,0),a.x=n*.5+.5,a.y=i*.5*y+.5,f.push(a.x,a.y),p++}for(let e=0;e<r;e++){let t=i+e,r=b+e;n===!0?l.push(r,r+1,t):l.push(r+1,r,t),_+=3}c.addGroup(g,_,n===!0?1:2),g+=_}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}},gd=new Z,_d=new Z,vd=new Z,yd=new sl,bd=class extends Kl{constructor(e=null,t=1){if(super(),this.type=`EdgesGeometry`,this.parameters={geometry:e,thresholdAngle:t},e!==null){let n=10**4,r=Math.cos(gs*t),i=e.getIndex(),a=e.getAttribute(`position`),o=i?i.count:a.count,s=[0,0,0],c=[`a`,`b`,`c`],l=[,,,],u={},d=[];for(let e=0;e<o;e+=3){i?(s[0]=i.getX(e),s[1]=i.getX(e+1),s[2]=i.getX(e+2)):(s[0]=e,s[1]=e+1,s[2]=e+2);let{a:t,b:o,c:f}=yd;if(t.fromBufferAttribute(a,s[0]),o.fromBufferAttribute(a,s[1]),f.fromBufferAttribute(a,s[2]),yd.getNormal(vd),l[0]=`${Math.round(t.x*n)},${Math.round(t.y*n)},${Math.round(t.z*n)}`,l[1]=`${Math.round(o.x*n)},${Math.round(o.y*n)},${Math.round(o.z*n)}`,l[2]=`${Math.round(f.x*n)},${Math.round(f.y*n)},${Math.round(f.z*n)}`,l[0]!==l[1]&&l[1]!==l[2]&&l[2]!==l[0])for(let e=0;e<3;e++){let t=(e+1)%3,n=l[e],i=l[t],a=yd[c[e]],o=yd[c[t]],f=`${n}_${i}`,p=`${i}_${n}`;p in u&&u[p]?(vd.dot(u[p].normal)<=r&&(d.push(a.x,a.y,a.z),d.push(o.x,o.y,o.z)),u[p]=null):f in u||(u[f]={index0:s[e],index1:s[t],normal:vd.clone()})}}for(let e in u)if(u[e]){let{index0:t,index1:n}=u[e];gd.fromBufferAttribute(a,t),_d.fromBufferAttribute(a,n),d.push(gd.x,gd.y,gd.z),d.push(_d.x,_d.y,_d.z)}this.setAttribute(`position`,new Pl(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}},xd=class e extends Kl{constructor(e=1,t=1,n=1,r=1){super(),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};let i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),c=o+1,l=s+1,u=e/o,d=t/s,f=[],p=[],m=[],h=[];for(let e=0;e<l;e++){let t=e*d-a;for(let n=0;n<c;n++){let r=n*u-i;p.push(r,-t,0),m.push(0,0,1),h.push(n/o),h.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){let n=t+c*e,r=t+c*(e+1),i=t+1+c*(e+1),a=t+1+c*e;f.push(n,r,a),f.push(r,i,a)}this.setIndex(f),this.setAttribute(`position`,new Pl(p,3)),this.setAttribute(`normal`,new Pl(m,3)),this.setAttribute(`uv`,new Pl(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.widthSegments,t.heightSegments)}},Sd=class extends Kl{constructor(e=null){if(super(),this.type=`WireframeGeometry`,this.parameters={geometry:e},e!==null){let t=[],n=new Set,r=new Z,i=new Z;if(e.index!==null){let a=e.attributes.position,o=e.index,s=e.groups;s.length===0&&(s=[{start:0,count:o.count,materialIndex:0}]);for(let e=0,c=s.length;e<c;++e){let c=s[e],l=c.start,u=c.count;for(let e=l,s=l+u;e<s;e+=3)for(let s=0;s<3;s++){let c=o.getX(e+s),l=o.getX(e+(s+1)%3);r.fromBufferAttribute(a,c),i.fromBufferAttribute(a,l),Cd(r,i,n)===!0&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{let a=e.attributes.position;for(let e=0,o=a.count/3;e<o;e++)for(let o=0;o<3;o++){let s=3*e+o,c=3*e+(o+1)%3;r.fromBufferAttribute(a,s),i.fromBufferAttribute(a,c),Cd(r,i,n)===!0&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute(`position`,new Pl(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}};function Cd(e,t,n){let r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return n.has(r)===!0||n.has(i)===!0?!1:(n.add(r),n.add(i),!0)}function wd(e){let t={};for(let n in e){t[n]={};for(let r in e[n]){let i=e[n][r];if(Ed(i))i.isRenderTargetTexture?(cs(`UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().`),t[n][r]=null):t[n][r]=i.clone();else if(Array.isArray(i))if(Ed(i[0])){let e=[];for(let t=0,n=i.length;t<n;t++)e[t]=i[t].clone();t[n][r]=e}else t[n][r]=i.slice();else t[n][r]=i}}return t}function Td(e){let t={};for(let n=0;n<e.length;n++){let r=wd(e[n]);for(let e in r)t[e]=r[e]}return t}function Ed(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function Dd(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}function Od(e){let t=e.getRenderTarget();return t===null?e.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Ys.workingColorSpace}var kd={clone:wd,merge:Td},Ad=`void main() {
|
|
1
|
+
import{$ as e,A as t,At as n,B as r,C as i,Dt as a,E as o,F as s,Ft as c,G as l,H as u,It as d,J as f,K as p,L as m,Lt as h,M as g,N as _,P as v,Pt as y,Q as b,Rt as x,S,T as C,U as w,V as T,W as E,X as D,Y as O,_t as k,a as A,at as j,bt as ee,c as M,dt as N,f as P,ft as te,g as ne,gt as F,h as re,it as I,j as ie,jt as ae,k as L,kt as R,lt as z,m as oe,mt as B,n as se,nt as ce,o as V,ot as le,q as ue,r as de,s as H,ut as U,v as fe,vt as pe,w as W,yt as G,z as K,zt as me}from"../chunks/Cke4knuE.js";import"../chunks/xihTtKlq.js";import{c as q,s as he,t as J}from"../chunks/DTG79Uyf.js";import{i as ge,r as _e}from"../chunks/B2lr8IYb.js";import{C as ve,E as ye,d as be,n as xe,o as Se,p as Ce,r as we,s as Te,t as Ee,u as De,y as Y}from"../chunks/BWkyPB3e.js";import{n as Oe,t as ke}from"../chunks/DSGwkBAQ.js";import{a as Ae,c as je,d as Me,f as Ne,h as Pe,i as Fe,l as Ie,m as Le,n as Re,o as ze,p as Be,r as Ve,s as He,t as Ue,u as We}from"../chunks/QnE7Zhsu.js";import{t as Ge}from"../chunks/5o828efA.js";import{t as Ke}from"../chunks/DryGTRV9.js";import{t as qe}from"../chunks/VJTh542u.js";import{t as Je}from"../chunks/DX2MELJa.js";import{t as Ye}from"../chunks/CNcd_3er.js";import{t as Xe}from"../chunks/f9BZlcKm.js";import{t as Ze}from"../chunks/_YFjRYrV.js";import{n as Qe,r as $e,t as et}from"../chunks/0lP-Rpma.js";import{i as tt,n as nt,r as rt,t as it}from"../chunks/BzEuycjW.js";import{t as at}from"../chunks/CAB-AK4E.js";import{t as ot}from"../chunks/gu4X15yF.js";import{t as st}from"../chunks/CjPXNCS7.js";import{t as ct}from"../chunks/BOS-wpIV.js";import{t as lt}from"../chunks/Dz00jH5u.js";import{D as ut,E as dt,O as ft,a as pt,d as mt,f as ht,o as gt,p as _t,t as vt,u as yt,v as bt,w as xt}from"../chunks/B50OBSAG.js";import{a as St,c as Ct,d as wt,i as Tt,l as Et,n as Dt,o as Ot,r as kt,s as At,t as jt,u as Mt}from"../chunks/CzAXFvH8.js";import{D as Nt,M as Pt,O as Ft,T as It,c as Lt,d as Rt,f as zt,h as Bt,k as Vt,l as Ht,m as Ut,n as Wt,p as Gt,s as Kt,u as qt,w as Jt,x as Yt}from"../chunks/B1oMYNg6.js";import{a as Xt,i as Zt,n as Qt,r as $t,t as en}from"../chunks/CWlCxbnY.js";import{t as tn}from"../chunks/C2ulfLBp.js";import{a as nn,i as rn,n as an,r as on,t as sn}from"../chunks/E0FrUJ1t.js";import{t as cn}from"../chunks/CR6AN07v.js";import{n as ln,t as un}from"../chunks/DJq7n-sf.js";import{t as dn}from"../chunks/KXvDoa1V.js";import{n as fn,t as pn}from"../chunks/sPP9TUD-.js";import{t as mn}from"../chunks/D3p1tqid.js";import{t as hn}from"../chunks/DqR8kuM62.js";import{n as gn}from"../chunks/C57linrd2.js";var _n=new Set([`$$slots`,`$$events`,`$$legacy`]);function vn(e,t){let n=V(t,_n),r=[[`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`}]];Oe(e,H({name:`box`},()=>n,{get iconNode(){return r}}))}var yn=new Set([`$$slots`,`$$events`,`$$legacy`]);function bn(e,t){let n=V(t,yn),r=[[`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`}]];Oe(e,H({name:`camera`},()=>n,{get iconNode(){return r}}))}var xn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Sn(e,t){let n=V(t,xn),r=[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`}],[`path`,{d:`m9 11 3 3L22 4`}]];Oe(e,H({name:`circle-check-big`},()=>n,{get iconNode(){return r}}))}var Cn=new Set([`$$slots`,`$$events`,`$$legacy`]);function wn(e,t){let n=V(t,Cn),r=[[`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`}]];Oe(e,H({name:`circle-question-mark`},()=>n,{get iconNode(){return r}}))}var Tn=new Set([`$$slots`,`$$events`,`$$legacy`]);function En(e,t){let n=V(t,Tn),r=[[`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`}]];Oe(e,H({name:`download`},()=>n,{get iconNode(){return r}}))}var Dn=new Set([`$$slots`,`$$events`,`$$legacy`]);function On(e,t){let n=V(t,Dn),r=[[`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`}]];Oe(e,H({name:`eye-off`},()=>n,{get iconNode(){return r}}))}var kn=new Set([`$$slots`,`$$events`,`$$legacy`]);function An(e,t){let n=V(t,kn),r=[[`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`}]];Oe(e,H({name:`eye`},()=>n,{get iconNode(){return r}}))}var jn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Mn(e,t){let n=V(t,jn),r=[[`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`}]];Oe(e,H({name:`file`},()=>n,{get iconNode(){return r}}))}var Nn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Pn(e,t){let n=V(t,Nn),r=[[`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`}]];Oe(e,H({name:`folder`},()=>n,{get iconNode(){return r}}))}var Fn=new Set([`$$slots`,`$$events`,`$$legacy`]);function In(e,t){let n=V(t,Fn),r=[[`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`}]];Oe(e,H({name:`frame`},()=>n,{get iconNode(){return r}}))}var Ln=new Set([`$$slots`,`$$events`,`$$legacy`]);function Rn(e,t){let n=V(t,Ln),r=[[`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`}]];Oe(e,H({name:`grid-3x3`},()=>n,{get iconNode(){return r}}))}var zn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Bn(e,t){let n=V(t,zn),r=[[`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`}]];Oe(e,H({name:`inbox`},()=>n,{get iconNode(){return r}}))}var Vn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Hn(e,t){let n=V(t,Vn),r=[[`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`}]];Oe(e,H({name:`layers`},()=>n,{get iconNode(){return r}}))}var Un=new Set([`$$slots`,`$$events`,`$$legacy`]);function Wn(e,t){let n=V(t,Un),r=[[`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`}]];Oe(e,H({name:`link`},()=>n,{get iconNode(){return r}}))}var Gn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Kn(e,t){let n=V(t,Gn),r=[[`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`}]];Oe(e,H({name:`loader`},()=>n,{get iconNode(){return r}}))}var qn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Jn(e,t){let n=V(t,qn),r=[[`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`}]];Oe(e,H({name:`maximize`},()=>n,{get iconNode(){return r}}))}var Yn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Xn(e,t){let n=V(t,Yn),r=[[`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`}]];Oe(e,H({name:`minimize`},()=>n,{get iconNode(){return r}}))}var Zn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Qn(e,t){let n=V(t,Zn),r=[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]];Oe(e,H({name:`palette`},()=>n,{get iconNode(){return r}}))}var $n=new Set([`$$slots`,`$$events`,`$$legacy`]);function er(e,t){let n=V(t,$n),r=[[`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`}]];Oe(e,H({name:`ruler`},()=>n,{get iconNode(){return r}}))}var tr=new Set([`$$slots`,`$$events`,`$$legacy`]);function nr(e,t){let n=V(t,tr),r=[[`path`,{d:`M14 17H5`}],[`path`,{d:`M19 7h-9`}],[`circle`,{cx:`17`,cy:`17`,r:`3`}],[`circle`,{cx:`7`,cy:`7`,r:`3`}]];Oe(e,H({name:`settings-2`},()=>n,{get iconNode(){return r}}))}var rr=new Set([`$$slots`,`$$events`,`$$legacy`]);function ir(e,t){let n=V(t,rr),r=[[`circle`,{cx:`19`,cy:`5`,r:`2`}],[`circle`,{cx:`5`,cy:`19`,r:`2`}],[`path`,{d:`M5 17A12 12 0 0 1 17 5`}]];Oe(e,H({name:`spline`},()=>n,{get iconNode(){return r}}))}var ar=new Set([`$$slots`,`$$events`,`$$legacy`]);function or(e,t){let n=V(t,ar),r=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}]];Oe(e,H({name:`square`},()=>n,{get iconNode(){return r}}))}var sr=new Set([`$$slots`,`$$events`,`$$legacy`]);function cr(e,t){let n=V(t,sr),r=[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`}]];Oe(e,H({name:`zap`},()=>n,{get iconNode(){return r}}))}var lr=Se({component:`checkbox`,parts:[`root`,`group`,`group-label`,`input`]}),ur=new ft(`Checkbox.Group`),dr=new ft(`Checkbox.Root`),fr=class e{static create(t,n=null){return dr.set(new e(t,n))}opts;group;#e=G(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.opts.name.current);get trueName(){return D(this.#e)}set trueName(e){B(this.#e,e)}#t=G(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return D(this.#t)}set trueRequired(e){B(this.#t,e)}#n=G(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return D(this.#n)}set trueDisabled(e){B(this.#n,e)}#r=G(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return D(this.#r)}set trueReadonly(e){B(this.#r,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=De(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),dt.pre([()=>y(this.group?.opts.value.current),()=>this.opts.value.current],([e,t])=>{!e||!t||(this.opts.checked.current=e.includes(t))}),dt.pre(()=>this.opts.checked.current,e=>{this.group&&(e?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===`Enter`){e.preventDefault(),this.opts.type.current===`submit`&&e.currentTarget.closest(`form`)?.requestSubmit();return}e.key===` `&&(e.preventDefault(),this.#i())}}#i(){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.#i();return}e.preventDefault(),this.#i()}}#a=G(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return D(this.#a)}set snippetProps(e){B(this.#a,e)}#o=G(()=>({id:this.opts.id.current,role:`checkbox`,type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":Te(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":we(this.trueRequired),"aria-readonly":we(this.trueReadonly),"data-disabled":xe(this.trueDisabled),"data-readonly":xe(this.trueReadonly),"data-state":mr(this.opts.checked.current,this.opts.indeterminate.current),[lr.root]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return D(this.#o)}set props(e){B(this.#o,e)}},pr=class e{static create(){return new e(dr.get())}root;#e=G(()=>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 D(this.#e)}set trueChecked(e){B(this.#e,e)}#t=G(()=>!!this.root.trueName);get shouldRender(){return D(this.#t)}set shouldRender(e){B(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){gt(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=G(()=>({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 D(this.#n)}set props(e){B(this.#n,e)}};function mr(e,t){return t?`indeterminate`:e?`checked`:`unchecked`}function hr(e,t){n(t,!0);let i=pr.create();var a=r(),o=U(a),c=e=>{Mt(e,H(()=>i.props))};s(o,e=>{i.shouldRender&&e(c)}),K(e,a),R()}var gr=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`ref`,`onCheckedChange`,`children`,`disabled`,`required`,`name`,`value`,`id`,`indeterminate`,`onIndeterminateChange`,`child`,`type`,`readonly`]),_r=T(`<button><!></button>`),vr=T(`<!> <!>`,1);function yr(e,i){let a=w();n(i,!0);let o=A(i,`checked`,15,!1),c=A(i,`ref`,15,null),l=A(i,`disabled`,3,!1),u=A(i,`required`,3,!1),f=A(i,`name`,3,void 0),p=A(i,`value`,3,`on`),m=A(i,`id`,19,()=>Ee(a)),h=A(i,`indeterminate`,15,!1),g=A(i,`type`,3,`button`),_=V(i,gr),v=ur.getOr(null);v&&p()&&(v.opts.value.current.includes(p())?o(!0):o(!1)),dt.pre(()=>p(),()=>{v&&p()&&(v.opts.value.current.includes(p())?o(!0):o(!1))});let y=fr.create({checked:Y(()=>o(),e=>{o(e),i.onCheckedChange?.(e)}),disabled:Y(()=>l()??!1),required:Y(()=>u()),name:Y(()=>f()),value:Y(()=>p()),id:Y(()=>m()),ref:Y(()=>c(),e=>c(e)),indeterminate:Y(()=>h(),e=>{h(e),i.onIndeterminateChange?.(e)}),type:Y(()=>g()),readonly:Y(()=>!!i.readonly)},v),b=G(()=>be({..._},y.props));var S=vr(),C=U(S),T=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(b),...y.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},E=e=>{var n=_r();oe(n,()=>({...D(b)}));var r=z(n);t(r,()=>i.children??x,()=>y.snippetProps),d(n),K(e,n)};s(C,e=>{i.child?e(T):e(E,-1)}),hr(N(C,2),{}),K(e,S),R()}function br(e,i){n(i,!0);let a=A(i,`open`,15,!1),o=A(i,`onOpenChange`,3,vt),s=A(i,`onOpenChangeComplete`,3,vt);Bt.create({open:Y(()=>a(),e=>{a(e),o()?.(e)}),onOpenChangeComplete:Y(()=>s())}),Ct(e,{children:(e,n)=>{var a=r(),o=U(a);t(o,()=>i.children??x),K(e,a)},$$slots:{default:!0}}),R()}var xr=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`ref`,`id`,`disabled`,`onSelect`,`closeOnSelect`]),Sr=T(`<div><!></div>`);function Cr(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=A(i,`disabled`,3,!1),u=A(i,`onSelect`,3,vt),f=A(i,`closeOnSelect`,3,!0),p=V(i,xr),m=Ht.create({id:Y(()=>c()),disabled:Y(()=>l()),onSelect:Y(()=>u()),ref:Y(()=>o(),e=>o(e)),closeOnSelect:Y(()=>f())}),h=G(()=>be(p,m.props));var g=r(),_=U(g),v=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(h)})),K(e,n)},y=e=>{var n=Sr();oe(n,()=>({...D(h)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(_,e=>{i.child?e(v):e(y,-1)}),K(e,g),R()}var wr=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`]),Tr=T(`<div><!></div>`);function Er(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=V(i,wr),u=Gt.create({id:Y(()=>c()),ref:Y(()=>o(),e=>o(e))}),f=G(()=>be(l,u.props));var p=r(),m=U(p),h=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(f)})),K(e,n)},g=e=>{var n=Tr();oe(n,()=>({...D(f)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(m,e=>{i.child?e(h):e(g,-1)}),K(e,p),R()}var Dr=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`children`,`child`,`loop`,`onInteractOutside`,`forceMount`,`onEscapeKeydown`,`interactOutsideBehavior`,`escapeKeydownBehavior`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onFocusOutside`,`side`,`trapFocus`,`style`]),Or=T(`<div><div><!></div></div>`);function kr(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`loop`,3,!0),u=A(i,`onInteractOutside`,3,vt),f=A(i,`forceMount`,3,!1),p=A(i,`onEscapeKeydown`,3,vt),m=A(i,`interactOutsideBehavior`,3,`defer-otherwise-close`),h=A(i,`escapeKeydownBehavior`,3,`defer-otherwise-close`),g=A(i,`onOpenAutoFocus`,3,vt),_=A(i,`onCloseAutoFocus`,3,vt),v=A(i,`onFocusOutside`,3,vt),y=A(i,`side`,3,`right`),b=A(i,`trapFocus`,3,!1),S=V(i,Dr),C=Lt.create({id:Y(()=>o()),loop:Y(()=>l()),ref:Y(()=>c(),e=>c(e)),isSub:!0,onCloseAutoFocus:Y(()=>j)});function T(e){let t=e.currentTarget.contains(e.target),n=Jt[C.parentMenu.root.opts.dir.current].includes(e.key);t&&n&&(C.parentMenu.onClose(),C.parentMenu.triggerNode?.focus(),e.preventDefault())}let E=G(()=>C.parentMenu.root.getBitsAttr(`sub-content`)),O=G(()=>be(S,C.props,{side:y(),onkeydown:T,[D(E)]:``}));function k(e){g()(e),!e.defaultPrevented&&(e.preventDefault(),C.parentMenu.root.isUsingKeyboard&&C.parentMenu.contentNode&&Rt.dispatch(C.parentMenu.contentNode))}function j(e){_()(e),!e.defaultPrevented&&e.preventDefault()}function ee(e){u()(e),!e.defaultPrevented&&C.parentMenu.onClose()}function M(e){p()(e),!e.defaultPrevented&&C.parentMenu.onClose()}function N(e){if(v()(e),e.defaultPrevented||!gt(e.target)||e.target.id===C.parentMenu.triggerNode?.id)return;if((C.parentMenu.parentMenu?.contentNode)?.contains(e.target)){C.parentMenu.onClose(),e.preventDefault();return}let t=`[${C.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t)){e.preventDefault();return}C.parentMenu.onClose()}var P=r(),te=U(P),ne=e=>{St(e,H(()=>D(O),{get ref(){return C.opts.ref},get interactOutsideBehavior(){return m()},get escapeKeydownBehavior(){return h()},onOpenAutoFocus:k,get enabled(){return C.parentMenu.opts.open.current},onInteractOutside:ee,onEscapeKeydown:M,onFocusOutside:N,preventScroll:!1,get loop(){return l()},get trapFocus(){return b()},get shouldRender(){return C.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),D(O),{style:Et(`menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),...C.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Or();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))},F=e=>{Ot(e,H(()=>D(O),{get ref(){return C.opts.ref},get interactOutsideBehavior(){return m()},get escapeKeydownBehavior(){return h()},onCloseAutoFocus:j,onOpenAutoFocus:k,get open(){return C.parentMenu.opts.open.current},onInteractOutside:ee,onEscapeKeydown:M,onFocusOutside:N,preventScroll:!1,get loop(){return l()},get trapFocus(){return b()},get shouldRender(){return C.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),D(O),{style:Et(`menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),...C.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Or();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))};s(te,e=>{f()?e(ne):f()||e(F,1)}),K(e,P),R()}var Ar=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`disabled`,`ref`,`children`,`child`,`onSelect`,`openDelay`]),jr=T(`<div><!></div>`);function Mr(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`disabled`,3,!1),l=A(i,`ref`,15,null),u=A(i,`onSelect`,3,vt),f=A(i,`openDelay`,3,0),p=V(i,Ar),m=Ut.create({disabled:Y(()=>c()),onSelect:Y(()=>u()),id:Y(()=>o()),ref:Y(()=>l(),e=>l(e)),openDelay:Y(()=>f())}),h=G(()=>be(p,m.props));At(e,{get id(){return o()},get ref(){return m.opts.ref},children:(e,n)=>{var a=r(),o=U(a),c=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(h)})),K(e,n)},l=e=>{var n=jr();oe(n,()=>({...D(h)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(o,e=>{i.child?e(c):e(l,-1)}),K(e,a)},$$slots:{default:!0}}),R()}function Nr(e,i){n(i,!0);let a=A(i,`open`,15,!1),o=A(i,`dir`,3,`ltr`),s=A(i,`onOpenChange`,3,vt),c=A(i,`onOpenChangeComplete`,3,vt),l=A(i,`_internal_variant`,3,`dropdown-menu`),u=A(i,`_internal_should_skip_exit_animation`,3,void 0),d=zt.create({variant:Y(()=>l()),dir:Y(()=>o()),onClose:()=>{a(!1),s()(!1)},shouldSkipExitAnimation:()=>u()?.()??!1});qt.create({open:Y(()=>a(),e=>{a(e),s()(e)}),onOpenChangeComplete:Y(()=>c())},d),Ct(e,{children:(e,n)=>{var a=r(),o=U(a);t(o,()=>i.children??x),K(e,a)},$$slots:{default:!0}}),R()}var Pr=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`child`,`children`,`ref`,`loop`,`onInteractOutside`,`onEscapeKeydown`,`onCloseAutoFocus`,`forceMount`,`trapFocus`,`style`]),Fr=T(`<div><div><!></div></div>`);function Ir(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`loop`,3,!0),u=A(i,`onInteractOutside`,3,vt),f=A(i,`onEscapeKeydown`,3,vt),p=A(i,`onCloseAutoFocus`,3,vt),m=A(i,`forceMount`,3,!1),h=A(i,`trapFocus`,3,!1),g=V(i,Pr),_=Lt.create({id:Y(()=>o()),loop:Y(()=>l()),ref:Y(()=>c(),e=>c(e)),onCloseAutoFocus:Y(()=>p())}),v=G(()=>be(g,_.props));function y(e){if(_.handleInteractOutside(e),!e.defaultPrevented&&(u()(e),!e.defaultPrevented)){if(e.target&&e.target instanceof Element){let t=`[${_.parentMenu.root.getBitsAttr(`sub-content`)}]`;if(e.target.closest(t))return}_.parentMenu.onClose()}}function b(e){f()(e),!e.defaultPrevented&&_.parentMenu.onClose()}var S=r(),C=U(S),T=e=>{St(e,H(()=>D(v),()=>_.popperProps,{get ref(){return _.opts.ref},get enabled(){return _.parentMenu.opts.open.current},onInteractOutside:y,onEscapeKeydown:b,get trapFocus(){return h()},get loop(){return l()},forceMount:!0,get id(){return o()},get shouldRender(){return _.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),{style:Et(`dropdown-menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),..._.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Fr();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))},E=e=>{Ot(e,H(()=>D(v),()=>_.popperProps,{get ref(){return _.opts.ref},get open(){return _.parentMenu.opts.open.current},onInteractOutside:y,onEscapeKeydown:b,get trapFocus(){return h()},get loop(){return l()},forceMount:!1,get id(){return o()},get shouldRender(){return _.shouldRender},popper:(e,n)=>{let a=()=>(n?.()).props,o=()=>(n?.()).wrapperProps,c=G(()=>be(a(),{style:Et(`dropdown-menu`)},{style:i.style}));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(c),wrapperProps:o(),..._.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},p=e=>{var n=Fr();oe(n,()=>({...o()}));var r=z(n);oe(r,()=>({...D(c)}));var a=z(r);t(a,()=>i.children??x),d(r),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l)},$$slots:{popper:!0}}))};s(C,e=>{m()?e(T):m()||e(E,1)}),K(e,S),R()}var Lr=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`disabled`,`type`]),Rr=T(`<button><!></button>`);function zr(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`disabled`,3,!1),u=A(i,`type`,3,`button`),f=V(i,Lr),p=Kt.create({id:Y(()=>o()),disabled:Y(()=>l()??!1),ref:Y(()=>c(),e=>c(e))}),m=G(()=>be(f,p.props,{type:u()}));At(e,{get id(){return o()},get ref(){return p.opts.ref},children:(e,n)=>{var a=r(),o=U(a),c=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(m)})),K(e,n)},l=e=>{var n=Rr();oe(n,()=>({...D(m)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(o,e=>{i.child?e(c):e(l,-1)}),K(e,a)},$$slots:{default:!0}}),R()}var Br=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),j(this.handler)}handler(){let e=0,t=this.#e();if(!t)return;let n=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return n.observe(t),()=>{window.cancelAnimationFrame(e),n.unobserve(t)}}},Vr=class{opts;present;#e;#t=F(!1);#n=!1;#r=F(void 0);#i=null;constructor(e){this.opts=e,this.present=this.opts.open,B(this.#t,e.open.current,!0),this.#e=new Nt({ref:this.opts.ref,afterTick:this.opts.open}),Pt(()=>this.#o()),dt(()=>this.present.current,e=>{if(!this.#n){this.#n=!0;return}this.#o(),e&&B(this.#t,!0),B(this.#r,e?`starting`:`ending`,!0),e&&(this.#i=window.requestAnimationFrame(()=>{this.#i=null,this.present.current&&B(this.#r,void 0)})),this.#e.run(()=>{e===this.present.current&&(e||B(this.#t,!1),B(this.#r,void 0))})})}#a=G(()=>D(this.#t));get isPresent(){return D(this.#a)}set isPresent(e){B(this.#a,e)}get transitionStatus(){return D(this.#r)}#o(){this.#i!==null&&(window.cancelAnimationFrame(this.#i),this.#i=null)}};function Hr(e,i){n(i,!0);let a=new Vr({open:Y(()=>i.open),ref:i.ref});var o=r(),c=U(o),l=e=>{var n=r(),o=U(n);t(o,()=>i.presence??x,()=>({present:a.isPresent,transitionStatus:a.transitionStatus})),K(e,n)};s(c,e=>{(i.forceMount||i.open||a.isPresent)&&e(l)}),K(e,o),R()}function Ur(e,t,n){return Math.min(n,Math.max(t,e))}var Wr=class{state;#e;constructor(e,t){this.state=ve(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)}},Gr=Se({component:`scroll-area`,parts:[`root`,`viewport`,`corner`,`thumb`,`scrollbar`]}),Kr=new ft(`ScrollArea.Root`),qr=new ft(`ScrollArea.Scrollbar`),Jr=new ft(`ScrollArea.ScrollbarVisible`),Yr=new ft(`ScrollArea.ScrollbarAxis`),Xr=new ft(`ScrollArea.ScrollbarShared`),Zr=class e{static create(t){return Kr.set(new e(t))}opts;attachment;#e=F(null);get scrollAreaNode(){return D(this.#e)}set scrollAreaNode(e){B(this.#e,e,!0)}#t=F(null);get viewportNode(){return D(this.#t)}set viewportNode(e){B(this.#t,e,!0)}#n=F(null);get contentNode(){return D(this.#n)}set contentNode(e){B(this.#n,e,!0)}#r=F(null);get scrollbarXNode(){return D(this.#r)}set scrollbarXNode(e){B(this.#r,e,!0)}#i=F(null);get scrollbarYNode(){return D(this.#i)}set scrollbarYNode(e){B(this.#i,e,!0)}#a=F(0);get cornerWidth(){return D(this.#a)}set cornerWidth(e){B(this.#a,e,!0)}#o=F(0);get cornerHeight(){return D(this.#o)}set cornerHeight(e){B(this.#o,e,!0)}#s=F(!1);get scrollbarXEnabled(){return D(this.#s)}set scrollbarXEnabled(e){B(this.#s,e,!0)}#c=F(!1);get scrollbarYEnabled(){return D(this.#c)}set scrollbarYEnabled(e){B(this.#c,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=De(e.ref,e=>this.scrollAreaNode=e),this.domContext=new Ft(e.ref)}#l=G(()=>({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`},[Gr.root]:``,...this.attachment}));get props(){return D(this.#l)}set props(e){B(this.#l,e)}},Qr=class e{static create(t){return new e(t,Kr.get())}opts;root;attachment;#e=ve(Wt());#t=ve(null);contentAttachment=De(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=De(e.ref,e=>this.root.viewportNode=e)}#n=G(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?`scroll`:`hidden`,overflowY:this.root.scrollbarYEnabled?`scroll`:`hidden`},[Gr.viewport]:``,...this.attachment}));get props(){return D(this.#n)}set props(e){B(this.#n,e)}#r=G(()=>({id:this.#e.current,"data-scroll-area-content":``,style:{minWidth:this.root.scrollbarXEnabled?`fit-content`:void 0},...this.contentAttachment}));get contentProps(){return D(this.#r)}set contentProps(e){B(this.#r,e)}},$r=class e{static create(t){return qr.set(new e(t,Kr.get()))}opts;root;#e=G(()=>this.opts.orientation.current===`horizontal`);get isHorizontal(){return D(this.#e)}set isHorizontal(e){B(this.#e,e)}#t=F(!1);get hasThumb(){return D(this.#t)}set hasThumb(e){B(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,dt(()=>this.isHorizontal,e=>e?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}},ei=class t{static create(){return new t(qr.get())}scrollbar;root;#e=F(!1);get isVisible(){return D(this.#e)}set isVisible(e){B(this.#e,e,!0)}constructor(t){this.scrollbar=t,this.root=t.root,j(()=>{let t=this.root.scrollAreaNode,n=this.root.opts.scrollHideDelay.current,r=0;if(!t)return;let i=Ce(f(t,`pointerenter`,()=>{this.root.domContext.clearTimeout(r),e(()=>this.isVisible=!0)}),f(t,`pointerleave`,()=>{r&&this.root.domContext.clearTimeout(r),r=this.root.domContext.setTimeout(()=>{e(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},n)}));return()=>{this.root.domContext.getWindow().clearTimeout(r),i()}})}#t=G(()=>({"data-state":this.isVisible?`visible`:`hidden`}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},ti=class e{static create(){return new e(qr.get())}scrollbar;root;machine=new Wr(`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=G(()=>this.machine.state.current===`hidden`);get isHidden(){return D(this.#e)}set isHidden(e){B(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;let t=ut(()=>this.machine.dispatch(`SCROLL_END`),100);j(()=>{let e=this.machine.state.current,t=this.root.opts.scrollHideDelay.current;if(e===`idle`){let e=this.root.domContext.setTimeout(()=>this.machine.dispatch(`HIDE`),t);return()=>this.root.domContext.clearTimeout(e)}}),j(()=>{let e=this.root.viewportNode;if(!e)return;let n=this.scrollbar.isHorizontal?`scrollLeft`:`scrollTop`,r=e[n];return f(e,`scroll`,()=>{let i=e[n];r!==i&&(this.machine.dispatch(`SCROLL`),t()),r=i})}),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=G(()=>({"data-state":this.machine.state.current===`hidden`?`hidden`:`visible`,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},ni=class e{static create(){return new e(qr.get())}scrollbar;root;#e=F(!1);get isVisible(){return D(this.#e)}set isVisible(e){B(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;let t=ut(()=>{let e=this.root.viewportNode;if(!e)return;let t=e.offsetWidth<e.scrollWidth,n=e.offsetHeight<e.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?t:n},10);new Br(()=>this.root.viewportNode,t),new Br(()=>this.root.contentNode,t)}#t=G(()=>({"data-state":this.isVisible?`visible`:`hidden`}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},ri=class e{static create(){return Jr.set(new e(qr.get()))}scrollbar;root;#e=F(null);get thumbNode(){return D(this.#e)}set thumbNode(e){B(this.#e,e,!0)}#t=F(0);get pointerOffset(){return D(this.#t)}set pointerOffset(e){B(this.#t,e,!0)}#n=F({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return D(this.#n)}set sizes(e){B(this.#n,e)}#r=G(()=>ui(this.sizes.viewport,this.sizes.content));get thumbRatio(){return D(this.#r)}set thumbRatio(e){B(this.#r,e)}#i=G(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return D(this.#i)}set hasThumb(e){B(this.#i,e)}#a=F(``);get prevTransformStyle(){return D(this.#a)}set prevTransformStyle(e){B(this.#a,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,j(()=>{this.scrollbar.hasThumb=this.hasThumb}),j(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return fi({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;let e=this.root.viewportNode.scrollLeft,t=`translate3d(${pi({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=t,this.prevTransformStyle=t}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;let e=this.root.viewportNode.scrollTop,t=`translate3d(0, ${pi({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=t,this.prevTransformStyle=t}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))}},ii=class e{static create(t){return Yr.set(new e(t,Jr.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=F();get computedStyle(){return D(this.#e)}set computedStyle(e){B(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=De(this.scrollbar.opts.ref,e=>this.root.scrollbarXNode=e),j(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),j(()=>{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;let n=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(n),hi(n,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:li(this.computedStyle.paddingLeft),paddingEnd:li(this.computedStyle.paddingRight)}})};#t=G(()=>di(this.scrollbarVis.sizes));get thumbSize(){return D(this.#t)}set thumbSize(e){B(this.#t,e)}#n=G(()=>({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 D(this.#n)}set props(e){B(this.#n,e)}},ai=class e{static create(t){return Yr.set(new e(t,Jr.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=F();get computedStyle(){return D(this.#e)}set computedStyle(e){B(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=De(this.scrollbar.opts.ref,e=>this.root.scrollbarYNode=e),j(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),j(()=>{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;let n=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(n),hi(n,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:li(this.computedStyle.paddingTop),paddingEnd:li(this.computedStyle.paddingBottom)}})}#t=G(()=>di(this.scrollbarVis.sizes));get thumbSize(){return D(this.#t)}set thumbSize(e){B(this.#t,e)}#n=G(()=>({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 D(this.#n)}set props(e){B(this.#n,e)}},oi=class t{static create(){return Xr.set(new t(Yr.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=F(null);get rect(){return D(this.#e)}set rect(e){B(this.#e,e)}#t=F(``);get prevWebkitUserSelect(){return D(this.#t)}set prevWebkitUserSelect(e){B(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#n=G(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return D(this.#n)}set maxScrollPos(e){B(this.#n,e)}constructor(t){this.scrollbarState=t,this.root=t.root,this.scrollbarVis=t.scrollbarVis,this.scrollbar=t.scrollbarVis.scrollbar,this.handleResize=ut(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,j(()=>{let e=this.maxScrollPos,t=this.scrollbar.opts.ref.current;return this.root.viewportNode,f(this.root.domContext.getDocument(),`wheel`,n=>{let r=n.target;t?.contains(r)&&this.handleWheelScroll(n,e)},{passive:!1})}),le(()=>{this.scrollbarVis.sizes,e(()=>this.handleThumbPositionChange())}),new Br(()=>this.scrollbar.opts.ref.current,this.handleResize),new Br(()=>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;let t=e.clientX-this.rect.left,n=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:n})}#r(){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){e.button===0&&(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){let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.#r()}onlostpointercapture(e){this.#r()}#i=G(()=>be({...this.scrollbarState.props,style:{position:`absolute`,...this.scrollbarState.props.style},[Gr.scrollbar]:``,onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return D(this.#i)}set props(e){B(this.#i,e)}},si=class t{static create(e){return new t(e,Xr.get())}opts;scrollbarState;attachment;#e;#t=F();#n=ut(()=>{D(this.#t)&&(D(this.#t)(),B(this.#t,void 0))},100);constructor(t,n){this.opts=t,this.scrollbarState=n,this.#e=n.root,this.attachment=De(this.opts.ref,e=>this.scrollbarState.scrollbarVis.thumbNode=e),j(()=>{let t=this.#e.viewportNode;return t?(e(()=>this.scrollbarState.handleThumbPositionChange()),f(t,`scroll`,()=>{if(this.#n(),!D(this.#t)){let e=gi(t,this.scrollbarState.handleThumbPositionChange);B(this.#t,e,!0),this.scrollbarState.handleThumbPositionChange()}})):void 0}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){let t=e.target;if(!t)return;let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top;this.scrollbarState.handleThumbPointerDown({x:r,y:i})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#r=G(()=>({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,[Gr.thumb]:``,...this.attachment}));get props(){return D(this.#r)}set props(e){B(this.#r,e)}},ci=class e{static create(t){return new e(t,Kr.get())}opts;root;attachment;#e=F(0);#t=F(0);#n=G(()=>!!(D(this.#e)&&D(this.#t)));get hasSize(){return D(this.#n)}set hasSize(e){B(this.#n,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=De(this.opts.ref),new Br(()=>this.root.scrollbarXNode,()=>{let e=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=e,B(this.#t,e,!0)}),new Br(()=>this.root.scrollbarYNode,()=>{let e=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=e,B(this.#e,e,!0)})}#r=G(()=>({id:this.opts.id.current,style:{width:D(this.#e),height:D(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},[Gr.corner]:``,...this.attachment}));get props(){return D(this.#r)}set props(e){B(this.#r,e)}};function li(e){return e?Number.parseInt(e,10):0}function ui(e,t){let n=e/t;return Number.isNaN(n)?0:n}function di(e){let t=ui(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function fi({pointerPos:e,pointerOffset:t,sizes:n,dir:r=`ltr`}){let i=di(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return mi([c,l],d)(e)}function pi({scrollPos:e,sizes:t,dir:n=`ltr`}){let r=di(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=n===`ltr`?[0,o]:[o*-1,0],l=Ur(e,c[0],c[1]);return mi([0,o],[0,s])(l)}function mi(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function hi(e,t){return e>0&&e<t}function gi(e,t){let n={left:e.scrollLeft,top:e.scrollTop},r=0,i=Vt(e);return(function a(){let o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,c=n.top!==o.top;(s||c)&&t(),n=o,r=i.requestAnimationFrame(a)})(),()=>i.cancelAnimationFrame(r)}var _i=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`type`,`dir`,`scrollHideDelay`,`children`,`child`]),vi=T(`<div><!></div>`);function yi(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=A(i,`type`,3,`hover`),u=A(i,`dir`,3,`ltr`),f=A(i,`scrollHideDelay`,3,600),p=V(i,_i),m=Zr.create({type:Y(()=>l()),dir:Y(()=>u()),scrollHideDelay:Y(()=>f()),id:Y(()=>c()),ref:Y(()=>o(),e=>o(e))}),h=G(()=>be(p,m.props));var g=r(),_=U(g),v=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(h)})),K(e,n)},y=e=>{var n=vi();oe(n,()=>({...D(h)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(_,e=>{i.child?e(v):e(y,-1)}),K(e,g),R()}var bi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`children`]),xi=T(`<div><div><!></div></div>`);function Si(e,r){let i=w();n(r,!0);let a=A(r,`ref`,15,null),o=A(r,`id`,19,()=>Ee(i)),s=V(r,bi),c=Qr.create({id:Y(()=>o()),ref:Y(()=>a(),e=>a(e))}),l=G(()=>be(s,c.props)),u=G(()=>be({},c.contentProps));var f=xi();oe(f,()=>({...D(l)}));var p=z(f);oe(p,()=>({...D(u)}));var m=z(p);t(m,()=>r.children??x),d(p),d(f),K(e,f),R()}var Ci=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`]),wi=T(`<div><!></div>`);function Ti(e,i){n(i,!0);let a=V(i,Ci),o=oi.create(),c=G(()=>be(a,o.props));var l=r(),u=U(l),f=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(c)})),K(e,n)},p=e=>{var n=wi();oe(n,()=>({...D(c)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(u,e=>{i.child?e(f):e(p,-1)}),K(e,l),R()}var Ei=new Set([`$$slots`,`$$events`,`$$legacy`]);function Di(e,t){n(t,!0);let r=V(t,Ei),i=new xt,a=ii.create({mounted:Y(()=>i.current)}),o=G(()=>be(r,a.props));Ti(e,H(()=>D(o))),R()}var Oi=new Set([`$$slots`,`$$events`,`$$legacy`]);function ki(e,t){n(t,!0);let r=V(t,Oi),i=new xt,a=ai.create({mounted:Y(()=>i.current)}),o=G(()=>be(r,a.props));Ti(e,H(()=>D(o))),R()}var Ai=new Set([`$$slots`,`$$events`,`$$legacy`]);function ji(e,t){n(t,!0);let i=V(t,Ai),a=ri.create();var o=r(),c=U(o),l=e=>{Di(e,H(()=>i))},u=e=>{ki(e,H(()=>i))};s(c,e=>{a.scrollbar.opts.orientation.current===`horizontal`?e(l):e(u,-1)}),K(e,o),R()}var Mi=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Ni(e,t){n(t,!0);let r=A(t,`forceMount`,3,!1),i=V(t,Mi),a=ni.create(),o=G(()=>be(i,a.props));{let t=e=>{ji(e,H(()=>D(o)))},n=G(()=>r()||a.isVisible);Hr(e,{get open(){return D(n)},get ref(){return a.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}})}R()}var Pi=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Fi(e,t){n(t,!0);let r=A(t,`forceMount`,3,!1),i=V(t,Pi),a=ti.create(),o=G(()=>be(i,a.props));{let t=e=>{ji(e,H(()=>D(o)))},n=G(()=>r()||!a.isHidden);Hr(e,H(()=>D(o),{get open(){return D(n)},get ref(){return a.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}}))}R()}var Ii=new Set([`$$slots`,`$$events`,`$$legacy`,`forceMount`]);function Li(e,t){n(t,!0);let r=A(t,`forceMount`,3,!1),i=V(t,Ii),a=ei.create(),o=ni.create(),s=G(()=>be(i,a.props,o.props,{"data-state":a.isVisible?`visible`:`hidden`})),c=G(()=>r()||a.isVisible&&o.isVisible);Hr(e,{get open(){return D(c)},get ref(){return o.scrollbar.opts.ref},presence:e=>{ji(e,H(()=>D(s)))},$$slots:{presence:!0}}),R()}var Ri=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`orientation`]);function zi(e,t){let i=w();n(t,!0);let a=A(t,`ref`,15,null),o=A(t,`id`,19,()=>Ee(i)),c=V(t,Ri),l=$r.create({orientation:Y(()=>t.orientation),id:Y(()=>o()),ref:Y(()=>a(),e=>a(e))}),u=G(()=>l.root.opts.type.current);var d=r(),f=U(d),p=e=>{Li(e,H(()=>c,{get id(){return o()}}))},m=e=>{Fi(e,H(()=>c,{get id(){return o()}}))},h=e=>{Ni(e,H(()=>c,{get id(){return o()}}))},g=e=>{ji(e,H(()=>c,{get id(){return o()}}))};s(f,e=>{D(u)===`hover`?e(p):D(u)===`scroll`?e(m,1):D(u)===`auto`?e(h,2):D(u)===`always`&&e(g,3)}),K(e,d),R()}var Bi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`child`,`children`,`present`]),Vi=T(`<div><!></div>`);function Hi(e,i){n(i,!0);let a=A(i,`ref`,15,null),o=V(i,Bi),c=new xt,l=si.create({id:Y(()=>i.id),ref:Y(()=>a(),e=>a(e)),mounted:Y(()=>c.current)}),u=G(()=>be(o,l.props,{style:{hidden:!i.present}}));var f=r(),p=U(f),m=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(u)})),K(e,n)},h=e=>{var n=Vi();oe(n,()=>({...D(u)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(p,e=>{i.child?e(m):e(h,-1)}),K(e,f),R()}var Ui=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`forceMount`]);function Wi(e,t){let r=w();n(t,!0);let i=A(t,`id`,19,()=>Ee(r)),a=A(t,`ref`,15,null),o=A(t,`forceMount`,3,!1),s=V(t,Ui),c=Jr.get();{let t=(e,t)=>{let n=()=>(t?.()).present;Hi(e,H(()=>s,{get id(){return i()},get present(){return n()},get ref(){return a()},set ref(e){a(e)}}))},n=G(()=>o()||c.hasThumb);Hr(e,{get open(){return D(n)},get ref(){return c.scrollbar.opts.ref},presence:t,$$slots:{presence:!0}})}R()}var Gi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`,`children`,`child`]),Ki=T(`<div><!></div>`);function qi(e,i){n(i,!0);let a=A(i,`ref`,15,null),o=V(i,Gi),c=ci.create({id:Y(()=>i.id),ref:Y(()=>a(),e=>a(e))}),l=G(()=>be(o,c.props));var u=r(),f=U(u),p=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(l)})),K(e,n)},m=e=>{var n=Ki();oe(n,()=>({...D(l)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(f,e=>{i.child?e(p):e(m,-1)}),K(e,u),R()}var Ji=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`id`]);function Yi(e,t){let i=w();n(t,!0);let a=A(t,`ref`,15,null),o=A(t,`id`,19,()=>Ee(i)),c=V(t,Ji),l=Kr.get(),u=G(()=>!!(l.scrollbarXNode&&l.scrollbarYNode)),d=G(()=>l.opts.type.current!==`scroll`&&D(u));var f=r(),p=U(f),m=e=>{qi(e,H(()=>c,{get id(){return o()},get ref(){return a()},set ref(e){a(e)}}))};s(p,e=>{D(d)&&e(m)}),K(e,f),R()}function Xi(e,t,n){let r={position:`absolute`};return e===`lr`?(r.left=`${t}%`,r.right=`${n}%`):e===`rl`?(r.right=`${t}%`,r.left=`${n}%`):e===`bt`?(r.bottom=`${t}%`,r.top=`${n}%`):(r.top=`${t}%`,r.bottom=`${n}%`),r}function Zi(e,t){let n={position:`absolute`};return e===`lr`?(n.left=`${t}%`,n.translate=`-50% 0`):e===`rl`?(n.right=`${t}%`,n.translate=`50% 0`):e===`bt`?(n.bottom=`${t}%`,n.translate=`0 50%`):(n.top=`${t}%`,n.translate=`0 -50%`),n}function Qi(e,t,n){let r={position:`absolute`};return e===`lr`?(r.left=`${t}%`,r.translate=`${n}% 0`):e===`rl`?(r.right=`${t}%`,r.translate=`${-n}% 0`):e===`bt`?(r.bottom=`${t}%`,r.translate=`0 ${-n}%`):(r.top=`${t}%`,r.translate=`0 ${n}%`),r}function $i(e){if(Math.floor(e)===e)return 0;let t=e.toString();if(t.indexOf(`.`)!==-1&&t.indexOf(`e-`)===-1)return t.split(`.`)[1].length;if(t.indexOf(`e-`)!==-1){let e=t.split(`e-`);return parseInt(e[1],10)}return 0}function ea(e,t){let n=10**t;return Math.round(e*n)/n}function ta(e,t,n){if(typeof e==`number`){let r=n-t,i=Math.ceil(r/e),a=$i(e),o=10**a;Math.round(r*o)%Math.round(e*o)===0&&i++;let s=[];for(let n=0;n<i;n++){let r=ea(t+n*e,a);s.push(r)}return s}return[...new Set(e)].filter(e=>e>=t&&e<=n).sort((e,t)=>e-t)}function na(e,t){if(t.length===0)return e;let n=t[0],r=Math.abs(e-n);for(let i of t){let t=Math.abs(e-i);t<r&&(r=t,n=i)}return n}function ra(e,t,n){let r=t.indexOf(e);return r===-1?na(e,t):n===`next`?r<t.length-1?t[r+1]:e:r>0?t[r-1]:e}function ia(e,t,n=!0){let[r,i]=e,[a,o]=t,s=(o-a)/(i-r);return e=>{let t=a+s*(e-r);return n?t>Math.max(a,o)?Math.max(a,o):t<Math.min(a,o)?Math.min(a,o):t:t}}var aa=Se({component:`slider`,parts:[`root`,`thumb`,`range`,`tick`,`tick-label`,`thumb-label`]}),oa=new ft(`Slider.Root`),sa=class{opts;attachment;#e=F(!1);get isActive(){return D(this.#e)}set isActive(e){B(this.#e,e,!0)}#t=F(0);#n=G(()=>this.opts.orientation.current===`horizontal`?this.opts.dir.current===`rtl`?`rl`:`lr`:this.opts.dir.current===`rtl`?`tb`:`bt`);get direction(){return D(this.#n)}set direction(e){B(this.#n,e)}#r=G(()=>ta(this.opts.step.current,this.opts.min.current,this.opts.max.current));get normalizedSteps(){return D(this.#r)}set normalizedSteps(e){B(this.#r,e)}domContext;constructor(e){this.opts=e,this.attachment=De(e.ref),this.domContext=new Ft(this.opts.ref),new Br(()=>this.opts.ref.current,this.#i)}#i=()=>{B(this.#t,D(this.#t)+1)};isThumbActive(e){return this.isActive}#a=G(()=>{if(!this.opts.disabled.current)return this.opts.orientation.current===`horizontal`?`pan-y`:`pan-x`});getAllThumbs=()=>{let e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(aa.selector(`thumb`))):[]};getThumbScale=()=>{D(this.#t);let e=this.opts.trackPadding?.current;if(e!==void 0&&e>0)return[e,100-e];if(this.opts.thumbPositioning.current===`exact`)return[0,100];let t=this.opts.orientation.current===`vertical`,n=this.getAllThumbs()[0],r=t?n?.offsetHeight:n?.offsetWidth;if(r===void 0||Number.isNaN(r)||r===0)return[0,100];let i=t?this.opts.ref.current?.offsetHeight:this.opts.ref.current?.offsetWidth;if(i===void 0||Number.isNaN(i)||i===0)return[0,100];let a=r/2/i*100;return[a,100-a]};getPositionFromValue=e=>{let t=this.getThumbScale();return ia([this.opts.min.current,this.opts.max.current],t)(e)};#o=G(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,"data-disabled":xe(this.opts.disabled.current),style:{touchAction:D(this.#a)},[aa.root]:``,...this.attachment}));get props(){return D(this.#o)}set props(e){B(this.#o,e)}},ca=class extends sa{opts;isMulti=!1;constructor(e){super(e),this.opts=e,wt(()=>Ce(f(this.domContext.getDocument(),`pointerdown`,this.handlePointerDown),f(this.domContext.getDocument(),`pointerup`,this.handlePointerUp),f(this.domContext.getDocument(),`pointermove`,this.handlePointerMove),f(this.domContext.getDocument(),`pointerleave`,this.handlePointerUp))),dt([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([e,t,n,r])=>{let i=ta(e,t,n),a=e=>i.includes(e),o=e=>na(e,i);a(r)||(this.opts.value.current=o(r))})}isTickValueSelected=e=>this.opts.value.current===e;applyPosition({clientXY:e,start:t,end:n}){let r=this.opts.min.current,i=this.opts.max.current,a=(e-t)/(n-t)*(i-r)+r;if(a<r)this.updateValue(r);else if(a>i)this.updateValue(i);else{let e=this.normalizedSteps,t=na(a,e);this.updateValue(t)}}updateValue=e=>{this.opts.value.current=na(e,this.normalizedSteps)};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();let t=this.opts.ref.current,n=this.getAllThumbs()[0];if(!t||!n)return;n.focus();let{left:r,right:i,top:a,bottom:o}=t.getBoundingClientRect();this.direction===`lr`?this.applyPosition({clientXY:e.clientX,start:r,end:i}):this.direction===`rl`?this.applyPosition({clientXY:e.clientX,start:i,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;let t=this.opts.ref.current,n=this.getAllThumbs()[0];if(!n||!t)return;let r=e.composedPath()[0]??e.target;!pt(r)||!t.contains(r)||(e.preventDefault(),n.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(e(()=>this.opts.value.current)),this.isActive=!1)};#e=G(()=>{let e=this.opts.value.current;return Array.from({length:1},()=>{let t=e,n=this.getPositionFromValue(t),r=Zi(this.direction,n);return{role:`slider`,"aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":t,"aria-disabled":we(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":t,"data-orientation":this.opts.orientation.current,style:r,[aa.thumb]:``}})});get thumbsPropsArr(){return D(this.#e)}set thumbsPropsArr(e){B(this.#e,e)}#t=G(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return D(this.#t)}set thumbsRenderArr(e){B(this.#t,e)}#n=G(()=>{let e=this.normalizedSteps,t=this.opts.value.current;return e.map((n,r)=>{let i=this.getPositionFromValue(n),a=r===0,o=r===e.length-1,s=a?0:o?-100:-50,c=Qi(this.direction,i,s),l=n<=t;return{"data-disabled":xe(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":l?``:void 0,"data-value":n,"data-selected":this.isTickValueSelected(n)?``:void 0,style:c,[aa.tick]:``}})});get ticksPropsArr(){return D(this.#n)}set ticksPropsArr(e){B(this.#n,e)}#r=G(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return D(this.#r)}set ticksRenderArr(e){B(this.#r,e)}#i=G(()=>this.ticksPropsArr.map((e,t)=>({value:e[`data-value`],index:t})));get tickItemsArr(){return D(this.#i)}set tickItemsArr(e){B(this.#i,e)}#a=G(()=>[{value:this.opts.value.current,index:0}]);get thumbItemsArr(){return D(this.#a)}set thumbItemsArr(e){B(this.#a,e)}#o=G(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return D(this.#o)}set snippetProps(e){B(this.#o,e)}},la=class extends sa{opts;isMulti=!0;#e=F(null);get activeThumb(){return D(this.#e)}set activeThumb(e){B(this.#e,e,!0)}#t=F(0);get currentThumbIdx(){return D(this.#t)}set currentThumbIdx(e){B(this.#t,e,!0)}constructor(e){super(e),this.opts=e,wt(()=>Ce(f(this.domContext.getDocument(),`pointerdown`,this.handlePointerDown),f(this.domContext.getDocument(),`pointerup`,this.handlePointerUp),f(this.domContext.getDocument(),`pointermove`,this.handlePointerMove),f(this.domContext.getDocument(),`pointerleave`,this.handlePointerUp))),dt([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([e,t,n,r])=>{let i=ta(e,t,n),a=e=>i.includes(e),o=e=>na(e,i);r.some(e=>!a(e))&&(this.opts.value.current=r.map(o))})}isTickValueSelected=e=>this.opts.value.current.includes(e);isThumbActive(e){return this.isActive&&this.activeThumb?.idx===e}applyPosition({clientXY:e,activeThumbIdx:t,start:n,end:r}){let i=this.opts.min.current,a=this.opts.max.current,o=(e-n)/(r-n)*(a-i)+i;if(o<i)this.updateValue(i,t);else if(o>a)this.updateValue(a,t);else{let e=this.normalizedSteps,n=na(o,e);this.updateValue(n,t)}}#n=e=>{let t=this.getAllThumbs();if(!t.length)return;for(let e of t)e.blur();let n=t.map(t=>{if(this.opts.orientation.current===`horizontal`){let{left:n,right:r}=t.getBoundingClientRect();return Math.abs(e.clientX-(n+r)/2)}{let{top:n,bottom:r}=t.getBoundingClientRect();return Math.abs(e.clientY-(n+r)/2)}}),r=t[n.indexOf(Math.min(...n))];return{node:r,idx:t.indexOf(r)}};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();let t=this.opts.ref.current,n=this.activeThumb;if(!t||!n)return;n.node.focus();let{left:r,right:i,top:a,bottom:o}=t.getBoundingClientRect(),s=this.direction;s===`lr`?this.applyPosition({clientXY:e.clientX,activeThumbIdx:n.idx,start:r,end:i}):s===`rl`?this.applyPosition({clientXY:e.clientX,activeThumbIdx:n.idx,start:i,end:r}):s===`bt`?this.applyPosition({clientXY:e.clientY,activeThumbIdx:n.idx,start:o,end:a}):s===`tb`&&this.applyPosition({clientXY:e.clientY,activeThumbIdx:n.idx,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;let t=this.opts.ref.current,n=this.#n(e);if(!n||!t)return;let r=e.composedPath()[0]??e.target;!pt(r)||!t.contains(r)||(e.preventDefault(),this.activeThumb=n,n.node.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(e(()=>this.opts.value.current)),this.isActive=!1)};getAllThumbs=()=>{let e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(aa.selector(`thumb`))):[]};updateValue=(e,t)=>{let n=this.opts.value.current;if(!n.length){this.opts.value.current.push(e);return}if(n[t]===e)return;let r=[...n];if(!Yt(t,r))return;let i=r[t]>e?-1:1,a=()=>{let n=t+i;r[t]=r[n],r[n]=e;let a=this.getAllThumbs();a.length&&(a[n]?.focus(),this.activeThumb={node:a[n],idx:n})};if(this.opts.autoSort.current&&(i===-1&&e<r[t-1]||i===1&&e>r[t+1])){a(),this.opts.value.current=r;return}let o=this.normalizedSteps;r[t]=na(e,o),this.opts.value.current=r};#r=G(()=>{let t=this.opts.value.current;return Array.from({length:t.length||1},(n,r)=>{let i=e(()=>this.currentThumbIdx);i<t.length&&e(()=>{this.currentThumbIdx=i+1});let a=t[r],o=this.getPositionFromValue(a??0),s=Zi(this.direction,o);return{role:`slider`,"aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":a,"aria-disabled":we(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":a,"data-orientation":this.opts.orientation.current,style:s,[aa.thumb]:``}})});get thumbsPropsArr(){return D(this.#r)}set thumbsPropsArr(e){B(this.#r,e)}#i=G(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return D(this.#i)}set thumbsRenderArr(e){B(this.#i,e)}#a=G(()=>{let e=this.normalizedSteps,t=this.opts.value.current;return e.map((n,r)=>{let i=this.getPositionFromValue(n),a=r===0,o=r===e.length-1,s=a?0:o?-100:-50,c=Qi(this.direction,i,s),l=t.length===1?n<=t[0]:t[0]<=n&&n<=t[t.length-1];return{"data-disabled":xe(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":l?``:void 0,"data-value":n,style:c,[aa.tick]:``}})});get ticksPropsArr(){return D(this.#a)}set ticksPropsArr(e){B(this.#a,e)}#o=G(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return D(this.#o)}set ticksRenderArr(e){B(this.#o,e)}#s=G(()=>this.ticksPropsArr.map((e,t)=>({value:e[`data-value`],index:t})));get tickItemsArr(){return D(this.#s)}set tickItemsArr(e){B(this.#s,e)}#c=G(()=>this.opts.value.current.map((e,t)=>({value:e,index:t})));get thumbItemsArr(){return D(this.#c)}set thumbItemsArr(e){B(this.#c,e)}#l=G(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return D(this.#l)}set snippetProps(e){B(this.#l,e)}},ua=class{static create(e){let{type:t,...n}=e,r=t===`single`?new ca(n):new la(n);return oa.set(r)}},da=[mt,ht,_t,yt,bt,`End`],fa=class e{static create(t){return new e(t,oa.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=De(e.ref)}#e=G(()=>{if(Array.isArray(this.root.opts.value.current)){let 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`,...Xi(this.root.direction,e,t)}}{let e=this.root.opts.trackPadding?.current,t=this.root.opts.value.current,n=this.root.opts.max.current,r=e!==void 0&&e>0&&t===n?0:100-this.root.getPositionFromValue(t);return{position:`absolute`,...Xi(this.root.direction,0,r)}}});get rangeStyles(){return D(this.#e)}set rangeStyles(e){B(this.#e,e)}#t=G(()=>({id:this.opts.id.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":xe(this.root.opts.disabled.current),style:this.rangeStyles,[aa.range]:``,...this.attachment}));get props(){return D(this.#t)}set props(e){B(this.#t,e)}},pa=class e{static create(t){return new e(t,oa.get())}opts;root;attachment;#e=G(()=>this.root.opts.disabled.current||this.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=De(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(D(this.#e))return;let t=this.opts.ref.current;if(!t)return;let n=this.root.getAllThumbs();if(!n.length)return;let r=n.indexOf(t);if(this.root.isMulti&&(this.root.currentThumbIdx=r),!da.includes(e.key))return;e.preventDefault();let i=this.root.opts.min.current,a=this.root.opts.max.current,o=this.root.opts.value.current,s=Array.isArray(o)?o[r]:o,c=this.root.opts.orientation.current,l=this.root.direction,u=this.root.normalizedSteps;switch(e.key){case bt:this.#t(i);break;case`End`:this.#t(a);break;case mt:if(c!==`horizontal`)break;if(e.metaKey){let e=l===`rl`?a:i;this.#t(e)}else{let e=ra(s,u,l===`rl`?`next`:`prev`);this.#t(e)}break;case ht:if(c!==`horizontal`)break;if(e.metaKey){let e=l===`rl`?i:a;this.#t(e)}else{let e=ra(s,u,l===`rl`?`prev`:`next`);this.#t(e)}break;case _t:if(e.metaKey){let e=l===`tb`?i:a;this.#t(e)}else{let e=ra(s,u,l===`tb`?`prev`:`next`);this.#t(e)}break;case yt:if(e.metaKey){let e=l===`tb`?a:i;this.#t(e)}else{let e=ra(s,u,l===`tb`?`next`:`prev`);this.#t(e)}}this.root.opts.onValueCommit.current(this.root.opts.value.current)}#n=G(()=>({...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":xe(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 D(this.#n)}set props(e){B(this.#n,e)}},ma=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`value`,`type`,`onValueChange`,`onValueCommit`,`disabled`,`min`,`max`,`step`,`dir`,`autoSort`,`orientation`,`thumbPositioning`,`trackPadding`]),ha=T(`<span><!></span>`);function ga(e,i){let a=w();n(i,!0);let o=A(i,`id`,19,()=>Ee(a)),c=A(i,`ref`,15,null),l=A(i,`value`,15),u=A(i,`onValueChange`,3,vt),f=A(i,`onValueCommit`,3,vt),p=A(i,`disabled`,3,!1),m=A(i,`step`,3,1),h=A(i,`dir`,3,`ltr`),g=A(i,`autoSort`,3,!0),_=A(i,`orientation`,3,`horizontal`),v=A(i,`thumbPositioning`,3,`contain`),y=V(i,ma),b=G(()=>i.min===void 0?Array.isArray(m())?Math.min(...m()):0:i.min),S=G(()=>i.max===void 0?Array.isArray(m())?Math.max(...m()):100:i.max);function C(){if(l()===void 0)return i.type===`single`?D(b):[]}C(),dt.pre(()=>l(),()=>{C()});let T=ua.create({id:Y(()=>o()),ref:Y(()=>c(),e=>c(e)),value:Y(()=>l(),e=>{l(e),u()(e)}),onValueCommit:Y(()=>f()),disabled:Y(()=>p()),min:Y(()=>D(b)),max:Y(()=>D(S)),step:Y(()=>m()),dir:Y(()=>h()),autoSort:Y(()=>g()),orientation:Y(()=>_()),thumbPositioning:Y(()=>v()),type:i.type,trackPadding:Y(()=>i.trackPadding)}),E=G(()=>be(y,T.props));var O=r(),k=U(O),j=e=>{var n=r(),a=U(n);{let e=G(()=>({props:D(E),...T.snippetProps}));t(a,()=>i.child,()=>D(e))}K(e,n)},ee=e=>{var n=ha();oe(n,()=>({...D(E)}));var r=z(n);t(r,()=>i.children??x,()=>T.snippetProps),d(n),K(e,n)};s(k,e=>{i.child?e(j):e(ee,-1)}),K(e,O),R()}var _a=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),va=T(`<span><!></span>`);function ya(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=V(i,_a),u=fa.create({id:Y(()=>c()),ref:Y(()=>o(),e=>o(e))}),f=G(()=>be(l,u.props));var p=r(),m=U(p),h=e=>{var n=r(),a=U(n);t(a,()=>i.child,()=>({props:D(f)})),K(e,n)},g=e=>{var n=va();oe(n,()=>({...D(f)}));var r=z(n);t(r,()=>i.children??x),d(n),K(e,n)};s(m,e=>{i.child?e(h):e(g,-1)}),K(e,p),R()}var ba=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`,`index`,`disabled`]),xa=T(`<span><!></span>`);function Sa(e,i){let a=w();n(i,!0);let o=A(i,`ref`,15,null),c=A(i,`id`,19,()=>Ee(a)),l=A(i,`disabled`,3,!1),u=V(i,ba),f=pa.create({id:Y(()=>c()),ref:Y(()=>o(),e=>o(e)),index:Y(()=>i.index),disabled:Y(()=>l())}),p=G(()=>be(u,f.props));var m=r(),h=U(m),g=e=>{var n=r(),a=U(n);{let e=G(()=>({active:f.root.isThumbActive(f.opts.index.current),props:D(p)}));t(a,()=>i.child,()=>D(e))}K(e,n)},_=e=>{var n=xa();oe(n,()=>({...D(p)}));var r=z(n);{let e=G(()=>({active:f.root.isThumbActive(f.opts.index.current)}));t(r,()=>i.children??x,()=>D(e))}d(n),K(e,n)};s(h,e=>{i.child?e(g):e(_,-1)}),K(e,m),R()}var Ca={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},wa={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Ta=1e3,Ea=1001,Da=1002,Oa=1003,ka=1004,Aa=1005,ja=1006,Ma=1007,Na=1008,Pa=1009,Fa=1010,Ia=1011,La=1012,Ra=1013,za=1014,Ba=1015,Va=1016,Ha=1017,Ua=1018,Wa=1020,Ga=35902,Ka=35899,qa=1021,Ja=1022,Ya=1023,Xa=1026,Za=1027,Qa=1028,$a=1029,eo=1030,to=1031,no=1033,ro=33776,io=33777,ao=33778,oo=33779,so=35840,co=35841,lo=35842,uo=35843,fo=36196,po=37492,mo=37496,ho=37488,go=37489,_o=37490,vo=37491,yo=37808,bo=37809,xo=37810,So=37811,Co=37812,wo=37813,To=37814,Eo=37815,Do=37816,Oo=37817,ko=37818,Ao=37819,jo=37820,Mo=37821,No=36492,Po=36494,Fo=36495,Io=36283,Lo=36284,Ro=36285,zo=36286,Bo=2300,Vo=2301,Ho=2302,Uo=2303,Wo=2400,Go=2401,Ko=2402,qo=3200,Jo=`srgb`,Yo=`srgb-linear`,Xo=`linear`,Zo=`srgb`,Qo=7680,$o=35044,es=2e3;function ts(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function ns(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function rs(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function is(){let e=rs(`canvas`);return e.style.display=`block`,e}var as={};function os(...e){let t=`THREE.`+e.shift();console.log(t,...e)}function ss(e){let t=e[0];if(typeof t==`string`&&t.startsWith(`TSL:`)){let t=e[1];t&&t.isStackTrace?e[0]+=` `+t.getLocation():e[1]=`Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.`}return e}function cs(...e){e=ss(e);let t=`THREE.`+e.shift();{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}function ls(...e){e=ss(e);let t=`THREE.`+e.shift();{let n=e[0];n&&n.isStackTrace?console.error(n.getError(t)):console.error(t,...e)}}function us(...e){let t=e.join(` `);t in as||(as[t]=!0,cs(...e))}function ds(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var fs={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3},ps=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n!==void 0&&n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n<r;n++)t[n].call(this,e);e.target=null}}},ms=`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`.split(`.`),hs=1234567,gs=Math.PI/180,_s=180/Math.PI;function vs(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(ms[e&255]+ms[e>>8&255]+ms[e>>16&255]+ms[e>>24&255]+`-`+ms[t&255]+ms[t>>8&255]+`-`+ms[t>>16&15|64]+ms[t>>24&255]+`-`+ms[n&63|128]+ms[n>>8&255]+`-`+ms[n>>16&255]+ms[n>>24&255]+ms[r&255]+ms[r>>8&255]+ms[r>>16&255]+ms[r>>24&255]).toLowerCase()}function ys(e,t,n){return Math.max(t,Math.min(n,e))}function bs(e,t){return(e%t+t)%t}function xs(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function Ss(e,t,n){return e===t?0:(n-e)/(t-e)}function Cs(e,t,n){return(1-n)*e+n*t}function ws(e,t,n,r){return Cs(e,t,1-Math.exp(-n*r))}function Ts(e,t=1){return t-Math.abs(bs(e,t*2)-t)}function Es(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function Ds(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function Os(e,t){return e+Math.floor(Math.random()*(t-e+1))}function ks(e,t){return e+Math.random()*(t-e)}function As(e){return e*(.5-Math.random())}function js(e){e!==void 0&&(hs=e);let t=hs+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Ms(e){return e*gs}function Ns(e){return e*_s}function Ps(e){return!(e&e-1)&&e!==0}function Fs(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function Is(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function Ls(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:cs(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function Rs(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}function zs(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}var Bs={DEG2RAD:gs,RAD2DEG:_s,generateUUID:vs,clamp:ys,euclideanModulo:bs,mapLinear:xs,inverseLerp:Ss,lerp:Cs,damp:ws,pingpong:Ts,smoothstep:Es,smootherstep:Ds,randInt:Os,randFloat:ks,randFloatSpread:As,seededRandom:js,degToRad:Ms,radToDeg:Ns,isPowerOfTwo:Ps,ceilPowerOfTwo:Fs,floorPowerOfTwo:Is,setQuaternionFromProperEuler:Ls,normalize:zs,denormalize:Rs},X=class e{static{e.prototype.isVector2=!0}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 Error(`THREE.Vector2: index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`THREE.Vector2: 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){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+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=ys(this.x,e.x,t.x),this.y=ys(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=ys(this.x,e,t),this.y=ys(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(ys(n,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){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(ys(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,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){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Vs=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,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,n,r){return this._x=e,this._y=t,this._z=n,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){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:cs(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(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=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ys(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);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*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*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}},Z=class e{static{e.prototype.isVector3=!0}constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,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 Error(`THREE.Vector3: 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 Error(`THREE.Vector3: 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(Us.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Us.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-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){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[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=ys(this.x,e.x,t.x),this.y=ys(this.y,e.y,t.y),this.z=ys(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=ys(this.x,e,t),this.y=ys(this.y,e,t),this.z=ys(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(ys(n,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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Hs.copy(this).projectOnVector(e),this.sub(Hs)}reflect(e){return this.sub(Hs.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(ys(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+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,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,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(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Hs=new Z,Us=new Vs,Ws=class e{static{e.prototype.isMatrix3=!0}constructor(e,t,n,r,i,a,o,s,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let 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){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,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){let 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,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return us(`Matrix3: .scale() is deprecated. Use .makeScale() instead.`),this.premultiply(Gs.makeScale(e,t)),this}rotate(e){return us(`Matrix3: .rotate() is deprecated. Use .makeRotation() instead.`),this.premultiply(Gs.makeRotation(-e)),this}translate(e,t){return us(`Matrix3: .translate() is deprecated. Use .makeTranslation() instead.`),this.premultiply(Gs.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){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},Gs=new Ws,Ks=new Ws().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),qs=new Ws().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Js(){let e={enabled:!0,workingColorSpace:Yo,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=Xs(e.r),e.g=Xs(e.g),e.b=Xs(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=Zs(e.r),e.g=Zs(e.g),e.b=Zs(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?Xo:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return us(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return us(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[Yo]:{primaries:t,whitePoint:r,transfer:Xo,toXYZ:Ks,fromXYZ:qs,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Jo},outputColorSpaceConfig:{drawingBufferColorSpace:Jo}},[Jo]:{primaries:t,whitePoint:r,transfer:Zo,toXYZ:Ks,fromXYZ:qs,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Jo}}}),e}var Ys=Js();function Xs(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function Zs(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var Qs,$s=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Qs===void 0&&(Qs=rs(`canvas`)),Qs.width=e.width,Qs.height=e.height;let t=Qs.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=Qs}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=rs(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=Xs(i[e]/255)*255;return n.putImageData(r,0,0),t}if(e.data){let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(Xs(t[e]/255)*255):t[e]=Xs(t[e]);return{data:t,width:e.width,height:e.height}}return cs(`ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.`),e}},ec=0,tc=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:ec++}),this.uuid=vs(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let 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(0,0,0):e.set(t.width,t.height,t.depth||0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let n={uuid:this.uuid,url:``},r=this.data;if(r!==null){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(nc(r[t].image)):e.push(nc(r[t]))}else e=nc(r);n.url=e}return t||(e.images[this.uuid]=n),n}};function nc(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap?$s.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(cs(`Texture: Unable to serialize Texture.`),{})}var rc=0,ic=new Z,ac=class e extends ps{constructor(t=e.DEFAULT_IMAGE,n=e.DEFAULT_MAPPING,r=Ea,i=Ea,a=ja,o=Na,s=Ya,c=Pa,l=e.DEFAULT_ANISOTROPY,u=``){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:rc++}),this.uuid=vs(),this.name=``,this.source=new tc(t),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=i,this.magFilter=a,this.minFilter=o,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=c,this.offset=new X(0,0),this.repeat=new X(1,1),this.center=new X(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ws,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(ic).x}get height(){return this.source.getSize(ic).y}get depth(){return this.source.getSize(ic).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(let t in e){let n=e[t];if(n===void 0){cs(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){cs(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ta:e.x-=Math.floor(e.x);break;case Ea:e.x=e.x<0?0:1;break;case Da:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case Ta:e.y-=Math.floor(e.y);break;case Ea:e.y=e.y<0?0:1;break;case Da:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y)}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++}};ac.DEFAULT_IMAGE=null,ac.DEFAULT_MAPPING=300,ac.DEFAULT_ANISOTROPY=1;var oc=class e{static{e.prototype.isVector4=!0}constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,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,n,r){return this.x=e,this.y=t,this.z=n,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 Error(`THREE.Vector4: 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 Error(`THREE.Vector4: 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?1:e.w,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){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,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);let 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,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)<a&&Math.abs(u-m)<a&&Math.abs(p-h)<a){if(Math.abs(l+d)<o&&Math.abs(u+m)<o&&Math.abs(p+h)<o&&Math.abs(c+f+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;let e=(c+1)/2,s=(f+1)/2,_=(g+1)/2,v=(l+d)/4,y=(u+m)/4,b=(p+h)/4;return e>s&&e>_?e<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=v/n,i=y/n):s>_?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=b/r):_<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(_),n=y/i,r=b/i),this.set(n,r,i,t),this}let _=Math.sqrt((h-p)*(h-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(_)<.001&&(_=1),this.x=(h-p)/_,this.y=(u-m)/_,this.z=(d-l)/_,this.w=Math.acos((c+f+g-1)/2),this}setFromMatrixPosition(e){let 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=ys(this.x,e.x,t.x),this.y=ys(this.y,e.y,t.y),this.z=ys(this.z,e.z,t.z),this.w=ys(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=ys(this.x,e,t),this.y=ys(this.y,e,t),this.z=ys(this.z,e,t),this.w=ys(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(ys(n,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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,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}},sc=class extends ps{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ja,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new oc(0,0,e,t),this.scissorTest=!1,this.viewport=new oc(0,0,e,t),this.textures=[];let r=new ac({width:e,height:t,depth:n.depth}),i=n.count;for(let e=0;e<i;e++)this.textures[e]=r.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview,this.useArrayDepthTexture=n.useArrayDepthTexture}_setTextureOptions(e={}){let t={minFilter:ja,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 e=0;e<this.textures.length;e++)this.textures[e].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,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,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,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let n=Object.assign({},e.textures[t].image);this.textures[t].source=new tc(n)}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.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:`dispose`})}},cc=class extends sc{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}},lc=class extends ac{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Oa,this.minFilter=Oa,this.wrapR=Ea,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},uc=class extends ac{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Oa,this.minFilter=Oa,this.wrapR=Ea,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},dc=class e{static{e.prototype.isMatrix4=!0}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){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,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,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 e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let 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,n){return this.determinantAffine()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();let t=this.elements,n=e.elements,r=1/fc.setFromMatrixColumn(e,0).length(),i=1/fc.setFromMatrixColumn(e,1).length(),a=1/fc.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}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(mc,e,hc)}lookAt(e,t,n){let r=this.elements;return vc.subVectors(e,t),vc.lengthSq()===0&&(vc.z=1),vc.normalize(),gc.crossVectors(n,vc),gc.lengthSq()===0&&(Math.abs(n.z)===1?vc.x+=1e-4:vc.z+=1e-4,vc.normalize(),gc.crossVectors(n,vc)),gc.normalize(),_c.crossVectors(vc,gc),r[0]=gc.x,r[4]=_c.x,r[8]=vc.x,r[1]=gc.y,r[5]=_c.y,r[9]=vc.y,r[2]=gc.z,r[6]=_c.z,r[10]=vc.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],j=r[10],ee=r[14],M=r[3],N=r[7],P=r[11],te=r[15];return i[0]=a*x+o*T+s*k+c*M,i[4]=a*S+o*E+s*A+c*N,i[8]=a*C+o*D+s*j+c*P,i[12]=a*w+o*O+s*ee+c*te,i[1]=l*x+u*T+d*k+f*M,i[5]=l*S+u*E+d*A+f*N,i[9]=l*C+u*D+d*j+f*P,i[13]=l*w+u*O+d*ee+f*te,i[2]=p*x+m*T+h*k+g*M,i[6]=p*S+m*E+h*A+g*N,i[10]=p*C+m*D+h*j+g*P,i[14]=p*w+m*O+h*ee+g*te,i[3]=_*x+v*T+y*k+b*M,i[7]=_*S+v*E+y*A+b*N,i[11]=_*C+v*D+y*j+b*P,i[15]=_*w+v*O+y*ee+b*te,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15],_=s*f-c*d,v=o*f-c*u,y=o*d-s*u,b=a*f-c*l,x=a*d-s*l,S=a*u-o*l;return t*(m*_-h*v+g*y)-n*(p*_-h*b+g*x)+r*(p*v-m*b+g*S)-i*(p*y-m*x+h*S)}determinantAffine(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[1],a=e[5],o=e[9],s=e[2],c=e[6],l=e[10];return t*(a*l-o*c)-n*(i*l-o*s)+r*(i*c-a*s)}transpose(){let e=this.elements,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,n){let 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]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=t*c-i*a,b=n*s-r*o,x=n*c-i*o,S=r*c-i*s,C=l*m-u*p,w=l*h-d*p,T=l*g-f*p,E=u*h-d*m,D=u*g-f*m,O=d*g-f*h,k=_*O-v*D+y*E+b*T-x*w+S*C;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let A=1/k;return e[0]=(o*O-s*D+c*E)*A,e[1]=(r*D-n*O-i*E)*A,e[2]=(m*S-h*x+g*b)*A,e[3]=(d*x-u*S-f*b)*A,e[4]=(s*T-a*O-c*w)*A,e[5]=(t*O-r*T+i*w)*A,e[6]=(h*y-p*S-g*v)*A,e[7]=(l*S-d*y+f*v)*A,e[8]=(a*D-o*T+c*C)*A,e[9]=(n*T-t*D-i*C)*A,e[10]=(p*x-m*y+g*_)*A,e[11]=(u*y-l*x-f*_)*A,e[12]=(o*w-a*E-s*C)*A,e[13]=(t*E-n*w+r*C)*A,e[14]=(m*v-p*b-h*_)*A,e[15]=(l*b-u*v+d*_)*A,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=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,n,r))}makeTranslation(e,t,n){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,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];let i=this.determinantAffine();if(i===0)return n.set(1,1,1),t.identity(),this;let a=fc.set(r[0],r[1],r[2]).length(),o=fc.set(r[4],r[5],r[6]).length(),s=fc.set(r[8],r[9],r[10]).length();i<0&&(a=-a),pc.copy(this);let c=1/a,l=1/o,u=1/s;return pc.elements[0]*=c,pc.elements[1]*=c,pc.elements[2]*=c,pc.elements[4]*=l,pc.elements[5]*=l,pc.elements[6]*=l,pc.elements[8]*=u,pc.elements[9]*=u,pc.elements[10]*=u,t.setFromRotationMatrix(pc),n.x=a,n.y=o,n.z=s,this}makePerspective(e,t,n,r,i,a,o=es,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=es,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},fc=new Z,pc=new dc,mc=new Z(0,0,0),hc=new Z(1,1,1),gc=new Z,_c=new Z,vc=new Z,yc=new dc,bc=new Vs,xc=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}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,n,r=this._order){return this._x=e,this._y=t,this._z=n,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,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(ys(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-ys(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(ys(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-ys(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(ys(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-ys(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:cs(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return yc.makeRotationFromQuaternion(e),this.setFromRotationMatrix(yc,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return bc.setFromEuler(this),this.setFromQuaternion(bc,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}};xc.DEFAULT_ORDER=`XYZ`;var Sc=class{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))}},Cc=0,wc=new Z,Tc=new Vs,Ec=new dc,Dc=new Z,Oc=new Z,kc=new Z,Ac=new Vs,jc=new Z(1,0,0),Mc=new Z(0,1,0),Nc=new Z(0,0,1),Pc={type:`added`},Fc={type:`removed`},Ic={type:`childadded`,child:null},Lc={type:`childremoved`,child:null},Rc=class e extends ps{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Cc++}),this.uuid=vs(),this.name=``,this.type=`Object3D`,this.parent=null,this.children=[],this.up=e.DEFAULT_UP.clone();let t=new Z,n=new xc,r=new Vs,i=new Z(1,1,1);function a(){r.setFromEuler(n,!1)}function o(){n.setFromQuaternion(r,void 0,!1)}n._onChange(a),r._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new dc},normalMatrix:{value:new Ws}}),this.matrix=new dc,this.matrixWorld=new dc,this.matrixAutoUpdate=e.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=e.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Sc,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 Tc.setFromAxisAngle(e,t),this.quaternion.multiply(Tc),this}rotateOnWorldAxis(e,t){return Tc.setFromAxisAngle(e,t),this.quaternion.premultiply(Tc),this}rotateX(e){return this.rotateOnAxis(jc,e)}rotateY(e){return this.rotateOnAxis(Mc,e)}rotateZ(e){return this.rotateOnAxis(Nc,e)}translateOnAxis(e,t){return wc.copy(e).applyQuaternion(this.quaternion),this.position.add(wc.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(jc,e)}translateY(e){return this.translateOnAxis(Mc,e)}translateZ(e){return this.translateOnAxis(Nc,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Ec.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Dc.copy(e):Dc.set(e,t,n);let r=this.parent;this.updateWorldMatrix(!0,!1),Oc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ec.lookAt(Oc,Dc,this.up):Ec.lookAt(Dc,Oc,this.up),this.quaternion.setFromRotationMatrix(Ec),r&&(Ec.extractRotation(r.matrixWorld),Tc.setFromRotationMatrix(Ec),this.quaternion.premultiply(Tc.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(ls(`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(Pc),Ic.child=e,this.dispatchEvent(Ic),Ic.child=null):ls(`Object3D.add: object not an instance of THREE.Object3D.`,e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Fc),Lc.child=e,this.dispatchEvent(Lc),Lc.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Ec.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Ec.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ec),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Pc),Ic.child=e,this.dispatchEvent(Ic),Ic.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 n=0,r=this.children.length;n<r;n++){let r=this.children[n].getObjectByProperty(e,t);if(r!==void 0)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Oc,e,kc),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Oc,Ac,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);let e=this.pivot;if(e!==null){let t=e.x,n=e.y,r=e.z,i=this.matrix.elements;i[12]+=t-i[0]*t-i[4]*n-i[8]*r,i[13]+=n-i[1]*t-i[5]*n-i[9]*r,i[14]+=r-i[2]*t-i[6]*n-i[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);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t,n=!1){let r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||n)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,n=!0),t===!0){let e=this.children;for(let t=0,r=e.length;t<r;t++)e[t].updateWorldMatrix(!1,!0,n)}}toJSON(e){let t=e===void 0||typeof e==`string`,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:`Object`,generator:`Object3D.toJSON`});let 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(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),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 i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.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=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){let r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){let t=a(e.geometries),r=a(e.materials),i=a(e.textures),o=a(e.images),s=a(e.shapes),c=a(e.skeletons),l=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}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?null:e.pivot.clone(),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 t=0;t<e.children.length;t++){let n=e.children[t];this.add(n.clone())}return this}};Rc.DEFAULT_UP=new Z(0,1,0),Rc.DEFAULT_MATRIX_AUTO_UPDATE=!0,Rc.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var zc=class extends Rc{constructor(){super(),this.isGroup=!0,this.type=`Group`}},Bc={type:`move`},Vc=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new zc,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 zc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new zc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Z,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){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}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,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,c=this._hand;if(e&&t.session.visibilityState!==`visible-blurred`){if(c&&e.hand){a=!0;for(let r of e.hand.values()){let e=t.getJointPose(r,n),i=this._getHandJoint(c,r);e!==null&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=e!==null}let r=c.joints[`index-finger-tip`],i=c.joints[`thumb-tip`],o=r.position.distanceTo(i.position);c.inputState.pinching&&o>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,s.eventsEnabled&&s.dispatchEvent({type:`gripUpdated`,data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),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(Bc)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new zc;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},Hc={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},Uc={h:0,s:0,l:0},Wc={h:0,s:0,l:0};function Gc(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var Q=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Jo){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ys.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=Ys.workingColorSpace){return this.r=e,this.g=t,this.b=n,Ys.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=Ys.workingColorSpace){if(e=bs(e,1),t=ys(t,0,1),n=ys(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Gc(i,r,e+1/3),this.g=Gc(i,r,e),this.b=Gc(i,r,e-1/3)}return Ys.colorSpaceToWorking(this,r),this}setStyle(e,t=Jo){function n(t){t!==void 0&&parseFloat(t)<1&&cs(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:cs(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);cs(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Jo){let n=Hc[e.toLowerCase()];return n===void 0?cs(`Color: Unknown color `+e):this.setHex(n,t),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=Xs(e.r),this.g=Xs(e.g),this.b=Xs(e.b),this}copyLinearToSRGB(e){return this.r=Zs(e.r),this.g=Zs(e.g),this.b=Zs(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Jo){return Ys.workingToColorSpace(Kc.copy(this),e),Math.round(ys(Kc.r*255,0,255))*65536+Math.round(ys(Kc.g*255,0,255))*256+Math.round(ys(Kc.b*255,0,255))}getHexString(e=Jo){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ys.workingColorSpace){Ys.workingToColorSpace(Kc.copy(this),t);let n=Kc.r,r=Kc.g,i=Kc.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r<i?6:0);break;case r:s=(i-n)/e+2;break;case i:s=(n-r)/e+4}s/=6}return e.h=s,e.s=c,e.l=l,e}getRGB(e,t=Ys.workingColorSpace){return Ys.workingToColorSpace(Kc.copy(this),t),e.r=Kc.r,e.g=Kc.g,e.b=Kc.b,e}getStyle(e=Jo){Ys.workingToColorSpace(Kc.copy(this),e);let t=Kc.r,n=Kc.g,r=Kc.b;return e===`srgb`?`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`:`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`}offsetHSL(e,t,n){return this.getHSL(Uc),this.setHSL(Uc.h+e,Uc.s+t,Uc.l+n)}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,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Uc),e.getHSL(Wc);let n=Cs(Uc.h,Wc.h,t),r=Cs(Uc.s,Wc.s,t),i=Cs(Uc.l,Wc.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[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}},Kc=new Q;Q.NAMES=Hc;var qc=class extends Rc{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 xc,this.environmentIntensity=1,this.environmentRotation=new xc,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){let 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}},Jc=new Z,Yc=new Z,Xc=new Z,Zc=new Z,Qc=new Z,$c=new Z,el=new Z,tl=new Z,nl=new Z,rl=new Z,il=new oc,al=new oc,ol=new oc,sl=class e{constructor(e=new Z,t=new Z,n=new Z){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Jc.subVectors(e,t),r.cross(Jc);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Jc.subVectors(r,t),Yc.subVectors(n,t),Xc.subVectors(e,t);let a=Jc.dot(Jc),o=Jc.dot(Yc),s=Jc.dot(Xc),c=Yc.dot(Yc),l=Yc.dot(Xc),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Zc)!==null&&Zc.x>=0&&Zc.y>=0&&Zc.x+Zc.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Zc)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,Zc.x),s.addScaledVector(a,Zc.y),s.addScaledVector(o,Zc.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return il.setScalar(0),al.setScalar(0),ol.setScalar(0),il.fromBufferAttribute(e,t),al.fromBufferAttribute(e,n),ol.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(il,i.x),a.addScaledVector(al,i.y),a.addScaledVector(ol,i.z),a}static isFrontFacing(e,t,n,r){return Jc.subVectors(n,t),Yc.subVectors(e,t),Jc.cross(Yc).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),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 Jc.subVectors(this.c,this.b),Yc.subVectors(this.a,this.b),Jc.cross(Yc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Qc.subVectors(r,n),$c.subVectors(i,n),tl.subVectors(e,n);let s=Qc.dot(tl),c=$c.dot(tl);if(s<=0&&c<=0)return t.copy(n);nl.subVectors(e,r);let l=Qc.dot(nl),u=$c.dot(nl);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Qc,a);rl.subVectors(e,i);let f=Qc.dot(rl),p=$c.dot(rl);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector($c,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return el.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(el,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Qc,a).addScaledVector($c,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},cl=class{constructor(e=new Z(1/0,1/0,1/0),t=new Z(-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,n=e.length;t<n;t+=3)this.expandByPoint(ul.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(ul.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=ul.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),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);let n=e.geometry;if(n!==void 0){let r=n.getAttribute(`position`);if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let t=0,n=r.count;t<n;t++)e.isMesh===!0?e.getVertexPosition(t,ul):ul.fromBufferAttribute(r,t),ul.applyMatrix4(e.matrixWorld),this.expandByPoint(ul);else e.boundingBox===void 0?(n.boundingBox===null&&n.computeBoundingBox(),dl.copy(n.boundingBox)):(e.boundingBox===null&&e.computeBoundingBox(),dl.copy(e.boundingBox)),dl.applyMatrix4(e.matrixWorld),this.union(dl)}let r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],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,ul),ul.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(vl),yl.subVectors(this.max,vl),fl.subVectors(e.a,vl),pl.subVectors(e.b,vl),ml.subVectors(e.c,vl),hl.subVectors(pl,fl),gl.subVectors(ml,pl),_l.subVectors(fl,ml);let t=[0,-hl.z,hl.y,0,-gl.z,gl.y,0,-_l.z,_l.y,hl.z,0,-hl.x,gl.z,0,-gl.x,_l.z,0,-_l.x,-hl.y,hl.x,0,-gl.y,gl.x,0,-_l.y,_l.x,0];return!Sl(t,fl,pl,ml,yl)||(t=[1,0,0,0,1,0,0,0,1],!Sl(t,fl,pl,ml,yl))?!1:(bl.crossVectors(hl,gl),t=[bl.x,bl.y,bl.z],Sl(t,fl,pl,ml,yl))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ul).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ul).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:(ll[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ll[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ll[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ll[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ll[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ll[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ll[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ll[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ll),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}},ll=[new Z,new Z,new Z,new Z,new Z,new Z,new Z,new Z],ul=new Z,dl=new cl,fl=new Z,pl=new Z,ml=new Z,hl=new Z,gl=new Z,_l=new Z,vl=new Z,yl=new Z,bl=new Z,xl=new Z;function Sl(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){xl.fromArray(e,a);let o=i.x*Math.abs(xl.x)+i.y*Math.abs(xl.y)+i.z*Math.abs(xl.z),s=t.dot(xl),c=n.dot(xl),l=r.dot(xl);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var Cl=wl();function wl(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[e|256]=32768,i[e]=24,i[e|256]=24):t<-14?(r[e]=1024>>-t-14,r[e|256]=1024>>-t-14|32768,i[e]=-t-1,i[e|256]=-t-1):t<=15?(r[e]=t+15<<10,r[e|256]=t+15<<10|32768,i[e]=13,i[e|256]=13):t<128?(r[e]=31744,r[e|256]=64512,i[e]=24,i[e|256]=24):(r[e]=31744,r[e|256]=64512,i[e]=13,i[e|256]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(t&8388608);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}function Tl(e){Math.abs(e)>65504&&cs(`DataUtils.toHalfFloat(): Value out of range.`),e=ys(e,-65504,65504),Cl.floatView[0]=e;let t=Cl.uint32View[0],n=t>>23&511;return Cl.baseTable[n]+((t&8388607)>>Cl.shiftTable[n])}function El(e){let t=e>>10;return Cl.uint32View[0]=Cl.mantissaTable[Cl.offsetTable[t]+(e&1023)]+Cl.exponentTable[t],Cl.floatView[0]}var Dl=class{static toHalfFloat(e){return Tl(e)}static fromHalfFloat(e){return El(e)}},Ol=new Z,kl=new X,Al=0,jl=class extends ps{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Al++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=$o,this.updateRanges=[],this.gpuType=Ba,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,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)kl.fromBufferAttribute(this,t),kl.applyMatrix3(e),this.setXY(t,kl.x,kl.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Ol.fromBufferAttribute(this,t),Ol.applyMatrix3(e),this.setXYZ(t,Ol.x,Ol.y,Ol.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Ol.fromBufferAttribute(this,t),Ol.applyMatrix4(e),this.setXYZ(t,Ol.x,Ol.y,Ol.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ol.fromBufferAttribute(this,t),Ol.applyNormalMatrix(e),this.setXYZ(t,Ol.x,Ol.y,Ol.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ol.fromBufferAttribute(this,t),Ol.transformDirection(e),this.setXYZ(t,Ol.x,Ol.y,Ol.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Rs(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=zs(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Rs(t,this.array)),t}setX(e,t){return this.normalized&&(t=zs(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Rs(t,this.array)),t}setY(e,t){return this.normalized&&(t=zs(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=Rs(t,this.array)),t}setZ(e,t){return this.normalized&&(t=zs(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=Rs(t,this.array)),t}setW(e,t){return this.normalized&&(t=zs(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=zs(t,this.array),n=zs(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=zs(t,this.array),n=zs(n,this.array),r=zs(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=zs(t,this.array),n=zs(n,this.array),r=zs(r,this.array),i=zs(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let 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!==35044&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:`dispose`})}},Ml=class extends jl{constructor(e,t,n){super(new Uint16Array(e),t,n)}},Nl=class extends jl{constructor(e,t,n){super(new Uint32Array(e),t,n)}},Pl=class extends jl{constructor(e,t,n){super(new Float32Array(e),t,n)}},Fl=new cl,Il=new Z,Ll=new Z,Rl=class{constructor(e=new Z,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){let n=this.center;t===void 0?Fl.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));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){let 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){let n=this.center.distanceToSquared(e);return t.copy(e),n>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*=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;Il.subVectors(e,this.center);let t=Il.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(Il,n/e),this.radius+=n}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):(Ll.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Il.copy(e.center).add(Ll)),this.expandByPoint(Il.copy(e.center).sub(Ll))),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}},zl=0,Bl=new dc,Vl=new Rc,Hl=new Z,Ul=new cl,Wl=new cl,Gl=new Z,Kl=class e extends ps{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:zl++}),this.uuid=vs(),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={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return this.index=Array.isArray(e)?new(ts(e)?Nl:Ml)(e,1):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,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let t=new Ws().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let 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._transformed=!0,this}applyQuaternion(e){return Bl.makeRotationFromQuaternion(e),this.applyMatrix4(Bl),this}rotateX(e){return Bl.makeRotationX(e),this.applyMatrix4(Bl),this}rotateY(e){return Bl.makeRotationY(e),this.applyMatrix4(Bl),this}rotateZ(e){return Bl.makeRotationZ(e),this.applyMatrix4(Bl),this}translate(e,t,n){return Bl.makeTranslation(e,t,n),this.applyMatrix4(Bl),this}scale(e,t,n){return Bl.makeScale(e,t,n),this.applyMatrix4(Bl),this}lookAt(e){return Vl.lookAt(e),Vl.updateMatrix(),this.applyMatrix4(Vl.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Hl).negate(),this.translate(Hl.x,Hl.y,Hl.z),this}setFromPoints(e){let t=this.getAttribute(`position`);if(t===void 0){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}this.setAttribute(`position`,new Pl(t,3))}else{let n=Math.min(e.length,t.count);for(let r=0;r<n;r++){let n=e[r];t.setXYZ(r,n.x,n.y,n.z||0)}e.length>t.count&&cs(`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 cl);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){ls(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new Z(-1/0,-1/0,-1/0),new Z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Ul.setFromBufferAttribute(n),this.morphTargetsRelative?(Gl.addVectors(this.boundingBox.min,Ul.min),this.boundingBox.expandByPoint(Gl),Gl.addVectors(this.boundingBox.max,Ul.max),this.boundingBox.expandByPoint(Gl)):(this.boundingBox.expandByPoint(Ul.min),this.boundingBox.expandByPoint(Ul.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&ls(`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 Rl);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){ls(`BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.`,this),this.boundingSphere.set(new Z,1/0);return}if(e){let n=this.boundingSphere.center;if(Ul.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];Wl.setFromBufferAttribute(n),this.morphTargetsRelative?(Gl.addVectors(Ul.min,Wl.min),Ul.expandByPoint(Gl),Gl.addVectors(Ul.max,Wl.max),Ul.expandByPoint(Gl)):(Ul.expandByPoint(Wl.min),Ul.expandByPoint(Wl.max))}Ul.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)Gl.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(Gl));if(t)for(let i=0,a=t.length;i<a;i++){let a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)Gl.fromBufferAttribute(a,t),o&&(Hl.fromBufferAttribute(e,t),Gl.add(Hl)),r=Math.max(r,n.distanceToSquared(Gl))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&ls(`BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.`,this)}}computeTangents(){let e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){ls(`BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)`);return}let n=t.position,r=t.normal,i=t.uv,a=this.getAttribute(`tangent`);(a===void 0||a.count!==n.count)&&(a=new jl(new Float32Array(4*n.count),4),this.setAttribute(`tangent`,a));let o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new Z,s[e]=new Z;let c=new Z,l=new Z,u=new Z,d=new X,f=new X,p=new X,m=new Z,h=new Z;function g(e,t,r){c.fromBufferAttribute(n,e),l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,r),d.fromBufferAttribute(i,e),f.fromBufferAttribute(i,t),p.fromBufferAttribute(i,r),l.sub(c),u.sub(c),f.sub(d),p.sub(d);let a=1/(f.x*p.y-p.x*f.y);isFinite(a)&&(m.copy(l).multiplyScalar(p.y).addScaledVector(u,-f.y).multiplyScalar(a),h.copy(u).multiplyScalar(f.x).addScaledVector(l,-p.x).multiplyScalar(a),o[e].add(m),o[t].add(m),o[r].add(m),s[e].add(h),s[t].add(h),s[r].add(h))}let _=this.groups;_.length===0&&(_=[{start:0,count:e.count}]);for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)g(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let v=new Z,y=new Z,b=new Z,x=new Z;function S(e){b.fromBufferAttribute(r,e),x.copy(b);let t=o[e];v.copy(t),v.sub(b.multiplyScalar(b.dot(t))).normalize(),y.crossVectors(x,t);let n=y.dot(s[e])<0?-1:1;a.setXYZW(e,v.x,v.y,v.z,n)}for(let t=0,n=_.length;t<n;++t){let n=_[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)S(e.getX(t+0)),S(e.getX(t+1)),S(e.getX(t+2))}this._transformed=!0}computeVertexNormals(){let e=this.index,t=this.getAttribute(`position`);if(t!==void 0){let n=this.getAttribute(`normal`);if(n===void 0||n.count!==t.count)n=new jl(new Float32Array(t.count*3),3),this.setAttribute(`normal`,n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let r=new Z,i=new Z,a=new Z,o=new Z,s=new Z,c=new Z,l=new Z,u=new Z;if(e)for(let d=0,f=e.count;d<f;d+=3){let f=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);r.fromBufferAttribute(t,f),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,m),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),o.fromBufferAttribute(n,f),s.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),o.add(l),s.add(l),c.add(l),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let e=0,o=t.count;e<o;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),l.subVectors(a,i),u.subVectors(r,i),l.cross(u),n.setXYZ(e+0,l.x,l.y,l.z),n.setXYZ(e+1,l.x,l.y,l.z),n.setXYZ(e+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Gl.fromBufferAttribute(e,t),Gl.normalize(),e.setXYZ(t,Gl.x,Gl.y,Gl.z)}toNonIndexed(){function t(e,t){let n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0;for(let i=0,c=t.length;i<c;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new jl(a,r,i)}if(this.index===null)return cs(`BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.`),this;let n=new e,r=this.index.array,i=this.attributes;for(let e in i){let a=i[e],o=t(a,r);n.setAttribute(e,o)}let a=this.morphAttributes;for(let e in a){let i=[],o=a[e];for(let e=0,n=o.length;e<n;e++){let n=o[e],a=t(n,r);i.push(a)}n.morphAttributes[e]=i}n.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let e=0,t=o.length;e<t;e++){let t=o[e];n.addGroup(t.start,t.count,t.materialIndex)}return n}toJSON(){let e={metadata:{version:4.7,type:`BufferGeometry`,generator:`BufferGeometry.toJSON`}};if(e.uuid=this.uuid,e.type=this.parameters!==void 0&&this._transformed===!0?`BufferGeometry`:this.type,this.name!==``&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t<r;t++){let r=n[t];a.push(r.toJSON(e.data))}a.length>0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let 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;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());let s=e.boundingSphere;return s!==null&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:`dispose`})}},ql=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.usage=$o,this.updateRanges=[],this.version=0,this.uuid=vs()}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,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+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=vs()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}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=vs()),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}}},Jl=new Z,Yl=class e{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name=``,this.data=e,this.itemSize=t,this.offset=n,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,n=this.data.count;t<n;t++)Jl.fromBufferAttribute(this,t),Jl.applyMatrix4(e),this.setXYZ(t,Jl.x,Jl.y,Jl.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Jl.fromBufferAttribute(this,t),Jl.applyNormalMatrix(e),this.setXYZ(t,Jl.x,Jl.y,Jl.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Jl.fromBufferAttribute(this,t),Jl.transformDirection(e),this.setXYZ(t,Jl.x,Jl.y,Jl.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Rs(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=zs(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=zs(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=zs(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=zs(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=zs(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=Rs(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Rs(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Rs(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Rs(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=zs(t,this.array),n=zs(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=zs(t,this.array),n=zs(n,this.array),r=zs(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=zs(t,this.array),n=zs(n,this.array),r=zs(r,this.array),i=zs(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(t){if(t===void 0){os(`InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new jl(new this.array.constructor(e),this.itemSize,this.normalized)}return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new e(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){os(`InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.`);let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}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}}},Xl=0,Zl=class extends ps{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Xl++}),this.uuid=vs(),this.name=``,this.type=`Material`,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Q(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Qo,this.stencilZFail=Qo,this.stencilZPass=Qo,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(let t in e){let n=e[t];if(n===void 0){cs(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){cs(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector2&&n&&n.isVector2||r&&r.isEuler&&n&&n.isEuler||r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}fromJSON(e,t){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new Q().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(this.vertexColors=typeof e.vertexColors==`number`?e.vertexColors>0:e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),this.normalScale=new X().fromArray(t)}return e.displacementMap!==void 0&&(this.displacementMap=t[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new X().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}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;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,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++}},Ql=class extends Zl{constructor(e){super(),this.isSpriteMaterial=!0,this.type=`SpriteMaterial`,this.color=new Q(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}},$l,eu=new Z,tu=new Z,nu=new Z,ru=new X,iu=new X,au=new dc,ou=new Z,su=new Z,cu=new Z,lu=new X,uu=new X,du=new X,fu=class extends Rc{constructor(e=new Ql){if(super(),this.isSprite=!0,this.type=`Sprite`,$l===void 0){$l=new Kl;let e=new ql(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);$l.setIndex([0,1,2,0,2,3]),$l.setAttribute(`position`,new Yl(e,3,0,!1)),$l.setAttribute(`uv`,new Yl(e,2,3,!1))}this.geometry=$l,this.material=e,this.center=new X(.5,.5),this.count=1}raycast(e,t){e.camera===null&&ls(`Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.`),tu.setFromMatrixScale(this.matrixWorld),au.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),nu.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&tu.multiplyScalar(-nu.z);let n=this.material.rotation,r,i;n!==0&&(i=Math.cos(n),r=Math.sin(n));let a=this.center;pu(ou.set(-.5,-.5,0),nu,a,tu,r,i),pu(su.set(.5,-.5,0),nu,a,tu,r,i),pu(cu.set(.5,.5,0),nu,a,tu,r,i),lu.set(0,0),uu.set(1,0),du.set(1,1);let o=e.ray.intersectTriangle(ou,su,cu,!1,eu);if(o===null&&(pu(su.set(-.5,.5,0),nu,a,tu,r,i),uu.set(0,1),o=e.ray.intersectTriangle(ou,cu,su,!1,eu),o===null))return;let s=e.ray.origin.distanceTo(eu);s<e.near||s>e.far||t.push({distance:s,point:eu.clone(),uv:sl.getInterpolation(eu,ou,su,cu,lu,uu,du,new X),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 pu(e,t,n,r,i,a){ru.subVectors(e,n).addScalar(.5).multiply(r),i===void 0?iu.copy(ru):(iu.x=a*ru.x-i*ru.y,iu.y=i*ru.x+a*ru.y),e.copy(t),e.x+=iu.x,e.y+=iu.y,e.applyMatrix4(au)}var mu=new Z,hu=new Z,gu=new Z,_u=new Z,vu=new Z,yu=new Z,bu=new Z,xu=class{constructor(e=new Z,t=new Z(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,mu)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=mu.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(mu.copy(this.origin).addScaledVector(this.direction,t),mu.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){hu.copy(e).add(t).multiplyScalar(.5),gu.copy(t).sub(e).normalize(),_u.copy(this.origin).sub(hu);let i=e.distanceTo(t)*.5,a=-this.direction.dot(gu),o=_u.dot(this.direction),s=-_u.dot(gu),c=_u.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(hu).addScaledVector(gu,d),f}intersectSphere(e,t){mu.subVectors(e.center,this.origin);let n=mu.dot(this.direction),r=mu.dot(mu)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),u>=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s<r||r!==r)&&(r=s),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,mu)!==null}intersectTriangle(e,t,n,r,i){vu.subVectors(t,e),yu.subVectors(n,e),bu.crossVectors(vu,yu);let a=this.direction.dot(bu),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;_u.subVectors(this.origin,e);let s=o*this.direction.dot(yu.crossVectors(_u,yu));if(s<0)return null;let c=o*this.direction.dot(vu.cross(_u));if(c<0||s+c>a)return null;let l=-o*_u.dot(bu);return l<0?null:this.at(l/a,i)}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)}},Su=class extends Zl{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new Q(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 xc,this.combine=0,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}},Cu=new dc,wu=new xu,Tu=new Rl,Eu=new Z,Du=new Z,Ou=new Z,ku=new Z,Au=new Z,ju=new Z,Mu=new Z,Nu=new Z,Pu=class extends Rc{constructor(e=new Kl,t=new Su){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(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);let o=this.morphTargetInfluences;if(i&&o){ju.set(0,0,0);for(let n=0,r=i.length;n<r;n++){let r=o[n],s=i[n];r!==0&&(Au.fromBufferAttribute(s,e),a?ju.addScaledVector(Au,r):ju.addScaledVector(Au.sub(t),r))}t.add(ju)}return t}raycast(e,t){let n=this.geometry,r=this.material,i=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Tu.copy(n.boundingSphere),Tu.applyMatrix4(i),wu.copy(e.ray).recast(e.near),!(Tu.containsPoint(wu.origin)===!1&&(wu.intersectSphere(Tu,Eu)===null||wu.origin.distanceToSquared(Eu)>(e.far-e.near)**2))&&(Cu.copy(i).invert(),wu.copy(e.ray).applyMatrix4(Cu),(n.boundingBox===null||wu.intersectsBox(n.boundingBox)!==!1)&&this._computeIntersections(e,t,wu)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;i<s;i++){let s=d[i],p=a[s.materialIndex],m=Math.max(s.start,f.start),h=Math.min(o.count,Math.min(s.start+s.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=o.getX(i),d=o.getX(i+1),f=o.getX(i+2);r=Iu(this,p,e,n,c,l,u,a,d,f),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),s=Math.min(o.count,f.start+f.count);for(let d=i,f=s;d<f;d+=3){let i=o.getX(d),s=o.getX(d+1),f=o.getX(d+2);r=Iu(this,a,e,n,c,l,u,i,s,f),r&&(r.faceIndex=Math.floor(d/3),t.push(r))}}else if(s!==void 0)if(Array.isArray(a))for(let i=0,o=d.length;i<o;i++){let o=d[i],p=a[o.materialIndex],m=Math.max(o.start,f.start),h=Math.min(s.count,Math.min(o.start+o.count,f.start+f.count));for(let i=m,a=h;i<a;i+=3){let a=i,s=i+1,d=i+2;r=Iu(this,p,e,n,c,l,u,a,s,d),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}}else{let i=Math.max(0,f.start),o=Math.min(s.count,f.start+f.count);for(let s=i,d=o;s<d;s+=3){let i=s,o=s+1,d=s+2;r=Iu(this,a,e,n,c,l,u,i,o,d),r&&(r.faceIndex=Math.floor(s/3),t.push(r))}}}};function Fu(e,t,n,r,i,a,o,s){let c;if(c=t.side===1?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,t.side===0,s),c===null)return null;Nu.copy(s),Nu.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(Nu);return l<n.near||l>n.far?null:{distance:l,point:Nu.clone(),object:e}}function Iu(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,Du),e.getVertexPosition(c,Ou),e.getVertexPosition(l,ku);let u=Fu(e,t,n,r,Du,Ou,ku,Mu);if(u){let e=new Z;sl.getBarycoord(Mu,Du,Ou,ku,e),i&&(u.uv=sl.getInterpolatedAttribute(i,s,c,l,e,new X)),a&&(u.uv1=sl.getInterpolatedAttribute(a,s,c,l,e,new X)),o&&(u.normal=sl.getInterpolatedAttribute(o,s,c,l,e,new Z),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new Z,materialIndex:0};sl.getNormal(Du,Ou,ku,t.normal),u.face=t,u.barycoord=e}return u}var Lu=class extends ac{constructor(e=null,t=1,n=1,r,i,a,o,s,c=Oa,l=Oa,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Ru=new Z,zu=new Z,Bu=new Ws,Vu=class{constructor(e=new Z(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,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=Ru.subVectors(n,t).cross(zu.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let 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,n=!0){let r=e.delta(Ru),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let a=-(e.start.dot(this.normal)+this.constant)/i;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<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){let n=t||Bu.getNormalMatrix(e),r=this.coplanarPoint(Ru).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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)}},Hu=new Rl,Uu=new X(.5,.5),Wu=new Z,Gu=class{constructor(e=new Vu,t=new Vu,n=new Vu,r=new Vu,i=new Vu,a=new Vu){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=es,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Hu.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Hu.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Hu)}intersectsSprite(e){return Hu.center.set(0,0,0),Hu.radius=.7071067811865476+Uu.distanceTo(e.center),Hu.applyMatrix4(e.matrixWorld),this.intersectsSphere(Hu)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let r=t[n];if(Wu.x=r.normal.x>0?e.max.x:e.min.x,Wu.y=r.normal.y>0?e.max.y:e.min.y,Wu.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Wu)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},Ku=class extends Zl{constructor(e){super(),this.isLineBasicMaterial=!0,this.type=`LineBasicMaterial`,this.color=new Q(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}},qu=new Z,Ju=new Z,Yu=new dc,Xu=new xu,Zu=new Rl,Qu=new Z,$u=new Z,ed=class extends Rc{constructor(e=new Kl,t=new Ku){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(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)qu.fromBufferAttribute(t,e-1),Ju.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=qu.distanceTo(Ju);e.setAttribute(`lineDistance`,new Pl(n,1))}else cs(`Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.`);return this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Zu.copy(n.boundingSphere),Zu.applyMatrix4(r),Zu.radius+=i,e.ray.intersectsSphere(Zu)===!1)return;Yu.copy(r).invert(),Xu.copy(e.ray).applyMatrix4(Yu);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=this.isLineSegments?2:1,l=n.index,u=n.attributes.position;if(l!==null){let n=Math.max(0,a.start),r=Math.min(l.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=l.getX(i),r=l.getX(i+1),a=td(this,e,Xu,s,n,r,i);a&&t.push(a)}if(this.isLineLoop){let i=l.getX(r-1),a=l.getX(n),o=td(this,e,Xu,s,i,a,r-1);o&&t.push(o)}}else{let n=Math.max(0,a.start),r=Math.min(u.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=c){let n=td(this,e,Xu,s,i,i+1,i);n&&t.push(n)}if(this.isLineLoop){let i=td(this,e,Xu,s,r-1,n,r-1);i&&t.push(i)}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function td(e,t,n,r,i,a,o){let s=e.geometry.attributes.position;if(qu.fromBufferAttribute(s,i),Ju.fromBufferAttribute(s,a),n.distanceSqToSegment(qu,Ju,Qu,$u)>r)return;Qu.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(Qu);if(!(c<t.near||c>t.far))return{distance:c,point:$u.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}var nd=class extends Zl{constructor(e){super(),this.isPointsMaterial=!0,this.type=`PointsMaterial`,this.color=new Q(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}},rd=new dc,id=new xu,ad=new Rl,od=new Z,sd=class extends Rc{constructor(e=new Kl,t=new nd){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){let n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),ad.copy(n.boundingSphere),ad.applyMatrix4(r),ad.radius+=i,e.ray.intersectsSphere(ad)===!1)return;rd.copy(r).invert(),id.copy(e.ray).applyMatrix4(rd);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,c=n.index,l=n.attributes.position;if(c!==null){let n=Math.max(0,a.start),i=Math.min(c.count,a.start+a.count);for(let a=n,o=i;a<o;a++){let n=c.getX(a);od.fromBufferAttribute(l,n),cd(od,n,s,r,e,t,this)}}else{let n=Math.max(0,a.start),i=Math.min(l.count,a.start+a.count);for(let a=n,o=i;a<o;a++)od.fromBufferAttribute(l,a),cd(od,a,s,r,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}};function cd(e,t,n,r,i,a,o){let s=id.distanceSqToPoint(e);if(s<n){let n=new Z;id.closestPointToPoint(e,n),n.applyMatrix4(r);let c=i.ray.origin.distanceTo(n);if(c<i.near||c>i.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var ld=class extends ac{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},ud=class extends ac{constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isCanvasTexture=!0,this.needsUpdate=!0}},dd=class extends ac{constructor(e,t,n=za,r,i,a,o=Oa,s=Oa,c,l=Xa,u=1){if(l!==1026&&l!==1027)throw Error(`THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new tc(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},fd=class extends dd{constructor(e,t=za,n=301,r,i,a=Oa,o=Oa,s,c=Xa){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},pd=class extends ac{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},md=class e extends Kl{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new Pl(c,3)),this.setAttribute(`normal`,new Pl(l,3)),this.setAttribute(`uv`,new Pl(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new Z;for(let a=0;a<w;a++){let o=a*y-x;for(let s=0;s<C;s++)D[e]=(s*v-b)*r,D[t]=o*i,D[n]=S,c.push(D.x,D.y,D.z),D[e]=0,D[t]=0,D[n]=m>0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e<g;e++)for(let t=0;t<h;t++){let n=d+t+C*e,r=d+t+C*(e+1),i=d+(t+1)+C*(e+1),a=d+(t+1)+C*e;s.push(n,r,a),s.push(r,i,a),E+=6}o.addGroup(f,E,_),f+=E,d+=T}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}},hd=class e extends Kl{constructor(e=1,t=1,n=1,r=32,i=1,a=!1,o=0,s=Math.PI*2){super(),this.type=`CylinderGeometry`,this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};let c=this;r=Math.floor(r),i=Math.floor(i);let l=[],u=[],d=[],f=[],p=0,m=[],h=n/2,g=0;_(),a===!1&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new Pl(u,3)),this.setAttribute(`normal`,new Pl(d,3)),this.setAttribute(`uv`,new Pl(f,2));function _(){let a=new Z,_=new Z,v=0,y=(t-e)/n;for(let c=0;c<=i;c++){let l=[],g=c/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,c=Math.sin(i),m=Math.cos(i);_.x=v*c,_.y=-g*n+h,_.z=v*m,u.push(_.x,_.y,_.z),a.set(c,y,m).normalize(),d.push(a.x,a.y,a.z),f.push(t,1-g),l.push(p++)}m.push(l)}for(let n=0;n<r;n++)for(let r=0;r<i;r++){let a=m[r][n],o=m[r+1][n],s=m[r+1][n+1],c=m[r][n+1];(e>0||r!==0)&&(l.push(a,o,c),v+=3),(t>0||r!==i-1)&&(l.push(o,s,c),v+=3)}c.addGroup(g,v,0),g+=v}function v(n){let i=p,a=new X,m=new Z,_=0,v=n===!0?e:t,y=n===!0?1:-1;for(let e=1;e<=r;e++)u.push(0,h*y,0),d.push(0,y,0),f.push(.5,.5),p++;let b=p;for(let e=0;e<=r;e++){let t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);m.x=v*i,m.y=h*y,m.z=v*n,u.push(m.x,m.y,m.z),d.push(0,y,0),a.x=n*.5+.5,a.y=i*.5*y+.5,f.push(a.x,a.y),p++}for(let e=0;e<r;e++){let t=i+e,r=b+e;n===!0?l.push(r,r+1,t):l.push(r+1,r,t),_+=3}c.addGroup(g,_,n===!0?1:2),g+=_}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}},gd=new Z,_d=new Z,vd=new Z,yd=new sl,bd=class extends Kl{constructor(e=null,t=1){if(super(),this.type=`EdgesGeometry`,this.parameters={geometry:e,thresholdAngle:t},e!==null){let n=10**4,r=Math.cos(gs*t),i=e.getIndex(),a=e.getAttribute(`position`),o=i?i.count:a.count,s=[0,0,0],c=[`a`,`b`,`c`],l=[,,,],u={},d=[];for(let e=0;e<o;e+=3){i?(s[0]=i.getX(e),s[1]=i.getX(e+1),s[2]=i.getX(e+2)):(s[0]=e,s[1]=e+1,s[2]=e+2);let{a:t,b:o,c:f}=yd;if(t.fromBufferAttribute(a,s[0]),o.fromBufferAttribute(a,s[1]),f.fromBufferAttribute(a,s[2]),yd.getNormal(vd),l[0]=`${Math.round(t.x*n)},${Math.round(t.y*n)},${Math.round(t.z*n)}`,l[1]=`${Math.round(o.x*n)},${Math.round(o.y*n)},${Math.round(o.z*n)}`,l[2]=`${Math.round(f.x*n)},${Math.round(f.y*n)},${Math.round(f.z*n)}`,l[0]!==l[1]&&l[1]!==l[2]&&l[2]!==l[0])for(let e=0;e<3;e++){let t=(e+1)%3,n=l[e],i=l[t],a=yd[c[e]],o=yd[c[t]],f=`${n}_${i}`,p=`${i}_${n}`;p in u&&u[p]?(vd.dot(u[p].normal)<=r&&(d.push(a.x,a.y,a.z),d.push(o.x,o.y,o.z)),u[p]=null):f in u||(u[f]={index0:s[e],index1:s[t],normal:vd.clone()})}}for(let e in u)if(u[e]){let{index0:t,index1:n}=u[e];gd.fromBufferAttribute(a,t),_d.fromBufferAttribute(a,n),d.push(gd.x,gd.y,gd.z),d.push(_d.x,_d.y,_d.z)}this.setAttribute(`position`,new Pl(d,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}},xd=class e extends Kl{constructor(e=1,t=1,n=1,r=1){super(),this.type=`PlaneGeometry`,this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};let i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),c=o+1,l=s+1,u=e/o,d=t/s,f=[],p=[],m=[],h=[];for(let e=0;e<l;e++){let t=e*d-a;for(let n=0;n<c;n++){let r=n*u-i;p.push(r,-t,0),m.push(0,0,1),h.push(n/o),h.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){let n=t+c*e,r=t+c*(e+1),i=t+1+c*(e+1),a=t+1+c*e;f.push(n,r,a),f.push(r,i,a)}this.setIndex(f),this.setAttribute(`position`,new Pl(p,3)),this.setAttribute(`normal`,new Pl(m,3)),this.setAttribute(`uv`,new Pl(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(t){return new e(t.width,t.height,t.widthSegments,t.heightSegments)}},Sd=class extends Kl{constructor(e=null){if(super(),this.type=`WireframeGeometry`,this.parameters={geometry:e},e!==null){let t=[],n=new Set,r=new Z,i=new Z;if(e.index!==null){let a=e.attributes.position,o=e.index,s=e.groups;s.length===0&&(s=[{start:0,count:o.count,materialIndex:0}]);for(let e=0,c=s.length;e<c;++e){let c=s[e],l=c.start,u=c.count;for(let e=l,s=l+u;e<s;e+=3)for(let s=0;s<3;s++){let c=o.getX(e+s),l=o.getX(e+(s+1)%3);r.fromBufferAttribute(a,c),i.fromBufferAttribute(a,l),Cd(r,i,n)===!0&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{let a=e.attributes.position;for(let e=0,o=a.count/3;e<o;e++)for(let o=0;o<3;o++){let s=3*e+o,c=3*e+(o+1)%3;r.fromBufferAttribute(a,s),i.fromBufferAttribute(a,c),Cd(r,i,n)===!0&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute(`position`,new Pl(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}};function Cd(e,t,n){let r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return n.has(r)===!0||n.has(i)===!0?!1:(n.add(r),n.add(i),!0)}function wd(e){let t={};for(let n in e){t[n]={};for(let r in e[n]){let i=e[n][r];if(Ed(i))i.isRenderTargetTexture?(cs(`UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().`),t[n][r]=null):t[n][r]=i.clone();else if(Array.isArray(i))if(Ed(i[0])){let e=[];for(let t=0,n=i.length;t<n;t++)e[t]=i[t].clone();t[n][r]=e}else t[n][r]=i.slice();else t[n][r]=i}}return t}function Td(e){let t={};for(let n=0;n<e.length;n++){let r=wd(e[n]);for(let e in r)t[e]=r[e]}return t}function Ed(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function Dd(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}function Od(e){let t=e.getRenderTarget();return t===null?e.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Ys.workingColorSpace}var kd={clone:wd,merge:Td},Ad=`void main() {
|
|
2
2
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
3
3
|
}`,jd=`void main() {
|
|
4
4
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|