@selvajs/selva 2.0.9 → 2.0.11
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/assets/0.B0phAlf7.css.gz +0 -0
- package/build/client/_app/immutable/assets/20.Bne67Vgr.css +1 -0
- package/build/client/_app/immutable/assets/20.Bne67Vgr.css.br +0 -0
- package/build/client/_app/immutable/assets/20.Bne67Vgr.css.gz +0 -0
- package/build/client/_app/immutable/assets/index.CV-KWLNP.css.gz +0 -0
- package/build/client/_app/immutable/chunks/1s2jTHrf.js.gz +0 -0
- package/build/client/_app/immutable/chunks/2XlIPTRw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/2_FEXmq1.js.gz +0 -0
- package/build/client/_app/immutable/chunks/2dX6Wjni.js.gz +0 -0
- package/build/client/_app/immutable/chunks/4tskcAVN.js.gz +0 -0
- package/build/client/_app/immutable/chunks/AEyooZaf.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B1aRL9Hz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B8uG8z2c.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B8zY50Bc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BCse3N0b.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BGxzXVpM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BM4_iXSA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BMGykAfL.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BNScKugQ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BNzEBMy8.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BU9URCkw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BW4xleRz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BZmrLQwT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B_Lmgh7q.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BapAUJpM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bb9xebuT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BjkQG7dw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bmz9gLBz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bnpwcepm.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BoR6OKl6.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Br5bpmJC.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BxCHY0iG.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C1Sz0rtw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C1aQuqo_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C26nmevH.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Dx1NLq6A.js → C7vGxU6A.js} +1 -1
- package/build/client/_app/immutable/chunks/C7vGxU6A.js.br +0 -0
- package/build/client/_app/immutable/chunks/C7vGxU6A.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C8ko2SLk.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CAMhfNhW.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CEnIp_6Y.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CMjc_m7Z.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{B1839-Qe.js → CQbfyd2L.js} +1 -1
- package/build/client/_app/immutable/chunks/CQbfyd2L.js.br +0 -0
- package/build/client/_app/immutable/chunks/CQbfyd2L.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CRRzXoPz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CXh1ITwj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CZ1oTCKP.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cbu9Tg11.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CcYNc8-G.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cdcajer6.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Ce2MupFq.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CfP1DoGT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CfhPDo21.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CkW8YtSm.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CoR7xVWs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CpGv0MSX.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cvr8AlQE.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D0QMYypb.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D40b34QZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D6MI_dhi.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D7l1JayF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D99uXqZb.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DEBBEmC0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DNsLImlA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DRDjLZb3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DTJeGfAL.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DZFqETAQ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D_wr-JLf.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BB7Ce_Ao.js → DhVbSqkb.js} +1 -1
- package/build/client/_app/immutable/chunks/DhVbSqkb.js.br +0 -0
- package/build/client/_app/immutable/chunks/DhVbSqkb.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dl4WTuMB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{8jxh9FTC.js → DmaxIj00.js} +1 -1
- package/build/client/_app/immutable/chunks/DmaxIj00.js.br +0 -0
- package/build/client/_app/immutable/chunks/DmaxIj00.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Doks8ISn.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DsnmJJEf.js.gz +0 -0
- package/build/client/_app/immutable/chunks/E3yOQTT0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Gxlzmh6y.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Ib-7xmHT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/P4Np3c9O.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Zf7VV5ZB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/_OLpdTiI.js.gz +0 -0
- package/build/client/_app/immutable/chunks/azBeeLR0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/gMllmzma.js.gz +0 -0
- package/build/client/_app/immutable/chunks/hRoV10UM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/iEBlyxZv.js.gz +0 -0
- package/build/client/_app/immutable/chunks/jFKgkeON.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BLObdRkl.js → m_mdPJGt.js} +2 -2
- package/build/client/_app/immutable/chunks/m_mdPJGt.js.br +0 -0
- package/build/client/_app/immutable/chunks/m_mdPJGt.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BG4KYJxd.js → o98Aze-n.js} +1 -1
- package/build/client/_app/immutable/chunks/o98Aze-n.js.br +0 -0
- package/build/client/_app/immutable/chunks/o98Aze-n.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ooPBmYPj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/pRg-f8xU.js.gz +0 -0
- package/build/client/_app/immutable/chunks/uINs3xv3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/wamM80bu.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.iSZ5n5at.js → app.BTWTTuAm.js} +2 -2
- package/build/client/_app/immutable/entry/app.BTWTTuAm.js.br +0 -0
- package/build/client/_app/immutable/entry/app.BTWTTuAm.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BH_CUTR9.js +1 -0
- package/build/client/_app/immutable/entry/start.BH_CUTR9.js.br +2 -0
- package/build/client/_app/immutable/entry/start.BH_CUTR9.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.KJ-PiM1c.js → 0.DlG8LAVR.js} +1 -1
- package/build/client/_app/immutable/nodes/0.DlG8LAVR.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.DlG8LAVR.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.B3iyxTLe.js → 1.DwOSHATI.js} +1 -1
- package/build/client/_app/immutable/nodes/1.DwOSHATI.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.DwOSHATI.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.C5pTC9MT.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{11.C0bOSA5Z.js → 11.Zly9hDVc.js} +1 -1
- package/build/client/_app/immutable/nodes/11.Zly9hDVc.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.Zly9hDVc.js.gz +0 -0
- package/build/client/_app/immutable/nodes/12.BoPfAFdi.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{13.BBX4st-t.js → 13.DPp5H0wF.js} +1 -1
- package/build/client/_app/immutable/nodes/13.DPp5H0wF.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.DPp5H0wF.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{14.S-GLVBVi.js → 14.Ckr1Pg-5.js} +1 -1
- package/build/client/_app/immutable/nodes/14.Ckr1Pg-5.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.Ckr1Pg-5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.CAs53i3e.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{16.ukqcuKdq.js → 16.D28cXk6c.js} +1 -1
- package/build/client/_app/immutable/nodes/16.D28cXk6c.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.D28cXk6c.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{17.DsZpiT_T.js → 17.zVEt35IE.js} +1 -1
- package/build/client/_app/immutable/nodes/17.zVEt35IE.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.zVEt35IE.js.gz +0 -0
- package/build/client/_app/immutable/nodes/18.BpVlwZ30.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{19.De1qTu0Z.js → 19.BVpcFyka.js} +1 -1
- package/build/client/_app/immutable/nodes/19.BVpcFyka.js.br +0 -0
- package/build/client/_app/immutable/nodes/19.BVpcFyka.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.D9zIVWl1.js → 2.CQHOuONl.js} +1 -1
- package/build/client/_app/immutable/nodes/2.CQHOuONl.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.CQHOuONl.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{20.DxsctpJH.js → 20.BCewwiaR.js} +6 -6
- package/build/client/_app/immutable/nodes/20.BCewwiaR.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.BCewwiaR.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.BsayWLjJ.js +4 -0
- package/build/client/_app/immutable/nodes/21.BsayWLjJ.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.BsayWLjJ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{23.VZ_boRL-.js → 23.DqdpBgOG.js} +1 -1
- package/build/client/_app/immutable/nodes/23.DqdpBgOG.js.br +0 -0
- package/build/client/_app/immutable/nodes/23.DqdpBgOG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{24.B9kY2pb5.js → 24.PfN1WmGB.js} +1 -1
- package/build/client/_app/immutable/nodes/24.PfN1WmGB.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.PfN1WmGB.js.gz +0 -0
- package/build/client/_app/immutable/nodes/25.oeBaWIUn.js.gz +0 -0
- package/build/client/_app/immutable/nodes/26.lPx5SjN1.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{27.DZwrstUI.js → 27.ps76gC2y.js} +1 -1
- package/build/client/_app/immutable/nodes/27.ps76gC2y.js.br +0 -0
- package/build/client/_app/immutable/nodes/27.ps76gC2y.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{28.MnyfwNy0.js → 28.jwW5ZPBb.js} +1 -1
- package/build/client/_app/immutable/nodes/28.jwW5ZPBb.js.br +0 -0
- package/build/client/_app/immutable/nodes/28.jwW5ZPBb.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{29.CNTJCITP.js → 29.C4UksAwf.js} +1 -1
- package/build/client/_app/immutable/nodes/29.C4UksAwf.js.br +0 -0
- package/build/client/_app/immutable/nodes/{29.CNTJCITP.js.gz → 29.C4UksAwf.js.gz} +0 -0
- package/build/client/_app/immutable/nodes/{3.KI4lh69U.js → 3.DeyGtotz.js} +1 -1
- package/build/client/_app/immutable/nodes/3.DeyGtotz.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.DeyGtotz.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{30.Ct1smdjS.js → 30.Ba8GVvTS.js} +1 -1
- package/build/client/_app/immutable/nodes/30.Ba8GVvTS.js.br +0 -0
- package/build/client/_app/immutable/nodes/30.Ba8GVvTS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/31.DKnO7o1W.js.gz +0 -0
- package/build/client/_app/immutable/nodes/32.D4xYDWvG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.0a-qdY5B.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{5.BN9x0bOB.js → 5.CEzlqY4U.js} +1 -1
- package/build/client/_app/immutable/nodes/5.CEzlqY4U.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.CEzlqY4U.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{6.BU_SGWVX.js → 6.CUbjblGG.js} +1 -1
- package/build/client/_app/immutable/nodes/6.CUbjblGG.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.CUbjblGG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.9jzNcaAs.js → 7.C7uFakzg.js} +1 -1
- package/build/client/_app/immutable/nodes/7.C7uFakzg.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.C7uFakzg.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{8.BvaBLt60.js → 8.DV-QvL-P.js} +1 -1
- package/build/client/_app/immutable/nodes/8.DV-QvL-P.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.DV-QvL-P.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.Cowm-e34.js +1 -0
- package/build/client/_app/immutable/nodes/9.Cowm-e34.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.Cowm-e34.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/client/favicon/favicon.svg.gz +0 -0
- package/build/client/robots.txt.gz +0 -0
- package/build/server/chunks/{0-CybFR_P8.js → 0-Dr_3KI7H.js} +4 -4
- package/build/server/chunks/{0-CybFR_P8.js.map → 0-Dr_3KI7H.js.map} +1 -1
- package/build/server/chunks/{1-CUP4tMEn.js → 1-DpVveeAx.js} +2 -2
- package/build/server/chunks/{1-CUP4tMEn.js.map → 1-DpVveeAx.js.map} +1 -1
- package/build/server/chunks/{10-zdkaINz9.js → 10-2TpR0PL8.js} +4 -4
- package/build/server/chunks/{10-zdkaINz9.js.map → 10-2TpR0PL8.js.map} +1 -1
- package/build/server/chunks/{11-DHKq5wgm.js → 11-Bc-lK9-m.js} +6 -6
- package/build/server/chunks/{11-DHKq5wgm.js.map → 11-Bc-lK9-m.js.map} +1 -1
- package/build/server/chunks/{12-XbcleGFd.js → 12-ChbvAloo.js} +2 -2
- package/build/server/chunks/{12-XbcleGFd.js.map → 12-ChbvAloo.js.map} +1 -1
- package/build/server/chunks/{13-D9eyZVCZ.js → 13-Dlj23jh3.js} +3 -3
- package/build/server/chunks/{13-D9eyZVCZ.js.map → 13-Dlj23jh3.js.map} +1 -1
- package/build/server/chunks/{14-qYW-h0op.js → 14-D1elkPr9.js} +3 -3
- package/build/server/chunks/{14-qYW-h0op.js.map → 14-D1elkPr9.js.map} +1 -1
- package/build/server/chunks/{15-wi_onU5j.js → 15-DPDMpQHT.js} +3 -3
- package/build/server/chunks/15-DPDMpQHT.js.map +1 -0
- package/build/server/chunks/{16-BM4yvuKv.js → 16-BAIR1y-G.js} +5 -5
- package/build/server/chunks/{16-BM4yvuKv.js.map → 16-BAIR1y-G.js.map} +1 -1
- package/build/server/chunks/{17-CexG3wap.js → 17-Bgy8wV-3.js} +2 -2
- package/build/server/chunks/{17-CexG3wap.js.map → 17-Bgy8wV-3.js.map} +1 -1
- package/build/server/chunks/{18-DbXlY9LE.js → 18-B12TC_xG.js} +2 -2
- package/build/server/chunks/{18-DbXlY9LE.js.map → 18-B12TC_xG.js.map} +1 -1
- package/build/server/chunks/{19-AX88i2oC.js → 19-DFUJ-cPC.js} +3 -3
- package/build/server/chunks/{19-AX88i2oC.js.map → 19-DFUJ-cPC.js.map} +1 -1
- package/build/server/chunks/{2-BMbliYzg.js → 2-C5cHr5Wg.js} +5 -5
- package/build/server/chunks/{2-BMbliYzg.js.map → 2-C5cHr5Wg.js.map} +1 -1
- package/build/server/chunks/{20-S3QlkFoL.js → 20-7IiGDCfi.js} +11 -11
- package/build/server/chunks/{20-S3QlkFoL.js.map → 20-7IiGDCfi.js.map} +1 -1
- package/build/server/chunks/{21-BAKPEyjQ.js → 21-CNigSlHO.js} +20 -7
- package/build/server/chunks/21-CNigSlHO.js.map +1 -0
- package/build/server/chunks/{23-DCiJWF0i.js → 23-Co-jOKsq.js} +6 -6
- package/build/server/chunks/{23-DCiJWF0i.js.map → 23-Co-jOKsq.js.map} +1 -1
- package/build/server/chunks/{24-B3gXWNYD.js → 24-DvOkSXb5.js} +4 -4
- package/build/server/chunks/{24-B3gXWNYD.js.map → 24-DvOkSXb5.js.map} +1 -1
- package/build/server/chunks/{25-9yYU1YBX.js → 25-CryepyT_.js} +2 -2
- package/build/server/chunks/{25-9yYU1YBX.js.map → 25-CryepyT_.js.map} +1 -1
- package/build/server/chunks/{27-GMsHFaaf.js → 27-DtqBEyra.js} +4 -4
- package/build/server/chunks/{27-GMsHFaaf.js.map → 27-DtqBEyra.js.map} +1 -1
- package/build/server/chunks/{28-DnplSoj0.js → 28-nphTAiOz.js} +3 -3
- package/build/server/chunks/{28-DnplSoj0.js.map → 28-nphTAiOz.js.map} +1 -1
- package/build/server/chunks/{29-orcjqU9J.js → 29-qD2ff8yc.js} +3 -3
- package/build/server/chunks/{29-orcjqU9J.js.map → 29-qD2ff8yc.js.map} +1 -1
- package/build/server/chunks/{3-B57IoxU7.js → 3-C1ShQmRn.js} +2 -2
- package/build/server/chunks/{3-B57IoxU7.js.map → 3-C1ShQmRn.js.map} +1 -1
- package/build/server/chunks/{30-UoUq_V5A.js → 30-DWf41Hl_.js} +3 -3
- package/build/server/chunks/{30-UoUq_V5A.js.map → 30-DWf41Hl_.js.map} +1 -1
- package/build/server/chunks/{31-BRqIoy8w.js → 31-S98r5Afv.js} +2 -2
- package/build/server/chunks/{31-BRqIoy8w.js.map → 31-S98r5Afv.js.map} +1 -1
- package/build/server/chunks/{32-D1Mk43AX.js → 32-EvYDgnSw.js} +2 -2
- package/build/server/chunks/{32-D1Mk43AX.js.map → 32-EvYDgnSw.js.map} +1 -1
- package/build/server/chunks/{5-DMGFkyK4.js → 5-DTeumakx.js} +2 -2
- package/build/server/chunks/{5-DMGFkyK4.js.map → 5-DTeumakx.js.map} +1 -1
- package/build/server/chunks/{6-CYaPOOMj.js → 6-BYo6Qo8b.js} +3 -3
- package/build/server/chunks/{6-CYaPOOMj.js.map → 6-BYo6Qo8b.js.map} +1 -1
- package/build/server/chunks/{7-Dk_VmXtf.js → 7-qSmAP9RY.js} +2 -2
- package/build/server/chunks/{7-Dk_VmXtf.js.map → 7-qSmAP9RY.js.map} +1 -1
- package/build/server/chunks/{8-Ce8EjQtB.js → 8-DeuHkUMB.js} +3 -3
- package/build/server/chunks/{8-Ce8EjQtB.js.map → 8-DeuHkUMB.js.map} +1 -1
- package/build/server/chunks/{9-DghkKEyM.js → 9-g6Y-orbL.js} +4 -4
- package/build/server/chunks/{9-DghkKEyM.js.map → 9-g6Y-orbL.js.map} +1 -1
- package/build/server/chunks/{_layout.svelte-xYAKGoE5.js → _layout.svelte-BvTGPzuy.js} +4 -4
- package/build/server/chunks/{_layout.svelte-xYAKGoE5.js.map → _layout.svelte-BvTGPzuy.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-BR8dze-7.js → _page.svelte-Cj20v_rA.js} +14 -14
- package/build/server/chunks/_page.svelte-Cj20v_rA.js.map +1 -0
- package/build/server/chunks/{_page.svelte-DSpONoJg.js → _page.svelte-CqD36W22.js} +10 -3
- package/build/server/chunks/_page.svelte-CqD36W22.js.map +1 -0
- package/build/server/chunks/{_page.svelte-BCCCalas.js → _page.svelte-ewKjgRGP.js} +5 -5
- package/build/server/chunks/_page.svelte-ewKjgRGP.js.map +1 -0
- package/build/server/chunks/{_server.ts-BX0JGorf.js → _server.ts-8QjiYm48.js} +4 -4
- package/build/server/chunks/{_server.ts-BX0JGorf.js.map → _server.ts-8QjiYm48.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CHvipMjS.js → _server.ts-BB8U11yC.js} +4 -4
- package/build/server/chunks/{_server.ts-CHvipMjS.js.map → _server.ts-BB8U11yC.js.map} +1 -1
- package/build/server/chunks/{_server.ts-D5nruaeK.js → _server.ts-BNhuuE9J.js} +6 -6
- package/build/server/chunks/{_server.ts-D5nruaeK.js.map → _server.ts-BNhuuE9J.js.map} +1 -1
- package/build/server/chunks/{_server.ts-7mF4ytYC.js → _server.ts-BctA3275.js} +4 -4
- package/build/server/chunks/{_server.ts-7mF4ytYC.js.map → _server.ts-BctA3275.js.map} +1 -1
- package/build/server/chunks/{_server.ts-B2zQRDbu.js → _server.ts-C72MeQO4.js} +2 -2
- package/build/server/chunks/{_server.ts-B2zQRDbu.js.map → _server.ts-C72MeQO4.js.map} +1 -1
- package/build/server/chunks/{_server.ts-kUn8v9xq.js → _server.ts-C9Y8O11v.js} +4 -4
- package/build/server/chunks/{_server.ts-kUn8v9xq.js.map → _server.ts-C9Y8O11v.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CKENL0Fr.js → _server.ts-CBXJ3sWT.js} +4 -4
- package/build/server/chunks/{_server.ts-CKENL0Fr.js.map → _server.ts-CBXJ3sWT.js.map} +1 -1
- package/build/server/chunks/{_server.ts-DLHHpGFa.js → _server.ts-CBupEVgc.js} +3 -3
- package/build/server/chunks/{_server.ts-DLHHpGFa.js.map → _server.ts-CBupEVgc.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BDeXzj8U.js → _server.ts-CCaOj5qQ.js} +4 -4
- package/build/server/chunks/{_server.ts-BDeXzj8U.js.map → _server.ts-CCaOj5qQ.js.map} +1 -1
- package/build/server/chunks/{_server.ts-c9y4czsq.js → _server.ts-CVDCtecg.js} +4 -4
- package/build/server/chunks/{_server.ts-c9y4czsq.js.map → _server.ts-CVDCtecg.js.map} +1 -1
- package/build/server/chunks/{_server.ts-DOstgfdy.js → _server.ts-CYRzm3Te.js} +4 -4
- package/build/server/chunks/{_server.ts-DOstgfdy.js.map → _server.ts-CYRzm3Te.js.map} +1 -1
- package/build/server/chunks/{_server.ts-DjEulrER.js → _server.ts-CapRJaU0.js} +4 -4
- package/build/server/chunks/{_server.ts-DjEulrER.js.map → _server.ts-CapRJaU0.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BaHBgmBs.js → _server.ts-CffaoluO.js} +4 -4
- package/build/server/chunks/{_server.ts-BaHBgmBs.js.map → _server.ts-CffaoluO.js.map} +1 -1
- package/build/server/chunks/{_server.ts-Dx6fUVVo.js → _server.ts-Ci4bczRU.js} +3 -3
- package/build/server/chunks/{_server.ts-Dx6fUVVo.js.map → _server.ts-Ci4bczRU.js.map} +1 -1
- package/build/server/chunks/{_server.ts-C9SZ9y6W.js → _server.ts-D0jpDtY6.js} +7 -7
- package/build/server/chunks/{_server.ts-C9SZ9y6W.js.map → _server.ts-D0jpDtY6.js.map} +1 -1
- package/build/server/chunks/{_server.ts-hNeWcDQg.js → _server.ts-D3U55JtM.js} +5 -5
- package/build/server/chunks/{_server.ts-hNeWcDQg.js.map → _server.ts-D3U55JtM.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BSZknGSV.js → _server.ts-DA2gHOEv.js} +4 -4
- package/build/server/chunks/{_server.ts-BSZknGSV.js.map → _server.ts-DA2gHOEv.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CIAkL4VM.js → _server.ts-DH46mwMu.js} +4 -4
- package/build/server/chunks/{_server.ts-CIAkL4VM.js.map → _server.ts-DH46mwMu.js.map} +1 -1
- package/build/server/chunks/{_server.ts-DMSCxMRc.js → _server.ts-DIA0nypE.js} +4 -4
- package/build/server/chunks/{_server.ts-DMSCxMRc.js.map → _server.ts-DIA0nypE.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CS_06-Es.js → _server.ts-DIDUPMUT.js} +4 -4
- package/build/server/chunks/{_server.ts-CS_06-Es.js.map → _server.ts-DIDUPMUT.js.map} +1 -1
- package/build/server/chunks/{_server.ts-Njof323z.js → _server.ts-DLL3XSZW.js} +5 -5
- package/build/server/chunks/{_server.ts-Njof323z.js.map → _server.ts-DLL3XSZW.js.map} +1 -1
- package/build/server/chunks/{_server.ts-MKn8v93k.js → _server.ts-DT5OwjDI.js} +4 -4
- package/build/server/chunks/{_server.ts-MKn8v93k.js.map → _server.ts-DT5OwjDI.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BbvHHiGq.js → _server.ts-DZfNclhh.js} +4 -4
- package/build/server/chunks/{_server.ts-BbvHHiGq.js.map → _server.ts-DZfNclhh.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BYTe4ViD.js → _server.ts-DkekkLe3.js} +4 -4
- package/build/server/chunks/{_server.ts-BYTe4ViD.js.map → _server.ts-DkekkLe3.js.map} +1 -1
- package/build/server/chunks/{_server.ts-B-LWyGZ8.js → _server.ts-DqSYGJwj.js} +4 -4
- package/build/server/chunks/{_server.ts-B-LWyGZ8.js.map → _server.ts-DqSYGJwj.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CKtVrr5P.js → _server.ts-Dvw_Z0Cw.js} +4 -4
- package/build/server/chunks/{_server.ts-CKtVrr5P.js.map → _server.ts-Dvw_Z0Cw.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BEGEbcQ_.js → _server.ts-L9E2K0UZ.js} +4 -4
- package/build/server/chunks/{_server.ts-BEGEbcQ_.js.map → _server.ts-L9E2K0UZ.js.map} +1 -1
- package/build/server/chunks/{_server.ts-Du9sjt--.js → _server.ts-OFmjL3-M.js} +4 -4
- package/build/server/chunks/{_server.ts-Du9sjt--.js.map → _server.ts-OFmjL3-M.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BUI9hwVF.js → _server.ts-PFG4aGE3.js} +4 -4
- package/build/server/chunks/{_server.ts-BUI9hwVF.js.map → _server.ts-PFG4aGE3.js.map} +1 -1
- package/build/server/chunks/{_server.ts-MvJCHr1k.js → _server.ts-SVtgpOfH.js} +3 -3
- package/build/server/chunks/{_server.ts-MvJCHr1k.js.map → _server.ts-SVtgpOfH.js.map} +1 -1
- package/build/server/chunks/{_server.ts-WfRBOO6r.js → _server.ts-YJbrc522.js} +4 -4
- package/build/server/chunks/{_server.ts-WfRBOO6r.js.map → _server.ts-YJbrc522.js.map} +1 -1
- package/build/server/chunks/{_server.ts-VbLWxdNH.js → _server.ts-bN4Lz9RH.js} +4 -4
- package/build/server/chunks/{_server.ts-VbLWxdNH.js.map → _server.ts-bN4Lz9RH.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BEW1ndmL.js → _server.ts-bnATlqbs.js} +5 -5
- package/build/server/chunks/{_server.ts-BEW1ndmL.js.map → _server.ts-bnATlqbs.js.map} +1 -1
- package/build/server/chunks/{_server.ts-07x4zjP2.js → _server.ts-eUYIsIFa.js} +4 -4
- package/build/server/chunks/{_server.ts-07x4zjP2.js.map → _server.ts-eUYIsIFa.js.map} +1 -1
- package/build/server/chunks/{_server.ts-BXGCxm6J.js → _server.ts-pQtrhbNR.js} +5 -5
- package/build/server/chunks/{_server.ts-BXGCxm6J.js.map → _server.ts-pQtrhbNR.js.map} +1 -1
- package/build/server/chunks/{_server.ts-B6Zmqwf5.js → _server.ts-tZLezQ2K.js} +4 -4
- package/build/server/chunks/{_server.ts-B6Zmqwf5.js.map → _server.ts-tZLezQ2K.js.map} +1 -1
- package/build/server/chunks/{_server.ts-DmvmgVIf.js → _server.ts-yWNI61C2.js} +5 -5
- package/build/server/chunks/{_server.ts-DmvmgVIf.js.map → _server.ts-yWNI61C2.js.map} +1 -1
- package/build/server/chunks/{_server.ts-DahXKbZg.js → _server.ts-z7zvXa1n.js} +3 -3
- package/build/server/chunks/{_server.ts-DahXKbZg.js.map → _server.ts-z7zvXa1n.js.map} +1 -1
- package/build/server/chunks/{access.server-DGKSuoRH.js → access.server-BIbrdwtI.js} +3 -3
- package/build/server/chunks/{access.server-DGKSuoRH.js.map → access.server-BIbrdwtI.js.map} +1 -1
- package/build/server/chunks/{api-errors-DSza0CJv.js → api-errors-Dvd_bb0g.js} +2 -2
- package/build/server/chunks/{api-errors-DSza0CJv.js.map → api-errors-Dvd_bb0g.js.map} +1 -1
- package/build/server/chunks/{auth-bootstrap.server-YBvyz9i1.js → auth-bootstrap.server-B93MMm50.js} +3 -2
- package/build/server/chunks/auth-bootstrap.server-B93MMm50.js.map +1 -0
- package/build/server/chunks/{bootHealth.server-DwPUi_JC.js → bootHealth.server-CCMjOn0m.js} +2 -2
- package/build/server/chunks/{bootHealth.server-DwPUi_JC.js.map → bootHealth.server-CCMjOn0m.js.map} +1 -1
- package/build/server/chunks/{hooks.server---blwhkE.js → hooks.server-BEJK3uzD.js} +29 -4
- package/build/server/chunks/hooks.server-BEJK3uzD.js.map +1 -0
- package/build/server/chunks/{permissions.server-toUY36oB.js → permissions.server-Bfvp6EaK.js} +2 -2
- package/build/server/chunks/{permissions.server-toUY36oB.js.map → permissions.server-Bfvp6EaK.js.map} +1 -1
- package/build/server/chunks/{providers.server-gJvnJT_K.js → providers.server-CuhJFeVB.js} +39 -3
- package/build/server/chunks/providers.server-CuhJFeVB.js.map +1 -0
- package/build/server/chunks/{resolve.server-Ca9AsrIQ.js → resolve.server-ButnJP6T.js} +3 -3
- package/build/server/chunks/{resolve.server-Ca9AsrIQ.js.map → resolve.server-ButnJP6T.js.map} +1 -1
- package/build/server/chunks/{resolve.server2-B0RMxSCk.js → resolve.server2-BniR9tSC.js} +2 -2
- package/build/server/chunks/{resolve.server2-B0RMxSCk.js.map → resolve.server2-BniR9tSC.js.map} +1 -1
- package/build/server/chunks/{utils2-DfCIUv4X.js → utils2-BZ2tVtxn.js} +2 -2
- package/build/server/chunks/{utils2-DfCIUv4X.js.map → utils2-BZ2tVtxn.js.map} +1 -1
- package/build/server/index.js +2 -2
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +70 -70
- package/build/server/manifest.js.map +1 -1
- package/package.json +3 -3
- package/build/client/.!34937!selva_example_0_1_0.gh +0 -0
- package/build/client/_app/immutable/assets/20.5bKkcx-V.css +0 -1
- package/build/client/_app/immutable/assets/20.5bKkcx-V.css.br +0 -0
- package/build/client/_app/immutable/assets/20.5bKkcx-V.css.gz +0 -0
- package/build/client/_app/immutable/chunks/8jxh9FTC.js.br +0 -0
- package/build/client/_app/immutable/chunks/8jxh9FTC.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B1839-Qe.js.br +0 -0
- package/build/client/_app/immutable/chunks/B1839-Qe.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BB7Ce_Ao.js.br +0 -0
- package/build/client/_app/immutable/chunks/BB7Ce_Ao.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BG4KYJxd.js.br +0 -0
- package/build/client/_app/immutable/chunks/BG4KYJxd.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BLObdRkl.js.br +0 -0
- package/build/client/_app/immutable/chunks/BLObdRkl.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dx1NLq6A.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dx1NLq6A.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.iSZ5n5at.js.br +0 -0
- package/build/client/_app/immutable/entry/app.iSZ5n5at.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.DN1mprbr.js +0 -1
- package/build/client/_app/immutable/entry/start.DN1mprbr.js.br +0 -2
- package/build/client/_app/immutable/entry/start.DN1mprbr.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.KJ-PiM1c.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.KJ-PiM1c.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.B3iyxTLe.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.B3iyxTLe.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.C0bOSA5Z.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.C0bOSA5Z.js.gz +0 -0
- package/build/client/_app/immutable/nodes/13.BBX4st-t.js.br +0 -0
- package/build/client/_app/immutable/nodes/13.BBX4st-t.js.gz +0 -0
- package/build/client/_app/immutable/nodes/14.S-GLVBVi.js.br +0 -0
- package/build/client/_app/immutable/nodes/14.S-GLVBVi.js.gz +0 -0
- package/build/client/_app/immutable/nodes/16.ukqcuKdq.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.ukqcuKdq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/17.DsZpiT_T.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.DsZpiT_T.js.gz +0 -0
- package/build/client/_app/immutable/nodes/19.De1qTu0Z.js.br +0 -0
- package/build/client/_app/immutable/nodes/19.De1qTu0Z.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.D9zIVWl1.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.D9zIVWl1.js.gz +0 -0
- package/build/client/_app/immutable/nodes/20.DxsctpJH.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.DxsctpJH.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.-SL0S8PQ.js +0 -3
- package/build/client/_app/immutable/nodes/21.-SL0S8PQ.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.-SL0S8PQ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/23.VZ_boRL-.js.br +0 -0
- package/build/client/_app/immutable/nodes/23.VZ_boRL-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/24.B9kY2pb5.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.B9kY2pb5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/27.DZwrstUI.js.br +0 -0
- package/build/client/_app/immutable/nodes/27.DZwrstUI.js.gz +0 -0
- package/build/client/_app/immutable/nodes/28.MnyfwNy0.js.br +0 -0
- package/build/client/_app/immutable/nodes/28.MnyfwNy0.js.gz +0 -0
- package/build/client/_app/immutable/nodes/29.CNTJCITP.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.KI4lh69U.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.KI4lh69U.js.gz +0 -0
- package/build/client/_app/immutable/nodes/30.Ct1smdjS.js.br +0 -0
- package/build/client/_app/immutable/nodes/30.Ct1smdjS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.BN9x0bOB.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.BN9x0bOB.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.BU_SGWVX.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.BU_SGWVX.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.9jzNcaAs.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.9jzNcaAs.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.BvaBLt60.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.BvaBLt60.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.CzG8ag1t.js +0 -1
- package/build/client/_app/immutable/nodes/9.CzG8ag1t.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.CzG8ag1t.js.gz +0 -0
- package/build/server/chunks/15-wi_onU5j.js.map +0 -1
- package/build/server/chunks/21-BAKPEyjQ.js.map +0 -1
- package/build/server/chunks/_page.svelte-BCCCalas.js.map +0 -1
- package/build/server/chunks/_page.svelte-BR8dze-7.js.map +0 -1
- package/build/server/chunks/_page.svelte-DSpONoJg.js.map +0 -1
- package/build/server/chunks/auth-bootstrap.server-YBvyz9i1.js.map +0 -1
- package/build/server/chunks/hooks.server---blwhkE.js.map +0 -1
- package/build/server/chunks/providers.server-gJvnJT_K.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../chunks/DsnmJJEf.js";import{a$ as ap,bb as op,bl as lp,S as cp,R as ha,T as up,g as d,j as O,e as we,u as z,k as Rt,K as nn,p as nt,f as ae,a as it,s as ue,c as Q,n as Ut,r as q,ax as dp,t as Le,a8 as $i,b as ct,h as $n,J as hp,bm as jd,i as fp,at as lu,bn as cu}from"../chunks/ooPBmYPj.js";import{c as Pe,a as D,p as Un,f as Z,t as Tt,d as pp}from"../chunks/_OLpdTiI.js";import{i as _e}from"../chunks/C8ko2SLk.js";import{_ as qd}from"../chunks/BapAUJpM.js";import{o as Kt,s as Ze,a as Lt,d as Gn,c as mp,e as gp}from"../chunks/BMGykAfL.js";import{S as vp}from"../chunks/DRDjLZb3.js";import{a as _p,D as Kd,A as xp,U as bp}from"../chunks/8jxh9FTC.js";import{A as Sp,o as yp,d as Zd,u as Mp,g as Ep,k as wp}from"../chunks/CZ1oTCKP.js";import{f as sn,r as kl,e as Ht,a as Vt,c as At,d as fa,k as $d,l as za,j as hi,s as Tp}from"../chunks/C1aQuqo_.js";import{s as _t,p as me,r as lt,c as We,b as Nn}from"../chunks/CcYNc8-G.js";import{p as uu}from"../chunks/B1839-Qe.js";import{o as Ea,a as Jd}from"../chunks/D0QMYypb.js";import{w as Js,F as du}from"../chunks/2_FEXmq1.js";import{b as Qd}from"../chunks/DEBBEmC0.js";import{S as is}from"../chunks/C1Sz0rtw.js";import{S as pa}from"../chunks/D_wr-JLf.js";import{S as hu}from"../chunks/Doks8ISn.js";import{C as eh}from"../chunks/hRoV10UM.js";import{I as an,c as Ln}from"../chunks/Bnpwcepm.js";import{X as Ap}from"../chunks/CEnIp_6Y.js";import{R as Ar,D as Rr,b as Ji,T as Qs,a as rs,c as ss}from"../chunks/CpGv0MSX.js";import{s as Ct}from"../chunks/BNScKugQ.js";import{a as Hn,e as tr,h as ma,x as Rp,c as Vl,b as xi,d as ut,m as fn,s as Io,r as Hl,S as Cp,y as Pp}from"../chunks/CRRzXoPz.js";import{B as mn}from"../chunks/azBeeLR0.js";import{P as Dp,F as fu,D as ka,U as pu}from"../chunks/C26nmevH.js";import{C as th}from"../chunks/Zf7VV5ZB.js";import{C as zi,w as Fi,E as Ip,S as Lp,i as Np,b as nh,a as ih,A as rh,c as sh,H as ah,d as oh,f as lh,n as mu}from"../chunks/gMllmzma.js";import{i as Up,H as Fp,o as ch,c as Op,R as Bp,S as zp,a as kp,b as Vp}from"../chunks/BGxzXVpM.js";import{h as Hp}from"../chunks/iEBlyxZv.js";import{T as Gp,a as Wp,b as Xp,d as Yp,c as jp}from"../chunks/1s2jTHrf.js";import{C as uh,a as Cr}from"../chunks/wamM80bu.js";import{C as dh}from"../chunks/D99uXqZb.js";import{C as qp,a as Kp}from"../chunks/uINs3xv3.js";import{C as Zp}from"../chunks/BU9URCkw.js";import{C as $p}from"../chunks/D7l1JayF.js";import{L as Di}from"../chunks/B8uG8z2c.js";import{I as Pr}from"../chunks/jFKgkeON.js";import{t as Jp}from"../chunks/BoR6OKl6.js";import{F as Qp}from"../chunks/pRg-f8xU.js";import{r as em}from"../chunks/Cbu9Tg11.js";import{C as tm}from"../chunks/BjkQG7dw.js";const nm=[];function Gl(n,e=!1,t=!1){return ea(n,new Map,"",nm,null,t)}function ea(n,e,t,i,r=null,s=!1){if(typeof n=="object"&&n!==null){var a=e.get(n);if(a!==void 0)return a;if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);if(ap(n)){var o=Array(n.length);e.set(n,o),r!==null&&e.set(r,o);for(var l=0;l<n.length;l+=1){var c=n[l];l in n&&(o[l]=ea(c,e,t,i,null,s))}return o}if(op(n)===lp){o={},e.set(n,o),r!==null&&e.set(r,o);for(var u of Object.keys(n))o[u]=ea(n[u],e,t,i,null,s);return o}if(n instanceof Date)return structuredClone(n);if(typeof n.toJSON=="function"&&!s)return ea(n.toJSON(),e,t,i,n)}if(n instanceof EventTarget)return n;try{return structuredClone(n)}catch{return n}}class im{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return cp(this.#t)}get(){const e=ha(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=ha(this.#t);return t===void 0?e:t}set(e){return up(this.#t,e)}}function rm(n,e){if(Up(n)){const i=n();return i===void 0?e:i}return n===void 0?e:n}function wa(n,e){let t=we(null);const i=z(()=>rm(e,250));function r(...s){if(d(t))d(t).timeout&&clearTimeout(d(t).timeout);else{let a,o;const l=new Promise((c,u)=>{a=c,o=u});O(t,{timeout:null,runner:null,promise:l,resolve:a,reject:o},!0)}return d(t).runner=async()=>{if(!d(t))return;const a=d(t);O(t,null);try{a.resolve(await n.apply(this,s))}catch(o){a.reject(o)}},d(t).timeout=setTimeout(d(t).runner,d(i)),d(t).promise}return r.cancel=async()=>{(!d(t)||d(t).timeout===null)&&(await new Promise(s=>setTimeout(s,0)),!d(t)||d(t).timeout===null)||(clearTimeout(d(t).timeout),d(t).reject("Cancelled"),O(t,null))},r.runScheduledNow=async()=>{(!d(t)||!d(t).timeout)&&(await new Promise(s=>setTimeout(s,0)),!d(t)||!d(t).timeout)||(clearTimeout(d(t).timeout),d(t).timeout=null,await d(t).runner?.())},Object.defineProperty(r,"pending",{enumerable:!0,get(){return!!d(t)?.timeout}}),r}class Wl{#e=we(!1);constructor(){Rt(()=>(nn(()=>O(this.#e,!0)),()=>{O(this.#e,!1)}))}get current(){return d(this.#e)}}const sm=Vl({component:"checkbox",parts:["root","group","group-label","input"]}),am=new zi("Checkbox.Group"),hh=new zi("Checkbox.Root");class Xl{static create(e,t=null){return hh.set(new Xl(e,t))}opts;group;#e=z(()=>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){O(this.#e,e)}#t=z(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return d(this.#t)}set trueRequired(e){O(this.#t,e)}#n=z(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return d(this.#n)}set trueDisabled(e){O(this.#n,e)}#i=z(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return d(this.#i)}set trueReadonly(e){O(this.#i,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=Hn(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),Fi.pre([()=>Gl(this.group?.opts.value.current),()=>this.opts.value.current],([i,r])=>{!i||!r||(this.opts.checked.current=i.includes(r))}),Fi.pre(()=>this.opts.checked.current,i=>{this.group&&(i?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===Ip){e.preventDefault(),this.opts.type.current==="submit"&&e.currentTarget.closest("form")?.requestSubmit();return}e.key===Lp&&(e.preventDefault(),this.#r())}}#r(){this.opts.indeterminate.current?(this.opts.indeterminate.current=!1,this.opts.checked.current=!0):this.opts.checked.current=!this.opts.checked.current}onclick(e){if(!(this.trueDisabled||this.trueReadonly)){if(this.opts.type.current==="submit"){this.#r();return}e.preventDefault(),this.#r()}}#s=z(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return d(this.#s)}set snippetProps(e){O(this.#s,e)}#a=z(()=>({id:this.opts.id.current,role:"checkbox",type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":Rp(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":ma(this.trueRequired),"aria-readonly":ma(this.trueReadonly),"data-disabled":tr(this.trueDisabled),"data-readonly":tr(this.trueReadonly),"data-state":om(this.opts.checked.current,this.opts.indeterminate.current),[sm.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return d(this.#a)}set props(e){O(this.#a,e)}}class Yl{static create(){return new Yl(hh.get())}root;#e=z(()=>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){O(this.#e,e)}#t=z(()=>!!this.root.trueName);get shouldRender(){return d(this.#t)}set shouldRender(e){O(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){Np(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=z(()=>({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){O(this.#n,e)}}function om(n,e){return e?"indeterminate":n?"checked":"unchecked"}function lm(n,e){nt(e,!0);const t=Yl.create();var i=Pe(),r=ae(i);{var s=a=>{Fp(a,_t(()=>t.props))};_e(r,a=>{t.shouldRender&&a(s)})}D(n,i),it()}var cm=Z("<button><!></button>"),um=Z("<!> <!>",1);function dm(n,e){const t=Un();nt(e,!0);let i=me(e,"checked",15,!1),r=me(e,"ref",15,null),s=me(e,"disabled",3,!1),a=me(e,"required",3,!1),o=me(e,"name",3,void 0),l=me(e,"value",3,"on"),c=me(e,"id",19,()=>xi(t)),u=me(e,"indeterminate",15,!1),h=me(e,"type",3,"button"),f=lt(e,["$$slots","$$events","$$legacy","checked","ref","onCheckedChange","children","disabled","required","name","value","id","indeterminate","onIndeterminateChange","child","type","readonly"]);const p=am.getOr(null);p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1)),Fi.pre(()=>l(),()=>{p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1))});const v=Xl.create({checked:ut(()=>i(),C=>{i(C),e.onCheckedChange?.(C)}),disabled:ut(()=>s()??!1),required:ut(()=>a()),name:ut(()=>o()),value:ut(()=>l()),id:ut(()=>c()),ref:ut(()=>r(),C=>r(C)),indeterminate:ut(()=>u(),C=>{u(C),e.onIndeterminateChange?.(C)}),type:ut(()=>h()),readonly:ut(()=>!!e.readonly)},p),S=z(()=>fn({...f},v.props));var g=um(),m=ae(g);{var x=C=>{var y=Pe(),I=ae(y);{let _=z(()=>({props:d(S),...v.snippetProps}));Ct(I,()=>e.child,()=>d(_))}D(C,y)},M=C=>{var y=cm();sn(y,()=>({...d(S)}));var I=Q(y);Ct(I,()=>e.children??Ut,()=>v.snippetProps),q(y),D(C,y)};_e(m,C=>{e.child?C(x):C(M,-1)})}var T=ue(m,2);lm(T,{}),D(n,g),it()}class nr{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),Rt(this.handler)}handler(){let e=0;const t=this.#e();if(!t)return;const i=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return i.observe(t),()=>{window.cancelAnimationFrame(e),i.unobserve(t)}}}class hm{opts;present;#e;#t=we(!1);#n=!1;#i=we(void 0);#r=null;constructor(e){this.opts=e,this.present=this.opts.open,O(this.#t,e.open.current,!0),this.#e=new Sp({ref:this.opts.ref,afterTick:this.opts.open}),yp(()=>this.#a()),Fi(()=>this.present.current,t=>{if(!this.#n){this.#n=!0;return}this.#a(),t&&O(this.#t,!0),O(this.#i,t?"starting":"ending",!0),t&&(this.#r=window.requestAnimationFrame(()=>{this.#r=null,this.present.current&&O(this.#i,void 0)})),this.#e.run(()=>{t===this.present.current&&(t||O(this.#t,!1),O(this.#i,void 0))})})}#s=z(()=>d(this.#t));get isPresent(){return d(this.#s)}set isPresent(e){O(this.#s,e)}get transitionStatus(){return d(this.#i)}#a(){this.#r!==null&&(window.cancelAnimationFrame(this.#r),this.#r=null)}}function Ta(n,e){nt(e,!0);const t=new hm({open:ut(()=>e.open),ref:e.ref});var i=Pe(),r=ae(i);{var s=a=>{var o=Pe(),l=ae(o);Ct(l,()=>e.presence??Ut,()=>({present:t.isPresent,transitionStatus:t.transitionStatus})),D(a,o)};_e(r,a=>{(e.forceMount||e.open||t.isPresent)&&a(s)})}D(n,i),it()}function fm(n,e,t){return Math.min(t,Math.max(e,n))}class pm{state;#e;constructor(e,t){this.state=Io(e),this.#e=t,this.dispatch=this.dispatch.bind(this)}#t(e){return this.#e[this.state.current][e]??this.state.current}dispatch(e){this.state.current=this.#t(e)}}const ps=Vl({component:"scroll-area",parts:["root","viewport","corner","thumb","scrollbar"]}),ms=new zi("ScrollArea.Root"),gs=new zi("ScrollArea.Scrollbar"),Aa=new zi("ScrollArea.ScrollbarVisible"),jl=new zi("ScrollArea.ScrollbarAxis"),fh=new zi("ScrollArea.ScrollbarShared");class ql{static create(e){return ms.set(new ql(e))}opts;attachment;#e=we(null);get scrollAreaNode(){return d(this.#e)}set scrollAreaNode(e){O(this.#e,e,!0)}#t=we(null);get viewportNode(){return d(this.#t)}set viewportNode(e){O(this.#t,e,!0)}#n=we(null);get contentNode(){return d(this.#n)}set contentNode(e){O(this.#n,e,!0)}#i=we(null);get scrollbarXNode(){return d(this.#i)}set scrollbarXNode(e){O(this.#i,e,!0)}#r=we(null);get scrollbarYNode(){return d(this.#r)}set scrollbarYNode(e){O(this.#r,e,!0)}#s=we(0);get cornerWidth(){return d(this.#s)}set cornerWidth(e){O(this.#s,e,!0)}#a=we(0);get cornerHeight(){return d(this.#a)}set cornerHeight(e){O(this.#a,e,!0)}#o=we(!1);get scrollbarXEnabled(){return d(this.#o)}set scrollbarXEnabled(e){O(this.#o,e,!0)}#l=we(!1);get scrollbarYEnabled(){return d(this.#l)}set scrollbarYEnabled(e){O(this.#l,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=Hn(e.ref,t=>this.scrollAreaNode=t),this.domContext=new Zd(e.ref)}#c=z(()=>({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`},[ps.root]:"",...this.attachment}));get props(){return d(this.#c)}set props(e){O(this.#c,e)}}class Kl{static create(e){return new Kl(e,ms.get())}opts;root;attachment;#e=Io(Mp());#t=Io(null);contentAttachment=Hn(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(e.ref,i=>this.root.viewportNode=i)}#n=z(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?"scroll":"hidden",overflowY:this.root.scrollbarYEnabled?"scroll":"hidden"},[ps.viewport]:"",...this.attachment}));get props(){return d(this.#n)}set props(e){O(this.#n,e)}#i=z(()=>({id:this.#e.current,"data-scroll-area-content":"",style:{minWidth:this.root.scrollbarXEnabled?"fit-content":void 0},...this.contentAttachment}));get contentProps(){return d(this.#i)}set contentProps(e){O(this.#i,e)}}class Zl{static create(e){return gs.set(new Zl(e,ms.get()))}opts;root;#e=z(()=>this.opts.orientation.current==="horizontal");get isHorizontal(){return d(this.#e)}set isHorizontal(e){O(this.#e,e)}#t=we(!1);get hasThumb(){return d(this.#t)}set hasThumb(e){O(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,Fi(()=>this.isHorizontal,i=>i?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}}class $l{static create(){return new $l(gs.get())}scrollbar;root;#e=we(!1);get isVisible(){return d(this.#e)}set isVisible(e){O(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Rt(()=>{const t=this.root.scrollAreaNode,i=this.root.opts.scrollHideDelay.current;let r=0;if(!t)return;const s=()=>{this.root.domContext.clearTimeout(r),nn(()=>this.isVisible=!0)},a=()=>{r&&this.root.domContext.clearTimeout(r),r=this.root.domContext.setTimeout(()=>{nn(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},i)},o=Hl(Kt(t,"pointerenter",s),Kt(t,"pointerleave",a));return()=>{this.root.domContext.getWindow().clearTimeout(r),o()}})}#t=z(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class Jl{static create(){return new Jl(gs.get())}scrollbar;root;machine=new pm("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=z(()=>this.machine.state.current==="hidden");get isHidden(){return d(this.#e)}set isHidden(e){O(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;const t=wa(()=>this.machine.dispatch("SCROLL_END"),100);Rt(()=>{const i=this.machine.state.current,r=this.root.opts.scrollHideDelay.current;if(i==="idle"){const s=this.root.domContext.setTimeout(()=>this.machine.dispatch("HIDE"),r);return()=>this.root.domContext.clearTimeout(s)}}),Rt(()=>{const i=this.root.viewportNode;if(!i)return;const r=this.scrollbar.isHorizontal?"scrollLeft":"scrollTop";let s=i[r];return Kt(i,"scroll",()=>{const l=i[r];s!==l&&(this.machine.dispatch("SCROLL"),t()),s=l})}),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}onpointerenter(e){this.machine.dispatch("POINTER_ENTER")}onpointerleave(e){this.machine.dispatch("POINTER_LEAVE")}#t=z(()=>({"data-state":this.machine.state.current==="hidden"?"hidden":"visible",onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class Ra{static create(){return new Ra(gs.get())}scrollbar;root;#e=we(!1);get isVisible(){return d(this.#e)}set isVisible(e){O(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;const t=wa(()=>{const i=this.root.viewportNode;if(!i)return;const r=i.offsetWidth<i.scrollWidth,s=i.offsetHeight<i.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?r:s},10);new nr(()=>this.root.viewportNode,t),new nr(()=>this.root.contentNode,t)}#t=z(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class Ql{static create(){return Aa.set(new Ql(gs.get()))}scrollbar;root;#e=we(null);get thumbNode(){return d(this.#e)}set thumbNode(e){O(this.#e,e,!0)}#t=we(0);get pointerOffset(){return d(this.#t)}set pointerOffset(e){O(this.#t,e,!0)}#n=we({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return d(this.#n)}set sizes(e){O(this.#n,e)}#i=z(()=>ph(this.sizes.viewport,this.sizes.content));get thumbRatio(){return d(this.#i)}set thumbRatio(e){O(this.#i,e)}#r=z(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return d(this.#r)}set hasThumb(e){O(this.#r,e)}#s=we("");get prevTransformStyle(){return d(this.#s)}set prevTransformStyle(e){O(this.#s,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Rt(()=>{this.scrollbar.hasThumb=this.hasThumb}),Rt(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return mm({pointerPos:e,pointerOffset:this.pointerOffset,sizes:this.sizes,dir:t})}onThumbPointerUp(){this.pointerOffset=0}onThumbPointerDown(e){this.pointerOffset=e}xOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const e=this.root.viewportNode.scrollLeft,i=`translate3d(${gu({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=i,this.prevTransformStyle=i}xOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=e)}xOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=this.getScrollPosition(e,this.root.opts.dir.current))}yOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const e=this.root.viewportNode.scrollTop,i=`translate3d(0, ${gu({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=i,this.prevTransformStyle=i}yOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=e)}yOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=this.getScrollPosition(e,this.root.opts.dir.current))}}class ec{static create(e){return jl.set(new ec(e,Aa.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=we();get computedStyle(){return d(this.#e)}set computedStyle(e){O(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=Hn(this.scrollbar.opts.ref,i=>this.root.scrollbarXNode=i),Rt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Rt(()=>{this.onResize()})}onThumbPointerDown=e=>{this.scrollbarVis.onThumbPointerDown(e.x)};onDragScroll=e=>{this.scrollbarVis.xOnDragScroll(e.x)};onThumbPointerUp=()=>{this.scrollbarVis.onThumbPointerUp()};onThumbPositionChange=()=>{this.scrollbarVis.xOnThumbPositionChange()};onWheelScroll=(e,t)=>{if(!this.root.viewportNode)return;const i=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(i),gh(i,t)&&e.preventDefault()};onResize=()=>{this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollWidth,viewport:this.root.viewportNode.offsetWidth,scrollbar:{size:this.scrollbar.opts.ref.current.clientWidth,paddingStart:ga(this.computedStyle.paddingLeft),paddingEnd:ga(this.computedStyle.paddingRight)}})};#t=z(()=>Ca(this.scrollbarVis.sizes));get thumbSize(){return d(this.#t)}set thumbSize(e){O(this.#t,e)}#n=z(()=>({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){O(this.#n,e)}}class tc{static create(e){return jl.set(new tc(e,Aa.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=we();get computedStyle(){return d(this.#e)}set computedStyle(e){O(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=Hn(this.scrollbar.opts.ref,i=>this.root.scrollbarYNode=i),Rt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Rt(()=>{this.onResize()}),this.onThumbPointerDown=this.onThumbPointerDown.bind(this),this.onDragScroll=this.onDragScroll.bind(this),this.onThumbPointerUp=this.onThumbPointerUp.bind(this),this.onThumbPositionChange=this.onThumbPositionChange.bind(this),this.onWheelScroll=this.onWheelScroll.bind(this),this.onResize=this.onResize.bind(this)}onThumbPointerDown(e){this.scrollbarVis.onThumbPointerDown(e.y)}onDragScroll(e){this.scrollbarVis.yOnDragScroll(e.y)}onThumbPointerUp(){this.scrollbarVis.onThumbPointerUp()}onThumbPositionChange(){this.scrollbarVis.yOnThumbPositionChange()}onWheelScroll(e,t){if(!this.root.viewportNode)return;const i=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(i),gh(i,t)&&e.preventDefault()}onResize(){this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollHeight,viewport:this.root.viewportNode.offsetHeight,scrollbar:{size:this.scrollbar.opts.ref.current.clientHeight,paddingStart:ga(this.computedStyle.paddingTop),paddingEnd:ga(this.computedStyle.paddingBottom)}})}#t=z(()=>Ca(this.scrollbarVis.sizes));get thumbSize(){return d(this.#t)}set thumbSize(e){O(this.#t,e)}#n=z(()=>({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){O(this.#n,e)}}class nc{static create(){return fh.set(new nc(jl.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=we(null);get rect(){return d(this.#e)}set rect(e){O(this.#e,e)}#t=we("");get prevWebkitUserSelect(){return d(this.#t)}set prevWebkitUserSelect(e){O(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#n=z(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return d(this.#n)}set maxScrollPos(e){O(this.#n,e)}constructor(e){this.scrollbarState=e,this.root=e.root,this.scrollbarVis=e.scrollbarVis,this.scrollbar=e.scrollbarVis.scrollbar,this.handleResize=wa(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,Rt(()=>{const t=this.maxScrollPos,i=this.scrollbar.opts.ref.current;this.root.viewportNode;const r=a=>{const o=a.target;i?.contains(o)&&this.handleWheelScroll(a,t)};return Kt(this.root.domContext.getDocument(),"wheel",r,{passive:!1})}),dp(()=>{this.scrollbarVis.sizes,nn(()=>this.handleThumbPositionChange())}),new nr(()=>this.scrollbar.opts.ref.current,this.handleResize),new nr(()=>this.root.contentNode,this.handleResize),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onlostpointercapture=this.onlostpointercapture.bind(this)}handleDragScroll(e){if(!this.rect)return;const t=e.clientX-this.rect.left,i=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:i})}#i(){this.rect!==null&&(this.root.domContext.getDocument().body.style.webkitUserSelect=this.prevWebkitUserSelect,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=""),this.rect=null)}onpointerdown(e){if(e.button!==0)return;e.target.setPointerCapture(e.pointerId),this.rect=this.scrollbar.opts.ref.current?.getBoundingClientRect()??null,this.prevWebkitUserSelect=this.root.domContext.getDocument().body.style.webkitUserSelect,this.root.domContext.getDocument().body.style.webkitUserSelect="none",this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior="auto"),this.handleDragScroll(e)}onpointermove(e){this.handleDragScroll(e)}onpointerup(e){const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.#i()}onlostpointercapture(e){this.#i()}#r=z(()=>fn({...this.scrollbarState.props,style:{position:"absolute",...this.scrollbarState.props.style},[ps.scrollbar]:"",onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return d(this.#r)}set props(e){O(this.#r,e)}}class ic{static create(e){return new ic(e,fh.get())}opts;scrollbarState;attachment;#e;#t=we();#n=wa(()=>{d(this.#t)&&(d(this.#t)(),O(this.#t,void 0))},100);constructor(e,t){this.opts=e,this.scrollbarState=t,this.#e=t.root,this.attachment=Hn(this.opts.ref,i=>this.scrollbarState.scrollbarVis.thumbNode=i),Rt(()=>{const i=this.#e.viewportNode;if(!i)return;const r=()=>{if(this.#n(),!d(this.#t)){const a=gm(i,this.scrollbarState.handleThumbPositionChange);O(this.#t,a,!0),this.scrollbarState.handleThumbPositionChange()}};return nn(()=>this.scrollbarState.handleThumbPositionChange()),Kt(i,"scroll",r)}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){const t=e.target;if(!t)return;const i=t.getBoundingClientRect(),r=e.clientX-i.left,s=e.clientY-i.top;this.scrollbarState.handleThumbPointerDown({x:r,y:s})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#i=z(()=>({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,[ps.thumb]:"",...this.attachment}));get props(){return d(this.#i)}set props(e){O(this.#i,e)}}class rc{static create(e){return new rc(e,ms.get())}opts;root;attachment;#e=we(0);#t=we(0);#n=z(()=>!!(d(this.#e)&&d(this.#t)));get hasSize(){return d(this.#n)}set hasSize(e){O(this.#n,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(this.opts.ref),new nr(()=>this.root.scrollbarXNode,()=>{const i=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=i,O(this.#t,i,!0)}),new nr(()=>this.root.scrollbarYNode,()=>{const i=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=i,O(this.#e,i,!0)})}#i=z(()=>({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},[ps.corner]:"",...this.attachment}));get props(){return d(this.#i)}set props(e){O(this.#i,e)}}function ga(n){return n?Number.parseInt(n,10):0}function ph(n,e){const t=n/e;return Number.isNaN(t)?0:t}function Ca(n){const e=ph(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,i=(n.scrollbar.size-t)*e;return Math.max(i,18)}function mm({pointerPos:n,pointerOffset:e,sizes:t,dir:i="ltr"}){const r=Ca(t),s=r/2,a=e||s,o=r-a,l=t.scrollbar.paddingStart+a,c=t.scrollbar.size-t.scrollbar.paddingEnd-o,u=t.content-t.viewport,h=i==="ltr"?[0,u]:[u*-1,0];return mh([l,c],h)(n)}function gu({scrollPos:n,sizes:e,dir:t="ltr"}){const i=Ca(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,a=e.content-e.viewport,o=s-i,l=t==="ltr"?[0,a]:[a*-1,0],c=fm(n,l[0],l[1]);return mh([0,a],[0,o])(c)}function mh(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(n[1]-n[0]);return e[0]+i*(t-n[0])}}function gh(n,e){return n>0&&n<e}function gm(n,e){let t={left:n.scrollLeft,top:n.scrollTop},i=0;const r=Ep(n);return(function s(){const a={left:n.scrollLeft,top:n.scrollTop},o=t.left!==a.left,l=t.top!==a.top;(o||l)&&e(),t=a,i=r.requestAnimationFrame(s)})(),()=>r.cancelAnimationFrame(i)}var vm=Z("<div><!></div>");function _m(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=me(e,"type",3,"hover"),a=me(e,"dir",3,"ltr"),o=me(e,"scrollHideDelay",3,600),l=lt(e,["$$slots","$$events","$$legacy","ref","id","type","dir","scrollHideDelay","children","child"]);const c=ql.create({type:ut(()=>s()),dir:ut(()=>a()),scrollHideDelay:ut(()=>o()),id:ut(()=>r()),ref:ut(()=>i(),S=>i(S))}),u=z(()=>fn(l,c.props));var h=Pe(),f=ae(h);{var p=S=>{var g=Pe(),m=ae(g);Ct(m,()=>e.child,()=>({props:d(u)})),D(S,g)},v=S=>{var g=vm();sn(g,()=>({...d(u)}));var m=Q(g);Ct(m,()=>e.children??Ut),q(g),D(S,g)};_e(f,S=>{e.child?S(p):S(v,-1)})}D(n,h),it()}var xm=Z("<div><div><!></div></div>");function bm(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","ref","id","children"]);const a=Kl.create({id:ut(()=>r()),ref:ut(()=>i(),f=>i(f))}),o=z(()=>fn(s,a.props)),l=z(()=>fn({},a.contentProps));var c=xm();sn(c,()=>({...d(o)}));var u=Q(c);sn(u,()=>({...d(l)}));var h=Q(u);Ct(h,()=>e.children??Ut),q(u),q(c),D(n,c),it()}var Sm=Z("<div><!></div>");function vh(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy","child","children"]);const i=nc.create(),r=z(()=>fn(t,i.props));var s=Pe(),a=ae(s);{var o=c=>{var u=Pe(),h=ae(u);Ct(h,()=>e.child,()=>({props:d(r)})),D(c,u)},l=c=>{var u=Sm();sn(u,()=>({...d(r)}));var h=Q(u);Ct(h,()=>e.children??Ut),q(u),D(c,u)};_e(a,c=>{e.child?c(o):c(l,-1)})}D(n,s),it()}function ym(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy"]);const i=new Wl,r=ec.create({mounted:ut(()=>i.current)}),s=z(()=>fn(t,r.props));vh(n,_t(()=>d(s))),it()}function Mm(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy"]);const i=new Wl,r=tc.create({mounted:ut(()=>i.current)}),s=z(()=>fn(t,r.props));vh(n,_t(()=>d(s))),it()}function Pa(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy"]);const i=Ql.create();var r=Pe(),s=ae(r);{var a=l=>{ym(l,_t(()=>t))},o=l=>{Mm(l,_t(()=>t))};_e(s,l=>{i.scrollbar.opts.orientation.current==="horizontal"?l(a):l(o,-1)})}D(n,r),it()}function Em(n,e){nt(e,!0);let t=me(e,"forceMount",3,!1),i=lt(e,["$$slots","$$events","$$legacy","forceMount"]);const r=Ra.create(),s=z(()=>fn(i,r.props));{const a=l=>{Pa(l,_t(()=>d(s)))};let o=z(()=>t()||r.isVisible);Ta(n,{get open(){return d(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}})}it()}function wm(n,e){nt(e,!0);let t=me(e,"forceMount",3,!1),i=lt(e,["$$slots","$$events","$$legacy","forceMount"]);const r=Jl.create(),s=z(()=>fn(i,r.props));{const a=l=>{Pa(l,_t(()=>d(s)))};let o=z(()=>t()||!r.isHidden);Ta(n,_t(()=>d(s),{get open(){return d(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}}))}it()}function Tm(n,e){nt(e,!0);let t=me(e,"forceMount",3,!1),i=lt(e,["$$slots","$$events","$$legacy","forceMount"]);const r=$l.create(),s=Ra.create(),a=z(()=>fn(i,r.props,s.props,{"data-state":r.isVisible?"visible":"hidden"})),o=z(()=>t()||r.isVisible&&s.isVisible);Ta(n,{get open(){return d(o)},get ref(){return s.scrollbar.opts.ref},presence:c=>{Pa(c,_t(()=>d(a)))},$$slots:{presence:!0}}),it()}function Am(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","ref","id","orientation"]);const a=Zl.create({orientation:ut(()=>e.orientation),id:ut(()=>r()),ref:ut(()=>i(),v=>i(v))}),o=z(()=>a.root.opts.type.current);var l=Pe(),c=ae(l);{var u=v=>{Tm(v,_t(()=>s,{get id(){return r()}}))},h=v=>{wm(v,_t(()=>s,{get id(){return r()}}))},f=v=>{Em(v,_t(()=>s,{get id(){return r()}}))},p=v=>{Pa(v,_t(()=>s,{get id(){return r()}}))};_e(c,v=>{d(o)==="hover"?v(u):d(o)==="scroll"?v(h,1):d(o)==="auto"?v(f,2):d(o)==="always"&&v(p,3)})}D(n,l),it()}var Rm=Z("<div><!></div>");function Cm(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","id","child","children","present"]);const r=new Wl,s=ic.create({id:ut(()=>e.id),ref:ut(()=>t(),h=>t(h)),mounted:ut(()=>r.current)}),a=z(()=>fn(i,s.props,{style:{hidden:!e.present}}));var o=Pe(),l=ae(o);{var c=h=>{var f=Pe(),p=ae(f);Ct(p,()=>e.child,()=>({props:d(a)})),D(h,f)},u=h=>{var f=Rm();sn(f,()=>({...d(a)}));var p=Q(f);Ct(p,()=>e.children??Ut),q(f),D(h,f)};_e(l,h=>{e.child?h(c):h(u,-1)})}D(n,o),it()}function Pm(n,e){const t=Un();nt(e,!0);let i=me(e,"id",19,()=>xi(t)),r=me(e,"ref",15,null),s=me(e,"forceMount",3,!1),a=lt(e,["$$slots","$$events","$$legacy","id","ref","forceMount"]);const o=Aa.get();{const l=(u,h)=>{let f=()=>h?.().present;Cm(u,_t(()=>a,{get id(){return i()},get present(){return f()},get ref(){return r()},set ref(p){r(p)}}))};let c=z(()=>s()||o.hasThumb);Ta(n,{get open(){return d(c)},get ref(){return o.scrollbar.opts.ref},presence:l,$$slots:{presence:!0}})}it()}var Dm=Z("<div><!></div>");function Im(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","id","children","child"]);const r=rc.create({id:ut(()=>e.id),ref:ut(()=>t(),u=>t(u))}),s=z(()=>fn(i,r.props));var a=Pe(),o=ae(a);{var l=u=>{var h=Pe(),f=ae(h);Ct(f,()=>e.child,()=>({props:d(s)})),D(u,h)},c=u=>{var h=Dm();sn(h,()=>({...d(s)}));var f=Q(h);Ct(f,()=>e.children??Ut),q(h),D(u,h)};_e(o,u=>{e.child?u(l):u(c,-1)})}D(n,a),it()}function Lm(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","ref","id"]);const a=ms.get(),o=z(()=>!!(a.scrollbarXNode&&a.scrollbarYNode)),l=z(()=>a.opts.type.current!=="scroll"&&d(o));var c=Pe(),u=ae(c);{var h=f=>{Im(f,_t(()=>s,{get id(){return r()},get ref(){return i()},set ref(p){i(p)}}))};_e(u,f=>{d(l)&&f(h)})}D(n,c),it()}function vu(n,e,t){const i={position:"absolute"};return n==="lr"?(i.left=`${e}%`,i.right=`${t}%`):n==="rl"?(i.right=`${e}%`,i.left=`${t}%`):n==="bt"?(i.bottom=`${e}%`,i.top=`${t}%`):(i.top=`${e}%`,i.bottom=`${t}%`),i}function _h(n,e){const t={position:"absolute"};return n==="lr"?(t.left=`${e}%`,t.translate="-50% 0"):n==="rl"?(t.right=`${e}%`,t.translate="50% 0"):n==="bt"?(t.bottom=`${e}%`,t.translate="0 50%"):(t.top=`${e}%`,t.translate="0 -50%"),t}function xh(n,e,t){const i={position:"absolute"};return n==="lr"?(i.left=`${e}%`,i.translate=`${t}% 0`):n==="rl"?(i.right=`${e}%`,i.translate=`${-t}% 0`):n==="bt"?(i.bottom=`${e}%`,i.translate=`0 ${-t}%`):(i.top=`${e}%`,i.translate=`0 ${t}%`),i}function Nm(n){if(Math.floor(n)===n)return 0;const e=n.toString();if(e.indexOf(".")!==-1&&e.indexOf("e-")===-1)return e.split(".")[1].length;if(e.indexOf("e-")!==-1){const t=e.split("e-");return parseInt(t[1],10)}return 0}function Um(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function sc(n,e,t){if(typeof n=="number"){const i=t-e;let r=Math.ceil(i/n);const s=Nm(n),a=Math.pow(10,s),o=Math.round(i*a),l=Math.round(n*a);o%l===0&&r++;const c=[];for(let u=0;u<r;u++){const h=e+u*n,f=Um(h,s);c.push(f)}return c}return[...new Set(n)].filter(i=>i>=e&&i<=t).sort((i,r)=>i-r)}function Qi(n,e){if(e.length===0)return n;let t=e[0],i=Math.abs(n-t);for(const r of e){const s=Math.abs(n-r);s<i&&(i=s,t=r)}return t}function Ms(n,e,t){const i=e.indexOf(n);return i===-1?Qi(n,e):t==="next"?i<e.length-1?e[i+1]:n:i>0?e[i-1]:n}function Fm(n,e,t=!0){const[i,r]=n,[s,a]=e,o=(a-s)/(r-i);return l=>{const c=s+o*(l-i);return t?c>Math.max(s,a)?Math.max(s,a):c<Math.min(s,a)?Math.min(s,a):c:c}}const Ni=Vl({component:"slider",parts:["root","thumb","range","tick","tick-label","thumb-label"]}),ac=new zi("Slider.Root");class bh{opts;attachment;#e=we(!1);get isActive(){return d(this.#e)}set isActive(e){O(this.#e,e,!0)}#t=we(0);#n=z(()=>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){O(this.#n,e)}#i=z(()=>sc(this.opts.step.current,this.opts.min.current,this.opts.max.current));get normalizedSteps(){return d(this.#i)}set normalizedSteps(e){O(this.#i,e)}domContext;constructor(e){this.opts=e,this.attachment=Hn(e.ref),this.domContext=new Zd(this.opts.ref),new nr(()=>this.opts.ref.current,this.#r)}#r=()=>{O(this.#t,d(this.#t)+1)};isThumbActive(e){return this.isActive}#s=z(()=>{if(!this.opts.disabled.current)return this.opts.orientation.current==="horizontal"?"pan-y":"pan-x"});getAllThumbs=()=>{const e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(Ni.selector("thumb"))):[]};getThumbScale=()=>{d(this.#t);const e=this.opts.trackPadding?.current;if(e!==void 0&&e>0)return[e,100-e];if(this.opts.thumbPositioning.current==="exact")return[0,100];const t=this.opts.orientation.current==="vertical",i=this.getAllThumbs()[0],r=t?i?.offsetHeight:i?.offsetWidth;if(r===void 0||Number.isNaN(r)||r===0)return[0,100];const s=t?this.opts.ref.current?.offsetHeight:this.opts.ref.current?.offsetWidth;if(s===void 0||Number.isNaN(s)||s===0)return[0,100];const a=r/2/s*100,o=a,l=100-a;return[o,l]};getPositionFromValue=e=>{const t=this.getThumbScale();return Fm([this.opts.min.current,this.opts.max.current],t)(e)};#a=z(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,"data-disabled":tr(this.opts.disabled.current),style:{touchAction:d(this.#s)},[Ni.root]:"",...this.attachment}));get props(){return d(this.#a)}set props(e){O(this.#a,e)}}class Om extends bh{opts;isMulti=!1;constructor(e){super(e),this.opts=e,ch(()=>Hl(Kt(this.domContext.getDocument(),"pointerdown",this.handlePointerDown),Kt(this.domContext.getDocument(),"pointerup",this.handlePointerUp),Kt(this.domContext.getDocument(),"pointermove",this.handlePointerMove),Kt(this.domContext.getDocument(),"pointerleave",this.handlePointerUp))),Fi([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=sc(t,i,r),o=c=>a.includes(c),l=c=>Qi(c,a);o(s)||(this.opts.value.current=l(s))})}isTickValueSelected=e=>this.opts.value.current===e;applyPosition({clientXY:e,start:t,end:i}){const r=this.opts.min.current,s=this.opts.max.current,o=(e-t)/(i-t)*(s-r)+r;if(o<r)this.updateValue(r);else if(o>s)this.updateValue(s);else{const l=this.normalizedSteps,c=Qi(o,l);this.updateValue(c)}}updateValue=e=>{this.opts.value.current=Qi(e,this.normalizedSteps)};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();const t=this.opts.ref.current,i=this.getAllThumbs()[0];if(!t||!i)return;i.focus();const{left:r,right:s,top:a,bottom:o}=t.getBoundingClientRect();this.direction==="lr"?this.applyPosition({clientXY:e.clientX,start:r,end:s}):this.direction==="rl"?this.applyPosition({clientXY:e.clientX,start:s,end:r}):this.direction==="bt"?this.applyPosition({clientXY:e.clientY,start:o,end:a}):this.direction==="tb"&&this.applyPosition({clientXY:e.clientY,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;const t=this.opts.ref.current,i=this.getAllThumbs()[0];if(!i||!t)return;const r=e.composedPath()[0]??e.target;!lh(r)||!t.contains(r)||(e.preventDefault(),i.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(nn(()=>this.opts.value.current)),this.isActive=!1)};#e=z(()=>{const e=this.opts.value.current;return Array.from({length:1},()=>{const t=e,i=this.getPositionFromValue(t),r=_h(this.direction,i);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":t,"aria-disabled":ma(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":t,"data-orientation":this.opts.orientation.current,style:r,[Ni.thumb]:""}})});get thumbsPropsArr(){return d(this.#e)}set thumbsPropsArr(e){O(this.#e,e)}#t=z(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return d(this.#t)}set thumbsRenderArr(e){O(this.#t,e)}#n=z(()=>{const e=this.normalizedSteps,t=this.opts.value.current;return e.map((i,r)=>{const s=this.getPositionFromValue(i),a=r===0,o=r===e.length-1,l=a?0:o?-100:-50,c=xh(this.direction,s,l),u=i<=t;return{"data-disabled":tr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":u?"":void 0,"data-value":i,"data-selected":this.isTickValueSelected(i)?"":void 0,style:c,[Ni.tick]:""}})});get ticksPropsArr(){return d(this.#n)}set ticksPropsArr(e){O(this.#n,e)}#i=z(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return d(this.#i)}set ticksRenderArr(e){O(this.#i,e)}#r=z(()=>this.ticksPropsArr.map((e,t)=>({value:e["data-value"],index:t})));get tickItemsArr(){return d(this.#r)}set tickItemsArr(e){O(this.#r,e)}#s=z(()=>[{value:this.opts.value.current,index:0}]);get thumbItemsArr(){return d(this.#s)}set thumbItemsArr(e){O(this.#s,e)}#a=z(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return d(this.#a)}set snippetProps(e){O(this.#a,e)}}class Bm extends bh{opts;isMulti=!0;#e=we(null);get activeThumb(){return d(this.#e)}set activeThumb(e){O(this.#e,e,!0)}#t=we(0);get currentThumbIdx(){return d(this.#t)}set currentThumbIdx(e){O(this.#t,e,!0)}constructor(e){super(e),this.opts=e,ch(()=>Hl(Kt(this.domContext.getDocument(),"pointerdown",this.handlePointerDown),Kt(this.domContext.getDocument(),"pointerup",this.handlePointerUp),Kt(this.domContext.getDocument(),"pointermove",this.handlePointerMove),Kt(this.domContext.getDocument(),"pointerleave",this.handlePointerUp))),Fi([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=sc(t,i,r),o=c=>a.includes(c),l=c=>Qi(c,a);s.some(c=>!o(c))&&(this.opts.value.current=s.map(l))})}isTickValueSelected=e=>this.opts.value.current.includes(e);isThumbActive(e){return this.isActive&&this.activeThumb?.idx===e}applyPosition({clientXY:e,activeThumbIdx:t,start:i,end:r}){const s=this.opts.min.current,a=this.opts.max.current,l=(e-i)/(r-i)*(a-s)+s;if(l<s)this.updateValue(s,t);else if(l>a)this.updateValue(a,t);else{const c=this.normalizedSteps,u=Qi(l,c);this.updateValue(u,t)}}#n=e=>{const t=this.getAllThumbs();if(!t.length)return;for(const a of t)a.blur();const i=t.map(a=>{if(this.opts.orientation.current==="horizontal"){const{left:o,right:l}=a.getBoundingClientRect();return Math.abs(e.clientX-(o+l)/2)}else{const{top:o,bottom:l}=a.getBoundingClientRect();return Math.abs(e.clientY-(o+l)/2)}}),r=t[i.indexOf(Math.min(...i))],s=t.indexOf(r);return{node:r,idx:s}};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();const t=this.opts.ref.current,i=this.activeThumb;if(!t||!i)return;i.node.focus();const{left:r,right:s,top:a,bottom:o}=t.getBoundingClientRect(),l=this.direction;l==="lr"?this.applyPosition({clientXY:e.clientX,activeThumbIdx:i.idx,start:r,end:s}):l==="rl"?this.applyPosition({clientXY:e.clientX,activeThumbIdx:i.idx,start:s,end:r}):l==="bt"?this.applyPosition({clientXY:e.clientY,activeThumbIdx:i.idx,start:o,end:a}):l==="tb"&&this.applyPosition({clientXY:e.clientY,activeThumbIdx:i.idx,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;const t=this.opts.ref.current,i=this.#n(e);if(!i||!t)return;const r=e.composedPath()[0]??e.target;!lh(r)||!t.contains(r)||(e.preventDefault(),this.activeThumb=i,i.node.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(nn(()=>this.opts.value.current)),this.isActive=!1)};getAllThumbs=()=>{const e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(Ni.selector("thumb"))):[]};updateValue=(e,t)=>{const i=this.opts.value.current;if(!i.length){this.opts.value.current.push(e);return}if(i[t]===e)return;const s=[...i];if(!Op(t,s))return;const a=s[t]>e?-1:1,o=()=>{const c=t+a;s[t]=s[c],s[c]=e;const u=this.getAllThumbs();u.length&&(u[c]?.focus(),this.activeThumb={node:u[c],idx:c})};if(this.opts.autoSort.current&&(a===-1&&e<s[t-1]||a===1&&e>s[t+1])){o(),this.opts.value.current=s;return}const l=this.normalizedSteps;s[t]=Qi(e,l),this.opts.value.current=s};#i=z(()=>{const e=this.opts.value.current;return Array.from({length:e.length||1},(t,i)=>{const r=nn(()=>this.currentThumbIdx);r<e.length&&nn(()=>{this.currentThumbIdx=r+1});const s=e[i],a=this.getPositionFromValue(s??0),o=_h(this.direction,a);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":s,"aria-disabled":ma(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":s,"data-orientation":this.opts.orientation.current,style:o,[Ni.thumb]:""}})});get thumbsPropsArr(){return d(this.#i)}set thumbsPropsArr(e){O(this.#i,e)}#r=z(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return d(this.#r)}set thumbsRenderArr(e){O(this.#r,e)}#s=z(()=>{const e=this.normalizedSteps,t=this.opts.value.current;return e.map((i,r)=>{const s=this.getPositionFromValue(i),a=r===0,o=r===e.length-1,l=a?0:o?-100:-50,c=xh(this.direction,s,l),u=t.length===1?i<=t[0]:t[0]<=i&&i<=t[t.length-1];return{"data-disabled":tr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":u?"":void 0,"data-value":i,style:c,[Ni.tick]:""}})});get ticksPropsArr(){return d(this.#s)}set ticksPropsArr(e){O(this.#s,e)}#a=z(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return d(this.#a)}set ticksRenderArr(e){O(this.#a,e)}#o=z(()=>this.ticksPropsArr.map((e,t)=>({value:e["data-value"],index:t})));get tickItemsArr(){return d(this.#o)}set tickItemsArr(e){O(this.#o,e)}#l=z(()=>this.opts.value.current.map((t,i)=>({value:t,index:i})));get thumbItemsArr(){return d(this.#l)}set thumbItemsArr(e){O(this.#l,e)}#c=z(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return d(this.#c)}set snippetProps(e){O(this.#c,e)}}class zm{static create(e){const{type:t,...i}=e,r=t==="single"?new Om(i):new Bm(i);return ac.set(r)}}const km=[nh,ih,rh,sh,ah,oh];class oc{static create(e){return new oc(e,ac.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(e.ref)}#e=z(()=>{if(Array.isArray(this.root.opts.value.current)){const e=this.root.opts.value.current.length>1?this.root.getPositionFromValue(Math.min(...this.root.opts.value.current)??0):0,t=100-this.root.getPositionFromValue(Math.max(...this.root.opts.value.current)??0);return{position:"absolute",...vu(this.root.direction,e,t)}}else{const e=this.root.opts.trackPadding?.current,t=this.root.opts.value.current,i=this.root.opts.max.current,r=0,s=e!==void 0&&e>0&&t===i?0:100-this.root.getPositionFromValue(t);return{position:"absolute",...vu(this.root.direction,r,s)}}});get rangeStyles(){return d(this.#e)}set rangeStyles(e){O(this.#e,e)}#t=z(()=>({id:this.opts.id.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":tr(this.root.opts.disabled.current),style:this.rangeStyles,[Ni.range]:"",...this.attachment}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class lc{static create(e){return new lc(e,ac.get())}opts;root;attachment;#e=z(()=>this.root.opts.disabled.current||this.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(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;const t=this.opts.ref.current;if(!t)return;const i=this.root.getAllThumbs();if(!i.length)return;const r=i.indexOf(t);if(this.root.isMulti&&(this.root.currentThumbIdx=r),!km.includes(e.key))return;e.preventDefault();const s=this.root.opts.min.current,a=this.root.opts.max.current,o=this.root.opts.value.current,l=Array.isArray(o)?o[r]:o,c=this.root.opts.orientation.current,u=this.root.direction,h=this.root.normalizedSteps;switch(e.key){case ah:this.#t(s);break;case oh:this.#t(a);break;case nh:if(c!=="horizontal")break;if(e.metaKey){const f=u==="rl"?a:s;this.#t(f)}else{const p=Ms(l,h,u==="rl"?"next":"prev");this.#t(p)}break;case ih:if(c!=="horizontal")break;if(e.metaKey){const f=u==="rl"?s:a;this.#t(f)}else{const p=Ms(l,h,u==="rl"?"prev":"next");this.#t(p)}break;case rh:if(e.metaKey){const f=u==="tb"?s:a;this.#t(f)}else{const p=Ms(l,h,u==="tb"?"prev":"next");this.#t(p)}break;case sh:if(e.metaKey){const f=u==="tb"?a:s;this.#t(f)}else{const p=Ms(l,h,u==="tb"?"next":"prev");this.#t(p)}break}this.root.opts.onValueCommit.current(this.root.opts.value.current)}#n=z(()=>({...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":tr(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){O(this.#n,e)}}var Vm=Z("<span><!></span>");function Hm(n,e){const t=Un();nt(e,!0);let i=me(e,"id",19,()=>xi(t)),r=me(e,"ref",15,null),s=me(e,"value",15),a=me(e,"onValueChange",3,mu),o=me(e,"onValueCommit",3,mu),l=me(e,"disabled",3,!1),c=me(e,"step",3,1),u=me(e,"dir",3,"ltr"),h=me(e,"autoSort",3,!0),f=me(e,"orientation",3,"horizontal"),p=me(e,"thumbPositioning",3,"contain"),v=lt(e,["$$slots","$$events","$$legacy","children","child","id","ref","value","type","onValueChange","onValueCommit","disabled","min","max","step","dir","autoSort","orientation","thumbPositioning","trackPadding"]);const S=z(()=>e.min!==void 0?e.min:Array.isArray(c())?Math.min(...c()):0),g=z(()=>e.max!==void 0?e.max:Array.isArray(c())?Math.max(...c()):100);function m(){if(s()===void 0)return e.type==="single"?d(S):[]}m(),Fi.pre(()=>s(),()=>{m()});const x=zm.create({id:ut(()=>i()),ref:ut(()=>r(),_=>r(_)),value:ut(()=>s(),_=>{s(_),a()(_)}),onValueCommit:ut(()=>o()),disabled:ut(()=>l()),min:ut(()=>d(S)),max:ut(()=>d(g)),step:ut(()=>c()),dir:ut(()=>u()),autoSort:ut(()=>h()),orientation:ut(()=>f()),thumbPositioning:ut(()=>p()),type:e.type,trackPadding:ut(()=>e.trackPadding)}),M=z(()=>fn(v,x.props));var T=Pe(),C=ae(T);{var y=_=>{var E=Pe(),L=ae(E);{let P=z(()=>({props:d(M),...x.snippetProps}));Ct(L,()=>e.child,()=>d(P))}D(_,E)},I=_=>{var E=Vm();sn(E,()=>({...d(M)}));var L=Q(E);Ct(L,()=>e.children??Ut,()=>x.snippetProps),q(E),D(_,E)};_e(C,_=>{e.child?_(y):_(I,-1)})}D(n,T),it()}var Gm=Z("<span><!></span>");function Wm(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const a=oc.create({id:ut(()=>r()),ref:ut(()=>i(),f=>i(f))}),o=z(()=>fn(s,a.props));var l=Pe(),c=ae(l);{var u=f=>{var p=Pe(),v=ae(p);Ct(v,()=>e.child,()=>({props:d(o)})),D(f,p)},h=f=>{var p=Gm();sn(p,()=>({...d(o)}));var v=Q(p);Ct(v,()=>e.children??Ut),q(p),D(f,p)};_e(c,f=>{e.child?f(u):f(h,-1)})}D(n,l),it()}var Xm=Z("<span><!></span>");function Ym(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=me(e,"disabled",3,!1),a=lt(e,["$$slots","$$events","$$legacy","children","child","ref","id","index","disabled"]);const o=lc.create({id:ut(()=>r()),ref:ut(()=>i(),p=>i(p)),index:ut(()=>e.index),disabled:ut(()=>s())}),l=z(()=>fn(a,o.props));var c=Pe(),u=ae(c);{var h=p=>{var v=Pe(),S=ae(v);{let g=z(()=>({active:o.root.isThumbActive(o.opts.index.current),props:d(l)}));Ct(S,()=>e.child,()=>d(g))}D(p,v)},f=p=>{var v=Xm();sn(v,()=>({...d(l)}));var S=Q(v);{let g=z(()=>({active:o.root.isThumbActive(o.opts.index.current)}));Ct(S,()=>e.children??Ut,()=>d(g))}q(v),D(p,v)};_e(u,p=>{e.child?p(h):p(f,-1)})}D(n,c),it()}function jm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"}],["circle",{cx:"12",cy:"13",r:"3"}]];an(n,_t({name:"camera"},()=>t,{get iconNode(){return i}}))}function qm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}],["path",{d:"m9 11 3 3L22 4"}]];an(n,_t({name:"circle-check-big"},()=>t,{get iconNode(){return i}}))}function Km(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];an(n,_t({name:"circle-check"},()=>t,{get iconNode(){return i}}))}function Zm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]];an(n,_t({name:"circle-question-mark"},()=>t,{get iconNode(){return i}}))}function Sh(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];an(n,_t({name:"download"},()=>t,{get iconNode(){return i}}))}function Va(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}],["path",{d:"m2 2 20 20"}]];an(n,_t({name:"eye-off"},()=>t,{get iconNode(){return i}}))}function Ha(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];an(n,_t({name:"eye"},()=>t,{get iconNode(){return i}}))}function $m(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}]];an(n,_t({name:"file"},()=>t,{get iconNode(){return i}}))}function Jm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}]];an(n,_t({name:"folder"},()=>t,{get iconNode(){return i}}))}function Qm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}]];an(n,_t({name:"inbox"},()=>t,{get iconNode(){return i}}))}function eg(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];an(n,_t({name:"info"},()=>t,{get iconNode(){return i}}))}function tg(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"}]];an(n,_t({name:"layers"},()=>t,{get iconNode(){return i}}))}function ng(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];an(n,_t({name:"link"},()=>t,{get iconNode(){return i}}))}function cc(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12 2v4"}],["path",{d:"m16.2 7.8 2.9-2.9"}],["path",{d:"M18 12h4"}],["path",{d:"m16.2 16.2 2.9 2.9"}],["path",{d:"M12 18v4"}],["path",{d:"m4.9 19.1 2.9-2.9"}],["path",{d:"M2 12h4"}],["path",{d:"m4.9 4.9 2.9 2.9"}]];an(n,_t({name:"loader"},()=>t,{get iconNode(){return i}}))}function uc(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"}]];an(n,_t({name:"maximize"},()=>t,{get iconNode(){return i}}))}function dc(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"}]];an(n,_t({name:"minimize"},()=>t,{get iconNode(){return i}}))}function ig(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M5 12h14"}]];an(n,_t({name:"minus"},()=>t,{get iconNode(){return i}}))}function rg(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];an(n,_t({name:"zap"},()=>t,{get iconNode(){return i}}))}const Nr={FILE_UPLOAD:{MAX_SIZE_MB:150,MAX_SIZE_BYTES:150*1024*1024},TIMEOUTS:{SOLVE_STATE_DURATION:3500,PARAM_EXPORT_DELAY:100,DRAWER_ANIMATION_MS:350},SOLVING_INDICATOR:{FAST_THRESHOLD_MS:200,SLOW_THRESHOLD_MS:600,ANIMATION_DELAY:300,HISTORY_SIZE:3},FILE_SIZE:{BYTES_PER_KB:1024}};var yh=Object.defineProperty,sg=(n,e,t)=>e in n?yh(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ag=(n,e)=>{for(var t in e)yh(n,t,{get:e[t],enumerable:!0})},Es=(n,e,t)=>sg(n,typeof e!="symbol"?e+"":e,t),gi={VALIDATION_ERROR:"VALIDATION_ERROR",INVALID_STATE:"INVALID_STATE",INVALID_INPUT:"INVALID_INPUT",BROWSER_ONLY:"BROWSER_ONLY"},Ui=class Lo extends Error{constructor(e,t="UNKNOWN_ERROR",i){super(e),Es(this,"code"),Es(this,"statusCode"),Es(this,"context"),Es(this,"originalError"),this.name="RhinoComputeError",this.code=t,this.statusCode=i?.statusCode,this.context=i?.context,this.originalError=i?.originalError,i?.originalError&&(this.cause=i.originalError)}static missingValues(e,t,i){return new Lo(`Input "${e}" has no values defined${t?` (expected ${t})`:""}`,gi.INVALID_INPUT,{context:{inputName:e,expectedType:t,...i}})}static unknownParamType(e,t,i){return new Lo(`Unknown paramType: ${e}`,gi.VALIDATION_ERROR,{context:{receivedParamType:e,paramName:t,...i}})}},og=class{debug(){}info(){}warn(){}error(){}},lg=new og;function zt(){return lg}function Mh(n){if(typeof globalThis.Buffer=="function"){let e=globalThis.Buffer.from(n,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(typeof globalThis.atob=="function"){let e=globalThis.atob(n),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i)&255;return t}throw new Ui("Base64 decoding not supported in this environment.",gi.INVALID_STATE,{context:{environmentInfo:"atob or Buffer not available"}})}const hc="184",Dr={ROTATE:0,DOLLY:1,PAN:2},Mr={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},cg=0,_u=1,ug=2,ta=1,dg=2,Er=3,Sn=0,xn=1,In=2,fi=0,Ir=1,xu=2,bu=3,Su=4,hg=5,ji=100,fg=101,pg=102,mg=103,gg=104,vg=200,_g=201,xg=202,bg=203,No=204,Uo=205,Sg=206,yg=207,Mg=208,Eg=209,wg=210,Tg=211,Ag=212,Rg=213,Cg=214,Fo=0,Oo=1,Bo=2,Ur=3,zo=4,ko=5,Vo=6,Ho=7,Eh=0,Pg=1,Dg=2,Qn=0,wh=1,Th=2,Ah=3,Rh=4,Ch=5,Ph=6,fc=7,Dh=300,ir=301,Fr=302,na=303,Ga=304,Da=306,Go=1e3,kn=1001,Wo=1002,on=1003,Ig=1004,ws=1005,Zt=1006,Wa=1007,Ii=1008,Tn=1009,Ih=1010,Lh=1011,os=1012,pc=1013,ti=1014,An=1015,Rn=1016,mc=1017,gc=1018,ls=1020,Nh=35902,Uh=35899,Fh=1021,Oh=1022,Vn=1023,vi=1026,Ki=1027,Bh=1028,vc=1029,rr=1030,_c=1031,xc=1033,ia=33776,ra=33777,sa=33778,aa=33779,Xo=35840,Yo=35841,jo=35842,qo=35843,Ko=36196,Zo=37492,$o=37496,Jo=37488,Qo=37489,va=37490,el=37491,tl=37808,nl=37809,il=37810,rl=37811,sl=37812,al=37813,ol=37814,ll=37815,cl=37816,ul=37817,dl=37818,hl=37819,fl=37820,pl=37821,ml=36492,gl=36494,vl=36495,_l=36283,xl=36284,_a=36285,bl=36286,Lg=3200,Sl=0,Ng=1,Pi="",wn="srgb",cs="srgb-linear",xa="linear",Pt="srgb",or=7680,yu=519,Ug=512,Fg=513,Og=514,bc=515,Bg=516,zg=517,Sc=518,kg=519,Mu=35044,Eu="300 es",Jn=2e3,us=2001;function Vg(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function ba(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Hg(){const n=ba("canvas");return n.style.display="block",n}const wu={};function Tu(...n){const e="THREE."+n.shift();console.log(e,...n)}function zh(n){const e=n[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=n[1];t&&t.isStackTrace?n[0]+=" "+t.getLocation():n[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return n}function ot(...n){n=zh(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...n)}}function yt(...n){n=zh(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...n)}}function yl(...n){const e=n.join(" ");e in wu||(wu[e]=!0,ot(...n))}function Gg(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const Wg={[Fo]:Oo,[Bo]:Vo,[zo]:Ho,[Ur]:ko,[Oo]:Fo,[Vo]:Bo,[Ho]:zo,[ko]:Ur};class ki{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}}const cn=["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"],oa=Math.PI/180,Ml=180/Math.PI;function vs(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(cn[n&255]+cn[n>>8&255]+cn[n>>16&255]+cn[n>>24&255]+"-"+cn[e&255]+cn[e>>8&255]+"-"+cn[e>>16&15|64]+cn[e>>24&255]+"-"+cn[t&63|128]+cn[t>>8&255]+"-"+cn[t>>16&255]+cn[t>>24&255]+cn[i&255]+cn[i>>8&255]+cn[i>>16&255]+cn[i>>24&255]).toLowerCase()}function bt(n,e,t){return Math.max(e,Math.min(t,n))}function Xg(n,e){return(n%e+e)%e}function Xa(n,e,t){return(1-t)*n+t*e}function Hr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function gn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Yg={DEG2RAD:oa},Kc=class Kc{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=bt(this.x,e.x,t.x),this.y=bt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=bt(this.x,e,t),this.y=bt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(bt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(bt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*i-a*r+e.x,this.y=s*r+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Kc.prototype.isVector2=!0;let ht=Kc;class Oi{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,a,o){let l=i[r+0],c=i[r+1],u=i[r+2],h=i[r+3],f=s[a+0],p=s[a+1],v=s[a+2],S=s[a+3];if(h!==S||l!==f||c!==p||u!==v){let g=l*f+c*p+u*v+h*S;g<0&&(f=-f,p=-p,v=-v,S=-S,g=-g);let m=1-o;if(g<.9995){const x=Math.acos(g),M=Math.sin(x);m=Math.sin(m*x)/M,o=Math.sin(o*x)/M,l=l*m+f*o,c=c*m+p*o,u=u*m+v*o,h=h*m+S*o}else{l=l*m+f*o,c=c*m+p*o,u=u*m+v*o,h=h*m+S*o;const x=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=x,c*=x,u*=x,h*=x}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,a){const o=i[r],l=i[r+1],c=i[r+2],u=i[r+3],h=s[a],f=s[a+1],p=s[a+2],v=s[a+3];return e[t]=o*v+u*h+l*p-c*f,e[t+1]=l*v+u*f+c*h-o*p,e[t+2]=c*v+u*p+o*f-l*h,e[t+3]=u*v-o*h-l*f-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(i/2),u=o(r/2),h=o(s/2),f=l(i/2),p=l(r/2),v=l(s/2);switch(a){case"XYZ":this._x=f*u*h+c*p*v,this._y=c*p*h-f*u*v,this._z=c*u*v+f*p*h,this._w=c*u*h-f*p*v;break;case"YXZ":this._x=f*u*h+c*p*v,this._y=c*p*h-f*u*v,this._z=c*u*v-f*p*h,this._w=c*u*h+f*p*v;break;case"ZXY":this._x=f*u*h-c*p*v,this._y=c*p*h+f*u*v,this._z=c*u*v+f*p*h,this._w=c*u*h-f*p*v;break;case"ZYX":this._x=f*u*h-c*p*v,this._y=c*p*h+f*u*v,this._z=c*u*v-f*p*h,this._w=c*u*h+f*p*v;break;case"YZX":this._x=f*u*h+c*p*v,this._y=c*p*h+f*u*v,this._z=c*u*v-f*p*h,this._w=c*u*h-f*p*v;break;case"XZY":this._x=f*u*h-c*p*v,this._y=c*p*h-f*u*v,this._z=c*u*v+f*p*h,this._w=c*u*h+f*p*v;break;default:ot("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],u=t[6],h=t[10],f=i+o+h;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(s-c)*p,this._z=(a-r)*p}else if(i>o&&i>h){const p=2*Math.sqrt(1+i-o-h);this._w=(u-l)/p,this._x=.25*p,this._y=(r+a)/p,this._z=(s+c)/p}else if(o>h){const p=2*Math.sqrt(1+o-i-h);this._w=(s-c)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+h-i-o);this._w=(a-r)/p,this._x=(s+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(bt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+a*o+r*c-s*l,this._y=r*u+a*l+s*o-i*c,this._z=s*u+a*c+i*l-r*o,this._w=a*u-i*o-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){let i=e._x,r=e._y,s=e._z,a=e._w,o=this.dot(e);o<0&&(i=-i,r=-r,s=-s,a=-a,o=-o);let l=1-t;if(o<.9995){const c=Math.acos(o),u=Math.sin(c);l=Math.sin(l*c)/u,t=Math.sin(t*c)/u,this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this._onChangeCallback()}else this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const Zc=class Zc{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Au.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Au.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*r-o*i),u=2*(o*t-s*r),h=2*(s*i-a*t);return this.x=t+l*c+a*h-o*u,this.y=i+l*u+o*c-s*h,this.z=r+l*h+s*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=bt(this.x,e.x,t.x),this.y=bt(this.y,e.y,t.y),this.z=bt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=bt(this.x,e,t),this.y=bt(this.y,e,t),this.z=bt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(bt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Ya.copy(this).projectOnVector(e),this.sub(Ya)}reflect(e){return this.sub(Ya.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(bt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Zc.prototype.isVector3=!0;let te=Zc;const Ya=new te,Au=new Oi,$c=class $c{constructor(e,t,i,r,s,a,o,l,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,a,o,l,c)}set(e,t,i,r,s,a,o,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],u=i[4],h=i[7],f=i[2],p=i[5],v=i[8],S=r[0],g=r[3],m=r[6],x=r[1],M=r[4],T=r[7],C=r[2],y=r[5],I=r[8];return s[0]=a*S+o*x+l*C,s[3]=a*g+o*M+l*y,s[6]=a*m+o*T+l*I,s[1]=c*S+u*x+h*C,s[4]=c*g+u*M+h*y,s[7]=c*m+u*T+h*I,s[2]=f*S+p*x+v*C,s[5]=f*g+p*M+v*y,s[8]=f*m+p*T+v*I,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8];return t*a*u-t*o*c-i*s*u+i*o*l+r*s*c-r*a*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=u*a-o*c,f=o*l-u*s,p=c*s-a*l,v=t*h+i*f+r*p;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/v;return e[0]=h*S,e[1]=(r*c-u*i)*S,e[2]=(o*i-r*a)*S,e[3]=f*S,e[4]=(u*t-r*l)*S,e[5]=(r*s-o*t)*S,e[6]=p*S,e[7]=(i*l-c*t)*S,e[8]=(a*t-i*s)*S,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*a+c*o)+a+e,-r*c,r*l,-r*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(ja.makeScale(e,t)),this}rotate(e){return this.premultiply(ja.makeRotation(-e)),this}translate(e,t){return this.premultiply(ja.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};$c.prototype.isMatrix3=!0;let pt=$c;const ja=new pt,Ru=new pt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Cu=new pt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function jg(){const n={enabled:!0,workingColorSpace:cs,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===Pt&&(r.r=pi(r.r),r.g=pi(r.g),r.b=pi(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Pt&&(r.r=Lr(r.r),r.g=Lr(r.g),r.b=Lr(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Pi?xa:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return yl("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return yl("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[cs]:{primaries:e,whitePoint:i,transfer:xa,toXYZ:Ru,fromXYZ:Cu,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:wn},outputColorSpaceConfig:{drawingBufferColorSpace:wn}},[wn]:{primaries:e,whitePoint:i,transfer:Pt,toXYZ:Ru,fromXYZ:Cu,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:wn}}}),n}const Mt=jg();function pi(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Lr(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let lr;class qg{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{lr===void 0&&(lr=ba("canvas")),lr.width=e.width,lr.height=e.height;const r=lr.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=lr}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=ba("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=pi(s[a]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(pi(t[i]/255)*255):t[i]=pi(t[i]);return{data:t,width:e.width,height:e.height}}else return ot("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Kg=0;class yc{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Kg++}),this.uuid=vs(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(qa(r[a].image)):s.push(qa(r[a]))}else s=qa(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function qa(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?qg.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(ot("Texture: Unable to serialize Texture."),{})}let Zg=0;const Ka=new te;class dn extends ki{constructor(e=dn.DEFAULT_IMAGE,t=dn.DEFAULT_MAPPING,i=kn,r=kn,s=Zt,a=Ii,o=Vn,l=Tn,c=dn.DEFAULT_ANISOTROPY,u=Pi){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Zg++}),this.uuid=vs(),this.name="",this.source=new yc(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new ht(0,0),this.repeat=new ht(1,1),this.center=new ht(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new pt,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=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Ka).x}get height(){return this.source.getSize(Ka).y}get depth(){return this.source.getSize(Ka).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){ot(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){ot(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Dh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Go:e.x=e.x-Math.floor(e.x);break;case kn:e.x=e.x<0?0:1;break;case Wo:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Go:e.y=e.y-Math.floor(e.y);break;case kn:e.y=e.y<0?0:1;break;case Wo:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}dn.DEFAULT_IMAGE=null;dn.DEFAULT_MAPPING=Dh;dn.DEFAULT_ANISOTROPY=1;const Jc=class Jc{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*i+a[11]*r+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],u=l[4],h=l[8],f=l[1],p=l[5],v=l[9],S=l[2],g=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(h-S)<.01&&Math.abs(v-g)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+S)<.1&&Math.abs(v+g)<.1&&Math.abs(c+p+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(c+1)/2,T=(p+1)/2,C=(m+1)/2,y=(u+f)/4,I=(h+S)/4,_=(v+g)/4;return M>T&&M>C?M<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(M),r=y/i,s=I/i):T>C?T<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(T),i=y/r,s=_/r):C<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(C),i=I/s,r=_/s),this.set(i,r,s,t),this}let x=Math.sqrt((g-v)*(g-v)+(h-S)*(h-S)+(f-u)*(f-u));return Math.abs(x)<.001&&(x=1),this.x=(g-v)/x,this.y=(h-S)/x,this.z=(f-u)/x,this.w=Math.acos((c+p+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=bt(this.x,e.x,t.x),this.y=bt(this.y,e.y,t.y),this.z=bt(this.z,e.z,t.z),this.w=bt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=bt(this.x,e,t),this.y=bt(this.y,e,t),this.z=bt(this.z,e,t),this.w=bt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(bt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};Jc.prototype.isVector4=!0;let Wt=Jc;class $g extends ki{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Zt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new Wt(0,0,e,t),this.scissorTest=!1,this.viewport=new Wt(0,0,e,t),this.textures=[];const r={width:e,height:t,depth:i.depth},s=new dn(r),a=i.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const t={minFilter:Zt,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=i,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new yc(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ei extends $g{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class kh extends dn{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=on,this.minFilter=on,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Jg extends dn{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=on,this.minFilter=on,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ma=class Ma{constructor(e,t,i,r,s,a,o,l,c,u,h,f,p,v,S,g){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,a,o,l,c,u,h,f,p,v,S,g)}set(e,t,i,r,s,a,o,l,c,u,h,f,p,v,S,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=a,m[9]=o,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=f,m[3]=p,m[7]=v,m[11]=S,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Ma().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,i=e.elements,r=1/cr.setFromMatrixColumn(e,0).length(),s=1/cr.setFromMatrixColumn(e,1).length(),a=1/cr.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const f=a*u,p=a*h,v=o*u,S=o*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=p+v*c,t[5]=f-S*c,t[9]=-o*l,t[2]=S-f*c,t[6]=v+p*c,t[10]=a*l}else if(e.order==="YXZ"){const f=l*u,p=l*h,v=c*u,S=c*h;t[0]=f+S*o,t[4]=v*o-p,t[8]=a*c,t[1]=a*h,t[5]=a*u,t[9]=-o,t[2]=p*o-v,t[6]=S+f*o,t[10]=a*l}else if(e.order==="ZXY"){const f=l*u,p=l*h,v=c*u,S=c*h;t[0]=f-S*o,t[4]=-a*h,t[8]=v+p*o,t[1]=p+v*o,t[5]=a*u,t[9]=S-f*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const f=a*u,p=a*h,v=o*u,S=o*h;t[0]=l*u,t[4]=v*c-p,t[8]=f*c+S,t[1]=l*h,t[5]=S*c+f,t[9]=p*c-v,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const f=a*l,p=a*c,v=o*l,S=o*c;t[0]=l*u,t[4]=S-f*h,t[8]=v*h+p,t[1]=h,t[5]=a*u,t[9]=-o*u,t[2]=-c*u,t[6]=p*h+v,t[10]=f-S*h}else if(e.order==="XZY"){const f=a*l,p=a*c,v=o*l,S=o*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=f*h+S,t[5]=a*u,t[9]=p*h-v,t[2]=v*h-p,t[6]=o*u,t[10]=S*h+f}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(Qg,e,ev)}lookAt(e,t,i){const r=this.elements;return Mn.subVectors(e,t),Mn.lengthSq()===0&&(Mn.z=1),Mn.normalize(),Mi.crossVectors(i,Mn),Mi.lengthSq()===0&&(Math.abs(i.z)===1?Mn.x+=1e-4:Mn.z+=1e-4,Mn.normalize(),Mi.crossVectors(i,Mn)),Mi.normalize(),Ts.crossVectors(Mn,Mi),r[0]=Mi.x,r[4]=Ts.x,r[8]=Mn.x,r[1]=Mi.y,r[5]=Ts.y,r[9]=Mn.y,r[2]=Mi.z,r[6]=Ts.z,r[10]=Mn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],u=i[1],h=i[5],f=i[9],p=i[13],v=i[2],S=i[6],g=i[10],m=i[14],x=i[3],M=i[7],T=i[11],C=i[15],y=r[0],I=r[4],_=r[8],E=r[12],L=r[1],P=r[5],k=r[9],W=r[13],H=r[2],N=r[6],R=r[10],F=r[14],U=r[3],X=r[7],V=r[11],$=r[15];return s[0]=a*y+o*L+l*H+c*U,s[4]=a*I+o*P+l*N+c*X,s[8]=a*_+o*k+l*R+c*V,s[12]=a*E+o*W+l*F+c*$,s[1]=u*y+h*L+f*H+p*U,s[5]=u*I+h*P+f*N+p*X,s[9]=u*_+h*k+f*R+p*V,s[13]=u*E+h*W+f*F+p*$,s[2]=v*y+S*L+g*H+m*U,s[6]=v*I+S*P+g*N+m*X,s[10]=v*_+S*k+g*R+m*V,s[14]=v*E+S*W+g*F+m*$,s[3]=x*y+M*L+T*H+C*U,s[7]=x*I+M*P+T*N+C*X,s[11]=x*_+M*k+T*R+C*V,s[15]=x*E+M*W+T*F+C*$,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],u=e[2],h=e[6],f=e[10],p=e[14],v=e[3],S=e[7],g=e[11],m=e[15],x=l*p-c*f,M=o*p-c*h,T=o*f-l*h,C=a*p-c*u,y=a*f-l*u,I=a*h-o*u;return t*(S*x-g*M+m*T)-i*(v*x-g*C+m*y)+r*(v*M-S*C+m*I)-s*(v*T-S*y+g*I)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],p=e[11],v=e[12],S=e[13],g=e[14],m=e[15],x=t*o-i*a,M=t*l-r*a,T=t*c-s*a,C=i*l-r*o,y=i*c-s*o,I=r*c-s*l,_=u*S-h*v,E=u*g-f*v,L=u*m-p*v,P=h*g-f*S,k=h*m-p*S,W=f*m-p*g,H=x*W-M*k+T*P+C*L-y*E+I*_;if(H===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const N=1/H;return e[0]=(o*W-l*k+c*P)*N,e[1]=(r*k-i*W-s*P)*N,e[2]=(S*I-g*y+m*C)*N,e[3]=(f*y-h*I-p*C)*N,e[4]=(l*L-a*W-c*E)*N,e[5]=(t*W-r*L+s*E)*N,e[6]=(g*T-v*I-m*M)*N,e[7]=(u*I-f*T+p*M)*N,e[8]=(a*k-o*L+c*_)*N,e[9]=(i*L-t*k-s*_)*N,e[10]=(v*y-S*T+m*x)*N,e[11]=(h*T-u*y-p*x)*N,e[12]=(o*E-a*P-l*_)*N,e[13]=(t*P-i*E+r*_)*N,e[14]=(S*M-v*C-g*x)*N,e[15]=(u*C-h*M+f*x)*N,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,a=e.x,o=e.y,l=e.z,c=s*a,u=s*o;return this.set(c*a+i,c*o-r*l,c*l+r*o,0,c*o+r*l,u*o+i,u*l-r*a,0,c*l-r*o,u*l+r*a,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,a){return this.set(1,i,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,u=a+a,h=o+o,f=s*c,p=s*u,v=s*h,S=a*u,g=a*h,m=o*h,x=l*c,M=l*u,T=l*h,C=i.x,y=i.y,I=i.z;return r[0]=(1-(S+m))*C,r[1]=(p+T)*C,r[2]=(v-M)*C,r[3]=0,r[4]=(p-T)*y,r[5]=(1-(f+m))*y,r[6]=(g+x)*y,r[7]=0,r[8]=(v+M)*I,r[9]=(g-x)*I,r[10]=(1-(f+S))*I,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinant();if(s===0)return i.set(1,1,1),t.identity(),this;let a=cr.set(r[0],r[1],r[2]).length();const o=cr.set(r[4],r[5],r[6]).length(),l=cr.set(r[8],r[9],r[10]).length();s<0&&(a=-a),Fn.copy(this);const c=1/a,u=1/o,h=1/l;return Fn.elements[0]*=c,Fn.elements[1]*=c,Fn.elements[2]*=c,Fn.elements[4]*=u,Fn.elements[5]*=u,Fn.elements[6]*=u,Fn.elements[8]*=h,Fn.elements[9]*=h,Fn.elements[10]*=h,t.setFromRotationMatrix(Fn),i.x=a,i.y=o,i.z=l,this}makePerspective(e,t,i,r,s,a,o=Jn,l=!1){const c=this.elements,u=2*s/(t-e),h=2*s/(i-r),f=(t+e)/(t-e),p=(i+r)/(i-r);let v,S;if(l)v=s/(a-s),S=a*s/(a-s);else if(o===Jn)v=-(a+s)/(a-s),S=-2*a*s/(a-s);else if(o===us)v=-a/(a-s),S=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=h,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=v,c[14]=S,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,i,r,s,a,o=Jn,l=!1){const c=this.elements,u=2/(t-e),h=2/(i-r),f=-(t+e)/(t-e),p=-(i+r)/(i-r);let v,S;if(l)v=1/(a-s),S=a/(a-s);else if(o===Jn)v=-2/(a-s),S=-(a+s)/(a-s);else if(o===us)v=-1/(a-s),S=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=0,c[12]=f,c[1]=0,c[5]=h,c[9]=0,c[13]=p,c[2]=0,c[6]=0,c[10]=v,c[14]=S,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}};Ma.prototype.isMatrix4=!0;let Xt=Ma;const cr=new te,Fn=new Xt,Qg=new te(0,0,0),ev=new te(1,1,1),Mi=new te,Ts=new te,Mn=new te,Pu=new Xt,Du=new Oi;class Bi{constructor(e=0,t=0,i=0,r=Bi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],u=r[9],h=r[2],f=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(bt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-bt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(bt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-bt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(bt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-bt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-u,p),this._y=0);break;default:ot("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return Pu.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Pu,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Du.setFromEuler(this),this.setFromQuaternion(Du,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}}Bi.DEFAULT_ORDER="XYZ";class Mc{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let tv=0;const Iu=new te,ur=new Oi,ri=new Xt,As=new te,Gr=new te,nv=new te,iv=new Oi,Lu=new te(1,0,0),Nu=new te(0,1,0),Uu=new te(0,0,1),Fu={type:"added"},rv={type:"removed"},dr={type:"childadded",child:null},Za={type:"childremoved",child:null};class hn extends ki{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:tv++}),this.uuid=vs(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hn.DEFAULT_UP.clone();const e=new te,t=new Bi,i=new Oi,r=new te(1,1,1);function s(){i.setFromEuler(t,!1)}function a(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Xt},normalMatrix:{value:new pt}}),this.matrix=new Xt,this.matrixWorld=new Xt,this.matrixAutoUpdate=hn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=hn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Mc,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 ur.setFromAxisAngle(e,t),this.quaternion.multiply(ur),this}rotateOnWorldAxis(e,t){return ur.setFromAxisAngle(e,t),this.quaternion.premultiply(ur),this}rotateX(e){return this.rotateOnAxis(Lu,e)}rotateY(e){return this.rotateOnAxis(Nu,e)}rotateZ(e){return this.rotateOnAxis(Uu,e)}translateOnAxis(e,t){return Iu.copy(e).applyQuaternion(this.quaternion),this.position.add(Iu.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Lu,e)}translateY(e){return this.translateOnAxis(Nu,e)}translateZ(e){return this.translateOnAxis(Uu,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ri.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?As.copy(e):As.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Gr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ri.lookAt(Gr,As,this.up):ri.lookAt(As,Gr,this.up),this.quaternion.setFromRotationMatrix(ri),r&&(ri.extractRotation(r.matrixWorld),ur.setFromRotationMatrix(ri),this.quaternion.premultiply(ur.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(yt("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(Fu),dr.child=e,this.dispatchEvent(dr),dr.child=null):yt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(rv),Za.child=e,this.dispatchEvent(Za),Za.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),ri.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),ri.multiply(e.parent.matrixWorld)),e.applyMatrix4(ri),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Fu),dr.child=e,this.dispatchEvent(dr),dr.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){const a=this.children[i].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gr,e,nv),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gr,iv,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,i=e.y,r=e.z,s=this.matrix.elements;s[12]+=t-s[0]*t-s[4]*i-s[8]*r,s[13]+=i-s[1]*t-s[5]*i-s[9]*r,s[14]+=r-s[2]*t-s[6]*i-s[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){const h=l[c];s(e.shapes,h)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),u=a(e.images),h=a(e.shapes),f=a(e.skeletons),p=a(e.animations),v=a(e.nodes);o.length>0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),f.length>0&&(i.skeletons=f),p.length>0&&(i.animations=p),v.length>0&&(i.nodes=v)}return i.object=r,i;function a(o){const l=[];for(const c in o){const u=o[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}hn.DEFAULT_UP=new te(0,1,0);hn.DEFAULT_MATRIX_AUTO_UPDATE=!0;hn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let Rs=class extends hn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const sv={type:"move"};class $a{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Rs,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 Rs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new te,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new te),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Rs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new te,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new te,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const S of e.hand.values()){const g=t.getJointPose(S,i),m=this._getHandJoint(c,S);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],f=u.position.distanceTo(h.position),p=.02,v=.005;c.inputState.pinching&&f>p+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=p-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1,l.eventsEnabled&&l.dispatchEvent({type:"gripUpdated",data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(sv)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Rs;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const Vh={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},Ei={h:0,s:0,l:0},Cs={h:0,s:0,l:0};function Ja(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class at{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=wn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Mt.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=Mt.workingColorSpace){return this.r=e,this.g=t,this.b=i,Mt.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=Mt.workingColorSpace){if(e=Xg(e,1),t=bt(t,0,1),i=bt(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,a=2*i-s;this.r=Ja(a,s,e+1/3),this.g=Ja(a,s,e),this.b=Ja(a,s,e-1/3)}return Mt.colorSpaceToWorking(this,r),this}setStyle(e,t=wn){function i(s){s!==void 0&&parseFloat(s)<1&&ot("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:ot("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);ot("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=wn){const i=Vh[e.toLowerCase()];return i!==void 0?this.setHex(i,t):ot("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=pi(e.r),this.g=pi(e.g),this.b=pi(e.b),this}copyLinearToSRGB(e){return this.r=Lr(e.r),this.g=Lr(e.g),this.b=Lr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=wn){return Mt.workingToColorSpace(un.copy(this),e),Math.round(bt(un.r*255,0,255))*65536+Math.round(bt(un.g*255,0,255))*256+Math.round(bt(un.b*255,0,255))}getHexString(e=wn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Mt.workingColorSpace){Mt.workingToColorSpace(un.copy(this),t);const i=un.r,r=un.g,s=un.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let l,c;const u=(o+a)/2;if(o===a)l=0,c=0;else{const h=a-o;switch(c=u<=.5?h/(a+o):h/(2-a-o),a){case i:l=(r-s)/h+(r<s?6:0);break;case r:l=(s-i)/h+2;break;case s:l=(i-r)/h+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=Mt.workingColorSpace){return Mt.workingToColorSpace(un.copy(this),t),e.r=un.r,e.g=un.g,e.b=un.b,e}getStyle(e=wn){Mt.workingToColorSpace(un.copy(this),e);const t=un.r,i=un.g,r=un.b;return e!==wn?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(Ei),this.setHSL(Ei.h+e,Ei.s+t,Ei.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Ei),e.getHSL(Cs);const i=Xa(Ei.h,Cs.h,t),r=Xa(Ei.s,Cs.s,t),s=Xa(Ei.l,Cs.l,t);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const un=new at;at.NAMES=Vh;class av extends hn{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 Bi,this.environmentIntensity=1,this.environmentRotation=new Bi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const On=new te,si=new te,Qa=new te,ai=new te,hr=new te,fr=new te,Ou=new te,eo=new te,to=new te,no=new te,io=new Wt,ro=new Wt,so=new Wt;class zn{constructor(e=new te,t=new te,i=new te){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),On.subVectors(e,t),r.cross(On);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){On.subVectors(r,t),si.subVectors(i,t),Qa.subVectors(e,t);const a=On.dot(On),o=On.dot(si),l=On.dot(Qa),c=si.dot(si),u=si.dot(Qa),h=a*c-o*o;if(h===0)return s.set(0,0,0),null;const f=1/h,p=(c*l-o*u)*f,v=(a*u-o*l)*f;return s.set(1-p-v,v,p)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,ai)===null?!1:ai.x>=0&&ai.y>=0&&ai.x+ai.y<=1}static getInterpolation(e,t,i,r,s,a,o,l){return this.getBarycoord(e,t,i,r,ai)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,ai.x),l.addScaledVector(a,ai.y),l.addScaledVector(o,ai.z),l)}static getInterpolatedAttribute(e,t,i,r,s,a){return io.setScalar(0),ro.setScalar(0),so.setScalar(0),io.fromBufferAttribute(e,t),ro.fromBufferAttribute(e,i),so.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(io,s.x),a.addScaledVector(ro,s.y),a.addScaledVector(so,s.z),a}static isFrontFacing(e,t,i,r){return On.subVectors(i,t),si.subVectors(e,t),On.cross(si).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return On.subVectors(this.c,this.b),si.subVectors(this.a,this.b),On.cross(si).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return zn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return zn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return zn.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return zn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return zn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let a,o;hr.subVectors(r,i),fr.subVectors(s,i),eo.subVectors(e,i);const l=hr.dot(eo),c=fr.dot(eo);if(l<=0&&c<=0)return t.copy(i);to.subVectors(e,r);const u=hr.dot(to),h=fr.dot(to);if(u>=0&&h<=u)return t.copy(r);const f=l*h-u*c;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),t.copy(i).addScaledVector(hr,a);no.subVectors(e,s);const p=hr.dot(no),v=fr.dot(no);if(v>=0&&p<=v)return t.copy(s);const S=p*c-l*v;if(S<=0&&c>=0&&v<=0)return o=c/(c-v),t.copy(i).addScaledVector(fr,o);const g=u*v-p*h;if(g<=0&&h-u>=0&&p-v>=0)return Ou.subVectors(s,r),o=(h-u)/(h-u+(p-v)),t.copy(r).addScaledVector(Ou,o);const m=1/(g+S+f);return a=S*m,o=f*m,t.copy(i).addScaledVector(hr,a).addScaledVector(fr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class _i{constructor(e=new te(1/0,1/0,1/0),t=new te(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(Bn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(Bn.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=Bn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Bn):Bn.fromBufferAttribute(s,a),Bn.applyMatrix4(e.matrixWorld),this.expandByPoint(Bn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Ps.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Ps.copy(i.boundingBox)),Ps.applyMatrix4(e.matrixWorld),this.union(Ps)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Bn),Bn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Wr),Ds.subVectors(this.max,Wr),pr.subVectors(e.a,Wr),mr.subVectors(e.b,Wr),gr.subVectors(e.c,Wr),wi.subVectors(mr,pr),Ti.subVectors(gr,mr),Gi.subVectors(pr,gr);let t=[0,-wi.z,wi.y,0,-Ti.z,Ti.y,0,-Gi.z,Gi.y,wi.z,0,-wi.x,Ti.z,0,-Ti.x,Gi.z,0,-Gi.x,-wi.y,wi.x,0,-Ti.y,Ti.x,0,-Gi.y,Gi.x,0];return!ao(t,pr,mr,gr,Ds)||(t=[1,0,0,0,1,0,0,0,1],!ao(t,pr,mr,gr,Ds))?!1:(Is.crossVectors(wi,Ti),t=[Is.x,Is.y,Is.z],ao(t,pr,mr,gr,Ds))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Bn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Bn).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:(oi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),oi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),oi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),oi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),oi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),oi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),oi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),oi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(oi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const oi=[new te,new te,new te,new te,new te,new te,new te,new te],Bn=new te,Ps=new _i,pr=new te,mr=new te,gr=new te,wi=new te,Ti=new te,Gi=new te,Wr=new te,Ds=new te,Is=new te,Wi=new te;function ao(n,e,t,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){Wi.fromArray(n,s);const o=r.x*Math.abs(Wi.x)+r.y*Math.abs(Wi.y)+r.z*Math.abs(Wi.z),l=e.dot(Wi),c=t.dot(Wi),u=i.dot(Wi);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}const di=ov();function ov(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function lv(n){Math.abs(n)>65504&&ot("DataUtils.toHalfFloat(): Value out of range."),n=bt(n,-65504,65504),di.floatView[0]=n;const e=di.uint32View[0],t=e>>23&511;return di.baseTable[t]+((e&8388607)>>di.shiftTable[t])}function cv(n){const e=n>>10;return di.uint32View[0]=di.mantissaTable[di.offsetTable[e]+(n&1023)]+di.exponentTable[e],di.floatView[0]}class Ls{static toHalfFloat(e){return lv(e)}static fromHalfFloat(e){return cv(e)}}const $t=new te,Ns=new ht;let uv=0;class bn extends ki{constructor(e,t,i=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:uv++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Mu,this.updateRanges=[],this.gpuType=An,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)Ns.fromBufferAttribute(this,t),Ns.applyMatrix3(e),this.setXY(t,Ns.x,Ns.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.applyMatrix3(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.applyMatrix4(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.applyNormalMatrix(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.transformDirection(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=Hr(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=gn(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Hr(t,this.array)),t}setX(e,t){return this.normalized&&(t=gn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Hr(t,this.array)),t}setY(e,t){return this.normalized&&(t=gn(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=Hr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=gn(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=Hr(t,this.array)),t}setW(e,t){return this.normalized&&(t=gn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=gn(t,this.array),i=gn(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=gn(t,this.array),i=gn(i,this.array),r=gn(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=gn(t,this.array),i=gn(i,this.array),r=gn(r,this.array),s=gn(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Mu&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class Hh extends bn{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class Gh extends bn{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class mi extends bn{constructor(e,t,i){super(new Float32Array(e),t,i)}}const dv=new _i,Xr=new te,oo=new te;class Ec{constructor(e=new te,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):dv.setFromPoints(e).getCenter(i);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Xr.subVectors(e,this.center);const t=Xr.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Xr,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(oo.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Xr.copy(e.center).add(oo)),this.expandByPoint(Xr.copy(e.center).sub(oo))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let hv=0;const Pn=new Xt,lo=new hn,vr=new te,En=new _i,Yr=new _i,tn=new te;class Wn extends ki{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:hv++}),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={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Vg(e)?Gh:Hh)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new pt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Pn.makeRotationFromQuaternion(e),this.applyMatrix4(Pn),this}rotateX(e){return Pn.makeRotationX(e),this.applyMatrix4(Pn),this}rotateY(e){return Pn.makeRotationY(e),this.applyMatrix4(Pn),this}rotateZ(e){return Pn.makeRotationZ(e),this.applyMatrix4(Pn),this}translate(e,t,i){return Pn.makeTranslation(e,t,i),this.applyMatrix4(Pn),this}scale(e,t,i){return Pn.makeScale(e,t,i),this.applyMatrix4(Pn),this}lookAt(e){return lo.lookAt(e),lo.updateMatrix(),this.applyMatrix4(lo.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(vr).negate(),this.translate(vr.x,vr.y,vr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];i.push(a.x,a.y,a.z||0)}this.setAttribute("position",new mi(i,3))}else{const i=Math.min(e.length,t.count);for(let r=0;r<i;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&ot("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 _i);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){yt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new te(-1/0,-1/0,-1/0),new te(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const s=t[i];En.setFromBufferAttribute(s),this.morphTargetsRelative?(tn.addVectors(this.boundingBox.min,En.min),this.boundingBox.expandByPoint(tn),tn.addVectors(this.boundingBox.max,En.max),this.boundingBox.expandByPoint(tn)):(this.boundingBox.expandByPoint(En.min),this.boundingBox.expandByPoint(En.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&yt('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 Ec);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){yt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new te,1/0);return}if(e){const i=this.boundingSphere.center;if(En.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];Yr.setFromBufferAttribute(o),this.morphTargetsRelative?(tn.addVectors(En.min,Yr.min),En.expandByPoint(tn),tn.addVectors(En.max,Yr.max),En.expandByPoint(tn)):(En.expandByPoint(Yr.min),En.expandByPoint(Yr.max))}En.getCenter(i);let r=0;for(let s=0,a=e.count;s<a;s++)tn.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(tn));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,u=o.count;c<u;c++)tn.fromBufferAttribute(o,c),l&&(vr.fromBufferAttribute(e,c),tn.add(vr)),r=Math.max(r,i.distanceToSquared(tn))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&yt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){yt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new bn(new Float32Array(4*i.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let _=0;_<i.count;_++)o[_]=new te,l[_]=new te;const c=new te,u=new te,h=new te,f=new ht,p=new ht,v=new ht,S=new te,g=new te;function m(_,E,L){c.fromBufferAttribute(i,_),u.fromBufferAttribute(i,E),h.fromBufferAttribute(i,L),f.fromBufferAttribute(s,_),p.fromBufferAttribute(s,E),v.fromBufferAttribute(s,L),u.sub(c),h.sub(c),p.sub(f),v.sub(f);const P=1/(p.x*v.y-v.x*p.y);isFinite(P)&&(S.copy(u).multiplyScalar(v.y).addScaledVector(h,-p.y).multiplyScalar(P),g.copy(h).multiplyScalar(p.x).addScaledVector(u,-v.x).multiplyScalar(P),o[_].add(S),o[E].add(S),o[L].add(S),l[_].add(g),l[E].add(g),l[L].add(g))}let x=this.groups;x.length===0&&(x=[{start:0,count:e.count}]);for(let _=0,E=x.length;_<E;++_){const L=x[_],P=L.start,k=L.count;for(let W=P,H=P+k;W<H;W+=3)m(e.getX(W+0),e.getX(W+1),e.getX(W+2))}const M=new te,T=new te,C=new te,y=new te;function I(_){C.fromBufferAttribute(r,_),y.copy(C);const E=o[_];M.copy(E),M.sub(C.multiplyScalar(C.dot(E))).normalize(),T.crossVectors(y,E);const P=T.dot(l[_])<0?-1:1;a.setXYZW(_,M.x,M.y,M.z,P)}for(let _=0,E=x.length;_<E;++_){const L=x[_],P=L.start,k=L.count;for(let W=P,H=P+k;W<H;W+=3)I(e.getX(W+0)),I(e.getX(W+1)),I(e.getX(W+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new bn(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let f=0,p=i.count;f<p;f++)i.setXYZ(f,0,0,0);const r=new te,s=new te,a=new te,o=new te,l=new te,c=new te,u=new te,h=new te;if(e)for(let f=0,p=e.count;f<p;f+=3){const v=e.getX(f+0),S=e.getX(f+1),g=e.getX(f+2);r.fromBufferAttribute(t,v),s.fromBufferAttribute(t,S),a.fromBufferAttribute(t,g),u.subVectors(a,s),h.subVectors(r,s),u.cross(h),o.fromBufferAttribute(i,v),l.fromBufferAttribute(i,S),c.fromBufferAttribute(i,g),o.add(u),l.add(u),c.add(u),i.setXYZ(v,o.x,o.y,o.z),i.setXYZ(S,l.x,l.y,l.z),i.setXYZ(g,c.x,c.y,c.z)}else for(let f=0,p=t.count;f<p;f+=3)r.fromBufferAttribute(t,f+0),s.fromBufferAttribute(t,f+1),a.fromBufferAttribute(t,f+2),u.subVectors(a,s),h.subVectors(r,s),u.cross(h),i.setXYZ(f+0,u.x,u.y,u.z),i.setXYZ(f+1,u.x,u.y,u.z),i.setXYZ(f+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)tn.fromBufferAttribute(e,t),tn.normalize(),e.setXYZ(t,tn.x,tn.y,tn.z)}toNonIndexed(){function e(o,l){const c=o.array,u=o.itemSize,h=o.normalized,f=new c.constructor(l.length*u);let p=0,v=0;for(let S=0,g=l.length;S<g;S++){o.isInterleavedBufferAttribute?p=l[S]*o.data.stride+o.offset:p=l[S]*u;for(let m=0;m<u;m++)f[v++]=c[p++]}return new bn(f,u,h)}if(this.index===null)return ot("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Wn,i=this.index.array,r=this.attributes;for(const o in r){const l=r[o],c=e(l,i);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let u=0,h=c.length;u<h;u++){const f=c[u],p=e(f,i);l.push(p)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,f=c.length;h<f;h++){const p=c[h];u.push(p.toJSON(e.data))}u.length>0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],h=s[c];for(let f=0,p=h.length;f<p;f++)u.push(h[f].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,u=a.length;c<u;c++){const h=a[c];this.addGroup(h.start,h.count,h.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let fv=0;class kr extends ki{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:fv++}),this.uuid=vs(),this.name="",this.type="Material",this.blending=Ir,this.side=Sn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=No,this.blendDst=Uo,this.blendEquation=ji,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new at(0,0,0),this.blendAlpha=0,this.depthFunc=Ur,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=yu,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=or,this.stencilZFail=or,this.stencilZPass=or,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){ot(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){ot(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Ir&&(i.blending=this.blending),this.side!==Sn&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==No&&(i.blendSrc=this.blendSrc),this.blendDst!==Uo&&(i.blendDst=this.blendDst),this.blendEquation!==ji&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Ur&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==yu&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==or&&(i.stencilFail=this.stencilFail),this.stencilZFail!==or&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==or&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=r(e.textures),a=r(e.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const li=new te,co=new te,Us=new te,Ai=new te,uo=new te,Fs=new te,ho=new te;class wc{constructor(e=new te,t=new te(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,li)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=li.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(li.copy(this.origin).addScaledVector(this.direction,t),li.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){co.copy(e).add(t).multiplyScalar(.5),Us.copy(t).sub(e).normalize(),Ai.copy(this.origin).sub(co);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Us),o=Ai.dot(this.direction),l=-Ai.dot(Us),c=Ai.lengthSq(),u=Math.abs(1-a*a);let h,f,p,v;if(u>0)if(h=a*l-o,f=a*o-l,v=s*u,h>=0)if(f>=-v)if(f<=v){const S=1/u;h*=S,f*=S,p=h*(h+a*f+2*o)+f*(a*h+f+2*l)+c}else f=s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+c;else f=-s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+c;else f<=-v?(h=Math.max(0,-(-a*s+o)),f=h>0?-s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+c):f<=v?(h=0,f=Math.min(Math.max(-s,-l),s),p=f*(f+2*l)+c):(h=Math.max(0,-(a*s+o)),f=h>0?s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+c);else f=a>0?-s:s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(co).addScaledVector(Us,f),p}intersectSphere(e,t){li.subVectors(e.center,this.origin);const i=li.dot(this.direction),r=li.dot(li)-i*i,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,a,o,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return c>=0?(i=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(i=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),u>=0?(s=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a<r||isNaN(r))&&(r=a),h>=0?(o=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(o=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),i>l||o>r)||((o>i||i!==i)&&(i=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,li)!==null}intersectTriangle(e,t,i,r,s){uo.subVectors(t,e),Fs.subVectors(i,e),ho.crossVectors(uo,Fs);let a=this.direction.dot(ho),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Ai.subVectors(this.origin,e);const l=o*this.direction.dot(Fs.crossVectors(Ai,Fs));if(l<0)return null;const c=o*this.direction.dot(uo.cross(Ai));if(c<0||l+c>a)return null;const u=-o*Ai.dot(ho);return u<0?null:this.at(u/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Wh extends kr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new at(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 Bi,this.combine=Eh,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Bu=new Xt,Xi=new wc,Os=new Ec,zu=new te,Bs=new te,zs=new te,ks=new te,fo=new te,Vs=new te,ku=new te,Hs=new te;class rn extends hn{constructor(e=new Wn,t=new Wh){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,a=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){Vs.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const u=o[l],h=s[l];u!==0&&(fo.fromBufferAttribute(h,e),a?Vs.addScaledVector(fo,u):Vs.addScaledVector(fo.sub(t),u))}t.add(Vs)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Os.copy(i.boundingSphere),Os.applyMatrix4(s),Xi.copy(e.ray).recast(e.near),!(Os.containsPoint(Xi.origin)===!1&&(Xi.intersectSphere(Os,zu)===null||Xi.origin.distanceToSquared(zu)>(e.far-e.near)**2))&&(Bu.copy(s).invert(),Xi.copy(e.ray).applyMatrix4(Bu),!(i.boundingBox!==null&&Xi.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Xi)))}_computeIntersections(e,t,i){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,f=s.groups,p=s.drawRange;if(o!==null)if(Array.isArray(a))for(let v=0,S=f.length;v<S;v++){const g=f[v],m=a[g.materialIndex],x=Math.max(g.start,p.start),M=Math.min(o.count,Math.min(g.start+g.count,p.start+p.count));for(let T=x,C=M;T<C;T+=3){const y=o.getX(T),I=o.getX(T+1),_=o.getX(T+2);r=Gs(this,m,e,i,c,u,h,y,I,_),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const v=Math.max(0,p.start),S=Math.min(o.count,p.start+p.count);for(let g=v,m=S;g<m;g+=3){const x=o.getX(g),M=o.getX(g+1),T=o.getX(g+2);r=Gs(this,a,e,i,c,u,h,x,M,T),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let v=0,S=f.length;v<S;v++){const g=f[v],m=a[g.materialIndex],x=Math.max(g.start,p.start),M=Math.min(l.count,Math.min(g.start+g.count,p.start+p.count));for(let T=x,C=M;T<C;T+=3){const y=T,I=T+1,_=T+2;r=Gs(this,m,e,i,c,u,h,y,I,_),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const v=Math.max(0,p.start),S=Math.min(l.count,p.start+p.count);for(let g=v,m=S;g<m;g+=3){const x=g,M=g+1,T=g+2;r=Gs(this,a,e,i,c,u,h,x,M,T),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}}}function pv(n,e,t,i,r,s,a,o){let l;if(e.side===xn?l=i.intersectTriangle(a,s,r,!0,o):l=i.intersectTriangle(r,s,a,e.side===Sn,o),l===null)return null;Hs.copy(o),Hs.applyMatrix4(n.matrixWorld);const c=t.ray.origin.distanceTo(Hs);return c<t.near||c>t.far?null:{distance:c,point:Hs.clone(),object:n}}function Gs(n,e,t,i,r,s,a,o,l,c){n.getVertexPosition(o,Bs),n.getVertexPosition(l,zs),n.getVertexPosition(c,ks);const u=pv(n,e,t,i,Bs,zs,ks,ku);if(u){const h=new te;zn.getBarycoord(ku,Bs,zs,ks,h),r&&(u.uv=zn.getInterpolatedAttribute(r,o,l,c,h,new ht)),s&&(u.uv1=zn.getInterpolatedAttribute(s,o,l,c,h,new ht)),a&&(u.normal=zn.getInterpolatedAttribute(a,o,l,c,h,new te),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const f={a:o,b:l,c,normal:new te,materialIndex:0};zn.getNormal(Bs,zs,ks,f.normal),u.face=f,u.barycoord=h}return u}class Xh extends dn{constructor(e=null,t=1,i=1,r,s,a,o,l,c=on,u=on,h,f){super(null,a,o,l,c,u,r,s,h,f),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const po=new te,mv=new te,gv=new pt;class Ci{constructor(e=new te(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=po.subVectors(i,t).cross(mv.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,i=!0){const r=e.delta(po),s=this.normal.dot(r);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/s;return i===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||gv.getNormalMatrix(e),r=this.coplanarPoint(po).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Yi=new Ec,vv=new ht(.5,.5),Ws=new te;class Tc{constructor(e=new Ci,t=new Ci,i=new Ci,r=new Ci,s=new Ci,a=new Ci){this.planes=[e,t,i,r,s,a]}set(e,t,i,r,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Jn,i=!1){const r=this.planes,s=e.elements,a=s[0],o=s[1],l=s[2],c=s[3],u=s[4],h=s[5],f=s[6],p=s[7],v=s[8],S=s[9],g=s[10],m=s[11],x=s[12],M=s[13],T=s[14],C=s[15];if(r[0].setComponents(c-a,p-u,m-v,C-x).normalize(),r[1].setComponents(c+a,p+u,m+v,C+x).normalize(),r[2].setComponents(c+o,p+h,m+S,C+M).normalize(),r[3].setComponents(c-o,p-h,m-S,C-M).normalize(),i)r[4].setComponents(l,f,g,T).normalize(),r[5].setComponents(c-l,p-f,m-g,C-T).normalize();else if(r[4].setComponents(c-l,p-f,m-g,C-T).normalize(),t===Jn)r[5].setComponents(c+l,p+f,m+g,C+T).normalize();else if(t===us)r[5].setComponents(l,f,g,T).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Yi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Yi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Yi)}intersectsSprite(e){Yi.center.set(0,0,0);const t=vv.distanceTo(e.center);return Yi.radius=.7071067811865476+t,Yi.applyMatrix4(e.matrixWorld),this.intersectsSphere(Yi)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(Ws.x=r.normal.x>0?e.max.x:e.min.x,Ws.y=r.normal.y>0?e.max.y:e.min.y,Ws.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Ws)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Yh extends dn{constructor(e=[],t=ir,i,r,s,a,o,l,c,u){super(e,t,i,r,s,a,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Or extends dn{constructor(e,t,i=ti,r,s,a,o=on,l=on,c,u=vi,h=1){if(u!==vi&&u!==Ki)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:t,depth:h};super(f,r,s,a,o,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new yc(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class _v extends Or{constructor(e,t=ti,i=ir,r,s,a=on,o=on,l,c=vi){const u={width:e,height:e,depth:1},h=[u,u,u,u,u,u];super(e,e,t,i,r,s,a,o,l,c),this.image=h,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class jh extends dn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class _s extends Wn{constructor(e=1,t=1,i=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],u=[],h=[];let f=0,p=0;v("z","y","x",-1,-1,i,t,e,a,s,0),v("z","y","x",1,-1,i,t,-e,a,s,1),v("x","z","y",1,1,e,i,t,r,a,2),v("x","z","y",1,-1,e,i,-t,r,a,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new mi(c,3)),this.setAttribute("normal",new mi(u,3)),this.setAttribute("uv",new mi(h,2));function v(S,g,m,x,M,T,C,y,I,_,E){const L=T/I,P=C/_,k=T/2,W=C/2,H=y/2,N=I+1,R=_+1;let F=0,U=0;const X=new te;for(let V=0;V<R;V++){const $=V*P-W;for(let ee=0;ee<N;ee++){const Se=ee*L-k;X[S]=Se*x,X[g]=$*M,X[m]=H,c.push(X.x,X.y,X.z),X[S]=0,X[g]=0,X[m]=y>0?1:-1,u.push(X.x,X.y,X.z),h.push(ee/I),h.push(1-V/_),F+=1}}for(let V=0;V<_;V++)for(let $=0;$<I;$++){const ee=f+$+N*V,Se=f+$+N*(V+1),ye=f+($+1)+N*(V+1),ve=f+($+1)+N*V;l.push(ee,Se,ve),l.push(Se,ye,ve),U+=6}o.addGroup(p,U,E),p+=U,f+=F}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new _s(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class xs extends Wn{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const s=e/2,a=t/2,o=Math.floor(i),l=Math.floor(r),c=o+1,u=l+1,h=e/o,f=t/l,p=[],v=[],S=[],g=[];for(let m=0;m<u;m++){const x=m*f-a;for(let M=0;M<c;M++){const T=M*h-s;v.push(T,-x,0),S.push(0,0,1),g.push(M/o),g.push(1-m/l)}}for(let m=0;m<l;m++)for(let x=0;x<o;x++){const M=x+c*m,T=x+c*(m+1),C=x+1+c*(m+1),y=x+1+c*m;p.push(M,T,y),p.push(T,C,y)}this.setIndex(p),this.setAttribute("position",new mi(v,3)),this.setAttribute("normal",new mi(S,3)),this.setAttribute("uv",new mi(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xs(e.width,e.height,e.widthSegments,e.heightSegments)}}function Br(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];if(Vu(r))r.isRenderTargetTexture?(ot("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone();else if(Array.isArray(r))if(Vu(r[0])){const s=[];for(let a=0,o=r.length;a<o;a++)s[a]=r[a].clone();e[t][i]=s}else e[t][i]=r.slice();else e[t][i]=r}}return e}function pn(n){const e={};for(let t=0;t<n.length;t++){const i=Br(n[t]);for(const r in i)e[r]=i[r]}return e}function Vu(n){return n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)}function xv(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function qh(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Mt.workingColorSpace}const bv={clone:Br,merge:pn};var Sv=`void main() {
|
|
1
|
+
import"../chunks/DsnmJJEf.js";import{a$ as ap,bb as op,bl as lp,S as cp,R as ha,T as up,g as d,j as O,e as we,u as z,k as Rt,K as nn,p as nt,f as ae,a as it,s as ue,c as Q,n as Ut,r as q,ax as dp,t as Le,a8 as $i,b as ct,h as $n,J as hp,bm as jd,i as fp,at as lu,bn as cu}from"../chunks/ooPBmYPj.js";import{c as Pe,a as D,p as Un,f as Z,t as Tt,d as pp}from"../chunks/_OLpdTiI.js";import{i as _e}from"../chunks/C8ko2SLk.js";import{_ as qd}from"../chunks/BapAUJpM.js";import{o as Kt,s as Ze,a as Lt,d as Gn,c as mp,e as gp}from"../chunks/BMGykAfL.js";import{S as vp}from"../chunks/DRDjLZb3.js";import{a as _p,D as Kd,A as xp,U as bp}from"../chunks/DmaxIj00.js";import{A as Sp,o as yp,d as Zd,u as Mp,g as Ep,k as wp}from"../chunks/CZ1oTCKP.js";import{f as sn,r as kl,e as Ht,a as Vt,c as At,d as fa,k as $d,l as za,j as hi,s as Tp}from"../chunks/C1aQuqo_.js";import{s as _t,p as me,r as lt,c as We,b as Nn}from"../chunks/CcYNc8-G.js";import{p as uu}from"../chunks/CQbfyd2L.js";import{o as Ea,a as Jd}from"../chunks/D0QMYypb.js";import{w as Js,F as du}from"../chunks/2_FEXmq1.js";import{b as Qd}from"../chunks/DEBBEmC0.js";import{S as is}from"../chunks/C1Sz0rtw.js";import{S as pa}from"../chunks/D_wr-JLf.js";import{S as hu}from"../chunks/Doks8ISn.js";import{C as eh}from"../chunks/hRoV10UM.js";import{I as an,c as Ln}from"../chunks/Bnpwcepm.js";import{X as Ap}from"../chunks/CEnIp_6Y.js";import{R as Ar,D as Rr,b as Ji,T as Qs,a as rs,c as ss}from"../chunks/CpGv0MSX.js";import{s as Ct}from"../chunks/BNScKugQ.js";import{a as Hn,e as tr,h as ma,x as Rp,c as Vl,b as xi,d as ut,m as fn,s as Io,r as Hl,S as Cp,y as Pp}from"../chunks/CRRzXoPz.js";import{B as mn}from"../chunks/azBeeLR0.js";import{P as Dp,F as fu,D as ka,U as pu}from"../chunks/C26nmevH.js";import{C as th}from"../chunks/Zf7VV5ZB.js";import{C as zi,w as Fi,E as Ip,S as Lp,i as Np,b as nh,a as ih,A as rh,c as sh,H as ah,d as oh,f as lh,n as mu}from"../chunks/gMllmzma.js";import{i as Up,H as Fp,o as ch,c as Op,R as Bp,S as zp,a as kp,b as Vp}from"../chunks/BGxzXVpM.js";import{h as Hp}from"../chunks/iEBlyxZv.js";import{T as Gp,a as Wp,b as Xp,d as Yp,c as jp}from"../chunks/1s2jTHrf.js";import{C as uh,a as Cr}from"../chunks/wamM80bu.js";import{C as dh}from"../chunks/D99uXqZb.js";import{C as qp,a as Kp}from"../chunks/uINs3xv3.js";import{C as Zp}from"../chunks/BU9URCkw.js";import{C as $p}from"../chunks/D7l1JayF.js";import{L as Di}from"../chunks/B8uG8z2c.js";import{I as Pr}from"../chunks/jFKgkeON.js";import{t as Jp}from"../chunks/BoR6OKl6.js";import{F as Qp}from"../chunks/pRg-f8xU.js";import{r as em}from"../chunks/Cbu9Tg11.js";import{C as tm}from"../chunks/BjkQG7dw.js";const nm=[];function Gl(n,e=!1,t=!1){return ea(n,new Map,"",nm,null,t)}function ea(n,e,t,i,r=null,s=!1){if(typeof n=="object"&&n!==null){var a=e.get(n);if(a!==void 0)return a;if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);if(ap(n)){var o=Array(n.length);e.set(n,o),r!==null&&e.set(r,o);for(var l=0;l<n.length;l+=1){var c=n[l];l in n&&(o[l]=ea(c,e,t,i,null,s))}return o}if(op(n)===lp){o={},e.set(n,o),r!==null&&e.set(r,o);for(var u of Object.keys(n))o[u]=ea(n[u],e,t,i,null,s);return o}if(n instanceof Date)return structuredClone(n);if(typeof n.toJSON=="function"&&!s)return ea(n.toJSON(),e,t,i,n)}if(n instanceof EventTarget)return n;try{return structuredClone(n)}catch{return n}}class im{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return cp(this.#t)}get(){const e=ha(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=ha(this.#t);return t===void 0?e:t}set(e){return up(this.#t,e)}}function rm(n,e){if(Up(n)){const i=n();return i===void 0?e:i}return n===void 0?e:n}function wa(n,e){let t=we(null);const i=z(()=>rm(e,250));function r(...s){if(d(t))d(t).timeout&&clearTimeout(d(t).timeout);else{let a,o;const l=new Promise((c,u)=>{a=c,o=u});O(t,{timeout:null,runner:null,promise:l,resolve:a,reject:o},!0)}return d(t).runner=async()=>{if(!d(t))return;const a=d(t);O(t,null);try{a.resolve(await n.apply(this,s))}catch(o){a.reject(o)}},d(t).timeout=setTimeout(d(t).runner,d(i)),d(t).promise}return r.cancel=async()=>{(!d(t)||d(t).timeout===null)&&(await new Promise(s=>setTimeout(s,0)),!d(t)||d(t).timeout===null)||(clearTimeout(d(t).timeout),d(t).reject("Cancelled"),O(t,null))},r.runScheduledNow=async()=>{(!d(t)||!d(t).timeout)&&(await new Promise(s=>setTimeout(s,0)),!d(t)||!d(t).timeout)||(clearTimeout(d(t).timeout),d(t).timeout=null,await d(t).runner?.())},Object.defineProperty(r,"pending",{enumerable:!0,get(){return!!d(t)?.timeout}}),r}class Wl{#e=we(!1);constructor(){Rt(()=>(nn(()=>O(this.#e,!0)),()=>{O(this.#e,!1)}))}get current(){return d(this.#e)}}const sm=Vl({component:"checkbox",parts:["root","group","group-label","input"]}),am=new zi("Checkbox.Group"),hh=new zi("Checkbox.Root");class Xl{static create(e,t=null){return hh.set(new Xl(e,t))}opts;group;#e=z(()=>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){O(this.#e,e)}#t=z(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return d(this.#t)}set trueRequired(e){O(this.#t,e)}#n=z(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return d(this.#n)}set trueDisabled(e){O(this.#n,e)}#i=z(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return d(this.#i)}set trueReadonly(e){O(this.#i,e)}attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=Hn(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),Fi.pre([()=>Gl(this.group?.opts.value.current),()=>this.opts.value.current],([i,r])=>{!i||!r||(this.opts.checked.current=i.includes(r))}),Fi.pre(()=>this.opts.checked.current,i=>{this.group&&(i?this.group?.addValue(this.opts.value.current):this.group?.removeValue(this.opts.value.current))})}onkeydown(e){if(!(this.trueDisabled||this.trueReadonly)){if(e.key===Ip){e.preventDefault(),this.opts.type.current==="submit"&&e.currentTarget.closest("form")?.requestSubmit();return}e.key===Lp&&(e.preventDefault(),this.#r())}}#r(){this.opts.indeterminate.current?(this.opts.indeterminate.current=!1,this.opts.checked.current=!0):this.opts.checked.current=!this.opts.checked.current}onclick(e){if(!(this.trueDisabled||this.trueReadonly)){if(this.opts.type.current==="submit"){this.#r();return}e.preventDefault(),this.#r()}}#s=z(()=>({checked:this.opts.checked.current,indeterminate:this.opts.indeterminate.current}));get snippetProps(){return d(this.#s)}set snippetProps(e){O(this.#s,e)}#a=z(()=>({id:this.opts.id.current,role:"checkbox",type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":Rp(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":ma(this.trueRequired),"aria-readonly":ma(this.trueReadonly),"data-disabled":tr(this.trueDisabled),"data-readonly":tr(this.trueReadonly),"data-state":om(this.opts.checked.current,this.opts.indeterminate.current),[sm.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return d(this.#a)}set props(e){O(this.#a,e)}}class Yl{static create(){return new Yl(hh.get())}root;#e=z(()=>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){O(this.#e,e)}#t=z(()=>!!this.root.trueName);get shouldRender(){return d(this.#t)}set shouldRender(e){O(this.#t,e)}constructor(e){this.root=e,this.onfocus=this.onfocus.bind(this)}onfocus(e){Np(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#n=z(()=>({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){O(this.#n,e)}}function om(n,e){return e?"indeterminate":n?"checked":"unchecked"}function lm(n,e){nt(e,!0);const t=Yl.create();var i=Pe(),r=ae(i);{var s=a=>{Fp(a,_t(()=>t.props))};_e(r,a=>{t.shouldRender&&a(s)})}D(n,i),it()}var cm=Z("<button><!></button>"),um=Z("<!> <!>",1);function dm(n,e){const t=Un();nt(e,!0);let i=me(e,"checked",15,!1),r=me(e,"ref",15,null),s=me(e,"disabled",3,!1),a=me(e,"required",3,!1),o=me(e,"name",3,void 0),l=me(e,"value",3,"on"),c=me(e,"id",19,()=>xi(t)),u=me(e,"indeterminate",15,!1),h=me(e,"type",3,"button"),f=lt(e,["$$slots","$$events","$$legacy","checked","ref","onCheckedChange","children","disabled","required","name","value","id","indeterminate","onIndeterminateChange","child","type","readonly"]);const p=am.getOr(null);p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1)),Fi.pre(()=>l(),()=>{p&&l()&&(p.opts.value.current.includes(l())?i(!0):i(!1))});const v=Xl.create({checked:ut(()=>i(),C=>{i(C),e.onCheckedChange?.(C)}),disabled:ut(()=>s()??!1),required:ut(()=>a()),name:ut(()=>o()),value:ut(()=>l()),id:ut(()=>c()),ref:ut(()=>r(),C=>r(C)),indeterminate:ut(()=>u(),C=>{u(C),e.onIndeterminateChange?.(C)}),type:ut(()=>h()),readonly:ut(()=>!!e.readonly)},p),S=z(()=>fn({...f},v.props));var g=um(),m=ae(g);{var x=C=>{var y=Pe(),I=ae(y);{let _=z(()=>({props:d(S),...v.snippetProps}));Ct(I,()=>e.child,()=>d(_))}D(C,y)},M=C=>{var y=cm();sn(y,()=>({...d(S)}));var I=Q(y);Ct(I,()=>e.children??Ut,()=>v.snippetProps),q(y),D(C,y)};_e(m,C=>{e.child?C(x):C(M,-1)})}var T=ue(m,2);lm(T,{}),D(n,g),it()}class nr{#e;#t;constructor(e,t){this.#e=e,this.#t=t,this.handler=this.handler.bind(this),Rt(this.handler)}handler(){let e=0;const t=this.#e();if(!t)return;const i=new ResizeObserver(()=>{cancelAnimationFrame(e),e=window.requestAnimationFrame(this.#t)});return i.observe(t),()=>{window.cancelAnimationFrame(e),i.unobserve(t)}}}class hm{opts;present;#e;#t=we(!1);#n=!1;#i=we(void 0);#r=null;constructor(e){this.opts=e,this.present=this.opts.open,O(this.#t,e.open.current,!0),this.#e=new Sp({ref:this.opts.ref,afterTick:this.opts.open}),yp(()=>this.#a()),Fi(()=>this.present.current,t=>{if(!this.#n){this.#n=!0;return}this.#a(),t&&O(this.#t,!0),O(this.#i,t?"starting":"ending",!0),t&&(this.#r=window.requestAnimationFrame(()=>{this.#r=null,this.present.current&&O(this.#i,void 0)})),this.#e.run(()=>{t===this.present.current&&(t||O(this.#t,!1),O(this.#i,void 0))})})}#s=z(()=>d(this.#t));get isPresent(){return d(this.#s)}set isPresent(e){O(this.#s,e)}get transitionStatus(){return d(this.#i)}#a(){this.#r!==null&&(window.cancelAnimationFrame(this.#r),this.#r=null)}}function Ta(n,e){nt(e,!0);const t=new hm({open:ut(()=>e.open),ref:e.ref});var i=Pe(),r=ae(i);{var s=a=>{var o=Pe(),l=ae(o);Ct(l,()=>e.presence??Ut,()=>({present:t.isPresent,transitionStatus:t.transitionStatus})),D(a,o)};_e(r,a=>{(e.forceMount||e.open||t.isPresent)&&a(s)})}D(n,i),it()}function fm(n,e,t){return Math.min(t,Math.max(e,n))}class pm{state;#e;constructor(e,t){this.state=Io(e),this.#e=t,this.dispatch=this.dispatch.bind(this)}#t(e){return this.#e[this.state.current][e]??this.state.current}dispatch(e){this.state.current=this.#t(e)}}const ps=Vl({component:"scroll-area",parts:["root","viewport","corner","thumb","scrollbar"]}),ms=new zi("ScrollArea.Root"),gs=new zi("ScrollArea.Scrollbar"),Aa=new zi("ScrollArea.ScrollbarVisible"),jl=new zi("ScrollArea.ScrollbarAxis"),fh=new zi("ScrollArea.ScrollbarShared");class ql{static create(e){return ms.set(new ql(e))}opts;attachment;#e=we(null);get scrollAreaNode(){return d(this.#e)}set scrollAreaNode(e){O(this.#e,e,!0)}#t=we(null);get viewportNode(){return d(this.#t)}set viewportNode(e){O(this.#t,e,!0)}#n=we(null);get contentNode(){return d(this.#n)}set contentNode(e){O(this.#n,e,!0)}#i=we(null);get scrollbarXNode(){return d(this.#i)}set scrollbarXNode(e){O(this.#i,e,!0)}#r=we(null);get scrollbarYNode(){return d(this.#r)}set scrollbarYNode(e){O(this.#r,e,!0)}#s=we(0);get cornerWidth(){return d(this.#s)}set cornerWidth(e){O(this.#s,e,!0)}#a=we(0);get cornerHeight(){return d(this.#a)}set cornerHeight(e){O(this.#a,e,!0)}#o=we(!1);get scrollbarXEnabled(){return d(this.#o)}set scrollbarXEnabled(e){O(this.#o,e,!0)}#l=we(!1);get scrollbarYEnabled(){return d(this.#l)}set scrollbarYEnabled(e){O(this.#l,e,!0)}domContext;constructor(e){this.opts=e,this.attachment=Hn(e.ref,t=>this.scrollAreaNode=t),this.domContext=new Zd(e.ref)}#c=z(()=>({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`},[ps.root]:"",...this.attachment}));get props(){return d(this.#c)}set props(e){O(this.#c,e)}}class Kl{static create(e){return new Kl(e,ms.get())}opts;root;attachment;#e=Io(Mp());#t=Io(null);contentAttachment=Hn(this.#t,e=>this.root.contentNode=e);constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(e.ref,i=>this.root.viewportNode=i)}#n=z(()=>({id:this.opts.id.current,style:{overflowX:this.root.scrollbarXEnabled?"scroll":"hidden",overflowY:this.root.scrollbarYEnabled?"scroll":"hidden"},[ps.viewport]:"",...this.attachment}));get props(){return d(this.#n)}set props(e){O(this.#n,e)}#i=z(()=>({id:this.#e.current,"data-scroll-area-content":"",style:{minWidth:this.root.scrollbarXEnabled?"fit-content":void 0},...this.contentAttachment}));get contentProps(){return d(this.#i)}set contentProps(e){O(this.#i,e)}}class Zl{static create(e){return gs.set(new Zl(e,ms.get()))}opts;root;#e=z(()=>this.opts.orientation.current==="horizontal");get isHorizontal(){return d(this.#e)}set isHorizontal(e){O(this.#e,e)}#t=we(!1);get hasThumb(){return d(this.#t)}set hasThumb(e){O(this.#t,e,!0)}constructor(e,t){this.opts=e,this.root=t,Fi(()=>this.isHorizontal,i=>i?(this.root.scrollbarXEnabled=!0,()=>{this.root.scrollbarXEnabled=!1}):(this.root.scrollbarYEnabled=!0,()=>{this.root.scrollbarYEnabled=!1}))}}class $l{static create(){return new $l(gs.get())}scrollbar;root;#e=we(!1);get isVisible(){return d(this.#e)}set isVisible(e){O(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Rt(()=>{const t=this.root.scrollAreaNode,i=this.root.opts.scrollHideDelay.current;let r=0;if(!t)return;const s=()=>{this.root.domContext.clearTimeout(r),nn(()=>this.isVisible=!0)},a=()=>{r&&this.root.domContext.clearTimeout(r),r=this.root.domContext.setTimeout(()=>{nn(()=>{this.scrollbar.hasThumb=!1,this.isVisible=!1})},i)},o=Hl(Kt(t,"pointerenter",s),Kt(t,"pointerleave",a));return()=>{this.root.domContext.getWindow().clearTimeout(r),o()}})}#t=z(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class Jl{static create(){return new Jl(gs.get())}scrollbar;root;machine=new pm("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=z(()=>this.machine.state.current==="hidden");get isHidden(){return d(this.#e)}set isHidden(e){O(this.#e,e)}constructor(e){this.scrollbar=e,this.root=e.root;const t=wa(()=>this.machine.dispatch("SCROLL_END"),100);Rt(()=>{const i=this.machine.state.current,r=this.root.opts.scrollHideDelay.current;if(i==="idle"){const s=this.root.domContext.setTimeout(()=>this.machine.dispatch("HIDE"),r);return()=>this.root.domContext.clearTimeout(s)}}),Rt(()=>{const i=this.root.viewportNode;if(!i)return;const r=this.scrollbar.isHorizontal?"scrollLeft":"scrollTop";let s=i[r];return Kt(i,"scroll",()=>{const l=i[r];s!==l&&(this.machine.dispatch("SCROLL"),t()),s=l})}),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this)}onpointerenter(e){this.machine.dispatch("POINTER_ENTER")}onpointerleave(e){this.machine.dispatch("POINTER_LEAVE")}#t=z(()=>({"data-state":this.machine.state.current==="hidden"?"hidden":"visible",onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class Ra{static create(){return new Ra(gs.get())}scrollbar;root;#e=we(!1);get isVisible(){return d(this.#e)}set isVisible(e){O(this.#e,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root;const t=wa(()=>{const i=this.root.viewportNode;if(!i)return;const r=i.offsetWidth<i.scrollWidth,s=i.offsetHeight<i.scrollHeight;this.isVisible=this.scrollbar.isHorizontal?r:s},10);new nr(()=>this.root.viewportNode,t),new nr(()=>this.root.contentNode,t)}#t=z(()=>({"data-state":this.isVisible?"visible":"hidden"}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class Ql{static create(){return Aa.set(new Ql(gs.get()))}scrollbar;root;#e=we(null);get thumbNode(){return d(this.#e)}set thumbNode(e){O(this.#e,e,!0)}#t=we(0);get pointerOffset(){return d(this.#t)}set pointerOffset(e){O(this.#t,e,!0)}#n=we({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}});get sizes(){return d(this.#n)}set sizes(e){O(this.#n,e)}#i=z(()=>ph(this.sizes.viewport,this.sizes.content));get thumbRatio(){return d(this.#i)}set thumbRatio(e){O(this.#i,e)}#r=z(()=>this.thumbRatio>0&&this.thumbRatio<1);get hasThumb(){return d(this.#r)}set hasThumb(e){O(this.#r,e)}#s=we("");get prevTransformStyle(){return d(this.#s)}set prevTransformStyle(e){O(this.#s,e,!0)}constructor(e){this.scrollbar=e,this.root=e.root,Rt(()=>{this.scrollbar.hasThumb=this.hasThumb}),Rt(()=>{!this.scrollbar.hasThumb&&this.thumbNode&&(this.prevTransformStyle=this.thumbNode.style.transform)})}setSizes(e){this.sizes=e}getScrollPosition(e,t){return mm({pointerPos:e,pointerOffset:this.pointerOffset,sizes:this.sizes,dir:t})}onThumbPointerUp(){this.pointerOffset=0}onThumbPointerDown(e){this.pointerOffset=e}xOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const e=this.root.viewportNode.scrollLeft,i=`translate3d(${gu({scrollPos:e,sizes:this.sizes,dir:this.root.opts.dir.current})}px, 0, 0)`;this.thumbNode.style.transform=i,this.prevTransformStyle=i}xOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=e)}xOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollLeft=this.getScrollPosition(e,this.root.opts.dir.current))}yOnThumbPositionChange(){if(!(this.root.viewportNode&&this.thumbNode))return;const e=this.root.viewportNode.scrollTop,i=`translate3d(0, ${gu({scrollPos:e,sizes:this.sizes})}px, 0)`;this.thumbNode.style.transform=i,this.prevTransformStyle=i}yOnWheelScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=e)}yOnDragScroll(e){this.root.viewportNode&&(this.root.viewportNode.scrollTop=this.getScrollPosition(e,this.root.opts.dir.current))}}class ec{static create(e){return jl.set(new ec(e,Aa.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=we();get computedStyle(){return d(this.#e)}set computedStyle(e){O(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=Hn(this.scrollbar.opts.ref,i=>this.root.scrollbarXNode=i),Rt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Rt(()=>{this.onResize()})}onThumbPointerDown=e=>{this.scrollbarVis.onThumbPointerDown(e.x)};onDragScroll=e=>{this.scrollbarVis.xOnDragScroll(e.x)};onThumbPointerUp=()=>{this.scrollbarVis.onThumbPointerUp()};onThumbPositionChange=()=>{this.scrollbarVis.xOnThumbPositionChange()};onWheelScroll=(e,t)=>{if(!this.root.viewportNode)return;const i=this.root.viewportNode.scrollLeft+e.deltaX;this.scrollbarVis.xOnWheelScroll(i),gh(i,t)&&e.preventDefault()};onResize=()=>{this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollWidth,viewport:this.root.viewportNode.offsetWidth,scrollbar:{size:this.scrollbar.opts.ref.current.clientWidth,paddingStart:ga(this.computedStyle.paddingLeft),paddingEnd:ga(this.computedStyle.paddingRight)}})};#t=z(()=>Ca(this.scrollbarVis.sizes));get thumbSize(){return d(this.#t)}set thumbSize(e){O(this.#t,e)}#n=z(()=>({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){O(this.#n,e)}}class tc{static create(e){return jl.set(new tc(e,Aa.get()))}opts;scrollbarVis;root;scrollbar;attachment;#e=we();get computedStyle(){return d(this.#e)}set computedStyle(e){O(this.#e,e,!0)}constructor(e,t){this.opts=e,this.scrollbarVis=t,this.root=t.root,this.scrollbar=t.scrollbar,this.attachment=Hn(this.scrollbar.opts.ref,i=>this.root.scrollbarYNode=i),Rt(()=>{this.scrollbar.opts.ref.current&&this.opts.mounted.current&&(this.computedStyle=getComputedStyle(this.scrollbar.opts.ref.current))}),Rt(()=>{this.onResize()}),this.onThumbPointerDown=this.onThumbPointerDown.bind(this),this.onDragScroll=this.onDragScroll.bind(this),this.onThumbPointerUp=this.onThumbPointerUp.bind(this),this.onThumbPositionChange=this.onThumbPositionChange.bind(this),this.onWheelScroll=this.onWheelScroll.bind(this),this.onResize=this.onResize.bind(this)}onThumbPointerDown(e){this.scrollbarVis.onThumbPointerDown(e.y)}onDragScroll(e){this.scrollbarVis.yOnDragScroll(e.y)}onThumbPointerUp(){this.scrollbarVis.onThumbPointerUp()}onThumbPositionChange(){this.scrollbarVis.yOnThumbPositionChange()}onWheelScroll(e,t){if(!this.root.viewportNode)return;const i=this.root.viewportNode.scrollTop+e.deltaY;this.scrollbarVis.yOnWheelScroll(i),gh(i,t)&&e.preventDefault()}onResize(){this.scrollbar.opts.ref.current&&this.root.viewportNode&&this.computedStyle&&this.scrollbarVis.setSizes({content:this.root.viewportNode.scrollHeight,viewport:this.root.viewportNode.offsetHeight,scrollbar:{size:this.scrollbar.opts.ref.current.clientHeight,paddingStart:ga(this.computedStyle.paddingTop),paddingEnd:ga(this.computedStyle.paddingBottom)}})}#t=z(()=>Ca(this.scrollbarVis.sizes));get thumbSize(){return d(this.#t)}set thumbSize(e){O(this.#t,e)}#n=z(()=>({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){O(this.#n,e)}}class nc{static create(){return fh.set(new nc(jl.get()))}scrollbarState;root;scrollbarVis;scrollbar;#e=we(null);get rect(){return d(this.#e)}set rect(e){O(this.#e,e)}#t=we("");get prevWebkitUserSelect(){return d(this.#t)}set prevWebkitUserSelect(e){O(this.#t,e,!0)}handleResize;handleThumbPositionChange;handleWheelScroll;handleThumbPointerDown;handleThumbPointerUp;#n=z(()=>this.scrollbarVis.sizes.content-this.scrollbarVis.sizes.viewport);get maxScrollPos(){return d(this.#n)}set maxScrollPos(e){O(this.#n,e)}constructor(e){this.scrollbarState=e,this.root=e.root,this.scrollbarVis=e.scrollbarVis,this.scrollbar=e.scrollbarVis.scrollbar,this.handleResize=wa(()=>this.scrollbarState.onResize(),10),this.handleThumbPositionChange=this.scrollbarState.onThumbPositionChange,this.handleWheelScroll=this.scrollbarState.onWheelScroll,this.handleThumbPointerDown=this.scrollbarState.onThumbPointerDown,this.handleThumbPointerUp=this.scrollbarState.onThumbPointerUp,Rt(()=>{const t=this.maxScrollPos,i=this.scrollbar.opts.ref.current;this.root.viewportNode;const r=a=>{const o=a.target;i?.contains(o)&&this.handleWheelScroll(a,t)};return Kt(this.root.domContext.getDocument(),"wheel",r,{passive:!1})}),dp(()=>{this.scrollbarVis.sizes,nn(()=>this.handleThumbPositionChange())}),new nr(()=>this.scrollbar.opts.ref.current,this.handleResize),new nr(()=>this.root.contentNode,this.handleResize),this.onpointerdown=this.onpointerdown.bind(this),this.onpointermove=this.onpointermove.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onlostpointercapture=this.onlostpointercapture.bind(this)}handleDragScroll(e){if(!this.rect)return;const t=e.clientX-this.rect.left,i=e.clientY-this.rect.top;this.scrollbarState.onDragScroll({x:t,y:i})}#i(){this.rect!==null&&(this.root.domContext.getDocument().body.style.webkitUserSelect=this.prevWebkitUserSelect,this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior=""),this.rect=null)}onpointerdown(e){if(e.button!==0)return;e.target.setPointerCapture(e.pointerId),this.rect=this.scrollbar.opts.ref.current?.getBoundingClientRect()??null,this.prevWebkitUserSelect=this.root.domContext.getDocument().body.style.webkitUserSelect,this.root.domContext.getDocument().body.style.webkitUserSelect="none",this.root.viewportNode&&(this.root.viewportNode.style.scrollBehavior="auto"),this.handleDragScroll(e)}onpointermove(e){this.handleDragScroll(e)}onpointerup(e){const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),this.#i()}onlostpointercapture(e){this.#i()}#r=z(()=>fn({...this.scrollbarState.props,style:{position:"absolute",...this.scrollbarState.props.style},[ps.scrollbar]:"",onpointerdown:this.onpointerdown,onpointermove:this.onpointermove,onpointerup:this.onpointerup,onlostpointercapture:this.onlostpointercapture}));get props(){return d(this.#r)}set props(e){O(this.#r,e)}}class ic{static create(e){return new ic(e,fh.get())}opts;scrollbarState;attachment;#e;#t=we();#n=wa(()=>{d(this.#t)&&(d(this.#t)(),O(this.#t,void 0))},100);constructor(e,t){this.opts=e,this.scrollbarState=t,this.#e=t.root,this.attachment=Hn(this.opts.ref,i=>this.scrollbarState.scrollbarVis.thumbNode=i),Rt(()=>{const i=this.#e.viewportNode;if(!i)return;const r=()=>{if(this.#n(),!d(this.#t)){const a=gm(i,this.scrollbarState.handleThumbPositionChange);O(this.#t,a,!0),this.scrollbarState.handleThumbPositionChange()}};return nn(()=>this.scrollbarState.handleThumbPositionChange()),Kt(i,"scroll",r)}),this.onpointerdowncapture=this.onpointerdowncapture.bind(this),this.onpointerup=this.onpointerup.bind(this)}onpointerdowncapture(e){const t=e.target;if(!t)return;const i=t.getBoundingClientRect(),r=e.clientX-i.left,s=e.clientY-i.top;this.scrollbarState.handleThumbPointerDown({x:r,y:s})}onpointerup(e){this.scrollbarState.handleThumbPointerUp()}#i=z(()=>({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,[ps.thumb]:"",...this.attachment}));get props(){return d(this.#i)}set props(e){O(this.#i,e)}}class rc{static create(e){return new rc(e,ms.get())}opts;root;attachment;#e=we(0);#t=we(0);#n=z(()=>!!(d(this.#e)&&d(this.#t)));get hasSize(){return d(this.#n)}set hasSize(e){O(this.#n,e)}constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(this.opts.ref),new nr(()=>this.root.scrollbarXNode,()=>{const i=this.root.scrollbarXNode?.offsetHeight||0;this.root.cornerHeight=i,O(this.#t,i,!0)}),new nr(()=>this.root.scrollbarYNode,()=>{const i=this.root.scrollbarYNode?.offsetWidth||0;this.root.cornerWidth=i,O(this.#e,i,!0)})}#i=z(()=>({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},[ps.corner]:"",...this.attachment}));get props(){return d(this.#i)}set props(e){O(this.#i,e)}}function ga(n){return n?Number.parseInt(n,10):0}function ph(n,e){const t=n/e;return Number.isNaN(t)?0:t}function Ca(n){const e=ph(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,i=(n.scrollbar.size-t)*e;return Math.max(i,18)}function mm({pointerPos:n,pointerOffset:e,sizes:t,dir:i="ltr"}){const r=Ca(t),s=r/2,a=e||s,o=r-a,l=t.scrollbar.paddingStart+a,c=t.scrollbar.size-t.scrollbar.paddingEnd-o,u=t.content-t.viewport,h=i==="ltr"?[0,u]:[u*-1,0];return mh([l,c],h)(n)}function gu({scrollPos:n,sizes:e,dir:t="ltr"}){const i=Ca(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=e.scrollbar.size-r,a=e.content-e.viewport,o=s-i,l=t==="ltr"?[0,a]:[a*-1,0],c=fm(n,l[0],l[1]);return mh([0,a],[0,o])(c)}function mh(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(n[1]-n[0]);return e[0]+i*(t-n[0])}}function gh(n,e){return n>0&&n<e}function gm(n,e){let t={left:n.scrollLeft,top:n.scrollTop},i=0;const r=Ep(n);return(function s(){const a={left:n.scrollLeft,top:n.scrollTop},o=t.left!==a.left,l=t.top!==a.top;(o||l)&&e(),t=a,i=r.requestAnimationFrame(s)})(),()=>r.cancelAnimationFrame(i)}var vm=Z("<div><!></div>");function _m(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=me(e,"type",3,"hover"),a=me(e,"dir",3,"ltr"),o=me(e,"scrollHideDelay",3,600),l=lt(e,["$$slots","$$events","$$legacy","ref","id","type","dir","scrollHideDelay","children","child"]);const c=ql.create({type:ut(()=>s()),dir:ut(()=>a()),scrollHideDelay:ut(()=>o()),id:ut(()=>r()),ref:ut(()=>i(),S=>i(S))}),u=z(()=>fn(l,c.props));var h=Pe(),f=ae(h);{var p=S=>{var g=Pe(),m=ae(g);Ct(m,()=>e.child,()=>({props:d(u)})),D(S,g)},v=S=>{var g=vm();sn(g,()=>({...d(u)}));var m=Q(g);Ct(m,()=>e.children??Ut),q(g),D(S,g)};_e(f,S=>{e.child?S(p):S(v,-1)})}D(n,h),it()}var xm=Z("<div><div><!></div></div>");function bm(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","ref","id","children"]);const a=Kl.create({id:ut(()=>r()),ref:ut(()=>i(),f=>i(f))}),o=z(()=>fn(s,a.props)),l=z(()=>fn({},a.contentProps));var c=xm();sn(c,()=>({...d(o)}));var u=Q(c);sn(u,()=>({...d(l)}));var h=Q(u);Ct(h,()=>e.children??Ut),q(u),q(c),D(n,c),it()}var Sm=Z("<div><!></div>");function vh(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy","child","children"]);const i=nc.create(),r=z(()=>fn(t,i.props));var s=Pe(),a=ae(s);{var o=c=>{var u=Pe(),h=ae(u);Ct(h,()=>e.child,()=>({props:d(r)})),D(c,u)},l=c=>{var u=Sm();sn(u,()=>({...d(r)}));var h=Q(u);Ct(h,()=>e.children??Ut),q(u),D(c,u)};_e(a,c=>{e.child?c(o):c(l,-1)})}D(n,s),it()}function ym(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy"]);const i=new Wl,r=ec.create({mounted:ut(()=>i.current)}),s=z(()=>fn(t,r.props));vh(n,_t(()=>d(s))),it()}function Mm(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy"]);const i=new Wl,r=tc.create({mounted:ut(()=>i.current)}),s=z(()=>fn(t,r.props));vh(n,_t(()=>d(s))),it()}function Pa(n,e){nt(e,!0);let t=lt(e,["$$slots","$$events","$$legacy"]);const i=Ql.create();var r=Pe(),s=ae(r);{var a=l=>{ym(l,_t(()=>t))},o=l=>{Mm(l,_t(()=>t))};_e(s,l=>{i.scrollbar.opts.orientation.current==="horizontal"?l(a):l(o,-1)})}D(n,r),it()}function Em(n,e){nt(e,!0);let t=me(e,"forceMount",3,!1),i=lt(e,["$$slots","$$events","$$legacy","forceMount"]);const r=Ra.create(),s=z(()=>fn(i,r.props));{const a=l=>{Pa(l,_t(()=>d(s)))};let o=z(()=>t()||r.isVisible);Ta(n,{get open(){return d(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}})}it()}function wm(n,e){nt(e,!0);let t=me(e,"forceMount",3,!1),i=lt(e,["$$slots","$$events","$$legacy","forceMount"]);const r=Jl.create(),s=z(()=>fn(i,r.props));{const a=l=>{Pa(l,_t(()=>d(s)))};let o=z(()=>t()||!r.isHidden);Ta(n,_t(()=>d(s),{get open(){return d(o)},get ref(){return r.scrollbar.opts.ref},presence:a,$$slots:{presence:!0}}))}it()}function Tm(n,e){nt(e,!0);let t=me(e,"forceMount",3,!1),i=lt(e,["$$slots","$$events","$$legacy","forceMount"]);const r=$l.create(),s=Ra.create(),a=z(()=>fn(i,r.props,s.props,{"data-state":r.isVisible?"visible":"hidden"})),o=z(()=>t()||r.isVisible&&s.isVisible);Ta(n,{get open(){return d(o)},get ref(){return s.scrollbar.opts.ref},presence:c=>{Pa(c,_t(()=>d(a)))},$$slots:{presence:!0}}),it()}function Am(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","ref","id","orientation"]);const a=Zl.create({orientation:ut(()=>e.orientation),id:ut(()=>r()),ref:ut(()=>i(),v=>i(v))}),o=z(()=>a.root.opts.type.current);var l=Pe(),c=ae(l);{var u=v=>{Tm(v,_t(()=>s,{get id(){return r()}}))},h=v=>{wm(v,_t(()=>s,{get id(){return r()}}))},f=v=>{Em(v,_t(()=>s,{get id(){return r()}}))},p=v=>{Pa(v,_t(()=>s,{get id(){return r()}}))};_e(c,v=>{d(o)==="hover"?v(u):d(o)==="scroll"?v(h,1):d(o)==="auto"?v(f,2):d(o)==="always"&&v(p,3)})}D(n,l),it()}var Rm=Z("<div><!></div>");function Cm(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","id","child","children","present"]);const r=new Wl,s=ic.create({id:ut(()=>e.id),ref:ut(()=>t(),h=>t(h)),mounted:ut(()=>r.current)}),a=z(()=>fn(i,s.props,{style:{hidden:!e.present}}));var o=Pe(),l=ae(o);{var c=h=>{var f=Pe(),p=ae(f);Ct(p,()=>e.child,()=>({props:d(a)})),D(h,f)},u=h=>{var f=Rm();sn(f,()=>({...d(a)}));var p=Q(f);Ct(p,()=>e.children??Ut),q(f),D(h,f)};_e(l,h=>{e.child?h(c):h(u,-1)})}D(n,o),it()}function Pm(n,e){const t=Un();nt(e,!0);let i=me(e,"id",19,()=>xi(t)),r=me(e,"ref",15,null),s=me(e,"forceMount",3,!1),a=lt(e,["$$slots","$$events","$$legacy","id","ref","forceMount"]);const o=Aa.get();{const l=(u,h)=>{let f=()=>h?.().present;Cm(u,_t(()=>a,{get id(){return i()},get present(){return f()},get ref(){return r()},set ref(p){r(p)}}))};let c=z(()=>s()||o.hasThumb);Ta(n,{get open(){return d(c)},get ref(){return o.scrollbar.opts.ref},presence:l,$$slots:{presence:!0}})}it()}var Dm=Z("<div><!></div>");function Im(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","id","children","child"]);const r=rc.create({id:ut(()=>e.id),ref:ut(()=>t(),u=>t(u))}),s=z(()=>fn(i,r.props));var a=Pe(),o=ae(a);{var l=u=>{var h=Pe(),f=ae(h);Ct(f,()=>e.child,()=>({props:d(s)})),D(u,h)},c=u=>{var h=Dm();sn(h,()=>({...d(s)}));var f=Q(h);Ct(f,()=>e.children??Ut),q(h),D(u,h)};_e(o,u=>{e.child?u(l):u(c,-1)})}D(n,a),it()}function Lm(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","ref","id"]);const a=ms.get(),o=z(()=>!!(a.scrollbarXNode&&a.scrollbarYNode)),l=z(()=>a.opts.type.current!=="scroll"&&d(o));var c=Pe(),u=ae(c);{var h=f=>{Im(f,_t(()=>s,{get id(){return r()},get ref(){return i()},set ref(p){i(p)}}))};_e(u,f=>{d(l)&&f(h)})}D(n,c),it()}function vu(n,e,t){const i={position:"absolute"};return n==="lr"?(i.left=`${e}%`,i.right=`${t}%`):n==="rl"?(i.right=`${e}%`,i.left=`${t}%`):n==="bt"?(i.bottom=`${e}%`,i.top=`${t}%`):(i.top=`${e}%`,i.bottom=`${t}%`),i}function _h(n,e){const t={position:"absolute"};return n==="lr"?(t.left=`${e}%`,t.translate="-50% 0"):n==="rl"?(t.right=`${e}%`,t.translate="50% 0"):n==="bt"?(t.bottom=`${e}%`,t.translate="0 50%"):(t.top=`${e}%`,t.translate="0 -50%"),t}function xh(n,e,t){const i={position:"absolute"};return n==="lr"?(i.left=`${e}%`,i.translate=`${t}% 0`):n==="rl"?(i.right=`${e}%`,i.translate=`${-t}% 0`):n==="bt"?(i.bottom=`${e}%`,i.translate=`0 ${-t}%`):(i.top=`${e}%`,i.translate=`0 ${t}%`),i}function Nm(n){if(Math.floor(n)===n)return 0;const e=n.toString();if(e.indexOf(".")!==-1&&e.indexOf("e-")===-1)return e.split(".")[1].length;if(e.indexOf("e-")!==-1){const t=e.split("e-");return parseInt(t[1],10)}return 0}function Um(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function sc(n,e,t){if(typeof n=="number"){const i=t-e;let r=Math.ceil(i/n);const s=Nm(n),a=Math.pow(10,s),o=Math.round(i*a),l=Math.round(n*a);o%l===0&&r++;const c=[];for(let u=0;u<r;u++){const h=e+u*n,f=Um(h,s);c.push(f)}return c}return[...new Set(n)].filter(i=>i>=e&&i<=t).sort((i,r)=>i-r)}function Qi(n,e){if(e.length===0)return n;let t=e[0],i=Math.abs(n-t);for(const r of e){const s=Math.abs(n-r);s<i&&(i=s,t=r)}return t}function Ms(n,e,t){const i=e.indexOf(n);return i===-1?Qi(n,e):t==="next"?i<e.length-1?e[i+1]:n:i>0?e[i-1]:n}function Fm(n,e,t=!0){const[i,r]=n,[s,a]=e,o=(a-s)/(r-i);return l=>{const c=s+o*(l-i);return t?c>Math.max(s,a)?Math.max(s,a):c<Math.min(s,a)?Math.min(s,a):c:c}}const Ni=Vl({component:"slider",parts:["root","thumb","range","tick","tick-label","thumb-label"]}),ac=new zi("Slider.Root");class bh{opts;attachment;#e=we(!1);get isActive(){return d(this.#e)}set isActive(e){O(this.#e,e,!0)}#t=we(0);#n=z(()=>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){O(this.#n,e)}#i=z(()=>sc(this.opts.step.current,this.opts.min.current,this.opts.max.current));get normalizedSteps(){return d(this.#i)}set normalizedSteps(e){O(this.#i,e)}domContext;constructor(e){this.opts=e,this.attachment=Hn(e.ref),this.domContext=new Zd(this.opts.ref),new nr(()=>this.opts.ref.current,this.#r)}#r=()=>{O(this.#t,d(this.#t)+1)};isThumbActive(e){return this.isActive}#s=z(()=>{if(!this.opts.disabled.current)return this.opts.orientation.current==="horizontal"?"pan-y":"pan-x"});getAllThumbs=()=>{const e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(Ni.selector("thumb"))):[]};getThumbScale=()=>{d(this.#t);const e=this.opts.trackPadding?.current;if(e!==void 0&&e>0)return[e,100-e];if(this.opts.thumbPositioning.current==="exact")return[0,100];const t=this.opts.orientation.current==="vertical",i=this.getAllThumbs()[0],r=t?i?.offsetHeight:i?.offsetWidth;if(r===void 0||Number.isNaN(r)||r===0)return[0,100];const s=t?this.opts.ref.current?.offsetHeight:this.opts.ref.current?.offsetWidth;if(s===void 0||Number.isNaN(s)||s===0)return[0,100];const a=r/2/s*100,o=a,l=100-a;return[o,l]};getPositionFromValue=e=>{const t=this.getThumbScale();return Fm([this.opts.min.current,this.opts.max.current],t)(e)};#a=z(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,"data-disabled":tr(this.opts.disabled.current),style:{touchAction:d(this.#s)},[Ni.root]:"",...this.attachment}));get props(){return d(this.#a)}set props(e){O(this.#a,e)}}class Om extends bh{opts;isMulti=!1;constructor(e){super(e),this.opts=e,ch(()=>Hl(Kt(this.domContext.getDocument(),"pointerdown",this.handlePointerDown),Kt(this.domContext.getDocument(),"pointerup",this.handlePointerUp),Kt(this.domContext.getDocument(),"pointermove",this.handlePointerMove),Kt(this.domContext.getDocument(),"pointerleave",this.handlePointerUp))),Fi([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=sc(t,i,r),o=c=>a.includes(c),l=c=>Qi(c,a);o(s)||(this.opts.value.current=l(s))})}isTickValueSelected=e=>this.opts.value.current===e;applyPosition({clientXY:e,start:t,end:i}){const r=this.opts.min.current,s=this.opts.max.current,o=(e-t)/(i-t)*(s-r)+r;if(o<r)this.updateValue(r);else if(o>s)this.updateValue(s);else{const l=this.normalizedSteps,c=Qi(o,l);this.updateValue(c)}}updateValue=e=>{this.opts.value.current=Qi(e,this.normalizedSteps)};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();const t=this.opts.ref.current,i=this.getAllThumbs()[0];if(!t||!i)return;i.focus();const{left:r,right:s,top:a,bottom:o}=t.getBoundingClientRect();this.direction==="lr"?this.applyPosition({clientXY:e.clientX,start:r,end:s}):this.direction==="rl"?this.applyPosition({clientXY:e.clientX,start:s,end:r}):this.direction==="bt"?this.applyPosition({clientXY:e.clientY,start:o,end:a}):this.direction==="tb"&&this.applyPosition({clientXY:e.clientY,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;const t=this.opts.ref.current,i=this.getAllThumbs()[0];if(!i||!t)return;const r=e.composedPath()[0]??e.target;!lh(r)||!t.contains(r)||(e.preventDefault(),i.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(nn(()=>this.opts.value.current)),this.isActive=!1)};#e=z(()=>{const e=this.opts.value.current;return Array.from({length:1},()=>{const t=e,i=this.getPositionFromValue(t),r=_h(this.direction,i);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":t,"aria-disabled":ma(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":t,"data-orientation":this.opts.orientation.current,style:r,[Ni.thumb]:""}})});get thumbsPropsArr(){return d(this.#e)}set thumbsPropsArr(e){O(this.#e,e)}#t=z(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return d(this.#t)}set thumbsRenderArr(e){O(this.#t,e)}#n=z(()=>{const e=this.normalizedSteps,t=this.opts.value.current;return e.map((i,r)=>{const s=this.getPositionFromValue(i),a=r===0,o=r===e.length-1,l=a?0:o?-100:-50,c=xh(this.direction,s,l),u=i<=t;return{"data-disabled":tr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":u?"":void 0,"data-value":i,"data-selected":this.isTickValueSelected(i)?"":void 0,style:c,[Ni.tick]:""}})});get ticksPropsArr(){return d(this.#n)}set ticksPropsArr(e){O(this.#n,e)}#i=z(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return d(this.#i)}set ticksRenderArr(e){O(this.#i,e)}#r=z(()=>this.ticksPropsArr.map((e,t)=>({value:e["data-value"],index:t})));get tickItemsArr(){return d(this.#r)}set tickItemsArr(e){O(this.#r,e)}#s=z(()=>[{value:this.opts.value.current,index:0}]);get thumbItemsArr(){return d(this.#s)}set thumbItemsArr(e){O(this.#s,e)}#a=z(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return d(this.#a)}set snippetProps(e){O(this.#a,e)}}class Bm extends bh{opts;isMulti=!0;#e=we(null);get activeThumb(){return d(this.#e)}set activeThumb(e){O(this.#e,e,!0)}#t=we(0);get currentThumbIdx(){return d(this.#t)}set currentThumbIdx(e){O(this.#t,e,!0)}constructor(e){super(e),this.opts=e,ch(()=>Hl(Kt(this.domContext.getDocument(),"pointerdown",this.handlePointerDown),Kt(this.domContext.getDocument(),"pointerup",this.handlePointerUp),Kt(this.domContext.getDocument(),"pointermove",this.handlePointerMove),Kt(this.domContext.getDocument(),"pointerleave",this.handlePointerUp))),Fi([()=>this.opts.step.current,()=>this.opts.min.current,()=>this.opts.max.current,()=>this.opts.value.current],([t,i,r,s])=>{const a=sc(t,i,r),o=c=>a.includes(c),l=c=>Qi(c,a);s.some(c=>!o(c))&&(this.opts.value.current=s.map(l))})}isTickValueSelected=e=>this.opts.value.current.includes(e);isThumbActive(e){return this.isActive&&this.activeThumb?.idx===e}applyPosition({clientXY:e,activeThumbIdx:t,start:i,end:r}){const s=this.opts.min.current,a=this.opts.max.current,l=(e-i)/(r-i)*(a-s)+s;if(l<s)this.updateValue(s,t);else if(l>a)this.updateValue(a,t);else{const c=this.normalizedSteps,u=Qi(l,c);this.updateValue(u,t)}}#n=e=>{const t=this.getAllThumbs();if(!t.length)return;for(const a of t)a.blur();const i=t.map(a=>{if(this.opts.orientation.current==="horizontal"){const{left:o,right:l}=a.getBoundingClientRect();return Math.abs(e.clientX-(o+l)/2)}else{const{top:o,bottom:l}=a.getBoundingClientRect();return Math.abs(e.clientY-(o+l)/2)}}),r=t[i.indexOf(Math.min(...i))],s=t.indexOf(r);return{node:r,idx:s}};handlePointerMove=e=>{if(!this.isActive||this.opts.disabled.current)return;e.preventDefault(),e.stopPropagation();const t=this.opts.ref.current,i=this.activeThumb;if(!t||!i)return;i.node.focus();const{left:r,right:s,top:a,bottom:o}=t.getBoundingClientRect(),l=this.direction;l==="lr"?this.applyPosition({clientXY:e.clientX,activeThumbIdx:i.idx,start:r,end:s}):l==="rl"?this.applyPosition({clientXY:e.clientX,activeThumbIdx:i.idx,start:s,end:r}):l==="bt"?this.applyPosition({clientXY:e.clientY,activeThumbIdx:i.idx,start:o,end:a}):l==="tb"&&this.applyPosition({clientXY:e.clientY,activeThumbIdx:i.idx,start:a,end:o})};handlePointerDown=e=>{if(e.button!==0||this.opts.disabled.current)return;const t=this.opts.ref.current,i=this.#n(e);if(!i||!t)return;const r=e.composedPath()[0]??e.target;!lh(r)||!t.contains(r)||(e.preventDefault(),this.activeThumb=i,i.node.focus(),this.isActive=!0,this.handlePointerMove(e))};handlePointerUp=()=>{this.opts.disabled.current||(this.isActive&&this.opts.onValueCommit.current(nn(()=>this.opts.value.current)),this.isActive=!1)};getAllThumbs=()=>{const e=this.opts.ref.current;return e?Array.from(e.querySelectorAll(Ni.selector("thumb"))):[]};updateValue=(e,t)=>{const i=this.opts.value.current;if(!i.length){this.opts.value.current.push(e);return}if(i[t]===e)return;const s=[...i];if(!Op(t,s))return;const a=s[t]>e?-1:1,o=()=>{const c=t+a;s[t]=s[c],s[c]=e;const u=this.getAllThumbs();u.length&&(u[c]?.focus(),this.activeThumb={node:u[c],idx:c})};if(this.opts.autoSort.current&&(a===-1&&e<s[t-1]||a===1&&e>s[t+1])){o(),this.opts.value.current=s;return}const l=this.normalizedSteps;s[t]=Qi(e,l),this.opts.value.current=s};#i=z(()=>{const e=this.opts.value.current;return Array.from({length:e.length||1},(t,i)=>{const r=nn(()=>this.currentThumbIdx);r<e.length&&nn(()=>{this.currentThumbIdx=r+1});const s=e[i],a=this.getPositionFromValue(s??0),o=_h(this.direction,a);return{role:"slider","aria-valuemin":this.opts.min.current,"aria-valuemax":this.opts.max.current,"aria-valuenow":s,"aria-disabled":ma(this.opts.disabled.current),"aria-orientation":this.opts.orientation.current,"data-value":s,"data-orientation":this.opts.orientation.current,style:o,[Ni.thumb]:""}})});get thumbsPropsArr(){return d(this.#i)}set thumbsPropsArr(e){O(this.#i,e)}#r=z(()=>this.thumbsPropsArr.map((e,t)=>t));get thumbsRenderArr(){return d(this.#r)}set thumbsRenderArr(e){O(this.#r,e)}#s=z(()=>{const e=this.normalizedSteps,t=this.opts.value.current;return e.map((i,r)=>{const s=this.getPositionFromValue(i),a=r===0,o=r===e.length-1,l=a?0:o?-100:-50,c=xh(this.direction,s,l),u=t.length===1?i<=t[0]:t[0]<=i&&i<=t[t.length-1];return{"data-disabled":tr(this.opts.disabled.current),"data-orientation":this.opts.orientation.current,"data-bounded":u?"":void 0,"data-value":i,style:c,[Ni.tick]:""}})});get ticksPropsArr(){return d(this.#s)}set ticksPropsArr(e){O(this.#s,e)}#a=z(()=>this.ticksPropsArr.map((e,t)=>t));get ticksRenderArr(){return d(this.#a)}set ticksRenderArr(e){O(this.#a,e)}#o=z(()=>this.ticksPropsArr.map((e,t)=>({value:e["data-value"],index:t})));get tickItemsArr(){return d(this.#o)}set tickItemsArr(e){O(this.#o,e)}#l=z(()=>this.opts.value.current.map((t,i)=>({value:t,index:i})));get thumbItemsArr(){return d(this.#l)}set thumbItemsArr(e){O(this.#l,e)}#c=z(()=>({ticks:this.ticksRenderArr,thumbs:this.thumbsRenderArr,tickItems:this.tickItemsArr,thumbItems:this.thumbItemsArr}));get snippetProps(){return d(this.#c)}set snippetProps(e){O(this.#c,e)}}class zm{static create(e){const{type:t,...i}=e,r=t==="single"?new Om(i):new Bm(i);return ac.set(r)}}const km=[nh,ih,rh,sh,ah,oh];class oc{static create(e){return new oc(e,ac.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(e.ref)}#e=z(()=>{if(Array.isArray(this.root.opts.value.current)){const e=this.root.opts.value.current.length>1?this.root.getPositionFromValue(Math.min(...this.root.opts.value.current)??0):0,t=100-this.root.getPositionFromValue(Math.max(...this.root.opts.value.current)??0);return{position:"absolute",...vu(this.root.direction,e,t)}}else{const e=this.root.opts.trackPadding?.current,t=this.root.opts.value.current,i=this.root.opts.max.current,r=0,s=e!==void 0&&e>0&&t===i?0:100-this.root.getPositionFromValue(t);return{position:"absolute",...vu(this.root.direction,r,s)}}});get rangeStyles(){return d(this.#e)}set rangeStyles(e){O(this.#e,e)}#t=z(()=>({id:this.opts.id.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":tr(this.root.opts.disabled.current),style:this.rangeStyles,[Ni.range]:"",...this.attachment}));get props(){return d(this.#t)}set props(e){O(this.#t,e)}}class lc{static create(e){return new lc(e,ac.get())}opts;root;attachment;#e=z(()=>this.root.opts.disabled.current||this.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=Hn(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;const t=this.opts.ref.current;if(!t)return;const i=this.root.getAllThumbs();if(!i.length)return;const r=i.indexOf(t);if(this.root.isMulti&&(this.root.currentThumbIdx=r),!km.includes(e.key))return;e.preventDefault();const s=this.root.opts.min.current,a=this.root.opts.max.current,o=this.root.opts.value.current,l=Array.isArray(o)?o[r]:o,c=this.root.opts.orientation.current,u=this.root.direction,h=this.root.normalizedSteps;switch(e.key){case ah:this.#t(s);break;case oh:this.#t(a);break;case nh:if(c!=="horizontal")break;if(e.metaKey){const f=u==="rl"?a:s;this.#t(f)}else{const p=Ms(l,h,u==="rl"?"next":"prev");this.#t(p)}break;case ih:if(c!=="horizontal")break;if(e.metaKey){const f=u==="rl"?s:a;this.#t(f)}else{const p=Ms(l,h,u==="rl"?"prev":"next");this.#t(p)}break;case rh:if(e.metaKey){const f=u==="tb"?s:a;this.#t(f)}else{const p=Ms(l,h,u==="tb"?"prev":"next");this.#t(p)}break;case sh:if(e.metaKey){const f=u==="tb"?a:s;this.#t(f)}else{const p=Ms(l,h,u==="tb"?"next":"prev");this.#t(p)}break}this.root.opts.onValueCommit.current(this.root.opts.value.current)}#n=z(()=>({...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":tr(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){O(this.#n,e)}}var Vm=Z("<span><!></span>");function Hm(n,e){const t=Un();nt(e,!0);let i=me(e,"id",19,()=>xi(t)),r=me(e,"ref",15,null),s=me(e,"value",15),a=me(e,"onValueChange",3,mu),o=me(e,"onValueCommit",3,mu),l=me(e,"disabled",3,!1),c=me(e,"step",3,1),u=me(e,"dir",3,"ltr"),h=me(e,"autoSort",3,!0),f=me(e,"orientation",3,"horizontal"),p=me(e,"thumbPositioning",3,"contain"),v=lt(e,["$$slots","$$events","$$legacy","children","child","id","ref","value","type","onValueChange","onValueCommit","disabled","min","max","step","dir","autoSort","orientation","thumbPositioning","trackPadding"]);const S=z(()=>e.min!==void 0?e.min:Array.isArray(c())?Math.min(...c()):0),g=z(()=>e.max!==void 0?e.max:Array.isArray(c())?Math.max(...c()):100);function m(){if(s()===void 0)return e.type==="single"?d(S):[]}m(),Fi.pre(()=>s(),()=>{m()});const x=zm.create({id:ut(()=>i()),ref:ut(()=>r(),_=>r(_)),value:ut(()=>s(),_=>{s(_),a()(_)}),onValueCommit:ut(()=>o()),disabled:ut(()=>l()),min:ut(()=>d(S)),max:ut(()=>d(g)),step:ut(()=>c()),dir:ut(()=>u()),autoSort:ut(()=>h()),orientation:ut(()=>f()),thumbPositioning:ut(()=>p()),type:e.type,trackPadding:ut(()=>e.trackPadding)}),M=z(()=>fn(v,x.props));var T=Pe(),C=ae(T);{var y=_=>{var E=Pe(),L=ae(E);{let P=z(()=>({props:d(M),...x.snippetProps}));Ct(L,()=>e.child,()=>d(P))}D(_,E)},I=_=>{var E=Vm();sn(E,()=>({...d(M)}));var L=Q(E);Ct(L,()=>e.children??Ut,()=>x.snippetProps),q(E),D(_,E)};_e(C,_=>{e.child?_(y):_(I,-1)})}D(n,T),it()}var Gm=Z("<span><!></span>");function Wm(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=lt(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const a=oc.create({id:ut(()=>r()),ref:ut(()=>i(),f=>i(f))}),o=z(()=>fn(s,a.props));var l=Pe(),c=ae(l);{var u=f=>{var p=Pe(),v=ae(p);Ct(v,()=>e.child,()=>({props:d(o)})),D(f,p)},h=f=>{var p=Gm();sn(p,()=>({...d(o)}));var v=Q(p);Ct(v,()=>e.children??Ut),q(p),D(f,p)};_e(c,f=>{e.child?f(u):f(h,-1)})}D(n,l),it()}var Xm=Z("<span><!></span>");function Ym(n,e){const t=Un();nt(e,!0);let i=me(e,"ref",15,null),r=me(e,"id",19,()=>xi(t)),s=me(e,"disabled",3,!1),a=lt(e,["$$slots","$$events","$$legacy","children","child","ref","id","index","disabled"]);const o=lc.create({id:ut(()=>r()),ref:ut(()=>i(),p=>i(p)),index:ut(()=>e.index),disabled:ut(()=>s())}),l=z(()=>fn(a,o.props));var c=Pe(),u=ae(c);{var h=p=>{var v=Pe(),S=ae(v);{let g=z(()=>({active:o.root.isThumbActive(o.opts.index.current),props:d(l)}));Ct(S,()=>e.child,()=>d(g))}D(p,v)},f=p=>{var v=Xm();sn(v,()=>({...d(l)}));var S=Q(v);{let g=z(()=>({active:o.root.isThumbActive(o.opts.index.current)}));Ct(S,()=>e.children??Ut,()=>d(g))}q(v),D(p,v)};_e(u,p=>{e.child?p(h):p(f,-1)})}D(n,c),it()}function jm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"}],["circle",{cx:"12",cy:"13",r:"3"}]];an(n,_t({name:"camera"},()=>t,{get iconNode(){return i}}))}function qm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}],["path",{d:"m9 11 3 3L22 4"}]];an(n,_t({name:"circle-check-big"},()=>t,{get iconNode(){return i}}))}function Km(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];an(n,_t({name:"circle-check"},()=>t,{get iconNode(){return i}}))}function Zm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]];an(n,_t({name:"circle-question-mark"},()=>t,{get iconNode(){return i}}))}function Sh(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];an(n,_t({name:"download"},()=>t,{get iconNode(){return i}}))}function Va(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}],["path",{d:"m2 2 20 20"}]];an(n,_t({name:"eye-off"},()=>t,{get iconNode(){return i}}))}function Ha(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];an(n,_t({name:"eye"},()=>t,{get iconNode(){return i}}))}function $m(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}]];an(n,_t({name:"file"},()=>t,{get iconNode(){return i}}))}function Jm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}]];an(n,_t({name:"folder"},()=>t,{get iconNode(){return i}}))}function Qm(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}]];an(n,_t({name:"inbox"},()=>t,{get iconNode(){return i}}))}function eg(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];an(n,_t({name:"info"},()=>t,{get iconNode(){return i}}))}function tg(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"}]];an(n,_t({name:"layers"},()=>t,{get iconNode(){return i}}))}function ng(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];an(n,_t({name:"link"},()=>t,{get iconNode(){return i}}))}function cc(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12 2v4"}],["path",{d:"m16.2 7.8 2.9-2.9"}],["path",{d:"M18 12h4"}],["path",{d:"m16.2 16.2 2.9 2.9"}],["path",{d:"M12 18v4"}],["path",{d:"m4.9 19.1 2.9-2.9"}],["path",{d:"M2 12h4"}],["path",{d:"m4.9 4.9 2.9 2.9"}]];an(n,_t({name:"loader"},()=>t,{get iconNode(){return i}}))}function uc(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"}]];an(n,_t({name:"maximize"},()=>t,{get iconNode(){return i}}))}function dc(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"}]];an(n,_t({name:"minimize"},()=>t,{get iconNode(){return i}}))}function ig(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M5 12h14"}]];an(n,_t({name:"minus"},()=>t,{get iconNode(){return i}}))}function rg(n,e){let t=lt(e,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];an(n,_t({name:"zap"},()=>t,{get iconNode(){return i}}))}const Nr={FILE_UPLOAD:{MAX_SIZE_MB:150,MAX_SIZE_BYTES:150*1024*1024},TIMEOUTS:{SOLVE_STATE_DURATION:3500,PARAM_EXPORT_DELAY:100,DRAWER_ANIMATION_MS:350},SOLVING_INDICATOR:{FAST_THRESHOLD_MS:200,SLOW_THRESHOLD_MS:600,ANIMATION_DELAY:300,HISTORY_SIZE:3},FILE_SIZE:{BYTES_PER_KB:1024}};var yh=Object.defineProperty,sg=(n,e,t)=>e in n?yh(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ag=(n,e)=>{for(var t in e)yh(n,t,{get:e[t],enumerable:!0})},Es=(n,e,t)=>sg(n,typeof e!="symbol"?e+"":e,t),gi={VALIDATION_ERROR:"VALIDATION_ERROR",INVALID_STATE:"INVALID_STATE",INVALID_INPUT:"INVALID_INPUT",BROWSER_ONLY:"BROWSER_ONLY"},Ui=class Lo extends Error{constructor(e,t="UNKNOWN_ERROR",i){super(e),Es(this,"code"),Es(this,"statusCode"),Es(this,"context"),Es(this,"originalError"),this.name="RhinoComputeError",this.code=t,this.statusCode=i?.statusCode,this.context=i?.context,this.originalError=i?.originalError,i?.originalError&&(this.cause=i.originalError)}static missingValues(e,t,i){return new Lo(`Input "${e}" has no values defined${t?` (expected ${t})`:""}`,gi.INVALID_INPUT,{context:{inputName:e,expectedType:t,...i}})}static unknownParamType(e,t,i){return new Lo(`Unknown paramType: ${e}`,gi.VALIDATION_ERROR,{context:{receivedParamType:e,paramName:t,...i}})}},og=class{debug(){}info(){}warn(){}error(){}},lg=new og;function zt(){return lg}function Mh(n){if(typeof globalThis.Buffer=="function"){let e=globalThis.Buffer.from(n,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(typeof globalThis.atob=="function"){let e=globalThis.atob(n),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i)&255;return t}throw new Ui("Base64 decoding not supported in this environment.",gi.INVALID_STATE,{context:{environmentInfo:"atob or Buffer not available"}})}const hc="184",Dr={ROTATE:0,DOLLY:1,PAN:2},Mr={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},cg=0,_u=1,ug=2,ta=1,dg=2,Er=3,Sn=0,xn=1,In=2,fi=0,Ir=1,xu=2,bu=3,Su=4,hg=5,ji=100,fg=101,pg=102,mg=103,gg=104,vg=200,_g=201,xg=202,bg=203,No=204,Uo=205,Sg=206,yg=207,Mg=208,Eg=209,wg=210,Tg=211,Ag=212,Rg=213,Cg=214,Fo=0,Oo=1,Bo=2,Ur=3,zo=4,ko=5,Vo=6,Ho=7,Eh=0,Pg=1,Dg=2,Qn=0,wh=1,Th=2,Ah=3,Rh=4,Ch=5,Ph=6,fc=7,Dh=300,ir=301,Fr=302,na=303,Ga=304,Da=306,Go=1e3,kn=1001,Wo=1002,on=1003,Ig=1004,ws=1005,Zt=1006,Wa=1007,Ii=1008,Tn=1009,Ih=1010,Lh=1011,os=1012,pc=1013,ti=1014,An=1015,Rn=1016,mc=1017,gc=1018,ls=1020,Nh=35902,Uh=35899,Fh=1021,Oh=1022,Vn=1023,vi=1026,Ki=1027,Bh=1028,vc=1029,rr=1030,_c=1031,xc=1033,ia=33776,ra=33777,sa=33778,aa=33779,Xo=35840,Yo=35841,jo=35842,qo=35843,Ko=36196,Zo=37492,$o=37496,Jo=37488,Qo=37489,va=37490,el=37491,tl=37808,nl=37809,il=37810,rl=37811,sl=37812,al=37813,ol=37814,ll=37815,cl=37816,ul=37817,dl=37818,hl=37819,fl=37820,pl=37821,ml=36492,gl=36494,vl=36495,_l=36283,xl=36284,_a=36285,bl=36286,Lg=3200,Sl=0,Ng=1,Pi="",wn="srgb",cs="srgb-linear",xa="linear",Pt="srgb",or=7680,yu=519,Ug=512,Fg=513,Og=514,bc=515,Bg=516,zg=517,Sc=518,kg=519,Mu=35044,Eu="300 es",Jn=2e3,us=2001;function Vg(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function ba(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Hg(){const n=ba("canvas");return n.style.display="block",n}const wu={};function Tu(...n){const e="THREE."+n.shift();console.log(e,...n)}function zh(n){const e=n[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=n[1];t&&t.isStackTrace?n[0]+=" "+t.getLocation():n[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return n}function ot(...n){n=zh(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...n)}}function yt(...n){n=zh(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...n)}}function yl(...n){const e=n.join(" ");e in wu||(wu[e]=!0,ot(...n))}function Gg(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const Wg={[Fo]:Oo,[Bo]:Vo,[zo]:Ho,[Ur]:ko,[Oo]:Fo,[Vo]:Bo,[Ho]:zo,[ko]:Ur};class ki{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}}const cn=["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"],oa=Math.PI/180,Ml=180/Math.PI;function vs(){const n=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(cn[n&255]+cn[n>>8&255]+cn[n>>16&255]+cn[n>>24&255]+"-"+cn[e&255]+cn[e>>8&255]+"-"+cn[e>>16&15|64]+cn[e>>24&255]+"-"+cn[t&63|128]+cn[t>>8&255]+"-"+cn[t>>16&255]+cn[t>>24&255]+cn[i&255]+cn[i>>8&255]+cn[i>>16&255]+cn[i>>24&255]).toLowerCase()}function bt(n,e,t){return Math.max(e,Math.min(t,n))}function Xg(n,e){return(n%e+e)%e}function Xa(n,e,t){return(1-t)*n+t*e}function Hr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function gn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Yg={DEG2RAD:oa},Kc=class Kc{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=bt(this.x,e.x,t.x),this.y=bt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=bt(this.x,e,t),this.y=bt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(bt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(bt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*i-a*r+e.x,this.y=s*r+a*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};Kc.prototype.isVector2=!0;let ht=Kc;class Oi{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,s,a,o){let l=i[r+0],c=i[r+1],u=i[r+2],h=i[r+3],f=s[a+0],p=s[a+1],v=s[a+2],S=s[a+3];if(h!==S||l!==f||c!==p||u!==v){let g=l*f+c*p+u*v+h*S;g<0&&(f=-f,p=-p,v=-v,S=-S,g=-g);let m=1-o;if(g<.9995){const x=Math.acos(g),M=Math.sin(x);m=Math.sin(m*x)/M,o=Math.sin(o*x)/M,l=l*m+f*o,c=c*m+p*o,u=u*m+v*o,h=h*m+S*o}else{l=l*m+f*o,c=c*m+p*o,u=u*m+v*o,h=h*m+S*o;const x=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=x,c*=x,u*=x,h*=x}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,a){const o=i[r],l=i[r+1],c=i[r+2],u=i[r+3],h=s[a],f=s[a+1],p=s[a+2],v=s[a+3];return e[t]=o*v+u*h+l*p-c*f,e[t+1]=l*v+u*f+c*h-o*p,e[t+2]=c*v+u*p+o*f-l*h,e[t+3]=u*v-o*h-l*f-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(i/2),u=o(r/2),h=o(s/2),f=l(i/2),p=l(r/2),v=l(s/2);switch(a){case"XYZ":this._x=f*u*h+c*p*v,this._y=c*p*h-f*u*v,this._z=c*u*v+f*p*h,this._w=c*u*h-f*p*v;break;case"YXZ":this._x=f*u*h+c*p*v,this._y=c*p*h-f*u*v,this._z=c*u*v-f*p*h,this._w=c*u*h+f*p*v;break;case"ZXY":this._x=f*u*h-c*p*v,this._y=c*p*h+f*u*v,this._z=c*u*v+f*p*h,this._w=c*u*h-f*p*v;break;case"ZYX":this._x=f*u*h-c*p*v,this._y=c*p*h+f*u*v,this._z=c*u*v-f*p*h,this._w=c*u*h+f*p*v;break;case"YZX":this._x=f*u*h+c*p*v,this._y=c*p*h+f*u*v,this._z=c*u*v-f*p*h,this._w=c*u*h-f*p*v;break;case"XZY":this._x=f*u*h-c*p*v,this._y=c*p*h-f*u*v,this._z=c*u*v+f*p*h,this._w=c*u*h+f*p*v;break;default:ot("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],u=t[6],h=t[10],f=i+o+h;if(f>0){const p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-l)*p,this._y=(s-c)*p,this._z=(a-r)*p}else if(i>o&&i>h){const p=2*Math.sqrt(1+i-o-h);this._w=(u-l)/p,this._x=.25*p,this._y=(r+a)/p,this._z=(s+c)/p}else if(o>h){const p=2*Math.sqrt(1+o-i-h);this._w=(s-c)/p,this._x=(r+a)/p,this._y=.25*p,this._z=(l+u)/p}else{const p=2*Math.sqrt(1+h-i-o);this._w=(a-r)/p,this._x=(s+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(bt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+a*o+r*c-s*l,this._y=r*u+a*l+s*o-i*c,this._z=s*u+a*c+i*l-r*o,this._w=a*u-i*o-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){let i=e._x,r=e._y,s=e._z,a=e._w,o=this.dot(e);o<0&&(i=-i,r=-r,s=-s,a=-a,o=-o);let l=1-t;if(o<.9995){const c=Math.acos(o),u=Math.sin(c);l=Math.sin(l*c)/u,t=Math.sin(t*c)/u,this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this._onChangeCallback()}else this._x=this._x*l+i*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const Zc=class Zc{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Au.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Au.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*r-o*i),u=2*(o*t-s*r),h=2*(s*i-a*t);return this.x=t+l*c+a*h-o*u,this.y=i+l*u+o*c-s*h,this.z=r+l*h+s*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=bt(this.x,e.x,t.x),this.y=bt(this.y,e.y,t.y),this.z=bt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=bt(this.x,e,t),this.y=bt(this.y,e,t),this.z=bt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(bt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Ya.copy(this).projectOnVector(e),this.sub(Ya)}reflect(e){return this.sub(Ya.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(bt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};Zc.prototype.isVector3=!0;let te=Zc;const Ya=new te,Au=new Oi,$c=class $c{constructor(e,t,i,r,s,a,o,l,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,a,o,l,c)}set(e,t,i,r,s,a,o,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,a=i[0],o=i[3],l=i[6],c=i[1],u=i[4],h=i[7],f=i[2],p=i[5],v=i[8],S=r[0],g=r[3],m=r[6],x=r[1],M=r[4],T=r[7],C=r[2],y=r[5],I=r[8];return s[0]=a*S+o*x+l*C,s[3]=a*g+o*M+l*y,s[6]=a*m+o*T+l*I,s[1]=c*S+u*x+h*C,s[4]=c*g+u*M+h*y,s[7]=c*m+u*T+h*I,s[2]=f*S+p*x+v*C,s[5]=f*g+p*M+v*y,s[8]=f*m+p*T+v*I,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8];return t*a*u-t*o*c-i*s*u+i*o*l+r*s*c-r*a*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=u*a-o*c,f=o*l-u*s,p=c*s-a*l,v=t*h+i*f+r*p;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/v;return e[0]=h*S,e[1]=(r*c-u*i)*S,e[2]=(o*i-r*a)*S,e[3]=f*S,e[4]=(u*t-r*l)*S,e[5]=(r*s-o*t)*S,e[6]=p*S,e[7]=(i*l-c*t)*S,e[8]=(a*t-i*s)*S,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*a+c*o)+a+e,-r*c,r*l,-r*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(ja.makeScale(e,t)),this}rotate(e){return this.premultiply(ja.makeRotation(-e)),this}translate(e,t){return this.premultiply(ja.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};$c.prototype.isMatrix3=!0;let pt=$c;const ja=new pt,Ru=new pt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Cu=new pt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function jg(){const n={enabled:!0,workingColorSpace:cs,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===Pt&&(r.r=pi(r.r),r.g=pi(r.g),r.b=pi(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===Pt&&(r.r=Lr(r.r),r.g=Lr(r.g),r.b=Lr(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Pi?xa:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return yl("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return yl("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[cs]:{primaries:e,whitePoint:i,transfer:xa,toXYZ:Ru,fromXYZ:Cu,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:wn},outputColorSpaceConfig:{drawingBufferColorSpace:wn}},[wn]:{primaries:e,whitePoint:i,transfer:Pt,toXYZ:Ru,fromXYZ:Cu,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:wn}}}),n}const Mt=jg();function pi(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Lr(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let lr;class qg{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{lr===void 0&&(lr=ba("canvas")),lr.width=e.width,lr.height=e.height;const r=lr.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=lr}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=ba("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=pi(s[a]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(pi(t[i]/255)*255):t[i]=pi(t[i]);return{data:t,width:e.width,height:e.height}}else return ot("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Kg=0;class yc{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Kg++}),this.uuid=vs(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(qa(r[a].image)):s.push(qa(r[a]))}else s=qa(r);i.url=s}return t||(e.images[this.uuid]=i),i}}function qa(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?qg.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(ot("Texture: Unable to serialize Texture."),{})}let Zg=0;const Ka=new te;class dn extends ki{constructor(e=dn.DEFAULT_IMAGE,t=dn.DEFAULT_MAPPING,i=kn,r=kn,s=Zt,a=Ii,o=Vn,l=Tn,c=dn.DEFAULT_ANISOTROPY,u=Pi){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Zg++}),this.uuid=vs(),this.name="",this.source=new yc(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new ht(0,0),this.repeat=new ht(1,1),this.center=new ht(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new pt,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=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Ka).x}get height(){return this.source.getSize(Ka).y}get depth(){return this.source.getSize(Ka).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){ot(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){ot(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Dh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Go:e.x=e.x-Math.floor(e.x);break;case kn:e.x=e.x<0?0:1;break;case Wo:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Go:e.y=e.y-Math.floor(e.y);break;case kn:e.y=e.y<0?0:1;break;case Wo:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}dn.DEFAULT_IMAGE=null;dn.DEFAULT_MAPPING=Dh;dn.DEFAULT_ANISOTROPY=1;const Jc=class Jc{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*i+a[11]*r+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],u=l[4],h=l[8],f=l[1],p=l[5],v=l[9],S=l[2],g=l[6],m=l[10];if(Math.abs(u-f)<.01&&Math.abs(h-S)<.01&&Math.abs(v-g)<.01){if(Math.abs(u+f)<.1&&Math.abs(h+S)<.1&&Math.abs(v+g)<.1&&Math.abs(c+p+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const M=(c+1)/2,T=(p+1)/2,C=(m+1)/2,y=(u+f)/4,I=(h+S)/4,_=(v+g)/4;return M>T&&M>C?M<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(M),r=y/i,s=I/i):T>C?T<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(T),i=y/r,s=_/r):C<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(C),i=I/s,r=_/s),this.set(i,r,s,t),this}let x=Math.sqrt((g-v)*(g-v)+(h-S)*(h-S)+(f-u)*(f-u));return Math.abs(x)<.001&&(x=1),this.x=(g-v)/x,this.y=(h-S)/x,this.z=(f-u)/x,this.w=Math.acos((c+p+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=bt(this.x,e.x,t.x),this.y=bt(this.y,e.y,t.y),this.z=bt(this.z,e.z,t.z),this.w=bt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=bt(this.x,e,t),this.y=bt(this.y,e,t),this.z=bt(this.z,e,t),this.w=bt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(bt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};Jc.prototype.isVector4=!0;let Wt=Jc;class $g extends ki{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Zt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new Wt(0,0,e,t),this.scissorTest=!1,this.viewport=new Wt(0,0,e,t),this.textures=[];const r={width:e,height:t,depth:i.depth},s=new dn(r),a=i.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const t={minFilter:Zt,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=i,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new yc(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ei extends $g{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class kh extends dn{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=on,this.minFilter=on,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Jg extends dn{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=on,this.minFilter=on,this.wrapR=kn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ma=class Ma{constructor(e,t,i,r,s,a,o,l,c,u,h,f,p,v,S,g){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,a,o,l,c,u,h,f,p,v,S,g)}set(e,t,i,r,s,a,o,l,c,u,h,f,p,v,S,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=a,m[9]=o,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=f,m[3]=p,m[7]=v,m[11]=S,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Ma().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,i=e.elements,r=1/cr.setFromMatrixColumn(e,0).length(),s=1/cr.setFromMatrixColumn(e,1).length(),a=1/cr.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*a,t[9]=i[9]*a,t[10]=i[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const f=a*u,p=a*h,v=o*u,S=o*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=p+v*c,t[5]=f-S*c,t[9]=-o*l,t[2]=S-f*c,t[6]=v+p*c,t[10]=a*l}else if(e.order==="YXZ"){const f=l*u,p=l*h,v=c*u,S=c*h;t[0]=f+S*o,t[4]=v*o-p,t[8]=a*c,t[1]=a*h,t[5]=a*u,t[9]=-o,t[2]=p*o-v,t[6]=S+f*o,t[10]=a*l}else if(e.order==="ZXY"){const f=l*u,p=l*h,v=c*u,S=c*h;t[0]=f-S*o,t[4]=-a*h,t[8]=v+p*o,t[1]=p+v*o,t[5]=a*u,t[9]=S-f*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const f=a*u,p=a*h,v=o*u,S=o*h;t[0]=l*u,t[4]=v*c-p,t[8]=f*c+S,t[1]=l*h,t[5]=S*c+f,t[9]=p*c-v,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const f=a*l,p=a*c,v=o*l,S=o*c;t[0]=l*u,t[4]=S-f*h,t[8]=v*h+p,t[1]=h,t[5]=a*u,t[9]=-o*u,t[2]=-c*u,t[6]=p*h+v,t[10]=f-S*h}else if(e.order==="XZY"){const f=a*l,p=a*c,v=o*l,S=o*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=f*h+S,t[5]=a*u,t[9]=p*h-v,t[2]=v*h-p,t[6]=o*u,t[10]=S*h+f}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(Qg,e,ev)}lookAt(e,t,i){const r=this.elements;return Mn.subVectors(e,t),Mn.lengthSq()===0&&(Mn.z=1),Mn.normalize(),Mi.crossVectors(i,Mn),Mi.lengthSq()===0&&(Math.abs(i.z)===1?Mn.x+=1e-4:Mn.z+=1e-4,Mn.normalize(),Mi.crossVectors(i,Mn)),Mi.normalize(),Ts.crossVectors(Mn,Mi),r[0]=Mi.x,r[4]=Ts.x,r[8]=Mn.x,r[1]=Mi.y,r[5]=Ts.y,r[9]=Mn.y,r[2]=Mi.z,r[6]=Ts.z,r[10]=Mn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,a=i[0],o=i[4],l=i[8],c=i[12],u=i[1],h=i[5],f=i[9],p=i[13],v=i[2],S=i[6],g=i[10],m=i[14],x=i[3],M=i[7],T=i[11],C=i[15],y=r[0],I=r[4],_=r[8],E=r[12],L=r[1],P=r[5],k=r[9],W=r[13],H=r[2],N=r[6],R=r[10],F=r[14],U=r[3],X=r[7],V=r[11],$=r[15];return s[0]=a*y+o*L+l*H+c*U,s[4]=a*I+o*P+l*N+c*X,s[8]=a*_+o*k+l*R+c*V,s[12]=a*E+o*W+l*F+c*$,s[1]=u*y+h*L+f*H+p*U,s[5]=u*I+h*P+f*N+p*X,s[9]=u*_+h*k+f*R+p*V,s[13]=u*E+h*W+f*F+p*$,s[2]=v*y+S*L+g*H+m*U,s[6]=v*I+S*P+g*N+m*X,s[10]=v*_+S*k+g*R+m*V,s[14]=v*E+S*W+g*F+m*$,s[3]=x*y+M*L+T*H+C*U,s[7]=x*I+M*P+T*N+C*X,s[11]=x*_+M*k+T*R+C*V,s[15]=x*E+M*W+T*F+C*$,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],u=e[2],h=e[6],f=e[10],p=e[14],v=e[3],S=e[7],g=e[11],m=e[15],x=l*p-c*f,M=o*p-c*h,T=o*f-l*h,C=a*p-c*u,y=a*f-l*u,I=a*h-o*u;return t*(S*x-g*M+m*T)-i*(v*x-g*C+m*y)+r*(v*M-S*C+m*I)-s*(v*T-S*y+g*I)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],p=e[11],v=e[12],S=e[13],g=e[14],m=e[15],x=t*o-i*a,M=t*l-r*a,T=t*c-s*a,C=i*l-r*o,y=i*c-s*o,I=r*c-s*l,_=u*S-h*v,E=u*g-f*v,L=u*m-p*v,P=h*g-f*S,k=h*m-p*S,W=f*m-p*g,H=x*W-M*k+T*P+C*L-y*E+I*_;if(H===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const N=1/H;return e[0]=(o*W-l*k+c*P)*N,e[1]=(r*k-i*W-s*P)*N,e[2]=(S*I-g*y+m*C)*N,e[3]=(f*y-h*I-p*C)*N,e[4]=(l*L-a*W-c*E)*N,e[5]=(t*W-r*L+s*E)*N,e[6]=(g*T-v*I-m*M)*N,e[7]=(u*I-f*T+p*M)*N,e[8]=(a*k-o*L+c*_)*N,e[9]=(i*L-t*k-s*_)*N,e[10]=(v*y-S*T+m*x)*N,e[11]=(h*T-u*y-p*x)*N,e[12]=(o*E-a*P-l*_)*N,e[13]=(t*P-i*E+r*_)*N,e[14]=(S*M-v*C-g*x)*N,e[15]=(u*C-h*M+f*x)*N,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,a=e.x,o=e.y,l=e.z,c=s*a,u=s*o;return this.set(c*a+i,c*o-r*l,c*l+r*o,0,c*o+r*l,u*o+i,u*l-r*a,0,c*l-r*o,u*l+r*a,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,a){return this.set(1,i,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,u=a+a,h=o+o,f=s*c,p=s*u,v=s*h,S=a*u,g=a*h,m=o*h,x=l*c,M=l*u,T=l*h,C=i.x,y=i.y,I=i.z;return r[0]=(1-(S+m))*C,r[1]=(p+T)*C,r[2]=(v-M)*C,r[3]=0,r[4]=(p-T)*y,r[5]=(1-(f+m))*y,r[6]=(g+x)*y,r[7]=0,r[8]=(v+M)*I,r[9]=(g-x)*I,r[10]=(1-(f+S))*I,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinant();if(s===0)return i.set(1,1,1),t.identity(),this;let a=cr.set(r[0],r[1],r[2]).length();const o=cr.set(r[4],r[5],r[6]).length(),l=cr.set(r[8],r[9],r[10]).length();s<0&&(a=-a),Fn.copy(this);const c=1/a,u=1/o,h=1/l;return Fn.elements[0]*=c,Fn.elements[1]*=c,Fn.elements[2]*=c,Fn.elements[4]*=u,Fn.elements[5]*=u,Fn.elements[6]*=u,Fn.elements[8]*=h,Fn.elements[9]*=h,Fn.elements[10]*=h,t.setFromRotationMatrix(Fn),i.x=a,i.y=o,i.z=l,this}makePerspective(e,t,i,r,s,a,o=Jn,l=!1){const c=this.elements,u=2*s/(t-e),h=2*s/(i-r),f=(t+e)/(t-e),p=(i+r)/(i-r);let v,S;if(l)v=s/(a-s),S=a*s/(a-s);else if(o===Jn)v=-(a+s)/(a-s),S=-2*a*s/(a-s);else if(o===us)v=-a/(a-s),S=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=h,c[9]=p,c[13]=0,c[2]=0,c[6]=0,c[10]=v,c[14]=S,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,i,r,s,a,o=Jn,l=!1){const c=this.elements,u=2/(t-e),h=2/(i-r),f=-(t+e)/(t-e),p=-(i+r)/(i-r);let v,S;if(l)v=1/(a-s),S=a/(a-s);else if(o===Jn)v=-2/(a-s),S=-(a+s)/(a-s);else if(o===us)v=-1/(a-s),S=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=0,c[12]=f,c[1]=0,c[5]=h,c[9]=0,c[13]=p,c[2]=0,c[6]=0,c[10]=v,c[14]=S,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}};Ma.prototype.isMatrix4=!0;let Xt=Ma;const cr=new te,Fn=new Xt,Qg=new te(0,0,0),ev=new te(1,1,1),Mi=new te,Ts=new te,Mn=new te,Pu=new Xt,Du=new Oi;class Bi{constructor(e=0,t=0,i=0,r=Bi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],u=r[9],h=r[2],f=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(bt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-bt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(bt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-bt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(f,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(bt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-bt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-u,p),this._y=0);break;default:ot("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return Pu.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Pu,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Du.setFromEuler(this),this.setFromQuaternion(Du,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}}Bi.DEFAULT_ORDER="XYZ";class Mc{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let tv=0;const Iu=new te,ur=new Oi,ri=new Xt,As=new te,Gr=new te,nv=new te,iv=new Oi,Lu=new te(1,0,0),Nu=new te(0,1,0),Uu=new te(0,0,1),Fu={type:"added"},rv={type:"removed"},dr={type:"childadded",child:null},Za={type:"childremoved",child:null};class hn extends ki{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:tv++}),this.uuid=vs(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hn.DEFAULT_UP.clone();const e=new te,t=new Bi,i=new Oi,r=new te(1,1,1);function s(){i.setFromEuler(t,!1)}function a(){t.setFromQuaternion(i,void 0,!1)}t._onChange(s),i._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Xt},normalMatrix:{value:new pt}}),this.matrix=new Xt,this.matrixWorld=new Xt,this.matrixAutoUpdate=hn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=hn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Mc,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 ur.setFromAxisAngle(e,t),this.quaternion.multiply(ur),this}rotateOnWorldAxis(e,t){return ur.setFromAxisAngle(e,t),this.quaternion.premultiply(ur),this}rotateX(e){return this.rotateOnAxis(Lu,e)}rotateY(e){return this.rotateOnAxis(Nu,e)}rotateZ(e){return this.rotateOnAxis(Uu,e)}translateOnAxis(e,t){return Iu.copy(e).applyQuaternion(this.quaternion),this.position.add(Iu.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(Lu,e)}translateY(e){return this.translateOnAxis(Nu,e)}translateZ(e){return this.translateOnAxis(Uu,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ri.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?As.copy(e):As.set(e,t,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Gr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ri.lookAt(Gr,As,this.up):ri.lookAt(As,Gr,this.up),this.quaternion.setFromRotationMatrix(ri),r&&(ri.extractRotation(r.matrixWorld),ur.setFromRotationMatrix(ri),this.quaternion.premultiply(ur.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(yt("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(Fu),dr.child=e,this.dispatchEvent(dr),dr.child=null):yt("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(rv),Za.child=e,this.dispatchEvent(Za),Za.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),ri.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),ri.multiply(e.parent.matrixWorld)),e.applyMatrix4(ri),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Fu),dr.child=e,this.dispatchEvent(dr),dr.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,r=this.children.length;i<r;i++){const a=this.children[i].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gr,e,nv),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gr,iv,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,i=e.y,r=e.z,s=this.matrix.elements;s[12]+=t-s[0]*t-s[4]*i-s[8]*r,s[13]+=i-s[1]*t-s[5]*i-s[9]*r,s[14]+=r-s[2]*t-s[6]*i-s[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){const h=l[c];s(e.shapes,h)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),u=a(e.images),h=a(e.shapes),f=a(e.skeletons),p=a(e.animations),v=a(e.nodes);o.length>0&&(i.geometries=o),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),f.length>0&&(i.skeletons=f),p.length>0&&(i.animations=p),v.length>0&&(i.nodes=v)}return i.object=r,i;function a(o){const l=[];for(const c in o){const u=o[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i<e.children.length;i++){const r=e.children[i];this.add(r.clone())}return this}}hn.DEFAULT_UP=new te(0,1,0);hn.DEFAULT_MATRIX_AUTO_UPDATE=!0;hn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let Rs=class extends hn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const sv={type:"move"};class $a{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Rs,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 Rs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new te,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new te),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Rs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new te,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new te,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const S of e.hand.values()){const g=t.getJointPose(S,i),m=this._getHandJoint(c,S);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],f=u.position.distanceTo(h.position),p=.02,v=.005;c.inputState.pinching&&f>p+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=p-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1,l.eventsEnabled&&l.dispatchEvent({type:"gripUpdated",data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(sv)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Rs;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const Vh={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},Ei={h:0,s:0,l:0},Cs={h:0,s:0,l:0};function Ja(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class at{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=wn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Mt.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=Mt.workingColorSpace){return this.r=e,this.g=t,this.b=i,Mt.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=Mt.workingColorSpace){if(e=Xg(e,1),t=bt(t,0,1),i=bt(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,a=2*i-s;this.r=Ja(a,s,e+1/3),this.g=Ja(a,s,e),this.b=Ja(a,s,e-1/3)}return Mt.colorSpaceToWorking(this,r),this}setStyle(e,t=wn){function i(s){s!==void 0&&parseFloat(s)<1&&ot("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:ot("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);ot("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=wn){const i=Vh[e.toLowerCase()];return i!==void 0?this.setHex(i,t):ot("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=pi(e.r),this.g=pi(e.g),this.b=pi(e.b),this}copyLinearToSRGB(e){return this.r=Lr(e.r),this.g=Lr(e.g),this.b=Lr(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=wn){return Mt.workingToColorSpace(un.copy(this),e),Math.round(bt(un.r*255,0,255))*65536+Math.round(bt(un.g*255,0,255))*256+Math.round(bt(un.b*255,0,255))}getHexString(e=wn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Mt.workingColorSpace){Mt.workingToColorSpace(un.copy(this),t);const i=un.r,r=un.g,s=un.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let l,c;const u=(o+a)/2;if(o===a)l=0,c=0;else{const h=a-o;switch(c=u<=.5?h/(a+o):h/(2-a-o),a){case i:l=(r-s)/h+(r<s?6:0);break;case r:l=(s-i)/h+2;break;case s:l=(i-r)/h+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=Mt.workingColorSpace){return Mt.workingToColorSpace(un.copy(this),t),e.r=un.r,e.g=un.g,e.b=un.b,e}getStyle(e=wn){Mt.workingToColorSpace(un.copy(this),e);const t=un.r,i=un.g,r=un.b;return e!==wn?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(Ei),this.setHSL(Ei.h+e,Ei.s+t,Ei.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(Ei),e.getHSL(Cs);const i=Xa(Ei.h,Cs.h,t),r=Xa(Ei.s,Cs.s,t),s=Xa(Ei.l,Cs.l,t);return this.setHSL(i,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*i+s[6]*r,this.g=s[1]*t+s[4]*i+s[7]*r,this.b=s[2]*t+s[5]*i+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const un=new at;at.NAMES=Vh;class av extends hn{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 Bi,this.environmentIntensity=1,this.environmentRotation=new Bi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const On=new te,si=new te,Qa=new te,ai=new te,hr=new te,fr=new te,Ou=new te,eo=new te,to=new te,no=new te,io=new Wt,ro=new Wt,so=new Wt;class zn{constructor(e=new te,t=new te,i=new te){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),On.subVectors(e,t),r.cross(On);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){On.subVectors(r,t),si.subVectors(i,t),Qa.subVectors(e,t);const a=On.dot(On),o=On.dot(si),l=On.dot(Qa),c=si.dot(si),u=si.dot(Qa),h=a*c-o*o;if(h===0)return s.set(0,0,0),null;const f=1/h,p=(c*l-o*u)*f,v=(a*u-o*l)*f;return s.set(1-p-v,v,p)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,ai)===null?!1:ai.x>=0&&ai.y>=0&&ai.x+ai.y<=1}static getInterpolation(e,t,i,r,s,a,o,l){return this.getBarycoord(e,t,i,r,ai)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,ai.x),l.addScaledVector(a,ai.y),l.addScaledVector(o,ai.z),l)}static getInterpolatedAttribute(e,t,i,r,s,a){return io.setScalar(0),ro.setScalar(0),so.setScalar(0),io.fromBufferAttribute(e,t),ro.fromBufferAttribute(e,i),so.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(io,s.x),a.addScaledVector(ro,s.y),a.addScaledVector(so,s.z),a}static isFrontFacing(e,t,i,r){return On.subVectors(i,t),si.subVectors(e,t),On.cross(si).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return On.subVectors(this.c,this.b),si.subVectors(this.a,this.b),On.cross(si).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return zn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return zn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return zn.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return zn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return zn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let a,o;hr.subVectors(r,i),fr.subVectors(s,i),eo.subVectors(e,i);const l=hr.dot(eo),c=fr.dot(eo);if(l<=0&&c<=0)return t.copy(i);to.subVectors(e,r);const u=hr.dot(to),h=fr.dot(to);if(u>=0&&h<=u)return t.copy(r);const f=l*h-u*c;if(f<=0&&l>=0&&u<=0)return a=l/(l-u),t.copy(i).addScaledVector(hr,a);no.subVectors(e,s);const p=hr.dot(no),v=fr.dot(no);if(v>=0&&p<=v)return t.copy(s);const S=p*c-l*v;if(S<=0&&c>=0&&v<=0)return o=c/(c-v),t.copy(i).addScaledVector(fr,o);const g=u*v-p*h;if(g<=0&&h-u>=0&&p-v>=0)return Ou.subVectors(s,r),o=(h-u)/(h-u+(p-v)),t.copy(r).addScaledVector(Ou,o);const m=1/(g+S+f);return a=S*m,o=f*m,t.copy(i).addScaledVector(hr,a).addScaledVector(fr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class _i{constructor(e=new te(1/0,1/0,1/0),t=new te(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(Bn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(Bn.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=Bn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Bn):Bn.fromBufferAttribute(s,a),Bn.applyMatrix4(e.matrixWorld),this.expandByPoint(Bn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Ps.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Ps.copy(i.boundingBox)),Ps.applyMatrix4(e.matrixWorld),this.union(Ps)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Bn),Bn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Wr),Ds.subVectors(this.max,Wr),pr.subVectors(e.a,Wr),mr.subVectors(e.b,Wr),gr.subVectors(e.c,Wr),wi.subVectors(mr,pr),Ti.subVectors(gr,mr),Gi.subVectors(pr,gr);let t=[0,-wi.z,wi.y,0,-Ti.z,Ti.y,0,-Gi.z,Gi.y,wi.z,0,-wi.x,Ti.z,0,-Ti.x,Gi.z,0,-Gi.x,-wi.y,wi.x,0,-Ti.y,Ti.x,0,-Gi.y,Gi.x,0];return!ao(t,pr,mr,gr,Ds)||(t=[1,0,0,0,1,0,0,0,1],!ao(t,pr,mr,gr,Ds))?!1:(Is.crossVectors(wi,Ti),t=[Is.x,Is.y,Is.z],ao(t,pr,mr,gr,Ds))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Bn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Bn).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:(oi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),oi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),oi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),oi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),oi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),oi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),oi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),oi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(oi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const oi=[new te,new te,new te,new te,new te,new te,new te,new te],Bn=new te,Ps=new _i,pr=new te,mr=new te,gr=new te,wi=new te,Ti=new te,Gi=new te,Wr=new te,Ds=new te,Is=new te,Wi=new te;function ao(n,e,t,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){Wi.fromArray(n,s);const o=r.x*Math.abs(Wi.x)+r.y*Math.abs(Wi.y)+r.z*Math.abs(Wi.z),l=e.dot(Wi),c=t.dot(Wi),u=i.dot(Wi);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}const di=ov();function ov(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function lv(n){Math.abs(n)>65504&&ot("DataUtils.toHalfFloat(): Value out of range."),n=bt(n,-65504,65504),di.floatView[0]=n;const e=di.uint32View[0],t=e>>23&511;return di.baseTable[t]+((e&8388607)>>di.shiftTable[t])}function cv(n){const e=n>>10;return di.uint32View[0]=di.mantissaTable[di.offsetTable[e]+(n&1023)]+di.exponentTable[e],di.floatView[0]}class Ls{static toHalfFloat(e){return lv(e)}static fromHalfFloat(e){return cv(e)}}const $t=new te,Ns=new ht;let uv=0;class bn extends ki{constructor(e,t,i=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:uv++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Mu,this.updateRanges=[],this.gpuType=An,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)Ns.fromBufferAttribute(this,t),Ns.applyMatrix3(e),this.setXY(t,Ns.x,Ns.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.applyMatrix3(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.applyMatrix4(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.applyNormalMatrix(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)$t.fromBufferAttribute(this,t),$t.transformDirection(e),this.setXYZ(t,$t.x,$t.y,$t.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=Hr(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=gn(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Hr(t,this.array)),t}setX(e,t){return this.normalized&&(t=gn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Hr(t,this.array)),t}setY(e,t){return this.normalized&&(t=gn(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=Hr(t,this.array)),t}setZ(e,t){return this.normalized&&(t=gn(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=Hr(t,this.array)),t}setW(e,t){return this.normalized&&(t=gn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=gn(t,this.array),i=gn(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=gn(t,this.array),i=gn(i,this.array),r=gn(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e*=this.itemSize,this.normalized&&(t=gn(t,this.array),i=gn(i,this.array),r=gn(r,this.array),s=gn(s,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Mu&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class Hh extends bn{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class Gh extends bn{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class mi extends bn{constructor(e,t,i){super(new Float32Array(e),t,i)}}const dv=new _i,Xr=new te,oo=new te;class Ec{constructor(e=new te,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):dv.setFromPoints(e).getCenter(i);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Xr.subVectors(e,this.center);const t=Xr.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Xr,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(oo.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Xr.copy(e.center).add(oo)),this.expandByPoint(Xr.copy(e.center).sub(oo))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let hv=0;const Pn=new Xt,lo=new hn,vr=new te,En=new _i,Yr=new _i,tn=new te;class Wn extends ki{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:hv++}),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={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(Vg(e)?Gh:Hh)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new pt().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Pn.makeRotationFromQuaternion(e),this.applyMatrix4(Pn),this}rotateX(e){return Pn.makeRotationX(e),this.applyMatrix4(Pn),this}rotateY(e){return Pn.makeRotationY(e),this.applyMatrix4(Pn),this}rotateZ(e){return Pn.makeRotationZ(e),this.applyMatrix4(Pn),this}translate(e,t,i){return Pn.makeTranslation(e,t,i),this.applyMatrix4(Pn),this}scale(e,t,i){return Pn.makeScale(e,t,i),this.applyMatrix4(Pn),this}lookAt(e){return lo.lookAt(e),lo.updateMatrix(),this.applyMatrix4(lo.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(vr).negate(),this.translate(vr.x,vr.y,vr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];i.push(a.x,a.y,a.z||0)}this.setAttribute("position",new mi(i,3))}else{const i=Math.min(e.length,t.count);for(let r=0;r<i;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&ot("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 _i);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){yt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new te(-1/0,-1/0,-1/0),new te(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i<r;i++){const s=t[i];En.setFromBufferAttribute(s),this.morphTargetsRelative?(tn.addVectors(this.boundingBox.min,En.min),this.boundingBox.expandByPoint(tn),tn.addVectors(this.boundingBox.max,En.max),this.boundingBox.expandByPoint(tn)):(this.boundingBox.expandByPoint(En.min),this.boundingBox.expandByPoint(En.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&yt('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 Ec);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){yt("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new te,1/0);return}if(e){const i=this.boundingSphere.center;if(En.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];Yr.setFromBufferAttribute(o),this.morphTargetsRelative?(tn.addVectors(En.min,Yr.min),En.expandByPoint(tn),tn.addVectors(En.max,Yr.max),En.expandByPoint(tn)):(En.expandByPoint(Yr.min),En.expandByPoint(Yr.max))}En.getCenter(i);let r=0;for(let s=0,a=e.count;s<a;s++)tn.fromBufferAttribute(e,s),r=Math.max(r,i.distanceToSquared(tn));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,u=o.count;c<u;c++)tn.fromBufferAttribute(o,c),l&&(vr.fromBufferAttribute(e,c),tn.add(vr)),r=Math.max(r,i.distanceToSquared(tn))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&yt('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){yt("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new bn(new Float32Array(4*i.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let _=0;_<i.count;_++)o[_]=new te,l[_]=new te;const c=new te,u=new te,h=new te,f=new ht,p=new ht,v=new ht,S=new te,g=new te;function m(_,E,L){c.fromBufferAttribute(i,_),u.fromBufferAttribute(i,E),h.fromBufferAttribute(i,L),f.fromBufferAttribute(s,_),p.fromBufferAttribute(s,E),v.fromBufferAttribute(s,L),u.sub(c),h.sub(c),p.sub(f),v.sub(f);const P=1/(p.x*v.y-v.x*p.y);isFinite(P)&&(S.copy(u).multiplyScalar(v.y).addScaledVector(h,-p.y).multiplyScalar(P),g.copy(h).multiplyScalar(p.x).addScaledVector(u,-v.x).multiplyScalar(P),o[_].add(S),o[E].add(S),o[L].add(S),l[_].add(g),l[E].add(g),l[L].add(g))}let x=this.groups;x.length===0&&(x=[{start:0,count:e.count}]);for(let _=0,E=x.length;_<E;++_){const L=x[_],P=L.start,k=L.count;for(let W=P,H=P+k;W<H;W+=3)m(e.getX(W+0),e.getX(W+1),e.getX(W+2))}const M=new te,T=new te,C=new te,y=new te;function I(_){C.fromBufferAttribute(r,_),y.copy(C);const E=o[_];M.copy(E),M.sub(C.multiplyScalar(C.dot(E))).normalize(),T.crossVectors(y,E);const P=T.dot(l[_])<0?-1:1;a.setXYZW(_,M.x,M.y,M.z,P)}for(let _=0,E=x.length;_<E;++_){const L=x[_],P=L.start,k=L.count;for(let W=P,H=P+k;W<H;W+=3)I(e.getX(W+0)),I(e.getX(W+1)),I(e.getX(W+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new bn(new Float32Array(t.count*3),3),this.setAttribute("normal",i);else for(let f=0,p=i.count;f<p;f++)i.setXYZ(f,0,0,0);const r=new te,s=new te,a=new te,o=new te,l=new te,c=new te,u=new te,h=new te;if(e)for(let f=0,p=e.count;f<p;f+=3){const v=e.getX(f+0),S=e.getX(f+1),g=e.getX(f+2);r.fromBufferAttribute(t,v),s.fromBufferAttribute(t,S),a.fromBufferAttribute(t,g),u.subVectors(a,s),h.subVectors(r,s),u.cross(h),o.fromBufferAttribute(i,v),l.fromBufferAttribute(i,S),c.fromBufferAttribute(i,g),o.add(u),l.add(u),c.add(u),i.setXYZ(v,o.x,o.y,o.z),i.setXYZ(S,l.x,l.y,l.z),i.setXYZ(g,c.x,c.y,c.z)}else for(let f=0,p=t.count;f<p;f+=3)r.fromBufferAttribute(t,f+0),s.fromBufferAttribute(t,f+1),a.fromBufferAttribute(t,f+2),u.subVectors(a,s),h.subVectors(r,s),u.cross(h),i.setXYZ(f+0,u.x,u.y,u.z),i.setXYZ(f+1,u.x,u.y,u.z),i.setXYZ(f+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)tn.fromBufferAttribute(e,t),tn.normalize(),e.setXYZ(t,tn.x,tn.y,tn.z)}toNonIndexed(){function e(o,l){const c=o.array,u=o.itemSize,h=o.normalized,f=new c.constructor(l.length*u);let p=0,v=0;for(let S=0,g=l.length;S<g;S++){o.isInterleavedBufferAttribute?p=l[S]*o.data.stride+o.offset:p=l[S]*u;for(let m=0;m<u;m++)f[v++]=c[p++]}return new bn(f,u,h)}if(this.index===null)return ot("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Wn,i=this.index.array,r=this.attributes;for(const o in r){const l=r[o],c=e(l,i);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let u=0,h=c.length;u<h;u++){const f=c[u],p=e(f,i);l.push(p)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,f=c.length;h<f;h++){const p=c[h];u.push(p.toJSON(e.data))}u.length>0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],h=s[c];for(let f=0,p=h.length;f<p;f++)u.push(h[f].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,u=a.length;c<u;c++){const h=a[c];this.addGroup(h.start,h.count,h.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let fv=0;class kr extends ki{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:fv++}),this.uuid=vs(),this.name="",this.type="Material",this.blending=Ir,this.side=Sn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=No,this.blendDst=Uo,this.blendEquation=ji,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new at(0,0,0),this.blendAlpha=0,this.depthFunc=Ur,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=yu,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=or,this.stencilZFail=or,this.stencilZPass=or,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){ot(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){ot(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Ir&&(i.blending=this.blending),this.side!==Sn&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==No&&(i.blendSrc=this.blendSrc),this.blendDst!==Uo&&(i.blendDst=this.blendDst),this.blendEquation!==ji&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Ur&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==yu&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==or&&(i.stencilFail=this.stencilFail),this.stencilZFail!==or&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==or&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=r(e.textures),a=r(e.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const li=new te,co=new te,Us=new te,Ai=new te,uo=new te,Fs=new te,ho=new te;class wc{constructor(e=new te,t=new te(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,li)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=li.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(li.copy(this.origin).addScaledVector(this.direction,t),li.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){co.copy(e).add(t).multiplyScalar(.5),Us.copy(t).sub(e).normalize(),Ai.copy(this.origin).sub(co);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Us),o=Ai.dot(this.direction),l=-Ai.dot(Us),c=Ai.lengthSq(),u=Math.abs(1-a*a);let h,f,p,v;if(u>0)if(h=a*l-o,f=a*o-l,v=s*u,h>=0)if(f>=-v)if(f<=v){const S=1/u;h*=S,f*=S,p=h*(h+a*f+2*o)+f*(a*h+f+2*l)+c}else f=s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+c;else f=-s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+c;else f<=-v?(h=Math.max(0,-(-a*s+o)),f=h>0?-s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+c):f<=v?(h=0,f=Math.min(Math.max(-s,-l),s),p=f*(f+2*l)+c):(h=Math.max(0,-(a*s+o)),f=h>0?s:Math.min(Math.max(-s,-l),s),p=-h*h+f*(f+2*l)+c);else f=a>0?-s:s,h=Math.max(0,-(a*f+o)),p=-h*h+f*(f+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(co).addScaledVector(Us,f),p}intersectSphere(e,t){li.subVectors(e.center,this.origin);const i=li.dot(this.direction),r=li.dot(li)-i*i,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,a,o,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,f=this.origin;return c>=0?(i=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(i=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),u>=0?(s=(e.min.y-f.y)*u,a=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,a=(e.min.y-f.y)*u),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a<r||isNaN(r))&&(r=a),h>=0?(o=(e.min.z-f.z)*h,l=(e.max.z-f.z)*h):(o=(e.max.z-f.z)*h,l=(e.min.z-f.z)*h),i>l||o>r)||((o>i||i!==i)&&(i=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,li)!==null}intersectTriangle(e,t,i,r,s){uo.subVectors(t,e),Fs.subVectors(i,e),ho.crossVectors(uo,Fs);let a=this.direction.dot(ho),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Ai.subVectors(this.origin,e);const l=o*this.direction.dot(Fs.crossVectors(Ai,Fs));if(l<0)return null;const c=o*this.direction.dot(uo.cross(Ai));if(c<0||l+c>a)return null;const u=-o*Ai.dot(ho);return u<0?null:this.at(u/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Wh extends kr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new at(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 Bi,this.combine=Eh,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Bu=new Xt,Xi=new wc,Os=new Ec,zu=new te,Bs=new te,zs=new te,ks=new te,fo=new te,Vs=new te,ku=new te,Hs=new te;class rn extends hn{constructor(e=new Wn,t=new Wh){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,a=i.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){Vs.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const u=o[l],h=s[l];u!==0&&(fo.fromBufferAttribute(h,e),a?Vs.addScaledVector(fo,u):Vs.addScaledVector(fo.sub(t),u))}t.add(Vs)}return t}raycast(e,t){const i=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Os.copy(i.boundingSphere),Os.applyMatrix4(s),Xi.copy(e.ray).recast(e.near),!(Os.containsPoint(Xi.origin)===!1&&(Xi.intersectSphere(Os,zu)===null||Xi.origin.distanceToSquared(zu)>(e.far-e.near)**2))&&(Bu.copy(s).invert(),Xi.copy(e.ray).applyMatrix4(Bu),!(i.boundingBox!==null&&Xi.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Xi)))}_computeIntersections(e,t,i){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,f=s.groups,p=s.drawRange;if(o!==null)if(Array.isArray(a))for(let v=0,S=f.length;v<S;v++){const g=f[v],m=a[g.materialIndex],x=Math.max(g.start,p.start),M=Math.min(o.count,Math.min(g.start+g.count,p.start+p.count));for(let T=x,C=M;T<C;T+=3){const y=o.getX(T),I=o.getX(T+1),_=o.getX(T+2);r=Gs(this,m,e,i,c,u,h,y,I,_),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const v=Math.max(0,p.start),S=Math.min(o.count,p.start+p.count);for(let g=v,m=S;g<m;g+=3){const x=o.getX(g),M=o.getX(g+1),T=o.getX(g+2);r=Gs(this,a,e,i,c,u,h,x,M,T),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let v=0,S=f.length;v<S;v++){const g=f[v],m=a[g.materialIndex],x=Math.max(g.start,p.start),M=Math.min(l.count,Math.min(g.start+g.count,p.start+p.count));for(let T=x,C=M;T<C;T+=3){const y=T,I=T+1,_=T+2;r=Gs(this,m,e,i,c,u,h,y,I,_),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const v=Math.max(0,p.start),S=Math.min(l.count,p.start+p.count);for(let g=v,m=S;g<m;g+=3){const x=g,M=g+1,T=g+2;r=Gs(this,a,e,i,c,u,h,x,M,T),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}}}function pv(n,e,t,i,r,s,a,o){let l;if(e.side===xn?l=i.intersectTriangle(a,s,r,!0,o):l=i.intersectTriangle(r,s,a,e.side===Sn,o),l===null)return null;Hs.copy(o),Hs.applyMatrix4(n.matrixWorld);const c=t.ray.origin.distanceTo(Hs);return c<t.near||c>t.far?null:{distance:c,point:Hs.clone(),object:n}}function Gs(n,e,t,i,r,s,a,o,l,c){n.getVertexPosition(o,Bs),n.getVertexPosition(l,zs),n.getVertexPosition(c,ks);const u=pv(n,e,t,i,Bs,zs,ks,ku);if(u){const h=new te;zn.getBarycoord(ku,Bs,zs,ks,h),r&&(u.uv=zn.getInterpolatedAttribute(r,o,l,c,h,new ht)),s&&(u.uv1=zn.getInterpolatedAttribute(s,o,l,c,h,new ht)),a&&(u.normal=zn.getInterpolatedAttribute(a,o,l,c,h,new te),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const f={a:o,b:l,c,normal:new te,materialIndex:0};zn.getNormal(Bs,zs,ks,f.normal),u.face=f,u.barycoord=h}return u}class Xh extends dn{constructor(e=null,t=1,i=1,r,s,a,o,l,c=on,u=on,h,f){super(null,a,o,l,c,u,r,s,h,f),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const po=new te,mv=new te,gv=new pt;class Ci{constructor(e=new te(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=po.subVectors(i,t).cross(mv.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,i=!0){const r=e.delta(po),s=this.normal.dot(r);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/s;return i===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||gv.getNormalMatrix(e),r=this.coplanarPoint(po).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Yi=new Ec,vv=new ht(.5,.5),Ws=new te;class Tc{constructor(e=new Ci,t=new Ci,i=new Ci,r=new Ci,s=new Ci,a=new Ci){this.planes=[e,t,i,r,s,a]}set(e,t,i,r,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(i),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Jn,i=!1){const r=this.planes,s=e.elements,a=s[0],o=s[1],l=s[2],c=s[3],u=s[4],h=s[5],f=s[6],p=s[7],v=s[8],S=s[9],g=s[10],m=s[11],x=s[12],M=s[13],T=s[14],C=s[15];if(r[0].setComponents(c-a,p-u,m-v,C-x).normalize(),r[1].setComponents(c+a,p+u,m+v,C+x).normalize(),r[2].setComponents(c+o,p+h,m+S,C+M).normalize(),r[3].setComponents(c-o,p-h,m-S,C-M).normalize(),i)r[4].setComponents(l,f,g,T).normalize(),r[5].setComponents(c-l,p-f,m-g,C-T).normalize();else if(r[4].setComponents(c-l,p-f,m-g,C-T).normalize(),t===Jn)r[5].setComponents(c+l,p+f,m+g,C+T).normalize();else if(t===us)r[5].setComponents(l,f,g,T).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Yi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Yi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Yi)}intersectsSprite(e){Yi.center.set(0,0,0);const t=vv.distanceTo(e.center);return Yi.radius=.7071067811865476+t,Yi.applyMatrix4(e.matrixWorld),this.intersectsSphere(Yi)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const r=t[i];if(Ws.x=r.normal.x>0?e.max.x:e.min.x,Ws.y=r.normal.y>0?e.max.y:e.min.y,Ws.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Ws)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Yh extends dn{constructor(e=[],t=ir,i,r,s,a,o,l,c,u){super(e,t,i,r,s,a,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Or extends dn{constructor(e,t,i=ti,r,s,a,o=on,l=on,c,u=vi,h=1){if(u!==vi&&u!==Ki)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:t,depth:h};super(f,r,s,a,o,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new yc(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class _v extends Or{constructor(e,t=ti,i=ir,r,s,a=on,o=on,l,c=vi){const u={width:e,height:e,depth:1},h=[u,u,u,u,u,u];super(e,e,t,i,r,s,a,o,l,c),this.image=h,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class jh extends dn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class _s extends Wn{constructor(e=1,t=1,i=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],u=[],h=[];let f=0,p=0;v("z","y","x",-1,-1,i,t,e,a,s,0),v("z","y","x",1,-1,i,t,-e,a,s,1),v("x","z","y",1,1,e,i,t,r,a,2),v("x","z","y",1,-1,e,i,-t,r,a,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new mi(c,3)),this.setAttribute("normal",new mi(u,3)),this.setAttribute("uv",new mi(h,2));function v(S,g,m,x,M,T,C,y,I,_,E){const L=T/I,P=C/_,k=T/2,W=C/2,H=y/2,N=I+1,R=_+1;let F=0,U=0;const X=new te;for(let V=0;V<R;V++){const $=V*P-W;for(let ee=0;ee<N;ee++){const Se=ee*L-k;X[S]=Se*x,X[g]=$*M,X[m]=H,c.push(X.x,X.y,X.z),X[S]=0,X[g]=0,X[m]=y>0?1:-1,u.push(X.x,X.y,X.z),h.push(ee/I),h.push(1-V/_),F+=1}}for(let V=0;V<_;V++)for(let $=0;$<I;$++){const ee=f+$+N*V,Se=f+$+N*(V+1),ye=f+($+1)+N*(V+1),ve=f+($+1)+N*V;l.push(ee,Se,ve),l.push(Se,ye,ve),U+=6}o.addGroup(p,U,E),p+=U,f+=F}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new _s(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class xs extends Wn{constructor(e=1,t=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};const s=e/2,a=t/2,o=Math.floor(i),l=Math.floor(r),c=o+1,u=l+1,h=e/o,f=t/l,p=[],v=[],S=[],g=[];for(let m=0;m<u;m++){const x=m*f-a;for(let M=0;M<c;M++){const T=M*h-s;v.push(T,-x,0),S.push(0,0,1),g.push(M/o),g.push(1-m/l)}}for(let m=0;m<l;m++)for(let x=0;x<o;x++){const M=x+c*m,T=x+c*(m+1),C=x+1+c*(m+1),y=x+1+c*m;p.push(M,T,y),p.push(T,C,y)}this.setIndex(p),this.setAttribute("position",new mi(v,3)),this.setAttribute("normal",new mi(S,3)),this.setAttribute("uv",new mi(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xs(e.width,e.height,e.widthSegments,e.heightSegments)}}function Br(n){const e={};for(const t in n){e[t]={};for(const i in n[t]){const r=n[t][i];if(Vu(r))r.isRenderTargetTexture?(ot("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][i]=null):e[t][i]=r.clone();else if(Array.isArray(r))if(Vu(r[0])){const s=[];for(let a=0,o=r.length;a<o;a++)s[a]=r[a].clone();e[t][i]=s}else e[t][i]=r.slice();else e[t][i]=r}}return e}function pn(n){const e={};for(let t=0;t<n.length;t++){const i=Br(n[t]);for(const r in i)e[r]=i[r]}return e}function Vu(n){return n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)}function xv(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t].clone());return e}function qh(n){const e=n.getRenderTarget();return e===null?n.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Mt.workingColorSpace}const bv={clone:Br,merge:pn};var Sv=`void main() {
|
|
2
2
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
3
3
|
}`,yv=`void main() {
|
|
4
4
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
@@ -4105,12 +4105,12 @@ void main() {
|
|
|
4105
4105
|
`))&&H<E&&k<_.byteLength;)N+=R,H+=R.length,k+=128,R=String.fromCharCode.apply(null,new Uint16Array(_.subarray(k,k+128)));return-1<W?(_.pos+=H+W+1,N+R.slice(0,W)):!1},f=function(_){const E=/^#\?(\S+)/,L=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,P=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,k=/^\s*FORMAT=(\S+)\s*$/,W=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,H={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let N,R;for((_.pos>=_.byteLength||!(N=h(_)))&&a(1,"no header found"),(R=N.match(E))||a(3,"bad initial token"),H.valid|=1,H.programtype=R[1],H.string+=N+`
|
|
4106
4106
|
`;N=h(_),N!==!1;){if(H.string+=N+`
|
|
4107
4107
|
`,N.charAt(0)==="#"){H.comments+=N+`
|
|
4108
|
-
`;continue}if((R=N.match(L))&&(H.gamma=parseFloat(R[1])),(R=N.match(P))&&(H.exposure=parseFloat(R[1])),(R=N.match(k))&&(H.valid|=2,H.format=R[1]),(R=N.match(W))&&(H.valid|=4,H.height=parseInt(R[1],10),H.width=parseInt(R[2],10)),H.valid&2&&H.valid&4)break}return H.valid&2||a(3,"missing format specifier"),H.valid&4||a(3,"missing image size specifier"),H},p=function(_,E,L){const P=E;if(P<8||P>32767||_[0]!==2||_[1]!==2||_[2]&128)return new Uint8Array(_);P!==(_[2]<<8|_[3])&&a(3,"wrong scanline width");const k=new Uint8Array(4*E*L);k.length||a(4,"unable to allocate buffer space");let W=0,H=0;const N=4*P,R=new Uint8Array(4),F=new Uint8Array(N);let U=L;for(;U>0&&H<_.byteLength;){H+4>_.byteLength&&a(1),R[0]=_[H++],R[1]=_[H++],R[2]=_[H++],R[3]=_[H++],(R[0]!=2||R[1]!=2||(R[2]<<8|R[3])!=P)&&a(3,"bad rgbe scanline format");let X=0,V;for(;X<N&&H<_.byteLength;){V=_[H++];const ee=V>128;if(ee&&(V-=128),(V===0||X+V>N)&&a(3,"bad scanline data"),ee){const Se=_[H++];for(let ye=0;ye<V;ye++)F[X++]=Se}else F.set(_.subarray(H,H+V),X),X+=V,H+=V}const $=P;for(let ee=0;ee<$;ee++){let Se=0;k[W]=F[ee+Se],Se+=P,k[W+1]=F[ee+Se],Se+=P,k[W+2]=F[ee+Se],Se+=P,k[W+3]=F[ee+Se],W+=4}U--}return k},v=function(_,E,L,P){const k=_[E+3],W=Math.pow(2,k-128)/255;L[P+0]=_[E+0]*W,L[P+1]=_[E+1]*W,L[P+2]=_[E+2]*W,L[P+3]=1},S=function(_,E,L,P){const k=_[E+3],W=Math.pow(2,k-128)/255;L[P+0]=Ls.toHalfFloat(Math.min(_[E+0]*W,65504)),L[P+1]=Ls.toHalfFloat(Math.min(_[E+1]*W,65504)),L[P+2]=Ls.toHalfFloat(Math.min(_[E+2]*W,65504)),L[P+3]=Ls.toHalfFloat(1)},g=new Uint8Array(e);g.pos=0;const m=f(g),x=m.width,M=m.height,T=p(g.subarray(g.pos),x,M);let C,y,I;switch(this.type){case An:I=T.length/4;const _=new Float32Array(I*4);for(let L=0;L<I;L++)v(T,L*4,_,L*4);C=_,y=An;break;case Rn:I=T.length/4;const E=new Uint16Array(I*4);for(let L=0;L<I;L++)S(T,L*4,E,L*4);C=E,y=Rn;break;default:throw new Error("THREE.HDRLoader: Unsupported type: "+this.type)}return{width:x,height:M,data:C,header:m.string,gamma:m.gamma,exposure:m.exposure,type:y}}setDataType(e){return this.type=e,this}load(e,t,i,r){function s(a,o){switch(a.type){case An:case Rn:a.colorSpace=cs,a.minFilter=Zt,a.magFilter=Zt,a.generateMipmaps=!1,a.flipY=!0;break}t&&t(a,o)}return super.load(e,s,i,r)}}var af=new te(0,0,1),Mo=(n,e,t,i)=>{switch(n){case"mm":return e;case"cm":return t;default:return i}},of=function(n,e){let t=ZS(e||{}),i=$S(t),r=iy(t,n),s=ry(n,t),a=ay(r,n,t);ey(i,t),ty(i,t),t.floor?.enabled&&ny(i,t);let o=t.events.enableEventHandlers!==!1?sy(n,i,r,a,t):{dispose:()=>{},fitToView:()=>{},clearSelection:()=>{}},l=n.parentElement,c=()=>l?{width:l.clientWidth,height:l.clientHeight}:{width:window.innerWidth,height:window.innerHeight},{animate:u,dispose:h}=QS(s,i,r,a,c,t.events.onFrame);u();let f=t.environment?.sceneUp||af;return i.up.set(f.x,f.y,f.z),{scene:i,camera:r,controls:a,renderer:s,dispose:()=>{h(),o.dispose(),a.dispose(),s.dispose(),i.traverse(p=>{p instanceof rn&&(p.geometry?.dispose(),Array.isArray(p.material)?p.material.forEach(v=>v.dispose()):p.material?.dispose())})},fitToView:o.fitToView,clearSelection:o.clearSelection}};function ZS(n){let e=n.sceneScale||"m",t={mm:{cameraDistance:20,near:.1,far:2e3,floorSize:100,lightDistance:10,lightHeight:20,minDistance:.1,shadowSize:100,scaleFactor:1e3},cm:{cameraDistance:20,near:.1,far:2e3,floorSize:100,lightDistance:25,lightHeight:50,minDistance:.1,shadowSize:100,scaleFactor:100},m:{cameraDistance:10,near:.01,far:2e3,floorSize:50,lightDistance:25,lightHeight:50,minDistance:.001,shadowSize:100,scaleFactor:1},inches:{cameraDistance:15,near:.1,far:2e3,floorSize:80,lightDistance:20,lightHeight:40,minDistance:.1,shadowSize:80,scaleFactor:39.37},feet:{cameraDistance:8,near:.1,far:2e3,floorSize:40,lightDistance:15,lightHeight:30,minDistance:.1,shadowSize:60,scaleFactor:3.28084}}[e];return{sceneScale:e,camera:{position:n.camera?.position||new te(-t.cameraDistance,t.cameraDistance,t.cameraDistance),fov:n.camera?.fov||20,near:n.camera?.near||t.near,far:n.camera?.far||t.far,target:n.camera?.target||new te(0,0,0)},lighting:{enableSunlight:n.lighting?.enableSunlight??!0,sunlightIntensity:n.lighting?.sunlightIntensity||1,sunlightPosition:n.lighting?.sunlightPosition||new te(t.lightDistance,t.lightHeight,t.lightDistance),ambientLightColor:n.lighting?.ambientLightColor||new at(4210752),ambientLightIntensity:n.lighting?.ambientLightIntensity||1,sunlightColor:n.lighting?.sunlightColor||16777215},environment:{hdrPath:n.environment?.hdrPath||"/baseHDR.hdr",backgroundColor:n.environment?.backgroundColor||new at(15790320),enableEnvironmentLighting:n.environment?.enableEnvironmentLighting??!0,sceneUp:n.environment?.sceneUp||af,showEnvironment:n.environment?.showEnvironment??!1},floor:{enabled:n.floor?.enabled??!1,size:n.floor?.size||t.floorSize,color:n.floor?.color||new at(8421504),roughness:n.floor?.roughness||.7,metalness:n.floor?.metalness||0,receiveShadow:n.floor?.receiveShadow??!0},render:{enableShadows:n.render?.enableShadows??!0,shadowMapSize:n.render?.shadowMapSize||2048,antialias:n.render?.antialias??!0,pixelRatio:n.render?.pixelRatio||Math.min(window.devicePixelRatio,2),toneMapping:n.render?.toneMapping||fc,toneMappingExposure:n.render?.toneMappingExposure||1,preserveDrawingBuffer:n.render?.preserveDrawingBuffer??!1},controls:{enableDamping:n.controls?.enableDamping??!1,dampingFactor:n.controls?.dampingFactor||.05,autoRotate:n.controls?.autoRotate??!1,autoRotateSpeed:n.controls?.autoRotateSpeed||.5,enableZoom:n.controls?.enableZoom??!0,enablePan:n.controls?.enablePan??!0,minDistance:n.controls?.minDistance||t.minDistance,maxDistance:n.controls?.maxDistance||1/0},events:{onBackgroundClicked:n.events?.onBackgroundClicked,onObjectSelected:n.events?.onObjectSelected,onMeshMetadataClicked:n.events?.onMeshMetadataClicked,onMeshDoubleClicked:n.events?.onMeshDoubleClicked,selectionColor:n.events?.selectionColor||"#ff0000",enableEventHandlers:n.events?.enableEventHandlers??!0,enableKeyboardControls:n.events?.enableKeyboardControls??!0,enableClickToFocus:n.events?.enableClickToFocus??!0,enableDoubleClickZoom:n.events?.enableDoubleClickZoom??!0,onReady:n.events?.onReady,onFrame:n.events?.onFrame}}}function $S(n){let e=new av,t=typeof n.environment.backgroundColor=="string"?new at(n.environment.backgroundColor):n.environment.backgroundColor;return e.background=t||null,e}function JS(n,e,t,i,r=200){let s=n.position.clone(),a=e.target.clone(),o=performance.now(),l=u=>1-Math.pow(1-u,3),c=()=>{let u=performance.now()-o,h=l(Math.min(u/r,1));n.position.lerpVectors(s,t,h),e.target.lerpVectors(a,i,h),e.update(),h<1&&requestAnimationFrame(c)};requestAnimationFrame(c)}function QS(n,e,t,i,r,s){let a=null,o=performance.now(),l=()=>{let{width:u,height:h}=r();if(u===0||h===0)return;let f=Math.min(window.devicePixelRatio,2),p=Math.round(u*f),v=Math.round(h*f);(n.domElement.width!==p||n.domElement.height!==v)&&(n.setPixelRatio(f),n.setSize(u,h,!1),t.aspect=u/h,t.updateProjectionMatrix())},c=function(){a=requestAnimationFrame(c);let u=performance.now(),h=(u-o)/1e3;o=u,l(),(i.enableDamping||i.autoRotate)&&i.update(),s?.(h),n.render(e,t)};return{animate:c,dispose:()=>{a!==null&&(cancelAnimationFrame(a),a=null)}}}function ey(n,e){e.environment.enableEnvironmentLighting?new KS().load(e.environment.hdrPath||"/baseHDR.hdr",function(t){t.mapping=na,n.environment=t,e.environment.showEnvironment&&(n.background=t),e.events.onReady?.()},void 0,function(t){zt().warn("HDR texture could not be loaded, falling back to basic lighting:",t),e.events.onReady?.()}):e.events.onReady?.()}function ty(n,e){let t=new Nv(e.lighting.ambientLightColor,e.lighting.ambientLightIntensity);if(n.add(t),e.lighting.enableSunlight){let i=new Lv(e.lighting.sunlightColor??16777215,e.lighting.sunlightIntensity),r=e.lighting.sunlightPosition;if(r&&i.position.set(r.x,r.y,r.z),e.render.enableShadows){i.castShadow=!0;let s=Mo(e.sceneScale,.1,10,100);i.shadow.camera.left=-s,i.shadow.camera.right=s,i.shadow.camera.top=s,i.shadow.camera.bottom=-s;let a=Mo(e.sceneScale,.001,.1,.5),o=Mo(e.sceneScale,1,100,500);i.shadow.camera.near=a,i.shadow.camera.far=o,i.shadow.mapSize.width=e.render.shadowMapSize||2048,i.shadow.mapSize.height=e.render.shadowMapSize||2048,i.shadow.bias=-1e-4,i.shadow.normalBias=.02}n.add(i)}}function ny(n,e){let t=e.floor.size,i=new xs(t,t),r=typeof e.floor.color=="string"?new at(e.floor.color):e.floor.color,s=new Kh({color:r,roughness:e.floor.roughness,metalness:e.floor.metalness,side:In}),a=new rn(i,s);a.userData.id="floor",a.name="floor",a.rotation.x=-Math.PI/2,a.position.y=0,e.floor.receiveShadow&&e.render.enableShadows&&(a.receiveShadow=!0),n.add(a)}function iy(n,e){let t=e.parentElement,i=t?t.clientWidth:window.innerWidth,r=t?t.clientHeight:window.innerHeight,s=new Dn(n.camera.fov,i/r,n.camera.near,n.camera.far),a=n.camera.position;return a&&s.position.set(a.x,a.y,a.z),s}function ry(n,e){let t=new NS({antialias:e.render.antialias,canvas:n,alpha:!0,powerPreference:"high-performance",preserveDrawingBuffer:e.render.preserveDrawingBuffer,logarithmicDepthBuffer:!0}),i=n.parentElement,r=i?i.clientWidth:window.innerWidth,s=i?i.clientHeight:window.innerHeight;return i&&(n.style.width="100%",n.style.height="100%",n.style.display="block"),t.setSize(r,s,!1),t.setPixelRatio(e.render.pixelRatio||Math.min(window.devicePixelRatio,2)),e.render.enableShadows&&(t.shadowMap.enabled=!0,t.shadowMap.type=Er),t.toneMapping=e.render.toneMapping,t.toneMappingExposure=e.render.toneMappingExposure||1,t.outputColorSpace=wn,t.sortObjects=!0,t}function sy(n,e,t,i,r){let s=new Set,a=new Map,o=new Ov,l=new ht,c=new ht,u=x=>{let M=x;for(;M;){if(!M.visible)return!1;M=M.parent}return!0},h=()=>{let x=new _i;if(e.traverse(E=>{E.visible&&E.userData.id!=="floor"&&E instanceof rn&&x.expandByObject(E)}),x.isEmpty()){zt().warn("No objects to fit to view");return}let M=x.getCenter(new te),T=x.getSize(new te),C=Math.max(T.x,T.y,T.z),y=t.fov*(Math.PI/180),I=C/(2*Math.tan(y/2));I*=1.5;let _=t.position.clone().sub(i.target).normalize();t.position.copy(M.clone().add(_.multiplyScalar(I))),i.target.copy(M),i.update()},f=typeof r.events.selectionColor=="string"?new at(r.events.selectionColor):r.events.selectionColor instanceof at?r.events.selectionColor:new at("#ff0000"),p=()=>{s.forEach(x=>{x instanceof rn&&a.has(x)&&(x.material=a.get(x),a.delete(x))}),s.clear()},v=x=>{c.set(x.clientX,x.clientY)},S=x=>{let M=new ht(x.clientX,x.clientY);if(c.distanceTo(M)>5)return;let T=n.getBoundingClientRect();l.x=(x.clientX-T.left)/T.width*2-1,l.y=-((x.clientY-T.top)/T.height)*2+1,o.setFromCamera(l,t);let C=o.intersectObjects(e.children,!0).filter(y=>u(y.object));if(C.length>0){let y=C[0].object;if(!s.has(y)){if(p(),s.add(y),y instanceof rn&&y.material instanceof kr){a.set(y,y.material);let I=y.material.clone();I.emissive=f.clone(),y.material=I}r.events?.onObjectSelected?.(y),y instanceof rn&&Object.keys(y.userData).length>0&&r.events?.onMeshMetadataClicked?.(y.userData)}}else p(),r.events?.onBackgroundClicked?.({x:l.x,y:l.y})},g=x=>{let M=n.getBoundingClientRect();l.x=(x.clientX-M.left)/M.width*2-1,l.y=-((x.clientY-M.top)/M.height)*2+1,o.setFromCamera(l,t);let T=o.intersectObjects(e.children,!0).filter(H=>u(H.object));if(T.length===0)return;let C=T[0].object;if(r.events?.onMeshDoubleClicked?.(C),!r.events?.enableDoubleClickZoom)return;let y=new _i().setFromObject(C);if(y.isEmpty())return;let I=y.getCenter(new te),_=y.getSize(new te),E=Math.max(_.x,_.y,_.z),L=t.fov*(Math.PI/180),P=E/(2*Math.tan(L/2))*1.5,k=t.position.clone().sub(i.target).normalize(),W=I.clone().add(k.multiplyScalar(P));JS(t,i,W,I)},m=x=>{if(r.events?.enableKeyboardControls)switch(x.key.toLowerCase()){case"f":x.preventDefault(),h();break;case"escape":x.preventDefault(),p();break;case" ":x.preventDefault(),h();break}};return r.events?.enableClickToFocus&&(n.addEventListener("mousedown",v),n.addEventListener("click",S),n.addEventListener("dblclick",g)),r.events?.enableKeyboardControls&&(n.setAttribute("tabindex","0"),n.addEventListener("keydown",m)),{dispose:()=>{n.removeEventListener("mousedown",v),n.removeEventListener("click",S),n.removeEventListener("dblclick",g),n.removeEventListener("keydown",m),p()},fitToView:h,clearSelection:p}}function ay(n,e,t){let i=new FS(n,e),r=t.camera.target;return r&&i.target.set(r.x,r.y,r.z),i.enableDamping=t.controls.enableDamping||!1,i.dampingFactor=t.controls.dampingFactor||.05,i.autoRotate=t.controls.autoRotate||!1,i.autoRotateSpeed=t.controls.autoRotateSpeed||.5,i.enableZoom=t.controls.enableZoom??!0,i.enablePan=t.controls.enablePan??!0,i.minDistance=t.controls.minDistance||.001,i.maxDistance=t.controls.maxDistance||1/0,i.screenSpacePanning=!1,i.maxPolarAngle=Math.PI,i.update(),i}var Kn={HUGE_THRESHOLD:1e4,LARGE_THRESHOLD:1e3,SCALE_RATIO_THRESHOLD:100,NEAR_PLANE_FACTOR:{TINY:1e-4,SMALL:.001,NORMAL:.01},FAR_PLANE_FACTOR:{HUGE:100,LARGE:50,NORMAL:20},INITIAL_DISTANCE_MULTIPLIER:4};function lf(n,e,t,i,r){if(oy(n),e.length===0)return;e.forEach(c=>{n.add(c)});let s=Ic(e),a=s.getCenter(new te),o=s.getSize(new te),l=Math.max(o.x,o.y,o.z);if(l/Math.min(o.x||1,o.y||1,o.z||1)>Kn.SCALE_RATIO_THRESHOLD||l>Kn.HUGE_THRESHOLD?(t.near=l*Kn.NEAR_PLANE_FACTOR.TINY,t.far=l*Kn.FAR_PLANE_FACTOR.HUGE):l>Kn.LARGE_THRESHOLD?(t.near=l*Kn.NEAR_PLANE_FACTOR.SMALL,t.far=l*Kn.FAR_PLANE_FACTOR.LARGE):(t.near=Math.max(.01,l*Kn.NEAR_PLANE_FACTOR.NORMAL),t.far=Math.max(2e3,l*Kn.FAR_PLANE_FACTOR.NORMAL)),t.updateProjectionMatrix(),r)i.minDistance=t.near*2,i.maxDistance=t.far*.9;else{let c=l*Kn.INITIAL_DISTANCE_MULTIPLIER;t.position.set(a.x+c*.8,a.y+c,a.z+c*1.2),i.target.copy(a),i.minDistance=t.near*2,i.maxDistance=t.far*.9,i.update()}}function cf(n){if(!n||typeof n!="string")return zt().warn(`Invalid color input: ${n}, using white`),new at(16777215);let e=n.trim();if(/^#?[0-9A-Fa-f]{6}$/.test(e))try{let t=e.startsWith("#")?e:`#${e}`;return new at(t)}catch{return zt().warn(`Invalid hex color: ${n}, using white`),new at(16777215)}if(e.includes(",")){let t=e.split(",").map(i=>parseInt(i.trim(),10));if(t.length===3&&t.every(i=>!isNaN(i)&&i>=0&&i<=255))return new at(t[0]/255,t[1]/255,t[2]/255)}try{return new at(e.toLowerCase())}catch{return zt().warn(`Invalid color string: ${n}, using white`),new at(16777215)}}function uf(n,e){n.forEach(t=>{t.position.y-=e})}function Ic(n){let e=new _i;return n.length===0||n.forEach(t=>{t.updateMatrixWorld(!0);let i=new _i().setFromObject(t);e.union(i)}),e}function oy(n){[...n.children].forEach(e=>{e.userData.id!=="floor"&&(e.traverse(t=>{t instanceof rn&&(t.geometry?.dispose(),(Array.isArray(t.material)?t.material:[t.material]).forEach(i=>{for(let r of Object.values(i))r instanceof dn&&r.dispose();i.dispose()}))}),e.removeFromParent())})}var df={};ag(df,{CONCRETE_MATERIAL:()=>uy,EMISSIVE_MATERIAL:()=>ly,GLASS_MATERIAL:()=>hy,METAL_MATERIAL:()=>cy,PLASTIC_MATERIAL:()=>dy,RUBBER_MATERIAL:()=>fy,WOOD_MATERIAL:()=>py});var ly=new Vi({color:0,emissive:new at(16777215),emissiveIntensity:5,metalness:0,roughness:.2,clearcoat:.3,clearcoatRoughness:.2,depthWrite:!0,depthTest:!0,transparent:!1,alphaTest:0,polygonOffset:!0,side:Sn,dithering:!0}),cy=new Vi({color:new at(0),metalness:.9,roughness:.3,envMapIntensity:1.2,clearcoat:.3,clearcoatRoughness:.2,reflectivity:1,ior:2.5,thickness:1,depthWrite:!0,transparent:!1,alphaTest:0,depthTest:!0,polygonOffset:!0,side:Sn,dithering:!0}),uy=new Vi({color:new at(13421772),metalness:0,roughness:.92,envMapIntensity:.15,clearcoat:.05,clearcoatRoughness:.9,reflectivity:.15,transmission:0,ior:1.45,thickness:0,depthWrite:!0,transparent:!1,alphaTest:.5,depthTest:!0,polygonOffset:!0,side:Sn,dithering:!0}),dy=new Vi({color:new at(16777215),metalness:0,roughness:.3,envMapIntensity:.5,clearcoat:.5,clearcoatRoughness:.1,reflectivity:.5,ior:1.4,transmission:0,transparent:!1,depthWrite:!0,side:Sn,dithering:!0,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),hy=new Vi({color:new at(16777215),metalness:0,roughness:0,transmission:.95,transparent:!0,opacity:.3,envMapIntensity:1,clearcoat:1,clearcoatRoughness:0,ior:1.52,reflectivity:.9,thickness:1,side:In,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),fy=new Vi({color:new at(1710618),metalness:0,roughness:.9,envMapIntensity:.2,clearcoat:.1,clearcoatRoughness:.8,reflectivity:.2,ior:1.3,transmission:0,depthWrite:!0,side:Sn,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),py=new Vi({color:new at(8934707),metalness:0,roughness:.7,envMapIntensity:.3,clearcoat:.3,clearcoatRoughness:.4,reflectivity:.3,ior:1.3,transmission:0,depthWrite:!0,side:Sn,dithering:!0,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),Al=1096174675,Rl=1,Lc=1,Ed=12,wd=56;function Nc(n){let e=my(n),t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<Ed)throw ui("Blob too small to contain SLVA header.",{expectedBytes:Ed,availableBytes:e.byteLength});let i=0,r=t.getUint32(i,!0);if(i+=4,r!==Al)throw ui(`Invalid SLVA magic: 0x${r.toString(16)}`,{expectedMagic:`0x${Al.toString(16)}`,actualMagic:`0x${r.toString(16)}`});let s=t.getUint32(i,!0);if(i+=4,s!==Rl)throw ui(`Unsupported SLVA version: ${s}`,{expectedVersion:Rl,actualVersion:s});let a=t.getUint32(i,!0);if(i+=4,i+a>e.byteLength)throw ui("Insufficient data to read metadata JSON.",{expectedBytes:a,availableBytes:e.byteLength-i,offset:i});let o=e.subarray(i,i+a);i+=a;let l;try{l=JSON.parse(gy(o))}catch(E){throw ui(`Failed to parse metadata JSON: ${E instanceof Error?E.message:String(E)}`,{metadataLen:a})}if(i+wd>e.byteLength)throw ui("Insufficient data to read geometry header.",{expectedBytes:wd,availableBytes:e.byteLength-i,offset:i});let c=t.getUint32(i,!0);i+=4;let u=t.getFloat64(i,!0);i+=8;let h=t.getFloat64(i,!0);i+=8;let f=t.getFloat64(i,!0);i+=8;let p=t.getFloat64(i,!0);i+=8;let v=t.getFloat64(i,!0);i+=8;let S=t.getFloat64(i,!0);i+=8;let g=t.getUint32(i,!0);i+=4;let m=(c&Lc)!==0,x=g*3,M=x*(m?4:2);if(i+M>e.byteLength)throw ui("Insufficient data to read vertices.",{expectedBytes:M,availableBytes:e.byteLength-i,offset:i,useFloat32:m,vertexCount:g});let T=e.byteOffset+i,C=m?_y(e.buffer,T,x):vy(e.buffer,T,x);if(i+=M,i+4>e.byteLength)throw ui("Insufficient data to read index count.",{expectedBytes:4,availableBytes:e.byteLength-i,offset:i});let y=t.getUint32(i,!0);i+=4;let I=y*4;if(i+I>e.byteLength)throw ui("Insufficient data to read indices.",{expectedBytes:I,availableBytes:e.byteLength-i,offset:i,indexCount:y});let _=xy(e.buffer,e.byteOffset+i,y);return{metadata:l,flags:c,vertices:C,indices:_,origin:[u,h,f],scale:[p,v,S]}}function my(n){return typeof n=="string"?Mh(n):n instanceof Uint8Array?n:new Uint8Array(n)}function gy(n){if(typeof TextDecoder<"u")return new TextDecoder("utf-8").decode(n);if(typeof globalThis.Buffer<"u")return globalThis.Buffer.from(n).toString("utf-8");throw new Ui("No UTF-8 decoder available in this environment.",gi.INVALID_STATE)}function vy(n,e,t){if(t===0)return new Int16Array(0);if(e%2===0)return new Int16Array(n,e,t);let i=new Uint8Array(t*2);return i.set(new Uint8Array(n,e,t*2)),new Int16Array(i.buffer)}function _y(n,e,t){if(t===0)return new Float32Array(0);if(e%4===0)return new Float32Array(n,e,t);let i=new Uint8Array(t*4);return i.set(new Uint8Array(n,e,t*4)),new Float32Array(i.buffer)}function xy(n,e,t){if(t===0)return new Uint32Array(0);if(e%4===0)return new Uint32Array(n,e,t);let i=new Uint8Array(t*4);return i.set(new Uint8Array(n,e,t*4)),new Uint32Array(i.buffer)}function ui(n,e){return new Ui(n,gi.VALIDATION_ERROR,{context:e})}async function hf(n,e){let{mergeByMaterial:t=!0,applyTransforms:i=!0,debug:r=!1}=e??{},s=r?performance.now():0,a=0;try{let o=performance.now(),l=JSON.parse(n);return a=performance.now()-o,await ff(l,{mergeByMaterial:t,applyTransforms:i,debug:r,parseTime:a,perfStart:s})}catch(o){return zt().error("Error parsing mesh batch:",o),[]}}async function ff(n,e){let{mergeByMaterial:t=!0,applyTransforms:i=!0,scaleFactor:r=1,debug:s=!1,parseTime:a=0,perfStart:o=s?performance.now():0}=e??{};try{let l=performance.now(),c=Nc(n.compressedData),u=performance.now()-l,h=s?Ty(n.compressedData):0;return pf(c,{mergeByMaterial:t,applyTransforms:i,scaleFactor:r,debug:s,parseTime:a,decodeTime:u,perfStart:o,blobBytes:h,fallback:{materials:n.materials,groups:n.groups,sourceComponentId:n.sourceComponentId}})}catch(l){return zt().error("Error parsing mesh batch object:",l),[]}}async function by(n,e){let{mergeByMaterial:t=!0,applyTransforms:i=!0,scaleFactor:r=1,debug:s=!1}=e??{},a=s?performance.now():0;try{let o=performance.now(),l=Nc(n),c=performance.now()-o,u=(n instanceof Uint8Array,n.byteLength);return pf(l,{mergeByMaterial:t,applyTransforms:i,scaleFactor:r,debug:s,parseTime:0,decodeTime:c,perfStart:a,blobBytes:u})}catch(o){return zt().error("Error parsing mesh batch blob:",o),[]}}function pf(n,e){let{mergeByMaterial:t,applyTransforms:i,scaleFactor:r,debug:s,parseTime:a,decodeTime:o,perfStart:l,blobBytes:c,fallback:u}=e,h=n.metadata.materials??u?.materials??[],f=n.metadata.groups??u?.groups??[],p=n.metadata.sourceComponentId??u?.sourceComponentId,v=(n.flags&Lc)!==0,S=v?yy(n.vertices,i):Sy(n.vertices,n.origin,n.scale,i);if(s){let T=n.vertices.byteLength+n.indices.byteLength;zt().debug("Mesh Batch Stats:"),zt().debug(` Materials: ${h.length} | Groups: ${f.length}`),zt().debug(` Vertices: ${n.vertices.length/3} | Indices: ${n.indices.length}`),zt().debug(` Format: ${v?"float32":"int16 quantized"}`),zt().debug(` Blob: ${(c/1024/1024).toFixed(2)} MB | Geometry on wire: ${(T/1024/1024).toFixed(2)} MB`)}let g=performance.now(),m=h.map(My),x=[];for(let T of f)if(t&&T.meshes.length>1){let C=Ey(T,S,n.indices,m);C.userData.sourceComponentId=p??null,x.push(C)}else{let C=wy(T,S,n.indices,m);for(let y of C)y.userData.sourceComponentId=p??null;x.push(...C)}if(r!==1)for(let T of x)T.scale.set(r,r,r);let M=performance.now()-g;if(s){let T=performance.now()-l;zt().debug("Performance:"),a>0&&zt().debug(` Parse JSON: ${a.toFixed(2)}ms`),zt().debug(` Decode binary: ${o.toFixed(2)}ms`),zt().debug(` Create Meshes: ${M.toFixed(2)}ms`),zt().debug(` Total: ${T.toFixed(2)}ms`)}return Promise.resolve(x)}function Sy(n,e,t,i){let r=new Float32Array(n.length),s=e[0],a=e[1],o=e[2],l=t[0],c=t[1],u=t[2];if(i)for(let h=0;h<n.length;h+=3){let f=s+(n[h]+32767)*l,p=a+(n[h+1]+32767)*c,v=o+(n[h+2]+32767)*u;r[h]=f,r[h+1]=v,r[h+2]=-p}else for(let h=0;h<n.length;h+=3)r[h]=s+(n[h]+32767)*l,r[h+1]=a+(n[h+1]+32767)*c,r[h+2]=o+(n[h+2]+32767)*u;return r}function yy(n,e){if(!e)return n;let t=new Float32Array(n.length);for(let i=0;i<n.length;i+=3){let r=n[i],s=n[i+1],a=n[i+2];t[i]=r,t[i+1]=a,t[i+2]=-s}return t}function My(n){let e=cf(n.color);return new Vi({color:e,metalness:n.metalness,roughness:n.roughness,opacity:n.opacity,transparent:n.transparent,side:In,polygonOffset:!0,polygonOffsetFactor:.5,polygonOffsetUnits:.5,depthWrite:!0,depthTest:!0})}function Ey(n,e,t,i){let r=0,s=0;for(let v of n.meshes)r+=v.vertexCount,s+=v.indexCount;let a=new Float32Array(r*3),o=new Uint32Array(s),l=0,c=0;for(let v of n.meshes){let S=v.vertexStart*3,g=v.vertexCount*3;a.set(e.subarray(S,S+g),l*3);let m=t.subarray(v.indexStart,v.indexStart+v.indexCount),x=l-v.vertexStart;if(x===0)o.set(m,c);else for(let M=0;M<m.length;M++)o[c+M]=m[M]+x;l+=v.vertexCount,c+=v.indexCount}let u=new Wn;u.setAttribute("position",new bn(a,3)),u.setIndex(new bn(o,1)),u.computeVertexNormals();let h=new rn(u,i[n.materialId]),f=n.meshes[0],p=n.meshes.map(v=>v.name).filter(v=>v&&v.length>0);return h.name=p.length>0?p[0]:`merged_material_${n.materialId}`,h.castShadow=!0,h.receiveShadow=!0,h.userData={name:h.name,layer:f?.layer??"",originalIndex:f?.originalIndex??0,metadata:f?.metadata??{},mergedFrom:n.meshes.slice(1).map(v=>({name:v.name,layer:v.layer,originalIndex:v.originalIndex}))},h}function wy(n,e,t,i){let r=[];for(let s of n.meshes){let a=s.vertexStart*3,o=s.vertexCount*3,l=e.slice(a,a+o),c=t.subarray(s.indexStart,s.indexStart+s.indexCount),u=new Uint32Array(c.length),h=s.vertexStart;for(let v=0;v<c.length;v++)u[v]=c[v]-h;let f=new Wn;f.setAttribute("position",new bn(l,3)),f.setIndex(new bn(u,1)),f.computeVertexNormals();let p=new rn(f,i[n.materialId]);p.name=s.name,p.userData={name:s.name,layer:s.layer??"",originalIndex:s.originalIndex,metadata:s.metadata??{}},p.castShadow=!0,p.receiveShadow=!0,r.push(p)}return r}function Ty(n){return Math.floor(n.length*3/4)}var mf={Millimeters:1/1e3,Centimeters:1/100,Meters:1,Inches:1/39.37,Feet:1/3.28084},Ay="Display";async function Ry(n,e){let t=performance.now(),i=[],{allowScaling:r=!0,allowAutoPosition:s=!0,debug:a=!1,parsing:o={}}=e??{};try{let l=r?Cy(n.modelunits):1;return await Py(n,i,l,o,a),s&&Iy(i),i}catch(l){throw Ly(l,i),l}finally{a&&Uy(t)}}function Cy(n){return mf[n]??1}async function Py(n,e,t,i,r){for(let s of n.values){let a=s.InnerTree;for(let o in a){let l=a[o];l&&await Dy(l,e,t,i,r)}}}async function Dy(n,e,t,i,r){for(let s of n)if(s.type.includes(Ay)){let a={mergeByMaterial:!0,applyTransforms:!0,debug:!1,...i},o=await hf(s.data,a);if(t!==1)for(let l of o)l.scale.set(t,t,t);e.push(...o),r&&zt().debug(`Extracted ${o.length} meshes from batch`)}}function Iy(n){if(n.length===0)return;let e=Ic(n).min.y;uf(n,e)}function Ly(n,e){zt().error("An unexpected error occurred:",n),Ny(e)}function Ny(n){for(let e of n)e.geometry&&e.geometry.dispose(),e.material&&(Array.isArray(e.material)?e.material.forEach(t=>t.dispose()):e.material.dispose())}function Uy(n){let e=performance.now()-n;zt().info("Time to process meshes:",`${e.toFixed(2)}ms`)}var Fy=Z('<button aria-label="Clear search"><!></button>'),Oy=Z('<div role="option" tabindex="-1"><button class="rounded p-1 shrink-0 transition-colors hover:bg-muted"><!></button> <span> </span> <span class="rounded px-1 py-0.5 font-medium shrink-0 bg-muted text-[9px] text-muted-foreground/70"> </span></div>'),By=Z('<div role="listbox" aria-multiselectable="true" class="ml-3 border-l border-border svelte-reaknn"></div>'),zy=Z('<div class="gap-1 pl-1 pr-2 py-1 group flex items-center transition-colors hover:bg-muted svelte-reaknn"><button class="rounded p-0.5 shrink-0 text-muted-foreground transition-colors hover:text-muted-foreground"><!></button> <button class="rounded p-1 shrink-0 transition-colors hover:bg-muted"><!></button> <span> </span> <span class="shrink-0 text-[10px] text-muted-foreground/50 tabular-nums"> </span></div> <!>',1),ky=Z('<div class="py-12 flex flex-col items-center justify-center text-center svelte-reaknn"><!> <p class="text-xs text-muted-foreground">No objects</p></div>'),Vy=Z('<div class="py-12 flex flex-col items-center justify-center text-center svelte-reaknn"><!> <p class="text-xs text-muted-foreground"> </p></div>'),Hy=Z('<div class="flex h-full flex-col bg-card text-card-foreground svelte-reaknn"><div class="px-3 py-2 gap-2 flex items-center border-b border-border svelte-reaknn"><!> <input class="min-w-0 text-xs flex-1 bg-transparent text-foreground outline-none placeholder:text-muted-foreground/50" placeholder="Search objects..."/> <!></div> <div class="py-1 flex-1 overflow-y-auto svelte-reaknn"><!> <!></div></div>');function Gy(n,e){nt(e,!0);let t=me(e,"sceneVersion",3,0);const i=()=>(t(),e.scene.children.filter(U=>!(U instanceof Cc)&&!(U instanceof Rc))),r=()=>{const U=i(),X=new pa;for(const V of U){const $=V.userData?.layer||V.userData?.category||"Default";X.has($)||X.set($,[]),X.get($).push(V)}return X};let s=new is,a=new is;const o=(U,X)=>{U.visible=X,U.traverse(V=>{V.visible=X}),X?s.delete(U.uuid):s.add(U.uuid)},l=U=>{if(x.has(U.uuid)&&x.size>1){const V=i().filter(ee=>x.has(ee.uuid)),$=V.every(ee=>s.has(ee.uuid));for(const ee of V)o(ee,$)}else o(U,s.has(U.uuid))},c=U=>U.every(X=>s.has(X.uuid)),u=U=>{const X=U.filter(V=>s.has(V.uuid)).length;return X>0&&X<U.length},h=(U,X)=>{const V=c(X);for(const $ of X)o($,V)},f=U=>{a.has(U)?a.delete(U):a.add(U)},p=U=>U.userData?.name||U.userData?.fileName||U.name||U.type,v=U=>U.type.replace("Mesh","").replace("Object3D","Obj")||U.type;let S=we("");const g=()=>{const U=r();if(!d(S).trim())return U;const X=d(S).toLowerCase(),V=new pa;for(const[$,ee]of U){const Se=$.toLowerCase().includes(X)?ee:ee.filter(ye=>p(ye).toLowerCase().includes(X));Se.length>0&&V.set($,Se)}return V},m=()=>{const U=[];for(const[X,V]of g())if(!a.has(X))for(const $ of V)U.push($.uuid);return U};let x=new is,M=we(null);const T=(U,X)=>{if(X.shiftKey&&d(M)){const V=m(),$=V.indexOf(d(M)),ee=V.indexOf(U);if($!==-1&&ee!==-1){const[Se,ye]=$<ee?[$,ee]:[ee,$];!X.ctrlKey&&!X.metaKey&&x.clear();for(let ve=Se;ve<=ye;ve++)x.add(V[ve])}}else X.ctrlKey||X.metaKey?x.has(U)?x.delete(U):(x.add(U),O(M,U,!0)):(x.clear(),x.add(U),O(M,U,!0));X.shiftKey||O(M,U,!0)};var C=Hy(),y=Q(C),I=Q(y);hu(I,{class:"h-3.5 w-3.5 shrink-0 text-muted-foreground/50"});var _=ue(I,2);kl(_);var E=ue(_,2);{var L=U=>{var X=Fy(),V=Q(X);Ap(V,{class:"h-3.5 w-3.5 text-muted-foreground/50 transition-colors hover:text-muted-foreground"}),q(X),Lt("click",X,()=>O(S,"")),D(U,X)};_e(E,U=>{d(S)&&U(L)})}q(y);var P=ue(y,2),k=Q(P);Ht(k,17,()=>[...g()],([U,X])=>U,(U,X)=>{var V=z(()=>$i(d(X),2));let $=()=>d(V)[0],ee=()=>d(V)[1];const Se=z(()=>c(ee())),ye=z(()=>u(ee())),ve=z(()=>a.has($()));var K=zy(),fe=ae(K),Y=Q(fe),oe=Q(Y);{let De=z(()=>d(ve)?"":"rotate-90");eh(oe,{get class(){return`h-3.5 w-3.5 transition-transform duration-150 ${d(De)??""}`}})}q(Y);var Me=ue(Y,2),Ee=Q(Me);{var Ge=De=>{Va(De,{class:"h-3.5 w-3.5 text-muted-foreground/40"})},Te=De=>{Ha(De,{class:"h-3.5 w-3.5 text-muted-foreground/60"})},Ve=De=>{Ha(De,{class:"h-3.5 w-3.5 text-muted-foreground"})};_e(Ee,De=>{d(Se)?De(Ge):d(ye)?De(Te,1):De(Ve,-1)})}q(Me);var Ae=ue(Me,2),Ce=Q(Ae,!0);q(Ae);var Oe=ue(Ae,2),Be=Q(Oe,!0);q(Oe),q(fe);var He=ue(fe,2);{var B=De=>{var pe=By();Ht(pe,21,ee,Ne=>Ne.uuid,(Ne,ce)=>{const je=z(()=>s.has(d(ce).uuid)),w=z(()=>x.has(d(ce).uuid));var b=Oy(),G=Q(b),ne=Q(G);{var de=Ie=>{Va(Ie,{class:"h-3 w-3 text-muted-foreground/60"})},he=Ie=>{Ha(Ie,{class:"h-3 w-3 text-muted-foreground"})};_e(ne,Ie=>{d(je)?Ie(de):Ie(he,-1)})}q(G);var xe=ue(G,2),ie=Q(xe,!0);q(xe);var ge=ue(xe,2),Ue=Q(ge,!0);q(ge),q(b),Le((Ie,ke)=>{Vt(b,"aria-selected",d(w)),At(b,1,`gap-1.5 pl-5 pr-2 py-0.5 flex cursor-pointer items-center transition-colors
|
|
4108
|
+
`;continue}if((R=N.match(L))&&(H.gamma=parseFloat(R[1])),(R=N.match(P))&&(H.exposure=parseFloat(R[1])),(R=N.match(k))&&(H.valid|=2,H.format=R[1]),(R=N.match(W))&&(H.valid|=4,H.height=parseInt(R[1],10),H.width=parseInt(R[2],10)),H.valid&2&&H.valid&4)break}return H.valid&2||a(3,"missing format specifier"),H.valid&4||a(3,"missing image size specifier"),H},p=function(_,E,L){const P=E;if(P<8||P>32767||_[0]!==2||_[1]!==2||_[2]&128)return new Uint8Array(_);P!==(_[2]<<8|_[3])&&a(3,"wrong scanline width");const k=new Uint8Array(4*E*L);k.length||a(4,"unable to allocate buffer space");let W=0,H=0;const N=4*P,R=new Uint8Array(4),F=new Uint8Array(N);let U=L;for(;U>0&&H<_.byteLength;){H+4>_.byteLength&&a(1),R[0]=_[H++],R[1]=_[H++],R[2]=_[H++],R[3]=_[H++],(R[0]!=2||R[1]!=2||(R[2]<<8|R[3])!=P)&&a(3,"bad rgbe scanline format");let X=0,V;for(;X<N&&H<_.byteLength;){V=_[H++];const ee=V>128;if(ee&&(V-=128),(V===0||X+V>N)&&a(3,"bad scanline data"),ee){const Se=_[H++];for(let ye=0;ye<V;ye++)F[X++]=Se}else F.set(_.subarray(H,H+V),X),X+=V,H+=V}const $=P;for(let ee=0;ee<$;ee++){let Se=0;k[W]=F[ee+Se],Se+=P,k[W+1]=F[ee+Se],Se+=P,k[W+2]=F[ee+Se],Se+=P,k[W+3]=F[ee+Se],W+=4}U--}return k},v=function(_,E,L,P){const k=_[E+3],W=Math.pow(2,k-128)/255;L[P+0]=_[E+0]*W,L[P+1]=_[E+1]*W,L[P+2]=_[E+2]*W,L[P+3]=1},S=function(_,E,L,P){const k=_[E+3],W=Math.pow(2,k-128)/255;L[P+0]=Ls.toHalfFloat(Math.min(_[E+0]*W,65504)),L[P+1]=Ls.toHalfFloat(Math.min(_[E+1]*W,65504)),L[P+2]=Ls.toHalfFloat(Math.min(_[E+2]*W,65504)),L[P+3]=Ls.toHalfFloat(1)},g=new Uint8Array(e);g.pos=0;const m=f(g),x=m.width,M=m.height,T=p(g.subarray(g.pos),x,M);let C,y,I;switch(this.type){case An:I=T.length/4;const _=new Float32Array(I*4);for(let L=0;L<I;L++)v(T,L*4,_,L*4);C=_,y=An;break;case Rn:I=T.length/4;const E=new Uint16Array(I*4);for(let L=0;L<I;L++)S(T,L*4,E,L*4);C=E,y=Rn;break;default:throw new Error("THREE.HDRLoader: Unsupported type: "+this.type)}return{width:x,height:M,data:C,header:m.string,gamma:m.gamma,exposure:m.exposure,type:y}}setDataType(e){return this.type=e,this}load(e,t,i,r){function s(a,o){switch(a.type){case An:case Rn:a.colorSpace=cs,a.minFilter=Zt,a.magFilter=Zt,a.generateMipmaps=!1,a.flipY=!0;break}t&&t(a,o)}return super.load(e,s,i,r)}}var af=new te(0,0,1),Mo=(n,e,t,i)=>{switch(n){case"mm":return e;case"cm":return t;default:return i}},of=function(n,e){let t=ZS(e||{}),i=$S(t),r=iy(t,n),s=ry(n,t),a=ay(r,n,t);ey(i,t),ty(i,t),t.floor?.enabled&&ny(i,t);let o=t.events.enableEventHandlers!==!1?sy(n,i,r,a,t):{dispose:()=>{},fitToView:()=>{},clearSelection:()=>{}},l=n.parentElement,c=()=>l?{width:l.clientWidth,height:l.clientHeight}:{width:window.innerWidth,height:window.innerHeight},{animate:u,dispose:h}=QS(s,i,r,a,c,t.events.onFrame);u();let f=t.environment?.sceneUp||af;return i.up.set(f.x,f.y,f.z),{scene:i,camera:r,controls:a,renderer:s,dispose:()=>{h(),o.dispose(),a.dispose(),s.dispose(),i.traverse(p=>{p instanceof rn&&(p.geometry?.dispose(),Array.isArray(p.material)?p.material.forEach(v=>v.dispose()):p.material?.dispose())})},fitToView:o.fitToView,clearSelection:o.clearSelection}};function ZS(n){let e=n.sceneScale||"m",t={mm:{cameraDistance:20,near:.1,far:2e3,floorSize:100,lightDistance:10,lightHeight:20,minDistance:.1,shadowSize:100,scaleFactor:1e3},cm:{cameraDistance:20,near:.1,far:2e3,floorSize:100,lightDistance:25,lightHeight:50,minDistance:.1,shadowSize:100,scaleFactor:100},m:{cameraDistance:10,near:.01,far:2e3,floorSize:50,lightDistance:25,lightHeight:50,minDistance:.001,shadowSize:100,scaleFactor:1},inches:{cameraDistance:15,near:.1,far:2e3,floorSize:80,lightDistance:20,lightHeight:40,minDistance:.1,shadowSize:80,scaleFactor:39.37},feet:{cameraDistance:8,near:.1,far:2e3,floorSize:40,lightDistance:15,lightHeight:30,minDistance:.1,shadowSize:60,scaleFactor:3.28084}}[e];return{sceneScale:e,camera:{position:n.camera?.position||new te(-t.cameraDistance,t.cameraDistance,t.cameraDistance),fov:n.camera?.fov||20,near:n.camera?.near||t.near,far:n.camera?.far||t.far,target:n.camera?.target||new te(0,0,0)},lighting:{enableSunlight:n.lighting?.enableSunlight??!0,sunlightIntensity:n.lighting?.sunlightIntensity||1,sunlightPosition:n.lighting?.sunlightPosition||new te(t.lightDistance,t.lightHeight,t.lightDistance),ambientLightColor:n.lighting?.ambientLightColor||new at(4210752),ambientLightIntensity:n.lighting?.ambientLightIntensity||1,sunlightColor:n.lighting?.sunlightColor||16777215},environment:{hdrPath:n.environment?.hdrPath||"/baseHDR.hdr",backgroundColor:n.environment?.backgroundColor||new at(15790320),enableEnvironmentLighting:n.environment?.enableEnvironmentLighting??!0,sceneUp:n.environment?.sceneUp||af,showEnvironment:n.environment?.showEnvironment??!1},floor:{enabled:n.floor?.enabled??!1,size:n.floor?.size||t.floorSize,color:n.floor?.color||new at(8421504),roughness:n.floor?.roughness||.7,metalness:n.floor?.metalness||0,receiveShadow:n.floor?.receiveShadow??!0},render:{enableShadows:n.render?.enableShadows??!0,shadowMapSize:n.render?.shadowMapSize||2048,antialias:n.render?.antialias??!0,pixelRatio:n.render?.pixelRatio||Math.min(window.devicePixelRatio,2),toneMapping:n.render?.toneMapping||fc,toneMappingExposure:n.render?.toneMappingExposure||1,preserveDrawingBuffer:n.render?.preserveDrawingBuffer??!1},controls:{enableDamping:n.controls?.enableDamping??!1,dampingFactor:n.controls?.dampingFactor||.05,autoRotate:n.controls?.autoRotate??!1,autoRotateSpeed:n.controls?.autoRotateSpeed||.5,enableZoom:n.controls?.enableZoom??!0,enablePan:n.controls?.enablePan??!0,minDistance:n.controls?.minDistance||t.minDistance,maxDistance:n.controls?.maxDistance||1/0},events:{onBackgroundClicked:n.events?.onBackgroundClicked,onObjectSelected:n.events?.onObjectSelected,onMeshMetadataClicked:n.events?.onMeshMetadataClicked,onMeshDoubleClicked:n.events?.onMeshDoubleClicked,selectionColor:n.events?.selectionColor||"#ff0000",enableEventHandlers:n.events?.enableEventHandlers??!0,enableKeyboardControls:n.events?.enableKeyboardControls??!0,enableClickToFocus:n.events?.enableClickToFocus??!0,enableDoubleClickZoom:n.events?.enableDoubleClickZoom??!0,onReady:n.events?.onReady,onFrame:n.events?.onFrame}}}function $S(n){let e=new av,t=typeof n.environment.backgroundColor=="string"?new at(n.environment.backgroundColor):n.environment.backgroundColor;return e.background=t||null,e}function JS(n,e,t,i,r=200){let s=n.position.clone(),a=e.target.clone(),o=performance.now(),l=u=>1-Math.pow(1-u,3),c=()=>{let u=performance.now()-o,h=l(Math.min(u/r,1));n.position.lerpVectors(s,t,h),e.target.lerpVectors(a,i,h),e.update(),h<1&&requestAnimationFrame(c)};requestAnimationFrame(c)}function QS(n,e,t,i,r,s){let a=null,o=performance.now(),l=()=>{let{width:u,height:h}=r();if(u===0||h===0)return;let f=Math.min(window.devicePixelRatio,2),p=Math.round(u*f),v=Math.round(h*f);(n.domElement.width!==p||n.domElement.height!==v)&&(n.setPixelRatio(f),n.setSize(u,h,!1),t.aspect=u/h,t.updateProjectionMatrix())},c=function(){a=requestAnimationFrame(c);let u=performance.now(),h=(u-o)/1e3;o=u,l(),(i.enableDamping||i.autoRotate)&&i.update(),s?.(h),n.render(e,t)};return{animate:c,dispose:()=>{a!==null&&(cancelAnimationFrame(a),a=null)}}}function ey(n,e){e.environment.enableEnvironmentLighting?new KS().load(e.environment.hdrPath||"/baseHDR.hdr",function(t){t.mapping=na,n.environment=t,e.environment.showEnvironment&&(n.background=t),e.events.onReady?.()},void 0,function(t){zt().warn("HDR texture could not be loaded, falling back to basic lighting:",t),e.events.onReady?.()}):e.events.onReady?.()}function ty(n,e){let t=new Nv(e.lighting.ambientLightColor,e.lighting.ambientLightIntensity);if(n.add(t),e.lighting.enableSunlight){let i=new Lv(e.lighting.sunlightColor??16777215,e.lighting.sunlightIntensity),r=e.lighting.sunlightPosition;if(r&&i.position.set(r.x,r.y,r.z),e.render.enableShadows){i.castShadow=!0;let s=Mo(e.sceneScale,.1,10,100);i.shadow.camera.left=-s,i.shadow.camera.right=s,i.shadow.camera.top=s,i.shadow.camera.bottom=-s;let a=Mo(e.sceneScale,.001,.1,.5),o=Mo(e.sceneScale,1,100,500);i.shadow.camera.near=a,i.shadow.camera.far=o,i.shadow.mapSize.width=e.render.shadowMapSize||2048,i.shadow.mapSize.height=e.render.shadowMapSize||2048,i.shadow.bias=-1e-4,i.shadow.normalBias=.02}n.add(i)}}function ny(n,e){let t=e.floor.size,i=new xs(t,t),r=typeof e.floor.color=="string"?new at(e.floor.color):e.floor.color,s=new Kh({color:r,roughness:e.floor.roughness,metalness:e.floor.metalness,side:In}),a=new rn(i,s);a.userData.id="floor",a.name="floor",a.rotation.x=-Math.PI/2,a.position.y=0,e.floor.receiveShadow&&e.render.enableShadows&&(a.receiveShadow=!0),n.add(a)}function iy(n,e){let t=e.parentElement,i=t?t.clientWidth:window.innerWidth,r=t?t.clientHeight:window.innerHeight,s=new Dn(n.camera.fov,i/r,n.camera.near,n.camera.far),a=n.camera.position;return a&&s.position.set(a.x,a.y,a.z),s}function ry(n,e){let t=new NS({antialias:e.render.antialias,canvas:n,alpha:!0,powerPreference:"high-performance",preserveDrawingBuffer:e.render.preserveDrawingBuffer,logarithmicDepthBuffer:!0}),i=n.parentElement,r=i?i.clientWidth:window.innerWidth,s=i?i.clientHeight:window.innerHeight;return i&&(n.style.width="100%",n.style.height="100%",n.style.display="block"),t.setSize(r,s,!1),t.setPixelRatio(e.render.pixelRatio||Math.min(window.devicePixelRatio,2)),e.render.enableShadows&&(t.shadowMap.enabled=!0,t.shadowMap.type=Er),t.toneMapping=e.render.toneMapping,t.toneMappingExposure=e.render.toneMappingExposure||1,t.outputColorSpace=wn,t.sortObjects=!0,t}function sy(n,e,t,i,r){let s=new Set,a=new Map,o=new Ov,l=new ht,c=new ht,u=x=>{let M=x;for(;M;){if(!M.visible)return!1;M=M.parent}return!0},h=()=>{let x=new _i;if(e.traverse(E=>{E.visible&&E.userData.id!=="floor"&&E instanceof rn&&x.expandByObject(E)}),x.isEmpty()){zt().warn("No objects to fit to view");return}let M=x.getCenter(new te),T=x.getSize(new te),C=Math.max(T.x,T.y,T.z),y=t.fov*(Math.PI/180),I=C/(2*Math.tan(y/2));I*=1.5;let _=t.position.clone().sub(i.target).normalize();t.position.copy(M.clone().add(_.multiplyScalar(I))),i.target.copy(M),i.update()},f=typeof r.events.selectionColor=="string"?new at(r.events.selectionColor):r.events.selectionColor instanceof at?r.events.selectionColor:new at("#ff0000"),p=()=>{s.forEach(x=>{x instanceof rn&&a.has(x)&&(x.material=a.get(x),a.delete(x))}),s.clear()},v=x=>{c.set(x.clientX,x.clientY)},S=x=>{let M=new ht(x.clientX,x.clientY);if(c.distanceTo(M)>5)return;let T=n.getBoundingClientRect();l.x=(x.clientX-T.left)/T.width*2-1,l.y=-((x.clientY-T.top)/T.height)*2+1,o.setFromCamera(l,t);let C=o.intersectObjects(e.children,!0).filter(y=>u(y.object));if(C.length>0){let y=C[0].object;if(!s.has(y)){if(p(),s.add(y),y instanceof rn&&y.material instanceof kr){a.set(y,y.material);let I=y.material.clone();I.emissive=f.clone(),y.material=I}r.events?.onObjectSelected?.(y),y instanceof rn&&Object.keys(y.userData).length>0&&r.events?.onMeshMetadataClicked?.(y.userData)}}else p(),r.events?.onBackgroundClicked?.({x:l.x,y:l.y})},g=x=>{let M=n.getBoundingClientRect();l.x=(x.clientX-M.left)/M.width*2-1,l.y=-((x.clientY-M.top)/M.height)*2+1,o.setFromCamera(l,t);let T=o.intersectObjects(e.children,!0).filter(H=>u(H.object));if(T.length===0)return;let C=T[0].object;if(r.events?.onMeshDoubleClicked?.(C),!r.events?.enableDoubleClickZoom)return;let y=new _i().setFromObject(C);if(y.isEmpty())return;let I=y.getCenter(new te),_=y.getSize(new te),E=Math.max(_.x,_.y,_.z),L=t.fov*(Math.PI/180),P=E/(2*Math.tan(L/2))*1.5,k=t.position.clone().sub(i.target).normalize(),W=I.clone().add(k.multiplyScalar(P));JS(t,i,W,I)},m=x=>{if(r.events?.enableKeyboardControls)switch(x.key.toLowerCase()){case"f":x.preventDefault(),h();break;case"escape":x.preventDefault(),p();break;case" ":x.preventDefault(),h();break}};return r.events?.enableClickToFocus&&(n.addEventListener("mousedown",v),n.addEventListener("click",S),n.addEventListener("dblclick",g)),r.events?.enableKeyboardControls&&(n.setAttribute("tabindex","0"),n.addEventListener("keydown",m)),{dispose:()=>{n.removeEventListener("mousedown",v),n.removeEventListener("click",S),n.removeEventListener("dblclick",g),n.removeEventListener("keydown",m),p()},fitToView:h,clearSelection:p}}function ay(n,e,t){let i=new FS(n,e),r=t.camera.target;return r&&i.target.set(r.x,r.y,r.z),i.enableDamping=t.controls.enableDamping||!1,i.dampingFactor=t.controls.dampingFactor||.05,i.autoRotate=t.controls.autoRotate||!1,i.autoRotateSpeed=t.controls.autoRotateSpeed||.5,i.enableZoom=t.controls.enableZoom??!0,i.enablePan=t.controls.enablePan??!0,i.minDistance=t.controls.minDistance||.001,i.maxDistance=t.controls.maxDistance||1/0,i.screenSpacePanning=!1,i.maxPolarAngle=Math.PI,i.update(),i}var Kn={HUGE_THRESHOLD:1e4,LARGE_THRESHOLD:1e3,SCALE_RATIO_THRESHOLD:100,NEAR_PLANE_FACTOR:{TINY:1e-4,SMALL:.001,NORMAL:.01},FAR_PLANE_FACTOR:{HUGE:100,LARGE:50,NORMAL:20},INITIAL_DISTANCE_MULTIPLIER:4};function lf(n,e,t,i,r){if(oy(n),e.length===0)return;e.forEach(c=>{n.add(c)});let s=Ic(e),a=s.getCenter(new te),o=s.getSize(new te),l=Math.max(o.x,o.y,o.z);if(l/Math.min(o.x||1,o.y||1,o.z||1)>Kn.SCALE_RATIO_THRESHOLD||l>Kn.HUGE_THRESHOLD?(t.near=l*Kn.NEAR_PLANE_FACTOR.TINY,t.far=l*Kn.FAR_PLANE_FACTOR.HUGE):l>Kn.LARGE_THRESHOLD?(t.near=l*Kn.NEAR_PLANE_FACTOR.SMALL,t.far=l*Kn.FAR_PLANE_FACTOR.LARGE):(t.near=Math.max(.01,l*Kn.NEAR_PLANE_FACTOR.NORMAL),t.far=Math.max(2e3,l*Kn.FAR_PLANE_FACTOR.NORMAL)),t.updateProjectionMatrix(),r)i.minDistance=t.near*2,i.maxDistance=t.far*.9;else{let c=l*Kn.INITIAL_DISTANCE_MULTIPLIER;t.position.set(a.x+c*.8,a.y+c,a.z+c*1.2),i.target.copy(a),i.minDistance=t.near*2,i.maxDistance=t.far*.9,i.update()}}function cf(n){if(!n||typeof n!="string")return zt().warn(`Invalid color input: ${n}, using white`),new at(16777215);let e=n.trim();if(/^#?[0-9A-Fa-f]{6}$/.test(e))try{let t=e.startsWith("#")?e:`#${e}`;return new at(t)}catch{return zt().warn(`Invalid hex color: ${n}, using white`),new at(16777215)}if(e.includes(",")){let t=e.split(",").map(i=>parseInt(i.trim(),10));if(t.length===3&&t.every(i=>!isNaN(i)&&i>=0&&i<=255))return new at(t[0]/255,t[1]/255,t[2]/255)}try{return new at(e.toLowerCase())}catch{return zt().warn(`Invalid color string: ${n}, using white`),new at(16777215)}}function uf(n,e){n.forEach(t=>{t.position.y-=e})}function Ic(n){let e=new _i;return n.length===0||n.forEach(t=>{t.updateMatrixWorld(!0);let i=new _i().setFromObject(t);e.union(i)}),e}function oy(n){[...n.children].forEach(e=>{e.userData.id!=="floor"&&(e.traverse(t=>{t instanceof rn&&(t.geometry?.dispose(),(Array.isArray(t.material)?t.material:[t.material]).forEach(i=>{for(let r of Object.values(i))r instanceof dn&&r.dispose();i.dispose()}))}),e.removeFromParent())})}var df={};ag(df,{CONCRETE_MATERIAL:()=>uy,EMISSIVE_MATERIAL:()=>ly,GLASS_MATERIAL:()=>hy,METAL_MATERIAL:()=>cy,PLASTIC_MATERIAL:()=>dy,RUBBER_MATERIAL:()=>fy,WOOD_MATERIAL:()=>py});var ly=new Vi({color:0,emissive:new at(16777215),emissiveIntensity:5,metalness:0,roughness:.2,clearcoat:.3,clearcoatRoughness:.2,depthWrite:!0,depthTest:!0,transparent:!1,alphaTest:0,polygonOffset:!0,side:Sn,dithering:!0}),cy=new Vi({color:new at(0),metalness:.9,roughness:.3,envMapIntensity:1.2,clearcoat:.3,clearcoatRoughness:.2,reflectivity:1,ior:2.5,thickness:1,depthWrite:!0,transparent:!1,alphaTest:0,depthTest:!0,polygonOffset:!0,side:Sn,dithering:!0}),uy=new Vi({color:new at(13421772),metalness:0,roughness:.92,envMapIntensity:.15,clearcoat:.05,clearcoatRoughness:.9,reflectivity:.15,transmission:0,ior:1.45,thickness:0,depthWrite:!0,transparent:!1,alphaTest:.5,depthTest:!0,polygonOffset:!0,side:Sn,dithering:!0}),dy=new Vi({color:new at(16777215),metalness:0,roughness:.3,envMapIntensity:.5,clearcoat:.5,clearcoatRoughness:.1,reflectivity:.5,ior:1.4,transmission:0,transparent:!1,depthWrite:!0,side:Sn,dithering:!0,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),hy=new Vi({color:new at(16777215),metalness:0,roughness:0,transmission:.95,transparent:!0,opacity:.3,envMapIntensity:1,clearcoat:1,clearcoatRoughness:0,ior:1.52,reflectivity:.9,thickness:1,side:In,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),fy=new Vi({color:new at(1710618),metalness:0,roughness:.9,envMapIntensity:.2,clearcoat:.1,clearcoatRoughness:.8,reflectivity:.2,ior:1.3,transmission:0,depthWrite:!0,side:Sn,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),py=new Vi({color:new at(8934707),metalness:0,roughness:.7,envMapIntensity:.3,clearcoat:.3,clearcoatRoughness:.4,reflectivity:.3,ior:1.3,transmission:0,depthWrite:!0,side:Sn,dithering:!0,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),Al=1096174675,Rl=1,Lc=1,Ed=12,wd=56;function Nc(n){let e=my(n),t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<Ed)throw ui("Blob too small to contain SLVA header.",{expectedBytes:Ed,availableBytes:e.byteLength});let i=0,r=t.getUint32(i,!0);if(i+=4,r!==Al)throw ui(`Invalid SLVA magic: 0x${r.toString(16)}`,{expectedMagic:`0x${Al.toString(16)}`,actualMagic:`0x${r.toString(16)}`});let s=t.getUint32(i,!0);if(i+=4,s!==Rl)throw ui(`Unsupported SLVA version: ${s}`,{expectedVersion:Rl,actualVersion:s});let a=t.getUint32(i,!0);if(i+=4,i+a>e.byteLength)throw ui("Insufficient data to read metadata JSON.",{expectedBytes:a,availableBytes:e.byteLength-i,offset:i});let o=e.subarray(i,i+a);i+=a;let l;try{l=JSON.parse(gy(o))}catch(E){throw ui(`Failed to parse metadata JSON: ${E instanceof Error?E.message:String(E)}`,{metadataLen:a})}if(i+wd>e.byteLength)throw ui("Insufficient data to read geometry header.",{expectedBytes:wd,availableBytes:e.byteLength-i,offset:i});let c=t.getUint32(i,!0);i+=4;let u=t.getFloat64(i,!0);i+=8;let h=t.getFloat64(i,!0);i+=8;let f=t.getFloat64(i,!0);i+=8;let p=t.getFloat64(i,!0);i+=8;let v=t.getFloat64(i,!0);i+=8;let S=t.getFloat64(i,!0);i+=8;let g=t.getUint32(i,!0);i+=4;let m=(c&Lc)!==0,x=g*3,M=x*(m?4:2);if(i+M>e.byteLength)throw ui("Insufficient data to read vertices.",{expectedBytes:M,availableBytes:e.byteLength-i,offset:i,useFloat32:m,vertexCount:g});let T=e.byteOffset+i,C=m?_y(e.buffer,T,x):vy(e.buffer,T,x);if(i+=M,i+4>e.byteLength)throw ui("Insufficient data to read index count.",{expectedBytes:4,availableBytes:e.byteLength-i,offset:i});let y=t.getUint32(i,!0);i+=4;let I=y*4;if(i+I>e.byteLength)throw ui("Insufficient data to read indices.",{expectedBytes:I,availableBytes:e.byteLength-i,offset:i,indexCount:y});let _=xy(e.buffer,e.byteOffset+i,y);return{metadata:l,flags:c,vertices:C,indices:_,origin:[u,h,f],scale:[p,v,S]}}function my(n){return typeof n=="string"?Mh(n):n instanceof Uint8Array?n:new Uint8Array(n)}function gy(n){if(typeof TextDecoder<"u")return new TextDecoder("utf-8").decode(n);if(typeof globalThis.Buffer<"u")return globalThis.Buffer.from(n).toString("utf-8");throw new Ui("No UTF-8 decoder available in this environment.",gi.INVALID_STATE)}function vy(n,e,t){if(t===0)return new Int16Array(0);if(e%2===0)return new Int16Array(n,e,t);let i=new Uint8Array(t*2);return i.set(new Uint8Array(n,e,t*2)),new Int16Array(i.buffer)}function _y(n,e,t){if(t===0)return new Float32Array(0);if(e%4===0)return new Float32Array(n,e,t);let i=new Uint8Array(t*4);return i.set(new Uint8Array(n,e,t*4)),new Float32Array(i.buffer)}function xy(n,e,t){if(t===0)return new Uint32Array(0);if(e%4===0)return new Uint32Array(n,e,t);let i=new Uint8Array(t*4);return i.set(new Uint8Array(n,e,t*4)),new Uint32Array(i.buffer)}function ui(n,e){return new Ui(n,gi.VALIDATION_ERROR,{context:e})}async function hf(n,e){let{mergeByMaterial:t=!0,applyTransforms:i=!0,debug:r=!1}=e??{},s=r?performance.now():0,a=0;try{let o=performance.now(),l=JSON.parse(n);return a=performance.now()-o,await ff(l,{mergeByMaterial:t,applyTransforms:i,debug:r,parseTime:a,perfStart:s})}catch(o){return zt().error("Error parsing mesh batch:",o),[]}}async function ff(n,e){let{mergeByMaterial:t=!0,applyTransforms:i=!0,scaleFactor:r=1,debug:s=!1,parseTime:a=0,perfStart:o=s?performance.now():0}=e??{};try{let l=performance.now(),c=Nc(n.compressedData),u=performance.now()-l,h=s?Ty(n.compressedData):0;return pf(c,{mergeByMaterial:t,applyTransforms:i,scaleFactor:r,debug:s,parseTime:a,decodeTime:u,perfStart:o,blobBytes:h,fallback:{materials:n.materials,groups:n.groups,sourceComponentId:n.sourceComponentId}})}catch(l){return zt().error("Error parsing mesh batch object:",l),[]}}async function by(n,e){let{mergeByMaterial:t=!0,applyTransforms:i=!0,scaleFactor:r=1,debug:s=!1}=e??{},a=s?performance.now():0;try{let o=performance.now(),l=Nc(n),c=performance.now()-o,u=(n instanceof Uint8Array,n.byteLength);return pf(l,{mergeByMaterial:t,applyTransforms:i,scaleFactor:r,debug:s,parseTime:0,decodeTime:c,perfStart:a,blobBytes:u})}catch(o){return zt().error("Error parsing mesh batch blob:",o),[]}}function pf(n,e){let{mergeByMaterial:t,applyTransforms:i,scaleFactor:r,debug:s,parseTime:a,decodeTime:o,perfStart:l,blobBytes:c,fallback:u}=e,h=n.metadata.materials??u?.materials??[],f=n.metadata.groups??u?.groups??[],p=n.metadata.sourceComponentId??u?.sourceComponentId,v=(n.flags&Lc)!==0,S=v?yy(n.vertices,i):Sy(n.vertices,n.origin,n.scale,i);if(s){let T=n.vertices.byteLength+n.indices.byteLength;zt().debug("Mesh Batch Stats:"),zt().debug(` Materials: ${h.length} | Groups: ${f.length}`),zt().debug(` Vertices: ${n.vertices.length/3} | Indices: ${n.indices.length}`),zt().debug(` Format: ${v?"float32":"int16 quantized"}`),zt().debug(` Blob: ${(c/1024/1024).toFixed(2)} MB | Geometry on wire: ${(T/1024/1024).toFixed(2)} MB`)}let g=performance.now(),m=h.map(My),x=[];for(let T of f)if(t&&T.meshes.length>1){let C=Ey(T,S,n.indices,m);C.userData.sourceComponentId=p??null,x.push(C)}else{let C=wy(T,S,n.indices,m);for(let y of C)y.userData.sourceComponentId=p??null;x.push(...C)}if(r!==1)for(let T of x)T.scale.set(r,r,r);let M=performance.now()-g;if(s){let T=performance.now()-l;zt().debug("Performance:"),a>0&&zt().debug(` Parse JSON: ${a.toFixed(2)}ms`),zt().debug(` Decode binary: ${o.toFixed(2)}ms`),zt().debug(` Create Meshes: ${M.toFixed(2)}ms`),zt().debug(` Total: ${T.toFixed(2)}ms`)}return Promise.resolve(x)}function Sy(n,e,t,i){let r=new Float32Array(n.length),s=e[0],a=e[1],o=e[2],l=t[0],c=t[1],u=t[2];if(i)for(let h=0;h<n.length;h+=3){let f=s+(n[h]+32767)*l,p=a+(n[h+1]+32767)*c,v=o+(n[h+2]+32767)*u;r[h]=f,r[h+1]=v,r[h+2]=-p}else for(let h=0;h<n.length;h+=3)r[h]=s+(n[h]+32767)*l,r[h+1]=a+(n[h+1]+32767)*c,r[h+2]=o+(n[h+2]+32767)*u;return r}function yy(n,e){if(!e)return n;let t=new Float32Array(n.length);for(let i=0;i<n.length;i+=3){let r=n[i],s=n[i+1],a=n[i+2];t[i]=r,t[i+1]=a,t[i+2]=-s}return t}function My(n){let e=cf(n.color);return new Vi({color:e,metalness:n.metalness,roughness:n.roughness,opacity:n.opacity,transparent:n.transparent,side:In,polygonOffset:!0,polygonOffsetFactor:.5,polygonOffsetUnits:.5,depthWrite:!0,depthTest:!0})}function Ey(n,e,t,i){let r=0,s=0;for(let v of n.meshes)r+=v.vertexCount,s+=v.indexCount;let a=new Float32Array(r*3),o=new Uint32Array(s),l=0,c=0;for(let v of n.meshes){let S=v.vertexStart*3,g=v.vertexCount*3;a.set(e.subarray(S,S+g),l*3);let m=t.subarray(v.indexStart,v.indexStart+v.indexCount),x=l-v.vertexStart;if(x===0)o.set(m,c);else for(let M=0;M<m.length;M++)o[c+M]=m[M]+x;l+=v.vertexCount,c+=v.indexCount}let u=new Wn;u.setAttribute("position",new bn(a,3)),u.setIndex(new bn(o,1)),u.computeVertexNormals();let h=new rn(u,i[n.materialId]),f=n.meshes[0],p=n.meshes.map(v=>v.name).filter(v=>v&&v.length>0);return h.name=p.length>0?p[0]:`merged_material_${n.materialId}`,h.castShadow=!0,h.receiveShadow=!0,h.userData={name:h.name,layer:f?.layer??"",originalIndex:f?.originalIndex??0,metadata:f?.metadata??{},mergedFrom:n.meshes.slice(1).map(v=>({name:v.name,layer:v.layer,originalIndex:v.originalIndex}))},h}function wy(n,e,t,i){let r=[];for(let s of n.meshes){let a=s.vertexStart*3,o=s.vertexCount*3,l=e.slice(a,a+o),c=t.subarray(s.indexStart,s.indexStart+s.indexCount),u=new Uint32Array(c.length),h=s.vertexStart;for(let v=0;v<c.length;v++)u[v]=c[v]-h;let f=new Wn;f.setAttribute("position",new bn(l,3)),f.setIndex(new bn(u,1)),f.computeVertexNormals();let p=new rn(f,i[n.materialId]);p.name=s.name,p.userData={name:s.name,layer:s.layer??"",originalIndex:s.originalIndex,metadata:s.metadata??{}},p.castShadow=!0,p.receiveShadow=!0,r.push(p)}return r}function Ty(n){return Math.floor(n.length*3/4)}var mf={Millimeters:1/1e3,Centimeters:1/100,Meters:1,Inches:1/39.37,Feet:1/3.28084},Ay="Display";async function Ry(n,e){let t=performance.now(),i=[],{allowScaling:r=!0,allowAutoPosition:s=!0,debug:a=!1,parsing:o={}}=e??{};try{let l=r?Cy(n.modelunits):1;return await Py(n,i,l,o,a),s&&Iy(i),i}catch(l){throw Ly(l,i),l}finally{a&&Uy(t)}}function Cy(n){return mf[n]??1}async function Py(n,e,t,i,r){for(let s of n.values){let a=s.InnerTree;for(let o in a){let l=a[o];l&&await Dy(l,e,t,i,r)}}}async function Dy(n,e,t,i,r){for(let s of n)if(s.type.includes(Ay)){let a={mergeByMaterial:!0,applyTransforms:!0,debug:!1,...i},o=await hf(s.data,a);if(t!==1)for(let l of o)l.scale.set(t,t,t);e.push(...o),r&&zt().debug(`Extracted ${o.length} meshes from batch`)}}function Iy(n){if(n.length===0)return;let e=Ic(n).min.y;uf(n,e)}function Ly(n,e){zt().error("An unexpected error occurred:",n),Ny(e)}function Ny(n){for(let e of n)e.geometry&&e.geometry.dispose(),e.material&&(Array.isArray(e.material)?e.material.forEach(t=>t.dispose()):e.material.dispose())}function Uy(n){let e=performance.now()-n;zt().info("Time to process meshes:",`${e.toFixed(2)}ms`)}var Fy=Z('<button aria-label="Clear search"><!></button>'),Oy=Z('<div role="option" tabindex="-1"><button class="rounded p-1 shrink-0 transition-colors hover:bg-muted"><!></button> <span> </span> <span class="rounded px-1 py-0.5 font-medium shrink-0 bg-muted text-[9px] text-muted-foreground/70"> </span></div>'),By=Z('<div role="listbox" aria-multiselectable="true" class="ml-3 border-l border-border svelte-vc2vi3"></div>'),zy=Z('<div class="gap-1 pl-1 pr-2 py-1 group flex items-center transition-colors hover:bg-muted svelte-vc2vi3"><button class="rounded p-0.5 shrink-0 text-muted-foreground transition-colors hover:text-muted-foreground"><!></button> <button class="rounded p-1 shrink-0 transition-colors hover:bg-muted"><!></button> <span> </span> <span class="shrink-0 text-[10px] text-muted-foreground/50 tabular-nums"> </span></div> <!>',1),ky=Z('<div class="py-12 flex flex-col items-center justify-center text-center svelte-vc2vi3"><!> <p class="text-xs text-muted-foreground">No objects</p></div>'),Vy=Z('<div class="py-12 flex flex-col items-center justify-center text-center svelte-vc2vi3"><!> <p class="text-xs text-muted-foreground"> </p></div>'),Hy=Z('<div class="flex h-full flex-col bg-card text-card-foreground svelte-vc2vi3"><div class="px-3 py-2 gap-2 flex items-center border-b border-border svelte-vc2vi3"><!> <input class="min-w-0 text-xs flex-1 bg-transparent text-foreground outline-none placeholder:text-muted-foreground/50" placeholder="Search objects..."/> <!></div> <div class="py-1 flex-1 overflow-y-auto svelte-vc2vi3"><!> <!></div></div>');function Gy(n,e){nt(e,!0);let t=me(e,"sceneVersion",3,0);const i=()=>(t(),e.scene.children.filter(U=>!(U instanceof Cc)&&!(U instanceof Rc))),r=()=>{const U=i(),X=new pa;for(const V of U){const $=V.userData?.layer||V.userData?.category||"Default";X.has($)||X.set($,[]),X.get($).push(V)}return X};let s=new is,a=new is;const o=(U,X)=>{U.visible=X,U.traverse(V=>{V.visible=X}),X?s.delete(U.uuid):s.add(U.uuid)},l=U=>{if(x.has(U.uuid)&&x.size>1){const V=i().filter(ee=>x.has(ee.uuid)),$=V.every(ee=>s.has(ee.uuid));for(const ee of V)o(ee,$)}else o(U,s.has(U.uuid))},c=U=>U.every(X=>s.has(X.uuid)),u=U=>{const X=U.filter(V=>s.has(V.uuid)).length;return X>0&&X<U.length},h=(U,X)=>{const V=c(X);for(const $ of X)o($,V)},f=U=>{a.has(U)?a.delete(U):a.add(U)},p=U=>U.userData?.name||U.userData?.fileName||U.name||U.type,v=U=>U.type.replace("Mesh","").replace("Object3D","Obj")||U.type;let S=we("");const g=()=>{const U=r();if(!d(S).trim())return U;const X=d(S).toLowerCase(),V=new pa;for(const[$,ee]of U){const Se=$.toLowerCase().includes(X)?ee:ee.filter(ye=>p(ye).toLowerCase().includes(X));Se.length>0&&V.set($,Se)}return V},m=()=>{const U=[];for(const[X,V]of g())if(!a.has(X))for(const $ of V)U.push($.uuid);return U};let x=new is,M=we(null);const T=(U,X)=>{if(X.shiftKey&&d(M)){const V=m(),$=V.indexOf(d(M)),ee=V.indexOf(U);if($!==-1&&ee!==-1){const[Se,ye]=$<ee?[$,ee]:[ee,$];!X.ctrlKey&&!X.metaKey&&x.clear();for(let ve=Se;ve<=ye;ve++)x.add(V[ve])}}else X.ctrlKey||X.metaKey?x.has(U)?x.delete(U):(x.add(U),O(M,U,!0)):(x.clear(),x.add(U),O(M,U,!0));X.shiftKey||O(M,U,!0)};var C=Hy(),y=Q(C),I=Q(y);hu(I,{class:"h-3.5 w-3.5 shrink-0 text-muted-foreground/50"});var _=ue(I,2);kl(_);var E=ue(_,2);{var L=U=>{var X=Fy(),V=Q(X);Ap(V,{class:"h-3.5 w-3.5 text-muted-foreground/50 transition-colors hover:text-muted-foreground"}),q(X),Lt("click",X,()=>O(S,"")),D(U,X)};_e(E,U=>{d(S)&&U(L)})}q(y);var P=ue(y,2),k=Q(P);Ht(k,17,()=>[...g()],([U,X])=>U,(U,X)=>{var V=z(()=>$i(d(X),2));let $=()=>d(V)[0],ee=()=>d(V)[1];const Se=z(()=>c(ee())),ye=z(()=>u(ee())),ve=z(()=>a.has($()));var K=zy(),fe=ae(K),Y=Q(fe),oe=Q(Y);{let De=z(()=>d(ve)?"":"rotate-90");eh(oe,{get class(){return`h-3.5 w-3.5 transition-transform duration-150 ${d(De)??""}`}})}q(Y);var Me=ue(Y,2),Ee=Q(Me);{var Ge=De=>{Va(De,{class:"h-3.5 w-3.5 text-muted-foreground/40"})},Te=De=>{Ha(De,{class:"h-3.5 w-3.5 text-muted-foreground/60"})},Ve=De=>{Ha(De,{class:"h-3.5 w-3.5 text-muted-foreground"})};_e(Ee,De=>{d(Se)?De(Ge):d(ye)?De(Te,1):De(Ve,-1)})}q(Me);var Ae=ue(Me,2),Ce=Q(Ae,!0);q(Ae);var Oe=ue(Ae,2),Be=Q(Oe,!0);q(Oe),q(fe);var He=ue(fe,2);{var B=De=>{var pe=By();Ht(pe,21,ee,Ne=>Ne.uuid,(Ne,ce)=>{const je=z(()=>s.has(d(ce).uuid)),w=z(()=>x.has(d(ce).uuid));var b=Oy(),G=Q(b),ne=Q(G);{var de=Ie=>{Va(Ie,{class:"h-3 w-3 text-muted-foreground/60"})},he=Ie=>{Ha(Ie,{class:"h-3 w-3 text-muted-foreground"})};_e(ne,Ie=>{d(je)?Ie(de):Ie(he,-1)})}q(G);var xe=ue(G,2),ie=Q(xe,!0);q(xe);var ge=ue(xe,2),Ue=Q(ge,!0);q(ge),q(b),Le((Ie,ke)=>{Vt(b,"aria-selected",d(w)),At(b,1,`gap-1.5 pl-5 pr-2 py-0.5 flex cursor-pointer items-center transition-colors
|
|
4109
4109
|
${d(w)?"bg-primary/10 hover:bg-primary/15":"hover:bg-muted"}
|
|
4110
|
-
${d(je)?"opacity-40":""}`,"svelte-
|
|
4110
|
+
${d(je)?"opacity-40":""}`,"svelte-vc2vi3"),Vt(G,"title",d(je)?"Show":"Hide"),Vt(G,"aria-label",d(je)?"Show object":"Hide object"),At(xe,1,`min-w-0 text-xs flex-1 truncate ${d(je)?"text-muted-foreground line-through":"text-foreground/80"}`),Ze(ie,Ie),Ze(Ue,ke)},[()=>p(d(ce)),()=>v(d(ce))]),Lt("mousedown",b,Ie=>{Ie.stopPropagation(),Ie.shiftKey&&Ie.preventDefault()}),Lt("click",b,Ie=>T(d(ce).uuid,Ie)),Lt("keydown",b,Ie=>Ie.key==="Enter"&&T(d(ce).uuid,Ie)),Lt("click",G,Ie=>{Ie.stopPropagation(),l(d(ce))}),D(Ne,b)}),q(pe),D(De,pe)};_e(He,De=>{d(ve)||De(B)})}Le(()=>{Vt(Y,"aria-label",d(ve)?"Expand layer":"Collapse layer"),Vt(Me,"title",d(Se)?"Show layer":"Hide layer"),Vt(Me,"aria-label",d(Se)?"Show layer":"Hide layer"),At(Ae,1,`min-w-0 text-xs font-medium flex-1 truncate ${d(Se)?"text-muted-foreground/40 line-through":"text-foreground"}`),Ze(Ce,$()),Ze(Be,ee().length)}),Lt("click",Y,()=>f($())),Lt("click",Me,()=>h($(),ee())),D(U,K)});var W=ue(k,2);{var H=U=>{var X=ky(),V=Q(X);Va(V,{class:"mb-2 h-5 w-5 text-muted-foreground/30"}),ct(2),q(X),D(U,X)},N=z(()=>i().length===0),R=U=>{var X=Vy(),V=Q(X);hu(V,{class:"mb-2 h-5 w-5 text-muted-foreground/30"});var $=ue(V,2),ee=Q($);q($),q(X),Le(()=>Ze(ee,`No results for "${d(S)??""}"`)),D(U,X)},F=z(()=>g().size===0);_e(W,U=>{d(N)?U(H):d(F)&&U(R,1)})}q(P),q(C),Lt("mousedown",C,()=>{x.clear(),O(M,null)}),Qd(_,()=>d(S),U=>O(S,U)),D(n,C),it()}Gn(["mousedown","click","keydown"]);var Wy=Z('<div class="px-4 pt-3 pb-2 border-b"><!></div>'),Xy=Z('<p class="px-4 py-3 text-xs text-muted-foreground">No metadata</p>'),Yy=Z('<div class="gap-2 flex"><span class="shrink-0 text-muted-foreground"> </span> <span> </span></div>'),jy=Z('<div class="space-y-0.5"></div>'),qy=Z("<div> </div>"),Ky=Z('<div class="space-y-1 text-left"></div>'),Zy=Z('<div class="gap-2 flex"><span class="shrink-0 text-muted-foreground"> </span> <span> </span></div>'),$y=Z('<div class="space-y-0.5 text-left"></div>'),Jy=Z('<span class="font-mono"> </span>'),Qy=Z("<span> </span>"),eM=Z('<span class="break-all"> </span>'),tM=Z('<tr class="border-b border-border/60 transition-colors hover:bg-muted/40"><th scope="row" class="px-4 py-2 font-normal text-left align-top whitespace-nowrap text-muted-foreground"> </th><td class="px-4 py-2 text-right align-top text-foreground"><!></td></tr>'),nM=Z('<table class="text-xs w-full border-collapse"><tbody></tbody></table>'),iM=Z('<!> <div class="max-h-80 overflow-y-auto"><!></div>',1);function rM(n,e){nt(e,!0);const t=new Set(["name","layer","originalIndex","sourceComponentId"]);let i=me(e,"open",15),r=me(e,"isFullscreen",3,!1);Rt(()=>{document.body.toggleAttribute("data-viewer-fullscreen",r())});const s=()=>{if(!e.metadata)return{};const l=Object.entries(e.metadata).filter(([u])=>!t.has(u)),c={};for(const[u,h]of l)u==="metadata"&&typeof h=="object"&&h!==null&&!Array.isArray(h)?Object.assign(c,h):c[u]=h;return c};var a=Pe(),o=ae(a);We(o,()=>Ar,(l,c)=>{c(l,{get onOpenChange(){return e.onOpenChange},get open(){return i()},set open(u){i(u)},children:(u,h)=>{var f=Pe(),p=ae(f);We(p,()=>Rr,(v,S)=>{S(v,{class:"min-w-60 max-w-xs p-0 gap-0 w-auto overflow-hidden",children:(g,m)=>{var x=iM(),M=ae(x);{var T=P=>{var k=Wy(),W=Q(k);We(W,()=>Ji,(H,N)=>{N(H,{class:"text-sm font-semibold",children:(R,F)=>{ct();var U=Tt();Le(()=>Ze(U,e.meshName)),D(R,U)},$$slots:{default:!0}})}),q(k),D(P,k)},C=P=>{var k=Pe(),W=ae(k);We(W,()=>Ji,(H,N)=>{N(H,{class:"sr-only",children:(R,F)=>{ct();var U=Tt("Object");D(R,U)},$$slots:{default:!0}})}),D(P,k)};_e(M,P=>{e.meshName?P(T):P(C,-1)})}var y=ue(M,2),I=Q(y);{var _=P=>{var k=Xy();D(P,k)},E=z(()=>!e.metadata||Object.keys(s()).length===0),L=P=>{var k=nM(),W=Q(k);Ht(W,21,()=>Object.entries(s()),([H,N])=>H,(H,N)=>{var R=z(()=>$i(d(N),2));let F=()=>d(R)[0],U=()=>d(R)[1];var X=tM(),V=Q(X),$=Q(V,!0);q(V);var ee=ue(V),Se=Q(ee);{var ye=Y=>{var oe=Pe(),Me=ae(oe);{var Ee=Ve=>{var Ae=Ky();Ht(Ae,21,U,$d,(Ce,Oe)=>{var Be=Pe(),He=ae(Be);{var B=pe=>{var Ne=jy();Ht(Ne,21,()=>Object.entries(d(Oe)),([ce,je])=>ce,(ce,je)=>{var w=z(()=>$i(d(je),2));let b=()=>d(w)[0],G=()=>d(w)[1];var ne=Yy(),de=Q(ne),he=Q(de);q(de);var xe=ue(de,2),ie=Q(xe,!0);q(xe),q(ne),Le(()=>{Ze(he,`${b()??""}:`),Ze(ie,G())}),D(ce,ne)}),q(Ne),D(pe,Ne)},De=pe=>{var Ne=qy(),ce=Q(Ne,!0);q(Ne),Le(()=>Ze(ce,d(Oe))),D(pe,Ne)};_e(He,pe=>{typeof d(Oe)=="object"?pe(B):pe(De,-1)})}D(Ce,Be)}),q(Ae),D(Ve,Ae)},Ge=z(()=>Array.isArray(U())),Te=Ve=>{var Ae=$y();Ht(Ae,21,()=>Object.entries(U()),([Ce,Oe])=>Ce,(Ce,Oe)=>{var Be=z(()=>$i(d(Oe),2));let He=()=>d(Be)[0],B=()=>d(Be)[1];var De=Zy(),pe=Q(De),Ne=Q(pe);q(pe);var ce=ue(pe,2),je=Q(ce,!0);q(ce),q(De),Le(()=>{Ze(Ne,`${He()??""}:`),Ze(je,B())}),D(Ce,De)}),q(Ae),D(Ve,Ae)};_e(Me,Ve=>{d(Ge)?Ve(Ee):Ve(Te,-1)})}D(Y,oe)},ve=Y=>{var oe=Jy(),Me=Q(oe,!0);q(oe),Le(()=>Ze(Me,U())),D(Y,oe)},K=Y=>{var oe=Qy(),Me=Q(oe,!0);q(oe),Le(()=>{At(oe,1,fa(U()?"text-green-500":"text-muted-foreground")),Ze(Me,U()?"true":"false")}),D(Y,oe)},fe=Y=>{var oe=eM(),Me=Q(oe,!0);q(oe),Le(()=>Ze(Me,U())),D(Y,oe)};_e(Se,Y=>{typeof U()=="object"&&U()!==null?Y(ye):typeof U()=="number"?Y(ve,1):typeof U()=="boolean"?Y(K,2):Y(fe,-1)})}q(ee),q(X),Le(()=>Ze($,F())),D(H,X)}),q(W),q(k),D(P,k)};_e(I,P=>{d(E)?P(_):P(L,-1)})}q(y),D(g,x)},$$slots:{default:!0}})}),D(u,f)},$$slots:{default:!0}})}),D(n,a),it()}function sM(n){return typeof n=="function"}function Uc(n){return n!==null&&typeof n=="object"}const aM=["string","number","bigint","boolean"];function Cl(n){return n==null||aM.includes(typeof n)?!0:Array.isArray(n)?n.every(e=>Cl(e)):typeof n=="object"?Object.getPrototypeOf(n)===Object.prototype:!1}const ds=Symbol("box"),Fc=Symbol("is-writable");function oM(n){return Uc(n)&&ds in n}function lM(n){return St.isBox(n)&&Fc in n}function St(n){let e=we($n(n));return{[ds]:!0,[Fc]:!0,get current(){return d(e)},set current(t){O(e,t,!0)}}}function cM(n,e){const t=z(n);return e?{[ds]:!0,[Fc]:!0,get current(){return d(t)},set current(i){e(i)}}:{[ds]:!0,get current(){return n()}}}function uM(n){return St.isBox(n)?n:sM(n)?St.with(n):St(n)}function dM(n){return Object.entries(n).reduce((e,[t,i])=>St.isBox(i)?(St.isWritableBox(i)?Object.defineProperty(e,t,{get(){return i.current},set(r){i.current=r}}):Object.defineProperty(e,t,{get(){return i.current}}),e):Object.assign(e,{[t]:i}),{})}function hM(n){return St.isWritableBox(n)?{[ds]:!0,get current(){return n.current}}:n}St.from=uM;St.with=cM;St.flatten=dM;St.readonly=hM;St.isBox=oM;St.isWritableBox=lM;function fM(...n){return function(e){for(const t of n)if(t){if(e.defaultPrevented)return;typeof t=="function"?t.call(this,e):t.current?.call(this,e)}}}const pM=/\d/,mM=["-","_","/","."];function gM(n=""){if(!pM.test(n))return n!==n.toLowerCase()}function vM(n){const e=[];let t="",i,r;for(const s of n){const a=mM.includes(s);if(a===!0){e.push(t),t="",i=void 0;continue}const o=gM(s);if(r===!1){if(i===!1&&o===!0){e.push(t),t=s,i=o;continue}if(i===!0&&o===!1&&t.length>1){const l=t.at(-1);e.push(t.slice(0,Math.max(0,t.length-1))),t=l+s,i=o;continue}}t+=s,i=o,r=a}return e.push(t),e}function gf(n){return n?vM(n).map(e=>xM(e)).join(""):""}function _M(n){return bM(gf(n||""))}function xM(n){return n?n[0].toUpperCase()+n.slice(1):""}function bM(n){return n?n[0].toLowerCase()+n.slice(1):""}function Zs(n){if(!n)return{};const e={};function t(i,r){if(i.startsWith("-moz-")||i.startsWith("-webkit-")||i.startsWith("-ms-")||i.startsWith("-o-")){e[gf(i)]=r;return}if(i.startsWith("--")){e[i]=r;return}e[_M(i)]=r}return Cp(n,t),e}function vf(...n){return(...e)=>{for(const t of n)typeof t=="function"&&t(...e)}}function SM(n,e,t,i){const r=Array.isArray(e)?e:[e];return r.forEach(s=>n.addEventListener(s,t,i)),()=>{r.forEach(s=>n.removeEventListener(s,t,i))}}function yM(n,e){const t=RegExp(n,"g");return i=>{if(typeof i!="string")throw new TypeError(`expected an argument of type string, but got ${typeof i}`);return i.match(t)?i.replace(t,e):i}}const MM=yM(/[A-Z]/,n=>`-${n.toLowerCase()}`);function EM(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError(`expected an argument of type object, but got ${typeof n}`);return Object.keys(n).map(e=>`${MM(e)}: ${n[e]};`).join(`
|
|
4111
4111
|
`)}function _f(n={}){return EM(n).replace(`
|
|
4112
4112
|
`," ")}const wM={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};_f(wM);const TM=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],AM=new Set(TM);function RM(n){return AM.has(n)}function Oc(...n){const e={...n[0]};for(let t=1;t<n.length;t++){const i=n[t];if(i){for(const r of Object.keys(i)){const s=e[r],a=i[r],o=typeof s=="function",l=typeof a=="function";if(o&&RM(r)){const c=s,u=a;e[r]=fM(c,u)}else if(o&&l)e[r]=vf(s,a);else if(r==="class"){const c=Cl(s),u=Cl(a);c&&u?e[r]=za(s,a):c?e[r]=za(s):u&&(e[r]=za(a))}else if(r==="style"){const c=typeof s=="object",u=typeof a=="object",h=typeof s=="string",f=typeof a=="string";if(c&&u)e[r]={...s,...a};else if(c&&f){const p=Zs(a);e[r]={...s,...p}}else if(h&&u){const p=Zs(s);e[r]={...p,...a}}else if(h&&f){const p=Zs(s),v=Zs(a);e[r]={...p,...v}}else c?e[r]=s:u?e[r]=a:h?e[r]=s:f&&(e[r]=a)}else e[r]=a!==void 0?a:s}for(const r of Object.getOwnPropertySymbols(i)){const s=e[r],a=i[r];e[r]=a!==void 0?a:s}}}return typeof e.style=="object"&&(e.style=_f(e.style).replaceAll(`
|
|
4113
|
-
`," ")),e.hidden!==!0&&(e.hidden=void 0,delete e.hidden),e.disabled!==!0&&(e.disabled=void 0,delete e.disabled),e}const CM=typeof window<"u"?window:void 0;function PM(n){let e=n.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class DM{#e;#t;constructor(e={}){const{window:t=CM,document:i=t?.document}=e;t!==void 0&&(this.#e=i,this.#t=mp(r=>{const s=Kt(t,"focusin",r),a=Kt(t,"focusout",r);return()=>{s(),a()}}))}get current(){return this.#t?.(),this.#e?PM(this.#e):null}}new DM;function IM(n){hp().then(n)}const LM=9;function NM(n){return Uc(n)&&n.nodeType===LM}function UM(n){return Uc(n)&&n.constructor?.name==="VisualViewport"}function FM(n){return NM(n)?n:UM(n)?n.document:n?.ownerDocument??document}function OM(n){let e=n.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class Bc{element;#e=z(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return d(this.#e)}set root(e){O(this.#e,e)}constructor(e){typeof e=="function"?this.element=St.with(e):this.element=e}getDocument=()=>FM(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>OM(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)}function zc(n,e){return{[Pp()]:t=>St.isBox(n)?(n.current=t,nn(()=>e?.(t)),()=>{"isConnected"in t&&t.isConnected||(n.current=null)}):(n(t),nn(()=>e?.(t)),()=>{"isConnected"in t&&t.isConnected||n(null)})}}function BM({layout:n,panesArray:e,pivotIndices:t}){let i=0,r=100,s=0,a=0;const o=t[0];for(let h=0;h<e.length;h++){const f=e[h].constraints,{maxSize:p=100,minSize:v=0}=f;h===o?(i=v,r=p):(s+=v,a+=p)}const l=Math.min(r,100-s),c=Math.max(i,100-a),u=n[o];return{valueMax:l,valueMin:c,valueNow:u}}function kt(n,e="Assertion failed!"){if(!n)throw console.error(e),new Error(e)}const zM=100,kc=10;function _n(n,e,t=kc){return hs(n,e,t)===0}function hs(n,e,t=kc){const i=Td(n,t),r=Td(e,t);return Math.sign(i-r)}function Kr(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function Td(n,e){return Number.parseFloat(n.toFixed(e))}const Na=typeof document<"u";function kM(n){return n instanceof HTMLElement}function xf(n){return n.type==="keydown"}function bf(n){return n.type.startsWith("mouse")}function Sf(n){return n.type.startsWith("touch")}function wr({paneConstraints:n,paneIndex:e,initialSize:t}){const i=n[e];kt(i!=null,"Pane constraints should not be null.");const{collapsedSize:r=0,collapsible:s,maxSize:a=100,minSize:o=0}=i;let l=t;return hs(l,o)<0&&(l=VM(l,s,r,o)),l=Math.min(a,l),Number.parseFloat(l.toFixed(kc))}function VM(n,e,t,i){if(!e)return i;const r=(t+i)/2;return hs(n,r)<0?t:i}function er(){}function HM({groupId:n,layout:e,panesArray:t,domContext:i}){const r=bs(n,i);for(let s=0;s<t.length-1;s++){const{valueMax:a,valueMin:o,valueNow:l}=BM({layout:e,panesArray:t,pivotIndices:[s,s+1]}),c=r[s];if(kM(c)){const u=t[s];c.setAttribute("aria-controls",u.opts.id.current),c.setAttribute("aria-valuemax",`${Math.round(a)}`),c.setAttribute("aria-valuemin",`${Math.round(o)}`),c.setAttribute("aria-valuenow",l!=null?`${Math.round(l)}`:"")}}return()=>{for(const s of r)s.removeAttribute("aria-controls"),s.removeAttribute("aria-valuemax"),s.removeAttribute("aria-valuemin"),s.removeAttribute("aria-valuenow")}}function bs(n,e){return Na?Array.from(e.querySelectorAll(`[data-pane-resizer-id][data-pane-group-id="${n}"]`)):[]}function yf({groupId:n,id:e,domContext:t}){return Na?bs(n,t).findIndex(s=>s.getAttribute("data-pane-resizer-id")===e)??null:null}function Ad({groupId:n,dragHandleId:e,domContext:t}){const i=yf({groupId:n,id:e,domContext:t});return i!=null?[i,i+1]:[-1,-1]}function Sr(n,e,t){const i=n.map(c=>c.constraints),r=yr(n,e),s=i[r],o=r===n.length-1?[r-1,r]:[r,r+1],l=t[r];return{...s,paneSize:l,pivotIndices:o}}function yr(n,e){return n.findIndex(t=>t.opts.id.current===e.opts.id.current)}function Zr(n,e,t){for(let i=0;i<e.length;i++){const r=e[i],s=n[i];kt(s);const{collapsedSize:a=0,collapsible:o}=s.constraints,l=t[s.opts.id.current];if(!(l==null||r!==l))continue;t[s.opts.id.current]=r;const{onCollapse:c,onExpand:u,onResize:h}=s.callbacks;h?.(r,l),o&&(c||u)&&(u&&(l==null||l===a)&&r!==a&&u(),c&&(l==null||l!==a)&&r===a&&c())}}function GM({panesArray:n}){const e=Array(n.length),t=n.map(s=>s.constraints);let i=0,r=100;for(let s=0;s<n.length;s++){const a=t[s];kt(a);const{defaultSize:o}=a;o!=null&&(i++,e[s]=o,r-=o)}for(let s=0;s<n.length;s++){const a=t[s];kt(a);const{defaultSize:o}=a;if(o!=null)continue;const l=n.length-i,c=r/l;i++,e[s]=c,r-=c}return e}function WM({layout:n,paneConstraints:e}){const t=[...n],i=t.reduce((s,a)=>s+a,0);if(t.length!==e.length)throw new Error(`Invalid ${e.length} pane layout: ${t.map(s=>`${s}%`).join(", ")}`);if(!_n(i,100))for(let s=0;s<e.length;s++){const a=t[s];kt(a!=null);const o=100/i*a;t[s]=o}let r=0;for(let s=0;s<e.length;s++){const a=t[s];kt(a!=null);const o=wr({paneConstraints:e,paneIndex:s,initialSize:a});a!==o&&(r+=a-o,t[s]=o)}if(!_n(r,0))for(let s=0;s<e.length;s++){const a=t[s];kt(a!=null);const o=a+r,l=wr({paneConstraints:e,paneIndex:s,initialSize:o});if(a!==l&&(r-=l-a,t[s]=l,_n(r,0)))break}return t}function XM(n,e){if(!Na)return null;const t=e.querySelector(`[data-pane-group][data-pane-group-id="${n}"]`);return t||null}function Vc(n,e){if(!Na)return null;const t=e.querySelector(`[data-pane-resizer-id="${n}"]`);return t||null}function YM({event:n,dragHandleId:e,dir:t,initialDragState:i,domContext:r}){const s=t==="horizontal",a=Vc(e,r);kt(a);const o=a.getAttribute("data-pane-group-id");kt(o);const{initialCursorPosition:l}=i,c=Mf(t,n),u=XM(o,r);kt(u);const h=u.getBoundingClientRect(),f=s?h.width:h.height;return(c-l)/f*100}function jM({event:n,dragHandleId:e,dir:t,initialDragState:i,keyboardResizeBy:r,domContext:s}){if(xf(n)){const a=t==="horizontal";let o=0;n.shiftKey?o=100:r!=null?o=r:o=10;let l=0;switch(n.key){case"ArrowDown":l=a?0:o;break;case"ArrowLeft":l=a?-o:0;break;case"ArrowRight":l=a?o:0;break;case"ArrowUp":l=a?0:-o;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return i==null?0:YM({event:n,dragHandleId:e,dir:t,initialDragState:i,domContext:s})}function Mf(n,e){const t=n==="horizontal";if(bf(e))return t?e.clientX:e.clientY;if(Sf(e)){const i=e.touches[0];return kt(i),t?i.screenX:i.screenY}else throw new Error(`Unsupported event type "${e.type}"`)}function qM({groupId:n,handleId:e,panesArray:t,domContext:i}){const r=Vc(e,i),s=bs(n,i),a=r?s.indexOf(r):-1,o=t[a]?.opts.id.current??null,l=t[a+1]?.opts.id.current??null;return[o,l]}function $r({delta:n,layout:e,paneConstraints:t,pivotIndices:i,trigger:r}){if(_n(n,0))return e;const s=[...e],[a,o]=i;let l=0;if(r==="keyboard"){{const u=n<0?o:a,h=t[u];if(kt(h),h.collapsible){const f=e[u];kt(f!=null);const p=t[u];kt(p);const{collapsedSize:v=0,minSize:S=0}=p;if(_n(f,v)){const g=S-f;hs(g,Math.abs(n))>0&&(n=n<0?0-g:g)}}}{const u=n<0?a:o,h=t[u];kt(h);const{collapsible:f}=h;if(f){const p=e[u];kt(p!=null);const v=t[u];kt(v);const{collapsedSize:S=0,minSize:g=0}=v;if(_n(p,g)){const m=p-S;hs(m,Math.abs(n))>0&&(n=n<0?0-m:m)}}}}{const u=n<0?1:-1;let h=n<0?o:a,f=0;for(;;){const v=e[h];kt(v!=null);const g=wr({paneConstraints:t,paneIndex:h,initialSize:100})-v;if(f+=g,h+=u,h<0||h>=t.length)break}const p=Math.min(Math.abs(n),Math.abs(f));n=n<0?0-p:p}{let h=n<0?a:o;for(;h>=0&&h<t.length;){const f=Math.abs(n)-Math.abs(l),p=e[h];kt(p!=null);const v=p-f,S=wr({paneConstraints:t,paneIndex:h,initialSize:v});if(!_n(p,S)&&(l+=p-S,s[h]=S,l.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?h--:h++}}if(_n(l,0))return e;{const u=n<0?o:a,h=e[u];kt(h!=null);const f=h+l,p=wr({paneConstraints:t,paneIndex:u,initialSize:f});if(s[u]=p,!_n(p,f)){let v=f-p,g=n<0?o:a;for(;g>=0&&g<t.length;){const m=s[g];kt(m!=null);const x=m+v,M=wr({paneConstraints:t,paneIndex:g,initialSize:x});if(_n(m,M)||(v-=M-m,s[g]=M),_n(v,0))break;n>0?g--:g++}}}const c=s.reduce((u,h)=>h+u,0);return _n(c,100)?s:e}let Pl=null,Zi=null;function Ef(n){switch(n){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function KM(){Zi!==null&&(document.head.removeChild(Zi),Pl=null,Zi=null)}function Eo(n,e){if(Pl===n)return;Pl=n;const t=Ef(n);Zi===null&&(Zi=e.createElement("style"),e.head.appendChild(Zi)),Zi.innerHTML=`*{cursor: ${t}!important;}`}function ZM({defaultSize:n,dragState:e,layout:t,panesArray:i,paneIndex:r,precision:s=3}){const a=t[r];let o;return a==null?o=n??"1":i.length===1?o="1":o=a.toPrecision(s),{flexBasis:0,flexGrow:o,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Rd(n){try{if(typeof localStorage>"u")throw new TypeError("localStorage is not supported in this environment");n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>localStorage.setItem(e,t)}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function wf(n){return`paneforge:${n}`}function Tf(n){return n.map(t=>t.opts.order.current?`${t.opts.order.current}:${JSON.stringify(t.constraints)}`:JSON.stringify(t.constraints)).sort().join(",")}function Af(n,e){try{const t=wf(n),i=e.getItem(t),r=JSON.parse(i||"");if(typeof r=="object"&&r!==null)return r}catch{}return null}function $M(n,e,t){const i=Af(n,t)||{},r=Tf(e);return i[r]||null}function JM(n,e,t,i,r){const s=wf(n),a=Tf(e),o=Af(n,r)||{};o[a]={expandToSizes:Object.fromEntries(t.entries()),layout:i};try{r.setItem(s,JSON.stringify(o))}catch(l){console.error(l)}}const Cd={};function QM(n,e=10){let t=null;return(...r)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r)},e)}}function eE({autoSaveId:n,layout:e,storage:t,panesArray:i,paneSizeBeforeCollapse:r}){if(e.length===0||e.length!==i.length)return;let s=Cd[n];s==null&&(s=QM(JM,zM),Cd[n]=s);const a=[...i],o=new Map(r);s(n,a,o,e,t)}const ns={getItem:n=>(Rd(ns),ns.getItem(n)),setItem:(n,e)=>{Rd(ns),ns.setItem(n,e)}},Hc=new im("PaneGroup");class Gc{static create(e){return Hc.set(new Gc(e))}opts;attachment;domContext;#e=we(null);get dragState(){return d(this.#e)}set dragState(e){O(this.#e,e)}#t=we([]);get layout(){return d(this.#t)}set layout(e){O(this.#t,e)}#n=we([]);get panesArray(){return d(this.#n)}set panesArray(e){O(this.#n,e)}#i=we(!1);get panesArrayChanged(){return d(this.#i)}set panesArrayChanged(e){O(this.#i,e,!0)}#r=we($n({}));get paneIdToLastNotifiedSizeMap(){return d(this.#r)}set paneIdToLastNotifiedSizeMap(e){O(this.#r,e,!0)}paneSizeBeforeCollapseMap=new Map;prevDelta=0;constructor(e){this.opts=e,this.attachment=zc(this.opts.ref),this.domContext=new Bc(this.opts.ref),Js([()=>this.opts.id.current,()=>this.layout,()=>this.panesArray],()=>HM({groupId:this.opts.id.current,layout:this.layout,panesArray:this.panesArray,domContext:this.domContext})),Rt(()=>nn(()=>this.#s())),Js([()=>this.opts.autoSaveId.current,()=>this.layout,()=>this.opts.storage.current],()=>{this.opts.autoSaveId.current&&eE({autoSaveId:this.opts.autoSaveId.current,layout:this.layout,storage:this.opts.storage.current,panesArray:this.panesArray,paneSizeBeforeCollapse:this.paneSizeBeforeCollapseMap})}),Js(()=>this.panesArrayChanged,()=>{if(!this.panesArrayChanged)return;this.panesArrayChanged=!1;const t=this.layout;let i=null;if(this.opts.autoSaveId.current){const s=$M(this.opts.autoSaveId.current,this.panesArray,this.opts.storage.current);s&&(this.paneSizeBeforeCollapseMap=new Map(Object.entries(s.expandToSizes)),i=s.layout)}i==null&&(i=GM({panesArray:this.panesArray}));const r=WM({layout:i,paneConstraints:this.panesArray.map(s=>s.constraints)});Kr(t,r)||(this.layout=r,this.opts.onLayout.current?.(r),Zr(this.panesArray,r,this.paneIdToLastNotifiedSizeMap))})}setLayout=e=>{this.layout=e};registerResizeHandle=e=>t=>{t.preventDefault();const i=this.opts.direction.current,r=this.dragState,s=this.opts.id.current,a=this.opts.keyboardResizeBy.current,o=this.layout,l=this.panesArray,{initialLayout:c}=r??{},u=this.domContext.getDocument(),h=Ad({groupId:s,dragHandleId:e,domContext:this.domContext});let f=jM({event:t,dragHandleId:e,dir:i,initialDragState:r,keyboardResizeBy:a,domContext:this.domContext});if(f===0)return;const p=i==="horizontal";u.dir==="rtl"&&p&&(f=-f);const v=l.map(m=>m.constraints),S=$r({delta:f,layout:c??o,paneConstraints:v,pivotIndices:h,trigger:xf(t)?"keyboard":"mouse-or-touch"}),g=!Kr(o,S);(bf(t)||Sf(t))&&this.prevDelta!==f&&(this.prevDelta=f,Eo(g?p?"horizontal":"vertical":p?f<0?"horizontal-min":"horizontal-max":f<0?"vertical-min":"vertical-max",u)),g&&(this.setLayout(S),this.opts.onLayout.current?.(S),Zr(l,S,this.paneIdToLastNotifiedSizeMap))};resizePane=(e,t)=>{const i=this.layout,r=this.panesArray,s=r.map(h=>h.constraints),{paneSize:a,pivotIndices:o}=Sr(r,e,i);kt(a!=null);const c=yr(r,e)===r.length-1?a-t:t-a,u=$r({delta:c,layout:i,paneConstraints:s,pivotIndices:o,trigger:"imperative-api"});Kr(i,u)||(this.setLayout(u),this.opts.onLayout.current?.(u),Zr(r,u,this.paneIdToLastNotifiedSizeMap))};startDragging=(e,t)=>{const i=this.opts.direction.current,r=this.layout,s=Vc(e,this.domContext);kt(s);const a=Mf(i,t);this.dragState={dragHandleId:e,dragHandleRect:s.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r}};stopDragging=()=>{KM(),this.dragState=null};isPaneCollapsed=e=>{const t=this.panesArray,i=this.layout,{collapsedSize:r=0,collapsible:s,paneSize:a}=Sr(t,e,i);return typeof a!="number"||typeof r!="number"?!1:s===!0&&_n(a,r)};expandPane=e=>{const t=this.layout,i=this.panesArray;if(!e.constraints.collapsible)return;const r=i.map(v=>v.constraints),{collapsedSize:s=0,paneSize:a,minSize:o=0,pivotIndices:l}=Sr(i,e,t);if(a!==s)return;const c=this.paneSizeBeforeCollapseMap.get(e.opts.id.current),u=c!=null&&c>=o?c:o,f=yr(i,e)===i.length-1?a-u:u-a,p=$r({delta:f,layout:t,paneConstraints:r,pivotIndices:l,trigger:"imperative-api"});Kr(t,p)||(this.setLayout(p),this.opts.onLayout.current?.(p),Zr(i,p,this.paneIdToLastNotifiedSizeMap))};collapsePane=e=>{const t=this.layout,i=this.panesArray;if(!e.constraints.collapsible)return;const r=i.map(h=>h.constraints),{collapsedSize:s=0,paneSize:a,pivotIndices:o}=Sr(i,e,t);if(kt(a!=null),a===s)return;this.paneSizeBeforeCollapseMap.set(e.opts.id.current,a);const c=yr(i,e)===i.length-1?a-s:s-a,u=$r({delta:c,layout:t,paneConstraints:r,pivotIndices:o,trigger:"imperative-api"});Kr(t,u)||(this.layout=u,this.opts.onLayout.current?.(u),Zr(i,u,this.paneIdToLastNotifiedSizeMap))};getPaneSize=e=>Sr(this.panesArray,e,this.layout).paneSize;getPaneStyle=(e,t)=>{const i=this.panesArray,r=this.layout,s=this.dragState,a=yr(i,e);return ZM({defaultSize:t,dragState:s,layout:r,panesArray:i,paneIndex:a})};isPaneExpanded=e=>{const{collapsedSize:t=0,collapsible:i,paneSize:r}=Sr(this.panesArray,e,this.layout);return!i||r>t};registerPane=e=>{const t=[...this.panesArray,e];return t.sort((i,r)=>{const s=i.opts.order.current,a=r.opts.order.current;return s==null&&a==null?0:s==null?-1:a==null?1:s-a}),this.panesArray=t,this.panesArrayChanged=!0,()=>{const i=[...this.panesArray],r=yr(this.panesArray,e);r<0||(i.splice(r,1),this.panesArray=i,delete this.paneIdToLastNotifiedSizeMap[e.opts.id.current],this.panesArrayChanged=!0)}};#s=()=>{const e=this.opts.id.current,t=bs(e,this.domContext),i=this.panesArray,r=t.map(s=>{const a=s.getAttribute("data-pane-resizer-id");if(!a)return er;const[o,l]=qM({groupId:e,handleId:a,panesArray:i,domContext:this.domContext});if(o==null||l==null)return er;const u=SM(s,"keydown",h=>{if(h.defaultPrevented||h.key!=="Enter")return;h.preventDefault();const f=this.panesArray,p=f.findIndex(C=>C.opts.id.current===o);if(p<0)return;const v=f[p];kt(v);const S=this.layout,g=S[p],{collapsedSize:m=0,collapsible:x,minSize:M=0}=v.constraints;if(!(g!=null&&x))return;const T=$r({delta:_n(g,m)?M-g:m-g,layout:S,paneConstraints:f.map(C=>C.constraints),pivotIndices:Ad({groupId:e,dragHandleId:a,domContext:this.domContext}),trigger:"keyboard"});S!==T&&(this.layout=T)});return()=>{u()}});return()=>{for(const s of r)s()}};#a=z(()=>({id:this.opts.id.current,"data-pane-group":"","data-direction":this.opts.direction.current,"data-pane-group-id":this.opts.id.current,style:{display:"flex",flexDirection:this.opts.direction.current==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"},...this.attachment}));get props(){return d(this.#a)}set props(e){O(this.#a,e)}}const tE=["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Home"];class Wc{static create(e){return new Wc(e,Hc.get())}opts;#e;attachment;domContext;#t=z(()=>this.#e.dragState?.dragHandleId===this.opts.id.current);#n=we(!1);resizeHandler=null;constructor(e,t){this.opts=e,this.#e=t,this.attachment=zc(this.opts.ref),this.domContext=new Bc(this.opts.ref),Rt(()=>{this.opts.disabled.current?this.resizeHandler=null:this.resizeHandler=this.#e.registerResizeHandle(this.opts.id.current)}),Rt(()=>{const i=this.opts.ref.current;if(!i)return;const r=this.opts.disabled.current,s=this.resizeHandler,a=d(this.#t);if(r||s===null||!a)return;const o=f=>{s(f)},l=f=>{s(f)},c=()=>{i.blur(),this.#e.stopDragging(),this.opts.onDraggingChange.current(!1)},u=this.domContext.getDocument().body,h=this.domContext.getWindow();return vf(Kt(u,"contextmenu",c),Kt(u,"mousemove",o),Kt(u,"touchmove",o,{passive:!1}),Kt(u,"mouseleave",l),Kt(h,"mouseup",c),Kt(h,"touchend",c))})}#i=e=>{e.preventDefault(),!this.opts.disabled.current&&(this.#e.startDragging(this.opts.id.current,e),this.opts.onDraggingChange.current(!0))};#r=()=>{const e=this.opts.ref.current;e&&(e.blur(),this.#e.stopDragging(),this.opts.onDraggingChange.current(!1))};#s=e=>{if(this.opts.disabled.current||!this.resizeHandler||e.defaultPrevented)return;if(tE.includes(e.key)){e.preventDefault(),this.resizeHandler(e);return}if(e.key!=="F6")return;e.preventDefault();const t=bs(this.#e.opts.id.current,this.domContext),i=yf({groupId:this.#e.opts.id.current,id:this.opts.id.current,domContext:this.domContext});if(i===null)return;let r=0;e.shiftKey?i>0?r=i-1:r=t.length-1:i+1<t.length?r=i+1:r=0,t[r].focus()};#a=()=>{O(this.#n,!1)};#o=()=>{O(this.#n,!0)};#l=e=>{this.#i(e)};#c=()=>{this.#r()};#d=()=>{this.#r()};#h=()=>{this.#r()};#f=e=>{this.#i(e)};#u=z(()=>({id:this.opts.id.current,role:"separator","data-direction":this.#e.opts.direction.current,"data-pane-group-id":this.#e.opts.id.current,"data-active":d(this.#t)?"pointer":d(this.#n)?"keyboard":void 0,"data-enabled":!this.opts.disabled.current,"data-pane-resizer-id":this.opts.id.current,"data-pane-resizer":"",tabIndex:this.opts.tabIndex.current,style:{cursor:Ef(this.#e.opts.direction.current),touchAction:"none",userSelect:"none","-webkit-user-select":"none","-webkit-touch-callout":"none"},onkeydown:this.#s,onblur:this.#a,onfocus:this.#o,onmousedown:this.#l,onmouseup:this.#c,ontouchcancel:this.#d,ontouchend:this.#h,ontouchstart:this.#f,...this.attachment}));get props(){return d(this.#u)}set props(e){O(this.#u,e)}}class Xc{static create(e){return new Xc(e,Hc.get())}opts;group;attachment;domContext;#e=we("");#t=z(()=>({onCollapse:this.opts.onCollapse.current,onExpand:this.opts.onExpand.current,onResize:this.opts.onResize.current}));get callbacks(){return d(this.#t)}set callbacks(e){O(this.#t,e)}#n=z(()=>({collapsedSize:this.opts.collapsedSize.current,collapsible:this.opts.collapsible.current,defaultSize:this.opts.defaultSize.current,maxSize:this.opts.maxSize.current,minSize:this.opts.minSize.current}));get constraints(){return d(this.#n)}set constraints(e){O(this.#n,e)}#i=e=>{O(this.#e,e,!0),IM(()=>{if(this.opts.ref.current){const t=this.opts.ref.current;if(!(getComputedStyle(t).transitionDuration!=="0s")){O(this.#e,"");return}const s=a=>{a.propertyName==="flex-grow"&&(O(this.#e,""),t.removeEventListener("transitionend",s))};t.addEventListener("transitionend",s)}else O(this.#e,"")})};pane={collapse:()=>{this.#i("collapsing"),this.group.collapsePane(this)},expand:()=>{this.#i("expanding"),this.group.expandPane(this)},getSize:()=>this.group.getPaneSize(this),isCollapsed:()=>this.group.isPaneCollapsed(this),isExpanded:()=>this.group.isPaneExpanded(this),resize:e=>this.group.resizePane(this,e),getId:()=>this.opts.id.current};constructor(e,t){this.opts=e,this.group=t,this.attachment=zc(this.opts.ref),this.domContext=new Bc(this.opts.ref),Ea(()=>this.group.registerPane(this)),Js(()=>Gl(this.constraints),()=>{this.group.panesArrayChanged=!0})}#r=z(()=>this.group.isPaneCollapsed(this));#s=z(()=>d(this.#e)!==""?d(this.#e):d(this.#r)?"collapsed":"expanded");#a=z(()=>({id:this.opts.id.current,style:this.group.getPaneStyle(this,this.opts.defaultSize.current),"data-pane":"","data-pane-id":this.opts.id.current,"data-pane-group-id":this.group.opts.id.current,"data-collapsed":d(this.#r)?"":void 0,"data-expanded":d(this.#r)?void 0:"","data-pane-state":d(this.#s),...this.attachment}));get props(){return d(this.#a)}set props(e){O(this.#a,e)}}var nE=Z("<div><!></div>");function iE(n,e){const t=Un();nt(e,!0);let i=me(e,"autoSaveId",3,null),r=me(e,"id",3,t),s=me(e,"keyboardResizeBy",3,null),a=me(e,"onLayoutChange",3,er),o=me(e,"storage",3,ns),l=me(e,"ref",15,null),c=lt(e,["$$slots","$$events","$$legacy","autoSaveId","direction","id","keyboardResizeBy","onLayoutChange","storage","ref","child","children"]);const u=Gc.create({id:St.with(()=>r()??t),ref:St.with(()=>l(),T=>l(T)),autoSaveId:St.with(()=>i()),direction:St.with(()=>e.direction),keyboardResizeBy:St.with(()=>s()),onLayout:St.with(()=>a()),storage:St.with(()=>o())}),h=()=>u.layout,f=u.setLayout,p=()=>u.opts.id.current,v=z(()=>Oc(c,u.props));var S={getLayout:h,setLayout:f,getId:p},g=Pe(),m=ae(g);{var x=T=>{var C=Pe(),y=ae(C);Ct(y,()=>e.child,()=>({props:d(v)})),D(T,C)},M=T=>{var C=nE();sn(C,()=>({...d(v)}));var y=Q(C);Ct(y,()=>e.children??Ut),q(C),D(T,C)};_e(m,T=>{e.child?T(x):T(M,-1)})}return D(n,g),it(S)}var rE=Z("<div><!></div>");function as(n,e){const t=Un();nt(e,!0);let i=me(e,"id",3,t),r=me(e,"ref",15,null),s=me(e,"onCollapse",3,er),a=me(e,"onExpand",3,er),o=me(e,"onResize",3,er),l=lt(e,["$$slots","$$events","$$legacy","id","ref","collapsedSize","collapsible","defaultSize","maxSize","minSize","onCollapse","onExpand","onResize","order","child","children"]);const c=Xc.create({id:St.with(()=>i()),ref:St.with(()=>r(),I=>r(I)),collapsedSize:St.with(()=>e.collapsedSize),collapsible:St.with(()=>e.collapsible),defaultSize:St.with(()=>e.defaultSize),maxSize:St.with(()=>e.maxSize),minSize:St.with(()=>e.minSize),onCollapse:St.with(()=>s()),onExpand:St.with(()=>a()),onResize:St.with(()=>o()),order:St.with(()=>e.order)}),u=c.pane.collapse,h=c.pane.expand,f=c.pane.getSize,p=c.pane.isCollapsed,v=c.pane.isExpanded,S=c.pane.resize,g=c.pane.getId,m=z(()=>Oc(l,c.props));var x={collapse:u,expand:h,getSize:f,isCollapsed:p,isExpanded:v,resize:S,getId:g},M=Pe(),T=ae(M);{var C=I=>{var _=Pe(),E=ae(_);Ct(E,()=>e.child,()=>({props:d(m)})),D(I,_)},y=I=>{var _=rE();sn(_,()=>({...d(m)}));var E=Q(_);Ct(E,()=>e.children??Ut),q(_),D(I,_)};_e(T,I=>{e.child?I(C):I(y,-1)})}return D(n,M),it(x)}var sE=Z("<div><!></div>");function aE(n,e){const t=Un();nt(e,!0);let i=me(e,"id",3,t),r=me(e,"ref",15,null),s=me(e,"disabled",3,!1),a=me(e,"onDraggingChange",3,er),o=me(e,"tabindex",3,0),l=lt(e,["$$slots","$$events","$$legacy","id","ref","disabled","onDraggingChange","tabindex","child","children"]);const c=Wc.create({id:St.with(()=>i()),ref:St.with(()=>r(),S=>r(S)),disabled:St.with(()=>s()),onDraggingChange:St.with(()=>a()),tabIndex:St.with(()=>o())}),u=z(()=>Oc(l,c.props));var h=Pe(),f=ae(h);{var p=S=>{var g=Pe(),m=ae(g);Ct(m,()=>e.child,()=>({props:d(u)})),D(S,g)},v=S=>{var g=sE();sn(g,()=>({...d(u)}));var m=Q(g);Ct(m,()=>e.children??Ut),q(g),D(S,g)};_e(f,S=>{e.child?S(p):S(v,-1)})}D(n,h),it()}var oE=Z('<div class="h-10 w-1 z-10 flex shrink-0 rounded-lg bg-border transition-[background-color,transform] duration-150 group-hover/handle:scale-y-110 group-hover/handle:bg-foreground/40 group-active/handle:bg-foreground/60"></div>');function Dl(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"withHandle",3,!1),r=lt(e,["$$slots","$$events","$$legacy","ref","class","withHandle"]);var s=Pe(),a=ae(s);{let o=z(()=>Ln("cn-resizable-handle group/handle after:inset-y-0 after:w-1 data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:translate-x-0 relative flex w-px items-center justify-center bg-border after:absolute after:left-1/2 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-hidden data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 [&[data-direction=vertical]>div]:rotate-90",e.class));We(a,()=>aE,(l,c)=>{c(l,_t({"data-slot":"resizable-handle",get class(){return d(o)}},()=>r,{get ref(){return t()},set ref(u){t(u)},children:(u,h)=>{var f=Pe(),p=ae(f);{var v=S=>{var g=oE();D(S,g)};_e(p,S=>{i()&&S(v)})}D(u,f)},$$slots:{default:!0}}))})}D(n,s),it()}function Rf(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"this",15),r=lt(e,["$$slots","$$events","$$legacy","ref","this","class"]);var s=Pe(),a=ae(s);{let o=z(()=>Ln("cn-resizable-panel-group flex h-full w-full data-[direction=vertical]:flex-col",e.class));We(a,()=>iE,(l,c)=>{Nn(c(l,_t({"data-slot":"resizable-pane-group",get class(){return d(o)}},()=>r,{get ref(){return t()},set ref(u){t(u)}})),u=>i(u),()=>i())})}D(n,s),it()}var lE=Z('<div class="inset-0 absolute z-10 animate-[selva-viewer-fade-in_0.2s_ease-out] backdrop-blur-[2px] transition-all duration-300"></div>'),cE=Z('<button class="h-10 w-10 shadow-lg hover:shadow-xl flex items-center justify-center rounded-lg border border-border bg-card/90 transition-all hover:bg-card active:scale-95" title="Download screenshot" aria-label="Download screenshot"><!></button>'),uE=Z('<button class="h-10 w-10 shadow-lg hover:shadow-xl flex items-center justify-center rounded-lg border border-border bg-card/90 transition-all hover:bg-card active:scale-95"><!></button>'),dE=Z('<button aria-label="Toggle scene manager"><!></button>'),hE=Z("<div><!> <!> <!></div>"),fE=Z('<div class="relative h-full w-full" style="touch-action: none;"><canvas class="block h-full w-full"></canvas> <div></div> <!> <!></div>'),pE=Z("<!> <!>",1),mE=Z("<!> <!>",1),gE=Z("<div><!></div> <!>",1);function Pd(n,e){nt(e,!0);const t={showScreenshotButton:!0,showFullscreenButton:!0,showSceneManager:!0,enableMeshClick:!0,backgroundColor:"#E6E6E6"};let i=me(e,"isFullscreen",15,!1),r=me(e,"isSolving",3,!1),s=me(e,"isBlurred",3,!1),a=me(e,"drawerOpen",3,!1),o=me(e,"viewerConfig",19,()=>({}));const l=z(()=>({...t,...o()}));let c,u=we(null),h=null,f=null,p=!1,v=we(0),S=we(!1),g=we(!1),m=we(null),x=we(null);Rt(()=>{if(a())O(S,!0);else{const L=setTimeout(()=>{O(S,!1)},Nr.TIMEOUTS.DRAWER_ANIMATION_MS);return()=>clearTimeout(L)}}),Ea(()=>{if(!c)return;const L={environment:{backgroundColor:d(l).backgroundColor},controls:{},events:{onMeshMetadataClicked:d(l).enableMeshClick?k=>{T(k)&&(O(m,k,!0),O(x,k?.name||"Object",!0))}:void 0}},P=of(c,L);return O(u,P.scene,!0),h=P.camera,f=P.controls,()=>{P.dispose()}}),Rt(()=>{d(u)&&h&&f&&(lf(d(u),e.meshes,h,f,p),nn(()=>jd(v)),!p&&e.meshes.length>0&&(p=!0))});function M(){i(!i())}function T(L){if(!L)return!1;if(L.metadata&&typeof L.metadata=="object"){const W=L.metadata;return Object.keys(W).length>0}const P=new Set(["name","layer","originalIndex","sourceComponentId","vertexCount","faceCount","vertexOffset","faceOffset"]);return Object.entries(L).filter(([W])=>!P.has(W)).length>0}function C(){c&&requestAnimationFrame(()=>{c.toBlob(L=>{if(!L)return;const P=URL.createObjectURL(L),k=document.createElement("a"),W=new Date().toISOString().slice(0,19).replace(/:/g,"-");k.href=P,k.download=`viewer-${W}.png`,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(P)})})}var y=gE(),I=ae(y),_=Q(I);We(_,()=>Rf,(L,P)=>{P(L,{direction:"horizontal",class:"h-full w-full",children:(k,W)=>{var H=mE(),N=ae(H);We(N,()=>as,(U,X)=>{X(U,{defaultSize:100,minSize:40,children:(V,$)=>{var ee=fE(),Se=Q(ee);Nn(Se,oe=>c=oe,()=>c);var ye=ue(Se,2),ve=ue(ye,2);{var K=oe=>{var Me=lE();D(oe,Me)};_e(ve,oe=>{r()&&oe(K)})}var fe=ue(ve,2);{var Y=oe=>{var Me=hE(),Ee=Q(Me);{var Ge=Oe=>{var Be=cE(),He=Q(Be);jm(He,{class:"h-5 w-5 text-card-foreground"}),q(Be),Lt("click",Be,C),D(Oe,Be)};_e(Ee,Oe=>{d(l).showScreenshotButton&&Oe(Ge)})}var Te=ue(Ee,2);{var Ve=Oe=>{var Be=uE(),He=Q(Be);{var B=pe=>{dc(pe,{class:"h-5 w-5 text-card-foreground"})},De=pe=>{uc(pe,{class:"h-5 w-5 text-card-foreground"})};_e(He,pe=>{i()?pe(B):pe(De,-1)})}q(Be),Le(()=>{Vt(Be,"title",i()?"Exit fullscreen":"Enter fullscreen"),Vt(Be,"aria-label",i()?"Exit fullscreen":"Enter fullscreen")}),Lt("click",Be,M),D(Oe,Be)};_e(Te,Oe=>{d(l).showFullscreenButton&&Oe(Ve)})}var Ae=ue(Te,2);{var Ce=Oe=>{var Be=dE(),He=Q(Be);{let B=z(()=>d(g)?"text-primary":"text-secondary-foreground");tg(He,{get class(){return`h-5 w-5 ${d(B)??""}`}})}q(Be),Le(()=>{At(Be,1,`h-10 w-10 shadow-lg hover:shadow-xl flex items-center justify-center rounded-lg border transition-all active:scale-95 ${d(g)?"border-muted-foreground/40 bg-secondary/40 hover:bg-secondary/60":"border-muted-foreground/50 bg-card/90 hover:bg-secondary/80"}`),Vt(Be,"title",d(g)?"Hide scene manager":"Show scene manager")}),Lt("click",Be,()=>O(g,!d(g))),D(Oe,Be)};_e(Ae,Oe=>{d(l).showSceneManager&&Oe(Ce)})}q(Me),Le(()=>{At(Me,1,`right-4 ${i()?"bottom-4":"bottom-16 sm:bottom-4"} gap-2 absolute z-50 flex items-center`),hi(Me,d(S)?"opacity: 0; pointer-events: none;":"opacity: 1; pointer-events: auto;")}),D(oe,Me)};_e(fe,oe=>{(d(l).showScreenshotButton||d(l).showFullscreenButton||d(l).showSceneManager)&&oe(Y)})}q(ee),Le(()=>At(ye,1,`inset-0 blur-overlay absolute z-20 ${s()?"blur-overlay-active":"blur-overlay-inactive"}`,"svelte-1kkkj78")),D(V,ee)},$$slots:{default:!0}})});var R=ue(N,2);{var F=U=>{var X=pE(),V=ae(X);We(V,()=>Dl,(ee,Se)=>{Se(ee,{withHandle:!0})});var $=ue(V,2);We($,()=>as,(ee,Se)=>{Se(ee,{defaultSize:15,minSize:8,maxSize:30,children:(ye,ve)=>{Gy(ye,{get scene(){return d(u)},get sceneVersion(){return d(v)}})},$$slots:{default:!0}})}),D(U,X)};_e(R,U=>{d(g)&&d(u)&&U(F)})}D(k,H)},$$slots:{default:!0}})}),q(I);var E=ue(I,2);{let L=z(()=>d(m)!==null);rM(E,{get open(){return d(L)},get metadata(){return d(m)},get meshName(){return d(x)},get isFullscreen(){return i()},onOpenChange:P=>{P||setTimeout(()=>{O(m,null),O(x,null)},200)}})}Le(()=>At(I,1,`min-h-64 sm:min-h-96 lg:min-h-125 relative h-full flex-1 border ${i()?"fullscreen-viewer":"overflow-hidden rounded-[0.625rem]"}`,"svelte-1kkkj78")),D(n,y),it()}Gn(["click"]);var vE=Z("<!> Solving...",1),_E=Z("<!> Press to calculate",1),xE=Z("<!> Calculate",1),bE=Z("<!> Up to date",1),SE=Z('<div class="bottom-0 mt-3 pb-3 pt-2 backdrop-blur-sm px-2 sticky border-t border-border/50"><!></div>');function wo(n,e){nt(e,!0);let t=me(e,"hasNeverSolved",3,!1);var i=SE(),r=Q(i);{let s=z(()=>e.hasPendingChanges?"default":"ghost"),a=z(()=>!e.hasPendingChanges&&!e.isSolving),o=z(()=>e.hasPendingChanges&&!e.isSolving?"selva-pending-pulse shadow-md":""),l=z(()=>!e.hasPendingChanges&&!e.isSolving?"text-muted-foreground":"");mn(r,{get variant(){return d(s)},size:"lg",onclick:()=>!e.isSolving&&e.oncalculate(),get disabled(){return d(a)},get"aria-busy"(){return e.isSolving},get class(){return`gap-2 font-medium w-full transition-all duration-200
|
|
4113
|
+
`," ")),e.hidden!==!0&&(e.hidden=void 0,delete e.hidden),e.disabled!==!0&&(e.disabled=void 0,delete e.disabled),e}const CM=typeof window<"u"?window:void 0;function PM(n){let e=n.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class DM{#e;#t;constructor(e={}){const{window:t=CM,document:i=t?.document}=e;t!==void 0&&(this.#e=i,this.#t=mp(r=>{const s=Kt(t,"focusin",r),a=Kt(t,"focusout",r);return()=>{s(),a()}}))}get current(){return this.#t?.(),this.#e?PM(this.#e):null}}new DM;function IM(n){hp().then(n)}const LM=9;function NM(n){return Uc(n)&&n.nodeType===LM}function UM(n){return Uc(n)&&n.constructor?.name==="VisualViewport"}function FM(n){return NM(n)?n:UM(n)?n.document:n?.ownerDocument??document}function OM(n){let e=n.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class Bc{element;#e=z(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return d(this.#e)}set root(e){O(this.#e,e)}constructor(e){typeof e=="function"?this.element=St.with(e):this.element=e}getDocument=()=>FM(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>OM(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)}function zc(n,e){return{[Pp()]:t=>St.isBox(n)?(n.current=t,nn(()=>e?.(t)),()=>{"isConnected"in t&&t.isConnected||(n.current=null)}):(n(t),nn(()=>e?.(t)),()=>{"isConnected"in t&&t.isConnected||n(null)})}}function BM({layout:n,panesArray:e,pivotIndices:t}){let i=0,r=100,s=0,a=0;const o=t[0];for(let h=0;h<e.length;h++){const f=e[h].constraints,{maxSize:p=100,minSize:v=0}=f;h===o?(i=v,r=p):(s+=v,a+=p)}const l=Math.min(r,100-s),c=Math.max(i,100-a),u=n[o];return{valueMax:l,valueMin:c,valueNow:u}}function kt(n,e="Assertion failed!"){if(!n)throw console.error(e),new Error(e)}const zM=100,kc=10;function _n(n,e,t=kc){return hs(n,e,t)===0}function hs(n,e,t=kc){const i=Td(n,t),r=Td(e,t);return Math.sign(i-r)}function Kr(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function Td(n,e){return Number.parseFloat(n.toFixed(e))}const Na=typeof document<"u";function kM(n){return n instanceof HTMLElement}function xf(n){return n.type==="keydown"}function bf(n){return n.type.startsWith("mouse")}function Sf(n){return n.type.startsWith("touch")}function wr({paneConstraints:n,paneIndex:e,initialSize:t}){const i=n[e];kt(i!=null,"Pane constraints should not be null.");const{collapsedSize:r=0,collapsible:s,maxSize:a=100,minSize:o=0}=i;let l=t;return hs(l,o)<0&&(l=VM(l,s,r,o)),l=Math.min(a,l),Number.parseFloat(l.toFixed(kc))}function VM(n,e,t,i){if(!e)return i;const r=(t+i)/2;return hs(n,r)<0?t:i}function er(){}function HM({groupId:n,layout:e,panesArray:t,domContext:i}){const r=bs(n,i);for(let s=0;s<t.length-1;s++){const{valueMax:a,valueMin:o,valueNow:l}=BM({layout:e,panesArray:t,pivotIndices:[s,s+1]}),c=r[s];if(kM(c)){const u=t[s];c.setAttribute("aria-controls",u.opts.id.current),c.setAttribute("aria-valuemax",`${Math.round(a)}`),c.setAttribute("aria-valuemin",`${Math.round(o)}`),c.setAttribute("aria-valuenow",l!=null?`${Math.round(l)}`:"")}}return()=>{for(const s of r)s.removeAttribute("aria-controls"),s.removeAttribute("aria-valuemax"),s.removeAttribute("aria-valuemin"),s.removeAttribute("aria-valuenow")}}function bs(n,e){return Na?Array.from(e.querySelectorAll(`[data-pane-resizer-id][data-pane-group-id="${n}"]`)):[]}function yf({groupId:n,id:e,domContext:t}){return Na?bs(n,t).findIndex(s=>s.getAttribute("data-pane-resizer-id")===e)??null:null}function Ad({groupId:n,dragHandleId:e,domContext:t}){const i=yf({groupId:n,id:e,domContext:t});return i!=null?[i,i+1]:[-1,-1]}function Sr(n,e,t){const i=n.map(c=>c.constraints),r=yr(n,e),s=i[r],o=r===n.length-1?[r-1,r]:[r,r+1],l=t[r];return{...s,paneSize:l,pivotIndices:o}}function yr(n,e){return n.findIndex(t=>t.opts.id.current===e.opts.id.current)}function Zr(n,e,t){for(let i=0;i<e.length;i++){const r=e[i],s=n[i];kt(s);const{collapsedSize:a=0,collapsible:o}=s.constraints,l=t[s.opts.id.current];if(!(l==null||r!==l))continue;t[s.opts.id.current]=r;const{onCollapse:c,onExpand:u,onResize:h}=s.callbacks;h?.(r,l),o&&(c||u)&&(u&&(l==null||l===a)&&r!==a&&u(),c&&(l==null||l!==a)&&r===a&&c())}}function GM({panesArray:n}){const e=Array(n.length),t=n.map(s=>s.constraints);let i=0,r=100;for(let s=0;s<n.length;s++){const a=t[s];kt(a);const{defaultSize:o}=a;o!=null&&(i++,e[s]=o,r-=o)}for(let s=0;s<n.length;s++){const a=t[s];kt(a);const{defaultSize:o}=a;if(o!=null)continue;const l=n.length-i,c=r/l;i++,e[s]=c,r-=c}return e}function WM({layout:n,paneConstraints:e}){const t=[...n],i=t.reduce((s,a)=>s+a,0);if(t.length!==e.length)throw new Error(`Invalid ${e.length} pane layout: ${t.map(s=>`${s}%`).join(", ")}`);if(!_n(i,100))for(let s=0;s<e.length;s++){const a=t[s];kt(a!=null);const o=100/i*a;t[s]=o}let r=0;for(let s=0;s<e.length;s++){const a=t[s];kt(a!=null);const o=wr({paneConstraints:e,paneIndex:s,initialSize:a});a!==o&&(r+=a-o,t[s]=o)}if(!_n(r,0))for(let s=0;s<e.length;s++){const a=t[s];kt(a!=null);const o=a+r,l=wr({paneConstraints:e,paneIndex:s,initialSize:o});if(a!==l&&(r-=l-a,t[s]=l,_n(r,0)))break}return t}function XM(n,e){if(!Na)return null;const t=e.querySelector(`[data-pane-group][data-pane-group-id="${n}"]`);return t||null}function Vc(n,e){if(!Na)return null;const t=e.querySelector(`[data-pane-resizer-id="${n}"]`);return t||null}function YM({event:n,dragHandleId:e,dir:t,initialDragState:i,domContext:r}){const s=t==="horizontal",a=Vc(e,r);kt(a);const o=a.getAttribute("data-pane-group-id");kt(o);const{initialCursorPosition:l}=i,c=Mf(t,n),u=XM(o,r);kt(u);const h=u.getBoundingClientRect(),f=s?h.width:h.height;return(c-l)/f*100}function jM({event:n,dragHandleId:e,dir:t,initialDragState:i,keyboardResizeBy:r,domContext:s}){if(xf(n)){const a=t==="horizontal";let o=0;n.shiftKey?o=100:r!=null?o=r:o=10;let l=0;switch(n.key){case"ArrowDown":l=a?0:o;break;case"ArrowLeft":l=a?-o:0;break;case"ArrowRight":l=a?o:0;break;case"ArrowUp":l=a?0:-o;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return i==null?0:YM({event:n,dragHandleId:e,dir:t,initialDragState:i,domContext:s})}function Mf(n,e){const t=n==="horizontal";if(bf(e))return t?e.clientX:e.clientY;if(Sf(e)){const i=e.touches[0];return kt(i),t?i.screenX:i.screenY}else throw new Error(`Unsupported event type "${e.type}"`)}function qM({groupId:n,handleId:e,panesArray:t,domContext:i}){const r=Vc(e,i),s=bs(n,i),a=r?s.indexOf(r):-1,o=t[a]?.opts.id.current??null,l=t[a+1]?.opts.id.current??null;return[o,l]}function $r({delta:n,layout:e,paneConstraints:t,pivotIndices:i,trigger:r}){if(_n(n,0))return e;const s=[...e],[a,o]=i;let l=0;if(r==="keyboard"){{const u=n<0?o:a,h=t[u];if(kt(h),h.collapsible){const f=e[u];kt(f!=null);const p=t[u];kt(p);const{collapsedSize:v=0,minSize:S=0}=p;if(_n(f,v)){const g=S-f;hs(g,Math.abs(n))>0&&(n=n<0?0-g:g)}}}{const u=n<0?a:o,h=t[u];kt(h);const{collapsible:f}=h;if(f){const p=e[u];kt(p!=null);const v=t[u];kt(v);const{collapsedSize:S=0,minSize:g=0}=v;if(_n(p,g)){const m=p-S;hs(m,Math.abs(n))>0&&(n=n<0?0-m:m)}}}}{const u=n<0?1:-1;let h=n<0?o:a,f=0;for(;;){const v=e[h];kt(v!=null);const g=wr({paneConstraints:t,paneIndex:h,initialSize:100})-v;if(f+=g,h+=u,h<0||h>=t.length)break}const p=Math.min(Math.abs(n),Math.abs(f));n=n<0?0-p:p}{let h=n<0?a:o;for(;h>=0&&h<t.length;){const f=Math.abs(n)-Math.abs(l),p=e[h];kt(p!=null);const v=p-f,S=wr({paneConstraints:t,paneIndex:h,initialSize:v});if(!_n(p,S)&&(l+=p-S,s[h]=S,l.toPrecision(3).localeCompare(Math.abs(n).toPrecision(3),void 0,{numeric:!0})>=0))break;n<0?h--:h++}}if(_n(l,0))return e;{const u=n<0?o:a,h=e[u];kt(h!=null);const f=h+l,p=wr({paneConstraints:t,paneIndex:u,initialSize:f});if(s[u]=p,!_n(p,f)){let v=f-p,g=n<0?o:a;for(;g>=0&&g<t.length;){const m=s[g];kt(m!=null);const x=m+v,M=wr({paneConstraints:t,paneIndex:g,initialSize:x});if(_n(m,M)||(v-=M-m,s[g]=M),_n(v,0))break;n>0?g--:g++}}}const c=s.reduce((u,h)=>h+u,0);return _n(c,100)?s:e}let Pl=null,Zi=null;function Ef(n){switch(n){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function KM(){Zi!==null&&(document.head.removeChild(Zi),Pl=null,Zi=null)}function Eo(n,e){if(Pl===n)return;Pl=n;const t=Ef(n);Zi===null&&(Zi=e.createElement("style"),e.head.appendChild(Zi)),Zi.innerHTML=`*{cursor: ${t}!important;}`}function ZM({defaultSize:n,dragState:e,layout:t,panesArray:i,paneIndex:r,precision:s=3}){const a=t[r];let o;return a==null?o=n??"1":i.length===1?o="1":o=a.toPrecision(s),{flexBasis:0,flexGrow:o,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Rd(n){try{if(typeof localStorage>"u")throw new TypeError("localStorage is not supported in this environment");n.getItem=e=>localStorage.getItem(e),n.setItem=(e,t)=>localStorage.setItem(e,t)}catch(e){console.error(e),n.getItem=()=>null,n.setItem=()=>{}}}function wf(n){return`paneforge:${n}`}function Tf(n){return n.map(t=>t.opts.order.current?`${t.opts.order.current}:${JSON.stringify(t.constraints)}`:JSON.stringify(t.constraints)).sort().join(",")}function Af(n,e){try{const t=wf(n),i=e.getItem(t),r=JSON.parse(i||"");if(typeof r=="object"&&r!==null)return r}catch{}return null}function $M(n,e,t){const i=Af(n,t)||{},r=Tf(e);return i[r]||null}function JM(n,e,t,i,r){const s=wf(n),a=Tf(e),o=Af(n,r)||{};o[a]={expandToSizes:Object.fromEntries(t.entries()),layout:i};try{r.setItem(s,JSON.stringify(o))}catch(l){console.error(l)}}const Cd={};function QM(n,e=10){let t=null;return(...r)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r)},e)}}function eE({autoSaveId:n,layout:e,storage:t,panesArray:i,paneSizeBeforeCollapse:r}){if(e.length===0||e.length!==i.length)return;let s=Cd[n];s==null&&(s=QM(JM,zM),Cd[n]=s);const a=[...i],o=new Map(r);s(n,a,o,e,t)}const ns={getItem:n=>(Rd(ns),ns.getItem(n)),setItem:(n,e)=>{Rd(ns),ns.setItem(n,e)}},Hc=new im("PaneGroup");class Gc{static create(e){return Hc.set(new Gc(e))}opts;attachment;domContext;#e=we(null);get dragState(){return d(this.#e)}set dragState(e){O(this.#e,e)}#t=we([]);get layout(){return d(this.#t)}set layout(e){O(this.#t,e)}#n=we([]);get panesArray(){return d(this.#n)}set panesArray(e){O(this.#n,e)}#i=we(!1);get panesArrayChanged(){return d(this.#i)}set panesArrayChanged(e){O(this.#i,e,!0)}#r=we($n({}));get paneIdToLastNotifiedSizeMap(){return d(this.#r)}set paneIdToLastNotifiedSizeMap(e){O(this.#r,e,!0)}paneSizeBeforeCollapseMap=new Map;prevDelta=0;constructor(e){this.opts=e,this.attachment=zc(this.opts.ref),this.domContext=new Bc(this.opts.ref),Js([()=>this.opts.id.current,()=>this.layout,()=>this.panesArray],()=>HM({groupId:this.opts.id.current,layout:this.layout,panesArray:this.panesArray,domContext:this.domContext})),Rt(()=>nn(()=>this.#s())),Js([()=>this.opts.autoSaveId.current,()=>this.layout,()=>this.opts.storage.current],()=>{this.opts.autoSaveId.current&&eE({autoSaveId:this.opts.autoSaveId.current,layout:this.layout,storage:this.opts.storage.current,panesArray:this.panesArray,paneSizeBeforeCollapse:this.paneSizeBeforeCollapseMap})}),Js(()=>this.panesArrayChanged,()=>{if(!this.panesArrayChanged)return;this.panesArrayChanged=!1;const t=this.layout;let i=null;if(this.opts.autoSaveId.current){const s=$M(this.opts.autoSaveId.current,this.panesArray,this.opts.storage.current);s&&(this.paneSizeBeforeCollapseMap=new Map(Object.entries(s.expandToSizes)),i=s.layout)}i==null&&(i=GM({panesArray:this.panesArray}));const r=WM({layout:i,paneConstraints:this.panesArray.map(s=>s.constraints)});Kr(t,r)||(this.layout=r,this.opts.onLayout.current?.(r),Zr(this.panesArray,r,this.paneIdToLastNotifiedSizeMap))})}setLayout=e=>{this.layout=e};registerResizeHandle=e=>t=>{t.preventDefault();const i=this.opts.direction.current,r=this.dragState,s=this.opts.id.current,a=this.opts.keyboardResizeBy.current,o=this.layout,l=this.panesArray,{initialLayout:c}=r??{},u=this.domContext.getDocument(),h=Ad({groupId:s,dragHandleId:e,domContext:this.domContext});let f=jM({event:t,dragHandleId:e,dir:i,initialDragState:r,keyboardResizeBy:a,domContext:this.domContext});if(f===0)return;const p=i==="horizontal";u.dir==="rtl"&&p&&(f=-f);const v=l.map(m=>m.constraints),S=$r({delta:f,layout:c??o,paneConstraints:v,pivotIndices:h,trigger:xf(t)?"keyboard":"mouse-or-touch"}),g=!Kr(o,S);(bf(t)||Sf(t))&&this.prevDelta!==f&&(this.prevDelta=f,Eo(g?p?"horizontal":"vertical":p?f<0?"horizontal-min":"horizontal-max":f<0?"vertical-min":"vertical-max",u)),g&&(this.setLayout(S),this.opts.onLayout.current?.(S),Zr(l,S,this.paneIdToLastNotifiedSizeMap))};resizePane=(e,t)=>{const i=this.layout,r=this.panesArray,s=r.map(h=>h.constraints),{paneSize:a,pivotIndices:o}=Sr(r,e,i);kt(a!=null);const c=yr(r,e)===r.length-1?a-t:t-a,u=$r({delta:c,layout:i,paneConstraints:s,pivotIndices:o,trigger:"imperative-api"});Kr(i,u)||(this.setLayout(u),this.opts.onLayout.current?.(u),Zr(r,u,this.paneIdToLastNotifiedSizeMap))};startDragging=(e,t)=>{const i=this.opts.direction.current,r=this.layout,s=Vc(e,this.domContext);kt(s);const a=Mf(i,t);this.dragState={dragHandleId:e,dragHandleRect:s.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r}};stopDragging=()=>{KM(),this.dragState=null};isPaneCollapsed=e=>{const t=this.panesArray,i=this.layout,{collapsedSize:r=0,collapsible:s,paneSize:a}=Sr(t,e,i);return typeof a!="number"||typeof r!="number"?!1:s===!0&&_n(a,r)};expandPane=e=>{const t=this.layout,i=this.panesArray;if(!e.constraints.collapsible)return;const r=i.map(v=>v.constraints),{collapsedSize:s=0,paneSize:a,minSize:o=0,pivotIndices:l}=Sr(i,e,t);if(a!==s)return;const c=this.paneSizeBeforeCollapseMap.get(e.opts.id.current),u=c!=null&&c>=o?c:o,f=yr(i,e)===i.length-1?a-u:u-a,p=$r({delta:f,layout:t,paneConstraints:r,pivotIndices:l,trigger:"imperative-api"});Kr(t,p)||(this.setLayout(p),this.opts.onLayout.current?.(p),Zr(i,p,this.paneIdToLastNotifiedSizeMap))};collapsePane=e=>{const t=this.layout,i=this.panesArray;if(!e.constraints.collapsible)return;const r=i.map(h=>h.constraints),{collapsedSize:s=0,paneSize:a,pivotIndices:o}=Sr(i,e,t);if(kt(a!=null),a===s)return;this.paneSizeBeforeCollapseMap.set(e.opts.id.current,a);const c=yr(i,e)===i.length-1?a-s:s-a,u=$r({delta:c,layout:t,paneConstraints:r,pivotIndices:o,trigger:"imperative-api"});Kr(t,u)||(this.layout=u,this.opts.onLayout.current?.(u),Zr(i,u,this.paneIdToLastNotifiedSizeMap))};getPaneSize=e=>Sr(this.panesArray,e,this.layout).paneSize;getPaneStyle=(e,t)=>{const i=this.panesArray,r=this.layout,s=this.dragState,a=yr(i,e);return ZM({defaultSize:t,dragState:s,layout:r,panesArray:i,paneIndex:a})};isPaneExpanded=e=>{const{collapsedSize:t=0,collapsible:i,paneSize:r}=Sr(this.panesArray,e,this.layout);return!i||r>t};registerPane=e=>{const t=[...this.panesArray,e];return t.sort((i,r)=>{const s=i.opts.order.current,a=r.opts.order.current;return s==null&&a==null?0:s==null?-1:a==null?1:s-a}),this.panesArray=t,this.panesArrayChanged=!0,()=>{const i=[...this.panesArray],r=yr(this.panesArray,e);r<0||(i.splice(r,1),this.panesArray=i,delete this.paneIdToLastNotifiedSizeMap[e.opts.id.current],this.panesArrayChanged=!0)}};#s=()=>{const e=this.opts.id.current,t=bs(e,this.domContext),i=this.panesArray,r=t.map(s=>{const a=s.getAttribute("data-pane-resizer-id");if(!a)return er;const[o,l]=qM({groupId:e,handleId:a,panesArray:i,domContext:this.domContext});if(o==null||l==null)return er;const u=SM(s,"keydown",h=>{if(h.defaultPrevented||h.key!=="Enter")return;h.preventDefault();const f=this.panesArray,p=f.findIndex(C=>C.opts.id.current===o);if(p<0)return;const v=f[p];kt(v);const S=this.layout,g=S[p],{collapsedSize:m=0,collapsible:x,minSize:M=0}=v.constraints;if(!(g!=null&&x))return;const T=$r({delta:_n(g,m)?M-g:m-g,layout:S,paneConstraints:f.map(C=>C.constraints),pivotIndices:Ad({groupId:e,dragHandleId:a,domContext:this.domContext}),trigger:"keyboard"});S!==T&&(this.layout=T)});return()=>{u()}});return()=>{for(const s of r)s()}};#a=z(()=>({id:this.opts.id.current,"data-pane-group":"","data-direction":this.opts.direction.current,"data-pane-group-id":this.opts.id.current,style:{display:"flex",flexDirection:this.opts.direction.current==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"},...this.attachment}));get props(){return d(this.#a)}set props(e){O(this.#a,e)}}const tE=["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Home"];class Wc{static create(e){return new Wc(e,Hc.get())}opts;#e;attachment;domContext;#t=z(()=>this.#e.dragState?.dragHandleId===this.opts.id.current);#n=we(!1);resizeHandler=null;constructor(e,t){this.opts=e,this.#e=t,this.attachment=zc(this.opts.ref),this.domContext=new Bc(this.opts.ref),Rt(()=>{this.opts.disabled.current?this.resizeHandler=null:this.resizeHandler=this.#e.registerResizeHandle(this.opts.id.current)}),Rt(()=>{const i=this.opts.ref.current;if(!i)return;const r=this.opts.disabled.current,s=this.resizeHandler,a=d(this.#t);if(r||s===null||!a)return;const o=f=>{s(f)},l=f=>{s(f)},c=()=>{i.blur(),this.#e.stopDragging(),this.opts.onDraggingChange.current(!1)},u=this.domContext.getDocument().body,h=this.domContext.getWindow();return vf(Kt(u,"contextmenu",c),Kt(u,"mousemove",o),Kt(u,"touchmove",o,{passive:!1}),Kt(u,"mouseleave",l),Kt(h,"mouseup",c),Kt(h,"touchend",c))})}#i=e=>{e.preventDefault(),!this.opts.disabled.current&&(this.#e.startDragging(this.opts.id.current,e),this.opts.onDraggingChange.current(!0))};#r=()=>{const e=this.opts.ref.current;e&&(e.blur(),this.#e.stopDragging(),this.opts.onDraggingChange.current(!1))};#s=e=>{if(this.opts.disabled.current||!this.resizeHandler||e.defaultPrevented)return;if(tE.includes(e.key)){e.preventDefault(),this.resizeHandler(e);return}if(e.key!=="F6")return;e.preventDefault();const t=bs(this.#e.opts.id.current,this.domContext),i=yf({groupId:this.#e.opts.id.current,id:this.opts.id.current,domContext:this.domContext});if(i===null)return;let r=0;e.shiftKey?i>0?r=i-1:r=t.length-1:i+1<t.length?r=i+1:r=0,t[r].focus()};#a=()=>{O(this.#n,!1)};#o=()=>{O(this.#n,!0)};#l=e=>{this.#i(e)};#c=()=>{this.#r()};#d=()=>{this.#r()};#h=()=>{this.#r()};#f=e=>{this.#i(e)};#u=z(()=>({id:this.opts.id.current,role:"separator","data-direction":this.#e.opts.direction.current,"data-pane-group-id":this.#e.opts.id.current,"data-active":d(this.#t)?"pointer":d(this.#n)?"keyboard":void 0,"data-enabled":!this.opts.disabled.current,"data-pane-resizer-id":this.opts.id.current,"data-pane-resizer":"",tabIndex:this.opts.tabIndex.current,style:{cursor:Ef(this.#e.opts.direction.current),touchAction:"none",userSelect:"none","-webkit-user-select":"none","-webkit-touch-callout":"none"},onkeydown:this.#s,onblur:this.#a,onfocus:this.#o,onmousedown:this.#l,onmouseup:this.#c,ontouchcancel:this.#d,ontouchend:this.#h,ontouchstart:this.#f,...this.attachment}));get props(){return d(this.#u)}set props(e){O(this.#u,e)}}class Xc{static create(e){return new Xc(e,Hc.get())}opts;group;attachment;domContext;#e=we("");#t=z(()=>({onCollapse:this.opts.onCollapse.current,onExpand:this.opts.onExpand.current,onResize:this.opts.onResize.current}));get callbacks(){return d(this.#t)}set callbacks(e){O(this.#t,e)}#n=z(()=>({collapsedSize:this.opts.collapsedSize.current,collapsible:this.opts.collapsible.current,defaultSize:this.opts.defaultSize.current,maxSize:this.opts.maxSize.current,minSize:this.opts.minSize.current}));get constraints(){return d(this.#n)}set constraints(e){O(this.#n,e)}#i=e=>{O(this.#e,e,!0),IM(()=>{if(this.opts.ref.current){const t=this.opts.ref.current;if(!(getComputedStyle(t).transitionDuration!=="0s")){O(this.#e,"");return}const s=a=>{a.propertyName==="flex-grow"&&(O(this.#e,""),t.removeEventListener("transitionend",s))};t.addEventListener("transitionend",s)}else O(this.#e,"")})};pane={collapse:()=>{this.#i("collapsing"),this.group.collapsePane(this)},expand:()=>{this.#i("expanding"),this.group.expandPane(this)},getSize:()=>this.group.getPaneSize(this),isCollapsed:()=>this.group.isPaneCollapsed(this),isExpanded:()=>this.group.isPaneExpanded(this),resize:e=>this.group.resizePane(this,e),getId:()=>this.opts.id.current};constructor(e,t){this.opts=e,this.group=t,this.attachment=zc(this.opts.ref),this.domContext=new Bc(this.opts.ref),Ea(()=>this.group.registerPane(this)),Js(()=>Gl(this.constraints),()=>{this.group.panesArrayChanged=!0})}#r=z(()=>this.group.isPaneCollapsed(this));#s=z(()=>d(this.#e)!==""?d(this.#e):d(this.#r)?"collapsed":"expanded");#a=z(()=>({id:this.opts.id.current,style:this.group.getPaneStyle(this,this.opts.defaultSize.current),"data-pane":"","data-pane-id":this.opts.id.current,"data-pane-group-id":this.group.opts.id.current,"data-collapsed":d(this.#r)?"":void 0,"data-expanded":d(this.#r)?void 0:"","data-pane-state":d(this.#s),...this.attachment}));get props(){return d(this.#a)}set props(e){O(this.#a,e)}}var nE=Z("<div><!></div>");function iE(n,e){const t=Un();nt(e,!0);let i=me(e,"autoSaveId",3,null),r=me(e,"id",3,t),s=me(e,"keyboardResizeBy",3,null),a=me(e,"onLayoutChange",3,er),o=me(e,"storage",3,ns),l=me(e,"ref",15,null),c=lt(e,["$$slots","$$events","$$legacy","autoSaveId","direction","id","keyboardResizeBy","onLayoutChange","storage","ref","child","children"]);const u=Gc.create({id:St.with(()=>r()??t),ref:St.with(()=>l(),T=>l(T)),autoSaveId:St.with(()=>i()),direction:St.with(()=>e.direction),keyboardResizeBy:St.with(()=>s()),onLayout:St.with(()=>a()),storage:St.with(()=>o())}),h=()=>u.layout,f=u.setLayout,p=()=>u.opts.id.current,v=z(()=>Oc(c,u.props));var S={getLayout:h,setLayout:f,getId:p},g=Pe(),m=ae(g);{var x=T=>{var C=Pe(),y=ae(C);Ct(y,()=>e.child,()=>({props:d(v)})),D(T,C)},M=T=>{var C=nE();sn(C,()=>({...d(v)}));var y=Q(C);Ct(y,()=>e.children??Ut),q(C),D(T,C)};_e(m,T=>{e.child?T(x):T(M,-1)})}return D(n,g),it(S)}var rE=Z("<div><!></div>");function as(n,e){const t=Un();nt(e,!0);let i=me(e,"id",3,t),r=me(e,"ref",15,null),s=me(e,"onCollapse",3,er),a=me(e,"onExpand",3,er),o=me(e,"onResize",3,er),l=lt(e,["$$slots","$$events","$$legacy","id","ref","collapsedSize","collapsible","defaultSize","maxSize","minSize","onCollapse","onExpand","onResize","order","child","children"]);const c=Xc.create({id:St.with(()=>i()),ref:St.with(()=>r(),I=>r(I)),collapsedSize:St.with(()=>e.collapsedSize),collapsible:St.with(()=>e.collapsible),defaultSize:St.with(()=>e.defaultSize),maxSize:St.with(()=>e.maxSize),minSize:St.with(()=>e.minSize),onCollapse:St.with(()=>s()),onExpand:St.with(()=>a()),onResize:St.with(()=>o()),order:St.with(()=>e.order)}),u=c.pane.collapse,h=c.pane.expand,f=c.pane.getSize,p=c.pane.isCollapsed,v=c.pane.isExpanded,S=c.pane.resize,g=c.pane.getId,m=z(()=>Oc(l,c.props));var x={collapse:u,expand:h,getSize:f,isCollapsed:p,isExpanded:v,resize:S,getId:g},M=Pe(),T=ae(M);{var C=I=>{var _=Pe(),E=ae(_);Ct(E,()=>e.child,()=>({props:d(m)})),D(I,_)},y=I=>{var _=rE();sn(_,()=>({...d(m)}));var E=Q(_);Ct(E,()=>e.children??Ut),q(_),D(I,_)};_e(T,I=>{e.child?I(C):I(y,-1)})}return D(n,M),it(x)}var sE=Z("<div><!></div>");function aE(n,e){const t=Un();nt(e,!0);let i=me(e,"id",3,t),r=me(e,"ref",15,null),s=me(e,"disabled",3,!1),a=me(e,"onDraggingChange",3,er),o=me(e,"tabindex",3,0),l=lt(e,["$$slots","$$events","$$legacy","id","ref","disabled","onDraggingChange","tabindex","child","children"]);const c=Wc.create({id:St.with(()=>i()),ref:St.with(()=>r(),S=>r(S)),disabled:St.with(()=>s()),onDraggingChange:St.with(()=>a()),tabIndex:St.with(()=>o())}),u=z(()=>Oc(l,c.props));var h=Pe(),f=ae(h);{var p=S=>{var g=Pe(),m=ae(g);Ct(m,()=>e.child,()=>({props:d(u)})),D(S,g)},v=S=>{var g=sE();sn(g,()=>({...d(u)}));var m=Q(g);Ct(m,()=>e.children??Ut),q(g),D(S,g)};_e(f,S=>{e.child?S(p):S(v,-1)})}D(n,h),it()}var oE=Z('<div class="h-10 w-1 z-10 flex shrink-0 rounded-lg bg-border transition-[background-color,transform] duration-150 group-hover/handle:scale-y-110 group-hover/handle:bg-foreground/40 group-active/handle:bg-foreground/60"></div>');function Dl(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"withHandle",3,!1),r=lt(e,["$$slots","$$events","$$legacy","ref","class","withHandle"]);var s=Pe(),a=ae(s);{let o=z(()=>Ln("cn-resizable-handle group/handle after:inset-y-0 after:w-1 data-[direction=vertical]:after:left-0 data-[direction=vertical]:after:h-1 data-[direction=vertical]:after:translate-x-0 relative flex w-px items-center justify-center bg-border after:absolute after:left-1/2 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-hidden data-[direction=vertical]:h-px data-[direction=vertical]:w-full data-[direction=vertical]:after:w-full data-[direction=vertical]:after:-translate-y-1/2 [&[data-direction=vertical]>div]:rotate-90",e.class));We(a,()=>aE,(l,c)=>{c(l,_t({"data-slot":"resizable-handle",get class(){return d(o)}},()=>r,{get ref(){return t()},set ref(u){t(u)},children:(u,h)=>{var f=Pe(),p=ae(f);{var v=S=>{var g=oE();D(S,g)};_e(p,S=>{i()&&S(v)})}D(u,f)},$$slots:{default:!0}}))})}D(n,s),it()}function Rf(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"this",15),r=lt(e,["$$slots","$$events","$$legacy","ref","this","class"]);var s=Pe(),a=ae(s);{let o=z(()=>Ln("cn-resizable-panel-group flex h-full w-full data-[direction=vertical]:flex-col",e.class));We(a,()=>iE,(l,c)=>{Nn(c(l,_t({"data-slot":"resizable-pane-group",get class(){return d(o)}},()=>r,{get ref(){return t()},set ref(u){t(u)}})),u=>i(u),()=>i())})}D(n,s),it()}var lE=Z('<div class="inset-0 absolute z-10 animate-[selva-viewer-fade-in_0.2s_ease-out] backdrop-blur-[2px] transition-all duration-300"></div>'),cE=Z('<button class="h-10 w-10 shadow-lg hover:shadow-xl flex items-center justify-center rounded-lg border border-border bg-card/90 transition-all hover:bg-card active:scale-95" title="Download screenshot" aria-label="Download screenshot"><!></button>'),uE=Z('<button class="h-10 w-10 shadow-lg hover:shadow-xl flex items-center justify-center rounded-lg border border-border bg-card/90 transition-all hover:bg-card active:scale-95"><!></button>'),dE=Z('<button aria-label="Toggle scene manager"><!></button>'),hE=Z("<div><!> <!> <!></div>"),fE=Z('<div class="relative h-full w-full" style="touch-action: none;"><canvas class="block h-full w-full"></canvas> <div></div> <!> <!></div>'),pE=Z("<!> <!>",1),mE=Z("<!> <!>",1),gE=Z("<div><!></div> <!>",1);function Pd(n,e){nt(e,!0);const t={showScreenshotButton:!0,showFullscreenButton:!0,showSceneManager:!0,enableMeshClick:!0,backgroundColor:"#E6E6E6"};let i=me(e,"isFullscreen",15,!1),r=me(e,"isSolving",3,!1),s=me(e,"isBlurred",3,!1),a=me(e,"drawerOpen",3,!1),o=me(e,"viewerConfig",19,()=>({}));const l=z(()=>({...t,...o()}));let c,u=we(null),h=null,f=null,p=!1,v=we(0),S=we(!1),g=we(!1),m=we(null),x=we(null);Rt(()=>{if(a())O(S,!0);else{const L=setTimeout(()=>{O(S,!1)},Nr.TIMEOUTS.DRAWER_ANIMATION_MS);return()=>clearTimeout(L)}}),Ea(()=>{if(!c)return;const L={environment:{backgroundColor:d(l).backgroundColor},controls:{},events:{onMeshMetadataClicked:d(l).enableMeshClick?k=>{T(k)&&(O(m,k,!0),O(x,k?.name||"Object",!0))}:void 0}},P=of(c,L);return O(u,P.scene,!0),h=P.camera,f=P.controls,()=>{P.dispose()}}),Rt(()=>{d(u)&&h&&f&&(lf(d(u),e.meshes,h,f,p),nn(()=>jd(v)),!p&&e.meshes.length>0&&(p=!0))});function M(){i(!i())}function T(L){if(!L)return!1;if(L.metadata&&typeof L.metadata=="object"){const W=L.metadata;return Object.keys(W).length>0}const P=new Set(["name","layer","originalIndex","sourceComponentId","vertexCount","faceCount","vertexOffset","faceOffset"]);return Object.entries(L).filter(([W])=>!P.has(W)).length>0}function C(){c&&requestAnimationFrame(()=>{c.toBlob(L=>{if(!L)return;const P=URL.createObjectURL(L),k=document.createElement("a"),W=new Date().toISOString().slice(0,19).replace(/:/g,"-");k.href=P,k.download=`viewer-${W}.png`,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(P)})})}var y=gE(),I=ae(y),_=Q(I);We(_,()=>Rf,(L,P)=>{P(L,{direction:"horizontal",class:"h-full w-full",children:(k,W)=>{var H=mE(),N=ae(H);We(N,()=>as,(U,X)=>{X(U,{defaultSize:100,minSize:40,children:(V,$)=>{var ee=fE(),Se=Q(ee);Nn(Se,oe=>c=oe,()=>c);var ye=ue(Se,2),ve=ue(ye,2);{var K=oe=>{var Me=lE();D(oe,Me)};_e(ve,oe=>{r()&&oe(K)})}var fe=ue(ve,2);{var Y=oe=>{var Me=hE(),Ee=Q(Me);{var Ge=Oe=>{var Be=cE(),He=Q(Be);jm(He,{class:"h-5 w-5 text-card-foreground"}),q(Be),Lt("click",Be,C),D(Oe,Be)};_e(Ee,Oe=>{d(l).showScreenshotButton&&Oe(Ge)})}var Te=ue(Ee,2);{var Ve=Oe=>{var Be=uE(),He=Q(Be);{var B=pe=>{dc(pe,{class:"h-5 w-5 text-card-foreground"})},De=pe=>{uc(pe,{class:"h-5 w-5 text-card-foreground"})};_e(He,pe=>{i()?pe(B):pe(De,-1)})}q(Be),Le(()=>{Vt(Be,"title",i()?"Exit fullscreen":"Enter fullscreen"),Vt(Be,"aria-label",i()?"Exit fullscreen":"Enter fullscreen")}),Lt("click",Be,M),D(Oe,Be)};_e(Te,Oe=>{d(l).showFullscreenButton&&Oe(Ve)})}var Ae=ue(Te,2);{var Ce=Oe=>{var Be=dE(),He=Q(Be);{let B=z(()=>d(g)?"text-primary":"text-secondary-foreground");tg(He,{get class(){return`h-5 w-5 ${d(B)??""}`}})}q(Be),Le(()=>{At(Be,1,`h-10 w-10 shadow-lg hover:shadow-xl flex items-center justify-center rounded-lg border transition-all active:scale-95 ${d(g)?"border-muted-foreground/40 bg-secondary/40 hover:bg-secondary/60":"border-muted-foreground/50 bg-card/90 hover:bg-secondary/80"}`),Vt(Be,"title",d(g)?"Hide scene manager":"Show scene manager")}),Lt("click",Be,()=>O(g,!d(g))),D(Oe,Be)};_e(Ae,Oe=>{d(l).showSceneManager&&Oe(Ce)})}q(Me),Le(()=>{At(Me,1,`right-4 ${i()?"bottom-4":"bottom-16 sm:bottom-4"} gap-2 absolute z-50 flex items-center`),hi(Me,d(S)?"opacity: 0; pointer-events: none;":"opacity: 1; pointer-events: auto;")}),D(oe,Me)};_e(fe,oe=>{(d(l).showScreenshotButton||d(l).showFullscreenButton||d(l).showSceneManager)&&oe(Y)})}q(ee),Le(()=>At(ye,1,`inset-0 blur-overlay absolute z-20 ${s()?"blur-overlay-active":"blur-overlay-inactive"}`,"svelte-13y0czs")),D(V,ee)},$$slots:{default:!0}})});var R=ue(N,2);{var F=U=>{var X=pE(),V=ae(X);We(V,()=>Dl,(ee,Se)=>{Se(ee,{withHandle:!0})});var $=ue(V,2);We($,()=>as,(ee,Se)=>{Se(ee,{defaultSize:15,minSize:8,maxSize:30,children:(ye,ve)=>{Gy(ye,{get scene(){return d(u)},get sceneVersion(){return d(v)}})},$$slots:{default:!0}})}),D(U,X)};_e(R,U=>{d(g)&&d(u)&&U(F)})}D(k,H)},$$slots:{default:!0}})}),q(I);var E=ue(I,2);{let L=z(()=>d(m)!==null);rM(E,{get open(){return d(L)},get metadata(){return d(m)},get meshName(){return d(x)},get isFullscreen(){return i()},onOpenChange:P=>{P||setTimeout(()=>{O(m,null),O(x,null)},200)}})}Le(()=>At(I,1,`min-h-64 sm:min-h-96 lg:min-h-125 relative h-full flex-1 border ${i()?"fullscreen-viewer":"overflow-hidden rounded-[0.625rem]"}`,"svelte-13y0czs")),D(n,y),it()}Gn(["click"]);var vE=Z("<!> Solving...",1),_E=Z("<!> Press to calculate",1),xE=Z("<!> Calculate",1),bE=Z("<!> Up to date",1),SE=Z('<div class="bottom-0 mt-3 pb-3 pt-2 backdrop-blur-sm px-2 sticky border-t border-border/50"><!></div>');function wo(n,e){nt(e,!0);let t=me(e,"hasNeverSolved",3,!1);var i=SE(),r=Q(i);{let s=z(()=>e.hasPendingChanges?"default":"ghost"),a=z(()=>!e.hasPendingChanges&&!e.isSolving),o=z(()=>e.hasPendingChanges&&!e.isSolving?"selva-pending-pulse shadow-md":""),l=z(()=>!e.hasPendingChanges&&!e.isSolving?"text-muted-foreground":"");mn(r,{get variant(){return d(s)},size:"lg",onclick:()=>!e.isSolving&&e.oncalculate(),get disabled(){return d(a)},get"aria-busy"(){return e.isSolving},get class(){return`gap-2 font-medium w-full transition-all duration-200
|
|
4114
4114
|
${d(o)??""}
|
|
4115
|
-
${d(l)??""}`},children:(c,u)=>{var h=Pe(),f=ae(h);{var p=m=>{var x=vE(),M=ae(x);cc(M,{class:"h-4 w-4 animate-spin"}),ct(),D(m,x)},v=m=>{var x=_E(),M=ae(x);Dp(M,{class:"h-4 w-4"}),ct(),D(m,x)},S=m=>{var x=xE(),M=ae(x);rg(M,{class:"h-4 w-4"}),ct(),D(m,x)},g=m=>{var x=bE(),M=ae(x);th(M,{class:"h-4 w-4"}),ct(),D(m,x)};_e(f,m=>{e.isSolving?m(p):t()?m(v,1):e.hasPendingChanges?m(S,2):m(g,-1)})}D(c,h)},$$slots:{default:!0}})}q(i),D(n,i),it()}var yE=Z('<div class="bottom-6 left-6 gap-3 px-5 py-3 shadow-xl fixed z-50 flex animate-[selva-slideInLeft_0.2s_ease-out] items-center rounded-lg border border-primary/20 bg-primary text-primary-foreground svelte-qi729x"><div class="h-5 w-5 relative flex shrink-0 items-center justify-center svelte-qi729x"><div class="animate-ping absolute h-full w-full rounded-full bg-primary-foreground opacity-30 svelte-qi729x"></div> <div class="h-3 w-3 animate-spin rounded-full border-2 border-primary-foreground border-t-transparent svelte-qi729x"></div></div> <div class="leading-tight flex flex-col svelte-qi729x"><span class="text-sm font-semibold svelte-qi729x">Solving</span> <span class="text-xs opacity-70 svelte-qi729x">Grasshopper is calculating...</span></div></div>');function ME(n,e){var t=Pe(),i=ae(t);{var r=s=>{var a=yE();D(s,a)};_e(i,s=>{e.show&&s(r)})}D(n,t)}var EE=Z("<div><!></div>");function wE(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","class","children"]);var r=EE();sn(r,a=>({"data-slot":"card-action",class:a,...i}),[()=>Ln("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e.class)]);var s=Q(r);Ct(s,()=>e.children??Ut),q(r),Nn(r,a=>t(a),()=>t()),D(n,r),it()}var TE=Z("<!> <!>",1);function Dd(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"orientation",3,"vertical"),r=lt(e,["$$slots","$$events","$$legacy","ref","class","orientation","children"]);var s=Pe(),a=ae(s);{let o=z(()=>Ln("flex touch-none p-px transition-colors select-none",i()==="vertical"&&"w-2.5 h-full border-s border-s-transparent",i()==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e.class));We(a,()=>Am,(l,c)=>{c(l,_t({"data-slot":"scroll-area-scrollbar",get orientation(){return i()},get class(){return d(o)}},()=>r,{get ref(){return t()},set ref(u){t(u)},children:(u,h)=>{var f=TE(),p=ae(f);Ct(p,()=>e.children??Ut);var v=ue(p,2);We(v,()=>Pm,(S,g)=>{g(S,{"data-slot":"scroll-area-thumb",class:"relative flex-1 rounded-full bg-border"})}),D(u,f)},$$slots:{default:!0}}))})}D(n,s),it()}var AE=Z("<!> <!> <!> <!>",1);function Cf(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"viewportRef",15,null),r=me(e,"orientation",3,"vertical"),s=me(e,"scrollbarXClasses",3,""),a=me(e,"scrollbarYClasses",3,""),o=lt(e,["$$slots","$$events","$$legacy","ref","viewportRef","class","orientation","scrollbarXClasses","scrollbarYClasses","children"]);var l=Pe(),c=ae(l);{let u=z(()=>Ln("relative",e.class));We(c,()=>_m,(h,f)=>{f(h,_t({"data-slot":"scroll-area",get class(){return d(u)}},()=>o,{get ref(){return t()},set ref(p){t(p)},children:(p,v)=>{var S=AE(),g=ae(S);We(g,()=>bm,(y,I)=>{I(y,{"data-slot":"scroll-area-viewport",class:"size-full rounded-[inherit] ring-ring/10 outline-ring/50 transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 dark:ring-ring/20 dark:outline-ring/40",get ref(){return i()},set ref(_){i(_)},children:(_,E)=>{var L=Pe(),P=ae(L);Ct(P,()=>e.children??Ut),D(_,L)},$$slots:{default:!0}})});var m=ue(g,2);{var x=y=>{Dd(y,{orientation:"vertical",get class(){return a()}})};_e(m,y=>{(r()==="vertical"||r()==="both")&&y(x)})}var M=ue(m,2);{var T=y=>{Dd(y,{orientation:"horizontal",get class(){return s()}})};_e(M,y=>{(r()==="horizontal"||r()==="both")&&y(T)})}var C=ue(M,2);We(C,()=>Lm,(y,I)=>{I(y,{})}),D(p,S)},$$slots:{default:!0}}))})}D(n,l),it()}const Pf=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ua=(n,e,t,i="")=>{const r=n.split(":");if(n.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const o=r.pop(),l=r.pop(),c={provider:r.length>0?r[0]:i,prefix:l,name:o};return e&&!ca(c)?null:c}const s=r[0],a=s.split("-");if(a.length>1){const o={provider:i,prefix:a.shift(),name:a.join("-")};return e&&!ca(o)?null:o}if(t&&i===""){const o={provider:i,prefix:"",name:s};return e&&!ca(o,t)?null:o}return null},ca=(n,e)=>n?!!((e&&n.prefix===""||n.prefix)&&n.name):!1;function RE(n,e){const t=n.icons,i=n.aliases||Object.create(null),r=Object.create(null);function s(a){if(t[a])return r[a]=[];if(!(a in r)){r[a]=null;const o=i[a]&&i[a].parent,l=o&&s(o);l&&(r[a]=[o].concat(l))}return r[a]}return Object.keys(t).concat(Object.keys(i)).forEach(s),r}const Df=Object.freeze({left:0,top:0,width:16,height:16}),Sa=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Fa=Object.freeze({...Df,...Sa}),Il=Object.freeze({...Fa,body:"",hidden:!1});function CE(n,e){const t={};!n.hFlip!=!e.hFlip&&(t.hFlip=!0),!n.vFlip!=!e.vFlip&&(t.vFlip=!0);const i=((n.rotate||0)+(e.rotate||0))%4;return i&&(t.rotate=i),t}function Id(n,e){const t=CE(n,e);for(const i in Il)i in Sa?i in n&&!(i in t)&&(t[i]=Sa[i]):i in e?t[i]=e[i]:i in n&&(t[i]=n[i]);return t}function PE(n,e,t){const i=n.icons,r=n.aliases||Object.create(null);let s={};function a(o){s=Id(i[o]||r[o],s)}return a(e),t.forEach(a),Id(n,s)}function If(n,e){const t=[];if(typeof n!="object"||typeof n.icons!="object")return t;n.not_found instanceof Array&&n.not_found.forEach(r=>{e(r,null),t.push(r)});const i=RE(n);for(const r in i){const s=i[r];s&&(e(r,PE(n,r,s)),t.push(r))}return t}const DE={provider:"",aliases:{},not_found:{},...Df};function To(n,e){for(const t in e)if(t in n&&typeof n[t]!=typeof e[t])return!1;return!0}function Lf(n){if(typeof n!="object"||n===null)return null;const e=n;if(typeof e.prefix!="string"||!n.icons||typeof n.icons!="object"||!To(n,DE))return null;const t=e.icons;for(const r in t){const s=t[r];if(!r||typeof s.body!="string"||!To(s,Il))return null}const i=e.aliases||Object.create(null);for(const r in i){const s=i[r],a=s.parent;if(!r||typeof a!="string"||!t[a]&&!i[a]||!To(s,Il))return null}return e}const Ld=Object.create(null);function IE(n,e){return{provider:n,prefix:e,icons:Object.create(null),missing:new Set}}function zr(n,e){const t=Ld[n]||(Ld[n]=Object.create(null));return t[e]||(t[e]=IE(n,e))}function Nf(n,e){return Lf(e)?If(e,(t,i)=>{i?n.icons[t]=i:n.missing.add(t)}):[]}function LE(n,e,t){try{if(typeof t.body=="string")return n.icons[e]={...t},!0}catch{}return!1}let fs=!1;function Uf(n){return typeof n=="boolean"&&(fs=n),fs}function NE(n){const e=typeof n=="string"?Ua(n,!0,fs):n;if(e){const t=zr(e.provider,e.prefix),i=e.name;return t.icons[i]||(t.missing.has(i)?null:void 0)}}function UE(n,e){const t=Ua(n,!0,fs);if(!t)return!1;const i=zr(t.provider,t.prefix);return e?LE(i,t.name,e):(i.missing.add(t.name),!0)}function FE(n,e){if(typeof n!="object")return!1;if(typeof e!="string"&&(e=n.provider||""),fs&&!e&&!n.prefix){let i=!1;return Lf(n)&&(n.prefix="",If(n,(r,s)=>{UE(r,s)&&(i=!0)})),i}const t=n.prefix;return ca({prefix:t,name:"a"})?!!Nf(zr(e,t),n):!1}const Ff=Object.freeze({width:null,height:null}),Of=Object.freeze({...Ff,...Sa}),OE=/(-?[0-9.]*[0-9]+[0-9.]*)/g,BE=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Nd(n,e,t){if(e===1)return n;if(t=t||100,typeof n=="number")return Math.ceil(n*e*t)/t;if(typeof n!="string")return n;const i=n.split(OE);if(i===null||!i.length)return n;const r=[];let s=i.shift(),a=BE.test(s);for(;;){if(a){const o=parseFloat(s);isNaN(o)?r.push(s):r.push(Math.ceil(o*e*t)/t)}else r.push(s);if(s=i.shift(),s===void 0)return r.join("");a=!a}}function zE(n,e="defs"){let t="";const i=n.indexOf("<"+e);for(;i>=0;){const r=n.indexOf(">",i),s=n.indexOf("</"+e);if(r===-1||s===-1)break;const a=n.indexOf(">",s);if(a===-1)break;t+=n.slice(r+1,s).trim(),n=n.slice(0,i).trim()+n.slice(a+1)}return{defs:t,content:n}}function kE(n,e){return n?"<defs>"+n+"</defs>"+e:e}function VE(n,e,t){const i=zE(n);return kE(i.defs,e+i.content+t)}const HE=n=>n==="unset"||n==="undefined"||n==="none";function GE(n,e){const t={...Fa,...n},i={...Of,...e},r={left:t.left,top:t.top,width:t.width,height:t.height};let s=t.body;[t,i].forEach(S=>{const g=[],m=S.hFlip,x=S.vFlip;let M=S.rotate;m?x?M+=2:(g.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),g.push("scale(-1 1)"),r.top=r.left=0):x&&(g.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),g.push("scale(1 -1)"),r.top=r.left=0);let T;switch(M<0&&(M-=Math.floor(M/4)*4),M=M%4,M){case 1:T=r.height/2+r.top,g.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:g.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:T=r.width/2+r.left,g.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")");break}M%2===1&&(r.left!==r.top&&(T=r.left,r.left=r.top,r.top=T),r.width!==r.height&&(T=r.width,r.width=r.height,r.height=T)),g.length&&(s=VE(s,'<g transform="'+g.join(" ")+'">',"</g>"))});const a=i.width,o=i.height,l=r.width,c=r.height;let u,h;a===null?(h=o===null?"1em":o==="auto"?c:o,u=Nd(h,l/c)):(u=a==="auto"?l:a,h=o===null?Nd(u,c/l):o==="auto"?c:o);const f={},p=(S,g)=>{HE(g)||(f[S]=g.toString())};p("width",u),p("height",h);const v=[r.left,r.top,l,c];return f.viewBox=v.join(" "),{attributes:f,viewBox:v,body:s}}const WE=/\sid="(\S+)"/g,Ud=new Map;function XE(n){n=n.replace(/[0-9]+$/,"")||"a";const e=Ud.get(n)||0;return Ud.set(n,e+1),e?`${n}${e}`:n}function YE(n){const e=[];let t;for(;t=WE.exec(n);)e.push(t[1]);if(!e.length)return n;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(r=>{const s=XE(r),a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),n=n.replace(new RegExp(i,"g"),""),n}const Ll=Object.create(null);function jE(n,e){Ll[n]=e}function Nl(n){return Ll[n]||Ll[""]}function Yc(n){let e;if(typeof n.resources=="string")e=[n.resources];else if(e=n.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:n.path||"/",maxURL:n.maxURL||500,rotate:n.rotate||750,timeout:n.timeout||5e3,random:n.random===!0,index:n.index||0,dataAfterTimeout:n.dataAfterTimeout!==!1}}const jc=Object.create(null),Jr=["https://api.simplesvg.com","https://api.unisvg.com"],ua=[];for(;Jr.length>0;)Jr.length===1||Math.random()>.5?ua.push(Jr.shift()):ua.push(Jr.pop());jc[""]=Yc({resources:["https://api.iconify.design"].concat(ua)});function qE(n,e){const t=Yc(e);return t===null?!1:(jc[n]=t,!0)}function qc(n){return jc[n]}const KE=()=>{let n;try{if(n=fetch,typeof n=="function")return n}catch{}};let Fd=KE();function ZE(n,e){const t=qc(n);if(!t)return 0;let i;if(!t.maxURL)i=0;else{let r=0;t.resources.forEach(a=>{r=Math.max(r,a.length)});const s=e+".json?icons=";i=t.maxURL-r-t.path.length-s.length}return i}function $E(n){return n===404}const JE=(n,e,t)=>{const i=[],r=ZE(n,e),s="icons";let a={type:s,provider:n,prefix:e,icons:[]},o=0;return t.forEach((l,c)=>{o+=l.length+1,o>=r&&c>0&&(i.push(a),a={type:s,provider:n,prefix:e,icons:[]},o=l.length),a.icons.push(l)}),i.push(a),i};function QE(n){if(typeof n=="string"){const e=qc(n);if(e)return e.path}return"/"}const e1=(n,e,t)=>{if(!Fd){t("abort",424);return}let i=QE(e.provider);switch(e.type){case"icons":{const s=e.prefix,a=e.icons.join(","),o=new URLSearchParams({icons:a});i+=s+".json?"+o.toString();break}case"custom":{const s=e.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:t("abort",400);return}let r=503;Fd(n+i).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{t($E(a)?"abort":"next",a)});return}return r=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?t("abort",s):t("next",r)});return}setTimeout(()=>{t("success",s)})}).catch(()=>{t("next",r)})},t1={prepare:JE,send:e1};function Bf(n,e){n.forEach(t=>{const i=t.loaderCallbacks;i&&(t.loaderCallbacks=i.filter(r=>r.id!==e))})}function n1(n){n.pendingCallbacksFlag||(n.pendingCallbacksFlag=!0,setTimeout(()=>{n.pendingCallbacksFlag=!1;const e=n.loaderCallbacks?n.loaderCallbacks.slice(0):[];if(!e.length)return;let t=!1;const i=n.provider,r=n.prefix;e.forEach(s=>{const a=s.icons,o=a.pending.length;a.pending=a.pending.filter(l=>{if(l.prefix!==r)return!0;const c=l.name;if(n.icons[c])a.loaded.push({provider:i,prefix:r,name:c});else if(n.missing.has(c))a.missing.push({provider:i,prefix:r,name:c});else return t=!0,!0;return!1}),a.pending.length!==o&&(t||Bf([n],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let i1=0;function r1(n,e,t){const i=i1++,r=Bf.bind(null,t,i);if(!e.pending.length)return r;const s={id:i,icons:e,callback:n,abort:r};return t.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),r}function s1(n){const e={loaded:[],missing:[],pending:[]},t=Object.create(null);n.sort((r,s)=>r.provider!==s.provider?r.provider.localeCompare(s.provider):r.prefix!==s.prefix?r.prefix.localeCompare(s.prefix):r.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return n.forEach(r=>{if(i.name===r.name&&i.prefix===r.prefix&&i.provider===r.provider)return;i=r;const s=r.provider,a=r.prefix,o=r.name,l=t[s]||(t[s]=Object.create(null)),c=l[a]||(l[a]=zr(s,a));let u;o in c.icons?u=e.loaded:a===""||c.missing.has(o)?u=e.missing:u=e.pending;const h={provider:s,prefix:a,name:o};u.push(h)}),e}function a1(n,e=!0,t=!1){const i=[];return n.forEach(r=>{const s=typeof r=="string"?Ua(r,e,t):r;s&&i.push(s)}),i}const o1={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function l1(n,e,t,i){const r=n.resources.length,s=n.random?Math.floor(Math.random()*r):n.index;let a;if(n.random){let y=n.resources.slice(0);for(a=[];y.length>1;){const I=Math.floor(Math.random()*y.length);a.push(y[I]),y=y.slice(0,I).concat(y.slice(I+1))}a=a.concat(y)}else a=n.resources.slice(s).concat(n.resources.slice(0,s));const o=Date.now();let l="pending",c=0,u,h=null,f=[],p=[];typeof i=="function"&&p.push(i);function v(){h&&(clearTimeout(h),h=null)}function S(){l==="pending"&&(l="aborted"),v(),f.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),f=[]}function g(y,I){I&&(p=[]),typeof y=="function"&&p.push(y)}function m(){return{startTime:o,payload:e,status:l,queriesSent:c,queriesPending:f.length,subscribe:g,abort:S}}function x(){l="failed",p.forEach(y=>{y(void 0,u)})}function M(){f.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),f=[]}function T(y,I,_){const E=I!=="success";switch(f=f.filter(L=>L!==y),l){case"pending":break;case"failed":if(E||!n.dataAfterTimeout)return;break;default:return}if(I==="abort"){u=_,x();return}if(E){u=_,f.length||(a.length?C():x());return}if(v(),M(),!n.random){const L=n.resources.indexOf(y.resource);L!==-1&&L!==n.index&&(n.index=L)}l="completed",p.forEach(L=>{L(_)})}function C(){if(l!=="pending")return;v();const y=a.shift();if(y===void 0){if(f.length){h=setTimeout(()=>{v(),l==="pending"&&(M(),x())},n.timeout);return}x();return}const I={status:"pending",resource:y,callback:(_,E)=>{T(I,_,E)}};f.push(I),c++,h=setTimeout(C,n.rotate),t(y,e,I.callback)}return setTimeout(C),m}function zf(n){const e={...o1,...n};let t=[];function i(){t=t.filter(a=>a().status==="pending")}function r(a,o,l){const c=l1(e,a,o,(u,h)=>{i(),l&&l(u,h)});return t.push(c),c}function s(a){return t.find(o=>a(o))||null}return{query:r,find:s,setIndex:a=>{e.index=a},getIndex:()=>e.index,cleanup:i}}function Od(){}const Ao=Object.create(null);function c1(n){if(!Ao[n]){const e=qc(n);if(!e)return;Ao[n]={config:e,redundancy:zf(e)}}return Ao[n]}function u1(n,e,t){let i,r;if(typeof n=="string"){const s=Nl(n);if(!s)return t(void 0,424),Od;r=s.send;const a=c1(n);a&&(i=a.redundancy)}else{const s=Yc(n);if(s){i=zf(s);const a=Nl(n.resources?n.resources[0]:"");a&&(r=a.send)}}return!i||!r?(t(void 0,424),Od):i.query(e,r,t)().abort}function Bd(){}function d1(n){n.iconsLoaderFlag||(n.iconsLoaderFlag=!0,setTimeout(()=>{n.iconsLoaderFlag=!1,n1(n)}))}function h1(n){const e=[],t=[];return n.forEach(i=>{(i.match(Pf)?e:t).push(i)}),{valid:e,invalid:t}}function Qr(n,e,t){function i(){const r=n.pendingIcons;e.forEach(s=>{r&&r.delete(s),n.icons[s]||n.missing.add(s)})}if(t&&typeof t=="object")try{if(!Nf(n,t).length){i();return}}catch(r){console.error(r)}i(),d1(n)}function zd(n,e){n instanceof Promise?n.then(t=>{e(t)}).catch(()=>{e(null)}):e(n)}function f1(n,e){n.iconsToLoad?n.iconsToLoad=n.iconsToLoad.concat(e).sort():n.iconsToLoad=e,n.iconsQueueFlag||(n.iconsQueueFlag=!0,setTimeout(()=>{n.iconsQueueFlag=!1;const{provider:t,prefix:i}=n,r=n.iconsToLoad;if(delete n.iconsToLoad,!r||!r.length)return;const s=n.loadIcon;if(n.loadIcons&&(r.length>1||!s)){zd(n.loadIcons(r,i,t),c=>{Qr(n,r,c)});return}if(s){r.forEach(c=>{zd(s(c,i,t),u=>{Qr(n,[c],u?{prefix:i,icons:{[c]:u}}:null)})});return}const{valid:a,invalid:o}=h1(r);if(o.length&&Qr(n,o,null),!a.length)return;const l=i.match(Pf)?Nl(t):null;if(!l){Qr(n,a,null);return}l.prepare(t,i,a).forEach(c=>{u1(t,c,u=>{Qr(n,c.icons,u)})})}))}const p1=(n,e)=>{const t=s1(a1(n,!0,Uf()));if(!t.pending.length){let o=!0;return e&&setTimeout(()=>{o&&e(t.loaded,t.missing,t.pending,Bd)}),()=>{o=!1}}const i=Object.create(null),r=[];let s,a;return t.pending.forEach(o=>{const{provider:l,prefix:c}=o;if(c===a&&l===s)return;s=l,a=c,r.push(zr(l,c));const u=i[l]||(i[l]=Object.create(null));u[c]||(u[c]=[])}),t.pending.forEach(o=>{const{provider:l,prefix:c,name:u}=o,h=zr(l,c),f=h.pendingIcons||(h.pendingIcons=new Set);f.has(u)||(f.add(u),i[l][c].push(u))}),r.forEach(o=>{const l=i[o.provider][o.prefix];l.length&&f1(o,l)}),e?r1(e,t,r):Bd};function m1(n,e){const t={...n};for(const i in e){const r=e[i],s=typeof r;i in Ff?(r===null||r&&(s==="string"||s==="number"))&&(t[i]=r):s===typeof t[i]&&(t[i]=i==="rotate"?r%4:r)}return t}const g1=/[\s,]+/;function v1(n,e){e.split(g1).forEach(t=>{switch(t.trim()){case"horizontal":n.hFlip=!0;break;case"vertical":n.vFlip=!0;break}})}function _1(n,e=0){const t=n.replace(/^-?[0-9.]*/,"");function i(r){for(;r<0;)r+=4;return r%4}if(t===""){const r=parseInt(n);return isNaN(r)?0:i(r)}else if(t!==n){let r=0;switch(t){case"%":r=25;break;case"deg":r=90}if(r){let s=parseFloat(n.slice(0,n.length-t.length));return isNaN(s)?0:(s=s/r,s%1===0?i(s):0)}}return e}function x1(n,e){let t=n.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)t+=" "+i+'="'+e[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+t+">"+n+"</svg>"}function b1(n){return n.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function S1(n){return"data:image/svg+xml,"+b1(n)}function y1(n){return'url("'+S1(n)+'")'}const kd={...Of,inline:!1},M1={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},E1={display:"inline-block"},Ul={"background-color":"currentColor"},kf={"background-color":"transparent"},Vd={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Hd={"-webkit-mask":Ul,mask:Ul,background:kf};for(const n in Hd){const e=Hd[n];for(const t in Vd)e[n+"-"+t]=Vd[t]}function w1(n){return n+(n.match(/^[-0-9.]+$/)?"px":"")}function T1(n,e){const t=m1(kd,e),i=e.mode||"svg",r=i==="svg"?{...M1}:{};n.body.indexOf("xlink:")===-1&&delete r["xmlns:xlink"];let s=typeof e.style=="string"?e.style:"";for(let m in e){const x=e[m];if(x!==void 0)switch(m){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":t[m]=x===!0||x==="true"||x===1;break;case"flip":typeof x=="string"&&v1(t,x);break;case"color":s=s+(s.length>0&&s.trim().slice(-1)!==";"?";":"")+"color: "+x+"; ";break;case"rotate":typeof x=="string"?t[m]=_1(x):typeof x=="number"&&(t[m]=x);break;case"ariaHidden":case"aria-hidden":x!==!0&&x!=="true"&&delete r["aria-hidden"];break;default:if(m.slice(0,3)==="on:")break;kd[m]===void 0&&(r[m]=x)}}const a=GE(n,t),o=a.attributes;if(t.inline&&(s="vertical-align: -0.125em; "+s),i==="svg")return Object.assign(r,o),s!==""&&(r.style=s),{svg:!0,attributes:r,body:YE(a.body)};const{body:l,width:c,height:u}=n,h=i==="mask"||(i==="bg"?!1:l.indexOf("currentColor")!==-1),f=x1(l,{...o,width:c+"",height:u+""}),v={"--svg":y1(f)},S=m=>{const x=o[m];x&&(v[m]=w1(x))};S("width"),S("height"),Object.assign(v,E1,h?Ul:kf);let g="";for(const m in v)g+=m+": "+v[m]+";";return r.style=g+s,{svg:!1,attributes:r}}Uf(!0);jE("",t1);if(typeof document<"u"&&typeof window<"u"){const n=window;if(n.IconifyPreload!==void 0){const e=n.IconifyPreload,t="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!FE(i))&&console.error(t)}catch{console.error(t)}})}if(n.IconifyProviders!==void 0){const e=n.IconifyProviders;if(typeof e=="object"&&e!==null)for(let t in e){const i="IconifyProviders["+t+"] is invalid.";try{const r=e[t];if(typeof r!="object"||!r||r.resources===void 0)continue;qE(t,r)||console.error(i)}catch{console.error(i)}}}}function A1(){try{return typeof window!="object"}catch{return!0}}function R1(n,e,t,i){function r(){e.loading&&(e.loading.abort(),e.loading=null)}if(typeof n=="object"&&n!==null&&typeof n.body=="string")return e.name="",r(),{data:{...Fa,...n}};let s;if(typeof n!="string"||(s=Ua(n,!1,!0))===null)return r(),null;const a=NE(s);if(!a)return!A1()&&(!e.loading||e.loading.name!==n)&&(r(),e.name="",e.loading={name:n,abort:p1([s],t)}),null;r(),e.name!==n&&(e.name=n,i&&!e.destroyed&&setTimeout(()=>{i(n)}));const o=["iconify"];return s.prefix!==""&&o.push("iconify--"+s.prefix),s.provider!==""&&o.push("iconify--"+s.provider),{data:a,classes:o}}function C1(n,e){return n?T1({...Fa,...n},e):null}var P1=pp("<svg></svg>"),D1=Z("<span></span>");function Vf(n,e){nt(e,!0);const t={name:"",loading:null,destroyed:!1},i=lt(e,["$$slots","$$events","$$legacy"]);let r=we(0),s=z(()=>(d(r),R1(e.icon,t,o,e.onload))),a=z(()=>{const h=d(s)?C1(d(s).data,i):null;return h&&d(s).classes&&i.class===void 0&&(h.attributes.class=(typeof i.class=="string"?i.class+" ":"")+d(s).classes.join(" ")),h});function o(){jd(r)}Jd(()=>{t.destroyed=!0,t.loading&&(t.loading.abort(),t.loading=null)});var l=Pe(),c=ae(l);{var u=h=>{var f=Pe(),p=ae(f);{var v=g=>{var m=P1();sn(m,()=>({...d(a).attributes})),Hp(m,()=>d(a).body,!0),q(m),D(g,m)},S=g=>{var m=D1();sn(m,()=>({...d(a).attributes})),D(g,m)};_e(p,g=>{d(a).svg?g(v):g(S,-1)})}D(h,f)};_e(c,h=>{d(a)&&h(u)})}D(n,l),it()}var I1=Z("<span> </span>"),L1=Z("<!> ",1);function N1(n,e){nt(e,!0);let t=we(null);function i(r){!d(t)||Math.abs(r.deltaX)>Math.abs(r.deltaY)||!(d(t).scrollWidth>d(t).clientWidth)||(r.preventDefault(),d(t).scrollLeft+=r.deltaY)}Cf(n,{class:"w-full shrink-0 border-b border-border",orientation:"horizontal",onwheel:i,get viewportRef(){return d(t)},set viewportRef(r){O(t,r,!0)},children:(r,s)=>{var a=Pe(),o=ae(a);We(o,()=>Gp,(l,c)=>{c(l,{class:"px-2 py-2 gap-0 inline-flex h-auto w-max justify-start rounded-none bg-transparent",children:(u,h)=>{var f=Pe(),p=ae(f);Ht(p,17,()=>e.tabs,v=>v.id,(v,S)=>{var g=Pe(),m=ae(g);We(m,()=>Wp,(x,M)=>{M(x,{get value(){return d(S).id},onclick:()=>e.onTabChange(d(S).id),class:"group/tab gap-1.5 px-3 py-1 text-sm font-medium relative h-auto flex-none shrink-0 rounded-none border-0 transition-colors not-last:border-r not-last:border-border hover:bg-accent data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:shadow-none data-[state=inactive]:text-muted-foreground dark:data-[state=active]:border-transparent dark:data-[state=active]:bg-transparent",children:(T,C)=>{var y=L1(),I=ae(y);{var _=L=>{var P=Pe(),k=ae(P);{var W=R=>{Vf(R,{get icon(){return d(S).icon},class:"h-4 w-4"})},H=z(()=>d(S).icon.includes(":")),N=R=>{var F=I1(),U=Q(F,!0);q(F),Le(()=>Ze(U,d(S).icon)),D(R,F)};_e(k,R=>{d(H)?R(W):R(N,-1)})}D(L,P)};_e(I,L=>{d(S).icon&&L(_)})}var E=ue(I);Le(()=>Ze(E,` ${d(S).label??""}`)),D(T,y)},$$slots:{default:!0}})}),D(v,g)}),D(u,f)},$$slots:{default:!0}})}),D(r,a)},$$slots:{default:!0}}),it()}var U1=Z("<h3> </h3>"),F1=Z("<p> </p>"),O1=Z("<div><!></div> <!> <!>",1);function Fl(n,e){let t=me(e,"message",3,""),i=me(e,"size",3,"medium"),r=me(e,"class",3,"");const s={small:{container:"p-6 gap-3",icon:"w-8 h-8",title:"text-sm font-semibold",message:"text-xs"},medium:{container:"p-12 gap-4",icon:"w-12 h-12",title:"text-lg font-semibold",message:"text-sm"},large:{container:"p-16 gap-6",icon:"w-16 h-16",title:"text-2xl font-bold",message:"text-base"}},a={loading:{icon:"text-primary",title:"text-primary-foreground",message:"text-primary-foreground/80",border:"border-primary",background:"bg-primary/15"},error:{icon:"text-destructive",title:"text-destructive-foreground",message:"text-destructive-foreground/80",border:"border-destructive",background:"bg-destructive/15"},warning:{icon:"text-accent",title:"text-accent-foreground",message:"text-accent-foreground/80",border:"border-accent",background:"bg-accent/15"},empty:{icon:"text-neutral",title:"text-neutral-foreground",message:"text-neutral-foreground/80",border:"border-neutral",background:"bg-neutral/15"}},o=z(()=>s[i()]),l=z(()=>a[e.type]);var c=Pe(),u=ae(c);We(u,()=>Cr,(h,f)=>{f(h,{get class(){return`rounded-lg border-2 ${d(l).border??""} ${d(l).background??""} ${r()??""}`},children:(p,v)=>{var S=Pe(),g=ae(S);We(g,()=>uh,(m,x)=>{x(m,{get class(){return`flex flex-col items-center justify-center text-center ${d(o).container??""}`},children:(M,T)=>{var C=O1(),y=ae(C),I=Q(y);{var _=R=>{cc(R,{class:"animate-spin h-full w-full"})},E=R=>{dh(R,{class:"h-full w-full"})},L=R=>{Qs(R,{class:"h-full w-full"})},P=R=>{Qm(R,{class:"h-full w-full"})};_e(I,R=>{e.type==="loading"?R(_):e.type==="error"?R(E,1):e.type==="warning"?R(L,2):e.type==="empty"&&R(P,3)})}q(y);var k=ue(y,2);{var W=R=>{var F=U1(),U=Q(F,!0);q(F),Le(()=>{At(F,1,`${d(o).title??""} ${d(l).title??""} mt-1`),Ze(U,e.title)}),D(R,F)};_e(k,R=>{e.title&&R(W)})}var H=ue(k,2);{var N=R=>{var F=F1(),U=Q(F,!0);q(F),Le(()=>{At(F,1,`${d(o).message??""} ${d(l).message??""} max-w-md leading-relaxed`),Ze(U,t())}),D(R,F)};_e(H,R=>{t()&&R(N)})}Le(()=>At(y,1,`${d(o).icon??""} ${d(l).icon??""}`)),D(M,C)},$$slots:{default:!0}})}),D(p,S)},$$slots:{default:!0}})}),D(n,c)}const $s=n=>Array.isArray(n)?n.map(String):n==null||n===""?[]:[String(n)],B1={equals:(n,e)=>n===e,notEquals:(n,e)=>n!==e,greaterThan:(n,e)=>Number(n)>Number(e),lessThan:(n,e)=>Number(n)<Number(e),greaterThanOrEqual:(n,e)=>Number(n)>=Number(e),lessThanOrEqual:(n,e)=>Number(n)<=Number(e),between:(n,e,t)=>t?.length===2&&Number(n)>=Number(t[0])&&Number(n)<=Number(t[1]),in:(n,e,t)=>t?.includes(String(n))??!1,notIn:(n,e,t)=>!(t?.includes(String(n))??!1),matches:(n,e)=>{try{return new RegExp(String(e)).test(String(n))}catch{return!1}},contains:(n,e)=>$s(n).includes(String(e)),containsAny:(n,e,t)=>{const i=$s(n);return t?.some(r=>i.includes(String(r)))??!1},isEmpty:n=>$s(n).length===0,isNotEmpty:n=>$s(n).length>0};function z1(n,e){const t=B1[n.operator];return t?t(e[n.paramId],n.value,n.values):!1}function Hf(n,e){const t=n.rules.map(i=>z1(i,e));return n.mode==="any"?t.some(Boolean):t.every(Boolean)}const Gd={show:n=>({visible:n,disabled:!1}),hide:(n,e)=>({visible:!n,disabled:!1,defaultValue:e}),disable:(n,e)=>({visible:!0,disabled:n,defaultValue:n?e:void 0})};function Ol(n,e){if(n.type==="linebreak")return{visible:!0,disabled:!1};if("visible"in n&&n.visible===!1)return{visible:!1,disabled:!1};if(!n.visibilityCondition?.rules)return{visible:!0,disabled:!1};const{action:t="show",defaultValue:i}=n.visibilityCondition,r=Hf(n.visibilityCondition,e);return(Gd[t]??Gd.show)(r,i)}function k1(n,e){if(!n.visibilityCondition?.rules)return!0;const{action:t="show"}=n.visibilityCondition,i=Hf(n.visibilityCondition,e);return t==="hide"?!i:i}var V1=Z('<div style="grid-column: 1 / -1" class="h-px bg-border" aria-hidden="true"></div>'),H1=Z("<div><!></div>"),G1=Z("<div><!></div>"),W1=Z('<div class="p-6"><div class="schema-grid gap-6 grid svelte-dzycr7"></div></div>'),X1=Z("<!> <!> <!>",1),Y1=Z('<div class="schema-grid gap-6 grid svelte-dzycr7"></div>'),j1=Z('<!> <div><div class="content-inner svelte-dzycr7"><!></div></div>',1);function q1(n,e){nt(e,!0);const t=(u,h=Ut,f=Ut,p=Ut)=>{var v=Pe(),S=ae(v);{var g=x=>{var M=V1();D(x,M)},m=x=>{const M=z(()=>Ol(h(),e.values)),T=z(()=>Math.min(Math.max(1,h().span??1),f()));var C=Pe(),y=ae(C);{var I=_=>{var E=Pe(),L=ae(E);{var P=W=>{var H=H1();let N;var R=Q(H);Ct(R,()=>e.inputSnippet,h,()=>d(M)),q(H),Le(()=>{N=At(H,1,"grid-cell min-w-0 flex items-center svelte-dzycr7",null,N,{"opacity-50":d(M).disabled,"col-divider":!p()&&f()>1}),hi(H,`grid-column: span ${d(T)??""} / span ${d(T)??""}`)}),D(W,H)},k=W=>{var H=G1();let N;var R=Q(H);Ct(R,()=>e.outputSnippet,h),q(H),Le(()=>{N=At(H,1,"grid-cell svelte-dzycr7",null,N,{"col-divider":!p()&&f()>1}),hi(H,`grid-column: span ${d(T)??""} / span ${d(T)??""}`)}),D(W,H)};_e(L,W=>{h().type==="input"?W(P):h().type==="output"&&W(k,1)})}D(_,E)};_e(y,_=>{d(M).visible&&_(I)})}D(x,C)};_e(S,x=>{h().type==="linebreak"?x(g):x(m,-1)})}D(u,v)};let i=me(e,"flat",3,!1);function r(u){(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),e.onToggle())}const s=z(()=>{const u=[];let h=0;for(const f of e.items){if(f.type==="linebreak"){u.push(0),h=0;continue}if(!Ol(f,e.values).visible){u.push(0);continue}const v=Math.min(Math.max(1,f.span??1),e.columns);h+v>e.columns&&(h=0),u.push(h),h=(h+v)%e.columns}return u});var a=Pe(),o=ae(a);{var l=u=>{var h=W1(),f=Q(h);Ht(f,23,()=>e.items,p=>p.type==="linebreak"?p.id:p.paramId,(p,v,S)=>{t(p,()=>d(v),()=>e.columns,()=>d(s)[d(S)]===0)}),q(f),q(h),Le(()=>hi(f,`--schema-cols: ${e.columns??""};`)),D(u,h)},c=u=>{var h=Pe(),f=ae(h);We(f,()=>Cr,(p,v)=>{v(p,{class:"gap-0 py-0 pt-0 overflow-hidden",children:(S,g)=>{var m=j1(),x=ae(m);{let I=z(()=>!e.collapsed);We(x,()=>qp,(_,E)=>{E(_,{class:"pt-4 pb-4! cursor-pointer border-b border-border bg-muted transition-colors select-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-none",role:"button",tabindex:0,get"aria-expanded"(){return d(I)},get onclick(){return e.onToggle},onkeydown:r,children:(L,P)=>{var k=X1(),W=ae(k);We(W,()=>Kp,(F,U)=>{U(F,{children:(X,V)=>{ct();var $=Tt();Le(()=>Ze($,e.label)),D(X,$)},$$slots:{default:!0}})});var H=ue(W,2);{var N=F=>{var U=Pe(),X=ae(U);We(X,()=>$p,(V,$)=>{$(V,{children:(ee,Se)=>{ct();var ye=Tt();Le(()=>Ze(ye,e.description)),D(ee,ye)},$$slots:{default:!0}})}),D(F,U)};_e(H,F=>{e.description&&F(N)})}var R=ue(H,2);We(R,()=>wE,(F,U)=>{U(F,{children:(X,V)=>{{let $=z(()=>e.collapsed?"":"rotate-180");Zp(X,{get class(){return`h-4 w-4 text-muted-foreground transition-transform duration-200 ${d($)??""}`}})}},$$slots:{default:!0}})}),D(L,k)},$$slots:{default:!0}})})}var M=ue(x,2);let T;var C=Q(M),y=Q(C);We(y,()=>uh,(I,_)=>{_(I,{class:"p-6",children:(E,L)=>{var P=Y1();Ht(P,23,()=>e.items,k=>k.type==="linebreak"?k.id:k.paramId,(k,W,H)=>{t(k,()=>d(W),()=>e.columns,()=>d(s)[d(H)]===0)}),q(P),Le(()=>hi(P,`--schema-cols: ${e.columns??""};`)),D(E,P)},$$slots:{default:!0}})}),q(C),q(M),Le(()=>T=At(M,1,"content-wrapper svelte-dzycr7",null,T,{collapsed:e.collapsed})),D(S,m)},$$slots:{default:!0}})}),D(u,h)};_e(o,u=>{i()?u(l):u(c,-1)})}D(n,a),it()}function Ro(n){return n.type==="input"&&n.widgetType==="number"}function K1(n){return n.type==="input"&&n.widgetType==="text"}function Z1(n){return n.type==="input"&&n.widgetType==="dropdown"}function $1(n){return n.type==="input"&&n.widgetType==="checkbox"}function J1(n){return n.type==="input"&&n.widgetType==="file"}function Q1(n){return n.type==="input"&&n.widgetType==="color"}const ew=Jp({base:"group/field data-[invalid=true]:text-destructive flex w-full gap-3",variants:{orientation:{vertical:"flex-col [&>*]:w-full [&>.sr-only]:w-auto",horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});var tw=Z("<div><!></div>");function Gf(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"orientation",3,"vertical"),r=lt(e,["$$slots","$$events","$$legacy","ref","class","orientation","children"]);var s=tw();sn(s,o=>({role:"group","data-slot":"field","data-orientation":i(),class:o,...r}),[()=>Ln(ew({orientation:i()}),e.class)]);var a=Q(s);Ct(a,()=>e.children??Ut),q(s),Nn(s,o=>t(o),()=>t()),D(n,s),it()}function Wf(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","class","children"]);{let r=z(()=>Ln("group/field-label peer/field-label gap-2 leading-snug flex w-fit group-data-[disabled=true]/field:opacity-50","[&>*]:data-[slot=field]:p-4 has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border","has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10",e.class));Di(n,_t({"data-slot":"field-label",get class(){return d(r)}},()=>i,{get ref(){return t()},set ref(s){t(s)},children:(s,a)=>{var o=Pe(),l=ae(o);Ct(l,()=>e.children??Ut),D(s,o)},$$slots:{default:!0}}))}it()}var nw=Z("<li> </li>"),iw=Z('<ul class="ms-4 gap-1 flex list-disc flex-col"></ul>'),rw=Z("<div><!></div>");function Xf(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","class","children","errors"]);const r=z(()=>e.children?!0:!(!e.errors||e.errors.length===0||e.errors.length===1&&!e.errors[0]?.message)),s=z(()=>e.errors&&e.errors.length>1),a=z(()=>e.errors&&e.errors.length===1&&e.errors[0]?.message);var o=Pe(),l=ae(o);{var c=u=>{var h=rw();sn(h,g=>({role:"alert","data-slot":"field-error",class:g,...i}),[()=>Ln("text-sm font-normal text-destructive",e.class)]);var f=Q(h);{var p=g=>{var m=Pe(),x=ae(m);Ct(x,()=>e.children),D(g,m)},v=g=>{var m=Tt();Le(()=>Ze(m,d(a))),D(g,m)},S=g=>{var m=iw();Ht(m,21,()=>e.errors??[],$d,(x,M)=>{var T=Pe(),C=ae(T);{var y=I=>{var _=nw(),E=Q(_,!0);q(_),Le(()=>Ze(E,d(M).message)),D(I,_)};_e(C,I=>{d(M)?.message&&I(y)})}D(x,T)}),q(m),D(g,m)};_e(f,g=>{e.children?g(p):d(a)?g(v,1):d(s)&&g(S,2)})}q(h),Nn(h,g=>t(g),()=>t()),D(u,h)};_e(l,u=>{d(r)&&u(c)})}D(n,o),it()}var sw=Z('<div data-slot="checkbox-indicator" class="text-current transition-none"><!></div>');function Yf(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"checked",15,!1),r=me(e,"indeterminate",15,!1),s=lt(e,["$$slots","$$events","$$legacy","ref","checked","indeterminate","class"]);var a=Pe(),o=ae(a);{const l=(u,h)=>{let f=()=>h?.().checked,p=()=>h?.().indeterminate;var v=sw(),S=Q(v);{var g=x=>{th(x,{class:"size-3.5"})},m=x=>{ig(x,{class:"size-3.5"})};_e(S,x=>{f()?x(g):p()&&x(m,1)})}q(v),D(u,v)};let c=z(()=>Ln("peer size-4 shadow-xs flex shrink-0 items-center justify-center rounded-[4px] border border-input transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",e.class));We(o,()=>dm,(u,h)=>{h(u,_t({"data-slot":"checkbox",get class(){return d(c)}},()=>s,{get ref(){return t()},set ref(f){t(f)},get checked(){return i()},set checked(f){i(f)},get indeterminate(){return r()},set indeterminate(f){r(f)},children:l,$$slots:{default:!0}}))})}D(n,a),it()}var aw=Z("<!> <!>",1);function ow(n,e){nt(e,!0);let t=me(e,"value",15),i=me(e,"disabled",3,!1);var r=Pe(),s=ae(r);We(s,()=>Gf,(a,o)=>{o(a,{orientation:"horizontal",children:(l,c)=>{var u=aw(),h=ae(u);{let p=z(()=>typeof t()=="boolean"?t():!1);Yf(h,{get id(){return e.inputId},get checked(){return d(p)},onCheckedChange:v=>{t(v===!0),e.onChange(v===!0)},get disabled(){return i()}})}var f=ue(h,2);We(f,()=>Wf,(p,v)=>{v(p,{get for(){return e.inputId},class:"font-normal cursor-pointer text-muted-foreground",children:(S,g)=>{ct();var m=Tt("Enabled");D(S,m)},$$slots:{default:!0}})}),D(l,u)},$$slots:{default:!0}})}),D(n,r),it()}var lw=Z("<label><!> <span> </span></label>"),cw=Z('<div class="divide-y divide-border/60 overflow-hidden rounded-md border border-input"></div>');function uw(n,e){nt(e,!0);let t=me(e,"disabled",3,!1);const i=z(()=>e.config?.options??{}),r=z(()=>new Set(e.value??[]));function s(o,l){const c=new is(d(r));l?c.add(o):c.delete(o),e.onChange([...c])}var a=cw();Ht(a,21,()=>Object.entries(d(i)),([o,l])=>l??o,(o,l)=>{var c=z(()=>$i(d(l),2));let u=()=>d(c)[0],h=()=>d(c)[1];const f=z(()=>h()??u()),p=z(()=>`${e.inputId}-${d(f)}`),v=z(()=>d(r).has(d(f)));var S=lw(),g=Q(S);Yf(g,{get id(){return d(p)},get checked(){return d(v)},onCheckedChange:T=>s(d(f),T===!0),get disabled(){return t()}});var m=ue(g,2);let x;var M=Q(m,!0);q(m),q(S),Le(()=>{Vt(S,"for",d(p)),At(S,1,`gap-3 px-3 py-2 text-sm flex items-center transition-colors select-none hover:bg-accent/50 ${d(v)?"bg-accent/30":""} ${t()?"cursor-not-allowed opacity-50":"cursor-pointer"}`),x=At(m,1,"flex-1",null,x,{"font-medium":d(v)}),Ze(M,u())}),D(o,S)}),q(a),D(n,a),it()}var dw=Z('<div class="gap-2 flex items-center"><input type="color" class="h-9 w-12 rounded p-1 cursor-pointer border border-input bg-background"/> <span class="font-mono text-sm text-muted-foreground"> </span></div>');function hw(n,e){nt(e,!0);let t=me(e,"value",3,"#000000");var i=dw(),r=Q(i);kl(r);var s=ue(r,2),a=Q(s,!0);q(s),q(i),Le(()=>{Tp(r,t()||"#000000"),Ze(a,t()||"#000000")}),Lt("change",r,o=>{const l=o.currentTarget.value;e.onChange(l)}),D(n,i),it()}Gn(["change"]);var fw=Z("<!> <!>",1);function pw(n,e){nt(e,!0);let t=me(e,"value",7),i=me(e,"disabled",3,!1);const r=z(()=>e.config?.options||{}),s=z(()=>t()||""),a=z(()=>Object.entries(d(r)).find(([c,u])=>u===d(s))?.[0]??d(s));var o=Pe(),l=ae(o);We(l,()=>Bp,(c,u)=>{u(c,{type:"single",get value(){return d(s)},onValueChange:h=>{h&&(t(h),e.onChange(h))},get disabled(){return i()},children:(h,f)=>{var p=fw(),v=ae(p);We(v,()=>zp,(g,m)=>{m(g,{class:"w-full",get disabled(){return i()},children:(x,M)=>{ct();var T=Tt();Le(()=>Ze(T,d(a)||"Select an option...")),D(x,T)},$$slots:{default:!0}})});var S=ue(v,2);We(S,()=>kp,(g,m)=>{m(g,{children:(x,M)=>{var T=Pe(),C=ae(T);Ht(C,17,()=>Object.entries(d(r)),([y,I])=>I??y,(y,I)=>{var _=z(()=>$i(d(I),2));let E=()=>d(_)[0],L=()=>d(_)[1];var P=Pe(),k=ae(P);{let W=z(()=>L()??E());We(k,()=>Vp,(H,N)=>{N(H,{get value(){return d(W)},get label(){return E()}})})}D(y,P)}),D(x,T)},$$slots:{default:!0}})}),D(h,p)},$$slots:{default:!0}})}),D(n,o),it()}var mw=Z('<button type="button"> </button>'),gw=Z('<div class="rounded text-xs flex overflow-hidden border"></div>'),vw=Z("<!> File URL",1),_w=Z('<div class="gap-1.5 text-xs flex items-center text-success"><!> </div>'),xw=Z('<p class="text-xs leading-snug pl-5 text-muted-foreground"> </p>'),bw=Z('<div class="p-2.5 gap-1.5 flex flex-col rounded-md border border-destructive/40 bg-destructive/5"><div class="gap-1.5 flex items-start"><!> <p class="text-xs leading-snug text-destructive"> </p></div> <!></div>'),Sw=Z('<p class="text-xs text-muted-foreground">URL must be publicly accessible (no login required).</p>'),yw=Z('<div class="gap-2 flex flex-col"><!> <div class="gap-2 flex"><!> <!></div> <!> <!> <!></div>'),Mw=Z("<!> Upload File",1),Ew=Z("<!> ",1),ww=Z('<p class="text-xs text-muted-foreground"> </p>'),Tw=Z('<div class="gap-2 flex flex-col"><!> <!> <!></div>'),Aw=Z('<div class="gap-4 flex w-full flex-col"><input type="file" class="hidden"/> <!> <!></div>');function Rw(n,e){nt(e,!0);let t=me(e,"value",15),i=me(e,"acceptedFormats",19,()=>[]),r=me(e,"defaultInputMode",3,"upload"),s=z(()=>e.allowedInputModes&&e.allowedInputModes.length>0?e.allowedInputModes:["upload","url"]),a=z(()=>d(s).length>1),o=we("upload");Rt(()=>{const R=r()??"upload";O(o,d(s).includes(R)?R:d(s)[0],!0)});let l=we(null),c=we(""),u=we(""),h=we(!1),f=we(!1),p=we(null),v=we("");Rt(()=>{if(t())try{const R=typeof t()=="string"?JSON.parse(t()):t();if(R.type==="base64")if(R._isMetadata&&R._fileSize){const F=(R._fileSize/1024/1024).toFixed(2);O(c,`Uploaded file (${R.fileEnding}, ${F}MB)`)}else O(c,`Uploaded file (${R.fileEnding})`);else R.type==="url"&&O(u,R.file,!0)}catch{}});function S(R){const F=R.split("?")[0];return(F.includes(".")?"."+F.split(".").pop():".tmp").toLowerCase()}function g(R){return i().length===0?!0:i().includes(R.toLowerCase())}function m(R){return R instanceof TypeError&&R.message==="Failed to fetch"}async function x(){if(d(u).trim()){O(f,!0),O(p,null),O(v,""),O(c,"");try{let R;try{R=new URL(d(u))}catch{O(p,{message:"Invalid URL — make sure it starts with https://",isCors:!1},!0),O(f,!1);return}if(R.protocol!=="https:"&&R.protocol!=="http:"){O(p,{message:"Only http:// and https:// URLs are supported.",isCors:!1},!0),O(f,!1);return}const F=await fetch(d(u));if(!F.ok){O(p,{message:`Server returned ${F.status} ${F.statusText}. Check the URL is correct and publicly accessible.`,isCors:!1},!0),O(f,!1);return}const U=await F.blob(),X=S(d(u));if(!g(X)){O(p,{message:`File format "${X}" is not accepted. Allowed: ${i().join(", ")}`,isCors:!1},!0),O(f,!1);return}const V=Nr.FILE_UPLOAD.MAX_SIZE_BYTES;if(U.size>V){O(p,{message:`File too large: ${(U.size/1024/1024).toFixed(2)}MB (max ${Nr.FILE_UPLOAD.MAX_SIZE_MB}MB). Download it and use Upload instead.`,isCors:!1},!0),O(f,!1);return}await new Promise(($,ee)=>{const Se=new FileReader;Se.onload=ye=>{const ve=ye.target?.result,K=ve.includes(",")?ve.split(",")[1]:ve,fe=JSON.stringify({file:K,type:"base64",fileEnding:X});t(fe),O(v,`Loaded ${X} (${(U.size/1024).toFixed(0)} KB)`),e.onChange(fe),$()},Se.onerror=()=>ee(new Error("Failed to read the downloaded file.")),Se.readAsDataURL(U)})}catch(R){if(m(R)){const F=(()=>{try{return new URL(d(u)).hostname}catch{return""}})();let U="Check that the URL is correct and the file is publicly accessible. If the server requires login, download the file and use the Upload option instead.";F.includes("sharepoint.com")||F.includes("onedrive.com")?U='SharePoint/OneDrive blocks browser access. Open the file in SharePoint, use "Download" to save it locally, then upload it here.':F.includes("drive.google.com")?U='Google Drive blocks browser access. Use "Download" in Google Drive to save the file locally, then upload it here.':F.includes("dropbox.com")&&(U='Dropbox links may block browser access. Try changing "?dl=0" to "?dl=1" in the URL, or download and upload instead.'),O(p,{message:`Could not reach "${F}" — the file may not exist, or the server does not allow browser access.`,isCors:!0,hint:U},!0)}else O(p,{message:R instanceof Error?R.message:"Unknown error",isCors:!1},!0)}finally{O(f,!1)}}}function M(R){const U=R.target.files?.[0];if(!U)return;const X=S(U.name);if(!g(X)){alert(`File format not accepted: ${X}`);return}O(c,U.name,!0);const V=new FileReader;V.onload=$=>{const ee=$.target?.result,Se=ee.includes(",")?ee.split(",")[1]:ee,ye=JSON.stringify({file:Se,type:"base64",fileEnding:X});t(ye),e.onChange(ye)},V.readAsDataURL(U)}function T(){d(l)?.click()}function C(R){R.preventDefault(),O(h,!0)}function y(){O(h,!1)}function I(R){R.preventDefault(),O(h,!1);const F=R.dataTransfer?.files;if(F?.[0]){const U=new Event("change");Object.defineProperty(U,"target",{value:{files:F}}),M(U)}}const _=z(()=>i().length>0?i().join(","):"*");var E=Aw(),L=Q(E);Nn(L,R=>O(l,R),()=>d(l));var P=ue(L,2);{var k=R=>{var F=gw();Ht(F,20,()=>d(s),U=>U,(U,X)=>{var V=mw(),$=Q(V,!0);q(V),Le(()=>{At(V,1,`px-3 py-1 flex-1 transition-colors ${d(o)===X?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"}`),Ze($,X==="upload"?"Upload":"URL")}),Lt("click",V,()=>O(o,X,!0)),D(U,V)}),q(F),D(R,F)};_e(P,R=>{d(a)&&R(k)})}var W=ue(P,2);{var H=R=>{var F=yw(),U=Q(F);Di(U,{for:"url-input",class:"gap-2 flex items-center",children:(Y,oe)=>{var Me=vw(),Ee=ae(Me);ng(Ee,{size:16}),ct(),D(Y,Me)},$$slots:{default:!0}});var X=ue(U,2),V=Q(X);{let Y=z(()=>d(p)?"border-destructive focus-visible:ring-destructive":"");Pr(V,{id:"url-input",type:"url",placeholder:"https://example.com/model.3dm",get disabled(){return d(f)},get class(){return d(Y)},oninput:()=>{O(p,null),O(v,"")},get value(){return d(u)},set value(oe){O(u,oe,!0)}})}var $=ue(V,2);{let Y=z(()=>d(f)||!d(u).trim());mn($,{type:"button",variant:"outline",get disabled(){return d(Y)},onclick:x,children:(oe,Me)=>{ct();var Ee=Tt();Le(()=>Ze(Ee,d(f)?"Fetching...":"Fetch")),D(oe,Ee)},$$slots:{default:!0}})}q(X);var ee=ue(X,2);{var Se=Y=>{var oe=_w(),Me=Q(oe);Km(Me,{size:13});var Ee=ue(Me);q(oe),Le(()=>Ze(Ee,` ${d(v)??""}`)),D(Y,oe)};_e(ee,Y=>{d(v)&&Y(Se)})}var ye=ue(ee,2);{var ve=Y=>{var oe=bw(),Me=Q(oe),Ee=Q(Me);dh(Ee,{size:13,class:"mt-0.5 shrink-0 text-destructive"});var Ge=ue(Ee,2),Te=Q(Ge,!0);q(Ge),q(Me);var Ve=ue(Me,2);{var Ae=Ce=>{var Oe=xw(),Be=Q(Oe,!0);q(Oe),Le(()=>Ze(Be,d(p).hint)),D(Ce,Oe)};_e(Ve,Ce=>{d(p).isCors&&d(p).hint&&Ce(Ae)})}q(oe),Le(()=>Ze(Te,d(p).message)),D(Y,oe)};_e(ye,Y=>{d(p)&&Y(ve)})}var K=ue(ye,2);{var fe=Y=>{var oe=Sw();D(Y,oe)};_e(K,Y=>{!d(p)&&!d(v)&&Y(fe)})}q(F),D(R,F)},N=R=>{var F=Tw(),U=Q(F);Di(U,{for:"file-upload",class:"gap-2 flex items-center",children:(ee,Se)=>{var ye=Mw(),ve=ae(ye);fu(ve,{size:16}),ct(),D(ee,ye)},$$slots:{default:!0}});var X=ue(U,2);{let ee=z(()=>d(h)?"border-primary":"");mn(X,{type:"button",variant:"outline",get class(){return`gap-2 w-full ${d(ee)??""}`},onclick:T,ondragover:C,ondragleave:y,ondrop:I,children:(Se,ye)=>{var ve=Ew(),K=ae(ve);fu(K,{size:16});var fe=ue(K);Le(()=>Ze(fe,` ${(d(c)||"Choose File or Drag & Drop")??""}`)),D(Se,ve)},$$slots:{default:!0}})}var V=ue(X,2);{var $=ee=>{var Se=ww(),ye=Q(Se);q(Se),Le(ve=>Ze(ye,`Accepted formats: ${ve??""}`),[()=>i().join(", ")]),D(ee,Se)};_e(V,ee=>{i().length>0&&ee($)})}q(F),D(R,F)};_e(W,R=>{d(o)==="url"?R(H):R(N,-1)})}q(E),Le(()=>Vt(L,"accept",d(_))),Lt("change",L,M),D(n,E),it()}Gn(["change","click"]);function Bl(n,e){let t=null;function i(...r){t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r),t=null},e)}return i.cancel=()=>{t!==null&&(clearTimeout(t),t=null)},i}var Cw=Z('<span data-slot="slider-track"><!></span> <!>',1);function Pw(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"value",15),r=me(e,"orientation",3,"horizontal"),s=lt(e,["$$slots","$$events","$$legacy","ref","value","orientation","class"]);var a=Pe(),o=ae(a);{const l=(u,h)=>{let f=()=>h?.().thumbs;var p=Cw(),v=ae(p),S=Q(v);{let m=z(()=>Ln("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"));We(S,()=>Wm,(x,M)=>{M(x,{"data-slot":"slider-range",get class(){return d(m)}})})}q(v);var g=ue(v,2);Ht(g,16,f,m=>m,(m,x)=>{var M=Pe(),T=ae(M);We(T,()=>Ym,(C,y)=>{y(C,{"data-slot":"slider-thumb",get index(){return x},class:"size-4 shadow-sm block shrink-0 rounded-full border border-primary bg-background ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"})}),D(m,M)}),Le(m=>{Vt(v,"data-orientation",r()),At(v,1,m)},[()=>fa(Ln("bg-neutral-200 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 relative grow overflow-hidden rounded-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full dark:bg-muted"))]),D(u,p)};let c=z(()=>Ln("data-[orientation=vertical]:min-h-44 relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e.class));We(o,()=>Hm,(u,h)=>{h(u,_t({"data-slot":"slider",get orientation(){return r()},get class(){return d(c)}},()=>s,{get ref(){return t()},set ref(f){t(f)},get value(){return i()},set value(f){i(f)},children:l,$$slots:{default:!0}}))})}D(n,a),it()}var Dw=Z('<input type="number" class="min-w-12 w-16 text-sm border-b border-border bg-transparent text-right outline-none focus:border-foreground"/>'),Iw=Z('<span role="button" class="min-w-12 text-sm cursor-text text-right text-muted-foreground select-none" title="Double-click to edit"> </span>'),Lw=Z('<div class="gap-4 flex items-center"><!> <!></div>'),Nw=Z("<!> <!>",1);function Uw(n,e){nt(e,!0);let t=me(e,"value",15),i=me(e,"disabled",3,!1),r=we(null),s=we(!1),a=we("");const o=z(()=>e.config?.minimum??0),l=z(()=>e.config?.maximum??100),c=z(()=>e.config?.stepSize??1),u=z(()=>typeof t()=="number"?t():d(o)),h=Bl(_=>e.onChange(_),400),f=Bl(_=>e.onChange(_),150);function p(_){return e.config?.minimum!==void 0&&_<e.config.minimum?`Minimum value is ${e.config.minimum}`:e.config?.maximum!==void 0&&_>e.config.maximum?`Maximum value is ${e.config.maximum}`:null}function v(_){const E=p(_);O(r,E,!0),E||(t(_),h(_))}function S(_){t(_),f(_)}function g(_){_.focus(),_.select()}function m(_){return Math.max(0,-Math.floor(Math.log10(_)))}var x=Nw(),M=ae(x);{var T=_=>{const E=z(()=>m(d(c)));var L=Lw(),P=Q(L);Pw(P,{type:"single",get value(){return d(u)},get min(){return d(o)},get max(){return d(l)},get step(){return d(c)},class:"flex-1",onValueChange:S,get disabled(){return i()}});var k=ue(P,2);{var W=N=>{var R=Dw();kl(R),_p(R,F=>g?.(F)),fp(()=>Qd(R,()=>d(a),F=>O(a,F))),Le(()=>Vt(R,"step",d(c))),gp("blur",R,()=>{const F=parseFloat(d(a));isNaN(F)||S(Math.min(d(l),Math.max(d(o),F))),O(s,!1)}),Lt("keydown",R,F=>{if(F.key==="Enter"){const U=parseFloat(d(a));isNaN(U)||S(Math.min(d(l),Math.max(d(o),U))),O(s,!1)}else F.key==="Escape"&&O(s,!1)}),D(N,R)},H=N=>{var R=Iw();Vt(R,"tabindex",0);var F=Q(R,!0);q(R),Le(U=>Ze(F,U),[()=>d(u).toFixed(d(E))]),Lt("dblclick",R,()=>{O(a,d(u).toFixed(d(E)),!0),O(s,!0)}),Lt("keydown",R,U=>{(U.key==="Enter"||U.key===" ")&&(O(a,d(u).toFixed(d(E)),!0),O(s,!0))}),D(N,R)};_e(k,N=>{d(s)?N(W):N(H,-1)})}q(L),D(_,L)},C=_=>{{let E=z(()=>e.config?.minimum),L=z(()=>e.config?.maximum),P=z(()=>e.config?.placeholder),k=z(()=>d(r)?!0:void 0),W=z(()=>d(r)?!0:void 0),H=z(()=>d(r)?"border-destructive":"");Pr(_,{get id(){return e.inputId},type:"number",get value(){return d(u)},get min(){return d(E)},get max(){return d(L)},get step(){return d(c)},get placeholder(){return d(P)},get"data-invalid"(){return d(k)},get"aria-invalid"(){return d(W)},get class(){return d(H)},get disabled(){return i()},oninput:()=>O(r,null),onchange:N=>{const R=parseFloat(N.currentTarget.value);isNaN(R)||v(R)},onblur:N=>{const R=parseFloat(N.currentTarget.value);if(!isNaN(R)){const F=p(R);O(r,F,!0),F||(t(R),e.onChange(R))}}})}};_e(M,_=>{e.config?.renderAsSlider?_(T):_(C,-1)})}var y=ue(M,2);{var I=_=>{var E=Pe(),L=ae(E);We(L,()=>Xf,(P,k)=>{k(P,{children:(W,H)=>{ct();var N=Tt();Le(()=>Ze(N,d(r))),D(W,N)},$$slots:{default:!0}})}),D(_,E)};_e(y,_=>{d(r)&&_(I)})}D(n,x),it()}Gn(["keydown","dblclick"]);var Fw=Z("<!> <!>",1);function Ow(n,e){nt(e,!0);let t=me(e,"value",15),i=me(e,"disabled",3,!1),r=we(null),s=we($n(t()||""));const a=Bl(p=>e.onChange(p),400);function o(p){if(e.config?.maxLength&&p.length>e.config.maxLength)return`Maximum ${e.config.maxLength} characters allowed`;if(e.config?.pattern)try{if(!new RegExp(e.config.pattern).test(p))return e.config.customErrorMessage||"Invalid format"}catch{return"Invalid validation pattern configured"}return null}function l(){const p=o(d(s));O(r,p,!0),p||(t(d(s)),a(d(s)))}var c=Fw(),u=ae(c);{let p=z(()=>e.config?.placeholder),v=z(()=>e.config?.maxLength),S=z(()=>d(r)?!0:void 0),g=z(()=>d(r)?!0:void 0),m=z(()=>d(r)?"border-destructive":"");Pr(u,{get id(){return e.inputId},type:"text",get placeholder(){return d(p)},get maxlength(){return d(v)},get"data-invalid"(){return d(S)},get"aria-invalid"(){return d(g)},get class(){return d(m)},get disabled(){return i()},oninput:()=>{O(r,null),l()},onblur:x=>{const M=x.currentTarget.value,T=o(M);O(r,T,!0),T||(O(s,M,!0),t(M),e.onChange(M))},get value(){return d(s)},set value(x){O(s,x,!0)}})}var h=ue(u,2);{var f=p=>{var v=Pe(),S=ae(v);We(S,()=>Xf,(g,m)=>{m(g,{children:(x,M)=>{ct();var T=Tt();Le(()=>Ze(T,d(r))),D(x,T)},$$slots:{default:!0}})}),D(p,v)};_e(h,p=>{d(r)&&p(f)})}D(n,c),it()}var Bw=Z("<!> <!>",1),zw=Z("<!> <!>",1),kw=Z('<span class="text-xs font-normal text-muted-foreground"> </span>'),Vw=Z(" <!> <!>",1),Hw=Z("<!> <!>",1);function Gw(n,e){nt(e,!0);let t=me(e,"value",15,void 0),i=me(e,"disabled",3,!1);const r=z(()=>`input-${e.item.paramId}`),s=z(()=>e.displayName||e.item.displayName||e.item.paramId),a=z(()=>{if(!Ro(e.item))return null;const h=e.item.config;if(h?.hideRange)return null;const f=typeof h?.minimum=="number",p=typeof h?.maximum=="number";return!f&&!p?null:f&&p?`${h.minimum} to ${h.maximum}`:f?`≥ ${h.minimum}`:`≤ ${h.maximum}`}),o=z(()=>Ro(e.item)&&d(a)!==null);function l(h){t(h),e.onChange(e.item.paramId,h)}var c=Pe(),u=ae(c);We(u,()=>Gf,(h,f)=>{f(h,{children:(p,v)=>{var S=Hw(),g=ae(S);We(g,()=>Wf,(H,N)=>{N(H,{get for(){return d(r)},class:"gap-2 flex items-center",children:(R,F)=>{ct();var U=Vw(),X=ae(U),V=ue(X);{var $=ye=>{var ve=Pe(),K=ae(ve);We(K,()=>Ar,(fe,Y)=>{Y(fe,{children:(oe,Me)=>{var Ee=zw(),Ge=ae(Ee);We(Ge,()=>Kd,(Ve,Ae)=>{Ae(Ve,{class:"p-1 cursor-help opacity-60 transition-opacity hover:opacity-100",children:(Ce,Oe)=>{Zm(Ce,{size:16})},$$slots:{default:!0}})});var Te=ue(Ge,2);We(Te,()=>Rr,(Ve,Ae)=>{Ae(Ve,{class:"sm:max-w-md",children:(Ce,Oe)=>{var Be=Pe(),He=ae(Be);We(He,()=>rs,(B,De)=>{De(B,{children:(pe,Ne)=>{var ce=Bw(),je=ae(ce);We(je,()=>Ji,(b,G)=>{G(b,{children:(ne,de)=>{ct();var he=Tt();Le(()=>Ze(he,d(s))),D(ne,he)},$$slots:{default:!0}})});var w=ue(je,2);We(w,()=>ss,(b,G)=>{G(b,{children:(ne,de)=>{ct();var he=Tt();Le(()=>Ze(he,e.item.description)),D(ne,he)},$$slots:{default:!0}})}),D(pe,ce)},$$slots:{default:!0}})}),D(Ce,Be)},$$slots:{default:!0}})}),D(oe,Ee)},$$slots:{default:!0}})}),D(ye,ve)};_e(V,ye=>{e.item.description&&ye($)})}var ee=ue(V,2);{var Se=ye=>{var ve=kw(),K=Q(ve,!0);q(ve),Le(()=>Ze(K,d(a))),D(ye,ve)};_e(ee,ye=>{d(o)&&ye(Se)})}Le(()=>Ze(X,`${d(s)??""} `)),D(R,U)},$$slots:{default:!0}})});var m=ue(g,2);{var x=H=>{const N=z(()=>e.item.config);{let R=z(()=>typeof t()=="number"?t():void 0);Uw(H,{get inputId(){return d(r)},get value(){return d(R)},get config(){return d(N)},onChange:l,get disabled(){return i()}})}},M=z(()=>Ro(e.item)),T=H=>{{let N=z(()=>typeof t()=="boolean"?t():void 0);ow(H,{get inputId(){return d(r)},get value(){return d(N)},onChange:l,get disabled(){return i()}})}},C=z(()=>$1(e.item)),y=H=>{const N=z(()=>e.item.config);{let R=z(()=>typeof t()=="string"?t():"");Ow(H,{get inputId(){return d(r)},get value(){return d(R)},get config(){return d(N)},onChange:l,get disabled(){return i()}})}},I=z(()=>K1(e.item)),_=H=>{const N=z(()=>e.item.config);var R=Pe(),F=ae(R);{var U=V=>{{let $=z(()=>Array.isArray(t())?t():typeof t()=="string"&&t()?[t()]:[]);uw(V,{get inputId(){return d(r)},get value(){return d($)},get config(){return d(N)},onChange:l,get disabled(){return i()}})}},X=V=>{{let $=z(()=>typeof t()=="string"?t():"");pw(V,{get value(){return d($)},get config(){return d(N)},onChange:l,get disabled(){return i()}})}};_e(F,V=>{d(N).displayAs==="checklist"?V(U):V(X,-1)})}D(H,R)},E=z(()=>Z1(e.item)),L=H=>{const N=z(()=>e.item.config);{let R=z(()=>typeof t()=="string"?t():""),F=z(()=>d(N)?.acceptedFormats??[]),U=z(()=>d(N)?.defaultInputMode),X=z(()=>d(N)?.allowedInputModes);Rw(H,{get value(){return d(R)},get acceptedFormats(){return d(F)},onChange:V=>l(V),get defaultInputMode(){return d(U)},get allowedInputModes(){return d(X)}})}},P=z(()=>J1(e.item)),k=H=>{{let N=z(()=>typeof t()=="string"?t():"#000000");hw(H,{get value(){return d(N)},onChange:R=>l(R)})}},W=z(()=>Q1(e.item));_e(m,H=>{d(M)?H(x):d(C)?H(T,1):d(I)?H(y,2):d(E)?H(_,3):d(P)?H(L,4):d(W)&&H(k,5)})}D(p,S)},$$slots:{default:!0}})}),D(n,c),it()}const es=new Map;function Ww(n,e){if(es.has(n))return es.get(n);if(document.querySelector(`script[src="${n}"]`)){const i=Promise.resolve();return es.set(n,i),i}const t=new Promise((i,r)=>{const s=document.createElement("script");s.src=n,e?.crossOrigin&&(s.crossOrigin=e.crossOrigin),e?.async!==void 0&&(s.async=e.async),e?.defer!==void 0&&(s.defer=e.defer),s.onload=()=>i(),s.onerror=()=>{es.delete(n),r(new Error(`Failed to load script: ${n}`))},document.head.appendChild(s)});return es.set(n,t),t}var Xw=Z('<div class="px-4 py-3 text-sm text-destructive"> </div>'),Yw=Z('<div class="px-4 py-8 text-sm text-center text-muted-foreground">Receiving chart data...</div>'),jw=Z('<div class="px-4 py-8 text-sm text-center text-muted-foreground">Waiting for chart data...</div>'),qw=Z('<div class="rounded p-1.5 backdrop-blur-sm flex items-center border border-border bg-background/80 text-muted-foreground"><!></div>'),Kw=Z('<div class="w-full"></div> <div><!> <button class="rounded p-1.5 backdrop-blur-sm flex items-center border border-border bg-background/80 text-foreground transition-colors hover:bg-background disabled:cursor-not-allowed disabled:opacity-50"><!></button></div>',1),Zw=Z("<div><!></div>");function $w(n,e){nt(e,!0);const t=new Set(["scattermap","scattermapbox","choropleth","scattergeo"]),i=z(()=>{if(!e.value)return null;try{return JSON.parse(e.value)}catch{return null}});let r=we(null),s=we(null),a=we(!1),o=we(null),l=we(!1),c=!1;async function u(){return window.Plotly||await Ww("https://cdn.plot.ly/plotly-3.4.0.min.js",{crossOrigin:"anonymous"}),window.Plotly}function h(){d(s)&&(document.fullscreenElement?document.exitFullscreen().catch(C=>{O(o,`Exit fullscreen failed: ${C.message}`)}):d(s).requestFullscreen().catch(C=>{O(o,`Fullscreen unavailable: ${C.message}`)}))}Rt(()=>{function C(){O(l,!!document.fullscreenElement),Promise.resolve().then(()=>{d(r)&&window.Plotly&&window.Plotly.Plots.resize(d(r))})}return document.addEventListener("fullscreenchange",C),()=>document.removeEventListener("fullscreenchange",C)});function f(){if(!d(r))return{textColor:"#333",gridColor:"#eee"};const C=getComputedStyle(d(r)),y=C.getPropertyValue("color").trim()||"#333",I=C.getPropertyValue("--border")?.trim()||C.getPropertyValue("--color-border")?.trim()||"rgba(128,128,128,0.2)";return{textColor:y,gridColor:I}}async function p(){if(!(!d(r)||!d(i))){O(o,null),O(a,!0);try{const C=await u(),{textColor:y,gridColor:I}=f(),_=d(i).data?.some(N=>t.has(N.type)),{title:E,template:L,height:P,width:k,...W}=d(i).layout,H={...W,autosize:!0,margin:{t:24,r:8,b:40,l:60,pad:0},font:{color:y},paper_bgcolor:W.paper_bgcolor??"transparent",plot_bgcolor:W.plot_bgcolor??"transparent",...!_&&W.xaxis?{xaxis:{...W.xaxis,gridcolor:I,color:y}}:{},...!_&&W.yaxis?{yaxis:{...W.yaxis,gridcolor:I,color:y}}:{}};C.react(d(r),d(i).data,H,{responsive:!0,displayModeBar:"hover",displaylogo:!1,modeBarButtonsToRemove:["sendDataToCloud","lasso2d","select2d"],...d(i).config})}catch(C){O(o,C instanceof Error?C.message:"Failed to render chart",!0)}finally{O(a,!1)}}}Ea(()=>{c=!0;let C=null;const y=new ResizeObserver(()=>{C&&clearTimeout(C),C=setTimeout(()=>{d(r)&&window.Plotly&&window.Plotly.Plots.resize(d(r)),C=null},150)});return d(s)&&y.observe(d(s)),()=>{y.disconnect(),C&&clearTimeout(C),d(r)&&window.Plotly&&window.Plotly.purge(d(r))}});let v=null;Rt(()=>{if(!(!e.value||!c||!d(r)))return v&&clearTimeout(v),v=setTimeout(()=>{p(),v=null},150),()=>{v&&clearTimeout(v)}});var S=Zw(),g=Q(S);{var m=C=>{var y=Xw(),I=Q(y,!0);q(y),Le(()=>Ze(I,d(o))),D(C,y)},x=C=>{var y=Yw();D(C,y)},M=C=>{var y=jw();D(C,y)},T=C=>{var y=Kw(),I=ae(y);Nn(I,N=>O(r,N),()=>d(r));var _=ue(I,2),E=Q(_);{var L=N=>{var R=qw(),F=Q(R);cc(F,{size:14,class:"animate-spin"}),q(R),D(N,R)};_e(E,N=>{d(a)&&N(L)})}var P=ue(E,2),k=Q(P);{var W=N=>{dc(N,{size:14})},H=N=>{uc(N,{size:14})};_e(k,N=>{d(l)?N(W):N(H,-1)})}q(P),q(_),Le(()=>{hi(I,`height: ${d(l)?"100vh":"380px"};`),At(_,1,`gap-1 left-2 top-2 absolute z-10 flex items-center opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${d(l)?"opacity-100":""}`),P.disabled=d(a),Vt(P,"title",d(l)?"Exit fullscreen":"Fullscreen")}),Lt("click",P,h),D(C,y)};_e(g,C=>{d(o)?C(m):!d(i)&&e.value?C(x,1):d(i)?C(T,-1):C(M,2)})}q(S),Nn(S,C=>O(s,C),()=>d(s)),Le(()=>At(S,1,`group rounded relative overflow-hidden border border-border ${d(l)?"bg-background":""}`)),D(n,S),it()}Gn(["click"]);var jf=async(n,e,t=null)=>{if(typeof document>"u"||typeof Blob>"u")throw new Ui("File download functionality is only available in browser environments. This function requires the DOM API (document, Blob).",gi.BROWSER_ONLY,{context:{environment:typeof window<"u"?"browser (SSR)":"Node.js",documentAvailable:typeof document<"u",blobAvailable:typeof Blob<"u"}});try{let i=await Jw(n,t);await Qw(i,e)}catch(i){throw i instanceof Ui?i:new Ui("Failed to download files from compute response",gi.INVALID_STATE,{context:{originalError:i instanceof Error?i.message:String(i)},originalError:i instanceof Error?i:void 0})}},Jw=async(n,e)=>{let t=[];if(n.forEach(i=>{let r=`${i.fileName}${i.fileType}`;if(i.subFolder&&i.subFolder.trim()!==""&&(r=`${i.subFolder}/${r}`),i.isBase64Encoded===!0&&i.data){let s=Mh(i.data);t.push({fileName:`${i.fileName}${i.fileType}`,content:new Uint8Array(s.buffer),path:r})}else i.isBase64Encoded===!1&&i.data&&t.push({fileName:`${i.fileName}${i.fileType}`,content:i.data,path:r})}),e){let i=Array.isArray(e)?e:[e],r=await Promise.all(i.map(async s=>{try{let a=await fetch(s.filePath);if(!a.ok)return zt().warn(`Failed to fetch additional file from URL: ${s.filePath}`),null;let o=await(await a.blob()).arrayBuffer();return{fileName:s.fileName,content:new Uint8Array(o),path:s.fileName}}catch(a){return zt().error(`Error fetching additional file from URL: ${s.filePath}`,a),null}}));t.push(...r.filter(s=>s!==null))}return t};async function Qw(n,e){let{zipSync:t,strToU8:i}=await qd(()=>import("../chunks/CXh1ITwj.js"),[],import.meta.url),r={};n.forEach(o=>{r[o.path]=typeof o.content=="string"?i(o.content):o.content});let s=t(r,{level:6}),a=new Blob([s],{type:"application/zip"});eT(a,`${e}.zip`)}function eT(n,e){if(typeof document>"u")throw new Ui("saveFile requires a browser environment with DOM API access.",gi.BROWSER_ONLY,{context:{function:"saveFile",requiredAPI:"document"}});let t=document.createElement("a");t.href=URL.createObjectURL(n),t.download=e,t.click(),URL.revokeObjectURL(t.href)}var da=new Map;function qf(n,e){da.set(n,e)}qf("Rhino.Geometry.Point3d",(n,e)=>{let t=e;return!t||typeof t.X!="number"?null:new n.Point([t.X,t.Y,t.Z])});qf("Rhino.Geometry.Line",(n,e)=>{let t=e;return!t||!t.From||!t.To?null:new n.Line([t.From.X,t.From.Y,t.From.Z],[t.To.X,t.To.Y,t.To.Z])});function tT(n){if(da.has(n))return da.get(n);for(let[e,t]of da)if(n.startsWith(e))return t}function nT(n){return!n||typeof n!="object"?null:n.data??n.value??null}function iT(n,e,t){let i=tT(e);if(i)try{return i(t,n)}catch(r){zt().warn(`Failed to decode Rhino type ${e}:`,r)}try{let r=nT(n);if(r)return t.CommonObject.decode(r)}catch(r){return zt().warn(`Failed to decode ${e} with CommonObject:`,r),{__decodeError:!0,type:e,raw:n}}return n}var Tr={STRING:"System.String",INT:"System.Int32",DOUBLE:"System.Double",BOOL:"System.Boolean"},rT="Rhino.Geometry.",sT=["WebDisplay"],aT="FileData";function Kf(n){return sT.some(e=>n.includes(e))}function Zf(n){if(typeof n!="string")return n;let e=n.trim();if(!(e.startsWith("{")||e.startsWith("[")||e.startsWith('"')))return n;try{let t=JSON.parse(e);if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}catch{return n}}function oT(n,e,t){switch(e){case Tr.STRING:return typeof n!="string"?n:n.replace(/^"(.*)"$/,"$1");case Tr.INT:return Number.parseInt(n,10);case Tr.DOUBLE:return Number.parseFloat(n);case Tr.BOOL:return String(n).toLowerCase()==="true";default:return t&&e.startsWith(rT)?iT(n,e,t):n}}function $f(n,e,t,i){if(typeof n!="string")return n;let r=t?Zf(n):n;return oT(r,e,i)}function lT(n){if(!n||typeof n!="object")return!1;let e=n;return typeof e.fileName=="string"&&typeof e.fileType=="string"&&"data"in e&&typeof e.isBase64Encoded=="boolean"&&typeof e.subFolder=="string"}function ya(n,e){for(let t of Object.values(n))if(Array.isArray(t))for(let i of t)e(i)}function cT(n,e=!1,t={}){let{parseValues:i=!0,rhino:r,stringOnly:s=!1}=t,a={};for(let o of n.values)ya(o.InnerTree,l=>{if(Kf(l.type)||s&&l.type!==Tr.STRING)return;let c=e?l.id:o.ParamName;if(!c)return;let u=$f(l.data,l.type,i,r);a[c]===void 0?a[c]=u:Array.isArray(a[c])?a[c].push(u):a[c]=[a[c],u]});return{values:a}}function uT(n){let e=[];for(let t of n.values)ya(t.InnerTree,i=>{if(!i.type.includes(aT))return;let r=Zf(i.data);lT(r)&&e.push(r)});return e}function Co(n,e,t={}){let{parseValues:i=!0,rhino:r,stringOnly:s=!1}=t,a;if("byName"in e?a=n.values.find(l=>l.ParamName===e.byName):a=n.values.find(l=>{let c=!1;return ya(l.InnerTree,u=>{u.id===e.byId&&(c=!0)}),c}),!a)return;let o=[];if(ya(a.InnerTree,l=>{if("byId"in e&&l.id!==e.byId||Kf(l.type)||s&&l.type!==Tr.STRING)return;let c=$f(l.data,l.type,i,r);o.push(c)}),o.length!==0)return o.length===1?o[0]:o}var dT=class{constructor(n,e=!1){this.response=n,this.debug=e}getValues(n=!1,e={}){return cT(this.response,n,e)}getValue(n,e){return Co(this.response,n,e)}getValueByParamName(n,e){return Co(this.response,{byName:n},e)}getValueByParamId(n,e){return Co(this.response,{byId:n},e)}async extractMeshesFromResponse(n){let e={debug:this.debug,...n},t;try{({getThreeMeshesFromComputeResponse:t}=await qd(()=>Promise.resolve().then(()=>cR),void 0,import.meta.url))}catch(i){throw new Ui("Failed to load three.js visualization module. Ensure three.js is installed as a peer dependency.",gi.INVALID_STATE,{context:{originalError:i instanceof Error?i.message:String(i)}})}return t(this.response,e)}getFileData(){return uT(this.response)}getAndDownloadFiles(n,e){let t=this.getFileData();jf(t,n,e)}};const hT={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif",".svg":"image/svg+xml",".json":"application/json",".txt":"text/plain",".csv":"text/csv",".xml":"application/xml",".pdf":"application/pdf",".3dm":"model/vnd.3dm",".obj":"model/obj",".stl":"model/stl"};function fT(n){const e=(n.fileType??"").toLowerCase(),t=hT[e]??"application/octet-stream";let i;if(n.isBase64Encoded){const a=atob(n.data),o=new Uint8Array(a.length);for(let l=0;l<a.length;l++)o[l]=a.charCodeAt(l);i=new Blob([o],{type:t})}else i=new Blob([n.data],{type:t});const r=`${n.fileName}${n.fileType??""}`,s=document.createElement("a");s.href=URL.createObjectURL(i),s.download=r,s.click(),URL.revokeObjectURL(s.href)}async function zl(n,e="grasshopper-output"){try{const t=Array.isArray(n)?n:[n];if(t.length===0){console.warn("[FileDownload] No files to download");return}if(t.length===1){fT(t[0]);return}await jf(t,e)}catch(t){throw console.error("[FileDownload] Error downloading files:",t),t}}function Po(n){if(n===0)return"0 Bytes";const e=Nr.FILE_SIZE.BYTES_PER_KB,t=["Bytes","KB","MB","GB"],i=Math.floor(Math.log(n)/Math.log(e));return Math.round(n/Math.pow(e,i)*100)/100+" "+t[i]}function Do(n){return Math.ceil(n.length*3/4)}var pT=Z('<div class="px-4 py-3 text-sm text-destructive"> </div>'),mT=Z('<div class="px-4 py-8 text-sm text-center text-muted-foreground">Waiting for image...</div>'),gT=Z(`<div class="px-4 py-3 text-sm text-destructive">Unsupported image format: <span class="font-mono"> </span>. Supported:
|
|
4116
|
-
.png, .jpg, .jpeg, .webp, .gif, .svg</div>`),vT=Z('<button title="Download image" class="rounded p-1.5 backdrop-blur-sm flex items-center border border-border bg-background/80 text-foreground transition-colors hover:bg-background disabled:cursor-not-allowed disabled:opacity-50"><!></button>'),_T=Z('<button class="rounded p-1.5 backdrop-blur-sm flex items-center border border-border bg-background/80 text-foreground transition-colors hover:bg-background"><!></button>'),xT=Z("<div><!> <!></div>"),bT=Z('<div class="w-full"><img class="h-full w-full object-contain"/></div> <!>',1),ST=Z("<div><!></div>");function yT(n,e){nt(e,!0);const t=new Set([".png",".jpg",".jpeg",".webp",".gif",".svg"]),i={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif",".svg":"image/svg+xml"};function r(E){return!!E&&typeof E=="object"&&"fileName"in E&&"data"in E&&"fileType"in E}const s=z(()=>Array.isArray(e.value)?e.value.find(r)??null:r(e.value)?e.value:null),a=z(()=>d(s)?(d(s).fileType??"").toLowerCase():""),o=z(()=>t.has(d(a))),l=z(()=>{if(!d(s)||!d(o))return null;const E=i[d(a)]??"application/octet-stream";return d(s).isBase64Encoded?`data:${E};base64,${d(s).data}`:`data:${E};utf8,${encodeURIComponent(d(s).data)}`}),c=z(()=>e.item.config??{}),u=z(()=>d(c).allowDownload??!0),h=z(()=>d(c).allowFullscreen??!0),f=z(()=>d(c).backgroundColor);let p=we(null),v=we(!1),S=we(!1),g=we(null);function m(){d(p)&&(document.fullscreenElement?document.exitFullscreen().catch(E=>{O(g,`Exit fullscreen failed: ${E.message}`)}):d(p).requestFullscreen().catch(E=>{O(g,`Fullscreen unavailable: ${E.message}`)}))}Rt(()=>{function E(){O(v,!!document.fullscreenElement)}return document.addEventListener("fullscreenchange",E),()=>document.removeEventListener("fullscreenchange",E)});async function x(){if(d(s)){O(S,!0),O(g,null);try{await zl(d(s),d(s).fileName)}catch(E){O(g,E instanceof Error?E.message:"Download failed",!0)}finally{O(S,!1)}}}var M=ST(),T=Q(M);{var C=E=>{var L=pT(),P=Q(L,!0);q(L),Le(()=>Ze(P,d(g))),D(E,L)},y=E=>{var L=mT();D(E,L)},I=E=>{var L=gT(),P=ue(Q(L)),k=Q(P,!0);q(P),ct(),q(L),Le(()=>Ze(k,d(a)||"(unknown)")),D(E,L)},_=E=>{var L=bT(),P=ae(L),k=Q(P);q(P);var W=ue(P,2);{var H=N=>{var R=xT(),F=Q(R);{var U=$=>{var ee=vT(),Se=Q(ee);Sh(Se,{size:14}),q(ee),Le(()=>ee.disabled=d(S)),Lt("click",ee,x),D($,ee)};_e(F,$=>{d(u)&&d(s)&&$(U)})}var X=ue(F,2);{var V=$=>{var ee=_T(),Se=Q(ee);{var ye=K=>{dc(K,{size:14})},ve=K=>{uc(K,{size:14})};_e(Se,K=>{d(v)?K(ye):K(ve,-1)})}q(ee),Le(()=>Vt(ee,"title",d(v)?"Exit fullscreen":"Fullscreen")),Lt("click",ee,m),D($,ee)};_e(X,$=>{d(h)&&$(V)})}q(R),Le(()=>At(R,1,`gap-1 right-2 top-2 absolute z-10 flex items-center opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${d(v)?"opacity-100":""}`)),D(N,R)};_e(W,N=>{(d(u)||d(h))&&N(H)})}Le(()=>{hi(P,`height: ${d(v)?"100vh":"380px"}; ${d(f)?`background-color: ${d(f)};`:""}`),Vt(k,"src",d(l)),Vt(k,"alt",e.item.displayName??d(s).fileName)}),D(E,L)};_e(T,E=>{d(g)?E(C):d(s)?d(o)?E(_,-1):E(I,2):E(y,1)})}q(M),Nn(M,E=>O(p,E),()=>d(p)),Le(()=>At(M,1,`group rounded relative overflow-hidden border border-border ${d(v)?"bg-background":""}`)),D(n,M),it()}Gn(["click"]);const Wd=n=>{var e=TT();D(n,e)};var MT=Z("<!> <!>",1),ET=Z("<!> <!>",1),wT=Z('<div class="gap-2 flex items-center"><!> <!></div>'),TT=Z('<span class="text-muted-foreground not-italic">Waiting for data...</span>'),AT=Z('<div class="ml-4 pl-2 border-l border-border/50"><!></div>'),RT=Z('<div><button class="gap-1.5 py-0.5 text-xs flex w-full items-center text-muted-foreground transition-colors hover:text-foreground"><!> <!> <span class="font-medium"> </span></button> <!></div>'),CT=Z('<div class="gap-1.5 py-0.5 flex items-center justify-between"><div class="gap-1.5 min-w-0 flex items-center"><!> <span class="text-xs truncate text-foreground"> </span></div> <span class="text-xs shrink-0 text-muted-foreground"> </span></div>'),PT=Z('<div class="rounded px-3 py-3 text-sm border border-border bg-muted text-muted-foreground">Waiting for file data...</div>'),DT=Z('<div class="gap-2 text-xs flex items-center justify-between text-muted-foreground"><span class="min-w-0 truncate"> </span> <span class="shrink-0"> </span></div>'),IT=Z('<div class="gap-1 flex flex-col"></div>'),LT=Z('<div class="mt-2"><!></div>'),NT=Z('<li class="truncate"><span class="font-mono"> </span></li>'),UT=Z('<div class="rounded px-3 py-2 text-sm border border-destructive bg-destructive/10 text-destructive"><div class="font-medium">Duplicate file names detected</div> <div class="mt-1 text-xs"> </div> <ul class="mt-1 ml-4 text-xs list-disc"></ul> <div class="mt-1 text-xs">Rename outputs in your Grasshopper definition so each file has a unique name.</div></div>'),FT=Z('<div class="rounded px-3 py-2 text-sm border border-destructive bg-destructive/10 text-destructive"> </div>'),OT=Z('<div class="gap-2 flex flex-col"><div class="rounded px-3 py-2 border border-border bg-muted"><div class="gap-2 flex items-center justify-between"><span class="min-w-0 text-sm font-medium truncate text-foreground"> </span> <span class="text-xs shrink-0 text-muted-foreground"> </span></div> <!></div> <!> <!> <!></div>'),BT=Z('<span class="font-bold text-primary"> </span>'),zT=Z("<div><!></div>"),kT=Z("<pre> </pre>"),VT=Z("<div><!></div>"),HT=Z('<div class="group relative"><!> <!></div>'),GT=Z('<div class="gap-2 flex flex-col"><!> <!></div>');function WT(n,e){nt(e,!0);const t=V=>{var $=wT(),ee=Q($);Di(ee,{children:(ve,K)=>{ct();var fe=Tt();Le(()=>Ze(fe,d(o))),D(ve,fe)},$$slots:{default:!0}});var Se=ue(ee,2);{var ye=ve=>{var K=Pe(),fe=ae(K);We(fe,()=>Ar,(Y,oe)=>{oe(Y,{children:(Me,Ee)=>{var Ge=ET(),Te=ae(Ge);We(Te,()=>Kd,(Ae,Ce)=>{Ce(Ae,{class:"p-1 cursor-help opacity-60 transition-opacity hover:opacity-100",children:(Oe,Be)=>{eg(Oe,{size:16})},$$slots:{default:!0}})});var Ve=ue(Te,2);We(Ve,()=>Rr,(Ae,Ce)=>{Ce(Ae,{class:"sm:max-w-md",children:(Oe,Be)=>{var He=Pe(),B=ae(He);We(B,()=>rs,(De,pe)=>{pe(De,{children:(Ne,ce)=>{var je=MT(),w=ae(je);We(w,()=>Ji,(G,ne)=>{ne(G,{children:(de,he)=>{ct();var xe=Tt();Le(()=>Ze(xe,d(o))),D(de,xe)},$$slots:{default:!0}})});var b=ue(w,2);We(b,()=>ss,(G,ne)=>{ne(G,{children:(de,he)=>{ct();var xe=Tt();Le(()=>Ze(xe,e.item.description)),D(de,xe)},$$slots:{default:!0}})}),D(Ne,je)},$$slots:{default:!0}})}),D(Oe,He)},$$slots:{default:!0}})}),D(Me,Ge)},$$slots:{default:!0}})}),D(ve,K)};_e(Se,ve=>{e.item.description&&ve(ye)})}q($),D(V,$)},i=(V,$=Ut,ee=Ut)=>{var Se=Pe(),ye=ae(Se);Ht(ye,17,$,([ve,K])=>ve,(ve,K)=>{var fe=z(()=>$i(d(K),2));let Y=()=>d(fe)[1];var oe=Pe(),Me=ae(oe);{var Ee=Te=>{const Ve=z(()=>ee()?`${ee()}/${Y().name}`:Y().name),Ae=z(()=>E.has(d(Ve)));var Ce=RT(),Oe=Q(Ce),Be=Q(Oe);{let w=z(()=>d(Ae)?"rotate-90":"");eh(Be,{size:12,get class(){return`shrink-0 transition-transform duration-150 ${d(w)??""}`}})}var He=ue(Be,2);{var B=w=>{Qp(w,{size:13,class:"shrink-0 text-primary/70"})},De=w=>{Jm(w,{size:13,class:"shrink-0 text-primary/70"})};_e(He,w=>{d(Ae)?w(B):w(De,-1)})}var pe=ue(He,2),Ne=Q(pe,!0);q(pe),q(Oe);var ce=ue(Oe,2);{var je=w=>{var b=AT(),G=Q(b);i(G,()=>Y().children,()=>d(Ve)),q(b),D(w,b)};_e(ce,w=>{d(Ae)&&w(je)})}q(Ce),Le(()=>Ze(Ne,Y().name)),Lt("click",Oe,()=>L(d(Ve))),D(Te,Ce)},Ge=Te=>{var Ve=CT(),Ae=Q(Ve),Ce=Q(Ae);$m(Ce,{size:12,class:"shrink-0 text-muted-foreground"});var Oe=ue(Ce,2),Be=Q(Oe);q(Oe),q(Ae);var He=ue(Ae,2),B=Q(He,!0);q(He),q(Ve),Le(De=>{Ze(Be,`${Y().file.fileName??""}${Y().file.fileType??""}`),Ze(B,De)},[()=>Po(Do(Y().file.data))]),D(Te,Ve)};_e(Me,Te=>{Y().type==="folder"?Te(Ee):Te(Ge,-1)})}D(ve,oe)}),D(V,Se)},r=V=>{var $=Pe(),ee=ae($);{var Se=ve=>{var K=PT();D(ve,K)},ye=ve=>{var K=OT(),fe=Q(K),Y=Q(fe),oe=Q(Y),Me=Q(oe,!0);q(oe);var Ee=ue(oe,2),Ge=Q(Ee,!0);q(Ee),q(Y);var Te=ue(Y,2);{var Ve=B=>{var De=LT(),pe=Q(De);{var Ne=je=>{i(je,()=>d(C),()=>"")},ce=je=>{var w=IT();Ht(w,23,()=>d(S),(b,G)=>y(b)+"#"+G,(b,G)=>{var ne=DT(),de=Q(ne),he=Q(de);q(de);var xe=ue(de,2),ie=Q(xe,!0);q(xe),q(ne),Le(ge=>{Ze(he,`${d(G).fileName??""}${d(G).fileType??""}`),Ze(ie,ge)},[()=>Po(Do(d(G).data))]),D(b,ne)}),q(w),D(je,w)};_e(pe,je=>{d(C)?je(Ne):je(ce,-1)})}q(De),D(B,De)};_e(Te,B=>{d(g)>1&&B(Ve)})}q(fe);var Ae=ue(fe,2);{var Ce=B=>{var De=UT(),pe=ue(Q(De),2),Ne=Q(pe);q(pe);var ce=ue(pe,2);Ht(ce,20,()=>d(I),je=>je,(je,w)=>{var b=NT(),G=Q(b),ne=Q(G,!0);q(G),q(b),Le(()=>Ze(ne,w)),D(je,b)}),q(ce),ct(2),q(De),Le(()=>Ze(Ne,`The following ${d(I).length===1?"path appears":"paths appear"} more than once:`)),D(B,De)};_e(Ae,B=>{d(_)&&B(Ce)})}var Oe=ue(Ae,2);{var Be=B=>{var De=FT(),pe=Q(De,!0);q(De),Le(()=>Ze(pe,d(p))),D(B,De)};_e(Oe,B=>{d(p)&&B(Be)})}var He=ue(Oe,2);{let B=z(()=>d(f)||d(_));mn(He,{onclick:P,get disabled(){return d(B)},class:"w-full",children:(De,pe)=>{ct();var Ne=Tt();Le(()=>Ze(Ne,d(f)?"Downloading...":`Download ${d(g)===1?"File":`${d(g)} Files`}`)),D(De,Ne)},$$slots:{default:!0}})}q(K),Le(B=>{Ze(Me,d(g)===1?`${d(S)[0].fileName}${d(S)[0].fileType}`:`${d(g)} files`),Ze(Ge,B)},[()=>Po(d(m))]),D(ve,K)};_e(ee,ve=>{d(g)===0?ve(Se):ve(ye,-1)})}D(V,$)};let s=we(!1),a;const o=z(()=>e.displayName||e.item.displayName||e.item.paramId),l=z(()=>typeof e.value=="object"&&e.value!==null),c=z(()=>e.value==null?"":d(l)?JSON.stringify(e.value,null,2):String(e.value)),u=z(()=>e.value!=null);async function h(){try{await navigator.clipboard.writeText(d(c)),O(s,!0),clearTimeout(a),a=setTimeout(()=>O(s,!1),2e3)}catch(V){console.error("Failed to copy:",V)}}let f=we(!1),p=we(null);function v(V){return V&&typeof V=="object"&&"fileName"in V&&"data"in V}const S=z(()=>e.value?Array.isArray(e.value)?e.value.filter(v):v(e.value)?[e.value]:[]:[]),g=z(()=>d(S).length),m=z(()=>d(S).reduce((V,$)=>V+Do($.data),0));function x(V){const $=new pa;for(let ee=0;ee<V.length;ee++){const Se=V[ee],ye=(Se.subFolder||"").split("/").filter(Boolean);let ve=$;for(const Y of ye){ve.has(Y)||ve.set(Y,{type:"folder",name:Y,children:new pa});const oe=ve.get(Y);oe.type==="folder"&&(ve=oe.children)}const K=`${Se.fileName}${Se.fileType??""}`,fe=ve.has(K)?`${K}#${ee}`:K;ve.set(fe,{type:"file",file:Se})}return $}function M(V,$=""){const ee=[];for(const[Se,ye]of V)if(ye.type==="folder"){const ve=$?`${$}/${Se}`:Se;ee.push(ve),ee.push(...M(ye.children,ve))}return ee}const T=z(()=>d(S).some(V=>V.subFolder&&V.subFolder.length>0)),C=z(()=>d(T)?x(d(S)):null);function y(V){const $=(V.subFolder||"").replace(/^\/+|\/+$/g,""),ee=`${V.fileName}${V.fileType??""}`;return $?`${$}/${ee}`:ee}const I=z(()=>{const V={};for(const $ of d(S)){const ee=y($);V[ee]=(V[ee]??0)+1}return Object.entries(V).filter(([,$])=>$>1).map(([$])=>$)}),_=z(()=>d(I).length>0);let E=new is;Rt(()=>{if(d(C)){E.clear();for(const V of M(d(C)))E.add(V)}});function L(V){E.has(V)?E.delete(V):E.add(V)}async function P(){if(d(g)!==0){O(f,!0),O(p,null);try{if(d(g)===1)await zl(d(S)[0],d(S)[0].fileName);else{const V=e.displayName?e.displayName.replace(/[^a-z0-9]/gi,"_").toLowerCase():"download";await zl(d(S),V)}}catch(V){O(p,V instanceof Error?V.message:"Failed to download files",!0),console.error("[OutputDisplayWidget] Download error:",V)}finally{O(f,!1)}}}var k=GT(),W=Q(k);t(W);var H=ue(W,2);{var N=V=>{{let $=z(()=>typeof e.value=="string"?e.value:e.value!=null?JSON.stringify(e.value):"");$w(V,{get item(){return e.item},get value(){return d($)}})}},R=V=>{yT(V,{get item(){return e.item},get value(){return e.value}})},F=V=>{r(V)},U=V=>{var $=zT();At($,1,"min-h-12.5 rounded px-3 py-3 font-mono text-sm border border-border flex items-center bg-muted/50 wrap-break-word");var ee=Q($);{var Se=ve=>{var K=BT(),fe=Q(K,!0);q(K),Le(()=>Ze(fe,d(c))),D(ve,K)},ye=ve=>{Wd(ve)};_e(ee,ve=>{d(u)?ve(Se):ve(ye,-1)})}q($),D(V,$)},X=V=>{var $=HT(),ee=Q($);{var Se=fe=>{var Y=kT();At(Y,1,"min-h-12.5 rounded px-3 py-3 font-mono text-sm border border-border overflow-wrap-anywhere max-h-96 overflow-auto bg-muted/10 text-foreground");var oe=Q(Y,!0);q(Y),Le(()=>Ze(oe,d(c))),D(fe,Y)},ye=fe=>{var Y=VT();At(Y,1,"min-h-12.5 rounded px-3 py-3 font-mono text-sm border border-border overflow-wrap-anywhere bg-muted/10 wrap-break-word whitespace-pre-wrap text-foreground");var oe=Q(Y);{var Me=Ge=>{var Te=Tt();Le(()=>Ze(Te,e.value)),D(Ge,Te)},Ee=Ge=>{Wd(Ge)};_e(oe,Ge=>{d(u)?Ge(Me):Ge(Ee,-1)})}q(Y),D(fe,Y)};_e(ee,fe=>{d(l)?fe(Se):fe(ye,-1)})}var ve=ue(ee,2);{var K=fe=>{{let Y=z(()=>d(s)?"opacity-100":"opacity-0 group-hover:opacity-100");mn(fe,{onclick:h,get class(){return`right-2 top-2 absolute transition-opacity ${d(Y)??""}`},size:"sm",children:(oe,Me)=>{ct();var Ee=Tt();Le(()=>Ze(Ee,d(s)?"Copied!":"Copy")),D(oe,Ee)},$$slots:{default:!0}})}};_e(ve,fe=>{d(u)&&fe(K)})}q($),D(V,$)};_e(H,V=>{e.item.widgetType==="chart"?V(N):e.item.widgetType==="image"?V(R,1):e.item.widgetType==="file"?V(F,2):e.item.widgetType==="number"?V(U,3):e.item.widgetType==="text"&&V(X,4)})}q(k),D(n,k),it()}Gn(["click"]);var XT=Z('<div class="gap-8 flex flex-col"></div>'),YT=Z('<div class="p-4 tab-content-container svelte-1v4x2r6"><!></div>');function jT(n,e){nt(e,!0);const t=(l,c=Ut,u=Ut)=>{const h=z(()=>r(c().paramId));var f=Pe(),p=ae(f);{var v=S=>{Gw(S,{get item(){return c()},get value(){return e.values[d(h).id]},get displayName(){return c().displayName},get onChange(){return e.onValueChange},get disabled(){return u().disabled}})};_e(p,S=>{d(h)&&S(v)})}D(l,f)},i=(l,c=Ut)=>{const u=z(()=>s(c().paramId));var h=Pe(),f=ae(h);{var p=v=>{WT(v,{get item(){return c()},get value(){return e.values[c().paramId]},get displayName(){return c().displayName}})};_e(f,v=>{d(u)&&v(p)})}D(l,h)};function r(l){return e.inputs.find(c=>c.id===l)}function s(l){return e.outputs.find(c=>c.id===l)}var a=Pe(),o=ae(a);We(o,()=>Xp,(l,c)=>{c(l,{get value(){return e.tab.id},class:"min-h-0 p-0 flex-1",children:(u,h)=>{Cf(u,{class:"h-full",orientation:"vertical",children:(f,p)=>{var v=YT(),S=Q(v);{var g=x=>{Fl(x,{type:"empty",size:"medium",message:"This tab has no groups configured."})},m=x=>{var M=XT();Ht(M,21,()=>e.tab.groups,T=>T.id,(T,C)=>{var y=Pe(),I=ae(y);{var _=L=>{{let P=z(()=>d(C).columns??1),k=z(()=>e.collapsedGroups[d(C).id]??!1),W=z(()=>e.tab.groups.length===1);q1(L,{get label(){return d(C).label},get description(){return d(C).description},get items(){return d(C).items},get columns(){return d(P)},get collapsed(){return d(k)},get values(){return e.values},onToggle:()=>e.onToggleGroup(d(C).id),get inputSnippet(){return t},get outputSnippet(){return i},get flat(){return d(W)}})}},E=z(()=>k1(d(C),e.values));_e(I,L=>{d(E)&&L(_)})}D(T,y)}),q(M),D(x,M)};_e(S,x=>{e.tab.groups.length===0?x(g):x(m,-1)})}q(v),D(f,v)},$$slots:{default:!0}})},$$slots:{default:!0}})}),D(n,a),it()}var qT=Z("<!> <!>",1);function KT(n,e){nt(e,!0);let t=me(e,"requestedTabId",3,null),i=we(""),r=$n({});const s=z(()=>e.schema.layout.type==="tabbed"?e.schema.layout.tabs.filter(h=>e.panelFilter?e.panelFilter==="right"?h.position==="right":h.position!=="right":!0):[]),a=z(()=>d(s).length>1);Rt(()=>{t()&&d(s).some(h=>h.id===t())?O(i,t()):d(s).length>0&&!d(i)&&O(i,d(s)[0].id,!0)}),Rt(()=>{if(e.schema.layout.type!=="tabbed")return;const h={};e.schema.layout.tabs.forEach(f=>f.groups.forEach(p=>{p.id in r||(h[p.id]=p.collapsed??!1)})),Object.keys(h).length>0&&Object.assign(r,h)}),Rt(()=>{if(e.schema.layout.type!=="tabbed")return;const h={};d(s).forEach(f=>f.groups.forEach(p=>p.items.forEach(v=>{if(v.type==="linebreak")return;const{visible:S,disabled:g,defaultValue:m}=Ol(v,e.values),x=e.schema.inputs.find(M=>M.id===v.paramId);!x||m===void 0||(!S||g)&&e.values[x.id]!==m&&(h[x.id]=m)}))),Object.keys(h).length>0&&Object.assign(e.values,h)});function o(h){r[h]=!r[h]}function l(h){O(i,h,!0)}var c=Pe(),u=ae(c);We(u,()=>Cr,(h,f)=>{f(h,{class:"pt-1 min-h-0 mx-1 flex flex-1 flex-col overflow-hidden",children:(p,v)=>{var S=Pe(),g=ae(S);We(g,()=>Yp,(m,x)=>{x(m,{get value(){return d(i)},class:"gap-0 min-h-0 flex flex-1 flex-col",children:(M,T)=>{var C=qT(),y=ae(C);{var I=E=>{N1(E,{get tabs(){return d(s)},onTabChange:l})};_e(y,E=>{d(a)&&E(I)})}var _=ue(y,2);Ht(_,17,()=>d(s),E=>E.id,(E,L)=>{jT(E,{get tab(){return d(L)},get values(){return e.values},get collapsedGroups(){return r},onToggleGroup:o,get onValueChange(){return e.onValueChange},get inputs(){return e.schema.inputs},get outputs(){return e.schema.outputs}})}),D(M,C)},$$slots:{default:!0}})}),D(p,S)},$$slots:{default:!0}})}),D(n,c),it()}var ZT=Z('<span class="text-xs font-semibold"> </span>'),$T=Z('<span class="text-xs font-semibold"> </span>'),JT=Z('<button type="button"><!></button>'),QT=Z('<div role="button" tabindex="0"></div>');function Xd(n,e){nt(e,!0);const t=z(()=>["gap-1 py-2 lg:py-3 lg:flex-col lg:w-auto px-2 lg:px-0","flex w-full shrink-0 flex-row items-center","backdrop-blur-sm bg-background/90 cursor-pointer"].join(" ")),i="w-8 h-8 rounded cursor-pointer flex shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-accent hover:text-foreground";var r=QT();Ht(r,21,()=>e.tabs,s=>s.id,(s,a)=>{var o=JT();At(o,1,fa(i));var l=Q(o);{var c=h=>{var f=Pe(),p=ae(f);{var v=m=>{Vf(m,{get icon(){return d(a).icon},class:"h-4 w-4"})},S=z(()=>d(a).icon.includes(":")),g=m=>{var x=ZT(),M=Q(x,!0);q(x),Le(()=>Ze(M,d(a).icon)),D(m,x)};_e(p,m=>{d(S)?m(v):m(g,-1)})}D(h,f)},u=h=>{var f=$T(),p=Q(f,!0);q(f),Le(v=>Ze(p,v),[()=>d(a).label[0]?.toUpperCase()??"?"]),D(h,f)};_e(l,h=>{d(a).icon?h(c):h(u,-1)})}q(o),Le(()=>{Vt(o,"title",d(a).label),Vt(o,"aria-label",d(a).label)}),Lt("click",o,h=>{h.stopPropagation(),e.onTabClick(d(a).id)}),D(s,o)}),q(r),Le(()=>{At(r,1,fa(d(t)),"svelte-ia1juq"),hi(r,`--collapsed-w: ${e.collapsedWidth??""}px;`),Vt(r,"aria-label",`Expand ${e.side??""} panel`)}),Lt("click",r,function(...s){e.onExpand?.apply(this,s)}),Lt("keydown",r,s=>(s.key==="Enter"||s.key===" ")&&e.onExpand()),D(n,r),it()}Gn(["click","keydown"]);function eA(n){return n.layout?n.layout.type==="tabbed"?n.layout.tabs.flatMap(e=>e.groups??[]):n.layout.type==="flat"?n.layout.groups??[]:[]:[]}function tA(n,e,t){const i=[];for(const r of eA(n))for(const s of r.items??[]){if(s.type!=="input")continue;const a=e[s.paramId],o=n.inputs.find(l=>l.id===s.paramId);a!==void 0&&o&&i.push({paramId:s.paramId,nickname:o.nickname,displayName:s.displayName||o.nickname,paramType:o.paramType,value:a,groupName:r.label})}return{id:em(),name:t.name,description:t.description,timestamp:new Date().toISOString(),schemaId:n.id,documentId:n.documentId??"",projectFileName:n.projectFileName??"",pluginVersion:n.pluginVersion??"",author:t.author,tags:t.tags??[],parameters:i}}function nA(n,e){const t=[];n.documentId!==(e.documentId??"")&&t.push({paramId:"__document__",severity:"error",message:"Document ID mismatch - this state was saved for a different document",details:{expected:e.documentId??"",actual:n.documentId}}),n.schemaId!==e.id&&t.push({paramId:"__schema__",severity:"warning",message:"Schema has changed since this state was saved",details:{expected:e.id,actual:n.schemaId}});for(const r of n.parameters){const s=e.inputs.find(a=>a.id===r.paramId);if(!s){t.push({paramId:r.paramId,severity:"error",message:`Parameter "${r.nickname}" no longer exists in the schema`});continue}s.nickname!==r.nickname&&t.push({paramId:r.paramId,severity:"warning",message:"Parameter nickname changed",details:{expected:r.nickname,actual:s.nickname}})}const i=t.some(r=>r.severity==="error");return{isValid:t.length===0,issues:t,canLoad:!i}}function Yd(n,e,t){const i=new Set(t.issues.filter(s=>s.severity==="error"&&!s.paramId.startsWith("__")).map(s=>s.paramId)),r={};for(const s of n.parameters){const a=e.inputs.some(o=>o.id===s.paramId);!i.has(s.paramId)&&a&&(r[s.paramId]=s.value)}return r}function iA(n){const e=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=`${n.name.replace(/[^a-z0-9]/gi,"_")}_${n.timestamp.split("T")[0].replace(/-/g,"_")}.sps`,i.style.display="none",document.body.appendChild(i),setTimeout(()=>{i.click(),setTimeout(()=>{document.body.removeChild(i),URL.revokeObjectURL(t)},Nr.TIMEOUTS.PARAM_EXPORT_DELAY)},0)}async function rA(n){const e=JSON.parse(await n.text());if(!e.id||!e.name||!e.documentId||!e.parameters)throw new Error("Invalid saved state file format");return e}var sA=Z("<!> Save State",1),aA=Z("<!> Load State",1),oA=Z("<!> ",1),lA=Z("<!> <!>",1),cA=Z("<!> <!>",1),uA=Z('<!> <div class="gap-4 py-4 grid"><div class="gap-2 grid"><!> <!></div> <div class="gap-2 grid"><!> <!></div> <div class="gap-2 grid"><!> <!></div> <div class="gap-2 grid"><!> <!></div></div> <!>',1),dA=Z("<!> <!>",1),hA=Z("<!> Select .sps File",1),fA=Z('<!> <div class="py-8"><!></div> <!>',1),pA=Z("<!> <!>",1),mA=Z('<div class="gap-3 flex items-start"><!> <div><h4 class="text-sm font-semibold text-success-foreground">No Issues Found</h4> <p class="text-sm mt-1 text-success-foreground/80">This state can be loaded safely.</p></div></div>'),gA=Z('<div class="gap-3 flex items-start"><!> <div><h4 class="text-sm font-semibold text-warning-foreground">Warnings Detected</h4> <p class="text-sm mt-1 text-warning-foreground/80"> </p></div></div>'),vA=Z('<div class="gap-3 flex items-start"><!> <div><h4 class="text-sm font-semibold text-destructive">Critical Errors</h4> <p class="text-sm mt-1 text-destructive/80">Cannot load this state due to critical incompatibilities.</p></div></div>'),_A=Z('<p class="text-xs mt-1 text-muted-foreground"> </p>'),xA=Z('<div><div class="gap-2 flex items-start"><!> <div class="flex-1"><p class="text-sm font-medium"> </p> <!></div></div></div>'),bA=Z('<div class="space-y-2"><h4 class="text-sm font-medium">Issues:</h4> <!></div>'),SA=Z('<div class="gap-4 py-4 grid"><!> <!></div>'),yA=Z("<!> <!>",1),MA=Z("<!> <!> <!>",1),EA=Z('<!> <!> <!> <input type="file" accept=".sps" class="hidden"/> <!> <!> <!>',1);function wA(n,e){nt(e,!0);let t=me(e,"showSaveButton",3,!0),i=me(e,"showLoadButton",3,!0),r=me(e,"actions",19,()=>[]),s=we(!1),a=we(""),o=we(""),l=we(""),c=we(""),u=we(!1),h=we(!1),f=we(null),p=we(null),v=we(null);function S(){O(a,`State ${new Date().toLocaleDateString()}`),O(o,""),O(l,e.schema.author||"",!0),O(c,""),O(s,!0)}function g(){if(!d(a).trim()){alert("Please enter a name for this state");return}const R=tA(e.schema,e.currentValues,{name:d(a).trim(),description:d(o).trim()||void 0,author:d(l).trim()||void 0,tags:d(c).split(",").map(F=>F.trim()).filter(F=>F.length>0)});iA(R),O(s,!1)}async function m(R){const F=R.target;if(!(!F.files||F.files.length===0)){try{const U=F.files[0],X=await rA(U),V=nA(X,e.schema);if(!V.canLoad){O(f,X,!0),O(p,V,!0),O(u,!0);return}if(!V.isValid){O(f,X,!0),O(p,V,!0),O(u,!0);return}const $=Yd(X,e.schema,V);e.onLoadValues($)}catch(U){alert("Failed to import state: "+U.message)}F.value=""}}function x(){if(!(!d(f)||!d(p))&&d(p).canLoad){const R=Yd(d(f),e.schema,d(p));e.onLoadValues(R),O(u,!1),O(f,null),O(p,null)}}function M(){O(u,!1),O(f,null),O(p,null)}function T(){O(h,!0)}function C(){d(v)?.click(),O(h,!1)}var y=EA(),I=ae(y);{var _=R=>{mn(R,{variant:"default",size:"sm",onclick:S,children:(F,U)=>{var X=sA(),V=ae(X);Sh(V,{class:"mr-2 h-4 w-4"}),ct(),D(F,X)},$$slots:{default:!0}})};_e(I,R=>{t()&&R(_)})}var E=ue(I,2);{var L=R=>{mn(R,{variant:"outline",size:"sm",onclick:T,children:(F,U)=>{var X=aA(),V=ae(X);pu(V,{class:"mr-2 h-4 w-4"}),ct(),D(F,X)},$$slots:{default:!0}})};_e(E,R=>{i()&&R(L)})}var P=ue(E,2);Ht(P,17,r,R=>R.id,(R,F)=>{{let U=z(()=>d(F).variant??"outline"),X=z(()=>d(F).size??"sm");mn(R,{get variant(){return d(U)},get size(){return d(X)},get onclick(){return d(F).onclick},children:(V,$)=>{var ee=oA(),Se=ae(ee);{var ye=K=>{const fe=z(()=>d(F).icon);var Y=Pe(),oe=ae(Y);We(oe,()=>d(fe),(Me,Ee)=>{Ee(Me,{class:"mr-2 h-4 w-4"})}),D(K,Y)};_e(Se,K=>{d(F).icon&&K(ye)})}var ve=ue(Se);Le(()=>Ze(ve,` ${d(F).label??""}`)),D(V,ee)},$$slots:{default:!0}})}});var k=ue(P,2);Nn(k,R=>O(v,R),()=>d(v));var W=ue(k,2);We(W,()=>Ar,(R,F)=>{F(R,{get open(){return d(s)},set open(U){O(s,U,!0)},children:(U,X)=>{var V=Pe(),$=ae(V);We($,()=>Rr,(ee,Se)=>{Se(ee,{children:(ye,ve)=>{var K=uA(),fe=ae(K);We(fe,()=>rs,(pe,Ne)=>{Ne(pe,{children:(ce,je)=>{var w=lA(),b=ae(w);We(b,()=>Ji,(ne,de)=>{de(ne,{children:(he,xe)=>{ct();var ie=Tt("Save Parameter State");D(he,ie)},$$slots:{default:!0}})});var G=ue(b,2);We(G,()=>ss,(ne,de)=>{de(ne,{children:(he,xe)=>{ct();var ie=Tt("Save the current parameter values as a .sps file");D(he,ie)},$$slots:{default:!0}})}),D(ce,w)},$$slots:{default:!0}})});var Y=ue(fe,2),oe=Q(Y),Me=Q(oe);Di(Me,{for:"export-name",children:(pe,Ne)=>{ct();var ce=Tt("State Name *");D(pe,ce)},$$slots:{default:!0}});var Ee=ue(Me,2);Pr(Ee,{id:"export-name",placeholder:"e.g., Design Option A",get value(){return d(a)},set value(pe){O(a,pe,!0)}}),q(oe);var Ge=ue(oe,2),Te=Q(Ge);Di(Te,{for:"export-description",children:(pe,Ne)=>{ct();var ce=Tt("Description");D(pe,ce)},$$slots:{default:!0}});var Ve=ue(Te,2);jp(Ve,{id:"export-description",placeholder:"Optional description of this state",rows:3,get value(){return d(o)},set value(pe){O(o,pe,!0)}}),q(Ge);var Ae=ue(Ge,2),Ce=Q(Ae);Di(Ce,{for:"export-author",children:(pe,Ne)=>{ct();var ce=Tt("Author");D(pe,ce)},$$slots:{default:!0}});var Oe=ue(Ce,2);Pr(Oe,{id:"export-author",placeholder:"Your name or email",get value(){return d(l)},set value(pe){O(l,pe,!0)}}),q(Ae);var Be=ue(Ae,2),He=Q(Be);Di(He,{for:"export-tags",children:(pe,Ne)=>{ct();var ce=Tt("Tags");D(pe,ce)},$$slots:{default:!0}});var B=ue(He,2);Pr(B,{id:"export-tags",placeholder:"facade, option-a, client-approved (comma-separated)",get value(){return d(c)},set value(pe){O(c,pe,!0)}}),q(Be),q(Y);var De=ue(Y,2);We(De,()=>ka,(pe,Ne)=>{Ne(pe,{children:(ce,je)=>{var w=cA(),b=ae(w);mn(b,{variant:"outline",onclick:()=>O(s,!1),children:(ne,de)=>{ct();var he=Tt("Cancel");D(ne,he)},$$slots:{default:!0}});var G=ue(b,2);mn(G,{onclick:g,children:(ne,de)=>{ct();var he=Tt("Save State");D(ne,he)},$$slots:{default:!0}}),D(ce,w)},$$slots:{default:!0}})}),D(ye,K)},$$slots:{default:!0}})}),D(U,V)},$$slots:{default:!0}})});var H=ue(W,2);We(H,()=>Ar,(R,F)=>{F(R,{get open(){return d(h)},set open(U){O(h,U,!0)},children:(U,X)=>{var V=Pe(),$=ae(V);We($,()=>Rr,(ee,Se)=>{Se(ee,{children:(ye,ve)=>{var K=fA(),fe=ae(K);We(fe,()=>rs,(Ee,Ge)=>{Ge(Ee,{children:(Te,Ve)=>{var Ae=dA(),Ce=ae(Ae);We(Ce,()=>Ji,(Be,He)=>{He(Be,{children:(B,De)=>{ct();var pe=Tt("Load Parameter State");D(B,pe)},$$slots:{default:!0}})});var Oe=ue(Ce,2);We(Oe,()=>ss,(Be,He)=>{He(Be,{children:(B,De)=>{ct();var pe=Tt("Select a .sps state file from your drive to load");D(B,pe)},$$slots:{default:!0}})}),D(Te,Ae)},$$slots:{default:!0}})});var Y=ue(fe,2),oe=Q(Y);mn(oe,{onclick:C,class:"w-full",size:"lg",children:(Ee,Ge)=>{var Te=hA(),Ve=ae(Te);pu(Ve,{class:"mr-2 h-4 w-4"}),ct(),D(Ee,Te)},$$slots:{default:!0}}),q(Y);var Me=ue(Y,2);We(Me,()=>ka,(Ee,Ge)=>{Ge(Ee,{children:(Te,Ve)=>{mn(Te,{variant:"outline",onclick:()=>O(h,!1),children:(Ae,Ce)=>{ct();var Oe=Tt("Cancel");D(Ae,Oe)},$$slots:{default:!0}})},$$slots:{default:!0}})}),D(ye,K)},$$slots:{default:!0}})}),D(U,V)},$$slots:{default:!0}})});var N=ue(H,2);We(N,()=>Ar,(R,F)=>{F(R,{get open(){return d(u)},set open(U){O(u,U,!0)},children:(U,X)=>{var V=Pe(),$=ae(V);We($,()=>Rr,(ee,Se)=>{Se(ee,{class:"max-w-2xl max-h-[80vh] overflow-y-auto",children:(ye,ve)=>{var K=MA(),fe=ae(K);We(fe,()=>rs,(Ee,Ge)=>{Ge(Ee,{children:(Te,Ve)=>{var Ae=pA(),Ce=ae(Ae);We(Ce,()=>Ji,(Be,He)=>{He(Be,{children:(B,De)=>{ct();var pe=Tt("State Validation Report");D(B,pe)},$$slots:{default:!0}})});var Oe=ue(Ce,2);We(Oe,()=>ss,(Be,He)=>{He(Be,{children:(B,De)=>{var pe=Pe(),Ne=ae(pe);{var ce=je=>{var w=Tt();Le(()=>Ze(w,`Validating state: ${d(f).name??""}`)),D(je,w)};_e(Ne,je=>{d(f)&&je(ce)})}D(B,pe)},$$slots:{default:!0}})}),D(Te,Ae)},$$slots:{default:!0}})});var Y=ue(fe,2);{var oe=Ee=>{var Ge=SA(),Te=Q(Ge);{var Ve=He=>{var B=Pe(),De=ae(B);We(De,()=>Cr,(pe,Ne)=>{Ne(pe,{class:"p-4 border-success/30 bg-success/5",children:(ce,je)=>{var w=mA(),b=Q(w);qm(b,{class:"h-5 w-5 text-success"}),ct(2),q(w),D(ce,w)},$$slots:{default:!0}})}),D(He,B)},Ae=He=>{var B=Pe(),De=ae(B);We(De,()=>Cr,(pe,Ne)=>{Ne(pe,{class:"p-4 border-warning/30 bg-warning/5",children:(ce,je)=>{var w=gA(),b=Q(w);Qs(b,{class:"h-5 w-5 text-warning"});var G=ue(b,2),ne=ue(Q(G),2),de=Q(ne);q(ne),q(G),q(w),Le(()=>Ze(de,`${d(p).issues.length??""} warning(s) found, but state can still be loaded.`)),D(ce,w)},$$slots:{default:!0}})}),D(He,B)},Ce=He=>{var B=Pe(),De=ae(B);We(De,()=>Cr,(pe,Ne)=>{Ne(pe,{class:"p-4 border-destructive/30 bg-destructive/5",children:(ce,je)=>{var w=vA(),b=Q(w);Qs(b,{class:"h-5 w-5 text-destructive"}),ct(2),q(w),D(ce,w)},$$slots:{default:!0}})}),D(He,B)};_e(Te,He=>{d(p).isValid?He(Ve):d(p).canLoad?He(Ae,1):He(Ce,-1)})}var Oe=ue(Te,2);{var Be=He=>{var B=bA(),De=ue(Q(B),2);Ht(De,17,()=>d(p).issues,pe=>pe.message,(pe,Ne)=>{var ce=xA(),je=Q(ce),w=Q(je);{let xe=z(()=>d(Ne).severity==="error"?"text-destructive":"text-warning");Qs(w,{get class(){return`h-4 w-4 mt-0.5 ${d(xe)??""}`}})}var b=ue(w,2),G=Q(b),ne=Q(G,!0);q(G);var de=ue(G,2);{var he=xe=>{var ie=_A(),ge=Q(ie);q(ie),Le(()=>Ze(ge,`Expected: ${d(Ne).details.expected??""} → Actual: ${d(Ne).details.actual??""}`)),D(xe,ie)};_e(de,xe=>{d(Ne).details&&xe(he)})}q(b),q(je),q(ce),Le(()=>{At(ce,1,`p-3 rounded-lg border ${d(Ne).severity==="error"?"border-destructive/30 bg-destructive/5":"border-warning/30 bg-warning/5"}`),Ze(ne,d(Ne).message)}),D(pe,ce)}),q(B),D(He,B)};_e(Oe,He=>{d(p).isValid||He(Be)})}q(Ge),D(Ee,Ge)};_e(Y,Ee=>{d(p)&&Ee(oe)})}var Me=ue(Y,2);We(Me,()=>ka,(Ee,Ge)=>{Ge(Ee,{children:(Te,Ve)=>{var Ae=yA(),Ce=ae(Ae);mn(Ce,{variant:"outline",onclick:M,children:(He,B)=>{ct();var De=Tt("Cancel");D(He,De)},$$slots:{default:!0}});var Oe=ue(Ce,2);{var Be=He=>{mn(He,{onclick:x,children:(B,De)=>{ct();var pe=Tt("Load Anyway");D(B,pe)},$$slots:{default:!0}})};_e(Oe,He=>{d(p)?.canLoad&&He(Be)})}D(Te,Ae)},$$slots:{default:!0}})}),D(ye,K)},$$slots:{default:!0}})}),D(U,V)},$$slots:{default:!0}})}),Lt("change",k,m),D(n,y),it()}Gn(["change"]);var TA=Z("<!> ",1),AA=Z('<div class="panel-footer px-3 svelte-gzxlx6"><div class="gap-2 flex flex-wrap items-center justify-center"><!> <!></div> <!></div>'),RA=Z('<div class="panel-content-wrapper svelte-gzxlx6"><!> <!></div>'),CA=Z('<div class="my-4 gap-2 flex items-center"><div class="h-px flex-1 bg-border"></div> <span class="text-xs font-medium px-1 text-muted-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div> <!>',1),PA=Z('<div class="drawer-footer svelte-gzxlx6"><!></div>'),DA=Z('<div class="min-h-0 flex flex-1 flex-col"><!></div> <div style="z-index: 40;"><button class="drawer-handle-bar svelte-gzxlx6"><div class="drawer-pill svelte-gzxlx6"></div> <span class="text-sm font-medium ml-2 text-foreground"> </span> <!></button> <div class="drawer-content svelte-gzxlx6"><div class="px-3 pb-6"><!> <!></div></div> <!></div>',1),IA=Z('<div class="my-4 gap-2 flex items-center"><div class="h-px flex-1 bg-border"></div> <span class="text-xs font-medium px-1 text-muted-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div> <!>',1),LA=Z('<div class="drawer-footer svelte-gzxlx6"><!></div>'),NA=Z('<div class="flex flex-1 flex-col overflow-hidden"><div class="px-3 pt-3 flex-1 overflow-y-auto"><!> <!></div> <!></div>'),UA=Z('<div class="min-h-0 flex h-full flex-1 justify-center"><div class="min-h-0 flex h-full w-4/5 flex-col"><!></div></div>'),FA=Z("<div><!></div>"),OA=Z("<!> <!>",1),BA=Z("<div><!></div>"),zA=Z("<!> <!>",1),kA=Z("<!> <!> <!>",1),VA=Z('<div class="min-h-0 flex h-full flex-1"><!> <!> <!></div>'),HA=Z('<div data-layout-root=""><!></div> <!>',1);function GA(n,e){nt(e,!0);const t=(Y,oe=Ut,Me=Ut,Ee,Ge)=>{let Te=lu(()=>cu(Ee?.(),!0)),Ve=lu(()=>cu(Ge?.(),!0));var Ae=RA(),Ce=Q(Ae);{var Oe=B=>{KT(B,{get schema(){return e.schema},get onValueChange(){return e.onValueChange},get panelFilter(){return oe()},get requestedTabId(){return Me()},get values(){return u()},set values(De){u(De)}})};_e(Ce,B=>{e.schema.layout.type==="tabbed"&&B(Oe)})}var Be=ue(Ce,2);{var He=B=>{var De=AA(),pe=Q(De),Ne=Q(pe);{var ce=G=>{wA(G,{get schema(){return e.schema},get currentValues(){return u()},onLoadValues:R,get showSaveButton(){return f()},get showLoadButton(){return p()}})};_e(Ne,G=>{d(Te)&&G(ce)})}var je=ue(Ne,2);Ht(je,17,h,G=>G.id,(G,ne)=>{{let de=z(()=>d(ne).variant??"outline"),he=z(()=>d(ne).size??"sm");mn(G,{get variant(){return d(de)},get size(){return d(he)},get onclick(){return d(ne).onclick},children:(xe,ie)=>{var ge=TA(),Ue=ae(ge);{var Ie=Fe=>{const dt=z(()=>d(ne).icon);var ft=Pe(),Et=ae(ft);We(Et,()=>d(dt),(j,ze)=>{ze(j,{class:"mr-2 h-4 w-4"})}),D(Fe,ft)};_e(Ue,Fe=>{d(ne).icon&&Fe(Ie)})}var ke=ue(Ue);Le(()=>Ze(ke,` ${d(ne).label??""}`)),D(xe,ge)},$$slots:{default:!0}})}}),q(pe);var w=ue(pe,2);{var b=G=>{wo(G,{get hasPendingChanges(){return a()},get hasNeverSolved(){return o()},get isSolving(){return e.isSolving},get oncalculate(){return c()}})};_e(w,G=>{!d(y)&&d(Ve)&&e.schema.instanceSolve===!1&&G(b)})}q(De),D(B,De)};_e(Be,B=>{(d(Te)||!d(y)&&d(Ve)&&e.schema.instanceSolve===!1)&&B(He)})}q(Ae),D(Y,Ae)},i=48;let r=me(e,"meshes",19,()=>[]),s=me(e,"showSolvingIndicator",3,!1),a=me(e,"hasPendingChanges",3,!1),o=me(e,"hasNeverSolved",3,!1),l=me(e,"isViewerFullscreen",15,!1),c=me(e,"oncalculate",3,()=>{}),u=me(e,"values",31,()=>$n({})),h=me(e,"panelActions",19,()=>[]),f=me(e,"showSaveButton",3,!0),p=me(e,"showLoadButton",3,!0),v=me(e,"viewerConfig",19,()=>({}));const S=z(()=>!!(e.schema?.viewerOptions?.enableLocal||e.schema?.viewerOptions?.enableRemote)),g=z(()=>e.schema.layout.type==="tabbed"?e.schema.layout.tabs.filter(Y=>Y.position!=="right"):[]),m=z(()=>e.schema.layout.type==="tabbed"?e.schema.layout.tabs.filter(Y=>Y.position==="right"):[]),x=z(()=>d(g).length>0),M=z(()=>d(m).length>0),T=z(()=>d(S)||d(M)),C=z(()=>!d(S)&&d(x)&&d(M));let y=we(!1),I=we(!1);const _=z(()=>d(g)[0]?.label??"Parameters");Rt(()=>{const Y=window.matchMedia("(max-width: 639px)");function oe(){O(y,Y.matches,!0)}return oe(),Y.addEventListener("change",oe),()=>Y.removeEventListener("change",oe)});let E=we(!1),L=we(!1),P=we(null),k=we(null),W=we(null),H=we(null);const N=z(()=>`${d(x)?"L":""}${d(S)?"V":""}${d(M)?"R":""}`);async function R(Y){Object.assign(u(),Y),await e.onLoadValues?.()}let F=0;function U(Y){F=Y.touches[0].clientY}function X(Y){const oe=Y.changedTouches[0].clientY-F;Math.abs(oe)>40&&O(I,oe<0)}var V=HA(),$=ae(V);let ee;var Se=Q($);{var ye=Y=>{var oe=Pe(),Me=ae(oe);{var Ee=Te=>{var Ve=DA(),Ae=ae(Ve),Ce=Q(Ae);{let he=z(()=>({...v(),backgroundColor:e.schema?.viewerOptions?.backgroundColor,showSceneManager:!1}));Pd(Ce,{get meshes(){return r()},get isSolving(){return e.isSolving},get isBlurred(){return d(I)},get drawerOpen(){return d(I)},get viewerConfig(){return d(he)},get isFullscreen(){return l()},set isFullscreen(xe){l(xe)}})}q(Ae);var Oe=ue(Ae,2);let Be;var He=Q(Oe),B=ue(Q(He),2),De=Q(B,!0);q(B);var pe=ue(B,2);{let he=z(()=>d(I)?"":"rotate-180");tm(pe,{size:16,get class(){return`ml-auto text-muted-foreground transition-transform duration-300 ${d(he)??""}`}})}q(He);var Ne=ue(He,2),ce=Q(Ne),je=Q(ce);{var w=he=>{t(he,()=>d(M)?"left":void 0,()=>d(W),()=>!d(M),()=>!1)};_e(je,he=>{d(x)&&he(w)})}var b=ue(je,2);{var G=he=>{var xe=CA(),ie=ae(xe),ge=ue(Q(ie),2),Ue=Q(ge,!0);q(ge),ct(2),q(ie);var Ie=ue(ie,2);t(Ie,()=>"right",()=>d(H),()=>!0,()=>!1),Le(()=>Ze(Ue,d(m)[0]?.label??"More")),D(he,xe)};_e(b,he=>{d(M)&&he(G)})}q(ce),q(Ne);var ne=ue(Ne,2);{var de=he=>{var xe=PA(),ie=Q(xe);wo(ie,{get hasPendingChanges(){return a()},get hasNeverSolved(){return o()},get isSolving(){return e.isSolving},get oncalculate(){return c()}}),q(xe),D(he,xe)};_e(ne,he=>{e.schema.instanceSolve===!1&&he(de)})}q(Oe),Le(()=>{Be=At(Oe,1,"drawer-container svelte-gzxlx6",null,Be,{"drawer-open":d(I),"drawer-closed":!d(I)}),Vt(He,"aria-label",d(I)?"Collapse panel":"Expand panel"),Vt(He,"aria-expanded",d(I)),Ze(De,d(_))}),Lt("click",He,()=>O(I,!d(I))),Lt("touchstart",He,U),Lt("touchend",He,X),D(Te,Ve)},Ge=Te=>{var Ve=NA(),Ae=Q(Ve),Ce=Q(Ae);{var Oe=pe=>{t(pe,()=>d(M)?"left":void 0,()=>d(W),()=>!d(M),()=>!1)};_e(Ce,pe=>{d(x)&&pe(Oe)})}var Be=ue(Ce,2);{var He=pe=>{var Ne=IA(),ce=ae(Ne),je=ue(Q(ce),2),w=Q(je,!0);q(je),ct(2),q(ce);var b=ue(ce,2);t(b,()=>"right",()=>d(H),()=>!0,()=>!1),Le(()=>Ze(w,d(m)[0]?.label??"More")),D(pe,Ne)};_e(Be,pe=>{d(M)&&pe(He)})}q(Ae);var B=ue(Ae,2);{var De=pe=>{var Ne=LA(),ce=Q(Ne);wo(ce,{get hasPendingChanges(){return a()},get hasNeverSolved(){return o()},get isSolving(){return e.isSolving},get oncalculate(){return c()}}),q(Ne),D(pe,Ne)};_e(B,pe=>{e.schema.instanceSolve===!1&&pe(De)})}q(Ve),D(Te,Ve)};_e(Me,Te=>{d(S)?Te(Ee):Te(Ge,-1)})}D(Y,oe)},ve=Y=>{var oe=UA(),Me=Q(oe),Ee=Q(Me);t(Ee,()=>d(M)?"right":void 0,()=>d(M)?d(H):d(W),()=>!d(M),()=>!d(M)),q(Me),q(oe),D(Y,oe)},K=Y=>{var oe=VA(),Me=Q(oe);{var Ee=Ae=>{Xd(Ae,{side:"left",get tabs(){return d(g)},collapsedWidth:i,onExpand:()=>d(P)?.expand(),onTabClick:Ce=>{O(W,Ce,!0),d(P)?.expand()}})};_e(Me,Ae=>{d(E)&&d(T)&&d(x)&&Ae(Ee)})}var Ge=ue(Me,2);We(Ge,()=>Rf,(Ae,Ce)=>{Ce(Ae,{direction:"horizontal",get autoSaveId(){return`selva-layout-${d(N)??""}`},class:"min-h-0 flex-1",children:(Oe,Be)=>{var He=kA(),B=ae(He);{var De=w=>{var b=OA(),G=ae(b);{let de=z(()=>d(C)?50:d(S)&&d(M)?22:30);We(G,()=>as,(he,xe)=>{Nn(xe(he,{order:1,get defaultSize(){return d(de)},minSize:15,maxSize:45,collapsible:!0,collapsedSize:0,onCollapse:()=>O(E,!0),onExpand:()=>O(E,!1),class:"ml-1",children:(ie,ge)=>{var Ue=FA(),Ie=Q(Ue);t(Ie,()=>d(M)?"left":void 0,()=>d(W)),q(Ue),Le(()=>At(Ue,1,`min-h-0 flex h-full flex-col ${l()||d(E)?"hidden":""}`)),D(ie,Ue)},$$slots:{default:!0}}),ie=>O(P,ie,!0),()=>d(P))})}var ne=ue(G,2);We(ne,()=>Dl,(de,he)=>{he(de,{withHandle:!0,class:"bg-transparent",get"data-collapsed"(){return d(E)},onclick:()=>{d(E)&&d(P)?.expand()}})}),D(w,b)};_e(B,w=>{d(x)&&w(De)})}var pe=ue(B,2);{var Ne=w=>{var b=Pe(),G=ae(b);We(G,()=>as,(ne,de)=>{de(ne,{order:2,minSize:20,class:"min-h-0 mx-1 flex flex-col",children:(he,xe)=>{{let ie=z(()=>({backgroundColor:e.schema?.viewerOptions?.backgroundColor}));Pd(he,{get meshes(){return r()},get isSolving(){return e.isSolving},get viewerConfig(){return d(ie)},get isFullscreen(){return l()},set isFullscreen(ge){l(ge)}})}},$$slots:{default:!0}})}),D(w,b)};_e(pe,w=>{d(S)&&w(Ne)})}var ce=ue(pe,2);{var je=w=>{var b=zA(),G=ae(b);We(G,()=>Dl,(de,he)=>{he(de,{withHandle:!0,class:"bg-transparent",get"data-collapsed"(){return d(L)},onclick:()=>{d(L)&&d(k)?.expand()}})});var ne=ue(G,2);{let de=z(()=>d(C)?50:25);We(ne,()=>as,(he,xe)=>{Nn(xe(he,{order:3,get defaultSize(){return d(de)},minSize:15,maxSize:45,collapsible:!0,collapsedSize:0,onCollapse:()=>O(L,!0),onExpand:()=>O(L,!1),class:"mr-1",children:(ie,ge)=>{var Ue=BA(),Ie=Q(Ue);t(Ie,()=>"right",()=>d(H),()=>!d(x),()=>!d(x)),q(Ue),Le(()=>At(Ue,1,`min-h-0 flex h-full flex-col ${l()||d(L)?"hidden":""}`)),D(ie,Ue)},$$slots:{default:!0}}),ie=>O(k,ie,!0),()=>d(k))})}D(w,b)};_e(ce,w=>{d(M)&&w(je)})}D(Oe,He)},$$slots:{default:!0}})});var Te=ue(Ge,2);{var Ve=Ae=>{Xd(Ae,{side:"right",get tabs(){return d(m)},collapsedWidth:i,onExpand:()=>d(k)?.expand(),onTabClick:Ce=>{O(H,Ce,!0),d(k)?.expand()}})};_e(Te,Ae=>{d(L)&&d(M)&&Ae(Ve)})}q(oe),D(Y,oe)};_e(Se,Y=>{d(y)?Y(ye):!d(S)&&!d(C)&&d(x)!==d(M)?Y(ve,1):Y(K,-1)})}q($);var fe=ue($,2);ME(fe,{get show(){return s()}}),Le(()=>ee=At($,1,`min-h-0 sm:flex-row sm:py-(--page-py) flex flex-1 flex-col overflow-hidden ${d(E)?"sm:pl-0":"sm:pl-(--page-px)"} ${d(L)?"sm:pr-0":"sm:pr-(--page-px)"}`,"svelte-gzxlx6",ee,{"fullscreen-layout":l(),relative:d(y)})),D(n,V),it()}Gn(["click","touchstart","touchend"]);function WA(n){switch(n){case"number":case"integer":return 0;case"boolean":return!1;case"text":return"";default:return null}}const XA=6e4;function YA(n,e={}){const{timeout:t=XA}=e;let i=we(!1),r=we(null),s=null;function a(){s?.abort(),s=null}async function o(u){a(),s=new AbortController;const{signal:h}=s,f=setTimeout(()=>s?.abort(),t);O(i,!0);try{await n(u,h)}catch(p){if(!(p instanceof Error&&p.name==="AbortError"))throw p}finally{if(clearTimeout(f),O(i,!1),s=null,d(r)!==null){const p=d(r);O(r,null),o(p)}}}function l(u){d(i)?O(r,u,!0):o(u)}function c(){O(r,null),a()}return{trigger:l,get isComputing(){return d(i)},get hasPending(){return d(r)!==null},cancel:c}}function jA(n){const{FAST_THRESHOLD_MS:e,SLOW_THRESHOLD_MS:t,HISTORY_SIZE:i,ANIMATION_DELAY:r}=Nr.SOLVING_INDICATOR;let s=we(!1),a=null,o=null;const l=[];return Rt(()=>{const c=n();return nn(()=>{if(c){o=performance.now();const u=l.length===0?1/0:l.reduce((f,p)=>f+p,0)/l.length;if(l.length>0&&u<e)return;const h=u===1/0||u>=t?0:(u-e)/(t-e)*r;a||(h===0?O(s,!0):a=setTimeout(()=>{O(s,!0),a=null},h))}else o!==null&&(l.push(performance.now()-o),l.length>i&&l.shift(),o=null),a&&(clearTimeout(a),a=null),O(s,!1)}),()=>{a&&clearTimeout(a)}}),{get show(){return d(s)}}}function qA(n,e,t,i="left",r=0,s){Ea(()=>{const a=ha(du);!a||!e||a.register(n,e,t,i,r,s)}),Jd(()=>{try{ha(du)?.unregister(n)}catch{}})}const KA=n=>{if(!n)return"";const e=n.replace(/^#/,"");if(!/^[0-9A-Fa-f]{6}$/.test(e))return n;const t=parseInt(e.slice(0,2),16)/255,i=parseInt(e.slice(2,4),16)/255,r=parseInt(e.slice(4,6),16)/255,s=T=>T<=.04045?T/12.92:Math.pow((T+.055)/1.055,2.4),a=s(t),o=s(i),l=s(r),c=a*.4124564+o*.3575761+l*.1804375,u=a*.2126729+o*.7151522+l*.072175,h=a*.0193339+o*.119192+l*.9503041,f=Math.cbrt(.8189330101*c+.3618667424*u-.1288597137*h),p=Math.cbrt(.0329845436*c+.9293118715*u+.0361456387*h),v=Math.cbrt(.0482003018*c+.2643662691*u+.633851707*h),S=.2104542553*f+.793617785*p-.0040720468*v,g=1.9779984951*f-2.428592205*p+.4505937099*v,m=.0259040371*f+.7827717662*p-.808675766*v,x=Math.sqrt(g*g+m*m);let M=Math.atan2(m,g)*180/Math.PI;return M<0&&(M+=360),`oklch(${S.toFixed(3)} ${x.toFixed(3)} ${M.toFixed(1)})`},ZA="external";function $A(n,e){return`${ZA}:${n}:${e}`}function JA(n){const{scopeKey:e,inputId:t}=n;if(!e||!t||typeof sessionStorage>"u")return;const i=sessionStorage.getItem($A(e,t));if(i!==null)try{return JSON.parse(i)}catch{return}}function*QA(n){const e=n.layout.type==="tabbed"?n.layout.tabs.flatMap(t=>t.groups):n.layout.groups;for(const t of e)for(const i of t.items)yield i}function eR(n){const e=[];for(const t of QA(n))t.type!=="input"||t.source?.kind!=="external"||e.push({paramId:t.paramId,displayName:t.displayName??t.paramId});return e}var tR=Z('<div class="min-h-100 p-8 flex items-center justify-center"><!></div>'),nR=Z('<div class="min-h-100 flex items-center justify-center"><!></div>'),iR=Z("<div><!></div>");function rR(n,e){nt(e,!0);let t=me(e,"definitionKey",3,""),i=me(e,"showModeToggle",3,!1),r=me(e,"panelActions",19,()=>[]),s=me(e,"showSaveButton",3,!0),a=me(e,"showLoadButton",3,!0),o=me(e,"footerItemId",3,"footer-item"),l=me(e,"footerItemPriority",3,0);const c=z(()=>e.externalScopeKey||t()||e.schema?.id||"");function u(ye,ve){const K=new Set(eR(ye).map(Y=>Y.paramId)),fe={};for(const Y of ye.inputs){if(K.has(Y.id)){const oe=JA({scopeKey:ve,inputId:Y.id});oe!==void 0&&(fe[Y.id]=oe);continue}fe[Y.id]=Y.default??WA(Y.paramType)}for(const Y of ye.outputs)fe[Y.id]=null;return fe}let h=we($n(u(e.schema,e.externalScopeKey||t()||e.schema?.id||""))),f=we(""),p=we($n([])),v=we($n([])),S=we($n([])),g=we($n({})),m=we(e.schema?.instanceSolve===!1),x=we(e.schema?.instanceSolve===!1),M=we(!1);async function T(ye,ve){try{O(f,""),O(p,[],!0),O(v,[],!0);const K=await e.onSolve(ye,ve);if(ve.aborted)return;O(p,K.errors??[],!0),O(v,K.warnings??[],!0),O(S,K.meshes??[],!0),Object.assign(d(h),K.outputs),O(g,{},!0),O(m,!1),O(x,!1)}catch(K){if(K instanceof Error&&K.name==="AbortError")return;O(f,K instanceof Error?K.message:String(K),!0)}}const C=YA(T,{timeout:e.solveTimeoutMs});let y=z(()=>C.isComputing);const I=jA(()=>d(y));function _(){C.trigger(Gl(d(h)))}function E(ye){Object.assign(d(h),ye),e.schema?.instanceSolve!==!1?_():O(m,!0)}Rt(()=>{e.onReady?.({loadValues:E})});let L=we(""),P=we(!0);Rt(()=>{t(),nn(()=>{d(P)?(O(P,!1),O(L,t()),e.schema?.instanceSolve!==!1&&_()):d(L)!==t()&&(O(S,[],!0),O(h,u(e.schema,d(c)),!0),O(f,""),O(p,[],!0),O(v,[],!0),e.schema&&Object.keys(d(h)).length>0&&_(),O(L,t()))})});async function k(ye,ve){if(d(h)[ye]=ve,e.schema?.instanceSolve===!1){d(g)[ye]=ve,O(m,!0);return}_()}function W(){_()}const H=nn(()=>o()),N=nn(()=>e.footerComponent),R=nn(()=>l());qA(H,N,()=>N?e.footerComponentProps?.()??{}:{},"left",R);let F=z(()=>e.isEmbedded??uu.url.searchParams.get("embed")==="true"),U=z(()=>e.primaryColor??uu.url.searchParams.get("primary")),X=z(()=>d(U)?`--primary: ${KA(d(U))}`:""),V=z(()=>e.title??(e.schema?.description||e.schema.name));var $=iR();let ee;var Se=Q($);{let ye=z(()=>!d(F));xp(Se,{mode:"fixed",get showHeader(){return d(ye)},showFooter:!0,get title(){return d(V)},get showModeToggle(){return i()},get rightContent(){return e.headerRight},get errors(){return d(p)},get warnings(){return d(v)},children:(ve,K)=>{var fe=Pe(),Y=ae(fe);{var oe=Ge=>{var Te=tR(),Ve=Q(Te);Fl(Ve,{type:"error",size:"medium",get message(){return d(f)}}),q(Te),D(Ge,Te)},Me=Ge=>{var Te=nR(),Ve=Q(Te);Fl(Ve,{type:"loading",size:"large",message:"Loading schema..."}),q(Te),D(Ge,Te)},Ee=Ge=>{var Te=Pe(),Ve=ae(Te);wp(Ve,t,Ae=>{{let Ce=z(()=>e.schema.instanceSolve!==!1&&I.show);GA(Ae,{get schema(){return e.schema},get meshes(){return d(S)},get isSolving(){return d(y)},get showSolvingIndicator(){return d(Ce)},get hasPendingChanges(){return d(m)},get hasNeverSolved(){return d(x)},get panelActions(){return r()},get showSaveButton(){return s()},get showLoadButton(){return a()},onValueChange:k,oncalculate:W,onLoadValues:()=>{e.schema?.instanceSolve!==!1?_():O(m,!0)},get isViewerFullscreen(){return d(M)},set isViewerFullscreen(Oe){O(M,Oe,!0)},get values(){return d(h)},set values(Oe){O(h,Oe,!0)}})}}),D(Ge,Te)};_e(Y,Ge=>{d(f)?Ge(oe):e.schema?Ge(Ee,-1):Ge(Me,1)})}D(ve,fe)},$$slots:{default:!0}})}q($),Le(()=>ee=hi($,d(X),ee,{display:"contents"})),D(n,$),it()}var sR=Z('<div class="text-muted-foreground flex items-center gap-1.5 text-xs"><!> <span> </span></div>');function aR(n,e){var t=Pe(),i=ae(t);{var r=s=>{var a=sR(),o=Q(a);vp(o,{class:"h-3 w-3"});var l=ue(o,2),c=Q(l,!0);q(l),q(a),Le(()=>Ze(c,e.label)),D(s,a)};_e(i,s=>{e.label&&s(r)})}D(n,t)}var oR=Z('<span class="bg-warning/15 text-warning rounded-full px-2.5 py-1 font-mono text-[11px] font-medium tracking-wide uppercase">Draft preview</span>'),lR=Z("<!> <!>",1);function QR(n,e){nt(e,!0);let t=0;const i=async(r,s)=>{const a=t-Date.now();if(a>0)throw new Error(`Rate limit reached. Try again in ${Math.ceil(a/1e3)}s.`);const o=await fetch("/api/compute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({inputs:e.data.schema.inputs,values:r,definitionUrl:e.data.ghDefinition,...e.data.channel==="draft"&&{channel:"draft"}}),signal:s});if(s.aborted)return{outputs:{}};if(!o.ok){if(o.status===503)throw new Error("Compute server is offline or unreachable. Please try again later.");if(o.status===429){const v=await o.json().catch(()=>({})),S=Number(o.headers.get("Retry-After"))||Number(v.retryAfter)||5;throw t=Date.now()+S*1e3,new Error(v.message||`Rate limit reached. Try again in ${S}s.`)}const p=await o.json().catch(()=>({}));throw new Error(p.message||"Compute error")}const l=await o.json();if(s.aborted)return{outputs:{}};const c=new dT(l,!1),h=e.data.schema.viewerOptions?.enableLocal||e.data.schema.viewerOptions?.enableRemote?await c.extractMeshesFromResponse():[],f={};for(const p of e.data.schema.outputs)f[p.id]=c.getValueByParamId(p.id,{parseValues:!0});return{outputs:f,meshes:h,errors:l.errors??[],warnings:l.warnings??[]}};{const r=a=>{var o=lR(),l=ae(o);{var c=h=>{var f=oR();D(h,f)};_e(l,h=>{e.data.channel==="draft"&&h(c)})}var u=ue(l,2);bp(u,{}),D(a,o)};let s=z(()=>e.data.schema?.description||e.data.schema.name);rR(n,{get schema(){return e.data.schema},onSolve:i,get definitionKey(){return e.data.currentDefinition},get title(){return d(s)},showModeToggle:!0,get solveTimeoutMs(){return e.data.solveTimeoutMs},get footerComponent(){return aR},footerComponentProps:()=>({label:e.data.serverLabel}),headerRight:r,$$slots:{headerRight:!0}})}it()}const cR=Object.freeze(Object.defineProperty({__proto__:null,BINARY_MESH_MAGIC:Al,BINARY_MESH_VERSION:Rl,FLAG_FLOAT32:Lc,Materials:df,SCALE_FACTORS:mf,applyOffset:uf,computeCombinedBoundingBox:Ic,getThreeMeshesFromComputeResponse:Ry,initThree:of,parseBinaryMeshBatch:Nc,parseColor:cf,parseMeshBatch:hf,parseMeshBatchBlob:by,parseMeshBatchObject:ff,updateScene:lf},Symbol.toStringTag,{value:"Module"}));export{QR as component};
|
|
4115
|
+
${d(l)??""}`},children:(c,u)=>{var h=Pe(),f=ae(h);{var p=m=>{var x=vE(),M=ae(x);cc(M,{class:"h-4 w-4 animate-spin"}),ct(),D(m,x)},v=m=>{var x=_E(),M=ae(x);Dp(M,{class:"h-4 w-4"}),ct(),D(m,x)},S=m=>{var x=xE(),M=ae(x);rg(M,{class:"h-4 w-4"}),ct(),D(m,x)},g=m=>{var x=bE(),M=ae(x);th(M,{class:"h-4 w-4"}),ct(),D(m,x)};_e(f,m=>{e.isSolving?m(p):t()?m(v,1):e.hasPendingChanges?m(S,2):m(g,-1)})}D(c,h)},$$slots:{default:!0}})}q(i),D(n,i),it()}var yE=Z('<div class="bottom-6 left-6 gap-3 px-5 py-3 shadow-xl fixed z-50 flex animate-[selva-slideInLeft_0.2s_ease-out] items-center rounded-lg border border-primary/20 bg-primary text-primary-foreground svelte-g866ul"><div class="h-5 w-5 relative flex shrink-0 items-center justify-center svelte-g866ul"><div class="animate-ping absolute h-full w-full rounded-full bg-primary-foreground opacity-30 svelte-g866ul"></div> <div class="h-3 w-3 animate-spin rounded-full border-2 border-primary-foreground border-t-transparent svelte-g866ul"></div></div> <div class="leading-tight flex flex-col svelte-g866ul"><span class="text-sm font-semibold svelte-g866ul">Solving</span> <span class="text-xs opacity-70 svelte-g866ul">Grasshopper is calculating...</span></div></div>');function ME(n,e){var t=Pe(),i=ae(t);{var r=s=>{var a=yE();D(s,a)};_e(i,s=>{e.show&&s(r)})}D(n,t)}var EE=Z("<div><!></div>");function wE(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","class","children"]);var r=EE();sn(r,a=>({"data-slot":"card-action",class:a,...i}),[()=>Ln("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e.class)]);var s=Q(r);Ct(s,()=>e.children??Ut),q(r),Nn(r,a=>t(a),()=>t()),D(n,r),it()}var TE=Z("<!> <!>",1);function Dd(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"orientation",3,"vertical"),r=lt(e,["$$slots","$$events","$$legacy","ref","class","orientation","children"]);var s=Pe(),a=ae(s);{let o=z(()=>Ln("flex touch-none p-px transition-colors select-none",i()==="vertical"&&"w-2.5 h-full border-s border-s-transparent",i()==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e.class));We(a,()=>Am,(l,c)=>{c(l,_t({"data-slot":"scroll-area-scrollbar",get orientation(){return i()},get class(){return d(o)}},()=>r,{get ref(){return t()},set ref(u){t(u)},children:(u,h)=>{var f=TE(),p=ae(f);Ct(p,()=>e.children??Ut);var v=ue(p,2);We(v,()=>Pm,(S,g)=>{g(S,{"data-slot":"scroll-area-thumb",class:"relative flex-1 rounded-full bg-border"})}),D(u,f)},$$slots:{default:!0}}))})}D(n,s),it()}var AE=Z("<!> <!> <!> <!>",1);function Cf(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"viewportRef",15,null),r=me(e,"orientation",3,"vertical"),s=me(e,"scrollbarXClasses",3,""),a=me(e,"scrollbarYClasses",3,""),o=lt(e,["$$slots","$$events","$$legacy","ref","viewportRef","class","orientation","scrollbarXClasses","scrollbarYClasses","children"]);var l=Pe(),c=ae(l);{let u=z(()=>Ln("relative",e.class));We(c,()=>_m,(h,f)=>{f(h,_t({"data-slot":"scroll-area",get class(){return d(u)}},()=>o,{get ref(){return t()},set ref(p){t(p)},children:(p,v)=>{var S=AE(),g=ae(S);We(g,()=>bm,(y,I)=>{I(y,{"data-slot":"scroll-area-viewport",class:"size-full rounded-[inherit] ring-ring/10 outline-ring/50 transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 dark:ring-ring/20 dark:outline-ring/40",get ref(){return i()},set ref(_){i(_)},children:(_,E)=>{var L=Pe(),P=ae(L);Ct(P,()=>e.children??Ut),D(_,L)},$$slots:{default:!0}})});var m=ue(g,2);{var x=y=>{Dd(y,{orientation:"vertical",get class(){return a()}})};_e(m,y=>{(r()==="vertical"||r()==="both")&&y(x)})}var M=ue(m,2);{var T=y=>{Dd(y,{orientation:"horizontal",get class(){return s()}})};_e(M,y=>{(r()==="horizontal"||r()==="both")&&y(T)})}var C=ue(M,2);We(C,()=>Lm,(y,I)=>{I(y,{})}),D(p,S)},$$slots:{default:!0}}))})}D(n,l),it()}const Pf=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ua=(n,e,t,i="")=>{const r=n.split(":");if(n.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const o=r.pop(),l=r.pop(),c={provider:r.length>0?r[0]:i,prefix:l,name:o};return e&&!ca(c)?null:c}const s=r[0],a=s.split("-");if(a.length>1){const o={provider:i,prefix:a.shift(),name:a.join("-")};return e&&!ca(o)?null:o}if(t&&i===""){const o={provider:i,prefix:"",name:s};return e&&!ca(o,t)?null:o}return null},ca=(n,e)=>n?!!((e&&n.prefix===""||n.prefix)&&n.name):!1;function RE(n,e){const t=n.icons,i=n.aliases||Object.create(null),r=Object.create(null);function s(a){if(t[a])return r[a]=[];if(!(a in r)){r[a]=null;const o=i[a]&&i[a].parent,l=o&&s(o);l&&(r[a]=[o].concat(l))}return r[a]}return Object.keys(t).concat(Object.keys(i)).forEach(s),r}const Df=Object.freeze({left:0,top:0,width:16,height:16}),Sa=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Fa=Object.freeze({...Df,...Sa}),Il=Object.freeze({...Fa,body:"",hidden:!1});function CE(n,e){const t={};!n.hFlip!=!e.hFlip&&(t.hFlip=!0),!n.vFlip!=!e.vFlip&&(t.vFlip=!0);const i=((n.rotate||0)+(e.rotate||0))%4;return i&&(t.rotate=i),t}function Id(n,e){const t=CE(n,e);for(const i in Il)i in Sa?i in n&&!(i in t)&&(t[i]=Sa[i]):i in e?t[i]=e[i]:i in n&&(t[i]=n[i]);return t}function PE(n,e,t){const i=n.icons,r=n.aliases||Object.create(null);let s={};function a(o){s=Id(i[o]||r[o],s)}return a(e),t.forEach(a),Id(n,s)}function If(n,e){const t=[];if(typeof n!="object"||typeof n.icons!="object")return t;n.not_found instanceof Array&&n.not_found.forEach(r=>{e(r,null),t.push(r)});const i=RE(n);for(const r in i){const s=i[r];s&&(e(r,PE(n,r,s)),t.push(r))}return t}const DE={provider:"",aliases:{},not_found:{},...Df};function To(n,e){for(const t in e)if(t in n&&typeof n[t]!=typeof e[t])return!1;return!0}function Lf(n){if(typeof n!="object"||n===null)return null;const e=n;if(typeof e.prefix!="string"||!n.icons||typeof n.icons!="object"||!To(n,DE))return null;const t=e.icons;for(const r in t){const s=t[r];if(!r||typeof s.body!="string"||!To(s,Il))return null}const i=e.aliases||Object.create(null);for(const r in i){const s=i[r],a=s.parent;if(!r||typeof a!="string"||!t[a]&&!i[a]||!To(s,Il))return null}return e}const Ld=Object.create(null);function IE(n,e){return{provider:n,prefix:e,icons:Object.create(null),missing:new Set}}function zr(n,e){const t=Ld[n]||(Ld[n]=Object.create(null));return t[e]||(t[e]=IE(n,e))}function Nf(n,e){return Lf(e)?If(e,(t,i)=>{i?n.icons[t]=i:n.missing.add(t)}):[]}function LE(n,e,t){try{if(typeof t.body=="string")return n.icons[e]={...t},!0}catch{}return!1}let fs=!1;function Uf(n){return typeof n=="boolean"&&(fs=n),fs}function NE(n){const e=typeof n=="string"?Ua(n,!0,fs):n;if(e){const t=zr(e.provider,e.prefix),i=e.name;return t.icons[i]||(t.missing.has(i)?null:void 0)}}function UE(n,e){const t=Ua(n,!0,fs);if(!t)return!1;const i=zr(t.provider,t.prefix);return e?LE(i,t.name,e):(i.missing.add(t.name),!0)}function FE(n,e){if(typeof n!="object")return!1;if(typeof e!="string"&&(e=n.provider||""),fs&&!e&&!n.prefix){let i=!1;return Lf(n)&&(n.prefix="",If(n,(r,s)=>{UE(r,s)&&(i=!0)})),i}const t=n.prefix;return ca({prefix:t,name:"a"})?!!Nf(zr(e,t),n):!1}const Ff=Object.freeze({width:null,height:null}),Of=Object.freeze({...Ff,...Sa}),OE=/(-?[0-9.]*[0-9]+[0-9.]*)/g,BE=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Nd(n,e,t){if(e===1)return n;if(t=t||100,typeof n=="number")return Math.ceil(n*e*t)/t;if(typeof n!="string")return n;const i=n.split(OE);if(i===null||!i.length)return n;const r=[];let s=i.shift(),a=BE.test(s);for(;;){if(a){const o=parseFloat(s);isNaN(o)?r.push(s):r.push(Math.ceil(o*e*t)/t)}else r.push(s);if(s=i.shift(),s===void 0)return r.join("");a=!a}}function zE(n,e="defs"){let t="";const i=n.indexOf("<"+e);for(;i>=0;){const r=n.indexOf(">",i),s=n.indexOf("</"+e);if(r===-1||s===-1)break;const a=n.indexOf(">",s);if(a===-1)break;t+=n.slice(r+1,s).trim(),n=n.slice(0,i).trim()+n.slice(a+1)}return{defs:t,content:n}}function kE(n,e){return n?"<defs>"+n+"</defs>"+e:e}function VE(n,e,t){const i=zE(n);return kE(i.defs,e+i.content+t)}const HE=n=>n==="unset"||n==="undefined"||n==="none";function GE(n,e){const t={...Fa,...n},i={...Of,...e},r={left:t.left,top:t.top,width:t.width,height:t.height};let s=t.body;[t,i].forEach(S=>{const g=[],m=S.hFlip,x=S.vFlip;let M=S.rotate;m?x?M+=2:(g.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),g.push("scale(-1 1)"),r.top=r.left=0):x&&(g.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),g.push("scale(1 -1)"),r.top=r.left=0);let T;switch(M<0&&(M-=Math.floor(M/4)*4),M=M%4,M){case 1:T=r.height/2+r.top,g.unshift("rotate(90 "+T.toString()+" "+T.toString()+")");break;case 2:g.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:T=r.width/2+r.left,g.unshift("rotate(-90 "+T.toString()+" "+T.toString()+")");break}M%2===1&&(r.left!==r.top&&(T=r.left,r.left=r.top,r.top=T),r.width!==r.height&&(T=r.width,r.width=r.height,r.height=T)),g.length&&(s=VE(s,'<g transform="'+g.join(" ")+'">',"</g>"))});const a=i.width,o=i.height,l=r.width,c=r.height;let u,h;a===null?(h=o===null?"1em":o==="auto"?c:o,u=Nd(h,l/c)):(u=a==="auto"?l:a,h=o===null?Nd(u,c/l):o==="auto"?c:o);const f={},p=(S,g)=>{HE(g)||(f[S]=g.toString())};p("width",u),p("height",h);const v=[r.left,r.top,l,c];return f.viewBox=v.join(" "),{attributes:f,viewBox:v,body:s}}const WE=/\sid="(\S+)"/g,Ud=new Map;function XE(n){n=n.replace(/[0-9]+$/,"")||"a";const e=Ud.get(n)||0;return Ud.set(n,e+1),e?`${n}${e}`:n}function YE(n){const e=[];let t;for(;t=WE.exec(n);)e.push(t[1]);if(!e.length)return n;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return e.forEach(r=>{const s=XE(r),a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),n=n.replace(new RegExp(i,"g"),""),n}const Ll=Object.create(null);function jE(n,e){Ll[n]=e}function Nl(n){return Ll[n]||Ll[""]}function Yc(n){let e;if(typeof n.resources=="string")e=[n.resources];else if(e=n.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:n.path||"/",maxURL:n.maxURL||500,rotate:n.rotate||750,timeout:n.timeout||5e3,random:n.random===!0,index:n.index||0,dataAfterTimeout:n.dataAfterTimeout!==!1}}const jc=Object.create(null),Jr=["https://api.simplesvg.com","https://api.unisvg.com"],ua=[];for(;Jr.length>0;)Jr.length===1||Math.random()>.5?ua.push(Jr.shift()):ua.push(Jr.pop());jc[""]=Yc({resources:["https://api.iconify.design"].concat(ua)});function qE(n,e){const t=Yc(e);return t===null?!1:(jc[n]=t,!0)}function qc(n){return jc[n]}const KE=()=>{let n;try{if(n=fetch,typeof n=="function")return n}catch{}};let Fd=KE();function ZE(n,e){const t=qc(n);if(!t)return 0;let i;if(!t.maxURL)i=0;else{let r=0;t.resources.forEach(a=>{r=Math.max(r,a.length)});const s=e+".json?icons=";i=t.maxURL-r-t.path.length-s.length}return i}function $E(n){return n===404}const JE=(n,e,t)=>{const i=[],r=ZE(n,e),s="icons";let a={type:s,provider:n,prefix:e,icons:[]},o=0;return t.forEach((l,c)=>{o+=l.length+1,o>=r&&c>0&&(i.push(a),a={type:s,provider:n,prefix:e,icons:[]},o=l.length),a.icons.push(l)}),i.push(a),i};function QE(n){if(typeof n=="string"){const e=qc(n);if(e)return e.path}return"/"}const e1=(n,e,t)=>{if(!Fd){t("abort",424);return}let i=QE(e.provider);switch(e.type){case"icons":{const s=e.prefix,a=e.icons.join(","),o=new URLSearchParams({icons:a});i+=s+".json?"+o.toString();break}case"custom":{const s=e.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:t("abort",400);return}let r=503;Fd(n+i).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{t($E(a)?"abort":"next",a)});return}return r=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?t("abort",s):t("next",r)});return}setTimeout(()=>{t("success",s)})}).catch(()=>{t("next",r)})},t1={prepare:JE,send:e1};function Bf(n,e){n.forEach(t=>{const i=t.loaderCallbacks;i&&(t.loaderCallbacks=i.filter(r=>r.id!==e))})}function n1(n){n.pendingCallbacksFlag||(n.pendingCallbacksFlag=!0,setTimeout(()=>{n.pendingCallbacksFlag=!1;const e=n.loaderCallbacks?n.loaderCallbacks.slice(0):[];if(!e.length)return;let t=!1;const i=n.provider,r=n.prefix;e.forEach(s=>{const a=s.icons,o=a.pending.length;a.pending=a.pending.filter(l=>{if(l.prefix!==r)return!0;const c=l.name;if(n.icons[c])a.loaded.push({provider:i,prefix:r,name:c});else if(n.missing.has(c))a.missing.push({provider:i,prefix:r,name:c});else return t=!0,!0;return!1}),a.pending.length!==o&&(t||Bf([n],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let i1=0;function r1(n,e,t){const i=i1++,r=Bf.bind(null,t,i);if(!e.pending.length)return r;const s={id:i,icons:e,callback:n,abort:r};return t.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),r}function s1(n){const e={loaded:[],missing:[],pending:[]},t=Object.create(null);n.sort((r,s)=>r.provider!==s.provider?r.provider.localeCompare(s.provider):r.prefix!==s.prefix?r.prefix.localeCompare(s.prefix):r.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return n.forEach(r=>{if(i.name===r.name&&i.prefix===r.prefix&&i.provider===r.provider)return;i=r;const s=r.provider,a=r.prefix,o=r.name,l=t[s]||(t[s]=Object.create(null)),c=l[a]||(l[a]=zr(s,a));let u;o in c.icons?u=e.loaded:a===""||c.missing.has(o)?u=e.missing:u=e.pending;const h={provider:s,prefix:a,name:o};u.push(h)}),e}function a1(n,e=!0,t=!1){const i=[];return n.forEach(r=>{const s=typeof r=="string"?Ua(r,e,t):r;s&&i.push(s)}),i}const o1={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function l1(n,e,t,i){const r=n.resources.length,s=n.random?Math.floor(Math.random()*r):n.index;let a;if(n.random){let y=n.resources.slice(0);for(a=[];y.length>1;){const I=Math.floor(Math.random()*y.length);a.push(y[I]),y=y.slice(0,I).concat(y.slice(I+1))}a=a.concat(y)}else a=n.resources.slice(s).concat(n.resources.slice(0,s));const o=Date.now();let l="pending",c=0,u,h=null,f=[],p=[];typeof i=="function"&&p.push(i);function v(){h&&(clearTimeout(h),h=null)}function S(){l==="pending"&&(l="aborted"),v(),f.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),f=[]}function g(y,I){I&&(p=[]),typeof y=="function"&&p.push(y)}function m(){return{startTime:o,payload:e,status:l,queriesSent:c,queriesPending:f.length,subscribe:g,abort:S}}function x(){l="failed",p.forEach(y=>{y(void 0,u)})}function M(){f.forEach(y=>{y.status==="pending"&&(y.status="aborted")}),f=[]}function T(y,I,_){const E=I!=="success";switch(f=f.filter(L=>L!==y),l){case"pending":break;case"failed":if(E||!n.dataAfterTimeout)return;break;default:return}if(I==="abort"){u=_,x();return}if(E){u=_,f.length||(a.length?C():x());return}if(v(),M(),!n.random){const L=n.resources.indexOf(y.resource);L!==-1&&L!==n.index&&(n.index=L)}l="completed",p.forEach(L=>{L(_)})}function C(){if(l!=="pending")return;v();const y=a.shift();if(y===void 0){if(f.length){h=setTimeout(()=>{v(),l==="pending"&&(M(),x())},n.timeout);return}x();return}const I={status:"pending",resource:y,callback:(_,E)=>{T(I,_,E)}};f.push(I),c++,h=setTimeout(C,n.rotate),t(y,e,I.callback)}return setTimeout(C),m}function zf(n){const e={...o1,...n};let t=[];function i(){t=t.filter(a=>a().status==="pending")}function r(a,o,l){const c=l1(e,a,o,(u,h)=>{i(),l&&l(u,h)});return t.push(c),c}function s(a){return t.find(o=>a(o))||null}return{query:r,find:s,setIndex:a=>{e.index=a},getIndex:()=>e.index,cleanup:i}}function Od(){}const Ao=Object.create(null);function c1(n){if(!Ao[n]){const e=qc(n);if(!e)return;Ao[n]={config:e,redundancy:zf(e)}}return Ao[n]}function u1(n,e,t){let i,r;if(typeof n=="string"){const s=Nl(n);if(!s)return t(void 0,424),Od;r=s.send;const a=c1(n);a&&(i=a.redundancy)}else{const s=Yc(n);if(s){i=zf(s);const a=Nl(n.resources?n.resources[0]:"");a&&(r=a.send)}}return!i||!r?(t(void 0,424),Od):i.query(e,r,t)().abort}function Bd(){}function d1(n){n.iconsLoaderFlag||(n.iconsLoaderFlag=!0,setTimeout(()=>{n.iconsLoaderFlag=!1,n1(n)}))}function h1(n){const e=[],t=[];return n.forEach(i=>{(i.match(Pf)?e:t).push(i)}),{valid:e,invalid:t}}function Qr(n,e,t){function i(){const r=n.pendingIcons;e.forEach(s=>{r&&r.delete(s),n.icons[s]||n.missing.add(s)})}if(t&&typeof t=="object")try{if(!Nf(n,t).length){i();return}}catch(r){console.error(r)}i(),d1(n)}function zd(n,e){n instanceof Promise?n.then(t=>{e(t)}).catch(()=>{e(null)}):e(n)}function f1(n,e){n.iconsToLoad?n.iconsToLoad=n.iconsToLoad.concat(e).sort():n.iconsToLoad=e,n.iconsQueueFlag||(n.iconsQueueFlag=!0,setTimeout(()=>{n.iconsQueueFlag=!1;const{provider:t,prefix:i}=n,r=n.iconsToLoad;if(delete n.iconsToLoad,!r||!r.length)return;const s=n.loadIcon;if(n.loadIcons&&(r.length>1||!s)){zd(n.loadIcons(r,i,t),c=>{Qr(n,r,c)});return}if(s){r.forEach(c=>{zd(s(c,i,t),u=>{Qr(n,[c],u?{prefix:i,icons:{[c]:u}}:null)})});return}const{valid:a,invalid:o}=h1(r);if(o.length&&Qr(n,o,null),!a.length)return;const l=i.match(Pf)?Nl(t):null;if(!l){Qr(n,a,null);return}l.prepare(t,i,a).forEach(c=>{u1(t,c,u=>{Qr(n,c.icons,u)})})}))}const p1=(n,e)=>{const t=s1(a1(n,!0,Uf()));if(!t.pending.length){let o=!0;return e&&setTimeout(()=>{o&&e(t.loaded,t.missing,t.pending,Bd)}),()=>{o=!1}}const i=Object.create(null),r=[];let s,a;return t.pending.forEach(o=>{const{provider:l,prefix:c}=o;if(c===a&&l===s)return;s=l,a=c,r.push(zr(l,c));const u=i[l]||(i[l]=Object.create(null));u[c]||(u[c]=[])}),t.pending.forEach(o=>{const{provider:l,prefix:c,name:u}=o,h=zr(l,c),f=h.pendingIcons||(h.pendingIcons=new Set);f.has(u)||(f.add(u),i[l][c].push(u))}),r.forEach(o=>{const l=i[o.provider][o.prefix];l.length&&f1(o,l)}),e?r1(e,t,r):Bd};function m1(n,e){const t={...n};for(const i in e){const r=e[i],s=typeof r;i in Ff?(r===null||r&&(s==="string"||s==="number"))&&(t[i]=r):s===typeof t[i]&&(t[i]=i==="rotate"?r%4:r)}return t}const g1=/[\s,]+/;function v1(n,e){e.split(g1).forEach(t=>{switch(t.trim()){case"horizontal":n.hFlip=!0;break;case"vertical":n.vFlip=!0;break}})}function _1(n,e=0){const t=n.replace(/^-?[0-9.]*/,"");function i(r){for(;r<0;)r+=4;return r%4}if(t===""){const r=parseInt(n);return isNaN(r)?0:i(r)}else if(t!==n){let r=0;switch(t){case"%":r=25;break;case"deg":r=90}if(r){let s=parseFloat(n.slice(0,n.length-t.length));return isNaN(s)?0:(s=s/r,s%1===0?i(s):0)}}return e}function x1(n,e){let t=n.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in e)t+=" "+i+'="'+e[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+t+">"+n+"</svg>"}function b1(n){return n.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function S1(n){return"data:image/svg+xml,"+b1(n)}function y1(n){return'url("'+S1(n)+'")'}const kd={...Of,inline:!1},M1={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},E1={display:"inline-block"},Ul={"background-color":"currentColor"},kf={"background-color":"transparent"},Vd={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Hd={"-webkit-mask":Ul,mask:Ul,background:kf};for(const n in Hd){const e=Hd[n];for(const t in Vd)e[n+"-"+t]=Vd[t]}function w1(n){return n+(n.match(/^[-0-9.]+$/)?"px":"")}function T1(n,e){const t=m1(kd,e),i=e.mode||"svg",r=i==="svg"?{...M1}:{};n.body.indexOf("xlink:")===-1&&delete r["xmlns:xlink"];let s=typeof e.style=="string"?e.style:"";for(let m in e){const x=e[m];if(x!==void 0)switch(m){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":t[m]=x===!0||x==="true"||x===1;break;case"flip":typeof x=="string"&&v1(t,x);break;case"color":s=s+(s.length>0&&s.trim().slice(-1)!==";"?";":"")+"color: "+x+"; ";break;case"rotate":typeof x=="string"?t[m]=_1(x):typeof x=="number"&&(t[m]=x);break;case"ariaHidden":case"aria-hidden":x!==!0&&x!=="true"&&delete r["aria-hidden"];break;default:if(m.slice(0,3)==="on:")break;kd[m]===void 0&&(r[m]=x)}}const a=GE(n,t),o=a.attributes;if(t.inline&&(s="vertical-align: -0.125em; "+s),i==="svg")return Object.assign(r,o),s!==""&&(r.style=s),{svg:!0,attributes:r,body:YE(a.body)};const{body:l,width:c,height:u}=n,h=i==="mask"||(i==="bg"?!1:l.indexOf("currentColor")!==-1),f=x1(l,{...o,width:c+"",height:u+""}),v={"--svg":y1(f)},S=m=>{const x=o[m];x&&(v[m]=w1(x))};S("width"),S("height"),Object.assign(v,E1,h?Ul:kf);let g="";for(const m in v)g+=m+": "+v[m]+";";return r.style=g+s,{svg:!1,attributes:r}}Uf(!0);jE("",t1);if(typeof document<"u"&&typeof window<"u"){const n=window;if(n.IconifyPreload!==void 0){const e=n.IconifyPreload,t="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!FE(i))&&console.error(t)}catch{console.error(t)}})}if(n.IconifyProviders!==void 0){const e=n.IconifyProviders;if(typeof e=="object"&&e!==null)for(let t in e){const i="IconifyProviders["+t+"] is invalid.";try{const r=e[t];if(typeof r!="object"||!r||r.resources===void 0)continue;qE(t,r)||console.error(i)}catch{console.error(i)}}}}function A1(){try{return typeof window!="object"}catch{return!0}}function R1(n,e,t,i){function r(){e.loading&&(e.loading.abort(),e.loading=null)}if(typeof n=="object"&&n!==null&&typeof n.body=="string")return e.name="",r(),{data:{...Fa,...n}};let s;if(typeof n!="string"||(s=Ua(n,!1,!0))===null)return r(),null;const a=NE(s);if(!a)return!A1()&&(!e.loading||e.loading.name!==n)&&(r(),e.name="",e.loading={name:n,abort:p1([s],t)}),null;r(),e.name!==n&&(e.name=n,i&&!e.destroyed&&setTimeout(()=>{i(n)}));const o=["iconify"];return s.prefix!==""&&o.push("iconify--"+s.prefix),s.provider!==""&&o.push("iconify--"+s.provider),{data:a,classes:o}}function C1(n,e){return n?T1({...Fa,...n},e):null}var P1=pp("<svg></svg>"),D1=Z("<span></span>");function Vf(n,e){nt(e,!0);const t={name:"",loading:null,destroyed:!1},i=lt(e,["$$slots","$$events","$$legacy"]);let r=we(0),s=z(()=>(d(r),R1(e.icon,t,o,e.onload))),a=z(()=>{const h=d(s)?C1(d(s).data,i):null;return h&&d(s).classes&&i.class===void 0&&(h.attributes.class=(typeof i.class=="string"?i.class+" ":"")+d(s).classes.join(" ")),h});function o(){jd(r)}Jd(()=>{t.destroyed=!0,t.loading&&(t.loading.abort(),t.loading=null)});var l=Pe(),c=ae(l);{var u=h=>{var f=Pe(),p=ae(f);{var v=g=>{var m=P1();sn(m,()=>({...d(a).attributes})),Hp(m,()=>d(a).body,!0),q(m),D(g,m)},S=g=>{var m=D1();sn(m,()=>({...d(a).attributes})),D(g,m)};_e(p,g=>{d(a).svg?g(v):g(S,-1)})}D(h,f)};_e(c,h=>{d(a)&&h(u)})}D(n,l),it()}var I1=Z("<span> </span>"),L1=Z("<!> ",1);function N1(n,e){nt(e,!0);let t=we(null);function i(r){!d(t)||Math.abs(r.deltaX)>Math.abs(r.deltaY)||!(d(t).scrollWidth>d(t).clientWidth)||(r.preventDefault(),d(t).scrollLeft+=r.deltaY)}Cf(n,{class:"w-full shrink-0 border-b border-border",orientation:"horizontal",onwheel:i,get viewportRef(){return d(t)},set viewportRef(r){O(t,r,!0)},children:(r,s)=>{var a=Pe(),o=ae(a);We(o,()=>Gp,(l,c)=>{c(l,{class:"px-2 py-2 gap-0 inline-flex h-auto w-max justify-start rounded-none bg-transparent",children:(u,h)=>{var f=Pe(),p=ae(f);Ht(p,17,()=>e.tabs,v=>v.id,(v,S)=>{var g=Pe(),m=ae(g);We(m,()=>Wp,(x,M)=>{M(x,{get value(){return d(S).id},onclick:()=>e.onTabChange(d(S).id),class:"group/tab gap-1.5 px-3 py-1 text-sm font-medium relative h-auto flex-none shrink-0 rounded-none border-0 transition-colors not-last:border-r not-last:border-border hover:bg-accent data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:shadow-none data-[state=inactive]:text-muted-foreground dark:data-[state=active]:border-transparent dark:data-[state=active]:bg-transparent",children:(T,C)=>{var y=L1(),I=ae(y);{var _=L=>{var P=Pe(),k=ae(P);{var W=R=>{Vf(R,{get icon(){return d(S).icon},class:"h-4 w-4"})},H=z(()=>d(S).icon.includes(":")),N=R=>{var F=I1(),U=Q(F,!0);q(F),Le(()=>Ze(U,d(S).icon)),D(R,F)};_e(k,R=>{d(H)?R(W):R(N,-1)})}D(L,P)};_e(I,L=>{d(S).icon&&L(_)})}var E=ue(I);Le(()=>Ze(E,` ${d(S).label??""}`)),D(T,y)},$$slots:{default:!0}})}),D(v,g)}),D(u,f)},$$slots:{default:!0}})}),D(r,a)},$$slots:{default:!0}}),it()}var U1=Z("<h3> </h3>"),F1=Z("<p> </p>"),O1=Z("<div><!></div> <!> <!>",1);function Fl(n,e){let t=me(e,"message",3,""),i=me(e,"size",3,"medium"),r=me(e,"class",3,"");const s={small:{container:"p-6 gap-3",icon:"w-8 h-8",title:"text-sm font-semibold",message:"text-xs"},medium:{container:"p-12 gap-4",icon:"w-12 h-12",title:"text-lg font-semibold",message:"text-sm"},large:{container:"p-16 gap-6",icon:"w-16 h-16",title:"text-2xl font-bold",message:"text-base"}},a={loading:{icon:"text-primary",title:"text-primary-foreground",message:"text-primary-foreground/80",border:"border-primary",background:"bg-primary/15"},error:{icon:"text-destructive",title:"text-destructive-foreground",message:"text-destructive-foreground/80",border:"border-destructive",background:"bg-destructive/15"},warning:{icon:"text-accent",title:"text-accent-foreground",message:"text-accent-foreground/80",border:"border-accent",background:"bg-accent/15"},empty:{icon:"text-neutral",title:"text-neutral-foreground",message:"text-neutral-foreground/80",border:"border-neutral",background:"bg-neutral/15"}},o=z(()=>s[i()]),l=z(()=>a[e.type]);var c=Pe(),u=ae(c);We(u,()=>Cr,(h,f)=>{f(h,{get class(){return`rounded-lg border-2 ${d(l).border??""} ${d(l).background??""} ${r()??""}`},children:(p,v)=>{var S=Pe(),g=ae(S);We(g,()=>uh,(m,x)=>{x(m,{get class(){return`flex flex-col items-center justify-center text-center ${d(o).container??""}`},children:(M,T)=>{var C=O1(),y=ae(C),I=Q(y);{var _=R=>{cc(R,{class:"animate-spin h-full w-full"})},E=R=>{dh(R,{class:"h-full w-full"})},L=R=>{Qs(R,{class:"h-full w-full"})},P=R=>{Qm(R,{class:"h-full w-full"})};_e(I,R=>{e.type==="loading"?R(_):e.type==="error"?R(E,1):e.type==="warning"?R(L,2):e.type==="empty"&&R(P,3)})}q(y);var k=ue(y,2);{var W=R=>{var F=U1(),U=Q(F,!0);q(F),Le(()=>{At(F,1,`${d(o).title??""} ${d(l).title??""} mt-1`),Ze(U,e.title)}),D(R,F)};_e(k,R=>{e.title&&R(W)})}var H=ue(k,2);{var N=R=>{var F=F1(),U=Q(F,!0);q(F),Le(()=>{At(F,1,`${d(o).message??""} ${d(l).message??""} max-w-md leading-relaxed`),Ze(U,t())}),D(R,F)};_e(H,R=>{t()&&R(N)})}Le(()=>At(y,1,`${d(o).icon??""} ${d(l).icon??""}`)),D(M,C)},$$slots:{default:!0}})}),D(p,S)},$$slots:{default:!0}})}),D(n,c)}const $s=n=>Array.isArray(n)?n.map(String):n==null||n===""?[]:[String(n)],B1={equals:(n,e)=>n===e,notEquals:(n,e)=>n!==e,greaterThan:(n,e)=>Number(n)>Number(e),lessThan:(n,e)=>Number(n)<Number(e),greaterThanOrEqual:(n,e)=>Number(n)>=Number(e),lessThanOrEqual:(n,e)=>Number(n)<=Number(e),between:(n,e,t)=>t?.length===2&&Number(n)>=Number(t[0])&&Number(n)<=Number(t[1]),in:(n,e,t)=>t?.includes(String(n))??!1,notIn:(n,e,t)=>!(t?.includes(String(n))??!1),matches:(n,e)=>{try{return new RegExp(String(e)).test(String(n))}catch{return!1}},contains:(n,e)=>$s(n).includes(String(e)),containsAny:(n,e,t)=>{const i=$s(n);return t?.some(r=>i.includes(String(r)))??!1},isEmpty:n=>$s(n).length===0,isNotEmpty:n=>$s(n).length>0};function z1(n,e){const t=B1[n.operator];return t?t(e[n.paramId],n.value,n.values):!1}function Hf(n,e){const t=n.rules.map(i=>z1(i,e));return n.mode==="any"?t.some(Boolean):t.every(Boolean)}const Gd={show:n=>({visible:n,disabled:!1}),hide:(n,e)=>({visible:!n,disabled:!1,defaultValue:e}),disable:(n,e)=>({visible:!0,disabled:n,defaultValue:n?e:void 0})};function Ol(n,e){if(n.type==="linebreak")return{visible:!0,disabled:!1};if("visible"in n&&n.visible===!1)return{visible:!1,disabled:!1};if(!n.visibilityCondition?.rules)return{visible:!0,disabled:!1};const{action:t="show",defaultValue:i}=n.visibilityCondition,r=Hf(n.visibilityCondition,e);return(Gd[t]??Gd.show)(r,i)}function k1(n,e){if(!n.visibilityCondition?.rules)return!0;const{action:t="show"}=n.visibilityCondition,i=Hf(n.visibilityCondition,e);return t==="hide"?!i:i}var V1=Z('<div style="grid-column: 1 / -1" class="h-px bg-border" aria-hidden="true"></div>'),H1=Z("<div><!></div>"),G1=Z("<div><!></div>"),W1=Z('<div class="p-6"><div class="schema-grid gap-6 grid svelte-1mpk06z"></div></div>'),X1=Z("<!> <!> <!>",1),Y1=Z('<div class="schema-grid gap-6 grid svelte-1mpk06z"></div>'),j1=Z('<!> <div><div class="content-inner svelte-1mpk06z"><!></div></div>',1);function q1(n,e){nt(e,!0);const t=(u,h=Ut,f=Ut,p=Ut)=>{var v=Pe(),S=ae(v);{var g=x=>{var M=V1();D(x,M)},m=x=>{const M=z(()=>Ol(h(),e.values)),T=z(()=>Math.min(Math.max(1,h().span??1),f()));var C=Pe(),y=ae(C);{var I=_=>{var E=Pe(),L=ae(E);{var P=W=>{var H=H1();let N;var R=Q(H);Ct(R,()=>e.inputSnippet,h,()=>d(M)),q(H),Le(()=>{N=At(H,1,"grid-cell min-w-0 flex items-center svelte-1mpk06z",null,N,{"opacity-50":d(M).disabled,"col-divider":!p()&&f()>1}),hi(H,`grid-column: span ${d(T)??""} / span ${d(T)??""}`)}),D(W,H)},k=W=>{var H=G1();let N;var R=Q(H);Ct(R,()=>e.outputSnippet,h),q(H),Le(()=>{N=At(H,1,"grid-cell svelte-1mpk06z",null,N,{"col-divider":!p()&&f()>1}),hi(H,`grid-column: span ${d(T)??""} / span ${d(T)??""}`)}),D(W,H)};_e(L,W=>{h().type==="input"?W(P):h().type==="output"&&W(k,1)})}D(_,E)};_e(y,_=>{d(M).visible&&_(I)})}D(x,C)};_e(S,x=>{h().type==="linebreak"?x(g):x(m,-1)})}D(u,v)};let i=me(e,"flat",3,!1);function r(u){(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),e.onToggle())}const s=z(()=>{const u=[];let h=0;for(const f of e.items){if(f.type==="linebreak"){u.push(0),h=0;continue}if(!Ol(f,e.values).visible){u.push(0);continue}const v=Math.min(Math.max(1,f.span??1),e.columns);h+v>e.columns&&(h=0),u.push(h),h=(h+v)%e.columns}return u});var a=Pe(),o=ae(a);{var l=u=>{var h=W1(),f=Q(h);Ht(f,23,()=>e.items,p=>p.type==="linebreak"?p.id:p.paramId,(p,v,S)=>{t(p,()=>d(v),()=>e.columns,()=>d(s)[d(S)]===0)}),q(f),q(h),Le(()=>hi(f,`--schema-cols: ${e.columns??""};`)),D(u,h)},c=u=>{var h=Pe(),f=ae(h);We(f,()=>Cr,(p,v)=>{v(p,{class:"gap-0 py-0 pt-0 overflow-hidden",children:(S,g)=>{var m=j1(),x=ae(m);{let I=z(()=>!e.collapsed);We(x,()=>qp,(_,E)=>{E(_,{class:"pt-4 pb-4! cursor-pointer border-b border-border bg-muted transition-colors select-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-none",role:"button",tabindex:0,get"aria-expanded"(){return d(I)},get onclick(){return e.onToggle},onkeydown:r,children:(L,P)=>{var k=X1(),W=ae(k);We(W,()=>Kp,(F,U)=>{U(F,{children:(X,V)=>{ct();var $=Tt();Le(()=>Ze($,e.label)),D(X,$)},$$slots:{default:!0}})});var H=ue(W,2);{var N=F=>{var U=Pe(),X=ae(U);We(X,()=>$p,(V,$)=>{$(V,{children:(ee,Se)=>{ct();var ye=Tt();Le(()=>Ze(ye,e.description)),D(ee,ye)},$$slots:{default:!0}})}),D(F,U)};_e(H,F=>{e.description&&F(N)})}var R=ue(H,2);We(R,()=>wE,(F,U)=>{U(F,{children:(X,V)=>{{let $=z(()=>e.collapsed?"":"rotate-180");Zp(X,{get class(){return`h-4 w-4 text-muted-foreground transition-transform duration-200 ${d($)??""}`}})}},$$slots:{default:!0}})}),D(L,k)},$$slots:{default:!0}})})}var M=ue(x,2);let T;var C=Q(M),y=Q(C);We(y,()=>uh,(I,_)=>{_(I,{class:"p-6",children:(E,L)=>{var P=Y1();Ht(P,23,()=>e.items,k=>k.type==="linebreak"?k.id:k.paramId,(k,W,H)=>{t(k,()=>d(W),()=>e.columns,()=>d(s)[d(H)]===0)}),q(P),Le(()=>hi(P,`--schema-cols: ${e.columns??""};`)),D(E,P)},$$slots:{default:!0}})}),q(C),q(M),Le(()=>T=At(M,1,"content-wrapper svelte-1mpk06z",null,T,{collapsed:e.collapsed})),D(S,m)},$$slots:{default:!0}})}),D(u,h)};_e(o,u=>{i()?u(l):u(c,-1)})}D(n,a),it()}function Ro(n){return n.type==="input"&&n.widgetType==="number"}function K1(n){return n.type==="input"&&n.widgetType==="text"}function Z1(n){return n.type==="input"&&n.widgetType==="dropdown"}function $1(n){return n.type==="input"&&n.widgetType==="checkbox"}function J1(n){return n.type==="input"&&n.widgetType==="file"}function Q1(n){return n.type==="input"&&n.widgetType==="color"}const ew=Jp({base:"group/field data-[invalid=true]:text-destructive flex w-full gap-3",variants:{orientation:{vertical:"flex-col [&>*]:w-full [&>.sr-only]:w-auto",horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});var tw=Z("<div><!></div>");function Gf(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"orientation",3,"vertical"),r=lt(e,["$$slots","$$events","$$legacy","ref","class","orientation","children"]);var s=tw();sn(s,o=>({role:"group","data-slot":"field","data-orientation":i(),class:o,...r}),[()=>Ln(ew({orientation:i()}),e.class)]);var a=Q(s);Ct(a,()=>e.children??Ut),q(s),Nn(s,o=>t(o),()=>t()),D(n,s),it()}function Wf(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","class","children"]);{let r=z(()=>Ln("group/field-label peer/field-label gap-2 leading-snug flex w-fit group-data-[disabled=true]/field:opacity-50","[&>*]:data-[slot=field]:p-4 has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border","has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10",e.class));Di(n,_t({"data-slot":"field-label",get class(){return d(r)}},()=>i,{get ref(){return t()},set ref(s){t(s)},children:(s,a)=>{var o=Pe(),l=ae(o);Ct(l,()=>e.children??Ut),D(s,o)},$$slots:{default:!0}}))}it()}var nw=Z("<li> </li>"),iw=Z('<ul class="ms-4 gap-1 flex list-disc flex-col"></ul>'),rw=Z("<div><!></div>");function Xf(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=lt(e,["$$slots","$$events","$$legacy","ref","class","children","errors"]);const r=z(()=>e.children?!0:!(!e.errors||e.errors.length===0||e.errors.length===1&&!e.errors[0]?.message)),s=z(()=>e.errors&&e.errors.length>1),a=z(()=>e.errors&&e.errors.length===1&&e.errors[0]?.message);var o=Pe(),l=ae(o);{var c=u=>{var h=rw();sn(h,g=>({role:"alert","data-slot":"field-error",class:g,...i}),[()=>Ln("text-sm font-normal text-destructive",e.class)]);var f=Q(h);{var p=g=>{var m=Pe(),x=ae(m);Ct(x,()=>e.children),D(g,m)},v=g=>{var m=Tt();Le(()=>Ze(m,d(a))),D(g,m)},S=g=>{var m=iw();Ht(m,21,()=>e.errors??[],$d,(x,M)=>{var T=Pe(),C=ae(T);{var y=I=>{var _=nw(),E=Q(_,!0);q(_),Le(()=>Ze(E,d(M).message)),D(I,_)};_e(C,I=>{d(M)?.message&&I(y)})}D(x,T)}),q(m),D(g,m)};_e(f,g=>{e.children?g(p):d(a)?g(v,1):d(s)&&g(S,2)})}q(h),Nn(h,g=>t(g),()=>t()),D(u,h)};_e(l,u=>{d(r)&&u(c)})}D(n,o),it()}var sw=Z('<div data-slot="checkbox-indicator" class="text-current transition-none"><!></div>');function Yf(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"checked",15,!1),r=me(e,"indeterminate",15,!1),s=lt(e,["$$slots","$$events","$$legacy","ref","checked","indeterminate","class"]);var a=Pe(),o=ae(a);{const l=(u,h)=>{let f=()=>h?.().checked,p=()=>h?.().indeterminate;var v=sw(),S=Q(v);{var g=x=>{th(x,{class:"size-3.5"})},m=x=>{ig(x,{class:"size-3.5"})};_e(S,x=>{f()?x(g):p()&&x(m,1)})}q(v),D(u,v)};let c=z(()=>Ln("peer size-4 shadow-xs flex shrink-0 items-center justify-center rounded-[4px] border border-input transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",e.class));We(o,()=>dm,(u,h)=>{h(u,_t({"data-slot":"checkbox",get class(){return d(c)}},()=>s,{get ref(){return t()},set ref(f){t(f)},get checked(){return i()},set checked(f){i(f)},get indeterminate(){return r()},set indeterminate(f){r(f)},children:l,$$slots:{default:!0}}))})}D(n,a),it()}var aw=Z("<!> <!>",1);function ow(n,e){nt(e,!0);let t=me(e,"value",15),i=me(e,"disabled",3,!1);var r=Pe(),s=ae(r);We(s,()=>Gf,(a,o)=>{o(a,{orientation:"horizontal",children:(l,c)=>{var u=aw(),h=ae(u);{let p=z(()=>typeof t()=="boolean"?t():!1);Yf(h,{get id(){return e.inputId},get checked(){return d(p)},onCheckedChange:v=>{t(v===!0),e.onChange(v===!0)},get disabled(){return i()}})}var f=ue(h,2);We(f,()=>Wf,(p,v)=>{v(p,{get for(){return e.inputId},class:"font-normal cursor-pointer text-muted-foreground",children:(S,g)=>{ct();var m=Tt("Enabled");D(S,m)},$$slots:{default:!0}})}),D(l,u)},$$slots:{default:!0}})}),D(n,r),it()}var lw=Z("<label><!> <span> </span></label>"),cw=Z('<div class="divide-y divide-border/60 overflow-hidden rounded-md border border-input"></div>');function uw(n,e){nt(e,!0);let t=me(e,"disabled",3,!1);const i=z(()=>e.config?.options??{}),r=z(()=>new Set(e.value??[]));function s(o,l){const c=new is(d(r));l?c.add(o):c.delete(o),e.onChange([...c])}var a=cw();Ht(a,21,()=>Object.entries(d(i)),([o,l])=>l??o,(o,l)=>{var c=z(()=>$i(d(l),2));let u=()=>d(c)[0],h=()=>d(c)[1];const f=z(()=>h()??u()),p=z(()=>`${e.inputId}-${d(f)}`),v=z(()=>d(r).has(d(f)));var S=lw(),g=Q(S);Yf(g,{get id(){return d(p)},get checked(){return d(v)},onCheckedChange:T=>s(d(f),T===!0),get disabled(){return t()}});var m=ue(g,2);let x;var M=Q(m,!0);q(m),q(S),Le(()=>{Vt(S,"for",d(p)),At(S,1,`gap-3 px-3 py-2 text-sm flex items-center transition-colors select-none hover:bg-accent/50 ${d(v)?"bg-accent/30":""} ${t()?"cursor-not-allowed opacity-50":"cursor-pointer"}`),x=At(m,1,"flex-1",null,x,{"font-medium":d(v)}),Ze(M,u())}),D(o,S)}),q(a),D(n,a),it()}var dw=Z('<div class="gap-2 flex items-center"><input type="color" class="h-9 w-12 rounded p-1 cursor-pointer border border-input bg-background"/> <span class="font-mono text-sm text-muted-foreground"> </span></div>');function hw(n,e){nt(e,!0);let t=me(e,"value",3,"#000000");var i=dw(),r=Q(i);kl(r);var s=ue(r,2),a=Q(s,!0);q(s),q(i),Le(()=>{Tp(r,t()||"#000000"),Ze(a,t()||"#000000")}),Lt("change",r,o=>{const l=o.currentTarget.value;e.onChange(l)}),D(n,i),it()}Gn(["change"]);var fw=Z("<!> <!>",1);function pw(n,e){nt(e,!0);let t=me(e,"value",7),i=me(e,"disabled",3,!1);const r=z(()=>e.config?.options||{}),s=z(()=>t()||""),a=z(()=>Object.entries(d(r)).find(([c,u])=>u===d(s))?.[0]??d(s));var o=Pe(),l=ae(o);We(l,()=>Bp,(c,u)=>{u(c,{type:"single",get value(){return d(s)},onValueChange:h=>{h&&(t(h),e.onChange(h))},get disabled(){return i()},children:(h,f)=>{var p=fw(),v=ae(p);We(v,()=>zp,(g,m)=>{m(g,{class:"w-full",get disabled(){return i()},children:(x,M)=>{ct();var T=Tt();Le(()=>Ze(T,d(a)||"Select an option...")),D(x,T)},$$slots:{default:!0}})});var S=ue(v,2);We(S,()=>kp,(g,m)=>{m(g,{children:(x,M)=>{var T=Pe(),C=ae(T);Ht(C,17,()=>Object.entries(d(r)),([y,I])=>I??y,(y,I)=>{var _=z(()=>$i(d(I),2));let E=()=>d(_)[0],L=()=>d(_)[1];var P=Pe(),k=ae(P);{let W=z(()=>L()??E());We(k,()=>Vp,(H,N)=>{N(H,{get value(){return d(W)},get label(){return E()}})})}D(y,P)}),D(x,T)},$$slots:{default:!0}})}),D(h,p)},$$slots:{default:!0}})}),D(n,o),it()}var mw=Z('<button type="button"> </button>'),gw=Z('<div class="rounded text-xs flex overflow-hidden border"></div>'),vw=Z("<!> File URL",1),_w=Z('<div class="gap-1.5 text-xs flex items-center text-success"><!> </div>'),xw=Z('<p class="text-xs leading-snug pl-5 text-muted-foreground"> </p>'),bw=Z('<div class="p-2.5 gap-1.5 flex flex-col rounded-md border border-destructive/40 bg-destructive/5"><div class="gap-1.5 flex items-start"><!> <p class="text-xs leading-snug text-destructive"> </p></div> <!></div>'),Sw=Z('<p class="text-xs text-muted-foreground">URL must be publicly accessible (no login required).</p>'),yw=Z('<div class="gap-2 flex flex-col"><!> <div class="gap-2 flex"><!> <!></div> <!> <!> <!></div>'),Mw=Z("<!> Upload File",1),Ew=Z("<!> ",1),ww=Z('<p class="text-xs text-muted-foreground"> </p>'),Tw=Z('<div class="gap-2 flex flex-col"><!> <!> <!></div>'),Aw=Z('<div class="gap-4 flex w-full flex-col"><input type="file" class="hidden"/> <!> <!></div>');function Rw(n,e){nt(e,!0);let t=me(e,"value",15),i=me(e,"acceptedFormats",19,()=>[]),r=me(e,"defaultInputMode",3,"upload"),s=z(()=>e.allowedInputModes&&e.allowedInputModes.length>0?e.allowedInputModes:["upload","url"]),a=z(()=>d(s).length>1),o=we("upload");Rt(()=>{const R=r()??"upload";O(o,d(s).includes(R)?R:d(s)[0],!0)});let l=we(null),c=we(""),u=we(""),h=we(!1),f=we(!1),p=we(null),v=we("");Rt(()=>{if(t())try{const R=typeof t()=="string"?JSON.parse(t()):t();if(R.type==="base64")if(R._isMetadata&&R._fileSize){const F=(R._fileSize/1024/1024).toFixed(2);O(c,`Uploaded file (${R.fileEnding}, ${F}MB)`)}else O(c,`Uploaded file (${R.fileEnding})`);else R.type==="url"&&O(u,R.file,!0)}catch{}});function S(R){const F=R.split("?")[0];return(F.includes(".")?"."+F.split(".").pop():".tmp").toLowerCase()}function g(R){return i().length===0?!0:i().includes(R.toLowerCase())}function m(R){return R instanceof TypeError&&R.message==="Failed to fetch"}async function x(){if(d(u).trim()){O(f,!0),O(p,null),O(v,""),O(c,"");try{let R;try{R=new URL(d(u))}catch{O(p,{message:"Invalid URL — make sure it starts with https://",isCors:!1},!0),O(f,!1);return}if(R.protocol!=="https:"&&R.protocol!=="http:"){O(p,{message:"Only http:// and https:// URLs are supported.",isCors:!1},!0),O(f,!1);return}const F=await fetch(d(u));if(!F.ok){O(p,{message:`Server returned ${F.status} ${F.statusText}. Check the URL is correct and publicly accessible.`,isCors:!1},!0),O(f,!1);return}const U=await F.blob(),X=S(d(u));if(!g(X)){O(p,{message:`File format "${X}" is not accepted. Allowed: ${i().join(", ")}`,isCors:!1},!0),O(f,!1);return}const V=Nr.FILE_UPLOAD.MAX_SIZE_BYTES;if(U.size>V){O(p,{message:`File too large: ${(U.size/1024/1024).toFixed(2)}MB (max ${Nr.FILE_UPLOAD.MAX_SIZE_MB}MB). Download it and use Upload instead.`,isCors:!1},!0),O(f,!1);return}await new Promise(($,ee)=>{const Se=new FileReader;Se.onload=ye=>{const ve=ye.target?.result,K=ve.includes(",")?ve.split(",")[1]:ve,fe=JSON.stringify({file:K,type:"base64",fileEnding:X});t(fe),O(v,`Loaded ${X} (${(U.size/1024).toFixed(0)} KB)`),e.onChange(fe),$()},Se.onerror=()=>ee(new Error("Failed to read the downloaded file.")),Se.readAsDataURL(U)})}catch(R){if(m(R)){const F=(()=>{try{return new URL(d(u)).hostname}catch{return""}})();let U="Check that the URL is correct and the file is publicly accessible. If the server requires login, download the file and use the Upload option instead.";F.includes("sharepoint.com")||F.includes("onedrive.com")?U='SharePoint/OneDrive blocks browser access. Open the file in SharePoint, use "Download" to save it locally, then upload it here.':F.includes("drive.google.com")?U='Google Drive blocks browser access. Use "Download" in Google Drive to save the file locally, then upload it here.':F.includes("dropbox.com")&&(U='Dropbox links may block browser access. Try changing "?dl=0" to "?dl=1" in the URL, or download and upload instead.'),O(p,{message:`Could not reach "${F}" — the file may not exist, or the server does not allow browser access.`,isCors:!0,hint:U},!0)}else O(p,{message:R instanceof Error?R.message:"Unknown error",isCors:!1},!0)}finally{O(f,!1)}}}function M(R){const U=R.target.files?.[0];if(!U)return;const X=S(U.name);if(!g(X)){alert(`File format not accepted: ${X}`);return}O(c,U.name,!0);const V=new FileReader;V.onload=$=>{const ee=$.target?.result,Se=ee.includes(",")?ee.split(",")[1]:ee,ye=JSON.stringify({file:Se,type:"base64",fileEnding:X});t(ye),e.onChange(ye)},V.readAsDataURL(U)}function T(){d(l)?.click()}function C(R){R.preventDefault(),O(h,!0)}function y(){O(h,!1)}function I(R){R.preventDefault(),O(h,!1);const F=R.dataTransfer?.files;if(F?.[0]){const U=new Event("change");Object.defineProperty(U,"target",{value:{files:F}}),M(U)}}const _=z(()=>i().length>0?i().join(","):"*");var E=Aw(),L=Q(E);Nn(L,R=>O(l,R),()=>d(l));var P=ue(L,2);{var k=R=>{var F=gw();Ht(F,20,()=>d(s),U=>U,(U,X)=>{var V=mw(),$=Q(V,!0);q(V),Le(()=>{At(V,1,`px-3 py-1 flex-1 transition-colors ${d(o)===X?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"}`),Ze($,X==="upload"?"Upload":"URL")}),Lt("click",V,()=>O(o,X,!0)),D(U,V)}),q(F),D(R,F)};_e(P,R=>{d(a)&&R(k)})}var W=ue(P,2);{var H=R=>{var F=yw(),U=Q(F);Di(U,{for:"url-input",class:"gap-2 flex items-center",children:(Y,oe)=>{var Me=vw(),Ee=ae(Me);ng(Ee,{size:16}),ct(),D(Y,Me)},$$slots:{default:!0}});var X=ue(U,2),V=Q(X);{let Y=z(()=>d(p)?"border-destructive focus-visible:ring-destructive":"");Pr(V,{id:"url-input",type:"url",placeholder:"https://example.com/model.3dm",get disabled(){return d(f)},get class(){return d(Y)},oninput:()=>{O(p,null),O(v,"")},get value(){return d(u)},set value(oe){O(u,oe,!0)}})}var $=ue(V,2);{let Y=z(()=>d(f)||!d(u).trim());mn($,{type:"button",variant:"outline",get disabled(){return d(Y)},onclick:x,children:(oe,Me)=>{ct();var Ee=Tt();Le(()=>Ze(Ee,d(f)?"Fetching...":"Fetch")),D(oe,Ee)},$$slots:{default:!0}})}q(X);var ee=ue(X,2);{var Se=Y=>{var oe=_w(),Me=Q(oe);Km(Me,{size:13});var Ee=ue(Me);q(oe),Le(()=>Ze(Ee,` ${d(v)??""}`)),D(Y,oe)};_e(ee,Y=>{d(v)&&Y(Se)})}var ye=ue(ee,2);{var ve=Y=>{var oe=bw(),Me=Q(oe),Ee=Q(Me);dh(Ee,{size:13,class:"mt-0.5 shrink-0 text-destructive"});var Ge=ue(Ee,2),Te=Q(Ge,!0);q(Ge),q(Me);var Ve=ue(Me,2);{var Ae=Ce=>{var Oe=xw(),Be=Q(Oe,!0);q(Oe),Le(()=>Ze(Be,d(p).hint)),D(Ce,Oe)};_e(Ve,Ce=>{d(p).isCors&&d(p).hint&&Ce(Ae)})}q(oe),Le(()=>Ze(Te,d(p).message)),D(Y,oe)};_e(ye,Y=>{d(p)&&Y(ve)})}var K=ue(ye,2);{var fe=Y=>{var oe=Sw();D(Y,oe)};_e(K,Y=>{!d(p)&&!d(v)&&Y(fe)})}q(F),D(R,F)},N=R=>{var F=Tw(),U=Q(F);Di(U,{for:"file-upload",class:"gap-2 flex items-center",children:(ee,Se)=>{var ye=Mw(),ve=ae(ye);fu(ve,{size:16}),ct(),D(ee,ye)},$$slots:{default:!0}});var X=ue(U,2);{let ee=z(()=>d(h)?"border-primary":"");mn(X,{type:"button",variant:"outline",get class(){return`gap-2 w-full ${d(ee)??""}`},onclick:T,ondragover:C,ondragleave:y,ondrop:I,children:(Se,ye)=>{var ve=Ew(),K=ae(ve);fu(K,{size:16});var fe=ue(K);Le(()=>Ze(fe,` ${(d(c)||"Choose File or Drag & Drop")??""}`)),D(Se,ve)},$$slots:{default:!0}})}var V=ue(X,2);{var $=ee=>{var Se=ww(),ye=Q(Se);q(Se),Le(ve=>Ze(ye,`Accepted formats: ${ve??""}`),[()=>i().join(", ")]),D(ee,Se)};_e(V,ee=>{i().length>0&&ee($)})}q(F),D(R,F)};_e(W,R=>{d(o)==="url"?R(H):R(N,-1)})}q(E),Le(()=>Vt(L,"accept",d(_))),Lt("change",L,M),D(n,E),it()}Gn(["change","click"]);function Bl(n,e){let t=null;function i(...r){t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r),t=null},e)}return i.cancel=()=>{t!==null&&(clearTimeout(t),t=null)},i}var Cw=Z('<span data-slot="slider-track"><!></span> <!>',1);function Pw(n,e){nt(e,!0);let t=me(e,"ref",15,null),i=me(e,"value",15),r=me(e,"orientation",3,"horizontal"),s=lt(e,["$$slots","$$events","$$legacy","ref","value","orientation","class"]);var a=Pe(),o=ae(a);{const l=(u,h)=>{let f=()=>h?.().thumbs;var p=Cw(),v=ae(p),S=Q(v);{let m=z(()=>Ln("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"));We(S,()=>Wm,(x,M)=>{M(x,{"data-slot":"slider-range",get class(){return d(m)}})})}q(v);var g=ue(v,2);Ht(g,16,f,m=>m,(m,x)=>{var M=Pe(),T=ae(M);We(T,()=>Ym,(C,y)=>{y(C,{"data-slot":"slider-thumb",get index(){return x},class:"size-4 shadow-sm block shrink-0 rounded-full border border-primary bg-background ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"})}),D(m,M)}),Le(m=>{Vt(v,"data-orientation",r()),At(v,1,m)},[()=>fa(Ln("bg-neutral-200 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 relative grow overflow-hidden rounded-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full dark:bg-muted"))]),D(u,p)};let c=z(()=>Ln("data-[orientation=vertical]:min-h-44 relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e.class));We(o,()=>Hm,(u,h)=>{h(u,_t({"data-slot":"slider",get orientation(){return r()},get class(){return d(c)}},()=>s,{get ref(){return t()},set ref(f){t(f)},get value(){return i()},set value(f){i(f)},children:l,$$slots:{default:!0}}))})}D(n,a),it()}var Dw=Z('<input type="number" class="min-w-12 w-16 text-sm border-b border-border bg-transparent text-right outline-none focus:border-foreground"/>'),Iw=Z('<span role="button" class="min-w-12 text-sm cursor-text text-right text-muted-foreground select-none" title="Double-click to edit"> </span>'),Lw=Z('<div class="gap-4 flex items-center"><!> <!></div>'),Nw=Z("<!> <!>",1);function Uw(n,e){nt(e,!0);let t=me(e,"value",15),i=me(e,"disabled",3,!1),r=we(null),s=we(!1),a=we("");const o=z(()=>e.config?.minimum??0),l=z(()=>e.config?.maximum??100),c=z(()=>e.config?.stepSize??1),u=z(()=>typeof t()=="number"?t():d(o)),h=Bl(_=>e.onChange(_),400),f=Bl(_=>e.onChange(_),150);function p(_){return e.config?.minimum!==void 0&&_<e.config.minimum?`Minimum value is ${e.config.minimum}`:e.config?.maximum!==void 0&&_>e.config.maximum?`Maximum value is ${e.config.maximum}`:null}function v(_){const E=p(_);O(r,E,!0),E||(t(_),h(_))}function S(_){t(_),f(_)}function g(_){_.focus(),_.select()}function m(_){return Math.max(0,-Math.floor(Math.log10(_)))}var x=Nw(),M=ae(x);{var T=_=>{const E=z(()=>m(d(c)));var L=Lw(),P=Q(L);Pw(P,{type:"single",get value(){return d(u)},get min(){return d(o)},get max(){return d(l)},get step(){return d(c)},class:"flex-1",onValueChange:S,get disabled(){return i()}});var k=ue(P,2);{var W=N=>{var R=Dw();kl(R),_p(R,F=>g?.(F)),fp(()=>Qd(R,()=>d(a),F=>O(a,F))),Le(()=>Vt(R,"step",d(c))),gp("blur",R,()=>{const F=parseFloat(d(a));isNaN(F)||S(Math.min(d(l),Math.max(d(o),F))),O(s,!1)}),Lt("keydown",R,F=>{if(F.key==="Enter"){const U=parseFloat(d(a));isNaN(U)||S(Math.min(d(l),Math.max(d(o),U))),O(s,!1)}else F.key==="Escape"&&O(s,!1)}),D(N,R)},H=N=>{var R=Iw();Vt(R,"tabindex",0);var F=Q(R,!0);q(R),Le(U=>Ze(F,U),[()=>d(u).toFixed(d(E))]),Lt("dblclick",R,()=>{O(a,d(u).toFixed(d(E)),!0),O(s,!0)}),Lt("keydown",R,U=>{(U.key==="Enter"||U.key===" ")&&(O(a,d(u).toFixed(d(E)),!0),O(s,!0))}),D(N,R)};_e(k,N=>{d(s)?N(W):N(H,-1)})}q(L),D(_,L)},C=_=>{{let E=z(()=>e.config?.minimum),L=z(()=>e.config?.maximum),P=z(()=>e.config?.placeholder),k=z(()=>d(r)?!0:void 0),W=z(()=>d(r)?!0:void 0),H=z(()=>d(r)?"border-destructive":"");Pr(_,{get id(){return e.inputId},type:"number",get value(){return d(u)},get min(){return d(E)},get max(){return d(L)},get step(){return d(c)},get placeholder(){return d(P)},get"data-invalid"(){return d(k)},get"aria-invalid"(){return d(W)},get class(){return d(H)},get disabled(){return i()},oninput:()=>O(r,null),onchange:N=>{const R=parseFloat(N.currentTarget.value);isNaN(R)||v(R)},onblur:N=>{const R=parseFloat(N.currentTarget.value);if(!isNaN(R)){const F=p(R);O(r,F,!0),F||(t(R),e.onChange(R))}}})}};_e(M,_=>{e.config?.renderAsSlider?_(T):_(C,-1)})}var y=ue(M,2);{var I=_=>{var E=Pe(),L=ae(E);We(L,()=>Xf,(P,k)=>{k(P,{children:(W,H)=>{ct();var N=Tt();Le(()=>Ze(N,d(r))),D(W,N)},$$slots:{default:!0}})}),D(_,E)};_e(y,_=>{d(r)&&_(I)})}D(n,x),it()}Gn(["keydown","dblclick"]);var Fw=Z("<!> <!>",1);function Ow(n,e){nt(e,!0);let t=me(e,"value",15),i=me(e,"disabled",3,!1),r=we(null),s=we($n(t()||""));const a=Bl(p=>e.onChange(p),400);function o(p){if(e.config?.maxLength&&p.length>e.config.maxLength)return`Maximum ${e.config.maxLength} characters allowed`;if(e.config?.pattern)try{if(!new RegExp(e.config.pattern).test(p))return e.config.customErrorMessage||"Invalid format"}catch{return"Invalid validation pattern configured"}return null}function l(){const p=o(d(s));O(r,p,!0),p||(t(d(s)),a(d(s)))}var c=Fw(),u=ae(c);{let p=z(()=>e.config?.placeholder),v=z(()=>e.config?.maxLength),S=z(()=>d(r)?!0:void 0),g=z(()=>d(r)?!0:void 0),m=z(()=>d(r)?"border-destructive":"");Pr(u,{get id(){return e.inputId},type:"text",get placeholder(){return d(p)},get maxlength(){return d(v)},get"data-invalid"(){return d(S)},get"aria-invalid"(){return d(g)},get class(){return d(m)},get disabled(){return i()},oninput:()=>{O(r,null),l()},onblur:x=>{const M=x.currentTarget.value,T=o(M);O(r,T,!0),T||(O(s,M,!0),t(M),e.onChange(M))},get value(){return d(s)},set value(x){O(s,x,!0)}})}var h=ue(u,2);{var f=p=>{var v=Pe(),S=ae(v);We(S,()=>Xf,(g,m)=>{m(g,{children:(x,M)=>{ct();var T=Tt();Le(()=>Ze(T,d(r))),D(x,T)},$$slots:{default:!0}})}),D(p,v)};_e(h,p=>{d(r)&&p(f)})}D(n,c),it()}var Bw=Z("<!> <!>",1),zw=Z("<!> <!>",1),kw=Z('<span class="text-xs font-normal text-muted-foreground"> </span>'),Vw=Z(" <!> <!>",1),Hw=Z("<!> <!>",1);function Gw(n,e){nt(e,!0);let t=me(e,"value",15,void 0),i=me(e,"disabled",3,!1);const r=z(()=>`input-${e.item.paramId}`),s=z(()=>e.displayName||e.item.displayName||e.item.paramId),a=z(()=>{if(!Ro(e.item))return null;const h=e.item.config;if(h?.hideRange)return null;const f=typeof h?.minimum=="number",p=typeof h?.maximum=="number";return!f&&!p?null:f&&p?`${h.minimum} to ${h.maximum}`:f?`≥ ${h.minimum}`:`≤ ${h.maximum}`}),o=z(()=>Ro(e.item)&&d(a)!==null);function l(h){t(h),e.onChange(e.item.paramId,h)}var c=Pe(),u=ae(c);We(u,()=>Gf,(h,f)=>{f(h,{children:(p,v)=>{var S=Hw(),g=ae(S);We(g,()=>Wf,(H,N)=>{N(H,{get for(){return d(r)},class:"gap-2 flex items-center",children:(R,F)=>{ct();var U=Vw(),X=ae(U),V=ue(X);{var $=ye=>{var ve=Pe(),K=ae(ve);We(K,()=>Ar,(fe,Y)=>{Y(fe,{children:(oe,Me)=>{var Ee=zw(),Ge=ae(Ee);We(Ge,()=>Kd,(Ve,Ae)=>{Ae(Ve,{class:"p-1 cursor-help opacity-60 transition-opacity hover:opacity-100",children:(Ce,Oe)=>{Zm(Ce,{size:16})},$$slots:{default:!0}})});var Te=ue(Ge,2);We(Te,()=>Rr,(Ve,Ae)=>{Ae(Ve,{class:"sm:max-w-md",children:(Ce,Oe)=>{var Be=Pe(),He=ae(Be);We(He,()=>rs,(B,De)=>{De(B,{children:(pe,Ne)=>{var ce=Bw(),je=ae(ce);We(je,()=>Ji,(b,G)=>{G(b,{children:(ne,de)=>{ct();var he=Tt();Le(()=>Ze(he,d(s))),D(ne,he)},$$slots:{default:!0}})});var w=ue(je,2);We(w,()=>ss,(b,G)=>{G(b,{children:(ne,de)=>{ct();var he=Tt();Le(()=>Ze(he,e.item.description)),D(ne,he)},$$slots:{default:!0}})}),D(pe,ce)},$$slots:{default:!0}})}),D(Ce,Be)},$$slots:{default:!0}})}),D(oe,Ee)},$$slots:{default:!0}})}),D(ye,ve)};_e(V,ye=>{e.item.description&&ye($)})}var ee=ue(V,2);{var Se=ye=>{var ve=kw(),K=Q(ve,!0);q(ve),Le(()=>Ze(K,d(a))),D(ye,ve)};_e(ee,ye=>{d(o)&&ye(Se)})}Le(()=>Ze(X,`${d(s)??""} `)),D(R,U)},$$slots:{default:!0}})});var m=ue(g,2);{var x=H=>{const N=z(()=>e.item.config);{let R=z(()=>typeof t()=="number"?t():void 0);Uw(H,{get inputId(){return d(r)},get value(){return d(R)},get config(){return d(N)},onChange:l,get disabled(){return i()}})}},M=z(()=>Ro(e.item)),T=H=>{{let N=z(()=>typeof t()=="boolean"?t():void 0);ow(H,{get inputId(){return d(r)},get value(){return d(N)},onChange:l,get disabled(){return i()}})}},C=z(()=>$1(e.item)),y=H=>{const N=z(()=>e.item.config);{let R=z(()=>typeof t()=="string"?t():"");Ow(H,{get inputId(){return d(r)},get value(){return d(R)},get config(){return d(N)},onChange:l,get disabled(){return i()}})}},I=z(()=>K1(e.item)),_=H=>{const N=z(()=>e.item.config);var R=Pe(),F=ae(R);{var U=V=>{{let $=z(()=>Array.isArray(t())?t():typeof t()=="string"&&t()?[t()]:[]);uw(V,{get inputId(){return d(r)},get value(){return d($)},get config(){return d(N)},onChange:l,get disabled(){return i()}})}},X=V=>{{let $=z(()=>typeof t()=="string"?t():"");pw(V,{get value(){return d($)},get config(){return d(N)},onChange:l,get disabled(){return i()}})}};_e(F,V=>{d(N).displayAs==="checklist"?V(U):V(X,-1)})}D(H,R)},E=z(()=>Z1(e.item)),L=H=>{const N=z(()=>e.item.config);{let R=z(()=>typeof t()=="string"?t():""),F=z(()=>d(N)?.acceptedFormats??[]),U=z(()=>d(N)?.defaultInputMode),X=z(()=>d(N)?.allowedInputModes);Rw(H,{get value(){return d(R)},get acceptedFormats(){return d(F)},onChange:V=>l(V),get defaultInputMode(){return d(U)},get allowedInputModes(){return d(X)}})}},P=z(()=>J1(e.item)),k=H=>{{let N=z(()=>typeof t()=="string"?t():"#000000");hw(H,{get value(){return d(N)},onChange:R=>l(R)})}},W=z(()=>Q1(e.item));_e(m,H=>{d(M)?H(x):d(C)?H(T,1):d(I)?H(y,2):d(E)?H(_,3):d(P)?H(L,4):d(W)&&H(k,5)})}D(p,S)},$$slots:{default:!0}})}),D(n,c),it()}const es=new Map;function Ww(n,e){if(es.has(n))return es.get(n);if(document.querySelector(`script[src="${n}"]`)){const i=Promise.resolve();return es.set(n,i),i}const t=new Promise((i,r)=>{const s=document.createElement("script");s.src=n,e?.crossOrigin&&(s.crossOrigin=e.crossOrigin),e?.async!==void 0&&(s.async=e.async),e?.defer!==void 0&&(s.defer=e.defer),s.onload=()=>i(),s.onerror=()=>{es.delete(n),r(new Error(`Failed to load script: ${n}`))},document.head.appendChild(s)});return es.set(n,t),t}var Xw=Z('<div class="px-4 py-3 text-sm text-destructive"> </div>'),Yw=Z('<div class="px-4 py-8 text-sm text-center text-muted-foreground">Receiving chart data...</div>'),jw=Z('<div class="px-4 py-8 text-sm text-center text-muted-foreground">Waiting for chart data...</div>'),qw=Z('<div class="rounded p-1.5 backdrop-blur-sm flex items-center border border-border bg-background/80 text-muted-foreground"><!></div>'),Kw=Z('<div class="w-full"></div> <div><!> <button class="rounded p-1.5 backdrop-blur-sm flex items-center border border-border bg-background/80 text-foreground transition-colors hover:bg-background disabled:cursor-not-allowed disabled:opacity-50"><!></button></div>',1),Zw=Z("<div><!></div>");function $w(n,e){nt(e,!0);const t=new Set(["scattermap","scattermapbox","choropleth","scattergeo"]),i=z(()=>{if(!e.value)return null;try{return JSON.parse(e.value)}catch{return null}});let r=we(null),s=we(null),a=we(!1),o=we(null),l=we(!1),c=!1;async function u(){return window.Plotly||await Ww("https://cdn.plot.ly/plotly-3.4.0.min.js",{crossOrigin:"anonymous"}),window.Plotly}function h(){d(s)&&(document.fullscreenElement?document.exitFullscreen().catch(C=>{O(o,`Exit fullscreen failed: ${C.message}`)}):d(s).requestFullscreen().catch(C=>{O(o,`Fullscreen unavailable: ${C.message}`)}))}Rt(()=>{function C(){O(l,!!document.fullscreenElement),Promise.resolve().then(()=>{d(r)&&window.Plotly&&window.Plotly.Plots.resize(d(r))})}return document.addEventListener("fullscreenchange",C),()=>document.removeEventListener("fullscreenchange",C)});function f(){if(!d(r))return{textColor:"#333",gridColor:"#eee"};const C=getComputedStyle(d(r)),y=C.getPropertyValue("color").trim()||"#333",I=C.getPropertyValue("--border")?.trim()||C.getPropertyValue("--color-border")?.trim()||"rgba(128,128,128,0.2)";return{textColor:y,gridColor:I}}async function p(){if(!(!d(r)||!d(i))){O(o,null),O(a,!0);try{const C=await u(),{textColor:y,gridColor:I}=f(),_=d(i).data?.some(N=>t.has(N.type)),{title:E,template:L,height:P,width:k,...W}=d(i).layout,H={...W,autosize:!0,margin:{t:24,r:8,b:40,l:60,pad:0},font:{color:y},paper_bgcolor:W.paper_bgcolor??"transparent",plot_bgcolor:W.plot_bgcolor??"transparent",...!_&&W.xaxis?{xaxis:{...W.xaxis,gridcolor:I,color:y}}:{},...!_&&W.yaxis?{yaxis:{...W.yaxis,gridcolor:I,color:y}}:{}};C.react(d(r),d(i).data,H,{responsive:!0,displayModeBar:"hover",displaylogo:!1,modeBarButtonsToRemove:["sendDataToCloud","lasso2d","select2d"],...d(i).config})}catch(C){O(o,C instanceof Error?C.message:"Failed to render chart",!0)}finally{O(a,!1)}}}Ea(()=>{c=!0;let C=null;const y=new ResizeObserver(()=>{C&&clearTimeout(C),C=setTimeout(()=>{d(r)&&window.Plotly&&window.Plotly.Plots.resize(d(r)),C=null},150)});return d(s)&&y.observe(d(s)),()=>{y.disconnect(),C&&clearTimeout(C),d(r)&&window.Plotly&&window.Plotly.purge(d(r))}});let v=null;Rt(()=>{if(!(!e.value||!c||!d(r)))return v&&clearTimeout(v),v=setTimeout(()=>{p(),v=null},150),()=>{v&&clearTimeout(v)}});var S=Zw(),g=Q(S);{var m=C=>{var y=Xw(),I=Q(y,!0);q(y),Le(()=>Ze(I,d(o))),D(C,y)},x=C=>{var y=Yw();D(C,y)},M=C=>{var y=jw();D(C,y)},T=C=>{var y=Kw(),I=ae(y);Nn(I,N=>O(r,N),()=>d(r));var _=ue(I,2),E=Q(_);{var L=N=>{var R=qw(),F=Q(R);cc(F,{size:14,class:"animate-spin"}),q(R),D(N,R)};_e(E,N=>{d(a)&&N(L)})}var P=ue(E,2),k=Q(P);{var W=N=>{dc(N,{size:14})},H=N=>{uc(N,{size:14})};_e(k,N=>{d(l)?N(W):N(H,-1)})}q(P),q(_),Le(()=>{hi(I,`height: ${d(l)?"100vh":"380px"};`),At(_,1,`gap-1 left-2 top-2 absolute z-10 flex items-center opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${d(l)?"opacity-100":""}`),P.disabled=d(a),Vt(P,"title",d(l)?"Exit fullscreen":"Fullscreen")}),Lt("click",P,h),D(C,y)};_e(g,C=>{d(o)?C(m):!d(i)&&e.value?C(x,1):d(i)?C(T,-1):C(M,2)})}q(S),Nn(S,C=>O(s,C),()=>d(s)),Le(()=>At(S,1,`group rounded relative overflow-hidden border border-border ${d(l)?"bg-background":""}`)),D(n,S),it()}Gn(["click"]);var jf=async(n,e,t=null)=>{if(typeof document>"u"||typeof Blob>"u")throw new Ui("File download functionality is only available in browser environments. This function requires the DOM API (document, Blob).",gi.BROWSER_ONLY,{context:{environment:typeof window<"u"?"browser (SSR)":"Node.js",documentAvailable:typeof document<"u",blobAvailable:typeof Blob<"u"}});try{let i=await Jw(n,t);await Qw(i,e)}catch(i){throw i instanceof Ui?i:new Ui("Failed to download files from compute response",gi.INVALID_STATE,{context:{originalError:i instanceof Error?i.message:String(i)},originalError:i instanceof Error?i:void 0})}},Jw=async(n,e)=>{let t=[];if(n.forEach(i=>{let r=`${i.fileName}${i.fileType}`;if(i.subFolder&&i.subFolder.trim()!==""&&(r=`${i.subFolder}/${r}`),i.isBase64Encoded===!0&&i.data){let s=Mh(i.data);t.push({fileName:`${i.fileName}${i.fileType}`,content:new Uint8Array(s.buffer),path:r})}else i.isBase64Encoded===!1&&i.data&&t.push({fileName:`${i.fileName}${i.fileType}`,content:i.data,path:r})}),e){let i=Array.isArray(e)?e:[e],r=await Promise.all(i.map(async s=>{try{let a=await fetch(s.filePath);if(!a.ok)return zt().warn(`Failed to fetch additional file from URL: ${s.filePath}`),null;let o=await(await a.blob()).arrayBuffer();return{fileName:s.fileName,content:new Uint8Array(o),path:s.fileName}}catch(a){return zt().error(`Error fetching additional file from URL: ${s.filePath}`,a),null}}));t.push(...r.filter(s=>s!==null))}return t};async function Qw(n,e){let{zipSync:t,strToU8:i}=await qd(()=>import("../chunks/CXh1ITwj.js"),[],import.meta.url),r={};n.forEach(o=>{r[o.path]=typeof o.content=="string"?i(o.content):o.content});let s=t(r,{level:6}),a=new Blob([s],{type:"application/zip"});eT(a,`${e}.zip`)}function eT(n,e){if(typeof document>"u")throw new Ui("saveFile requires a browser environment with DOM API access.",gi.BROWSER_ONLY,{context:{function:"saveFile",requiredAPI:"document"}});let t=document.createElement("a");t.href=URL.createObjectURL(n),t.download=e,t.click(),URL.revokeObjectURL(t.href)}var da=new Map;function qf(n,e){da.set(n,e)}qf("Rhino.Geometry.Point3d",(n,e)=>{let t=e;return!t||typeof t.X!="number"?null:new n.Point([t.X,t.Y,t.Z])});qf("Rhino.Geometry.Line",(n,e)=>{let t=e;return!t||!t.From||!t.To?null:new n.Line([t.From.X,t.From.Y,t.From.Z],[t.To.X,t.To.Y,t.To.Z])});function tT(n){if(da.has(n))return da.get(n);for(let[e,t]of da)if(n.startsWith(e))return t}function nT(n){return!n||typeof n!="object"?null:n.data??n.value??null}function iT(n,e,t){let i=tT(e);if(i)try{return i(t,n)}catch(r){zt().warn(`Failed to decode Rhino type ${e}:`,r)}try{let r=nT(n);if(r)return t.CommonObject.decode(r)}catch(r){return zt().warn(`Failed to decode ${e} with CommonObject:`,r),{__decodeError:!0,type:e,raw:n}}return n}var Tr={STRING:"System.String",INT:"System.Int32",DOUBLE:"System.Double",BOOL:"System.Boolean"},rT="Rhino.Geometry.",sT=["WebDisplay"],aT="FileData";function Kf(n){return sT.some(e=>n.includes(e))}function Zf(n){if(typeof n!="string")return n;let e=n.trim();if(!(e.startsWith("{")||e.startsWith("[")||e.startsWith('"')))return n;try{let t=JSON.parse(e);if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}catch{return n}}function oT(n,e,t){switch(e){case Tr.STRING:return typeof n!="string"?n:n.replace(/^"(.*)"$/,"$1");case Tr.INT:return Number.parseInt(n,10);case Tr.DOUBLE:return Number.parseFloat(n);case Tr.BOOL:return String(n).toLowerCase()==="true";default:return t&&e.startsWith(rT)?iT(n,e,t):n}}function $f(n,e,t,i){if(typeof n!="string")return n;let r=t?Zf(n):n;return oT(r,e,i)}function lT(n){if(!n||typeof n!="object")return!1;let e=n;return typeof e.fileName=="string"&&typeof e.fileType=="string"&&"data"in e&&typeof e.isBase64Encoded=="boolean"&&typeof e.subFolder=="string"}function ya(n,e){for(let t of Object.values(n))if(Array.isArray(t))for(let i of t)e(i)}function cT(n,e=!1,t={}){let{parseValues:i=!0,rhino:r,stringOnly:s=!1}=t,a={};for(let o of n.values)ya(o.InnerTree,l=>{if(Kf(l.type)||s&&l.type!==Tr.STRING)return;let c=e?l.id:o.ParamName;if(!c)return;let u=$f(l.data,l.type,i,r);a[c]===void 0?a[c]=u:Array.isArray(a[c])?a[c].push(u):a[c]=[a[c],u]});return{values:a}}function uT(n){let e=[];for(let t of n.values)ya(t.InnerTree,i=>{if(!i.type.includes(aT))return;let r=Zf(i.data);lT(r)&&e.push(r)});return e}function Co(n,e,t={}){let{parseValues:i=!0,rhino:r,stringOnly:s=!1}=t,a;if("byName"in e?a=n.values.find(l=>l.ParamName===e.byName):a=n.values.find(l=>{let c=!1;return ya(l.InnerTree,u=>{u.id===e.byId&&(c=!0)}),c}),!a)return;let o=[];if(ya(a.InnerTree,l=>{if("byId"in e&&l.id!==e.byId||Kf(l.type)||s&&l.type!==Tr.STRING)return;let c=$f(l.data,l.type,i,r);o.push(c)}),o.length!==0)return o.length===1?o[0]:o}var dT=class{constructor(n,e=!1){this.response=n,this.debug=e}getValues(n=!1,e={}){return cT(this.response,n,e)}getValue(n,e){return Co(this.response,n,e)}getValueByParamName(n,e){return Co(this.response,{byName:n},e)}getValueByParamId(n,e){return Co(this.response,{byId:n},e)}async extractMeshesFromResponse(n){let e={debug:this.debug,...n},t;try{({getThreeMeshesFromComputeResponse:t}=await qd(()=>Promise.resolve().then(()=>cR),void 0,import.meta.url))}catch(i){throw new Ui("Failed to load three.js visualization module. Ensure three.js is installed as a peer dependency.",gi.INVALID_STATE,{context:{originalError:i instanceof Error?i.message:String(i)}})}return t(this.response,e)}getFileData(){return uT(this.response)}getAndDownloadFiles(n,e){let t=this.getFileData();jf(t,n,e)}};const hT={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif",".svg":"image/svg+xml",".json":"application/json",".txt":"text/plain",".csv":"text/csv",".xml":"application/xml",".pdf":"application/pdf",".3dm":"model/vnd.3dm",".obj":"model/obj",".stl":"model/stl"};function fT(n){const e=(n.fileType??"").toLowerCase(),t=hT[e]??"application/octet-stream";let i;if(n.isBase64Encoded){const a=atob(n.data),o=new Uint8Array(a.length);for(let l=0;l<a.length;l++)o[l]=a.charCodeAt(l);i=new Blob([o],{type:t})}else i=new Blob([n.data],{type:t});const r=`${n.fileName}${n.fileType??""}`,s=document.createElement("a");s.href=URL.createObjectURL(i),s.download=r,s.click(),URL.revokeObjectURL(s.href)}async function zl(n,e="grasshopper-output"){try{const t=Array.isArray(n)?n:[n];if(t.length===0){console.warn("[FileDownload] No files to download");return}if(t.length===1){fT(t[0]);return}await jf(t,e)}catch(t){throw console.error("[FileDownload] Error downloading files:",t),t}}function Po(n){if(n===0)return"0 Bytes";const e=Nr.FILE_SIZE.BYTES_PER_KB,t=["Bytes","KB","MB","GB"],i=Math.floor(Math.log(n)/Math.log(e));return Math.round(n/Math.pow(e,i)*100)/100+" "+t[i]}function Do(n){return Math.ceil(n.length*3/4)}var pT=Z('<div class="px-4 py-3 text-sm text-destructive"> </div>'),mT=Z('<div class="px-4 py-8 text-sm text-center text-muted-foreground">Waiting for image...</div>'),gT=Z(`<div class="px-4 py-3 text-sm text-destructive">Unsupported image format: <span class="font-mono"> </span>. Supported:
|
|
4116
|
+
.png, .jpg, .jpeg, .webp, .gif, .svg</div>`),vT=Z('<button title="Download image" class="rounded p-1.5 backdrop-blur-sm flex items-center border border-border bg-background/80 text-foreground transition-colors hover:bg-background disabled:cursor-not-allowed disabled:opacity-50"><!></button>'),_T=Z('<button class="rounded p-1.5 backdrop-blur-sm flex items-center border border-border bg-background/80 text-foreground transition-colors hover:bg-background"><!></button>'),xT=Z("<div><!> <!></div>"),bT=Z('<div class="w-full"><img class="h-full w-full object-contain"/></div> <!>',1),ST=Z("<div><!></div>");function yT(n,e){nt(e,!0);const t=new Set([".png",".jpg",".jpeg",".webp",".gif",".svg"]),i={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif",".svg":"image/svg+xml"};function r(E){return!!E&&typeof E=="object"&&"fileName"in E&&"data"in E&&"fileType"in E}const s=z(()=>Array.isArray(e.value)?e.value.find(r)??null:r(e.value)?e.value:null),a=z(()=>d(s)?(d(s).fileType??"").toLowerCase():""),o=z(()=>t.has(d(a))),l=z(()=>{if(!d(s)||!d(o))return null;const E=i[d(a)]??"application/octet-stream";return d(s).isBase64Encoded?`data:${E};base64,${d(s).data}`:`data:${E};utf8,${encodeURIComponent(d(s).data)}`}),c=z(()=>e.item.config??{}),u=z(()=>d(c).allowDownload??!0),h=z(()=>d(c).allowFullscreen??!0),f=z(()=>d(c).backgroundColor);let p=we(null),v=we(!1),S=we(!1),g=we(null);function m(){d(p)&&(document.fullscreenElement?document.exitFullscreen().catch(E=>{O(g,`Exit fullscreen failed: ${E.message}`)}):d(p).requestFullscreen().catch(E=>{O(g,`Fullscreen unavailable: ${E.message}`)}))}Rt(()=>{function E(){O(v,!!document.fullscreenElement)}return document.addEventListener("fullscreenchange",E),()=>document.removeEventListener("fullscreenchange",E)});async function x(){if(d(s)){O(S,!0),O(g,null);try{await zl(d(s),d(s).fileName)}catch(E){O(g,E instanceof Error?E.message:"Download failed",!0)}finally{O(S,!1)}}}var M=ST(),T=Q(M);{var C=E=>{var L=pT(),P=Q(L,!0);q(L),Le(()=>Ze(P,d(g))),D(E,L)},y=E=>{var L=mT();D(E,L)},I=E=>{var L=gT(),P=ue(Q(L)),k=Q(P,!0);q(P),ct(),q(L),Le(()=>Ze(k,d(a)||"(unknown)")),D(E,L)},_=E=>{var L=bT(),P=ae(L),k=Q(P);q(P);var W=ue(P,2);{var H=N=>{var R=xT(),F=Q(R);{var U=$=>{var ee=vT(),Se=Q(ee);Sh(Se,{size:14}),q(ee),Le(()=>ee.disabled=d(S)),Lt("click",ee,x),D($,ee)};_e(F,$=>{d(u)&&d(s)&&$(U)})}var X=ue(F,2);{var V=$=>{var ee=_T(),Se=Q(ee);{var ye=K=>{dc(K,{size:14})},ve=K=>{uc(K,{size:14})};_e(Se,K=>{d(v)?K(ye):K(ve,-1)})}q(ee),Le(()=>Vt(ee,"title",d(v)?"Exit fullscreen":"Fullscreen")),Lt("click",ee,m),D($,ee)};_e(X,$=>{d(h)&&$(V)})}q(R),Le(()=>At(R,1,`gap-1 right-2 top-2 absolute z-10 flex items-center opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100 ${d(v)?"opacity-100":""}`)),D(N,R)};_e(W,N=>{(d(u)||d(h))&&N(H)})}Le(()=>{hi(P,`height: ${d(v)?"100vh":"380px"}; ${d(f)?`background-color: ${d(f)};`:""}`),Vt(k,"src",d(l)),Vt(k,"alt",e.item.displayName??d(s).fileName)}),D(E,L)};_e(T,E=>{d(g)?E(C):d(s)?d(o)?E(_,-1):E(I,2):E(y,1)})}q(M),Nn(M,E=>O(p,E),()=>d(p)),Le(()=>At(M,1,`group rounded relative overflow-hidden border border-border ${d(v)?"bg-background":""}`)),D(n,M),it()}Gn(["click"]);const Wd=n=>{var e=TT();D(n,e)};var MT=Z("<!> <!>",1),ET=Z("<!> <!>",1),wT=Z('<div class="gap-2 flex items-center"><!> <!></div>'),TT=Z('<span class="text-muted-foreground not-italic">Waiting for data...</span>'),AT=Z('<div class="ml-4 pl-2 border-l border-border/50"><!></div>'),RT=Z('<div><button class="gap-1.5 py-0.5 text-xs flex w-full items-center text-muted-foreground transition-colors hover:text-foreground"><!> <!> <span class="font-medium"> </span></button> <!></div>'),CT=Z('<div class="gap-1.5 py-0.5 flex items-center justify-between"><div class="gap-1.5 min-w-0 flex items-center"><!> <span class="text-xs truncate text-foreground"> </span></div> <span class="text-xs shrink-0 text-muted-foreground"> </span></div>'),PT=Z('<div class="rounded px-3 py-3 text-sm border border-border bg-muted text-muted-foreground">Waiting for file data...</div>'),DT=Z('<div class="gap-2 text-xs flex items-center justify-between text-muted-foreground"><span class="min-w-0 truncate"> </span> <span class="shrink-0"> </span></div>'),IT=Z('<div class="gap-1 flex flex-col"></div>'),LT=Z('<div class="mt-2"><!></div>'),NT=Z('<li class="truncate"><span class="font-mono"> </span></li>'),UT=Z('<div class="rounded px-3 py-2 text-sm border border-destructive bg-destructive/10 text-destructive"><div class="font-medium">Duplicate file names detected</div> <div class="mt-1 text-xs"> </div> <ul class="mt-1 ml-4 text-xs list-disc"></ul> <div class="mt-1 text-xs">Rename outputs in your Grasshopper definition so each file has a unique name.</div></div>'),FT=Z('<div class="rounded px-3 py-2 text-sm border border-destructive bg-destructive/10 text-destructive"> </div>'),OT=Z('<div class="gap-2 flex flex-col"><div class="rounded px-3 py-2 border border-border bg-muted"><div class="gap-2 flex items-center justify-between"><span class="min-w-0 text-sm font-medium truncate text-foreground"> </span> <span class="text-xs shrink-0 text-muted-foreground"> </span></div> <!></div> <!> <!> <!></div>'),BT=Z('<span class="font-bold text-primary"> </span>'),zT=Z("<div><!></div>"),kT=Z("<pre> </pre>"),VT=Z("<div><!></div>"),HT=Z('<div class="group relative"><!> <!></div>'),GT=Z('<div class="gap-2 flex flex-col"><!> <!></div>');function WT(n,e){nt(e,!0);const t=V=>{var $=wT(),ee=Q($);Di(ee,{children:(ve,K)=>{ct();var fe=Tt();Le(()=>Ze(fe,d(o))),D(ve,fe)},$$slots:{default:!0}});var Se=ue(ee,2);{var ye=ve=>{var K=Pe(),fe=ae(K);We(fe,()=>Ar,(Y,oe)=>{oe(Y,{children:(Me,Ee)=>{var Ge=ET(),Te=ae(Ge);We(Te,()=>Kd,(Ae,Ce)=>{Ce(Ae,{class:"p-1 cursor-help opacity-60 transition-opacity hover:opacity-100",children:(Oe,Be)=>{eg(Oe,{size:16})},$$slots:{default:!0}})});var Ve=ue(Te,2);We(Ve,()=>Rr,(Ae,Ce)=>{Ce(Ae,{class:"sm:max-w-md",children:(Oe,Be)=>{var He=Pe(),B=ae(He);We(B,()=>rs,(De,pe)=>{pe(De,{children:(Ne,ce)=>{var je=MT(),w=ae(je);We(w,()=>Ji,(G,ne)=>{ne(G,{children:(de,he)=>{ct();var xe=Tt();Le(()=>Ze(xe,d(o))),D(de,xe)},$$slots:{default:!0}})});var b=ue(w,2);We(b,()=>ss,(G,ne)=>{ne(G,{children:(de,he)=>{ct();var xe=Tt();Le(()=>Ze(xe,e.item.description)),D(de,xe)},$$slots:{default:!0}})}),D(Ne,je)},$$slots:{default:!0}})}),D(Oe,He)},$$slots:{default:!0}})}),D(Me,Ge)},$$slots:{default:!0}})}),D(ve,K)};_e(Se,ve=>{e.item.description&&ve(ye)})}q($),D(V,$)},i=(V,$=Ut,ee=Ut)=>{var Se=Pe(),ye=ae(Se);Ht(ye,17,$,([ve,K])=>ve,(ve,K)=>{var fe=z(()=>$i(d(K),2));let Y=()=>d(fe)[1];var oe=Pe(),Me=ae(oe);{var Ee=Te=>{const Ve=z(()=>ee()?`${ee()}/${Y().name}`:Y().name),Ae=z(()=>E.has(d(Ve)));var Ce=RT(),Oe=Q(Ce),Be=Q(Oe);{let w=z(()=>d(Ae)?"rotate-90":"");eh(Be,{size:12,get class(){return`shrink-0 transition-transform duration-150 ${d(w)??""}`}})}var He=ue(Be,2);{var B=w=>{Qp(w,{size:13,class:"shrink-0 text-primary/70"})},De=w=>{Jm(w,{size:13,class:"shrink-0 text-primary/70"})};_e(He,w=>{d(Ae)?w(B):w(De,-1)})}var pe=ue(He,2),Ne=Q(pe,!0);q(pe),q(Oe);var ce=ue(Oe,2);{var je=w=>{var b=AT(),G=Q(b);i(G,()=>Y().children,()=>d(Ve)),q(b),D(w,b)};_e(ce,w=>{d(Ae)&&w(je)})}q(Ce),Le(()=>Ze(Ne,Y().name)),Lt("click",Oe,()=>L(d(Ve))),D(Te,Ce)},Ge=Te=>{var Ve=CT(),Ae=Q(Ve),Ce=Q(Ae);$m(Ce,{size:12,class:"shrink-0 text-muted-foreground"});var Oe=ue(Ce,2),Be=Q(Oe);q(Oe),q(Ae);var He=ue(Ae,2),B=Q(He,!0);q(He),q(Ve),Le(De=>{Ze(Be,`${Y().file.fileName??""}${Y().file.fileType??""}`),Ze(B,De)},[()=>Po(Do(Y().file.data))]),D(Te,Ve)};_e(Me,Te=>{Y().type==="folder"?Te(Ee):Te(Ge,-1)})}D(ve,oe)}),D(V,Se)},r=V=>{var $=Pe(),ee=ae($);{var Se=ve=>{var K=PT();D(ve,K)},ye=ve=>{var K=OT(),fe=Q(K),Y=Q(fe),oe=Q(Y),Me=Q(oe,!0);q(oe);var Ee=ue(oe,2),Ge=Q(Ee,!0);q(Ee),q(Y);var Te=ue(Y,2);{var Ve=B=>{var De=LT(),pe=Q(De);{var Ne=je=>{i(je,()=>d(C),()=>"")},ce=je=>{var w=IT();Ht(w,23,()=>d(S),(b,G)=>y(b)+"#"+G,(b,G)=>{var ne=DT(),de=Q(ne),he=Q(de);q(de);var xe=ue(de,2),ie=Q(xe,!0);q(xe),q(ne),Le(ge=>{Ze(he,`${d(G).fileName??""}${d(G).fileType??""}`),Ze(ie,ge)},[()=>Po(Do(d(G).data))]),D(b,ne)}),q(w),D(je,w)};_e(pe,je=>{d(C)?je(Ne):je(ce,-1)})}q(De),D(B,De)};_e(Te,B=>{d(g)>1&&B(Ve)})}q(fe);var Ae=ue(fe,2);{var Ce=B=>{var De=UT(),pe=ue(Q(De),2),Ne=Q(pe);q(pe);var ce=ue(pe,2);Ht(ce,20,()=>d(I),je=>je,(je,w)=>{var b=NT(),G=Q(b),ne=Q(G,!0);q(G),q(b),Le(()=>Ze(ne,w)),D(je,b)}),q(ce),ct(2),q(De),Le(()=>Ze(Ne,`The following ${d(I).length===1?"path appears":"paths appear"} more than once:`)),D(B,De)};_e(Ae,B=>{d(_)&&B(Ce)})}var Oe=ue(Ae,2);{var Be=B=>{var De=FT(),pe=Q(De,!0);q(De),Le(()=>Ze(pe,d(p))),D(B,De)};_e(Oe,B=>{d(p)&&B(Be)})}var He=ue(Oe,2);{let B=z(()=>d(f)||d(_));mn(He,{onclick:P,get disabled(){return d(B)},class:"w-full",children:(De,pe)=>{ct();var Ne=Tt();Le(()=>Ze(Ne,d(f)?"Downloading...":`Download ${d(g)===1?"File":`${d(g)} Files`}`)),D(De,Ne)},$$slots:{default:!0}})}q(K),Le(B=>{Ze(Me,d(g)===1?`${d(S)[0].fileName}${d(S)[0].fileType}`:`${d(g)} files`),Ze(Ge,B)},[()=>Po(d(m))]),D(ve,K)};_e(ee,ve=>{d(g)===0?ve(Se):ve(ye,-1)})}D(V,$)};let s=we(!1),a;const o=z(()=>e.displayName||e.item.displayName||e.item.paramId),l=z(()=>typeof e.value=="object"&&e.value!==null),c=z(()=>e.value==null?"":d(l)?JSON.stringify(e.value,null,2):String(e.value)),u=z(()=>e.value!=null);async function h(){try{await navigator.clipboard.writeText(d(c)),O(s,!0),clearTimeout(a),a=setTimeout(()=>O(s,!1),2e3)}catch(V){console.error("Failed to copy:",V)}}let f=we(!1),p=we(null);function v(V){return V&&typeof V=="object"&&"fileName"in V&&"data"in V}const S=z(()=>e.value?Array.isArray(e.value)?e.value.filter(v):v(e.value)?[e.value]:[]:[]),g=z(()=>d(S).length),m=z(()=>d(S).reduce((V,$)=>V+Do($.data),0));function x(V){const $=new pa;for(let ee=0;ee<V.length;ee++){const Se=V[ee],ye=(Se.subFolder||"").split("/").filter(Boolean);let ve=$;for(const Y of ye){ve.has(Y)||ve.set(Y,{type:"folder",name:Y,children:new pa});const oe=ve.get(Y);oe.type==="folder"&&(ve=oe.children)}const K=`${Se.fileName}${Se.fileType??""}`,fe=ve.has(K)?`${K}#${ee}`:K;ve.set(fe,{type:"file",file:Se})}return $}function M(V,$=""){const ee=[];for(const[Se,ye]of V)if(ye.type==="folder"){const ve=$?`${$}/${Se}`:Se;ee.push(ve),ee.push(...M(ye.children,ve))}return ee}const T=z(()=>d(S).some(V=>V.subFolder&&V.subFolder.length>0)),C=z(()=>d(T)?x(d(S)):null);function y(V){const $=(V.subFolder||"").replace(/^\/+|\/+$/g,""),ee=`${V.fileName}${V.fileType??""}`;return $?`${$}/${ee}`:ee}const I=z(()=>{const V={};for(const $ of d(S)){const ee=y($);V[ee]=(V[ee]??0)+1}return Object.entries(V).filter(([,$])=>$>1).map(([$])=>$)}),_=z(()=>d(I).length>0);let E=new is;Rt(()=>{if(d(C)){E.clear();for(const V of M(d(C)))E.add(V)}});function L(V){E.has(V)?E.delete(V):E.add(V)}async function P(){if(d(g)!==0){O(f,!0),O(p,null);try{if(d(g)===1)await zl(d(S)[0],d(S)[0].fileName);else{const V=e.displayName?e.displayName.replace(/[^a-z0-9]/gi,"_").toLowerCase():"download";await zl(d(S),V)}}catch(V){O(p,V instanceof Error?V.message:"Failed to download files",!0),console.error("[OutputDisplayWidget] Download error:",V)}finally{O(f,!1)}}}var k=GT(),W=Q(k);t(W);var H=ue(W,2);{var N=V=>{{let $=z(()=>typeof e.value=="string"?e.value:e.value!=null?JSON.stringify(e.value):"");$w(V,{get item(){return e.item},get value(){return d($)}})}},R=V=>{yT(V,{get item(){return e.item},get value(){return e.value}})},F=V=>{r(V)},U=V=>{var $=zT();At($,1,"min-h-12.5 rounded px-3 py-3 font-mono text-sm border border-border flex items-center bg-muted/50 wrap-break-word");var ee=Q($);{var Se=ve=>{var K=BT(),fe=Q(K,!0);q(K),Le(()=>Ze(fe,d(c))),D(ve,K)},ye=ve=>{Wd(ve)};_e(ee,ve=>{d(u)?ve(Se):ve(ye,-1)})}q($),D(V,$)},X=V=>{var $=HT(),ee=Q($);{var Se=fe=>{var Y=kT();At(Y,1,"min-h-12.5 rounded px-3 py-3 font-mono text-sm border border-border overflow-wrap-anywhere max-h-96 overflow-auto bg-muted/10 text-foreground");var oe=Q(Y,!0);q(Y),Le(()=>Ze(oe,d(c))),D(fe,Y)},ye=fe=>{var Y=VT();At(Y,1,"min-h-12.5 rounded px-3 py-3 font-mono text-sm border border-border overflow-wrap-anywhere bg-muted/10 wrap-break-word whitespace-pre-wrap text-foreground");var oe=Q(Y);{var Me=Ge=>{var Te=Tt();Le(()=>Ze(Te,e.value)),D(Ge,Te)},Ee=Ge=>{Wd(Ge)};_e(oe,Ge=>{d(u)?Ge(Me):Ge(Ee,-1)})}q(Y),D(fe,Y)};_e(ee,fe=>{d(l)?fe(Se):fe(ye,-1)})}var ve=ue(ee,2);{var K=fe=>{{let Y=z(()=>d(s)?"opacity-100":"opacity-0 group-hover:opacity-100");mn(fe,{onclick:h,get class(){return`right-2 top-2 absolute transition-opacity ${d(Y)??""}`},size:"sm",children:(oe,Me)=>{ct();var Ee=Tt();Le(()=>Ze(Ee,d(s)?"Copied!":"Copy")),D(oe,Ee)},$$slots:{default:!0}})}};_e(ve,fe=>{d(u)&&fe(K)})}q($),D(V,$)};_e(H,V=>{e.item.widgetType==="chart"?V(N):e.item.widgetType==="image"?V(R,1):e.item.widgetType==="file"?V(F,2):e.item.widgetType==="number"?V(U,3):e.item.widgetType==="text"&&V(X,4)})}q(k),D(n,k),it()}Gn(["click"]);var XT=Z('<div class="gap-8 flex flex-col"></div>'),YT=Z('<div class="p-4 tab-content-container svelte-jdukda"><!></div>');function jT(n,e){nt(e,!0);const t=(l,c=Ut,u=Ut)=>{const h=z(()=>r(c().paramId));var f=Pe(),p=ae(f);{var v=S=>{Gw(S,{get item(){return c()},get value(){return e.values[d(h).id]},get displayName(){return c().displayName},get onChange(){return e.onValueChange},get disabled(){return u().disabled}})};_e(p,S=>{d(h)&&S(v)})}D(l,f)},i=(l,c=Ut)=>{const u=z(()=>s(c().paramId));var h=Pe(),f=ae(h);{var p=v=>{WT(v,{get item(){return c()},get value(){return e.values[c().paramId]},get displayName(){return c().displayName}})};_e(f,v=>{d(u)&&v(p)})}D(l,h)};function r(l){return e.inputs.find(c=>c.id===l)}function s(l){return e.outputs.find(c=>c.id===l)}var a=Pe(),o=ae(a);We(o,()=>Xp,(l,c)=>{c(l,{get value(){return e.tab.id},class:"min-h-0 p-0 flex-1",children:(u,h)=>{Cf(u,{class:"h-full",orientation:"vertical",children:(f,p)=>{var v=YT(),S=Q(v);{var g=x=>{Fl(x,{type:"empty",size:"medium",message:"This tab has no groups configured."})},m=x=>{var M=XT();Ht(M,21,()=>e.tab.groups,T=>T.id,(T,C)=>{var y=Pe(),I=ae(y);{var _=L=>{{let P=z(()=>d(C).columns??1),k=z(()=>e.collapsedGroups[d(C).id]??!1),W=z(()=>e.tab.groups.length===1);q1(L,{get label(){return d(C).label},get description(){return d(C).description},get items(){return d(C).items},get columns(){return d(P)},get collapsed(){return d(k)},get values(){return e.values},onToggle:()=>e.onToggleGroup(d(C).id),get inputSnippet(){return t},get outputSnippet(){return i},get flat(){return d(W)}})}},E=z(()=>k1(d(C),e.values));_e(I,L=>{d(E)&&L(_)})}D(T,y)}),q(M),D(x,M)};_e(S,x=>{e.tab.groups.length===0?x(g):x(m,-1)})}q(v),D(f,v)},$$slots:{default:!0}})},$$slots:{default:!0}})}),D(n,a),it()}var qT=Z("<!> <!>",1);function KT(n,e){nt(e,!0);let t=me(e,"requestedTabId",3,null),i=we(""),r=$n({});const s=z(()=>e.schema.layout.type==="tabbed"?e.schema.layout.tabs.filter(h=>e.panelFilter?e.panelFilter==="right"?h.position==="right":h.position!=="right":!0):[]),a=z(()=>d(s).length>1);Rt(()=>{t()&&d(s).some(h=>h.id===t())?O(i,t()):d(s).length>0&&!d(i)&&O(i,d(s)[0].id,!0)}),Rt(()=>{if(e.schema.layout.type!=="tabbed")return;const h={};e.schema.layout.tabs.forEach(f=>f.groups.forEach(p=>{p.id in r||(h[p.id]=p.collapsed??!1)})),Object.keys(h).length>0&&Object.assign(r,h)}),Rt(()=>{if(e.schema.layout.type!=="tabbed")return;const h={};d(s).forEach(f=>f.groups.forEach(p=>p.items.forEach(v=>{if(v.type==="linebreak")return;const{visible:S,disabled:g,defaultValue:m}=Ol(v,e.values),x=e.schema.inputs.find(M=>M.id===v.paramId);!x||m===void 0||(!S||g)&&e.values[x.id]!==m&&(h[x.id]=m)}))),Object.keys(h).length>0&&Object.assign(e.values,h)});function o(h){r[h]=!r[h]}function l(h){O(i,h,!0)}var c=Pe(),u=ae(c);We(u,()=>Cr,(h,f)=>{f(h,{class:"pt-1 min-h-0 mx-1 flex flex-1 flex-col overflow-hidden",children:(p,v)=>{var S=Pe(),g=ae(S);We(g,()=>Yp,(m,x)=>{x(m,{get value(){return d(i)},class:"gap-0 min-h-0 flex flex-1 flex-col",children:(M,T)=>{var C=qT(),y=ae(C);{var I=E=>{N1(E,{get tabs(){return d(s)},onTabChange:l})};_e(y,E=>{d(a)&&E(I)})}var _=ue(y,2);Ht(_,17,()=>d(s),E=>E.id,(E,L)=>{jT(E,{get tab(){return d(L)},get values(){return e.values},get collapsedGroups(){return r},onToggleGroup:o,get onValueChange(){return e.onValueChange},get inputs(){return e.schema.inputs},get outputs(){return e.schema.outputs}})}),D(M,C)},$$slots:{default:!0}})}),D(p,S)},$$slots:{default:!0}})}),D(n,c),it()}var ZT=Z('<span class="text-xs font-semibold"> </span>'),$T=Z('<span class="text-xs font-semibold"> </span>'),JT=Z('<button type="button"><!></button>'),QT=Z('<div role="button" tabindex="0"></div>');function Xd(n,e){nt(e,!0);const t=z(()=>["gap-1 py-2 lg:py-3 lg:flex-col lg:w-auto px-2 lg:px-0","flex w-full shrink-0 flex-row items-center","backdrop-blur-sm bg-background/90 cursor-pointer"].join(" ")),i="w-8 h-8 rounded cursor-pointer flex shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-accent hover:text-foreground";var r=QT();Ht(r,21,()=>e.tabs,s=>s.id,(s,a)=>{var o=JT();At(o,1,fa(i));var l=Q(o);{var c=h=>{var f=Pe(),p=ae(f);{var v=m=>{Vf(m,{get icon(){return d(a).icon},class:"h-4 w-4"})},S=z(()=>d(a).icon.includes(":")),g=m=>{var x=ZT(),M=Q(x,!0);q(x),Le(()=>Ze(M,d(a).icon)),D(m,x)};_e(p,m=>{d(S)?m(v):m(g,-1)})}D(h,f)},u=h=>{var f=$T(),p=Q(f,!0);q(f),Le(v=>Ze(p,v),[()=>d(a).label[0]?.toUpperCase()??"?"]),D(h,f)};_e(l,h=>{d(a).icon?h(c):h(u,-1)})}q(o),Le(()=>{Vt(o,"title",d(a).label),Vt(o,"aria-label",d(a).label)}),Lt("click",o,h=>{h.stopPropagation(),e.onTabClick(d(a).id)}),D(s,o)}),q(r),Le(()=>{At(r,1,fa(d(t)),"svelte-17r9ylq"),hi(r,`--collapsed-w: ${e.collapsedWidth??""}px;`),Vt(r,"aria-label",`Expand ${e.side??""} panel`)}),Lt("click",r,function(...s){e.onExpand?.apply(this,s)}),Lt("keydown",r,s=>(s.key==="Enter"||s.key===" ")&&e.onExpand()),D(n,r),it()}Gn(["click","keydown"]);function eA(n){return n.layout?n.layout.type==="tabbed"?n.layout.tabs.flatMap(e=>e.groups??[]):n.layout.type==="flat"?n.layout.groups??[]:[]:[]}function tA(n,e,t){const i=[];for(const r of eA(n))for(const s of r.items??[]){if(s.type!=="input")continue;const a=e[s.paramId],o=n.inputs.find(l=>l.id===s.paramId);a!==void 0&&o&&i.push({paramId:s.paramId,nickname:o.nickname,displayName:s.displayName||o.nickname,paramType:o.paramType,value:a,groupName:r.label})}return{id:em(),name:t.name,description:t.description,timestamp:new Date().toISOString(),schemaId:n.id,documentId:n.documentId??"",projectFileName:n.projectFileName??"",pluginVersion:n.pluginVersion??"",author:t.author,tags:t.tags??[],parameters:i}}function nA(n,e){const t=[];n.documentId!==(e.documentId??"")&&t.push({paramId:"__document__",severity:"error",message:"Document ID mismatch - this state was saved for a different document",details:{expected:e.documentId??"",actual:n.documentId}}),n.schemaId!==e.id&&t.push({paramId:"__schema__",severity:"warning",message:"Schema has changed since this state was saved",details:{expected:e.id,actual:n.schemaId}});for(const r of n.parameters){const s=e.inputs.find(a=>a.id===r.paramId);if(!s){t.push({paramId:r.paramId,severity:"error",message:`Parameter "${r.nickname}" no longer exists in the schema`});continue}s.nickname!==r.nickname&&t.push({paramId:r.paramId,severity:"warning",message:"Parameter nickname changed",details:{expected:r.nickname,actual:s.nickname}})}const i=t.some(r=>r.severity==="error");return{isValid:t.length===0,issues:t,canLoad:!i}}function Yd(n,e,t){const i=new Set(t.issues.filter(s=>s.severity==="error"&&!s.paramId.startsWith("__")).map(s=>s.paramId)),r={};for(const s of n.parameters){const a=e.inputs.some(o=>o.id===s.paramId);!i.has(s.paramId)&&a&&(r[s.paramId]=s.value)}return r}function iA(n){const e=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=`${n.name.replace(/[^a-z0-9]/gi,"_")}_${n.timestamp.split("T")[0].replace(/-/g,"_")}.sps`,i.style.display="none",document.body.appendChild(i),setTimeout(()=>{i.click(),setTimeout(()=>{document.body.removeChild(i),URL.revokeObjectURL(t)},Nr.TIMEOUTS.PARAM_EXPORT_DELAY)},0)}async function rA(n){const e=JSON.parse(await n.text());if(!e.id||!e.name||!e.documentId||!e.parameters)throw new Error("Invalid saved state file format");return e}var sA=Z("<!> Save State",1),aA=Z("<!> Load State",1),oA=Z("<!> ",1),lA=Z("<!> <!>",1),cA=Z("<!> <!>",1),uA=Z('<!> <div class="gap-4 py-4 grid"><div class="gap-2 grid"><!> <!></div> <div class="gap-2 grid"><!> <!></div> <div class="gap-2 grid"><!> <!></div> <div class="gap-2 grid"><!> <!></div></div> <!>',1),dA=Z("<!> <!>",1),hA=Z("<!> Select .sps File",1),fA=Z('<!> <div class="py-8"><!></div> <!>',1),pA=Z("<!> <!>",1),mA=Z('<div class="gap-3 flex items-start"><!> <div><h4 class="text-sm font-semibold text-success-foreground">No Issues Found</h4> <p class="text-sm mt-1 text-success-foreground/80">This state can be loaded safely.</p></div></div>'),gA=Z('<div class="gap-3 flex items-start"><!> <div><h4 class="text-sm font-semibold text-warning-foreground">Warnings Detected</h4> <p class="text-sm mt-1 text-warning-foreground/80"> </p></div></div>'),vA=Z('<div class="gap-3 flex items-start"><!> <div><h4 class="text-sm font-semibold text-destructive">Critical Errors</h4> <p class="text-sm mt-1 text-destructive/80">Cannot load this state due to critical incompatibilities.</p></div></div>'),_A=Z('<p class="text-xs mt-1 text-muted-foreground"> </p>'),xA=Z('<div><div class="gap-2 flex items-start"><!> <div class="flex-1"><p class="text-sm font-medium"> </p> <!></div></div></div>'),bA=Z('<div class="space-y-2"><h4 class="text-sm font-medium">Issues:</h4> <!></div>'),SA=Z('<div class="gap-4 py-4 grid"><!> <!></div>'),yA=Z("<!> <!>",1),MA=Z("<!> <!> <!>",1),EA=Z('<!> <!> <!> <input type="file" accept=".sps" class="hidden"/> <!> <!> <!>',1);function wA(n,e){nt(e,!0);let t=me(e,"showSaveButton",3,!0),i=me(e,"showLoadButton",3,!0),r=me(e,"actions",19,()=>[]),s=we(!1),a=we(""),o=we(""),l=we(""),c=we(""),u=we(!1),h=we(!1),f=we(null),p=we(null),v=we(null);function S(){O(a,`State ${new Date().toLocaleDateString()}`),O(o,""),O(l,e.schema.author||"",!0),O(c,""),O(s,!0)}function g(){if(!d(a).trim()){alert("Please enter a name for this state");return}const R=tA(e.schema,e.currentValues,{name:d(a).trim(),description:d(o).trim()||void 0,author:d(l).trim()||void 0,tags:d(c).split(",").map(F=>F.trim()).filter(F=>F.length>0)});iA(R),O(s,!1)}async function m(R){const F=R.target;if(!(!F.files||F.files.length===0)){try{const U=F.files[0],X=await rA(U),V=nA(X,e.schema);if(!V.canLoad){O(f,X,!0),O(p,V,!0),O(u,!0);return}if(!V.isValid){O(f,X,!0),O(p,V,!0),O(u,!0);return}const $=Yd(X,e.schema,V);e.onLoadValues($)}catch(U){alert("Failed to import state: "+U.message)}F.value=""}}function x(){if(!(!d(f)||!d(p))&&d(p).canLoad){const R=Yd(d(f),e.schema,d(p));e.onLoadValues(R),O(u,!1),O(f,null),O(p,null)}}function M(){O(u,!1),O(f,null),O(p,null)}function T(){O(h,!0)}function C(){d(v)?.click(),O(h,!1)}var y=EA(),I=ae(y);{var _=R=>{mn(R,{variant:"default",size:"sm",onclick:S,children:(F,U)=>{var X=sA(),V=ae(X);Sh(V,{class:"mr-2 h-4 w-4"}),ct(),D(F,X)},$$slots:{default:!0}})};_e(I,R=>{t()&&R(_)})}var E=ue(I,2);{var L=R=>{mn(R,{variant:"outline",size:"sm",onclick:T,children:(F,U)=>{var X=aA(),V=ae(X);pu(V,{class:"mr-2 h-4 w-4"}),ct(),D(F,X)},$$slots:{default:!0}})};_e(E,R=>{i()&&R(L)})}var P=ue(E,2);Ht(P,17,r,R=>R.id,(R,F)=>{{let U=z(()=>d(F).variant??"outline"),X=z(()=>d(F).size??"sm");mn(R,{get variant(){return d(U)},get size(){return d(X)},get onclick(){return d(F).onclick},children:(V,$)=>{var ee=oA(),Se=ae(ee);{var ye=K=>{const fe=z(()=>d(F).icon);var Y=Pe(),oe=ae(Y);We(oe,()=>d(fe),(Me,Ee)=>{Ee(Me,{class:"mr-2 h-4 w-4"})}),D(K,Y)};_e(Se,K=>{d(F).icon&&K(ye)})}var ve=ue(Se);Le(()=>Ze(ve,` ${d(F).label??""}`)),D(V,ee)},$$slots:{default:!0}})}});var k=ue(P,2);Nn(k,R=>O(v,R),()=>d(v));var W=ue(k,2);We(W,()=>Ar,(R,F)=>{F(R,{get open(){return d(s)},set open(U){O(s,U,!0)},children:(U,X)=>{var V=Pe(),$=ae(V);We($,()=>Rr,(ee,Se)=>{Se(ee,{children:(ye,ve)=>{var K=uA(),fe=ae(K);We(fe,()=>rs,(pe,Ne)=>{Ne(pe,{children:(ce,je)=>{var w=lA(),b=ae(w);We(b,()=>Ji,(ne,de)=>{de(ne,{children:(he,xe)=>{ct();var ie=Tt("Save Parameter State");D(he,ie)},$$slots:{default:!0}})});var G=ue(b,2);We(G,()=>ss,(ne,de)=>{de(ne,{children:(he,xe)=>{ct();var ie=Tt("Save the current parameter values as a .sps file");D(he,ie)},$$slots:{default:!0}})}),D(ce,w)},$$slots:{default:!0}})});var Y=ue(fe,2),oe=Q(Y),Me=Q(oe);Di(Me,{for:"export-name",children:(pe,Ne)=>{ct();var ce=Tt("State Name *");D(pe,ce)},$$slots:{default:!0}});var Ee=ue(Me,2);Pr(Ee,{id:"export-name",placeholder:"e.g., Design Option A",get value(){return d(a)},set value(pe){O(a,pe,!0)}}),q(oe);var Ge=ue(oe,2),Te=Q(Ge);Di(Te,{for:"export-description",children:(pe,Ne)=>{ct();var ce=Tt("Description");D(pe,ce)},$$slots:{default:!0}});var Ve=ue(Te,2);jp(Ve,{id:"export-description",placeholder:"Optional description of this state",rows:3,get value(){return d(o)},set value(pe){O(o,pe,!0)}}),q(Ge);var Ae=ue(Ge,2),Ce=Q(Ae);Di(Ce,{for:"export-author",children:(pe,Ne)=>{ct();var ce=Tt("Author");D(pe,ce)},$$slots:{default:!0}});var Oe=ue(Ce,2);Pr(Oe,{id:"export-author",placeholder:"Your name or email",get value(){return d(l)},set value(pe){O(l,pe,!0)}}),q(Ae);var Be=ue(Ae,2),He=Q(Be);Di(He,{for:"export-tags",children:(pe,Ne)=>{ct();var ce=Tt("Tags");D(pe,ce)},$$slots:{default:!0}});var B=ue(He,2);Pr(B,{id:"export-tags",placeholder:"facade, option-a, client-approved (comma-separated)",get value(){return d(c)},set value(pe){O(c,pe,!0)}}),q(Be),q(Y);var De=ue(Y,2);We(De,()=>ka,(pe,Ne)=>{Ne(pe,{children:(ce,je)=>{var w=cA(),b=ae(w);mn(b,{variant:"outline",onclick:()=>O(s,!1),children:(ne,de)=>{ct();var he=Tt("Cancel");D(ne,he)},$$slots:{default:!0}});var G=ue(b,2);mn(G,{onclick:g,children:(ne,de)=>{ct();var he=Tt("Save State");D(ne,he)},$$slots:{default:!0}}),D(ce,w)},$$slots:{default:!0}})}),D(ye,K)},$$slots:{default:!0}})}),D(U,V)},$$slots:{default:!0}})});var H=ue(W,2);We(H,()=>Ar,(R,F)=>{F(R,{get open(){return d(h)},set open(U){O(h,U,!0)},children:(U,X)=>{var V=Pe(),$=ae(V);We($,()=>Rr,(ee,Se)=>{Se(ee,{children:(ye,ve)=>{var K=fA(),fe=ae(K);We(fe,()=>rs,(Ee,Ge)=>{Ge(Ee,{children:(Te,Ve)=>{var Ae=dA(),Ce=ae(Ae);We(Ce,()=>Ji,(Be,He)=>{He(Be,{children:(B,De)=>{ct();var pe=Tt("Load Parameter State");D(B,pe)},$$slots:{default:!0}})});var Oe=ue(Ce,2);We(Oe,()=>ss,(Be,He)=>{He(Be,{children:(B,De)=>{ct();var pe=Tt("Select a .sps state file from your drive to load");D(B,pe)},$$slots:{default:!0}})}),D(Te,Ae)},$$slots:{default:!0}})});var Y=ue(fe,2),oe=Q(Y);mn(oe,{onclick:C,class:"w-full",size:"lg",children:(Ee,Ge)=>{var Te=hA(),Ve=ae(Te);pu(Ve,{class:"mr-2 h-4 w-4"}),ct(),D(Ee,Te)},$$slots:{default:!0}}),q(Y);var Me=ue(Y,2);We(Me,()=>ka,(Ee,Ge)=>{Ge(Ee,{children:(Te,Ve)=>{mn(Te,{variant:"outline",onclick:()=>O(h,!1),children:(Ae,Ce)=>{ct();var Oe=Tt("Cancel");D(Ae,Oe)},$$slots:{default:!0}})},$$slots:{default:!0}})}),D(ye,K)},$$slots:{default:!0}})}),D(U,V)},$$slots:{default:!0}})});var N=ue(H,2);We(N,()=>Ar,(R,F)=>{F(R,{get open(){return d(u)},set open(U){O(u,U,!0)},children:(U,X)=>{var V=Pe(),$=ae(V);We($,()=>Rr,(ee,Se)=>{Se(ee,{class:"max-w-2xl max-h-[80vh] overflow-y-auto",children:(ye,ve)=>{var K=MA(),fe=ae(K);We(fe,()=>rs,(Ee,Ge)=>{Ge(Ee,{children:(Te,Ve)=>{var Ae=pA(),Ce=ae(Ae);We(Ce,()=>Ji,(Be,He)=>{He(Be,{children:(B,De)=>{ct();var pe=Tt("State Validation Report");D(B,pe)},$$slots:{default:!0}})});var Oe=ue(Ce,2);We(Oe,()=>ss,(Be,He)=>{He(Be,{children:(B,De)=>{var pe=Pe(),Ne=ae(pe);{var ce=je=>{var w=Tt();Le(()=>Ze(w,`Validating state: ${d(f).name??""}`)),D(je,w)};_e(Ne,je=>{d(f)&&je(ce)})}D(B,pe)},$$slots:{default:!0}})}),D(Te,Ae)},$$slots:{default:!0}})});var Y=ue(fe,2);{var oe=Ee=>{var Ge=SA(),Te=Q(Ge);{var Ve=He=>{var B=Pe(),De=ae(B);We(De,()=>Cr,(pe,Ne)=>{Ne(pe,{class:"p-4 border-success/30 bg-success/5",children:(ce,je)=>{var w=mA(),b=Q(w);qm(b,{class:"h-5 w-5 text-success"}),ct(2),q(w),D(ce,w)},$$slots:{default:!0}})}),D(He,B)},Ae=He=>{var B=Pe(),De=ae(B);We(De,()=>Cr,(pe,Ne)=>{Ne(pe,{class:"p-4 border-warning/30 bg-warning/5",children:(ce,je)=>{var w=gA(),b=Q(w);Qs(b,{class:"h-5 w-5 text-warning"});var G=ue(b,2),ne=ue(Q(G),2),de=Q(ne);q(ne),q(G),q(w),Le(()=>Ze(de,`${d(p).issues.length??""} warning(s) found, but state can still be loaded.`)),D(ce,w)},$$slots:{default:!0}})}),D(He,B)},Ce=He=>{var B=Pe(),De=ae(B);We(De,()=>Cr,(pe,Ne)=>{Ne(pe,{class:"p-4 border-destructive/30 bg-destructive/5",children:(ce,je)=>{var w=vA(),b=Q(w);Qs(b,{class:"h-5 w-5 text-destructive"}),ct(2),q(w),D(ce,w)},$$slots:{default:!0}})}),D(He,B)};_e(Te,He=>{d(p).isValid?He(Ve):d(p).canLoad?He(Ae,1):He(Ce,-1)})}var Oe=ue(Te,2);{var Be=He=>{var B=bA(),De=ue(Q(B),2);Ht(De,17,()=>d(p).issues,pe=>pe.message,(pe,Ne)=>{var ce=xA(),je=Q(ce),w=Q(je);{let xe=z(()=>d(Ne).severity==="error"?"text-destructive":"text-warning");Qs(w,{get class(){return`h-4 w-4 mt-0.5 ${d(xe)??""}`}})}var b=ue(w,2),G=Q(b),ne=Q(G,!0);q(G);var de=ue(G,2);{var he=xe=>{var ie=_A(),ge=Q(ie);q(ie),Le(()=>Ze(ge,`Expected: ${d(Ne).details.expected??""} → Actual: ${d(Ne).details.actual??""}`)),D(xe,ie)};_e(de,xe=>{d(Ne).details&&xe(he)})}q(b),q(je),q(ce),Le(()=>{At(ce,1,`p-3 rounded-lg border ${d(Ne).severity==="error"?"border-destructive/30 bg-destructive/5":"border-warning/30 bg-warning/5"}`),Ze(ne,d(Ne).message)}),D(pe,ce)}),q(B),D(He,B)};_e(Oe,He=>{d(p).isValid||He(Be)})}q(Ge),D(Ee,Ge)};_e(Y,Ee=>{d(p)&&Ee(oe)})}var Me=ue(Y,2);We(Me,()=>ka,(Ee,Ge)=>{Ge(Ee,{children:(Te,Ve)=>{var Ae=yA(),Ce=ae(Ae);mn(Ce,{variant:"outline",onclick:M,children:(He,B)=>{ct();var De=Tt("Cancel");D(He,De)},$$slots:{default:!0}});var Oe=ue(Ce,2);{var Be=He=>{mn(He,{onclick:x,children:(B,De)=>{ct();var pe=Tt("Load Anyway");D(B,pe)},$$slots:{default:!0}})};_e(Oe,He=>{d(p)?.canLoad&&He(Be)})}D(Te,Ae)},$$slots:{default:!0}})}),D(ye,K)},$$slots:{default:!0}})}),D(U,V)},$$slots:{default:!0}})}),Lt("change",k,m),D(n,y),it()}Gn(["change"]);var TA=Z("<!> ",1),AA=Z('<div class="panel-footer px-3 svelte-1txzu1i"><div class="gap-2 flex flex-wrap items-center justify-center"><!> <!></div> <!></div>'),RA=Z('<div class="panel-content-wrapper svelte-1txzu1i"><!> <!></div>'),CA=Z('<div class="my-4 gap-2 flex items-center"><div class="h-px flex-1 bg-border"></div> <span class="text-xs font-medium px-1 text-muted-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div> <!>',1),PA=Z('<div class="drawer-footer svelte-1txzu1i"><!></div>'),DA=Z('<div class="min-h-0 flex flex-1 flex-col"><!></div> <div style="z-index: 40;"><button class="drawer-handle-bar svelte-1txzu1i"><div class="drawer-pill svelte-1txzu1i"></div> <span class="text-sm font-medium ml-2 text-foreground"> </span> <!></button> <div class="drawer-content svelte-1txzu1i"><div class="px-3 pb-6"><!> <!></div></div> <!></div>',1),IA=Z('<div class="my-4 gap-2 flex items-center"><div class="h-px flex-1 bg-border"></div> <span class="text-xs font-medium px-1 text-muted-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div> <!>',1),LA=Z('<div class="drawer-footer svelte-1txzu1i"><!></div>'),NA=Z('<div class="flex flex-1 flex-col overflow-hidden"><div class="px-3 pt-3 flex-1 overflow-y-auto"><!> <!></div> <!></div>'),UA=Z('<div class="min-h-0 flex h-full flex-1 justify-center"><div class="min-h-0 flex h-full w-4/5 flex-col"><!></div></div>'),FA=Z("<div><!></div>"),OA=Z("<!> <!>",1),BA=Z("<div><!></div>"),zA=Z("<!> <!>",1),kA=Z("<!> <!> <!>",1),VA=Z('<div class="min-h-0 flex h-full flex-1"><!> <!> <!></div>'),HA=Z('<div data-layout-root=""><!></div> <!>',1);function GA(n,e){nt(e,!0);const t=(Y,oe=Ut,Me=Ut,Ee,Ge)=>{let Te=lu(()=>cu(Ee?.(),!0)),Ve=lu(()=>cu(Ge?.(),!0));var Ae=RA(),Ce=Q(Ae);{var Oe=B=>{KT(B,{get schema(){return e.schema},get onValueChange(){return e.onValueChange},get panelFilter(){return oe()},get requestedTabId(){return Me()},get values(){return u()},set values(De){u(De)}})};_e(Ce,B=>{e.schema.layout.type==="tabbed"&&B(Oe)})}var Be=ue(Ce,2);{var He=B=>{var De=AA(),pe=Q(De),Ne=Q(pe);{var ce=G=>{wA(G,{get schema(){return e.schema},get currentValues(){return u()},onLoadValues:R,get showSaveButton(){return f()},get showLoadButton(){return p()}})};_e(Ne,G=>{d(Te)&&G(ce)})}var je=ue(Ne,2);Ht(je,17,h,G=>G.id,(G,ne)=>{{let de=z(()=>d(ne).variant??"outline"),he=z(()=>d(ne).size??"sm");mn(G,{get variant(){return d(de)},get size(){return d(he)},get onclick(){return d(ne).onclick},children:(xe,ie)=>{var ge=TA(),Ue=ae(ge);{var Ie=Fe=>{const dt=z(()=>d(ne).icon);var ft=Pe(),Et=ae(ft);We(Et,()=>d(dt),(j,ze)=>{ze(j,{class:"mr-2 h-4 w-4"})}),D(Fe,ft)};_e(Ue,Fe=>{d(ne).icon&&Fe(Ie)})}var ke=ue(Ue);Le(()=>Ze(ke,` ${d(ne).label??""}`)),D(xe,ge)},$$slots:{default:!0}})}}),q(pe);var w=ue(pe,2);{var b=G=>{wo(G,{get hasPendingChanges(){return a()},get hasNeverSolved(){return o()},get isSolving(){return e.isSolving},get oncalculate(){return c()}})};_e(w,G=>{!d(y)&&d(Ve)&&e.schema.instanceSolve===!1&&G(b)})}q(De),D(B,De)};_e(Be,B=>{(d(Te)||!d(y)&&d(Ve)&&e.schema.instanceSolve===!1)&&B(He)})}q(Ae),D(Y,Ae)},i=48;let r=me(e,"meshes",19,()=>[]),s=me(e,"showSolvingIndicator",3,!1),a=me(e,"hasPendingChanges",3,!1),o=me(e,"hasNeverSolved",3,!1),l=me(e,"isViewerFullscreen",15,!1),c=me(e,"oncalculate",3,()=>{}),u=me(e,"values",31,()=>$n({})),h=me(e,"panelActions",19,()=>[]),f=me(e,"showSaveButton",3,!0),p=me(e,"showLoadButton",3,!0),v=me(e,"viewerConfig",19,()=>({}));const S=z(()=>!!(e.schema?.viewerOptions?.enableLocal||e.schema?.viewerOptions?.enableRemote)),g=z(()=>e.schema.layout.type==="tabbed"?e.schema.layout.tabs.filter(Y=>Y.position!=="right"):[]),m=z(()=>e.schema.layout.type==="tabbed"?e.schema.layout.tabs.filter(Y=>Y.position==="right"):[]),x=z(()=>d(g).length>0),M=z(()=>d(m).length>0),T=z(()=>d(S)||d(M)),C=z(()=>!d(S)&&d(x)&&d(M));let y=we(!1),I=we(!1);const _=z(()=>d(g)[0]?.label??"Parameters");Rt(()=>{const Y=window.matchMedia("(max-width: 639px)");function oe(){O(y,Y.matches,!0)}return oe(),Y.addEventListener("change",oe),()=>Y.removeEventListener("change",oe)});let E=we(!1),L=we(!1),P=we(null),k=we(null),W=we(null),H=we(null);const N=z(()=>`${d(x)?"L":""}${d(S)?"V":""}${d(M)?"R":""}`);async function R(Y){Object.assign(u(),Y),await e.onLoadValues?.()}let F=0;function U(Y){F=Y.touches[0].clientY}function X(Y){const oe=Y.changedTouches[0].clientY-F;Math.abs(oe)>40&&O(I,oe<0)}var V=HA(),$=ae(V);let ee;var Se=Q($);{var ye=Y=>{var oe=Pe(),Me=ae(oe);{var Ee=Te=>{var Ve=DA(),Ae=ae(Ve),Ce=Q(Ae);{let he=z(()=>({...v(),backgroundColor:e.schema?.viewerOptions?.backgroundColor,showSceneManager:!1}));Pd(Ce,{get meshes(){return r()},get isSolving(){return e.isSolving},get isBlurred(){return d(I)},get drawerOpen(){return d(I)},get viewerConfig(){return d(he)},get isFullscreen(){return l()},set isFullscreen(xe){l(xe)}})}q(Ae);var Oe=ue(Ae,2);let Be;var He=Q(Oe),B=ue(Q(He),2),De=Q(B,!0);q(B);var pe=ue(B,2);{let he=z(()=>d(I)?"":"rotate-180");tm(pe,{size:16,get class(){return`ml-auto text-muted-foreground transition-transform duration-300 ${d(he)??""}`}})}q(He);var Ne=ue(He,2),ce=Q(Ne),je=Q(ce);{var w=he=>{t(he,()=>d(M)?"left":void 0,()=>d(W),()=>!d(M),()=>!1)};_e(je,he=>{d(x)&&he(w)})}var b=ue(je,2);{var G=he=>{var xe=CA(),ie=ae(xe),ge=ue(Q(ie),2),Ue=Q(ge,!0);q(ge),ct(2),q(ie);var Ie=ue(ie,2);t(Ie,()=>"right",()=>d(H),()=>!0,()=>!1),Le(()=>Ze(Ue,d(m)[0]?.label??"More")),D(he,xe)};_e(b,he=>{d(M)&&he(G)})}q(ce),q(Ne);var ne=ue(Ne,2);{var de=he=>{var xe=PA(),ie=Q(xe);wo(ie,{get hasPendingChanges(){return a()},get hasNeverSolved(){return o()},get isSolving(){return e.isSolving},get oncalculate(){return c()}}),q(xe),D(he,xe)};_e(ne,he=>{e.schema.instanceSolve===!1&&he(de)})}q(Oe),Le(()=>{Be=At(Oe,1,"drawer-container svelte-1txzu1i",null,Be,{"drawer-open":d(I),"drawer-closed":!d(I)}),Vt(He,"aria-label",d(I)?"Collapse panel":"Expand panel"),Vt(He,"aria-expanded",d(I)),Ze(De,d(_))}),Lt("click",He,()=>O(I,!d(I))),Lt("touchstart",He,U),Lt("touchend",He,X),D(Te,Ve)},Ge=Te=>{var Ve=NA(),Ae=Q(Ve),Ce=Q(Ae);{var Oe=pe=>{t(pe,()=>d(M)?"left":void 0,()=>d(W),()=>!d(M),()=>!1)};_e(Ce,pe=>{d(x)&&pe(Oe)})}var Be=ue(Ce,2);{var He=pe=>{var Ne=IA(),ce=ae(Ne),je=ue(Q(ce),2),w=Q(je,!0);q(je),ct(2),q(ce);var b=ue(ce,2);t(b,()=>"right",()=>d(H),()=>!0,()=>!1),Le(()=>Ze(w,d(m)[0]?.label??"More")),D(pe,Ne)};_e(Be,pe=>{d(M)&&pe(He)})}q(Ae);var B=ue(Ae,2);{var De=pe=>{var Ne=LA(),ce=Q(Ne);wo(ce,{get hasPendingChanges(){return a()},get hasNeverSolved(){return o()},get isSolving(){return e.isSolving},get oncalculate(){return c()}}),q(Ne),D(pe,Ne)};_e(B,pe=>{e.schema.instanceSolve===!1&&pe(De)})}q(Ve),D(Te,Ve)};_e(Me,Te=>{d(S)?Te(Ee):Te(Ge,-1)})}D(Y,oe)},ve=Y=>{var oe=UA(),Me=Q(oe),Ee=Q(Me);t(Ee,()=>d(M)?"right":void 0,()=>d(M)?d(H):d(W),()=>!d(M),()=>!d(M)),q(Me),q(oe),D(Y,oe)},K=Y=>{var oe=VA(),Me=Q(oe);{var Ee=Ae=>{Xd(Ae,{side:"left",get tabs(){return d(g)},collapsedWidth:i,onExpand:()=>d(P)?.expand(),onTabClick:Ce=>{O(W,Ce,!0),d(P)?.expand()}})};_e(Me,Ae=>{d(E)&&d(T)&&d(x)&&Ae(Ee)})}var Ge=ue(Me,2);We(Ge,()=>Rf,(Ae,Ce)=>{Ce(Ae,{direction:"horizontal",get autoSaveId(){return`selva-layout-${d(N)??""}`},class:"min-h-0 flex-1",children:(Oe,Be)=>{var He=kA(),B=ae(He);{var De=w=>{var b=OA(),G=ae(b);{let de=z(()=>d(C)?50:d(S)&&d(M)?22:30);We(G,()=>as,(he,xe)=>{Nn(xe(he,{order:1,get defaultSize(){return d(de)},minSize:15,maxSize:45,collapsible:!0,collapsedSize:0,onCollapse:()=>O(E,!0),onExpand:()=>O(E,!1),class:"ml-1",children:(ie,ge)=>{var Ue=FA(),Ie=Q(Ue);t(Ie,()=>d(M)?"left":void 0,()=>d(W)),q(Ue),Le(()=>At(Ue,1,`min-h-0 flex h-full flex-col ${l()||d(E)?"hidden":""}`)),D(ie,Ue)},$$slots:{default:!0}}),ie=>O(P,ie,!0),()=>d(P))})}var ne=ue(G,2);We(ne,()=>Dl,(de,he)=>{he(de,{withHandle:!0,class:"bg-transparent",get"data-collapsed"(){return d(E)},onclick:()=>{d(E)&&d(P)?.expand()}})}),D(w,b)};_e(B,w=>{d(x)&&w(De)})}var pe=ue(B,2);{var Ne=w=>{var b=Pe(),G=ae(b);We(G,()=>as,(ne,de)=>{de(ne,{order:2,minSize:20,class:"min-h-0 mx-1 flex flex-col",children:(he,xe)=>{{let ie=z(()=>({backgroundColor:e.schema?.viewerOptions?.backgroundColor}));Pd(he,{get meshes(){return r()},get isSolving(){return e.isSolving},get viewerConfig(){return d(ie)},get isFullscreen(){return l()},set isFullscreen(ge){l(ge)}})}},$$slots:{default:!0}})}),D(w,b)};_e(pe,w=>{d(S)&&w(Ne)})}var ce=ue(pe,2);{var je=w=>{var b=zA(),G=ae(b);We(G,()=>Dl,(de,he)=>{he(de,{withHandle:!0,class:"bg-transparent",get"data-collapsed"(){return d(L)},onclick:()=>{d(L)&&d(k)?.expand()}})});var ne=ue(G,2);{let de=z(()=>d(C)?50:25);We(ne,()=>as,(he,xe)=>{Nn(xe(he,{order:3,get defaultSize(){return d(de)},minSize:15,maxSize:45,collapsible:!0,collapsedSize:0,onCollapse:()=>O(L,!0),onExpand:()=>O(L,!1),class:"mr-1",children:(ie,ge)=>{var Ue=BA(),Ie=Q(Ue);t(Ie,()=>"right",()=>d(H),()=>!d(x),()=>!d(x)),q(Ue),Le(()=>At(Ue,1,`min-h-0 flex h-full flex-col ${l()||d(L)?"hidden":""}`)),D(ie,Ue)},$$slots:{default:!0}}),ie=>O(k,ie,!0),()=>d(k))})}D(w,b)};_e(ce,w=>{d(M)&&w(je)})}D(Oe,He)},$$slots:{default:!0}})});var Te=ue(Ge,2);{var Ve=Ae=>{Xd(Ae,{side:"right",get tabs(){return d(m)},collapsedWidth:i,onExpand:()=>d(k)?.expand(),onTabClick:Ce=>{O(H,Ce,!0),d(k)?.expand()}})};_e(Te,Ae=>{d(L)&&d(M)&&Ae(Ve)})}q(oe),D(Y,oe)};_e(Se,Y=>{d(y)?Y(ye):!d(S)&&!d(C)&&d(x)!==d(M)?Y(ve,1):Y(K,-1)})}q($);var fe=ue($,2);ME(fe,{get show(){return s()}}),Le(()=>ee=At($,1,`min-h-0 sm:flex-row sm:py-(--page-py) flex flex-1 flex-col overflow-hidden ${d(E)?"sm:pl-0":"sm:pl-(--page-px)"} ${d(L)?"sm:pr-0":"sm:pr-(--page-px)"}`,"svelte-1txzu1i",ee,{"fullscreen-layout":l(),relative:d(y)})),D(n,V),it()}Gn(["click","touchstart","touchend"]);function WA(n){switch(n){case"number":case"integer":return 0;case"boolean":return!1;case"text":return"";default:return null}}const XA=6e4;function YA(n,e={}){const{timeout:t=XA}=e;let i=we(!1),r=we(null),s=null;function a(){s?.abort(),s=null}async function o(u){a(),s=new AbortController;const{signal:h}=s,f=setTimeout(()=>s?.abort(),t);O(i,!0);try{await n(u,h)}catch(p){if(!(p instanceof Error&&p.name==="AbortError"))throw p}finally{if(clearTimeout(f),O(i,!1),s=null,d(r)!==null){const p=d(r);O(r,null),o(p)}}}function l(u){d(i)?O(r,u,!0):o(u)}function c(){O(r,null),a()}return{trigger:l,get isComputing(){return d(i)},get hasPending(){return d(r)!==null},cancel:c}}function jA(n){const{FAST_THRESHOLD_MS:e,SLOW_THRESHOLD_MS:t,HISTORY_SIZE:i,ANIMATION_DELAY:r}=Nr.SOLVING_INDICATOR;let s=we(!1),a=null,o=null;const l=[];return Rt(()=>{const c=n();return nn(()=>{if(c){o=performance.now();const u=l.length===0?1/0:l.reduce((f,p)=>f+p,0)/l.length;if(l.length>0&&u<e)return;const h=u===1/0||u>=t?0:(u-e)/(t-e)*r;a||(h===0?O(s,!0):a=setTimeout(()=>{O(s,!0),a=null},h))}else o!==null&&(l.push(performance.now()-o),l.length>i&&l.shift(),o=null),a&&(clearTimeout(a),a=null),O(s,!1)}),()=>{a&&clearTimeout(a)}}),{get show(){return d(s)}}}function qA(n,e,t,i="left",r=0,s){Ea(()=>{const a=ha(du);!a||!e||a.register(n,e,t,i,r,s)}),Jd(()=>{try{ha(du)?.unregister(n)}catch{}})}const KA=n=>{if(!n)return"";const e=n.replace(/^#/,"");if(!/^[0-9A-Fa-f]{6}$/.test(e))return n;const t=parseInt(e.slice(0,2),16)/255,i=parseInt(e.slice(2,4),16)/255,r=parseInt(e.slice(4,6),16)/255,s=T=>T<=.04045?T/12.92:Math.pow((T+.055)/1.055,2.4),a=s(t),o=s(i),l=s(r),c=a*.4124564+o*.3575761+l*.1804375,u=a*.2126729+o*.7151522+l*.072175,h=a*.0193339+o*.119192+l*.9503041,f=Math.cbrt(.8189330101*c+.3618667424*u-.1288597137*h),p=Math.cbrt(.0329845436*c+.9293118715*u+.0361456387*h),v=Math.cbrt(.0482003018*c+.2643662691*u+.633851707*h),S=.2104542553*f+.793617785*p-.0040720468*v,g=1.9779984951*f-2.428592205*p+.4505937099*v,m=.0259040371*f+.7827717662*p-.808675766*v,x=Math.sqrt(g*g+m*m);let M=Math.atan2(m,g)*180/Math.PI;return M<0&&(M+=360),`oklch(${S.toFixed(3)} ${x.toFixed(3)} ${M.toFixed(1)})`},ZA="external";function $A(n,e){return`${ZA}:${n}:${e}`}function JA(n){const{scopeKey:e,inputId:t}=n;if(!e||!t||typeof sessionStorage>"u")return;const i=sessionStorage.getItem($A(e,t));if(i!==null)try{return JSON.parse(i)}catch{return}}function*QA(n){const e=n.layout.type==="tabbed"?n.layout.tabs.flatMap(t=>t.groups):n.layout.groups;for(const t of e)for(const i of t.items)yield i}function eR(n){const e=[];for(const t of QA(n))t.type!=="input"||t.source?.kind!=="external"||e.push({paramId:t.paramId,displayName:t.displayName??t.paramId});return e}var tR=Z('<div class="min-h-100 p-8 flex items-center justify-center"><!></div>'),nR=Z('<div class="min-h-100 flex items-center justify-center"><!></div>'),iR=Z("<div><!></div>");function rR(n,e){nt(e,!0);let t=me(e,"definitionKey",3,""),i=me(e,"showModeToggle",3,!1),r=me(e,"panelActions",19,()=>[]),s=me(e,"showSaveButton",3,!0),a=me(e,"showLoadButton",3,!0),o=me(e,"footerItemId",3,"footer-item"),l=me(e,"footerItemPriority",3,0);const c=z(()=>e.externalScopeKey||t()||e.schema?.id||"");function u(ye,ve){const K=new Set(eR(ye).map(Y=>Y.paramId)),fe={};for(const Y of ye.inputs){if(K.has(Y.id)){const oe=JA({scopeKey:ve,inputId:Y.id});oe!==void 0&&(fe[Y.id]=oe);continue}fe[Y.id]=Y.default??WA(Y.paramType)}for(const Y of ye.outputs)fe[Y.id]=null;return fe}let h=we($n(u(e.schema,e.externalScopeKey||t()||e.schema?.id||""))),f=we(""),p=we($n([])),v=we($n([])),S=we($n([])),g=we($n({})),m=we(e.schema?.instanceSolve===!1),x=we(e.schema?.instanceSolve===!1),M=we(!1);async function T(ye,ve){try{O(f,""),O(p,[],!0),O(v,[],!0);const K=await e.onSolve(ye,ve);if(ve.aborted)return;O(p,K.errors??[],!0),O(v,K.warnings??[],!0),O(S,K.meshes??[],!0),Object.assign(d(h),K.outputs),O(g,{},!0),O(m,!1),O(x,!1)}catch(K){if(K instanceof Error&&K.name==="AbortError")return;O(f,K instanceof Error?K.message:String(K),!0)}}const C=YA(T,{timeout:e.solveTimeoutMs});let y=z(()=>C.isComputing);const I=jA(()=>d(y));function _(){C.trigger(Gl(d(h)))}function E(ye){Object.assign(d(h),ye),e.schema?.instanceSolve!==!1?_():O(m,!0)}Rt(()=>{e.onReady?.({loadValues:E})});let L=we(""),P=we(!0);Rt(()=>{t(),nn(()=>{d(P)?(O(P,!1),O(L,t()),e.schema?.instanceSolve!==!1&&_()):d(L)!==t()&&(O(S,[],!0),O(h,u(e.schema,d(c)),!0),O(f,""),O(p,[],!0),O(v,[],!0),e.schema&&Object.keys(d(h)).length>0&&_(),O(L,t()))})});async function k(ye,ve){if(d(h)[ye]=ve,e.schema?.instanceSolve===!1){d(g)[ye]=ve,O(m,!0);return}_()}function W(){_()}const H=nn(()=>o()),N=nn(()=>e.footerComponent),R=nn(()=>l());qA(H,N,()=>N?e.footerComponentProps?.()??{}:{},"left",R);let F=z(()=>e.isEmbedded??uu.url.searchParams.get("embed")==="true"),U=z(()=>e.primaryColor??uu.url.searchParams.get("primary")),X=z(()=>d(U)?`--primary: ${KA(d(U))}`:""),V=z(()=>e.title??(e.schema?.description||e.schema.name));var $=iR();let ee;var Se=Q($);{let ye=z(()=>!d(F));xp(Se,{mode:"fixed",get showHeader(){return d(ye)},showFooter:!0,get title(){return d(V)},get showModeToggle(){return i()},get rightContent(){return e.headerRight},get errors(){return d(p)},get warnings(){return d(v)},children:(ve,K)=>{var fe=Pe(),Y=ae(fe);{var oe=Ge=>{var Te=tR(),Ve=Q(Te);Fl(Ve,{type:"error",size:"medium",get message(){return d(f)}}),q(Te),D(Ge,Te)},Me=Ge=>{var Te=nR(),Ve=Q(Te);Fl(Ve,{type:"loading",size:"large",message:"Loading schema..."}),q(Te),D(Ge,Te)},Ee=Ge=>{var Te=Pe(),Ve=ae(Te);wp(Ve,t,Ae=>{{let Ce=z(()=>e.schema.instanceSolve!==!1&&I.show);GA(Ae,{get schema(){return e.schema},get meshes(){return d(S)},get isSolving(){return d(y)},get showSolvingIndicator(){return d(Ce)},get hasPendingChanges(){return d(m)},get hasNeverSolved(){return d(x)},get panelActions(){return r()},get showSaveButton(){return s()},get showLoadButton(){return a()},onValueChange:k,oncalculate:W,onLoadValues:()=>{e.schema?.instanceSolve!==!1?_():O(m,!0)},get isViewerFullscreen(){return d(M)},set isViewerFullscreen(Oe){O(M,Oe,!0)},get values(){return d(h)},set values(Oe){O(h,Oe,!0)}})}}),D(Ge,Te)};_e(Y,Ge=>{d(f)?Ge(oe):e.schema?Ge(Ee,-1):Ge(Me,1)})}D(ve,fe)},$$slots:{default:!0}})}q($),Le(()=>ee=hi($,d(X),ee,{display:"contents"})),D(n,$),it()}var sR=Z('<div class="text-muted-foreground flex items-center gap-1.5 text-xs"><!> <span> </span></div>');function aR(n,e){var t=Pe(),i=ae(t);{var r=s=>{var a=sR(),o=Q(a);vp(o,{class:"h-3 w-3"});var l=ue(o,2),c=Q(l,!0);q(l),q(a),Le(()=>Ze(c,e.label)),D(s,a)};_e(i,s=>{e.label&&s(r)})}D(n,t)}var oR=Z('<span class="bg-warning/15 text-warning rounded-full px-2.5 py-1 font-mono text-[11px] font-medium tracking-wide uppercase">Draft preview</span>'),lR=Z("<!> <!>",1);function QR(n,e){nt(e,!0);let t=0;const i=async(r,s)=>{const a=t-Date.now();if(a>0)throw new Error(`Rate limit reached. Try again in ${Math.ceil(a/1e3)}s.`);const o=await fetch("/api/compute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({inputs:e.data.schema.inputs,values:r,definitionUrl:e.data.ghDefinition,...e.data.channel==="draft"&&{channel:"draft"}}),signal:s});if(s.aborted)return{outputs:{}};if(!o.ok){if(o.status===503)throw new Error("Compute server is offline or unreachable. Please try again later.");if(o.status===429){const v=await o.json().catch(()=>({})),S=Number(o.headers.get("Retry-After"))||Number(v.retryAfter)||5;throw t=Date.now()+S*1e3,new Error(v.message||`Rate limit reached. Try again in ${S}s.`)}const p=await o.json().catch(()=>({}));throw new Error(p.message||"Compute error")}const l=await o.json();if(s.aborted)return{outputs:{}};const c=new dT(l,!1),h=e.data.schema.viewerOptions?.enableLocal||e.data.schema.viewerOptions?.enableRemote?await c.extractMeshesFromResponse():[],f={};for(const p of e.data.schema.outputs)f[p.id]=c.getValueByParamId(p.id,{parseValues:!0});return{outputs:f,meshes:h,errors:l.errors??[],warnings:l.warnings??[]}};{const r=a=>{var o=lR(),l=ae(o);{var c=h=>{var f=oR();D(h,f)};_e(l,h=>{e.data.channel==="draft"&&h(c)})}var u=ue(l,2);bp(u,{}),D(a,o)};let s=z(()=>e.data.schema?.description||e.data.schema.name);rR(n,{get schema(){return e.data.schema},onSolve:i,get definitionKey(){return e.data.currentDefinition},get title(){return d(s)},showModeToggle:!0,get solveTimeoutMs(){return e.data.solveTimeoutMs},get footerComponent(){return aR},footerComponentProps:()=>({label:e.data.serverLabel}),headerRight:r,$$slots:{headerRight:!0}})}it()}const cR=Object.freeze(Object.defineProperty({__proto__:null,BINARY_MESH_MAGIC:Al,BINARY_MESH_VERSION:Rl,FLAG_FLOAT32:Lc,Materials:df,SCALE_FACTORS:mf,applyOffset:uf,computeCombinedBoundingBox:Ic,getThreeMeshesFromComputeResponse:Ry,initThree:of,parseBinaryMeshBatch:Nc,parseColor:cf,parseMeshBatch:hf,parseMeshBatchBlob:by,parseMeshBatchObject:ff,updateScene:lf},Symbol.toStringTag,{value:"Module"}));export{QR as component};
|